create-ec-app 1.7.0 → 1.9.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.
Files changed (104) hide show
  1. package/README.md +72 -17
  2. package/dist/cssScope.js +3 -5
  3. package/dist/cssScope.js.map +1 -1
  4. package/dist/index.d.ts +46 -1
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +129 -53
  7. package/dist/index.js.map +1 -1
  8. package/dist/libFunctions.d.ts +13 -6
  9. package/dist/libFunctions.d.ts.map +1 -1
  10. package/dist/libFunctions.js +24 -9
  11. package/dist/libFunctions.js.map +1 -1
  12. package/dist/pcf.d.ts.map +1 -1
  13. package/dist/pcf.js +4 -1
  14. package/dist/pcf.js.map +1 -1
  15. package/dist/portalContainers.js +7 -5
  16. package/dist/portalContainers.js.map +1 -1
  17. package/package.json +18 -11
  18. package/scripts/build-generated.mjs +59 -0
  19. package/scripts/refresh-shadcn-template.ts +406 -0
  20. package/scripts/smoke-scaffold.mjs +245 -0
  21. package/templates/base/eslint.config.js +1 -1
  22. package/templates/base/package-lock.json +380 -476
  23. package/templates/base/package.json +14 -19
  24. package/templates/pcf/base/package-lock.json +35 -53
  25. package/templates/targets/code-apps/AGENTS.md +187 -0
  26. package/templates/targets/code-apps/CLAUDE.md +1 -0
  27. package/templates/targets/code-apps/package.patch.json +1 -1
  28. package/templates/targets/power-pages/AGENTS.md +192 -0
  29. package/templates/targets/power-pages/CLAUDE.md +1 -0
  30. package/templates/targets/power-pages/README.md +22 -2
  31. package/templates/targets/power-pages/src/App.patch.tsx +3 -1
  32. package/templates/targets/power-pages/src/components/shared/AuthError.tsx +18 -0
  33. package/templates/targets/power-pages/src/context/AuthContext.tsx +0 -4
  34. package/templates/targets/swa/AGENTS.md +181 -0
  35. package/templates/targets/swa/CLAUDE.md +1 -0
  36. package/templates/targets/webresource/AGENTS.md +179 -67
  37. package/templates/targets/webresource/CLAUDE.md +1 -0
  38. package/templates/targets/webresource/README.md +5 -5
  39. package/templates/ui/kendo/package.patch.json +2 -2
  40. package/templates/ui/shadcn-ui/SHADCN_TEMPLATE.md +20 -0
  41. package/templates/ui/shadcn-ui/package.patch.json +18 -9
  42. package/templates/ui/shadcn-ui/src/components/ui/accordion.tsx +79 -0
  43. package/templates/ui/shadcn-ui/src/components/ui/alert-dialog.tsx +199 -0
  44. package/templates/ui/shadcn-ui/src/components/ui/alert.tsx +76 -0
  45. package/templates/ui/shadcn-ui/src/components/ui/aspect-ratio.tsx +11 -0
  46. package/templates/ui/shadcn-ui/src/components/ui/attachment.tsx +206 -0
  47. package/templates/ui/shadcn-ui/src/components/ui/avatar.tsx +110 -0
  48. package/templates/ui/shadcn-ui/src/components/ui/badge.tsx +49 -0
  49. package/templates/ui/shadcn-ui/src/components/ui/breadcrumb.tsx +122 -0
  50. package/templates/ui/shadcn-ui/src/components/ui/bubble.tsx +125 -0
  51. package/templates/ui/shadcn-ui/src/components/ui/button-group.tsx +83 -0
  52. package/templates/ui/shadcn-ui/src/components/ui/button.tsx +67 -0
  53. package/templates/ui/shadcn-ui/src/components/ui/calendar.tsx +222 -0
  54. package/templates/ui/shadcn-ui/src/components/ui/card.tsx +103 -0
  55. package/templates/ui/shadcn-ui/src/components/ui/carousel.tsx +240 -0
  56. package/templates/ui/shadcn-ui/src/components/ui/chart.tsx +373 -0
  57. package/templates/ui/shadcn-ui/src/components/ui/checkbox.tsx +31 -0
  58. package/templates/ui/shadcn-ui/src/components/ui/collapsible.tsx +33 -0
  59. package/templates/ui/shadcn-ui/src/components/ui/combobox.tsx +299 -0
  60. package/templates/ui/shadcn-ui/src/components/ui/command.tsx +195 -0
  61. package/templates/ui/shadcn-ui/src/components/ui/context-menu.tsx +264 -0
  62. package/templates/ui/shadcn-ui/src/components/ui/dialog.tsx +170 -0
  63. package/templates/ui/shadcn-ui/src/components/ui/direction.tsx +22 -0
  64. package/templates/ui/shadcn-ui/src/components/ui/drawer.tsx +134 -0
  65. package/templates/ui/shadcn-ui/src/components/ui/dropdown-menu.tsx +272 -0
  66. package/templates/ui/shadcn-ui/src/components/ui/empty.tsx +104 -0
  67. package/templates/ui/shadcn-ui/src/components/ui/field.tsx +236 -0
  68. package/templates/ui/shadcn-ui/src/components/ui/hover-card.tsx +44 -0
  69. package/templates/ui/shadcn-ui/src/components/ui/input-group.tsx +156 -0
  70. package/templates/ui/shadcn-ui/src/components/ui/input-otp.tsx +87 -0
  71. package/templates/ui/shadcn-ui/src/components/ui/input.tsx +19 -0
  72. package/templates/ui/shadcn-ui/src/components/ui/item.tsx +196 -0
  73. package/templates/ui/shadcn-ui/src/components/ui/kbd.tsx +26 -0
  74. package/templates/ui/shadcn-ui/src/components/ui/label.tsx +22 -0
  75. package/templates/ui/shadcn-ui/src/components/ui/marker.tsx +69 -0
  76. package/templates/ui/shadcn-ui/src/components/ui/menubar.tsx +282 -0
  77. package/templates/ui/shadcn-ui/src/components/ui/message-scroller.tsx +129 -0
  78. package/templates/ui/shadcn-ui/src/components/ui/message.tsx +92 -0
  79. package/templates/ui/shadcn-ui/src/components/ui/native-select.tsx +61 -0
  80. package/templates/ui/shadcn-ui/src/components/ui/navigation-menu.tsx +164 -0
  81. package/templates/ui/shadcn-ui/src/components/ui/pagination.tsx +129 -0
  82. package/templates/ui/shadcn-ui/src/components/ui/popover.tsx +89 -0
  83. package/templates/ui/shadcn-ui/src/components/ui/progress.tsx +31 -0
  84. package/templates/ui/shadcn-ui/src/components/ui/radio-group.tsx +42 -0
  85. package/templates/ui/shadcn-ui/src/components/ui/resizable.tsx +50 -0
  86. package/templates/ui/shadcn-ui/src/components/ui/scroll-area.tsx +53 -0
  87. package/templates/ui/shadcn-ui/src/components/ui/select.tsx +194 -0
  88. package/templates/ui/shadcn-ui/src/components/ui/separator.tsx +26 -0
  89. package/templates/ui/shadcn-ui/src/components/ui/sheet.tsx +149 -0
  90. package/templates/ui/shadcn-ui/src/components/ui/sidebar.tsx +702 -0
  91. package/templates/ui/shadcn-ui/src/components/ui/skeleton.tsx +13 -0
  92. package/templates/ui/shadcn-ui/src/components/ui/slider.tsx +59 -0
  93. package/templates/ui/shadcn-ui/src/components/ui/sonner.tsx +47 -0
  94. package/templates/ui/shadcn-ui/src/components/ui/spinner.tsx +10 -0
  95. package/templates/ui/shadcn-ui/src/components/ui/switch.tsx +33 -0
  96. package/templates/ui/shadcn-ui/src/components/ui/table.tsx +114 -0
  97. package/templates/ui/shadcn-ui/src/components/ui/tabs.tsx +90 -0
  98. package/templates/ui/shadcn-ui/src/components/ui/textarea.tsx +18 -0
  99. package/templates/ui/shadcn-ui/src/components/ui/toggle-group.tsx +87 -0
  100. package/templates/ui/shadcn-ui/src/components/ui/toggle.tsx +45 -0
  101. package/templates/ui/shadcn-ui/src/components/ui/tooltip.tsx +59 -0
  102. package/templates/ui/shadcn-ui/src/index.patch.css +0 -118
  103. package/templates/ui/shadcn-ui/src/runtime/PortalContainer.ts +8 -0
  104. package/templates/base/biome.json +0 -54
