@khester/create-dynamics-app 1.1.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -0
- package/dist/artifacts/registry.d.ts +18 -0
- package/dist/artifacts/registry.d.ts.map +1 -0
- package/dist/artifacts/registry.js +340 -0
- package/dist/artifacts/registry.js.map +1 -0
- package/dist/artifacts/types.d.ts +122 -0
- package/dist/artifacts/types.d.ts.map +1 -0
- package/dist/artifacts/types.js +7 -0
- package/dist/artifacts/types.js.map +1 -0
- package/dist/artifacts/validators.d.ts +16 -0
- package/dist/artifacts/validators.d.ts.map +1 -0
- package/dist/artifacts/validators.js +45 -0
- package/dist/artifacts/validators.js.map +1 -0
- package/dist/fromDesign.d.ts +5 -0
- package/dist/fromDesign.d.ts.map +1 -0
- package/dist/fromDesign.js +98 -0
- package/dist/fromDesign.js.map +1 -0
- package/dist/index.js +129 -177
- package/dist/index.js.map +1 -1
- package/dist/injectDevTools.d.ts +28 -0
- package/dist/injectDevTools.d.ts.map +1 -0
- package/dist/injectDevTools.js +148 -0
- package/dist/injectDevTools.js.map +1 -0
- package/dist/scaffold.d.ts +48 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +180 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/templatePlan.d.ts +3 -0
- package/dist/templatePlan.d.ts.map +1 -0
- package/dist/templatePlan.js +43 -0
- package/dist/templatePlan.js.map +1 -0
- package/dist/utils/copyTemplate.d.ts +13 -1
- package/dist/utils/copyTemplate.d.ts.map +1 -1
- package/dist/utils/copyTemplate.js +98 -4
- package/dist/utils/copyTemplate.js.map +1 -1
- package/dist/utils/updatePackageJson.d.ts +11 -1
- package/dist/utils/updatePackageJson.d.ts.map +1 -1
- package/dist/utils/updatePackageJson.js +12 -10
- package/dist/utils/updatePackageJson.js.map +1 -1
- package/package.json +10 -7
- package/templates/_shared/dev-tools/auth/get-token.js +72 -0
- package/templates/_shared/dev-tools/dev/mock-xrm.js +42 -0
- package/templates/_shared/dev-tools/metadata-sync/index.js +152 -0
- package/templates/_shared/dev-tools/smoke/test-retrieve.js +44 -0
- package/templates/dialog-form/README.md +27 -0
- package/templates/dialog-form/_variants/App.v8.tsx +39 -0
- package/templates/dialog-form/_variants/App.v9.tsx +41 -0
- package/templates/dialog-form/gitignore +5 -0
- package/templates/dialog-form/package.json +27 -0
- package/templates/dialog-form/public/index.html +11 -0
- package/templates/dialog-form/src/index.tsx +10 -0
- package/templates/dialog-form/src/services/dataverse.ts +30 -0
- package/templates/dialog-form/tsconfig.json +15 -0
- package/templates/dialog-form/webpack.config.js +17 -0
- package/templates/grid-customizer/README.md +28 -0
- package/templates/grid-customizer/gitignore +4 -0
- package/templates/grid-customizer/package.json +25 -0
- package/templates/grid-customizer/src/GridCustomizer.ts +28 -0
- package/templates/grid-customizer/src/cell-renderers.tsx +35 -0
- package/templates/grid-customizer/src/index.ts +4 -0
- package/templates/grid-customizer/src/types/grid-types.ts +30 -0
- package/templates/grid-customizer/src/utils/color-utils.ts +24 -0
- package/templates/grid-customizer/tsconfig.json +15 -0
- package/templates/grid-customizer/webpack.config.js +17 -0
- package/templates/pcf-dataset/ControlManifest.Input.xml +16 -0
- package/templates/pcf-dataset/README.md +21 -0
- package/templates/pcf-dataset/gitignore +5 -0
- package/templates/pcf-dataset/index.ts +39 -0
- package/templates/pcf-dataset/package.json +30 -0
- package/templates/pcf-dataset/strings/{{componentName}}.1033.resx +47 -0
- package/templates/pcf-dataset/tsconfig.json +8 -0
- package/templates/pcf-dataset/{{componentName}}Component.tsx +39 -0
- package/templates/pcf-field/ControlManifest.Input.xml +17 -0
- package/templates/pcf-field/README.md +95 -0
- package/templates/pcf-field/_variants/ValueInput.boolean.tsx +24 -0
- package/templates/pcf-field/_variants/ValueInput.date.tsx +27 -0
- package/templates/pcf-field/_variants/ValueInput.number.tsx +35 -0
- package/templates/pcf-field/_variants/ValueInput.text.tsx +27 -0
- package/templates/pcf-field/gitignore +5 -0
- package/templates/pcf-field/index.ts +61 -0
- package/templates/pcf-field/package.json +30 -0
- package/templates/pcf-field/strings/{{componentName}}.1033.resx +47 -0
- package/templates/pcf-field/tsconfig.json +8 -0
- package/templates/pcf-field/{{componentName}}Component.tsx +35 -0
- package/templates/power-pages-starter/gitignore +5 -0
- package/templates/react-custom-page/gitignore +5 -0
- package/templates/{dynamics-365-starter → react-custom-page}/package.json +3 -3
- package/templates/react-custom-page/tools/metadata-sync/index.js +152 -0
- package/templates/static-web-app/README.md +36 -0
- package/templates/static-web-app/_variants/App.v8.tsx +32 -0
- package/templates/static-web-app/_variants/App.v9.tsx +31 -0
- package/templates/static-web-app/api/host.json +12 -0
- package/templates/static-web-app/api/package.json +19 -0
- package/templates/static-web-app/api/src/functions/hello.ts +16 -0
- package/templates/static-web-app/api/tsconfig.json +14 -0
- package/templates/static-web-app/frontend/index.html +12 -0
- package/templates/static-web-app/frontend/package.json +23 -0
- package/templates/static-web-app/frontend/src/index.tsx +8 -0
- package/templates/static-web-app/frontend/tsconfig.json +16 -0
- package/templates/static-web-app/frontend/vite.config.ts +13 -0
- package/templates/static-web-app/gitignore +8 -0
- package/templates/static-web-app/package.json +15 -0
- package/templates/static-web-app/staticwebapp.config.json +7 -0
- package/templates/teams-app/README.md +27 -0
- package/templates/teams-app/_variants/graph.off.ts +7 -0
- package/templates/teams-app/_variants/graph.on.ts +22 -0
- package/templates/teams-app/appPackage/manifest.json +26 -0
- package/templates/teams-app/gitignore +5 -0
- package/templates/teams-app/index.html +12 -0
- package/templates/teams-app/package.json +26 -0
- package/templates/teams-app/src/App.tsx +25 -0
- package/templates/teams-app/src/index.tsx +8 -0
- package/templates/teams-app/tsconfig.json +16 -0
- package/templates/teams-app/vite.config.ts +9 -0
- package/templates/web-resource/README.md +39 -0
- package/templates/web-resource/_variants/App.v8.tsx +29 -0
- package/templates/web-resource/_variants/App.v9.tsx +28 -0
- package/templates/web-resource/gitignore +5 -0
- package/templates/web-resource/package.json +27 -0
- package/templates/web-resource/public/index.html +11 -0
- package/templates/web-resource/src/index.tsx +10 -0
- package/templates/web-resource/src/services/dataverse.ts +30 -0
- package/templates/web-resource/tsconfig.json +15 -0
- package/templates/web-resource/webpack.config.js +17 -0
- package/dist/utils/consultingHelpers.d.ts +0 -13
- package/dist/utils/consultingHelpers.d.ts.map +0 -1
- package/dist/utils/consultingHelpers.js +0 -569
- package/dist/utils/consultingHelpers.js.map +0 -1
- package/templates/dynamics-365-starter/INTEGRATION_TEST_RESULTS.md +0 -302
- package/templates/dynamics-365-starter/PHASE_4_COMPLETION_SUMMARY.md +0 -305
- package/templates/dynamics-365-starter/deployment/QUICKSTART-MAC.md +0 -507
- package/templates/dynamics-365-starter/deployment/QUICKSTART-WINDOWS.md +0 -372
- package/templates/dynamics-365-starter/deployment/pipelines/README.md +0 -375
- package/templates/dynamics-365-starter/deployment/pipelines/azure-pipelines.yml +0 -330
- package/templates/dynamics-365-starter/deployment/pipelines/github-actions.yml +0 -422
- package/templates/dynamics-365-starter/deployment/pipelines/jenkins.groovy +0 -636
- package/templates/dynamics-365-starter/deployment/scripts/deploy.ps1 +0 -417
- package/templates/dynamics-365-starter/deployment/scripts/deploy.sh +0 -582
- package/templates/dynamics-365-starter/deployment/scripts/team-onboarding.ps1 +0 -486
- package/templates/dynamics-365-starter/deployment/scripts/team-onboarding.sh +0 -567
- package/templates/dynamics-365-starter/deployment/scripts/validate-setup.ps1 +0 -703
- package/templates/dynamics-365-starter/deployment/scripts/validate-setup.sh +0 -671
- package/templates/dynamics-365-starter/docs/team-standards/README.md +0 -273
- package/templates/dynamics-365-starter/docs/team-standards/client-onboarding.md +0 -577
- package/templates/dynamics-365-starter/docs/team-standards/code-review-checklist.md +0 -359
- package/templates/dynamics-365-starter/docs/team-standards/coding-standards.md +0 -700
- package/templates/dynamics-365-starter/docs/team-standards/cross-platform-team-guide.md +0 -736
- package/templates/dynamics-365-starter/docs/team-standards/development-workflows.md +0 -727
- package/templates/dynamics-365-starter/docs/troubleshooting/common-errors.md +0 -758
- package/templates/dynamics-365-starter/docs/troubleshooting/platform-specific-issues.md +0 -878
- package/templates/dynamics-365-starter/src/client-project-template/README.md +0 -234
- package/templates/dynamics-365-starter/src/client-project-template/config/client.template.json +0 -114
- package/templates/dynamics-365-starter/src/client-project-template/config/environments/template.json +0 -186
- package/templates/dynamics-365-starter/src/client-project-template/scripts/client-setup.js +0 -667
- package/templates/dynamics-365-starter/src/examples/README.md +0 -52
- package/templates/dynamics-365-starter/src/examples/component-examples/opportunity-management.tsx +0 -625
- package/templates/dynamics-365-starter/src/examples/entity-examples/opportunity-model.ts +0 -545
- package/templates/dynamics-365-starter/src/examples/integration-examples/custom-pcf-wrapper.tsx +0 -722
- package/templates/dynamics-365-starter/src/examples/workflow-examples/sales-workflow.ts +0 -662
- package/templates/dynamics-365-starter/src/page-templates/EntityDashboard.tsx +0 -519
- package/templates/dynamics-365-starter/src/page-templates/EntityDetailPage.tsx +0 -456
- package/templates/dynamics-365-starter/src/page-templates/EntityListPage.tsx +0 -406
- package/templates/dynamics-365-starter/src/page-templates/RelatedEntitiesPage.tsx +0 -578
- package/templates/dynamics-365-starter/src/page-templates/SearchPage.tsx +0 -629
- package/templates/dynamics-365-starter/tools/entity-generator/index.js +0 -168
- package/templates/dynamics-365-starter/tools/entity-generator/templates/constants.template.ts +0 -124
- package/templates/dynamics-365-starter/tools/entity-generator/templates/form.template.css +0 -283
- package/templates/dynamics-365-starter/tools/entity-generator/templates/form.template.tsx +0 -275
- package/templates/dynamics-365-starter/tools/entity-generator/templates/management.template.css +0 -204
- package/templates/dynamics-365-starter/tools/entity-generator/templates/management.template.tsx +0 -413
- package/templates/dynamics-365-starter/tools/entity-generator/templates/model.template.ts +0 -250
- package/templates/dynamics-365-starter/tools/metadata-sync/d365-client.js +0 -410
- package/templates/dynamics-365-starter/tools/metadata-sync/index.js +0 -512
- package/templates/dynamics-365-starter/tools/metadata-sync/type-generator.js +0 -675
- /package/templates/{dynamics-365-starter → react-custom-page}/README.md +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/deployment/README.md +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/docs/ARCHITECTURE_OVERVIEW.md +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/docs/BEST_PRACTICES.md +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/docs/MIGRATION_GUIDE.md +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/public/index.html +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/scripts/custom-build.js +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/AccountForm.css +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/AccountForm.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/AccountManagement.css +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/AccountManagement.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/ContactForm.css +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/ContactForm.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/ContactManagement.css +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/ContactManagement.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LogDialog.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LoggingContext.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LoggingDebugPanel.css +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LoggingDebugPanel.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LoggingProvider.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/logger.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/constants/account.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/constants/contact.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/index.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/models/Account.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/models/BaseEntity.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/models/Contact.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/pcf/ContactControlWrapper.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/pcf/MultiEntityControlWrapper.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/providers/DynamicsProvider.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/services/MockApiService.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/services/ServiceFactory.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/services/XrmApiService.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/styles/index.css +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/tsconfig.json +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/webpack.config.js +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# create-dynamics-app
|
|
2
|
+
|
|
3
|
+
Unified CLI to scaffold Dynamics 365 / Power Platform artifacts — one tool, per-artifact templates, a Fluent **v8/v9** choice, integrated dev-tools, and an optional **from-design** mode.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
create-dynamics-app <project-name> --artifact <id> [--v8|--v9]
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Quick start
|
|
10
|
+
|
|
11
|
+
**Prerequisite:** Node 20+ (`engines.node >= 20`). Every package is public on npm — no login, no auth, no private registry.
|
|
12
|
+
|
|
13
|
+
Scaffold a Dynamics **custom page** and run it (the scaffold step runs `npm install` for you):
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx @khester/create-dynamics-app my-custom-page --artifact react-custom-page --v8
|
|
17
|
+
cd my-custom-page
|
|
18
|
+
npm run dev # webpack dev server + mock Xrm — open in the browser
|
|
19
|
+
npm run build # production bundle → dist/ (deployable web resource)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
- Run with no flags (`npx @khester/create-dynamics-app my-custom-page`) for an interactive picker.
|
|
23
|
+
- Use `--v9` for Fluent UI v9 (default is v8 — the safe choice for Power Pages / Dynamics).
|
|
24
|
+
- Add `--with-components` to also install the [`@khester/reusable-components`](https://www.npmjs.com/package/@khester/reusable-components) Fluent v8 set (see Flags).
|
|
25
|
+
- Pin a version (`@khester/create-dynamics-app@2.1.0`) for reproducible builds.
|
|
26
|
+
|
|
27
|
+
### Connect to a live Dataverse org (optional)
|
|
28
|
+
|
|
29
|
+
The scaffold ships dev-tools that pull real metadata. Needs the Azure CLI (`az login` into the tenant) **or** `DYNAMICS_*` env vars:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm run auth:token # az → token written to .env (git-ignored)
|
|
33
|
+
npm run metadata:pull -- --entities account,contact # live metadata → typed src/constants + src/models
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Artifacts (`--artifact`)
|
|
37
|
+
|
|
38
|
+
| id | What it scaffolds | Fluent |
|
|
39
|
+
|----|-------------------|--------|
|
|
40
|
+
| `react-custom-page` | React SPA for a model-driven custom page | v8 |
|
|
41
|
+
| `power-pages` | Power Pages portal starter | v8 |
|
|
42
|
+
| `pcf-field` | PCF field control (property-type aware: text/number/boolean/date) | v8 |
|
|
43
|
+
| `pcf-dataset` | PCF dataset/grid control (DetailsList) | v8 |
|
|
44
|
+
| `grid-customizer` | Editable-grid cell-renderer customizer | v9 |
|
|
45
|
+
| `web-resource` | React web resource (webpack bundle) | **v8 or v9** |
|
|
46
|
+
| `dialog-form` | Single React form host (opened as a dialog) | **v8 or v9** |
|
|
47
|
+
| `static-web-app` | Azure SWA — React frontend + Functions `api/` | **v8 or v9** |
|
|
48
|
+
| `teams-app` | Teams tab (React + teams-js), optional Graph (`--graph`) | v9 |
|
|
49
|
+
|
|
50
|
+
Run with no flags for an interactive picker.
|
|
51
|
+
|
|
52
|
+
## Flags
|
|
53
|
+
|
|
54
|
+
- `-a, --artifact <id>` — artifact to scaffold (see table).
|
|
55
|
+
- `--v8` / `--v9` (or `-l, --library fluent-v8|fluent-v9`) — Fluent version for artifacts that support a choice. Only the chosen library is installed.
|
|
56
|
+
- `-n, --namespace`, `--component-name`, `--property-type` — PCF options.
|
|
57
|
+
- `--graph` — include Microsoft Graph (teams-app).
|
|
58
|
+
- `--with-components` — install [`@khester/reusable-components`](https://www.npmjs.com/package/@khester/reusable-components) (a curated Fluent **v8** React set: `ReusableCard`, `CustomSection`, `FileUploadField`, `SearchComponent`, `DetailsListComponent`, the localhost-gated `logger`, …) plus its `@fluentui/react` v8 peer. Honored for the v8 React hosts — `react-custom-page`, `power-pages`, `web-resource`, `dialog-form`; warned-and-ignored elsewhere; **errors** if combined with `--v9`.
|
|
59
|
+
- `--from-design <file>` — generate from a form-builder export (a `FormBuilderProject` JSON, e.g. from `/generate-form`). Wraps `@dataverse-kit/export-engine` to produce a deployable project (host + form code + a design-derived data layer). Supported targets: `web-resource`, `pcf`, `static-web-app`. From-design output is generated by the export engine and is structurally different from a blank starter (it ships its own token tooling); `package.json.dynamicsKit.artifact` records which.
|
|
60
|
+
- `--skip-git`, `--skip-install`.
|
|
61
|
+
|
|
62
|
+
## Dev-tools (in generated projects)
|
|
63
|
+
|
|
64
|
+
Blank starters get `package.json` scripts for: `auth:token` (Azure CLI → `.env`), `metadata:pull` (typed entities via dvgen), `smoke:live` (live-org retrieve), plus a mock-Xrm helper for local serve.
|
|
65
|
+
|
|
66
|
+
## Breaking changes in 2.0.0
|
|
67
|
+
|
|
68
|
+
See `CHANGELOG.md`. In short: removed the consulting flags (`-c/-e/-p/-d/--generate-sample`); `--template dynamics-365|pcf-control` are removed (use `--artifact react-custom-page` / `--artifact pcf-field`); `--template power-pages` still works as a deprecated alias.
|
|
69
|
+
|
|
70
|
+
## Testing & coverage boundaries
|
|
71
|
+
|
|
72
|
+
- Unit + smoke tests (`npm test`) run the scaffold pipeline for all 9 artifacts (zero-residual-token + variant/prune checks) but do **not** `npm install` or build the generated projects.
|
|
73
|
+
- React artifacts are verified to `tsc --noEmit` clean for v8 and v9 via manual installs; **PCF** type-correctness (against generated `ManifestTypes` from `pcf-scripts refreshTypes`) is verified manually, not in CI.
|
|
74
|
+
- The `--from-design` generated-project build is verified manually.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ArtifactDescriptor, TemplateFlagMigration } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The artifact registry. Phase 0 wires the three templates that exist today
|
|
4
|
+
* (`react-custom-page`, `power-pages`, `pcf-field`); the remaining artifacts
|
|
5
|
+
* are declared with `available: false` and their templates land in Phase A.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ARTIFACTS: ArtifactDescriptor[];
|
|
8
|
+
export declare function getArtifact(id: string): ArtifactDescriptor | undefined;
|
|
9
|
+
export declare function availableArtifacts(): ArtifactDescriptor[];
|
|
10
|
+
/**
|
|
11
|
+
* Legacy `--template <flag>` migration. `power-pages` is an honest passthrough
|
|
12
|
+
* (template unchanged). `dynamics-365` / `pcf-control` hard-deprecate: the old
|
|
13
|
+
* flows generated entity/page/deploy code (now removed) and PCF output changed,
|
|
14
|
+
* so silently remapping would break the published-CLI contract — we error out
|
|
15
|
+
* with migration guidance instead.
|
|
16
|
+
*/
|
|
17
|
+
export declare const TEMPLATE_FLAG_MIGRATIONS: Record<string, TemplateFlagMigration>;
|
|
18
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/artifacts/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAGlB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAoGpB;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,kBAAkB,EAwOzC,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAEtE;AAED,wBAAgB,kBAAkB,IAAI,kBAAkB,EAAE,CAEzD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAI1E,CAAC"}
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { validateComponentName, validateNamespace, toIdentifier } from './validators.js';
|
|
2
|
+
/**
|
|
3
|
+
* Fluent library dependency, added per the chosen componentLibrary so the
|
|
4
|
+
* generated project ships ONLY the version it uses (the v8/v9 choice is real,
|
|
5
|
+
* not cosmetic). The template base package.json carries neither Fluent package.
|
|
6
|
+
* `packagePath` targets the package.json that consumes Fluent (root, or an
|
|
7
|
+
* SWA's `frontend`).
|
|
8
|
+
*/
|
|
9
|
+
function fluentLibraryDeps(packagePath) {
|
|
10
|
+
return [
|
|
11
|
+
{
|
|
12
|
+
when: (vars) => vars.componentLibrary === 'fluent-v8',
|
|
13
|
+
dependencies: { '@fluentui/react': '^8.110.10' },
|
|
14
|
+
packagePath,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
when: (vars) => vars.componentLibrary === 'fluent-v9',
|
|
18
|
+
dependencies: { '@fluentui/react-components': '^9.46.2' },
|
|
19
|
+
packagePath,
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Opt-in reusable component library (`--with-components`). It is Fluent v8, so it
|
|
25
|
+
* also pins the v8 peer — `pickHigherRange` dedupes that against `fluentLibraryDeps`
|
|
26
|
+
* on artifacts that also offer the v8/v9 choice. Gated on `vars.withComponents`,
|
|
27
|
+
* which the driver sets only for `supportsComponents` artifacts on a v8 build.
|
|
28
|
+
*/
|
|
29
|
+
function reusableComponentsDeps(packagePath) {
|
|
30
|
+
return [
|
|
31
|
+
{
|
|
32
|
+
when: (vars) => vars.withComponents === 'true',
|
|
33
|
+
dependencies: {
|
|
34
|
+
'@khester/reusable-components': '^0.1.0',
|
|
35
|
+
'@fluentui/react': '^8.110.10',
|
|
36
|
+
},
|
|
37
|
+
packagePath,
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* PCF bound-property type → generated TypeScript value type, input-renderer variant,
|
|
43
|
+
* and the type-appropriate default used when reading `context.parameters.value.raw`.
|
|
44
|
+
*/
|
|
45
|
+
const PCF_TYPE_MAP = {
|
|
46
|
+
'SingleLine.Text': { tsType: 'string', renderKind: 'text', valueDefault: '""' },
|
|
47
|
+
'Whole.None': { tsType: 'number | null', renderKind: 'number', valueDefault: 'null' },
|
|
48
|
+
Decimal: { tsType: 'number | null', renderKind: 'number', valueDefault: 'null' },
|
|
49
|
+
OptionSet: { tsType: 'number | null', renderKind: 'number', valueDefault: 'null' },
|
|
50
|
+
TwoOptions: { tsType: 'boolean', renderKind: 'boolean', valueDefault: 'false' },
|
|
51
|
+
'DateAndTime.DateOnly': { tsType: 'Date | null', renderKind: 'date', valueDefault: 'null' },
|
|
52
|
+
};
|
|
53
|
+
/** Derive the common PCF naming vars (namespace / componentName / prefix). */
|
|
54
|
+
function derivePcfNaming(answers, { projectName }) {
|
|
55
|
+
const namespace = answers.namespace || 'DynamicsUIKit';
|
|
56
|
+
const componentName = answers.componentName || toIdentifier(projectName);
|
|
57
|
+
return { namespace, componentName, prefix: namespace.toLowerCase() };
|
|
58
|
+
}
|
|
59
|
+
/** PCF field control: naming + property-type family (tsType/renderKind/valueDefault). */
|
|
60
|
+
function derivePcfVars(answers, ctx) {
|
|
61
|
+
const propertyType = answers.propertyType || 'SingleLine.Text';
|
|
62
|
+
const family = PCF_TYPE_MAP[propertyType] ?? PCF_TYPE_MAP['SingleLine.Text'];
|
|
63
|
+
return {
|
|
64
|
+
...derivePcfNaming(answers, ctx),
|
|
65
|
+
propertyType,
|
|
66
|
+
tsType: family.tsType,
|
|
67
|
+
renderKind: family.renderKind,
|
|
68
|
+
valueDefault: family.valueDefault,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** Shared namespace/componentName prompts for PCF-family artifacts. */
|
|
72
|
+
const PCF_NAMING_PROMPTS = [
|
|
73
|
+
{
|
|
74
|
+
name: 'namespace',
|
|
75
|
+
message: 'Namespace for the PCF control:',
|
|
76
|
+
type: 'input',
|
|
77
|
+
default: 'DynamicsUIKit',
|
|
78
|
+
validate: validateNamespace,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'componentName',
|
|
82
|
+
message: 'Component name:',
|
|
83
|
+
type: 'input',
|
|
84
|
+
validate: validateComponentName,
|
|
85
|
+
},
|
|
86
|
+
];
|
|
87
|
+
/**
|
|
88
|
+
* The artifact registry. Phase 0 wires the three templates that exist today
|
|
89
|
+
* (`react-custom-page`, `power-pages`, `pcf-field`); the remaining artifacts
|
|
90
|
+
* are declared with `available: false` and their templates land in Phase A.
|
|
91
|
+
*/
|
|
92
|
+
export const ARTIFACTS = [
|
|
93
|
+
{
|
|
94
|
+
id: 'react-custom-page',
|
|
95
|
+
label: '⚡ React Custom Page — full React app mounted as a Dynamics 365 custom page',
|
|
96
|
+
description: 'Slim React SPA (models/services/components + dvgen dev-tools) for a model-driven app custom page.',
|
|
97
|
+
templateDir: 'react-custom-page',
|
|
98
|
+
supportsLibraryChoice: false,
|
|
99
|
+
supportsComponents: true,
|
|
100
|
+
// codegen is shipped in-template (tools/metadata-sync + metadata:* scripts), so only inject token.
|
|
101
|
+
devTools: ['token'],
|
|
102
|
+
prompts: [],
|
|
103
|
+
conditionalDeps: reusableComponentsDeps(),
|
|
104
|
+
exportTarget: 'static-web-app',
|
|
105
|
+
templateVersion: '2.0.0',
|
|
106
|
+
available: true,
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
id: 'power-pages',
|
|
110
|
+
label: '🌐 Power Pages — Power Pages portal starter',
|
|
111
|
+
description: 'Power Pages portal scaffold (ContactForm, providers, webpack).',
|
|
112
|
+
templateDir: 'power-pages-starter',
|
|
113
|
+
supportsLibraryChoice: false,
|
|
114
|
+
supportsComponents: true,
|
|
115
|
+
devTools: [],
|
|
116
|
+
prompts: [],
|
|
117
|
+
conditionalDeps: reusableComponentsDeps(),
|
|
118
|
+
templateVersion: '2.0.0',
|
|
119
|
+
available: true,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
id: 'pcf-field',
|
|
123
|
+
label: '🎛️ PCF Field Control — PowerApps Component Framework field control',
|
|
124
|
+
description: 'PCF field control (React + Fluent UI), built with pcf-scripts.',
|
|
125
|
+
templateDir: 'pcf-field',
|
|
126
|
+
supportsLibraryChoice: false,
|
|
127
|
+
devTools: [],
|
|
128
|
+
prompts: [
|
|
129
|
+
{
|
|
130
|
+
name: 'namespace',
|
|
131
|
+
message: 'Namespace for the PCF control:',
|
|
132
|
+
type: 'input',
|
|
133
|
+
default: 'DynamicsUIKit',
|
|
134
|
+
validate: validateNamespace,
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
// Default (= project name) is filled by the driver.
|
|
138
|
+
name: 'componentName',
|
|
139
|
+
message: 'Component name:',
|
|
140
|
+
type: 'input',
|
|
141
|
+
validate: validateComponentName,
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: 'propertyType',
|
|
145
|
+
message: 'Bound property type:',
|
|
146
|
+
type: 'list',
|
|
147
|
+
default: 'SingleLine.Text',
|
|
148
|
+
choices: [
|
|
149
|
+
{ name: 'Text (SingleLine.Text)', value: 'SingleLine.Text' },
|
|
150
|
+
{ name: 'Whole number (Whole.None)', value: 'Whole.None' },
|
|
151
|
+
{ name: 'Decimal (Decimal)', value: 'Decimal' },
|
|
152
|
+
{ name: 'Yes/No (TwoOptions)', value: 'TwoOptions' },
|
|
153
|
+
{ name: 'Option set (OptionSet)', value: 'OptionSet' },
|
|
154
|
+
{ name: 'Date (DateAndTime.DateOnly)', value: 'DateAndTime.DateOnly' },
|
|
155
|
+
],
|
|
156
|
+
validate: (v) => v in PCF_TYPE_MAP
|
|
157
|
+
? true
|
|
158
|
+
: `Unknown property type ${JSON.stringify(v)}. One of: ${Object.keys(PCF_TYPE_MAP).join(', ')}.`,
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
derive: derivePcfVars,
|
|
162
|
+
// Pick the input renderer matching the property type, then drop the variant set.
|
|
163
|
+
variants: [
|
|
164
|
+
{
|
|
165
|
+
choose: 'renderKind',
|
|
166
|
+
cases: {
|
|
167
|
+
text: '_variants/ValueInput.text.tsx',
|
|
168
|
+
number: '_variants/ValueInput.number.tsx',
|
|
169
|
+
boolean: '_variants/ValueInput.boolean.tsx',
|
|
170
|
+
date: '_variants/ValueInput.date.tsx',
|
|
171
|
+
},
|
|
172
|
+
to: 'ValueInput.tsx',
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
prune: ['_variants'],
|
|
176
|
+
exportTarget: 'pcf',
|
|
177
|
+
templateVersion: '2.0.0',
|
|
178
|
+
available: true,
|
|
179
|
+
},
|
|
180
|
+
// ----- Declared now, templates land in Phase A (not yet offered) -----
|
|
181
|
+
{
|
|
182
|
+
id: 'web-resource',
|
|
183
|
+
label: '📄 Web Resource — React (Fluent v8/v9) web resource',
|
|
184
|
+
description: 'Dynamics web resource: React + Fluent UI bundled to a single JS web resource.',
|
|
185
|
+
templateDir: 'web-resource',
|
|
186
|
+
supportsLibraryChoice: true,
|
|
187
|
+
supportsComponents: true,
|
|
188
|
+
defaultLibrary: 'fluent-v8',
|
|
189
|
+
devTools: ['token', 'serve', 'codegen'],
|
|
190
|
+
prompts: [],
|
|
191
|
+
// Select the Fluent v8 or v9 App shell based on the chosen component library.
|
|
192
|
+
variants: [
|
|
193
|
+
{
|
|
194
|
+
choose: 'componentLibrary',
|
|
195
|
+
cases: {
|
|
196
|
+
'fluent-v8': '_variants/App.v8.tsx',
|
|
197
|
+
'fluent-v9': '_variants/App.v9.tsx',
|
|
198
|
+
},
|
|
199
|
+
to: 'src/App.tsx',
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
prune: ['_variants'],
|
|
203
|
+
conditionalDeps: [...fluentLibraryDeps(), ...reusableComponentsDeps()],
|
|
204
|
+
exportTarget: 'web-resource',
|
|
205
|
+
templateVersion: '2.0.0',
|
|
206
|
+
available: true,
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
id: 'pcf-dataset',
|
|
210
|
+
label: '🗂️ PCF Dataset Control — grid/dataset PCF control (Fluent v8)',
|
|
211
|
+
description: 'PCF dataset control: binds a grid/view, renders records with a DetailsList.',
|
|
212
|
+
templateDir: 'pcf-dataset',
|
|
213
|
+
supportsLibraryChoice: false,
|
|
214
|
+
devTools: [],
|
|
215
|
+
prompts: PCF_NAMING_PROMPTS,
|
|
216
|
+
derive: derivePcfNaming,
|
|
217
|
+
exportTarget: 'pcf',
|
|
218
|
+
templateVersion: '2.0.0',
|
|
219
|
+
available: true,
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
id: 'grid-customizer',
|
|
223
|
+
label: '🧩 Grid Customizer — editable-grid cell renderers (Fluent v9)',
|
|
224
|
+
description: 'Editable-grid customizer: map column types/names to Fluent v9 cell renderers.',
|
|
225
|
+
templateDir: 'grid-customizer',
|
|
226
|
+
supportsLibraryChoice: false,
|
|
227
|
+
devTools: [],
|
|
228
|
+
prompts: PCF_NAMING_PROMPTS,
|
|
229
|
+
derive: derivePcfNaming,
|
|
230
|
+
// No exportTarget: grid customizers use a separate export-engine generator,
|
|
231
|
+
// not the previewExport from-design path.
|
|
232
|
+
templateVersion: '2.0.0',
|
|
233
|
+
available: true,
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
id: 'dialog-form',
|
|
237
|
+
label: '🪟 Dialog / Form — single React form (Fluent v8/v9) web-resource host',
|
|
238
|
+
description: 'Single-form host (opened as a dialog), React + Fluent UI. From-design capable.',
|
|
239
|
+
templateDir: 'dialog-form',
|
|
240
|
+
supportsLibraryChoice: true,
|
|
241
|
+
supportsComponents: true,
|
|
242
|
+
defaultLibrary: 'fluent-v8',
|
|
243
|
+
devTools: ['token', 'serve', 'codegen'],
|
|
244
|
+
prompts: [],
|
|
245
|
+
variants: [
|
|
246
|
+
{
|
|
247
|
+
choose: 'componentLibrary',
|
|
248
|
+
cases: {
|
|
249
|
+
'fluent-v8': '_variants/App.v8.tsx',
|
|
250
|
+
'fluent-v9': '_variants/App.v9.tsx',
|
|
251
|
+
},
|
|
252
|
+
to: 'src/App.tsx',
|
|
253
|
+
},
|
|
254
|
+
],
|
|
255
|
+
prune: ['_variants'],
|
|
256
|
+
conditionalDeps: [...fluentLibraryDeps(), ...reusableComponentsDeps()],
|
|
257
|
+
exportTarget: 'web-resource',
|
|
258
|
+
templateVersion: '2.0.0',
|
|
259
|
+
available: true,
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
id: 'teams-app',
|
|
263
|
+
label: '💬 Teams App — Teams tab (React, Fluent v9, optional Graph)',
|
|
264
|
+
description: 'Microsoft Teams tab: React + Fluent v9 + teams-js, with optional Graph integration.',
|
|
265
|
+
templateDir: 'teams-app',
|
|
266
|
+
supportsLibraryChoice: false,
|
|
267
|
+
devTools: ['token', 'serve'],
|
|
268
|
+
prompts: [
|
|
269
|
+
{
|
|
270
|
+
name: 'graph',
|
|
271
|
+
message: 'Include Microsoft Graph integration?',
|
|
272
|
+
type: 'confirm',
|
|
273
|
+
default: 'false',
|
|
274
|
+
},
|
|
275
|
+
],
|
|
276
|
+
// Map the Graph answer to a variant key for src/services/graph.ts.
|
|
277
|
+
derive: (answers) => ({ graphKind: answers.graph === 'true' ? 'on' : 'off' }),
|
|
278
|
+
variants: [
|
|
279
|
+
{
|
|
280
|
+
choose: 'graphKind',
|
|
281
|
+
cases: { on: '_variants/graph.on.ts', off: '_variants/graph.off.ts' },
|
|
282
|
+
to: 'src/services/graph.ts',
|
|
283
|
+
},
|
|
284
|
+
],
|
|
285
|
+
prune: ['_variants'],
|
|
286
|
+
// Graph client is added only when Graph integration is enabled.
|
|
287
|
+
conditionalDeps: [
|
|
288
|
+
{
|
|
289
|
+
when: (vars) => vars.graphKind === 'on',
|
|
290
|
+
dependencies: { '@microsoft/microsoft-graph-client': '^3.0.7' },
|
|
291
|
+
},
|
|
292
|
+
],
|
|
293
|
+
templateVersion: '2.0.0',
|
|
294
|
+
available: true,
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
id: 'static-web-app',
|
|
298
|
+
label: '☁️ Azure Static Web App — React frontend + managed Functions api/',
|
|
299
|
+
description: 'Azure SWA: React + Fluent UI (v8/v9) frontend with an Azure Functions api/.',
|
|
300
|
+
templateDir: 'static-web-app',
|
|
301
|
+
supportsLibraryChoice: true,
|
|
302
|
+
defaultLibrary: 'fluent-v9',
|
|
303
|
+
devTools: ['token', 'serve', 'codegen', 'smoke'],
|
|
304
|
+
prompts: [],
|
|
305
|
+
variants: [
|
|
306
|
+
{
|
|
307
|
+
choose: 'componentLibrary',
|
|
308
|
+
cases: {
|
|
309
|
+
'fluent-v8': '_variants/App.v8.tsx',
|
|
310
|
+
'fluent-v9': '_variants/App.v9.tsx',
|
|
311
|
+
},
|
|
312
|
+
to: 'frontend/src/App.tsx',
|
|
313
|
+
},
|
|
314
|
+
],
|
|
315
|
+
prune: ['_variants'],
|
|
316
|
+
conditionalDeps: fluentLibraryDeps('frontend'),
|
|
317
|
+
exportTarget: 'static-web-app',
|
|
318
|
+
templateVersion: '2.0.0',
|
|
319
|
+
available: true,
|
|
320
|
+
},
|
|
321
|
+
];
|
|
322
|
+
export function getArtifact(id) {
|
|
323
|
+
return ARTIFACTS.find((a) => a.id === id);
|
|
324
|
+
}
|
|
325
|
+
export function availableArtifacts() {
|
|
326
|
+
return ARTIFACTS.filter((a) => a.available);
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Legacy `--template <flag>` migration. `power-pages` is an honest passthrough
|
|
330
|
+
* (template unchanged). `dynamics-365` / `pcf-control` hard-deprecate: the old
|
|
331
|
+
* flows generated entity/page/deploy code (now removed) and PCF output changed,
|
|
332
|
+
* so silently remapping would break the published-CLI contract — we error out
|
|
333
|
+
* with migration guidance instead.
|
|
334
|
+
*/
|
|
335
|
+
export const TEMPLATE_FLAG_MIGRATIONS = {
|
|
336
|
+
'power-pages': { mode: 'passthrough', artifact: 'power-pages' },
|
|
337
|
+
'dynamics-365': { mode: 'hard-deprecate', artifact: 'react-custom-page' },
|
|
338
|
+
'pcf-control': { mode: 'hard-deprecate', artifact: 'pcf-field' },
|
|
339
|
+
};
|
|
340
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/artifacts/registry.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEzF;;;;;;GAMG;AACH,SAAS,iBAAiB,CAAC,WAAoB;IAC7C,OAAO;QACL;YACE,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,gBAAgB,KAAK,WAAW;YACrD,YAAY,EAAE,EAAE,iBAAiB,EAAE,WAAW,EAAE;YAChD,WAAW;SACZ;QACD;YACE,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,gBAAgB,KAAK,WAAW;YACrD,YAAY,EAAE,EAAE,4BAA4B,EAAE,SAAS,EAAE;YACzD,WAAW;SACZ;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAS,sBAAsB,CAAC,WAAoB;IAClD,OAAO;QACL;YACE,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,KAAK,MAAM;YAC9C,YAAY,EAAE;gBACZ,8BAA8B,EAAE,QAAQ;gBACxC,iBAAiB,EAAE,WAAW;aAC/B;YACD,WAAW;SACZ;KACF,CAAC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F,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,EAAU;IACpC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAA0C;IAC7E,aAAa,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE;IAC/D,cAAc,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,mBAAmB,EAAE;IACzE,aAAa,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,WAAW,EAAE;CACjE,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Artifact registry types. The registry replaces the old hard-coded
|
|
3
|
+
* three-template `if/else` in `index.ts` — every scaffoldable artifact is one
|
|
4
|
+
* `ArtifactDescriptor`, and the CLI is a thin driver over the registry.
|
|
5
|
+
*/
|
|
6
|
+
/** Fluent UI version the generated React output targets. */
|
|
7
|
+
export type ComponentLibrary = 'fluent-v8' | 'fluent-v9';
|
|
8
|
+
/**
|
|
9
|
+
* export-engine target an artifact maps to for the (Phase B) from-design path.
|
|
10
|
+
* Mirrors the export engine's own ExportTarget — grid-customizer is NOT a
|
|
11
|
+
* from-design target (it uses a separate generator), so it carries no exportTarget.
|
|
12
|
+
*/
|
|
13
|
+
export type ExportTarget = 'web-resource' | 'pcf' | 'static-web-app';
|
|
14
|
+
/** Dev-tools that `injectDevTools` (Phase A) can wire into a generated project. */
|
|
15
|
+
export type DevToolId = 'token' | 'serve' | 'codegen' | 'smoke';
|
|
16
|
+
/** The full set of artifact ids the unified CLI will produce. */
|
|
17
|
+
export type ArtifactId = 'react-custom-page' | 'power-pages' | 'pcf-field' | 'pcf-dataset' | 'grid-customizer' | 'web-resource' | 'dialog-form' | 'teams-app' | 'static-web-app';
|
|
18
|
+
/**
|
|
19
|
+
* A single interactive prompt for an artifact. The answer is written into the
|
|
20
|
+
* `{{name}}` substitution bag. `when` gates conditional prompts (e.g. a PCF
|
|
21
|
+
* property type only asked for field controls).
|
|
22
|
+
*/
|
|
23
|
+
export interface PromptSpec {
|
|
24
|
+
/** Substitution-variable key (also the inquirer answer name). */
|
|
25
|
+
name: string;
|
|
26
|
+
message: string;
|
|
27
|
+
type?: 'input' | 'list' | 'confirm';
|
|
28
|
+
default?: string;
|
|
29
|
+
choices?: Array<{
|
|
30
|
+
name: string;
|
|
31
|
+
value: string;
|
|
32
|
+
}>;
|
|
33
|
+
when?: (answers: Record<string, unknown>) => boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Validate the answer. Returns `true` if valid, or an error message string.
|
|
36
|
+
* Enforced for BOTH the interactive prompt AND values supplied via flags
|
|
37
|
+
* (flags bypass the prompt, so a prompt-only validator would be insufficient).
|
|
38
|
+
*/
|
|
39
|
+
validate?: (value: string) => true | string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Select one file from a variant set based on the value of a (usually derived)
|
|
43
|
+
* substitution variable, then copy it to `to`. Lets a single template express
|
|
44
|
+
* divergent file bodies (e.g. a PCF control's input renderer per property type)
|
|
45
|
+
* without a separate template per case. `from`/`to` are template-relative paths.
|
|
46
|
+
*/
|
|
47
|
+
export interface VariantSelect {
|
|
48
|
+
/** Substitution-variable name whose value picks the case (e.g. 'renderKind'). */
|
|
49
|
+
choose: string;
|
|
50
|
+
/** value → source path within the template (e.g. { number: '_variants/input.number.tsx' }). */
|
|
51
|
+
cases: Record<string, string>;
|
|
52
|
+
/** Destination path the chosen case is copied to (e.g. 'src/ValueInput.tsx'). */
|
|
53
|
+
to: string;
|
|
54
|
+
}
|
|
55
|
+
/** Conditionally add dependencies to a generated package.json (e.g. Teams Graph). */
|
|
56
|
+
export interface ConditionalDeps {
|
|
57
|
+
/** Predicate over the full substitution bag (answers + derived vars). */
|
|
58
|
+
when: (vars: Record<string, string>) => boolean;
|
|
59
|
+
dependencies?: Record<string, string>;
|
|
60
|
+
devDependencies?: Record<string, string>;
|
|
61
|
+
/** Project-relative directory of the target package.json (default: root). */
|
|
62
|
+
packagePath?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface ArtifactDescriptor {
|
|
65
|
+
id: ArtifactId;
|
|
66
|
+
/** Display label for the interactive picker. */
|
|
67
|
+
label: string;
|
|
68
|
+
description: string;
|
|
69
|
+
/** Literal directory name under `templates/` (no suffix heuristic). */
|
|
70
|
+
templateDir: string;
|
|
71
|
+
/** Whether this artifact prompts for fluent-v8 vs fluent-v9 output. */
|
|
72
|
+
supportsLibraryChoice: boolean;
|
|
73
|
+
defaultLibrary?: ComponentLibrary;
|
|
74
|
+
/**
|
|
75
|
+
* Whether `--with-components` applies — i.e. this artifact is a Fluent-v8 React
|
|
76
|
+
* host that can consume `@khester/reusable-components`. When false/absent the
|
|
77
|
+
* flag is warned-and-ignored. Independent of `supportsLibraryChoice`: a v8-only
|
|
78
|
+
* host (react-custom-page, power-pages) has no library choice but still accepts
|
|
79
|
+
* the components; a v8/v9 host (web-resource, dialog-form) accepts them only on
|
|
80
|
+
* a v8 build (the driver errors on `--with-components --v9`).
|
|
81
|
+
*/
|
|
82
|
+
supportsComponents?: boolean;
|
|
83
|
+
/** Dev-tools injected into the generated project (Phase A). */
|
|
84
|
+
devTools: DevToolId[];
|
|
85
|
+
/** Artifact-specific prompts → substitution variables. */
|
|
86
|
+
prompts: PromptSpec[];
|
|
87
|
+
/** export-engine target for the from-design path (Phase B); omitted = no from-design. */
|
|
88
|
+
exportTarget?: ExportTarget;
|
|
89
|
+
/**
|
|
90
|
+
* Derive additional substitution variables from the collected answers — the
|
|
91
|
+
* data-driven replacement for hard-coded per-id logic in the driver (e.g. a PCF
|
|
92
|
+
* control deriving `tsType`/`renderKind`/`prefix` from `propertyType`/`namespace`).
|
|
93
|
+
*/
|
|
94
|
+
derive?: (answers: Record<string, string>, ctx: {
|
|
95
|
+
projectName: string;
|
|
96
|
+
}) => Record<string, string>;
|
|
97
|
+
/** File-variant selections applied after copy (e.g. property-type-specific renderer). */
|
|
98
|
+
variants?: VariantSelect[];
|
|
99
|
+
/** Template-relative files/dirs to delete after variant selection (scaffolding leftovers). */
|
|
100
|
+
prune?: string[];
|
|
101
|
+
/** Conditional dependency additions (consumed by injectDevTools/updatePackageJson). */
|
|
102
|
+
conditionalDeps?: ConditionalDeps[];
|
|
103
|
+
/** Template schema version, stamped into the generated package.json provenance. */
|
|
104
|
+
templateVersion: string;
|
|
105
|
+
/**
|
|
106
|
+
* Whether a template directory exists yet. Artifacts whose templates land in
|
|
107
|
+
* Phase A are declared here (for the type union + planning) but not offered
|
|
108
|
+
* until `available` flips true.
|
|
109
|
+
*/
|
|
110
|
+
available: boolean;
|
|
111
|
+
}
|
|
112
|
+
/** How a legacy `--template <flag>` value migrates to the new artifact model. */
|
|
113
|
+
export interface TemplateFlagMigration {
|
|
114
|
+
/**
|
|
115
|
+
* `passthrough` — the artifact is unchanged, run it (e.g. power-pages).
|
|
116
|
+
* `hard-deprecate` — print a notice and exit non-zero; output differs, so we
|
|
117
|
+
* never silently remap (would violate the published-CLI contract).
|
|
118
|
+
*/
|
|
119
|
+
mode: 'passthrough' | 'hard-deprecate';
|
|
120
|
+
artifact: ArtifactId;
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/artifacts/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,4DAA4D;AAC5D,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,WAAW,CAAC;AAEzD;;;;GAIG;AACH,MAAM,MAAM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
|
1
|
+
/**
|
|
2
|
+
* Artifact registry types. The registry replaces the old hard-coded
|
|
3
|
+
* three-template `if/else` in `index.ts` — every scaffoldable artifact is one
|
|
4
|
+
* `ArtifactDescriptor`, and the CLI is a thin driver over the registry.
|
|
5
|
+
*/
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/artifacts/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input validators. User-supplied values (project name, PCF namespace /
|
|
3
|
+
* component name) are substituted raw into XML manifests, JSON, TypeScript
|
|
4
|
+
* identifiers, and filenames — so they must be format-checked before they enter
|
|
5
|
+
* the substitution bag, both from interactive prompts and from CLI flags.
|
|
6
|
+
*/
|
|
7
|
+
export declare function validateComponentName(value: string): true | string;
|
|
8
|
+
export declare function validateNamespace(value: string): true | string;
|
|
9
|
+
/**
|
|
10
|
+
* Coerce an arbitrary name (e.g. a hyphenated project name) into a valid PCF
|
|
11
|
+
* identifier — PascalCase, alphanumeric, starting with a letter. Used to derive
|
|
12
|
+
* a safe default `componentName` so we never offer an invalid PCF constructor.
|
|
13
|
+
*/
|
|
14
|
+
export declare function toIdentifier(value: string): string;
|
|
15
|
+
export declare function validateProjectName(value: string): true | string;
|
|
16
|
+
//# sourceMappingURL=validators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/artifacts/validators.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAIlE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAI9D;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOlD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAMhE"}
|