create-ec-app 1.8.0 → 1.10.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 +43 -1
  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 +43 -1
  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 +42 -0
  35. package/templates/targets/swa/CLAUDE.md +1 -0
  36. package/templates/targets/webresource/AGENTS.md +47 -4
  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": {
@@ -36,7 +36,7 @@ The app supports two modes.
36
36
  - Run `npx power-apps init` before real push/data-source work.
37
37
  - Treat `power.config.example.json` as documentation only; do not rename it to bypass initialization.
38
38
 
39
- Do not mix this with webresource `authService.ts`, `token.json`, or Power Pages `AuthContext`.
39
+ Do not mix this with webresource `AuthService.ts`, `token.json`, or Power Pages `AuthContext`.
40
40
 
41
41
  ## Critical Files
42
42
 
@@ -101,6 +101,7 @@ Preferred shape:
101
101
  - one TanStack Query hook when components need query state
102
102
  - one mutation hook when mutation state or invalidation is needed
103
103
  - query keys colocated with the hook when reused for invalidation
104
+ - UI that consumes async data should handle loading, error, empty, and success states when each state affects the workflow
104
105
 
105
106
  Do not create wrapper chains such as:
106
107
 
@@ -133,6 +134,13 @@ Stay consistent with the project's existing UI system.
133
134
  - Do not hand-roll custom CSS unless component props and Tailwind are not enough.
134
135
  - Keep layouts compact, scannable, responsive, and suitable for Power Apps hosting.
135
136
 
137
+ ## Accessibility
138
+
139
+ - Use semantic HTML.
140
+ - Use buttons for actions and links for navigation.
141
+ - Keep input labels, accessible names, dialog titles, and keyboard support intact.
142
+ - Do not remove shadcn/Radix or Kendo accessibility behavior while restyling.
143
+
136
144
  ## Code Shape
137
145
 
138
146
  Prefer:
@@ -142,6 +150,7 @@ Prefer:
142
150
  - existing generated services and components
143
151
  - small local helpers only when they remove real duplication or name non-obvious domain logic
144
152
  - explicit connector/table/action handling over generic frameworks
153
+ - feature folders only when a feature owns multiple pieces such as API, hooks, components, types, or schemas
145
154
 
146
155
  Avoid:
147
156
 
@@ -151,6 +160,39 @@ Avoid:
151
160
  - excessive configuration
152
161
  - defensive wrappers around every value
153
162
  - broad refactors while adding a feature
163
+ - moving code into shared `common` or `lib` before there is a second caller
164
+
165
+ ## Feature and Routing Shape
166
+
167
+ Keep small apps flat. Use feature folders when a feature owns enough surface area to group its page, UI, data access, hooks, and types.
168
+
169
+ Example:
170
+
171
+ ```text
172
+ src/
173
+ features/
174
+ accounts/
175
+ pages/
176
+ accounts-page.tsx
177
+ components/
178
+ accounts-table.tsx
179
+ api/
180
+ accounts.api.ts
181
+ hooks/
182
+ use-accounts.ts
183
+ types/
184
+ account.types.ts
185
+ ```
186
+
187
+ Use only folders that contain real files. Flatten the example when the feature is small.
188
+
189
+ When React Router or another router is present:
190
+
191
+ - keep route definitions in one obvious place, such as `src/routes.tsx` or `src/router/routes.tsx`
192
+ - keep page components thin; they read route/search params and compose feature components
193
+ - parse URL params at the route/page boundary, then pass typed values down
194
+ - use `getContext` from `@microsoft/power-apps/app` for Power Apps host/query context instead of assuming browser URL control
195
+ - do not add a router for a single screen that local state can handle
154
196
 
155
197
  ## Error Handling
156
198
 
@@ -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"
@@ -37,7 +37,7 @@ The app supports two modes.
37
37
  - Use the existing `AuthContext` flow only where this template already requires it.
38
38
  - Never commit client secrets, tenant-specific secrets, or real token values.
39
39
 
40
- Do not mix Power Pages auth with webresource `authService.ts` or `token.json`.
40
+ Do not mix Power Pages auth with webresource `AuthService.ts` or `token.json`.
41
41
 
42
42
  ## Critical Files
43
43
 
@@ -106,6 +106,7 @@ Preferred shape:
106
106
  - one TanStack Query hook when components need it
107
107
  - one mutation hook when mutation state or invalidation is needed
108
108
  - query keys colocated with the hook when reused for invalidation
109
+ - UI that consumes async data should handle loading, error, empty, and success states when each state affects the workflow
109
110
 
110
111
  Do not create wrapper chains such as:
111
112
 