@@ -8,36 +8,31 @@
8
8
  "build": "tsc -b && vite build",
9
9
  "build:dev": "tsc -b && vite build --mode development",
10
10
  "lint": "eslint .",
11
- "preview": "vite preview",
12
- "format": "biome format --write .",
13
- "lint:biome": "biome lint .",
14
- "check": "biome check --write --no-errors-on-unmatched .",
15
- "format:check": "biome format --check .",
16
- "lint:fix": "biome lint --apply ."
11
+ "preview": "vite preview"
17
12
  },
18
13
  "dependencies": {
19
- "@tailwindcss/vite": "^4.3.0",
20
- "tailwindcss": "^4.3.0",
21
- "@tanstack/react-query": "^5.100.14",
14
+ "@tailwindcss/vite": "^4.3.1",
15
+ "@tanstack/react-query": "^5.101.2",
22
16
  "@types/xrm": "^9.0.94",
23
17
  "react": "^19.2.7",
24
18
  "react-dom": "^19.2.7",
19
+ "tailwindcss": "^4.3.1",
25
20
  "zod": "^4.4.3",
26
21
  "zustand": "^5.0.14"
27
22
  },
28
23
  "devDependencies": {
29
24
  "@eslint/js": "^10.0.1",
30
- "@tanstack/eslint-plugin-query": "^5.100.14",
31
- "@types/node": "^24.12.4",
32
- "@types/react": "^19.2.16",
25
+ "@tanstack/eslint-plugin-query": "^5.101.2",
26
+ "@types/node": "^22.20.0",
27
+ "@types/react": "^19.2.17",
33
28
  "@types/react-dom": "^19.2.3",
34
- "@vitejs/plugin-react": "^6.0.2",
35
- "eslint": "^10.4.1",
29
+ "@vitejs/plugin-react": "^6.0.3",
30
+ "eslint": "^10.6.0",
36
31
  "eslint-plugin-react-hooks": "^7.1.1",
37
- "eslint-plugin-react-refresh": "^0.5.2",
38
- "globals": "^17.6.0",
39
- "typescript": "~6.0.3",
40
- "typescript-eslint": "^8.60.1",
41
- "vite": "^8.0.16"
32
+ "eslint-plugin-react-refresh": "^0.5.3",
33
+ "globals": "^17.7.0",
34
+ "typescript": "^6.0.3",
35
+ "typescript-eslint": "^8.62.0",
36
+ "vite": "^8.1.0"
42
37
  }
