|
| 1 | +# Contributing |
| 2 | + |
| 3 | +## Reporting a Bug |
| 4 | + |
| 5 | +Be sure to reproduce the issue on the latest master branch before filing a report. |
| 6 | +If you can still reproduce it, open a detailed issue with the steps needed to reproduce the bug. |
| 7 | +The goal of your description is to make it easy to fix the bug, not just find it. |
| 8 | + |
| 9 | +## Feature Requests |
| 10 | + |
| 11 | +We love new ideas. Open an issue explaining the feature in detail so we can understand exactly what you need. |
| 12 | + |
| 13 | +## Building the Project |
| 14 | + |
| 15 | +The build script is `build.fsx`, run with `dotnet fsi`. |
| 16 | + |
| 17 | +``` |
| 18 | +dotnet fsi build.fsx |
| 19 | +``` |
| 20 | + |
| 21 | + |
| 22 | +## Code Structure |
| 23 | + |
| 24 | +XrmTypeScript works by querying CRM for metadata and generating TypeScript declaration files from it. |
| 25 | +The entry point is `XrmTypeScript.fs`, which calls two functions: `retrieveRawState`, which fetches |
| 26 | +metadata from CRM, and `generateFromRaw`, which generates the declaration files from that metadata. |
| 27 | + |
| 28 | +The following describes the contents of each folder in the project. |
| 29 | + |
| 30 | +### Types |
| 31 | +Contains the static TypeScript declaration files that are copied directly to the output. |
| 32 | +The main file is `xrm.d.ts`, which provides the base `Xrm` namespace declarations based on `@types/xrm`. |
| 33 | + |
| 34 | +### TypeScript |
| 35 | +Contains helper methods and declarations used during the generation of TypeScript files. |
| 36 | + |
| 37 | +### Crm |
| 38 | +Contains helper methods for connecting to and querying CRM. |
| 39 | +`CrmAuth` handles authentication, `CrmBaseHelper` handles querying, and `CrmDataHelper` extends `CrmBaseHelper`. |
| 40 | + |
| 41 | +### Interpretation |
| 42 | +Contains interpreters that translate raw CRM metadata into an intermediate representation used by the rest of the program. |
| 43 | + |
| 44 | +### CreateTypeScript |
| 45 | +Contains functions that translate the intermediate representation into TypeScript declaration file content. |
| 46 | + |
| 47 | +### Generation |
| 48 | +Orchestrates the overall generation process — retrieving metadata, interpreting it, and writing the output files. |
| 49 | + |
| 50 | +### CommandLine |
| 51 | +Contains the functions necessary to handle command-line arguments. |
0 commit comments