@@ -138,6 +139,13 @@ Stay consistent with the project's existing UI system.
138
139
  - Do not hand-roll custom CSS unless component props and Tailwind are not enough.
139
140
  - Keep layouts compact, scannable, responsive, and suitable for Power Pages.
140
141
 
142
+ ## Accessibility
143
+
144
+ - Use semantic HTML.
145
+ - Use buttons for actions and links for navigation.
146
+ - Keep input labels, accessible names, dialog titles, and keyboard support intact.
147
+ - Do not remove shadcn/Radix or Kendo accessibility behavior while restyling.
148
+
141
149
  ## Code Shape
142
150
 
143
151
  Prefer:
@@ -147,6 +155,7 @@ Prefer:
147
155
  - existing auth, services, and components
148
156
  - small local helpers only when they remove real duplication or name non-obvious domain logic
149
157
  - explicit Power Pages table/field handling over generic frameworks
158
+ - feature folders only when a feature owns multiple pieces such as API, hooks, components, types, or schemas
150
159
 
151
160
  Avoid:
152
161
 
@@ -156,6 +165,39 @@ Avoid:
156
165
  - excessive configuration
157
166
  - defensive wrappers around every value
158
167
  - broad refactors while adding a feature
168
+ - moving code into shared `common` or `lib` before there is a second caller
169
+
170
+ ## Feature and Routing Shape
171
+
172
+ Keep small apps flat. Use feature folders when a feature owns enough surface area to group its page, UI, data access, hooks, and types.
173
+
174
+ Example:
175
+
176
+ ```text
177
+ src/
178
+ features/
179
+ accounts/
180
+ pages/
181
+ accounts-page.tsx
182
+ components/
183
+ accounts-table.tsx
184
+ api/
185
+ accounts.api.ts
186
+ hooks/
187
+ use-accounts.ts
188
+ types/
189
+ account.types.ts
190
+ ```
191
+
192
+ Use only folders that contain real files. Flatten the example when the feature is small.
193
+
194
+ When React Router or another router is present:
195
+
196
+ - keep route definitions in one obvious place, such as `src/routes.tsx` or `src/router/routes.tsx`
197
+ - keep page components thin; they read route/search params and compose feature components
198
+ - parse URL params at the route/page boundary, then pass typed values down
199
+ - keep client routes separate from Power Pages `_api` calls and code-site deployment paths
200
+ - do not add a router for a single screen that local state can handle
159
201
 
160
202
  ## Error Handling
161
203
 
@@ -0,0 +1 @@
1
+ @AGENTS.md
@@ -14,7 +14,7 @@ This is a Power Pages Single Page Application (SPA) built with React, Vite, and
14
14
 
15
15
  ## Auth and API Access
16
16
 
17
- This SPA uses ADAL (Azure Active Directory Authentication Library) for authentication. While ADAL is deprecated by Microsoft, it remains functional for Power Pages scenarios until MSAL v2 support is available.
17
+ This SPA uses ADAL (Azure Active Directory Authentication Library) for authentication. ADAL is deprecated by Microsoft and should not be treated as a long-term ideal path, but this template keeps the existing ADAL implementation for Power Pages scenarios until a validated MSAL v2 migration is introduced.
18
18
 
19
19
  ### Authentication Setup
20
20
 
@@ -37,6 +37,26 @@ The `AuthContext` requires the following environment variables:
37
37
  - After successful authentication, users are redirected back with tokens
38
38
  - Tokens are automatically cached and reused for subsequent requests
39
39
  - Call `logout()` to clear tokens and sign out the user
40
+ - Auth errors are exposed as `error` on `useAuth()` and can be cleared with `clearError()`
41
+
42
+ ### Authentication Errors
43
+
44
+ The generated app includes `src/components/shared/AuthError.tsx` and renders it near the app root. Keep that pattern if you replace the root layout:
45
+
46
+ ```tsx
47
+ import { AuthError } from "@/components/shared/AuthError";
48
+
49
+ function App() {
50
+ return (
51
+ <main>
52
+ <AuthError />
53
+ {/* app routes or page content */}
54
+ </main>
55
+ );
56
+ }
57
+ ```
58
+
59
+ `AuthContext` does not throw automatically when authentication fails, so the app can display a local error and let the user dismiss it.
40
60
 
41
61
  ## Example Data Fetch Using TanStack Query and AuthContext
42
62
 