43
38
  }
@@ -124,9 +124,9 @@
124
124
  }
125
125
  },
126
126
  "node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/core": {
127
- "version": "2.7.1",
128
- "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.7.1.tgz",
129
- "integrity": "sha512-QAqIj32AtK6+pEVNG7EOVxHdE06RP+FM5qpiEJ4RtDcFIqKUZHYhl7/7UY5efhwmwNAg7j8QbJVBLxMerc0+gw==",
127
+ "version": "2.8.0",
128
+ "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.8.0.tgz",
129
+ "integrity": "sha512-hd1Lfh8p545nNz+jq1Ejfz+Mn1hyLuxYn1YzTfFNrxr8urEWMNQLPf1Th8kjOH+HxwawCrtgBp8JpBUR4ZSgww==",
130
130
  "dev": true,
131
131
  "license": "Apache-2.0",
132
132
  "dependencies": {
@@ -2277,14 +2277,14 @@
2277
2277
  }
2278
2278
  },
2279
2279
  "node_modules/@opentelemetry/sdk-trace-web": {
2280
- "version": "2.7.1",
2281
- "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-web/-/sdk-trace-web-2.7.1.tgz",
2282
- "integrity": "sha512-K806OouCSOjMd8Nr7+ZCq3QT22tdAzzS/7h8vprfiKjkgFQ99/dvwU8d12WJANA6D5Qtme65hyBAqAu9CkQuxQ==",
2280
+ "version": "2.8.0",
2281
+ "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-web/-/sdk-trace-web-2.8.0.tgz",
2282
+ "integrity": "sha512-P3ZM8BGJ5mwjtyfAxRyxsCyWHvaj+xahdhLoS3YiPsEyTHcWTVzx2691C8SrGkpvro3tNFCsWuNNrvM+spKODg==",
2283
2283
  "dev": true,
2284
2284
  "license": "Apache-2.0",
2285
2285
  "dependencies": {
2286
- "@opentelemetry/core": "2.7.1",
2287
- "@opentelemetry/sdk-trace-base": "2.7.1"
2286
+ "@opentelemetry/core": "2.8.0",
2287
+ "@opentelemetry/sdk-trace-base": "2.8.0"
2288
2288
  },
2289
2289
  "engines": {
2290
2290
  "node": "^18.19.0 || >=20.6.0"
@@ -2294,9 +2294,9 @@
2294
2294
  }
2295
2295
  },
2296
2296
  "node_modules/@opentelemetry/sdk-trace-web/node_modules/@opentelemetry/core": {
2297
- "version": "2.7.1",
2298
- "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.7.1.tgz",
2299
- "integrity": "sha512-QAqIj32AtK6+pEVNG7EOVxHdE06RP+FM5qpiEJ4RtDcFIqKUZHYhl7/7UY5efhwmwNAg7j8QbJVBLxMerc0+gw==",
2297
+ "version": "2.8.0",
2298
+ "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.8.0.tgz",
2299
+ "integrity": "sha512-hd1Lfh8p545nNz+jq1Ejfz+Mn1hyLuxYn1YzTfFNrxr8urEWMNQLPf1Th8kjOH+HxwawCrtgBp8JpBUR4ZSgww==",
2300
2300
  "dev": true,
2301
2301
  "license": "Apache-2.0",
2302
2302
  "dependencies": {
@@ -2310,13 +2310,13 @@
2310
2310
  }
2311
2311
  },
2312
2312
  "node_modules/@opentelemetry/sdk-trace-web/node_modules/@opentelemetry/resources": {
2313
- "version": "2.7.1",
2314
- "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.7.1.tgz",
2315
- "integrity": "sha512-DeT6KKolmC4e/dRQvMQ/RwlnzhaqeiFOXY5ngoOPJ07GgVVKxZOg9EcrNZb5aTzUn+iCrJldAgOfQm1O/QfPAQ==",
2313
+ "version": "2.8.0",
2314
+ "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.8.0.tgz",
2315
+ "integrity": "sha512-qmXQ27ilDbUK/vGMqwL8D4/rhn76C+sherM4wTbjlfknR8Nvfc/hCxjRJPhkzZzUsPiNg16SA31NxMabwttRjg==",
2316
2316
  "dev": true,
2317
2317
  "license": "Apache-2.0",
2318
2318
  "dependencies": {
2319
- "@opentelemetry/core": "2.7.1",
2319
+ "@opentelemetry/core": "2.8.0",
2320
2320
  "@opentelemetry/semantic-conventions": "^1.29.0"
2321
2321
  },
2322
2322
  "engines": {
@@ -2327,14 +2327,14 @@
2327
2327
  }
2328
2328
  },
