create-ec-app 1.9.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ec-app",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "Unified CLI tool to create different types of EC applications: Webresource, Portal, Power Pages, Power Apps Code Apps",
5
5
  "bin": {
6
6
  "create-ec-app": "./dist/index.js"
@@ -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
 
@@ -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
 
@@ -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
 
@@ -102,6 +102,7 @@ Preferred shape:
102
102
  - one TanStack Query hook when components need it
103
103
  - one mutation hook when mutation state or invalidation is needed
104
104
  - query keys colocated with the hook when reused for invalidation
105
+ - UI that consumes async data should handle loading, error, empty, and success states when each state affects the workflow
105
106
 
106
107
  Do not create wrapper chains such as:
107
108
 
@@ -134,6 +135,13 @@ Stay consistent with the project's existing UI system.
134
135
  - Do not hand-roll custom CSS unless component props and Tailwind are not enough.
135
136
  - Keep layouts compact, scannable, responsive, and suitable for embedded Dynamics screens.
136
137
 
138
+ ## Accessibility
139
+
140
+ - Use semantic HTML.
141
+ - Use buttons for actions and links for navigation.
142
+ - Keep input labels, accessible names, dialog titles, and keyboard support intact.
143
+ - Do not remove shadcn/Radix or Kendo accessibility behavior while restyling.
144
+
137
145
  ## Code Shape
138
146
 
139
147
  Prefer:
@@ -143,6 +151,7 @@ Prefer:
143
151
  - existing services and components
144
152
  - small local helpers only when they remove real duplication or name non-obvious domain logic
145
153
  - explicit Dataverse table/field handling over generic frameworks
154
+ - feature folders only when a feature owns multiple pieces such as API, hooks, components, types, or schemas
146
155
 
147
156
  Avoid:
148
157
 
@@ -152,6 +161,39 @@ Avoid:
152
161
  - excessive configuration
153
162
  - defensive wrappers around every value
154
163
  - broad refactors while adding a feature
164
+ - moving code into shared `common` or `lib` before there is a second caller
165
+
166
+ ## Feature and Routing Shape
167
+
168
+ Keep small apps flat. Use feature folders when a feature owns enough surface area to group its page, UI, data access, hooks, and types.
169
+
170
+ Example:
171
+
172
+ ```text
173
+ src/
174
+ features/
175
+ accounts/
176
+ pages/
177
+ accounts-page.tsx
178
+ components/
179
+ accounts-table.tsx
180
+ api/
181
+ accounts.api.ts
182
+ hooks/
183
+ use-accounts.ts
184
+ types/
185
+ account.types.ts
186
+ ```
187
+
188
+ Use only folders that contain real files. Flatten the example when the feature is small.
189
+
190
+ When React Router or another router is present:
191
+
192
+ - keep route definitions in one obvious place, such as `src/routes.tsx` or `src/router/routes.tsx`
193
+ - keep page components thin; they read route/search params and compose feature components
194
+ - parse URL params at the route/page boundary, then pass typed values down
195
+ - prefer hash/search-param routing for embedded webresources unless the Dynamics host URL is proven to support browser history routing
196
+ - do not add a router for a single screen that local state can handle
155
197
 
156
198
  ## Error Handling
157
199