@@ -156,7 +176,7 @@ export const AuthButton = () => {
156
176
  <Button>Click me</Button>;
157
177
  ```
158
178
 
159
- - Shadcn/ui: Components are installed and available under the `@/components` alias. Example:
179
+ - Shadcn/ui: Components are copied from the committed template snapshot and available under the `@/components` alias. Example:
160
180
 
161
181
  ```tsx
162
182
  import { Button } from "@/components/ui/button";
@@ -1,10 +1,12 @@
1
1
  import { useAuth } from "./context/AuthContext";
2
+ import { AuthError } from "./components/shared/AuthError";
2
3
 
3
4
  function App() {
4
- const { isAuthenticated, user } = useAuth(); //INFO: User is where the token information is stored (user?.idToken)
5
+ const { isAuthenticated } = useAuth();
5
6
 
6
7
  return (
7
8
  <div className="flex h-screen flex-col items-center justify-center gap-4">
9
+ <AuthError />
8
10
  {isAuthenticated ? (
9
11
  <div>You are logged in</div>
10
12
  ) : (
@@ -0,0 +1,18 @@
1
+ import { useAuth } from "@/context/AuthContext";
2
+
3
+ export function AuthError() {
4
+ const { error, clearError } = useAuth();
5
+
6
+ if (!error) {
7
+ return null;
8
+ }
9
+
10
+ return (
11
+ <div role="alert" className="rounded border p-3">
12
+ <p>Authentication error: {error}</p>
13
+ <button type="button" onClick={clearError}>
14
+ Dismiss
15
+ </button>
16
+ </div>
17
+ );
18
+ }
@@ -263,10 +263,6 @@ const AuthProviderContent = ({ children }: { children: ReactNode }) => {
263
263
  getIdToken,
264
264
  };
265
265
 
266
- if (error) {
267
- throw new Error(`Authentication error: ${error}`);
268
- }
269
-
270
266
  return (
271
267
  <AuthContext.Provider value={value}>{children}</AuthContext.Provider>
272
268
  );
@@ -96,6 +96,7 @@ Preferred shape:
96
96
  - one TanStack Query hook when components need it
97
97
  - one mutation hook when mutation state or invalidation is needed
98
98
  - query keys colocated with the hook when reused for invalidation
99
+ - UI that consumes async data should handle loading, error, empty, and success states when each state affects the workflow
99
100
 
100
101
  Do not create wrapper chains such as:
101
102
 
@@ -128,6 +129,13 @@ Stay consistent with the project's existing UI system.
128
129
  - Do not hand-roll custom CSS unless component props and Tailwind are not enough.
129
130
  - Keep layouts compact, responsive, and suitable for a hosted business app.
130
131
 
132
+ ## Accessibility
133
+
134
+ - Use semantic HTML.
135
+ - Use buttons for actions and links for navigation.
136
+ - Keep input labels, accessible names, dialog titles, and keyboard support intact.
137
+ - Do not remove shadcn/Radix or Kendo accessibility behavior while restyling.
138
+
131
139
  ## Code Shape
132
140
 
133
141
  Prefer:
@@ -136,6 +144,7 @@ Prefer:
136
144
  - direct typed functions
137
145
  - existing services and components
138
146
  - small local helpers only when they remove real duplication or name non-obvious domain logic
147
+ - feature folders only when a feature owns multiple pieces such as API, hooks, components, types, or schemas
139
148
 
140
149
  Avoid:
141
150
 
@@ -145,6 +154,39 @@ Avoid:
145
154
  - excessive configuration
146
155
  - defensive wrappers around every value
147
156
  - broad refactors while adding a feature
157
+ - moving code into shared `common` or `lib` before there is a second caller
158
+
159
+ ## Feature and Routing Shape
160
+
161
+ Keep small apps flat. Use feature folders when a feature owns enough surface area to group its page, UI, data access, hooks, and types.
162
+
163
+ Example:
164
+
165
+ ```text
166
+ src/
167
+ features/
168
+ accounts/
169
+ pages/
170
+ accounts-page.tsx
171
+ components/
172
+ accounts-table.tsx
173
+ api/
174
+ accounts.api.ts
175
+ hooks/
176
+ use-accounts.ts
177
+ types/
178
+ account.types.ts
179
+ ```
180
+
181
+ Use only folders that contain real files. Flatten the example when the feature is small.
182
+
183
+ When React Router or another router is present:
184
+
185
+ - keep route definitions in one obvious place, such as `src/routes.tsx` or `src/router/routes.tsx`
186
+ - keep page components thin; they read route/search params and compose feature components
187
+ - parse URL params at the route/page boundary, then pass typed values down
188
+ - keep `staticwebapp.config.json` `navigationFallback` aligned with client-side routes
189
+ - do not add a router for a single screen that local state can handle
148
190
 
149
191
  ## Error Handling
150
192
 
@@ -0,0 +1 @@
1
+ @AGENTS.md