@khester/create-dynamics-app 2.6.5 → 2.6.6
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/LICENSE +21 -0
- package/README.md +26 -2
- package/package.json +3 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 khester
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -38,6 +38,9 @@ npm run metadata:pull -- --entities account,contact # live metadata → typed s
|
|
|
38
38
|
| id | What it scaffolds | Fluent |
|
|
39
39
|
|----|-------------------|--------|
|
|
40
40
|
| `react-custom-page` | React SPA for a model-driven custom page | v8 |
|
|
41
|
+
| `host-swap` | **One component, three hosts** — one host-agnostic `Component.tsx` (coded against an injected `IApiService`) + a thin per-host wrapper; pick PCF, a custom page, or a web resource with `--host` (see below) | v8 |
|
|
42
|
+
| `grid-starter` | React custom page rendering a grid-kit `<DataGrid>` over a cell-renderer registry | v8 |
|
|
43
|
+
| `starter-page` | Dynamics page built on a selectable `@dataverse-kit/surface-kit` surface (`--surface`) | v8 |
|
|
41
44
|
| `power-pages` | Power Pages portal starter | v8 |
|
|
42
45
|
| `pcf-field` | PCF field control (property-type aware: text/number/boolean/date) | v8 |
|
|
43
46
|
| `pcf-dataset` | PCF dataset/grid control — grid-kit `<ReadOnlyGrid>` (sort/filter/columns/search), **model-driven, React 18** | v8 |
|
|
@@ -49,13 +52,33 @@ npm run metadata:pull -- --entities account,contact # live metadata → typed s
|
|
|
49
52
|
|
|
50
53
|
Run with no flags for an interactive picker.
|
|
51
54
|
|
|
55
|
+
### Host-swap — write once, switch host
|
|
56
|
+
|
|
57
|
+
The `host-swap` artifact is the host-portability story: you write **one** `src/Component.tsx`
|
|
58
|
+
against the injected `IApiService` data-access seam, and a thin per-host wrapper supplies the
|
|
59
|
+
service and mounts it. The component source never changes — only the wrapper does. Pick the
|
|
60
|
+
host with `--host`:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npx @khester/create-dynamics-app my-control --artifact host-swap --host pcf
|
|
64
|
+
# --host custom-page → Vite app mounted as a Dynamics custom page (ServiceFactory ladder)
|
|
65
|
+
# --host pcf → pcf-scripts virtual ReactControl (same-origin FetchApiService, React 18)
|
|
66
|
+
# --host web-resource → webpack-bundled web resource (same-origin FetchApiService)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Each host builds the **same** component under its own toolchain (Vite / pcf-scripts / webpack);
|
|
70
|
+
all three are exercised by CI build gates. To retarget, scaffold with another `--host` and copy
|
|
71
|
+
your `src/Component.tsx` across.
|
|
72
|
+
|
|
52
73
|
## Flags
|
|
53
74
|
|
|
54
75
|
- `-a, --artifact <id>` — artifact to scaffold (see table).
|
|
55
76
|
- `--v8` / `--v9` (or `-l, --library fluent-v8|fluent-v9`) — Fluent version for artifacts that support a choice. Only the chosen library is installed.
|
|
56
77
|
- `-n, --namespace`, `--component-name`, `--property-type` — PCF options.
|
|
78
|
+
- `--host <custom-page|pcf|web-resource>` — host target for the `host-swap` artifact (default `custom-page`).
|
|
79
|
+
- `--surface <form|panel|dashboard|master-detail>` — surface for the `starter-page` artifact.
|
|
57
80
|
- `--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.
|
|
81
|
+
- `--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. Opt-in for the v8 React hosts that don't already bundle it — `power-pages`, `web-resource`, `dialog-form` (`react-custom-page`, `grid-starter`, and `host-swap` ship it as a base dependency already); warned-and-ignored elsewhere; **errors** if combined with `--v9`.
|
|
59
82
|
- `--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
83
|
- `--skip-git`, `--skip-install`.
|
|
61
84
|
|
|
@@ -69,6 +92,7 @@ See `CHANGELOG.md`. In short: removed the consulting flags (`-c/-e/-p/-d/--gener
|
|
|
69
92
|
|
|
70
93
|
## Testing & coverage boundaries
|
|
71
94
|
|
|
72
|
-
- Unit + smoke tests (`npm test`) run the scaffold pipeline for all
|
|
95
|
+
- Unit + smoke tests (`npm test`) run the scaffold pipeline for all 12 artifacts (zero-residual-token + variant/prune checks) but do **not** `npm install` or build the generated projects, except the build gates below.
|
|
96
|
+
- Build gates (`npm run test:e2e`) scaffold + `npm install` + build the React custom-page templates (Vite), the PCF templates (`pcf-scripts`), and **all three `host-swap` hosts** (custom-page → Vite, pcf → pcf-scripts, web-resource → webpack) — the host-swap gates prove one `Component.tsx` builds under every host toolchain.
|
|
73
97
|
- 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
98
|
- The `--from-design` generated-project build is verified manually.
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khester/create-dynamics-app",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.6",
|
|
4
|
+
"license": "MIT",
|
|
4
5
|
"description": "Unified CLI to scaffold Dynamics 365 / Power Platform artifacts",
|
|
5
6
|
"main": "dist/index.js",
|
|
6
7
|
"type": "module",
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
"clean": "rimraf dist tsconfig.tsbuildinfo"
|
|
26
27
|
},
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@dataverse-kit/export-engine": "^1.25.
|
|
29
|
+
"@dataverse-kit/export-engine": "^1.25.2",
|
|
29
30
|
"@khester/dynamics-ui-components": "^1.0.0",
|
|
30
31
|
"chalk": "^5.3.0",
|
|
31
32
|
"commander": "^11.1.0",
|