2329
2329
  "node_modules/@opentelemetry/sdk-trace-web/node_modules/@opentelemetry/sdk-trace-base": {
2330
- "version": "2.7.1",
2331
- "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-2.7.1.tgz",
2332
- "integrity": "sha512-NAYIlsF8MPUsKqJMiDQJTMPOmlbawC1Iz/omMLygZ1C9am8fTKYjTaI+OZM+WTY3t3Glo0wnOg/6/pac6RGPPw==",
2330
+ "version": "2.8.0",
2331
+ "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-2.8.0.tgz",
2332
+ "integrity": "sha512-mhU4jp+vW0mGbFRd+GeXHvmfA4aDqWjBjLC3pE5XMpLs0IE2ryYb019Ts2AQrOq67gaTF25D91+fgvEHDZEnuQ==",
2333
2333
  "dev": true,
2334
2334
  "license": "Apache-2.0",
2335
2335
  "dependencies": {
2336
- "@opentelemetry/core": "2.7.1",
2337
- "@opentelemetry/resources": "2.7.1",
2336
+ "@opentelemetry/core": "2.8.0",
2337
+ "@opentelemetry/resources": "2.8.0",
2338
2338
  "@opentelemetry/semantic-conventions": "^1.29.0"
2339
2339
  },
2340
2340
  "engines": {
@@ -2483,9 +2483,6 @@
2483
2483
  "arm"
2484
2484
  ],
2485
2485
  "dev": true,
2486
- "libc": [
2487
- "glibc"
2488
- ],
2489
2486
  "license": "MIT",
2490
2487
  "optional": true,
2491
2488
  "os": [
@@ -2507,9 +2504,6 @@
2507
2504
  "arm"
2508
2505
  ],
2509
2506
  "dev": true,
2510
- "libc": [
2511
- "musl"
2512
- ],
2513
2507
  "license": "MIT",
2514
2508
  "optional": true,
2515
2509
  "os": [
@@ -2531,9 +2525,6 @@
2531
2525
  "arm64"
2532
2526
  ],
2533
2527
  "dev": true,
2534
- "libc": [
2535
- "glibc"
2536
- ],
2537
2528
  "license": "MIT",
2538
2529
  "optional": true,
2539
2530
  "os": [
@@ -2555,9 +2546,6 @@
2555
2546
  "arm64"
2556
2547
  ],
2557
2548
  "dev": true,
2558
- "libc": [
2559
- "musl"
2560
- ],
2561
2549
  "license": "MIT",
2562
2550
  "optional": true,
2563
2551
  "os": [
@@ -2579,9 +2567,6 @@
2579
2567
  "x64"
2580
2568
  ],
2581
2569
  "dev": true,
2582
- "libc": [
2583
- "glibc"
2584
- ],
2585
2570
  "license": "MIT",
2586
2571
  "optional": true,
2587
2572
  "os": [
@@ -2603,9 +2588,6 @@
2603
2588
  "x64"
2604
2589
  ],
2605
2590
  "dev": true,
2606
- "libc": [
2607
- "musl"
2608
- ],
2609
2591
  "license": "MIT",
2610
2592
  "optional": true,
2611
2593
  "os": [
@@ -4094,9 +4076,9 @@
4094
4076
  }
4095
4077
  },
4096
4078
  "node_modules/engine.io": {
4097
- "version": "6.6.8",
4098
- "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.8.tgz",
4099
- "integrity": "sha512-2agL3ueZhqxoVrfmntO8yuVj+uNSlIOnhykYHk3Cq0ShYPdUjjUiSJrQvXjq01I9jAuI0Zl2YO8Evv5Mqytm5g==",
4079
+ "version": "6.6.9",
4080
+ "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.9.tgz",
4081
+ "integrity": "sha512-clKkw4C7nJ22mGgoVcCg6V/W/TxdNyIOTr89k2ONZu81qqkddPFDF0LXcbAwhzPD8DjkiRCjzuiO6Y+fkpD4vg==",
4100
4082
  "dev": true,
4101
4083
  "license": "MIT",
4102
4084
  "dependencies": {
@@ -4109,23 +4091,23 @@
4109
4091
  "cors": "~2.8.5",
4110
4092
  "debug": "~4.4.1",
4111
4093
  "engine.io-parser": "~5.2.1",
4112
- "ws": "~8.20.1"
4094
+ "ws": "~8.21.0"
4113
4095
  },
4114
4096
  "engines": {
4115
4097
  "node": ">=10.2.0"
4116
4098
  }
4117
4099
  },
