Skip to content

Commit a4fdf97

Browse files
committed
Enhance contribution guidelines for DAX libraries by detailing package creation steps, mandatory files, and optional assets
1 parent 1ffc42c commit a4fdf97

1 file changed

Lines changed: 79 additions & 0 deletions

File tree

_mydocs/contribute/github-repo.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,82 @@ You don’t have to create a repository for your DAX library on daxlib.org, but
1313

1414
To create a GitHub repository for your DAX library, ensure you have a GitHub account; if not, create one. Then, follow the instructions at [https://github.com/daxlib/lib-quickstart-template](https://github.com/daxlib/lib-quickstart-template)
1515

16+
**TODO**
17+
18+
You can follow these steps to add a new package to DAX Lib:
19+
20+
1. **Create a name** for your package following the [naming conventions](naming-conventions.md) for both the name of the library and the package.
21+
22+
2. **Create the manifest** in `manifest.daxlib` file.
23+
24+
The `manifest.daxlib` is a mandatory file contains the package properties in JSON format. You can see the [DaxLib.Sample](https://daxlib.org/package/DaxLib.Sample/#code) package for an example and refer to the [JSON schema](https://github.com/daxlib/daxlib/blob/main/schemas/manifest/1.0.0/manifest.1.0.0.schema.json) for the complete specification of available properties.
25+
26+
The manifest file should be located in the root folder of the library:
27+
28+
```bash
29+
/manifest.daxlib
30+
```
31+
32+
3. **Create the DAX user-defined functions** in `lib/functions.tmdl` and follow the [naming conventions](naming-conventions.md) for the function names.
33+
34+
The file `lib/functions.tmdl` is a mandatory file and contains the source code of the DAX user-defined functions using the TMDL syntax. For an example, see the [DaxLib.Sample](https://daxlib.org/package/DaxLib.Sample/#code) package.
35+
36+
**Remarks**:
37+
- The `functions.tmdl` file should contain only the function definitions without the `createOrReplace` command.
38+
- Optional: add comments describing the function and its parameters to improve readability and usability, as suggested in the [DAX naming convention](https://docs.sqlbi.com/dax-style/dax-naming-conventions#comments).
39+
- Each UDF must include the mandatory annotations: `DAXLIB_PackageId` and `DAXLIB_PackageVersion`.
40+
41+
Example: for a library named `Contoso.Conversion` with version `1.0.0` the annotations should be:
42+
43+
``` text
44+
annotation DAXLIB_PackageId = Contoso.Conversion
45+
annotation DAXLIB_PackageVersion = 1.0.0
46+
```
47+
48+
4. **(Optional) Add a custom icon for your library**
49+
50+
You can include a custom icon for your library by adding a PNG file inside the library's folder.
51+
52+
**Remarks**:
53+
- The icon file must be in PNG format (`.PNG`), with a maximum size of 100 KB.
54+
- Place the icon file at:
55+
56+
```bash
57+
/icon.png
58+
```
59+
60+
If you include a library icon, you must also update the `manifest.daxlib` to specify the file path.
61+
62+
```json
63+
{
64+
// ...other manifest properties...
65+
"icon": "/icon.png"
66+
}
67+
```
68+
69+
5. **(Optional) Add a README file**
70+
71+
You can include a README file to provide documentation for your library. It can include general information about the library, usage instructions, examples, and any notes for users.
72+
73+
**Remarks**:
74+
- The file must be in Markdown format (`.MD`), with a maximum size of 100 KB.
75+
- For security reasons, only a limited set of Markdown features are supported, and external links may be restricted to trusted domains.
76+
77+
Place the README file at:
78+
79+
```bash
80+
/README.md
81+
```
82+
83+
If you include a README file, you must also update the `manifest.daxlib` to specify the file path.
84+
85+
```json
86+
{
87+
// ...other manifest properties...
88+
"readme": "/README.md"
89+
}
90+
```
91+
92+
6. **Create a pull request** to publish the library on [daxlib.org](https://daxlib.org/) following the instruction at [https://github.com/daxlib/lib-quickstart-template](https://github.com/daxlib/lib-quickstart-template?tab=readme-ov-file#-publish-your-library).
93+
- The pull request must be approved manually by DaxLib owners/maintainers.
94+
- When the pull request is approved, the package is immediately published.

0 commit comments

Comments
 (0)