4118
4100
  "node_modules/engine.io-client": {
4119
- "version": "6.6.5",
4120
- "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.6.5.tgz",
4121
- "integrity": "sha512-QCwxUDULPlXv8F6tqMMKx5dNkTe6OaBYRMPYeXKBlyOoKvAmE0ac6pW7fFhSscJ/5SI7666/U/B+MElbsrJlIg==",
4101
+ "version": "6.6.6",
4102
+ "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.6.6.tgz",
4103
+ "integrity": "sha512-iY6QdftLQ9pyiPoX082bpf/u1UewnOaJrtJIF9T0++QB34lZrj0uP+Q/bj8AlUsAxqhnkTV2BS8SBZSxOmoV5Q==",
4122
4104
  "dev": true,
4123
4105
  "license": "MIT",
4124
4106
  "dependencies": {
4125
4107
  "@socket.io/component-emitter": "~3.1.0",
4126
4108
  "debug": "~4.4.1",
4127
4109
  "engine.io-parser": "~5.2.1",
4128
- "ws": "~8.20.1",
4110
+ "ws": "~8.21.0",
4129
4111
  "xmlhttprequest-ssl": "~2.1.1"
4130
4112
  }
4131
4113
  },
@@ -6439,14 +6421,14 @@
6439
6421
  }
6440
6422
  },
6441
6423
  "node_modules/socket.io-adapter": {
6442
- "version": "2.5.7",
6443
- "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.7.tgz",
6444
- "integrity": "sha512-e0LyK91f3cUxTmv95/KzoLg47+zF+s/sbxRGDNsyG4dmIP8ZSX8ax6byOxfJXeNNtS/8AZlfD+uP7gBeR7DLlg==",
6424
+ "version": "2.5.8",
6425
+ "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.8.tgz",
6426
+ "integrity": "sha512-6Oy52pbg+kvdCVvjcN+FnY7BvxZ7cIHNScbvztT/It5d0vbwoJoVZmF2gjJmnV0/4WlXRfG15zc45ySk9Ah8bw==",
6445
6427
  "dev": true,
6446
6428
  "license": "MIT",
6447
6429
  "dependencies": {
6448
6430
  "debug": "~4.4.1",
6449
- "ws": "~8.20.1"
6431
+ "ws": "~8.21.0"
6450
6432
  }
6451
6433
  },
6452
6434
  "node_modules/socket.io-client": {
@@ -7173,9 +7155,9 @@
7173
7155
  }
7174
7156
  },
7175
7157
  "node_modules/ws": {
7176
- "version": "8.20.1",
7177
- "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.1.tgz",
7178
- "integrity": "sha512-It4dO0K5v//JtTXuPkfEOaI3uUN87iYPnqo/ZzqCoG3g8uhA66QUMs/SrM0YK7/NAu+r4LMh/9dq2A7k+rHs+w==",
7158
+ "version": "8.21.0",
7159
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz",
7160
+ "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==",
7179
7161
  "dev": true,
7180
7162
  "license": "MIT",
7181
7163
  "engines": {
@@ -0,0 +1,187 @@
1
+ ## Purpose
2
+
3
+ This repository is a Power Apps code app using React, TypeScript, Vite, and the Power Apps code app SDK.
4
+
5
+ Treat it as a Power Apps-hosted code app, not a Dynamics web resource. Keep it small, readable, and easy to push with the Power Apps tooling.
6
+
7
+ Use the global AGENTS.md rules first. This file adds project-specific constraints.
8
+
9
+ ## Hard Constraints
10
+
11
+ - Keep Power Apps code app hosting working.
12
+ - Keep local Power Apps play support working.
13
+ - Keep generated connector and Dataverse service access working.
14
+ - Keep the app client-side.
15
+ - Make surgical changes.
16
+
17
+ Do not add Dynamics `Xrm`, `token.json`, Power Pages ADAL, Static Web Apps routing, or direct Dataverse Web API auth patterns unless the target changes.
18
+
19
+ ## Runtime Modes
20
+
21
+ The app supports two modes.
22
+
23
+ ### Power Apps-hosted
24
+
25
+ - The Power Apps host manages end-user authentication, app loading, and runtime context.
26
+ - Use `@microsoft/power-apps` APIs when app, environment, user, host, or query-parameter context is needed.
27
+ - Use generated models and services for Dataverse and connector access.
28
+ - Preserve `power.config.json` semantics after `npx power-apps init`.
29
+ - Do not assume model-driven app `window.Xrm` context exists.
30
+
31
+ ### Local dev
32
+
33
+ - Run Vite through `npm run dev`.
34
+ - Open the Local Play URL printed by the Power Apps Vite plugin.
35
+ - Use the same browser profile as the target Power Platform tenant.
36
+ - Run `npx power-apps init` before real push/data-source work.
37
+ - Treat `power.config.example.json` as documentation only; do not rename it to bypass initialization.
38
+
39
+ Do not mix this with webresource `AuthService.ts`, `token.json`, or Power Pages `AuthContext`.
40
+
41
+ ## Critical Files
42
+
43
+ | File | Rule |
44
+ |---|---|
45
+ | `vite.config.ts` | Preserve `powerApps()` plus React, Tailwind, and alias config. |
46
+ | `power.config.json` | Generated by `npx power-apps init`; environment-specific app metadata and data references live here. |
47
+ | `power.config.example.json` | Reference only. Do not make it the real config before initialization. |
48
+ | `src/generated/models/*` | Generated data-source models. Do not hand-edit unless the generator output is known wrong. |
49
+ | `src/generated/services/*` | Generated service methods for Dataverse/connectors/actions/functions. Prefer these over custom clients. |
50
+ | `src/main.tsx` | Preserve bootstrap, providers, and global theme/style imports. |
51
+
52
+ ## API and Data Access
53
+
54
+ Prefer generated Power Apps services.
55
+
56
+ Use:
57
+
58
+ - `npx power-apps add-data-source` for Dataverse and connector data sources
59
+ - `npx power-apps add-dataverse-api` for Dataverse actions/functions
60
+ - generated service methods from `src/generated/services`
61
+ - generated model types from `src/generated/models`
62
+ - `getContext` from `@microsoft/power-apps/app` when host context is needed
63
+ - narrow `select` options when generated Dataverse services support them
64
+ - clear errors when generated calls fail
65
+
66
+ Avoid:
67
+
68
+ - direct browser calls to Dataverse Web API
69
+ - copied webresource `getApiUrl()` / `getAuthHeaders()` helpers
70
+ - manually maintained connector clients
71
+ - wrapping every generated service in another generic service layer
72
+ - repository/client layers for small features
73
+ - Zod schemas for every generated response
74
+ - silent fallbacks for failed connector or Dataverse calls
75
+
76
+ For known data sources, use the generated service for that source. Add a new data source only when the current feature needs it.
77
+
78
+ ## Validation
79
+
80
+ Use generated TypeScript models for normal connector and Dataverse response shapes.
81
+
82
+ Use runtime validation only when the current feature needs it, such as:
83
+
84
+ - user-entered form data
85
+ - URL/query parameters that control behavior
86
+ - data sent to create/update/delete operations
87
+ - genuinely variable connector data where the UI must branch safely
88
+ - security-sensitive or data-loss-prone paths
89
+
90
+ Do not validate values just because they are shaped like GUIDs, logical names, dates, URLs, or enum strings. If the generated service or platform will reject the value clearly and there is no local UX/security need, pass it through.
91
+
92
+ Do not normalize strings by default. Trim, lowercase, strip braces, or reformat only when the app has a known input source that sends multiple formats.
93
+
94
+ ## Services, Queries, and Mutations
95
+
96
+ Keep service files explicit.
97
+
98
+ Preferred shape:
99
+
100
+ - call the generated service directly from a small domain service when naming the operation helps
101
+ - one TanStack Query hook when components need query state
102
+ - one mutation hook when mutation state or invalidation is needed
103
+ - query keys colocated with the hook when reused for invalidation
104
+
105
+ Do not create wrapper chains such as:
106
+
107
+ ```text
108
+ resolveConfig -> normalizeInput -> validateInput -> resolveGeneratedService -> buildRequest -> executeRequest
109
+ ```
110
+
111
+ Prefer direct flow:
112
+
113
+ ```text
114
+ call generated service -> check result/error -> return typed data
115
+ ```
116
+
117
+ ## State Management
118
+
119
+ - Use TanStack Query for server/connector state.
120
+ - Use local component state for local UI behavior.
121
+ - Use Zustand only for shared client state that has outgrown local state.
122
+ - Do not store server state in Zustand.
123
+ - Do not add Redux unless explicitly requested.
124
+
125
+ ## UI and Styling
126
+
127
+ Stay consistent with the project's existing UI system.
128
+
129
+ - Shadcn/ui projects: use existing `@/components/ui` components and Tailwind utilities.
130
+ - Kendo projects: use Kendo React components for rich controls and Tailwind for layout/composition.
131
+ - Preserve the existing theme and global CSS imports.
132
+ - Do not mix UI systems unless explicitly asked.
133
+ - Do not hand-roll custom CSS unless component props and Tailwind are not enough.
134
+ - Keep layouts compact, scannable, responsive, and suitable for Power Apps hosting.
135
+
136
+ ## Code Shape
137
+
138
+ Prefer:
139
+
140
+ - focused React components
141
+ - direct typed functions
142
+ - existing generated services and components
143
+ - small local helpers only when they remove real duplication or name non-obvious domain logic
144
+ - explicit connector/table/action handling over generic frameworks
145
+
146
+ Avoid:
147
+
148
+ - broad factories
149
+ - generic service clients
150
+ - classes for simple service logic
151
+ - excessive configuration
152
+ - defensive wrappers around every value
153
+ - broad refactors while adding a feature
154
+
155
+ ## Error Handling
156
+
157
+ Connector calls, Dataverse reads/saves/deletes, auth/context failures, uploads, downloads, and required parsing failures should throw.
158
+
159
+ Do not swallow failed generated service calls and treat them as empty data unless the requirement explicitly says the feature is best-effort.
160
+
161
+ Include useful operation context and platform error text where practical.
162
+
163
+ ## Build and Deployment
164
+
165
+ Do not replace Vite, remove `powerApps()`, add SSR, add Next.js, or change the app into a webresource/Power Pages/SWA deployment unless explicitly asked.
166
+
167
+ Use `npm run build` for production assets and `npx power-apps push` for the npm CLI path. Use PAC CLI only when a required option is not available through the npm CLI.
168
+
169
+ ## Checks
170
+
171
+ Run the smallest relevant command for the changed area, such as:
172
+
173
+ - typecheck
174
+ - lint
175
+ - targeted tests
176
+ - Vite build when deployment shape could be affected
177
+ - local Power Apps play smoke test when SDK/plugin/data-source behavior changes
178
+
179
+ Do not run broad expensive checks unless the change touches shared infrastructure or the project requires it.
180
+
181
+ ## Figma MCP
182
+
183
+ When using the Figma MCP server, ensure that you are not just blindly copying the designs. Take note and always place a focus on the following:
184
+
185
+ - Ensure responsiveness on all screen sizes
186
+ - If there are icons as part of the design, use those, don't blindly look for Lucide-React equivalents.
187
+ - Use the exact colours in the design. Don't make up your own.
@@ -0,0 +1 @@
1
+ @AGENTS.md
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "dependencies": {
3
- "@microsoft/power-apps": "^1.1.9"
3
+ "@microsoft/power-apps": "^1.2.2"
4
4
  },
5
5
  "devDependencies": {
6
6
  "@microsoft/power-apps-vite": "^1.0.2"
@@ -0,0 +1,192 @@
1
+ ## Purpose
2
+
3
+ This repository is a Power Pages single-page application using React, TypeScript, and Vite.
4
+
5
+ Treat it as a Power Pages code site. Keep it small, readable, and easy to upload to Power Pages.
6
+
7
+ Use the global AGENTS.md rules first. This file adds project-specific constraints.
8
+
9
+ ## Hard Constraints
10
+
11
+ - Keep Power Pages code-site deployment working.
12
+ - Keep Power Pages `_api` access working.
13
+ - Keep local Vite development working.
14
+ - Keep the app client-side.
15
+ - Make surgical changes.
16
+
17
+ Do not add Dynamics `Xrm`, `token.json`, Static Web Apps routing, or Power Apps code app SDK patterns unless the target changes.
18
+
19
+ ## Runtime Modes
20
+
21
+ The app supports two modes.
22
+
23
+ ### Power Pages-hosted
24
+
25
+ - Run as a browser SPA hosted by Power Pages.
26
+ - Use Power Pages `_api` for Dataverse access from the site.
27
+ - Rely on Power Pages web roles, table permissions, and site settings for data authorization.
28
+ - Preserve code-site build output and `powerpages.config.json`.
29
+ - Do not call the Dataverse organization Web API directly from the browser.
30
+ - Do not assume `window.Xrm` or model-driven app context exists.
31
+
32
+ ### Local dev
33
+
34
+ - Use Vite for local UI development.
35
+ - Use the existing Vite `/_api` proxy when local code needs to call a Power Pages site.
36
+ - Keep the proxy target explicit and environment-specific.
37
+ - Use the existing `AuthContext` flow only where this template already requires it.
38
+ - Never commit client secrets, tenant-specific secrets, or real token values.
39
+
40
+ Do not mix Power Pages auth with webresource `AuthService.ts` or `token.json`.
41
+
42
+ ## Critical Files
43
+
44
+ | File | Rule |
45
+ |---|---|
46
+ | `src/context/AuthContext.tsx` | Current auth boundary for this template. Reuse it; do not add a second auth system. |
47
+ | `src/main.tsx` | Preserve `AuthProvider`, `QueryClientProvider`, bootstrap, and global style imports. |
48
+ | `vite.config.ts` | Preserve React, Tailwind, alias, and the `/_api` dev proxy when API calls are used locally. |
49
+ | `powerpages.config.json` | Power Pages code-site configuration. Keep compiled path and landing page accurate. |
50
+ | `src/App.tsx` | Keep app behavior client-side and provider-aware. |
51
+
52
+ ## API and Data Access
53
+
54
+ Prefer direct, boring Power Pages Web API calls.
55
+
56
+ Use:
57
+
58
+ - relative `_api/...` URLs
59
+ - the existing auth context only where the current template flow already uses it
60
+ - Power Pages request verification/CSRF handling where the portal Web API requires it
61
+ - Power Pages table permissions and web roles for authorization
62
+ - narrow `$select` queries
63
+ - `URLSearchParams` for normal query parameters
64
+ - direct `fetch` inside service files
65
+ - small TypeScript interfaces for response shapes
66
+ - clear `response.ok` checks with useful status text
67
+
68
+ Avoid:
69
+
70
+ - direct calls to `https://<org>.crm*.dynamics.com/api/data/v9.2` from the browser
71
+ - duplicated auth contexts
72
+ - raw fetch calls inside UI components
73
+ - repository/client layers for small features
74
+ - generic OData builders
75
+ - Zod schemas for every Power Pages response
76
+ - GUID or logical-name regex validation by default
77
+ - silent fallbacks for failed Power Pages calls
78
+
79
+ For known tables, use known entity set names. Fetch metadata only when the feature truly supports arbitrary table names.
80
+
81
+ Escape OData string literals when interpolating inside quoted OData expressions. Do not create a broad escaping/parsing layer for simple queries.
82
+
83
+ ## Validation
84
+
85
+ Use TypeScript types for normal Power Pages Web API response shapes.
86
+
87
+ Use runtime validation only when the current feature needs it, such as:
88
+
89
+ - user-entered form data
90
+ - URL/search parameters that control behavior
91
+ - local config that can be wrong
92
+ - genuinely variable API data where the UI must branch safely
93
+ - security-sensitive or data-loss-prone paths
94
+
95
+ Do not validate values just because they are shaped like GUIDs, logical names, dates, URLs, or enum strings. If Power Pages or Dataverse will reject the value clearly and there is no local UX/security need, pass it through.
96
+
97
+ Do not normalize strings by default. Trim, lowercase, strip braces, or reformat only when the app has a known input source that sends multiple formats.
98
+
99
+ ## Services, Queries, and Mutations
100
+
101
+ Keep service files explicit.
102
+
103
+ Preferred shape:
104
+
105
+ - one fetch/save function for the operation
106
+ - one TanStack Query hook when components need it
107
+ - one mutation hook when mutation state or invalidation is needed
108
+ - query keys colocated with the hook when reused for invalidation
109
+
110
+ Do not create wrapper chains such as:
111
+
112
+ ```text
113
+ resolveConfig -> normalizeInput -> validateInput -> resolveMetadata -> buildRequest -> executeRequest
114
+ ```
115
+
116
+ Prefer direct flow:
117
+
118
+ ```text
119
+ read auth/context -> fetch -> check response -> return typed data
120
+ ```
121
+
122
+ ## State Management
123
+
124
+ - Use TanStack Query for server state.
125
+ - Use local component state for local UI behavior.
126
+ - Use Zustand only for shared client state that has outgrown local state.
127
+ - Do not store server state in Zustand.
128
+ - Do not add Redux unless explicitly requested.
129
+
130
+ ## UI and Styling
131
+
132
+ Stay consistent with the project's existing UI system.
133
+
134
+ - Shadcn/ui projects: use existing `@/components/ui` components and Tailwind utilities.
135
+ - Kendo projects: use Kendo React components for rich controls and Tailwind for layout/composition.
136
+ - Preserve the existing theme and global CSS imports.
137
+ - Do not mix UI systems unless explicitly asked.
138
+ - Do not hand-roll custom CSS unless component props and Tailwind are not enough.
139
+ - Keep layouts compact, scannable, responsive, and suitable for Power Pages.
140
+
141
+ ## Code Shape
142
+
143
+ Prefer:
144
+
145
+ - focused React components
146
+ - direct typed functions
147
+ - existing auth, services, and components
148
+ - small local helpers only when they remove real duplication or name non-obvious domain logic
149
+ - explicit Power Pages table/field handling over generic frameworks
150
+
151
+ Avoid:
152
+
153
+ - broad factories
154
+ - generic service clients
155
+ - classes for simple service logic
156
+ - excessive configuration
157
+ - defensive wrappers around every value
158
+ - broad refactors while adding a feature
159
+
160
+ ## Error Handling
161
+
162
+ Power Pages reads, saves, deletes, uploads, downloads, auth failures, and required parsing failures should throw.
163
+
164
+ Do not swallow failed fetches and treat them as "not found" unless the requirement explicitly says the feature is best-effort.
165
+
166
+ Include response status and useful response text where practical.
167
+
168
+ ## Build and Deployment
169
+
170
+ Do not replace Vite, add SSR, add Next.js, change the code-site output shape, or introduce backend coupling unless explicitly asked.
171
+
172
+ Keep output deployable through the Power Pages code-site flow and keep `powerpages.config.json` aligned with the built `dist` folder.
173
+
174
+ ## Checks
175
+
176
+ Run the smallest relevant command for the changed area, such as:
177
+
178
+ - typecheck
179
+ - lint
180
+ - targeted tests
181
+ - Vite build when deployment shape could be affected
182
+ - local `/_api` proxy smoke test when API routing changes
183
+
184
+ Do not run broad expensive checks unless the change touches shared infrastructure or the project requires it.
185
+
186
+ ## Figma MCP
187
+
188
+ When using the Figma MCP server, ensure that you are not just blindly copying the designs. Take note and always place a focus on the following:
189
+
190
+ - Ensure responsiveness on all screen sizes
191
+ - If there are icons as part of the design, use those, don't blindly look for Lucide-React equivalents.
192
+ - Use the exact colours in the design. Don't make up your own.
@@ -0,0 +1 @@
1
+ @AGENTS.md