create-react-admin-template 0.0.0-stage → 0.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.
Files changed (736) hide show
  1. package/README.md +46 -2
  2. package/bin/create.mjs +5 -0
  3. package/package.json +22 -4
  4. package/template/.dockerignore +12 -0
  5. package/template/.editorconfig +12 -0
  6. package/template/.env +14 -0
  7. package/template/.env.development +5 -0
  8. package/template/.env.production +2 -0
  9. package/template/.env.test +5 -0
  10. package/template/.github/workflows/ci.yml +40 -0
  11. package/template/.gitlab-ci.yml +208 -0
  12. package/template/.husky/commit-msg +1 -0
  13. package/template/.husky/pre-commit +1 -0
  14. package/template/.nvmrc +1 -0
  15. package/template/.prettierignore +11 -0
  16. package/template/.prettierrc +47 -0
  17. package/template/Dockerfile +16 -0
  18. package/template/README.md +372 -0
  19. package/template/build/advancedTable.ts +103 -0
  20. package/template/build/environment.ts +150 -0
  21. package/template/commitlint.config.js +32 -0
  22. package/template/components.json +21 -0
  23. package/template/deploy/README.md +132 -0
  24. package/template/deploy/host-nginx/react-admin-api.conf +14 -0
  25. package/template/deploy/host-nginx/react-admin-web.conf +8 -0
  26. package/template/deploy/nginx.conf +38 -0
  27. package/template/docs/activity-status.md +217 -0
  28. package/template/docs/audit-logs.md +158 -0
  29. package/template/docs/authentication-adapters.md +219 -0
  30. package/template/docs/browser-security.md +58 -0
  31. package/template/docs/bundle-budgets.md +65 -0
  32. package/template/docs/component-source-governance.md +99 -0
  33. package/template/docs/data-masking.md +169 -0
  34. package/template/docs/enterprise-scaffold.md +208 -0
  35. package/template/docs/feature-data-template.md +227 -0
  36. package/template/docs/feature-flags.md +169 -0
  37. package/template/docs/file-capabilities.md +196 -0
  38. package/template/docs/locale-and-i18n.md +132 -0
  39. package/template/docs/mutation-idempotency.md +24 -0
  40. package/template/docs/optional-editors.md +203 -0
  41. package/template/docs/page-feedback.md +83 -0
  42. package/template/docs/query-data-conventions.md +178 -0
  43. package/template/docs/realtime-collaboration.md +140 -0
  44. package/template/docs/reporting-printing-templates.md +156 -0
  45. package/template/docs/scaffold-capability-roadmap.md +226 -0
  46. package/template/docs/scaffold-guide.md +443 -0
  47. package/template/docs/template-changelog.md +30 -0
  48. package/template/docs/template-versioning.md +26 -0
  49. package/template/docs/tenant-workspace-context.md +147 -0
  50. package/template/docs/unsaved-changes.md +58 -0
  51. package/template/docs/white-label.md +102 -0
  52. package/template/eslint.config.js +697 -0
  53. package/template/gitignore +39 -0
  54. package/template/index.html +26 -0
  55. package/template/knip.config.ts +42 -0
  56. package/template/lint-staged.config.js +8 -0
  57. package/template/package.json +133 -0
  58. package/template/pnpm-lock.yaml +8694 -0
  59. package/template/public/favicon.ico +0 -0
  60. package/template/public/logo.svg +1 -0
  61. package/template/public/runtime-config.json +49 -0
  62. package/template/scaffold.template.json +5 -0
  63. package/template/src/Application.tsx +114 -0
  64. package/template/src/api/ApiError.ts +33 -0
  65. package/template/src/api/activity/ActivityProvider.tsx +167 -0
  66. package/template/src/api/activity/access.ts +13 -0
  67. package/template/src/api/activity/errors.ts +17 -0
  68. package/template/src/api/activity/index.ts +67 -0
  69. package/template/src/api/activity/model.ts +227 -0
  70. package/template/src/api/activity/query.ts +163 -0
  71. package/template/src/api/activity/source.ts +16 -0
  72. package/template/src/api/activity/subscription.ts +292 -0
  73. package/template/src/api/activity/transports.ts +271 -0
  74. package/template/src/api/activity/types.ts +402 -0
  75. package/template/src/api/authClient.ts +134 -0
  76. package/template/src/api/authSession.ts +307 -0
  77. package/template/src/api/clients/configureApiClient.ts +62 -0
  78. package/template/src/api/clients/httpStatus.ts +4 -0
  79. package/template/src/api/config/services.json +7 -0
  80. package/template/src/api/demoAuthClient.ts +46 -0
  81. package/template/src/api/enums/EnumCatalogProvider.tsx +169 -0
  82. package/template/src/api/enums/EnumDictionary.ts +55 -0
  83. package/template/src/api/enums/access.ts +130 -0
  84. package/template/src/api/enums/catalog.ts +216 -0
  85. package/template/src/api/enums/errors.ts +21 -0
  86. package/template/src/api/enums/index.ts +48 -0
  87. package/template/src/api/enums/query.ts +82 -0
  88. package/template/src/api/enums/scope.ts +58 -0
  89. package/template/src/api/enums/types.ts +251 -0
  90. package/template/src/api/hooks/error.ts +198 -0
  91. package/template/src/api/hooks/index.ts +4 -0
  92. package/template/src/api/hooks/request.ts +99 -0
  93. package/template/src/api/hooks/requestId.ts +65 -0
  94. package/template/src/api/hooks/response.ts +22 -0
  95. package/template/src/api/hooks/types.ts +20 -0
  96. package/template/src/api/idempotency/index.ts +1 -0
  97. package/template/src/api/idempotency/key.ts +23 -0
  98. package/template/src/api/index.ts +14 -0
  99. package/template/src/api/metadata/MetadataProvider.tsx +37 -0
  100. package/template/src/api/metadata/index.ts +2 -0
  101. package/template/src/api/metadata/types.ts +30 -0
  102. package/template/src/api/parameters/GlobalParameterProvider.tsx +210 -0
  103. package/template/src/api/parameters/access.ts +117 -0
  104. package/template/src/api/parameters/catalog.ts +170 -0
  105. package/template/src/api/parameters/errors.ts +21 -0
  106. package/template/src/api/parameters/index.ts +53 -0
  107. package/template/src/api/parameters/query.ts +84 -0
  108. package/template/src/api/parameters/scope.ts +58 -0
  109. package/template/src/api/parameters/types.ts +214 -0
  110. package/template/src/api/query/index.ts +13 -0
  111. package/template/src/api/query/keys.ts +155 -0
  112. package/template/src/api/query/mutation.ts +48 -0
  113. package/template/src/api/query/react.ts +36 -0
  114. package/template/src/api/query/scope.ts +38 -0
  115. package/template/src/api/query/types.ts +147 -0
  116. package/template/src/api/types.ts +144 -0
  117. package/template/src/application/types.ts +52 -0
  118. package/template/src/auditLogs/errors.ts +17 -0
  119. package/template/src/auditLogs/export.ts +85 -0
  120. package/template/src/auditLogs/index.ts +54 -0
  121. package/template/src/auditLogs/model.ts +526 -0
  122. package/template/src/auditLogs/query.ts +113 -0
  123. package/template/src/auditLogs/react.ts +36 -0
  124. package/template/src/auditLogs/source.ts +51 -0
  125. package/template/src/auditLogs/types.ts +357 -0
  126. package/template/src/authentication/controller.ts +351 -0
  127. package/template/src/authentication/index.ts +8 -0
  128. package/template/src/authentication/redirect.ts +72 -0
  129. package/template/src/authentication/types.ts +300 -0
  130. package/template/src/bootstrap.tsx +96 -0
  131. package/template/src/components/AppDataTable/AppDataTable.tsx +74 -0
  132. package/template/src/components/AppDataTable/index.ts +2 -0
  133. package/template/src/components/AppDataTable/types.ts +27 -0
  134. package/template/src/components/AppDialog/AppConfirmDialog.tsx +44 -0
  135. package/template/src/components/AppDialog/AppDialog.tsx +113 -0
  136. package/template/src/components/AppDialog/index.ts +3 -0
  137. package/template/src/components/AppDialog/messages.tsx +22 -0
  138. package/template/src/components/AppDialog/types.ts +53 -0
  139. package/template/src/components/AppPageForm/AppPageForm.tsx +21 -0
  140. package/template/src/components/AppPageForm/PageForm.tsx +765 -0
  141. package/template/src/components/AppPageForm/SOURCE.md +26 -0
  142. package/template/src/components/AppPageForm/config.ts +253 -0
  143. package/template/src/components/AppPageForm/controller.ts +580 -0
  144. package/template/src/components/AppPageForm/index.ts +2 -0
  145. package/template/src/components/AppPageForm/messages.ts +90 -0
  146. package/template/src/components/AppPageForm/optionUtils.ts +91 -0
  147. package/template/src/components/AppPageForm/options.ts +397 -0
  148. package/template/src/components/AppPageForm/query.ts +44 -0
  149. package/template/src/components/AppPageForm/style.css +119 -0
  150. package/template/src/components/AppPageForm/types.ts +632 -0
  151. package/template/src/components/AppPageForm/validation.ts +233 -0
  152. package/template/src/components/AppTable/AppTable.tsx +26 -0
  153. package/template/src/components/AppTable/SOURCE.md +72 -0
  154. package/template/src/components/AppTable/cell/customCell/TableCellLayer.tsx +73 -0
  155. package/template/src/components/AppTable/cell/customCell/actions/ActionDropdownCell.tsx +104 -0
  156. package/template/src/components/AppTable/cell/customCell/cellLayer.ts +358 -0
  157. package/template/src/components/AppTable/cell/customCell/componentProps.ts +30 -0
  158. package/template/src/components/AppTable/cell/customCell/date/TemporalPickerEditor.tsx +54 -0
  159. package/template/src/components/AppTable/cell/customCell/index.ts +2 -0
  160. package/template/src/components/AppTable/cell/customCell/select/SelectCellEditor.tsx +225 -0
  161. package/template/src/components/AppTable/cell/customCell/tableCellLayer.css +20 -0
  162. package/template/src/components/AppTable/cell/customCell/tooltip/TooltipCell.tsx +45 -0
  163. package/template/src/components/AppTable/cell/customCell/types.ts +63 -0
  164. package/template/src/components/AppTable/cell/customCell/useCellLayerLifecycle.ts +111 -0
  165. package/template/src/components/AppTable/cell/frameworkCell/TableCellComponentLayer.tsx +40 -0
  166. package/template/src/components/AppTable/cell/frameworkCell/cellComponentSession.ts +203 -0
  167. package/template/src/components/AppTable/cell/frameworkCell/index.ts +3 -0
  168. package/template/src/components/AppTable/cell/index.ts +2 -0
  169. package/template/src/components/AppTable/columns/TableColumnEditor.tsx +257 -0
  170. package/template/src/components/AppTable/columns/index.ts +1 -0
  171. package/template/src/components/AppTable/columns/useTableColumnPreferenceActions.ts +85 -0
  172. package/template/src/components/AppTable/config/defaults.ts +46 -0
  173. package/template/src/components/AppTable/config/index.ts +2 -0
  174. package/template/src/components/AppTable/config/license.ts +39 -0
  175. package/template/src/components/AppTable/config/resolver.ts +25 -0
  176. package/template/src/components/AppTable/config/types.ts +377 -0
  177. package/template/src/components/AppTable/engine/bottom/index.ts +1 -0
  178. package/template/src/components/AppTable/engine/bottom/types.ts +14 -0
  179. package/template/src/components/AppTable/engine/cell/constants.ts +32 -0
  180. package/template/src/components/AppTable/engine/cell/customCell/actions/index.ts +1 -0
  181. package/template/src/components/AppTable/engine/cell/customCell/actions/renderer.ts +162 -0
  182. package/template/src/components/AppTable/engine/cell/customCell/date/index.ts +1 -0
  183. package/template/src/components/AppTable/engine/cell/customCell/date/renderer.ts +116 -0
  184. package/template/src/components/AppTable/engine/cell/customCell/editors/editorBounds.ts +57 -0
  185. package/template/src/components/AppTable/engine/cell/customCell/editors/editorTrigger.ts +46 -0
  186. package/template/src/components/AppTable/engine/cell/customCell/editors/index.ts +3 -0
  187. package/template/src/components/AppTable/engine/cell/customCell/editors/layerEditor.ts +244 -0
  188. package/template/src/components/AppTable/engine/cell/customCell/index.ts +7 -0
  189. package/template/src/components/AppTable/engine/cell/customCell/renderers/columnRenderer.ts +245 -0
  190. package/template/src/components/AppTable/engine/cell/customCell/renderers/confirmInput.ts +57 -0
  191. package/template/src/components/AppTable/engine/cell/customCell/renderers/display.ts +78 -0
  192. package/template/src/components/AppTable/engine/cell/customCell/renderers/index.ts +3 -0
  193. package/template/src/components/AppTable/engine/cell/customCell/renderers/itemList.ts +60 -0
  194. package/template/src/components/AppTable/engine/cell/customCell/renderers/links.ts +131 -0
  195. package/template/src/components/AppTable/engine/cell/customCell/renderers/selection.ts +41 -0
  196. package/template/src/components/AppTable/engine/cell/customCell/renderers/shared.ts +71 -0
  197. package/template/src/components/AppTable/engine/cell/customCell/renderers/step.ts +37 -0
  198. package/template/src/components/AppTable/engine/cell/customCell/renderers/switch.ts +45 -0
  199. package/template/src/components/AppTable/engine/cell/customCell/select/index.ts +1 -0
  200. package/template/src/components/AppTable/engine/cell/customCell/select/renderer.ts +33 -0
  201. package/template/src/components/AppTable/engine/cell/customCell/tooltip/index.ts +1 -0
  202. package/template/src/components/AppTable/engine/cell/customCell/tooltip/tooltip.ts +94 -0
  203. package/template/src/components/AppTable/engine/cell/customCell/types.ts +82 -0
  204. package/template/src/components/AppTable/engine/cell/formatting.ts +355 -0
  205. package/template/src/components/AppTable/engine/cell/formula.ts +145 -0
  206. package/template/src/components/AppTable/engine/cell/index.ts +7 -0
  207. package/template/src/components/AppTable/engine/cell/multiSelect.ts +96 -0
  208. package/template/src/components/AppTable/engine/cell/options.ts +339 -0
  209. package/template/src/components/AppTable/engine/cell/types.ts +53 -0
  210. package/template/src/components/AppTable/engine/columns/column.ts +430 -0
  211. package/template/src/components/AppTable/engine/columns/config/columns.ts +33 -0
  212. package/template/src/components/AppTable/engine/columns/config/index.ts +4 -0
  213. package/template/src/components/AppTable/engine/columns/config/mutation.ts +138 -0
  214. package/template/src/components/AppTable/engine/columns/config/temporal.ts +11 -0
  215. package/template/src/components/AppTable/engine/columns/config/validation.ts +106 -0
  216. package/template/src/components/AppTable/engine/columns/constants.ts +6 -0
  217. package/template/src/components/AppTable/engine/columns/gridColumns.ts +332 -0
  218. package/template/src/components/AppTable/engine/columns/index.ts +4 -0
  219. package/template/src/components/AppTable/engine/columns/rendererPolicies.ts +129 -0
  220. package/template/src/components/AppTable/engine/component/resolver.ts +272 -0
  221. package/template/src/components/AppTable/engine/component/types.ts +384 -0
  222. package/template/src/components/AppTable/engine/config/constants.ts +33 -0
  223. package/template/src/components/AppTable/engine/config/grid/compiler.ts +65 -0
  224. package/template/src/components/AppTable/engine/config/grid/defaults.ts +82 -0
  225. package/template/src/components/AppTable/engine/config/grid/ownership.ts +35 -0
  226. package/template/src/components/AppTable/engine/config/grid/runtimeDelta.ts +34 -0
  227. package/template/src/components/AppTable/engine/config/grid/types.ts +30 -0
  228. package/template/src/components/AppTable/engine/pagination/config.ts +75 -0
  229. package/template/src/components/AppTable/engine/pagination/constants.ts +5 -0
  230. package/template/src/components/AppTable/engine/pagination/index.ts +3 -0
  231. package/template/src/components/AppTable/engine/pagination/types.ts +70 -0
  232. package/template/src/components/AppTable/engine/preference/index.ts +2 -0
  233. package/template/src/components/AppTable/engine/preference/preference.ts +535 -0
  234. package/template/src/components/AppTable/engine/preference/types.ts +28 -0
  235. package/template/src/components/AppTable/engine/right/index.ts +1 -0
  236. package/template/src/components/AppTable/engine/right/types.ts +18 -0
  237. package/template/src/components/AppTable/engine/search/config.ts +64 -0
  238. package/template/src/components/AppTable/engine/search/constants.ts +8 -0
  239. package/template/src/components/AppTable/engine/search/index.ts +7 -0
  240. package/template/src/components/AppTable/engine/search/localQuery.ts +145 -0
  241. package/template/src/components/AppTable/engine/search/query.ts +203 -0
  242. package/template/src/components/AppTable/engine/search/remoteQuery.ts +99 -0
  243. package/template/src/components/AppTable/engine/search/searchInteraction.ts +46 -0
  244. package/template/src/components/AppTable/engine/search/types.ts +155 -0
  245. package/template/src/components/AppTable/engine/selection/config.ts +13 -0
  246. package/template/src/components/AppTable/engine/selection/index.ts +4 -0
  247. package/template/src/components/AppTable/engine/selection/selection.ts +357 -0
  248. package/template/src/components/AppTable/engine/selection/selectionHeader.ts +88 -0
  249. package/template/src/components/AppTable/engine/selection/types.ts +66 -0
  250. package/template/src/components/AppTable/engine/shared/action.ts +11 -0
  251. package/template/src/components/AppTable/engine/shared/constants.ts +2 -0
  252. package/template/src/components/AppTable/engine/shared/decimal.ts +114 -0
  253. package/template/src/components/AppTable/engine/shared/feedback.ts +62 -0
  254. package/template/src/components/AppTable/engine/shared/index.ts +13 -0
  255. package/template/src/components/AppTable/engine/shared/interaction.ts +55 -0
  256. package/template/src/components/AppTable/engine/shared/messages.ts +161 -0
  257. package/template/src/components/AppTable/engine/shared/row.ts +32 -0
  258. package/template/src/components/AppTable/engine/shared/scheduler.ts +17 -0
  259. package/template/src/components/AppTable/engine/shared/tableKey.ts +31 -0
  260. package/template/src/components/AppTable/engine/shared/theme.ts +196 -0
  261. package/template/src/components/AppTable/engine/shared/treeRows.ts +155 -0
  262. package/template/src/components/AppTable/engine/shared/types.ts +58 -0
  263. package/template/src/components/AppTable/engine/shared/valueSnapshot.ts +46 -0
  264. package/template/src/components/AppTable/engine/summary/config/export.ts +117 -0
  265. package/template/src/components/AppTable/engine/summary/config/index.ts +3 -0
  266. package/template/src/components/AppTable/engine/summary/config/summary.ts +62 -0
  267. package/template/src/components/AppTable/engine/summary/config/types.ts +93 -0
  268. package/template/src/components/AppTable/engine/summary/constants.ts +13 -0
  269. package/template/src/components/AppTable/engine/summary/excelJs.ts +133 -0
  270. package/template/src/components/AppTable/engine/summary/export.ts +311 -0
  271. package/template/src/components/AppTable/engine/summary/index.ts +6 -0
  272. package/template/src/components/AppTable/engine/summary/selectionSum.ts +92 -0
  273. package/template/src/components/AppTable/engine/summary/summary.ts +457 -0
  274. package/template/src/components/AppTable/engine/table/clipboard/index.ts +1 -0
  275. package/template/src/components/AppTable/engine/table/clipboard/transfer.ts +9 -0
  276. package/template/src/components/AppTable/engine/table/controller/TableController.ts +802 -0
  277. package/template/src/components/AppTable/engine/table/controller/errors.ts +106 -0
  278. package/template/src/components/AppTable/engine/table/controller/index.ts +4 -0
  279. package/template/src/components/AppTable/engine/table/controller/latestAbortableTask.ts +33 -0
  280. package/template/src/components/AppTable/engine/table/controller/tableDataReplacement.ts +60 -0
  281. package/template/src/components/AppTable/engine/table/controller/tableDomainConfiguration.ts +94 -0
  282. package/template/src/components/AppTable/engine/table/controller/tableEditingCommands.ts +163 -0
  283. package/template/src/components/AppTable/engine/table/controller/tableGridHost.ts +324 -0
  284. package/template/src/components/AppTable/engine/table/controller/tableIdentity.ts +68 -0
  285. package/template/src/components/AppTable/engine/table/controller/tableMutationPipeline.ts +79 -0
  286. package/template/src/components/AppTable/engine/table/controller/tableQueryCoordinator.ts +187 -0
  287. package/template/src/components/AppTable/engine/table/controller/tableReportingCoordinator.ts +143 -0
  288. package/template/src/components/AppTable/engine/table/controller/tableSaveCoordinator.ts +227 -0
  289. package/template/src/components/AppTable/engine/table/controller/tableSaveValidation.ts +29 -0
  290. package/template/src/components/AppTable/engine/table/controller/tableSnapshot.ts +58 -0
  291. package/template/src/components/AppTable/engine/table/controller/types.ts +202 -0
  292. package/template/src/components/AppTable/engine/table/editing/baselineStore.ts +134 -0
  293. package/template/src/components/AppTable/engine/table/editing/changeSet.ts +492 -0
  294. package/template/src/components/AppTable/engine/table/editing/changeSetSettlement.ts +633 -0
  295. package/template/src/components/AppTable/engine/table/editing/commitResultIndex.ts +75 -0
  296. package/template/src/components/AppTable/engine/table/editing/constants.ts +15 -0
  297. package/template/src/components/AppTable/engine/table/editing/dirtyCellIndex.ts +96 -0
  298. package/template/src/components/AppTable/engine/table/editing/index.ts +6 -0
  299. package/template/src/components/AppTable/engine/table/editing/mutation.ts +173 -0
  300. package/template/src/components/AppTable/engine/table/editing/rowKey.ts +10 -0
  301. package/template/src/components/AppTable/engine/table/editing/types.ts +404 -0
  302. package/template/src/components/AppTable/engine/table/editing/validation.ts +452 -0
  303. package/template/src/components/AppTable/engine/table/grid/cellMeta.ts +90 -0
  304. package/template/src/components/AppTable/engine/table/grid/handsontable.ts +25 -0
  305. package/template/src/components/AppTable/engine/table/grid/handsontableExtensions.d.ts +26 -0
  306. package/template/src/components/AppTable/engine/table/grid/index.ts +5 -0
  307. package/template/src/components/AppTable/engine/table/grid/moduleRegistry.ts +39 -0
  308. package/template/src/components/AppTable/engine/table/grid/runtime.ts +31 -0
  309. package/template/src/components/AppTable/engine/table/grid/types.ts +25 -0
  310. package/template/src/components/AppTable/engine/table/hooks/fixedEndHooks.ts +44 -0
  311. package/template/src/components/AppTable/engine/table/hooks/gridHooks.ts +108 -0
  312. package/template/src/components/AppTable/engine/table/hooks/headerHooks.ts +103 -0
  313. package/template/src/components/AppTable/engine/table/hooks/index.ts +3 -0
  314. package/template/src/components/AppTable/engine/table/index.ts +6 -0
  315. package/template/src/components/AppTable/engine/table/layout/constants.ts +2 -0
  316. package/template/src/components/AppTable/engine/table/layout/dropdownMenu.ts +89 -0
  317. package/template/src/components/AppTable/engine/table/layout/fixedColumns.ts +44 -0
  318. package/template/src/components/AppTable/engine/table/layout/fixedEndOverlay.ts +90 -0
  319. package/template/src/components/AppTable/engine/table/layout/fixedEndOverlayAccessibility.ts +104 -0
  320. package/template/src/components/AppTable/engine/table/layout/fixedEndOverlayRenderer.ts +690 -0
  321. package/template/src/components/AppTable/engine/table/layout/fixedEndOverlaySignature.ts +58 -0
  322. package/template/src/components/AppTable/engine/table/layout/fixedEndRuntime.ts +137 -0
  323. package/template/src/components/AppTable/engine/table/layout/handsontableDomAdapter.ts +40 -0
  324. package/template/src/components/AppTable/engine/table/layout/height.ts +72 -0
  325. package/template/src/components/AppTable/engine/table/layout/index.ts +14 -0
  326. package/template/src/components/AppTable/engine/table/layout/layoutScheduler.ts +60 -0
  327. package/template/src/components/AppTable/engine/table/layout/mergeCells.ts +146 -0
  328. package/template/src/components/AppTable/engine/table/layout/nestedHeaders.ts +271 -0
  329. package/template/src/components/AppTable/engine/table/layout/types.ts +10 -0
  330. package/template/src/components/AppTable/engine/toolbar/index.ts +1 -0
  331. package/template/src/components/AppTable/engine/toolbar/types.ts +56 -0
  332. package/template/src/components/AppTable/index.ts +11 -0
  333. package/template/src/components/AppTable/messages.ts +256 -0
  334. package/template/src/components/AppTable/pagination/TablePaginationBar.tsx +193 -0
  335. package/template/src/components/AppTable/pagination/index.ts +1 -0
  336. package/template/src/components/AppTable/pagination/paginationItems.ts +56 -0
  337. package/template/src/components/AppTable/preference/index.ts +1 -0
  338. package/template/src/components/AppTable/preference/useTablePreference.ts +208 -0
  339. package/template/src/components/AppTable/reporting/index.ts +1 -0
  340. package/template/src/components/AppTable/reporting/useTableReporting.ts +342 -0
  341. package/template/src/components/AppTable/search/TableSearchBar.tsx +301 -0
  342. package/template/src/components/AppTable/search/TableSearchConditionEditor.tsx +254 -0
  343. package/template/src/components/AppTable/search/TableSearchField.tsx +338 -0
  344. package/template/src/components/AppTable/search/TableSearchFields.tsx +65 -0
  345. package/template/src/components/AppTable/search/constants.ts +9 -0
  346. package/template/src/components/AppTable/search/index.ts +3 -0
  347. package/template/src/components/AppTable/search/tableSearchBar.css +164 -0
  348. package/template/src/components/AppTable/search/types.ts +7 -0
  349. package/template/src/components/AppTable/search/useTableQuery.ts +373 -0
  350. package/template/src/components/AppTable/selection/index.ts +1 -0
  351. package/template/src/components/AppTable/selection/useTableSelection.ts +188 -0
  352. package/template/src/components/AppTable/sensitiveData.tsx +41 -0
  353. package/template/src/components/AppTable/shared/styles.ts +2 -0
  354. package/template/src/components/AppTable/styles/index.css +6 -0
  355. package/template/src/components/AppTable/styles/tableComponent.css +297 -0
  356. package/template/src/components/AppTable/styles/theme.css +133 -0
  357. package/template/src/components/AppTable/table/components/TableComponent.tsx +567 -0
  358. package/template/src/components/AppTable/table/components/TableErrorFeedback.tsx +36 -0
  359. package/template/src/components/AppTable/table/components/TableGridViewport.tsx +85 -0
  360. package/template/src/components/AppTable/table/components/index.ts +2 -0
  361. package/template/src/components/AppTable/table/components/types.ts +90 -0
  362. package/template/src/components/AppTable/table/controller/configuration.ts +89 -0
  363. package/template/src/components/AppTable/table/controller/index.ts +2 -0
  364. package/template/src/components/AppTable/table/controller/useTableController.ts +155 -0
  365. package/template/src/components/AppTable/table/controller/useTableLifecycle.ts +97 -0
  366. package/template/src/components/AppTable/table/grid/index.ts +1 -0
  367. package/template/src/components/AppTable/table/grid/useTableGrid.ts +857 -0
  368. package/template/src/components/AppTable/table/grid/useTableGridRuntimeSettings.ts +49 -0
  369. package/template/src/components/AppTable/table/index.ts +4 -0
  370. package/template/src/components/AppTable/table/layout/TablePanels.tsx +389 -0
  371. package/template/src/components/AppTable/table/layout/index.ts +7 -0
  372. package/template/src/components/AppTable/table/layout/types.ts +3 -0
  373. package/template/src/components/AppTable/table/layout/useResizablePanel.ts +213 -0
  374. package/template/src/components/AppTable/table/layout/useTableAdaptiveHeight.ts +238 -0
  375. package/template/src/components/AppTable/table/layout/useTablePanels.ts +329 -0
  376. package/template/src/components/AppTable/table/layout/useTableTheme.ts +123 -0
  377. package/template/src/components/AppTable/toolbar/TableToolbar.tsx +336 -0
  378. package/template/src/components/AppTable/toolbar/index.ts +1 -0
  379. package/template/src/components/BrandLogo/BrandLogo.tsx +41 -0
  380. package/template/src/components/BrandLogo/index.ts +1 -0
  381. package/template/src/components/Can/Can.tsx +19 -0
  382. package/template/src/components/Can/index.ts +7 -0
  383. package/template/src/components/Can/types.ts +41 -0
  384. package/template/src/components/EnumBadge/EnumBadge.tsx +44 -0
  385. package/template/src/components/EnumBadge/index.ts +2 -0
  386. package/template/src/components/EnumBadge/types.ts +16 -0
  387. package/template/src/components/EnumText/EnumText.tsx +33 -0
  388. package/template/src/components/EnumText/index.ts +2 -0
  389. package/template/src/components/EnumText/types.ts +13 -0
  390. package/template/src/components/FilePreview/FilePreview.tsx +120 -0
  391. package/template/src/components/FilePreview/index.ts +11 -0
  392. package/template/src/components/FilePreview/preview.ts +88 -0
  393. package/template/src/components/FilePreview/types.ts +91 -0
  394. package/template/src/components/FileUpload/FileUpload.tsx +172 -0
  395. package/template/src/components/FileUpload/index.ts +2 -0
  396. package/template/src/components/FileUpload/types.ts +32 -0
  397. package/template/src/components/JsonEditor/JsonEditor.tsx +103 -0
  398. package/template/src/components/JsonEditor/index.ts +1 -0
  399. package/template/src/components/JsonEditor/types.ts +14 -0
  400. package/template/src/components/PageFeedback/PageFeedback.tsx +194 -0
  401. package/template/src/components/PageFeedback/index.ts +10 -0
  402. package/template/src/components/PageFeedback/types.ts +31 -0
  403. package/template/src/components/PasswordInput/PasswordInput.tsx +50 -0
  404. package/template/src/components/PasswordInput/index.ts +1 -0
  405. package/template/src/components/RouteDialog/RouteDialog.tsx +20 -0
  406. package/template/src/components/RouteDialog/index.ts +2 -0
  407. package/template/src/components/RouteDialog/types.ts +8 -0
  408. package/template/src/components/RouteDialog/useRouteDialogNavigation.ts +30 -0
  409. package/template/src/components/SensitiveData/SensitiveData.tsx +337 -0
  410. package/template/src/components/SensitiveData/index.ts +2 -0
  411. package/template/src/components/SensitiveData/types.ts +31 -0
  412. package/template/src/components/StatusBadge/StatusBadge.tsx +28 -0
  413. package/template/src/components/StatusBadge/index.ts +2 -0
  414. package/template/src/components/StatusBadge/statusBadgeStyles.ts +30 -0
  415. package/template/src/components/StatusBadge/types.ts +7 -0
  416. package/template/src/components/layout/AppHeader/AppHeader.tsx +57 -0
  417. package/template/src/components/layout/AppHeader/HeaderSearch.tsx +160 -0
  418. package/template/src/components/layout/AppHeader/HeaderUserMenu.tsx +59 -0
  419. package/template/src/components/layout/AppHeader/ThemeControls.tsx +44 -0
  420. package/template/src/components/layout/AppHeader/index.ts +1 -0
  421. package/template/src/components/layout/AppHeader/themeOptions.ts +13 -0
  422. package/template/src/components/layout/AppSidebar.tsx +268 -0
  423. package/template/src/components/layout/PageContainer.tsx +16 -0
  424. package/template/src/components/ui/avatar.tsx +108 -0
  425. package/template/src/components/ui/badge.tsx +47 -0
  426. package/template/src/components/ui/button.tsx +63 -0
  427. package/template/src/components/ui/card.tsx +60 -0
  428. package/template/src/components/ui/checkbox.tsx +31 -0
  429. package/template/src/components/ui/collapsible.tsx +33 -0
  430. package/template/src/components/ui/command.tsx +181 -0
  431. package/template/src/components/ui/dialog.tsx +157 -0
  432. package/template/src/components/ui/dropdown-menu.tsx +254 -0
  433. package/template/src/components/ui/form.tsx +141 -0
  434. package/template/src/components/ui/input.tsx +20 -0
  435. package/template/src/components/ui/label.tsx +23 -0
  436. package/template/src/components/ui/pagination.tsx +127 -0
  437. package/template/src/components/ui/popover.tsx +41 -0
  438. package/template/src/components/ui/select.tsx +187 -0
  439. package/template/src/components/ui/separator.tsx +25 -0
  440. package/template/src/components/ui/sheet.tsx +142 -0
  441. package/template/src/components/ui/sidebar.tsx +878 -0
  442. package/template/src/components/ui/skeleton.tsx +13 -0
  443. package/template/src/components/ui/sonner.tsx +33 -0
  444. package/template/src/components/ui/tooltip.tsx +54 -0
  445. package/template/src/config/RuntimeConfigErrorPage.tsx +48 -0
  446. package/template/src/config/appConfig.ts +126 -0
  447. package/template/src/config/buildInfo.ts +8 -0
  448. package/template/src/config/observabilityAdapter.ts +8 -0
  449. package/template/src/config/runtimeConfig.ts +360 -0
  450. package/template/src/config/types.ts +195 -0
  451. package/template/src/context/ThemeProvider.tsx +84 -0
  452. package/template/src/context/UnsavedChangesProvider.tsx +123 -0
  453. package/template/src/context/applicationScope.ts +39 -0
  454. package/template/src/context/types.ts +41 -0
  455. package/template/src/dataMasking/index.ts +14 -0
  456. package/template/src/dataMasking/masking.ts +139 -0
  457. package/template/src/dataMasking/types.ts +144 -0
  458. package/template/src/featureFlags/FeatureFlagProvider.tsx +143 -0
  459. package/template/src/featureFlags/FeatureGate.tsx +12 -0
  460. package/template/src/featureFlags/catalog.ts +140 -0
  461. package/template/src/featureFlags/errors.ts +17 -0
  462. package/template/src/featureFlags/index.ts +43 -0
  463. package/template/src/featureFlags/query.ts +103 -0
  464. package/template/src/featureFlags/registry.ts +149 -0
  465. package/template/src/featureFlags/scope.ts +27 -0
  466. package/template/src/featureFlags/types.ts +241 -0
  467. package/template/src/features/auth/AuthLayout.tsx +17 -0
  468. package/template/src/features/auth/index.ts +2 -0
  469. package/template/src/features/auth/signIn/components/UserAuthForm.tsx +121 -0
  470. package/template/src/features/auth/signIn/index.tsx +71 -0
  471. package/template/src/features/auth/signIn/messages.ts +37 -0
  472. package/template/src/features/auth/signIn/types.ts +4 -0
  473. package/template/src/features/errors/ForbiddenError.tsx +34 -0
  474. package/template/src/features/errors/GeneralError.tsx +46 -0
  475. package/template/src/features/errors/MaintenanceError.tsx +31 -0
  476. package/template/src/features/errors/NotFoundError.tsx +34 -0
  477. package/template/src/features/errors/RouteError.tsx +72 -0
  478. package/template/src/features/errors/UnauthorizedError.tsx +34 -0
  479. package/template/src/features/errors/index.ts +6 -0
  480. package/template/src/features/errors/messages.ts +56 -0
  481. package/template/src/features/home/index.tsx +107 -0
  482. package/template/src/features/home/messages.ts +59 -0
  483. package/template/src/features/showcase/AccessShowcasePage.tsx +284 -0
  484. package/template/src/features/showcase/AdvancedTableDemo.tsx +120 -0
  485. package/template/src/features/showcase/FeedbackShowcasePage.tsx +142 -0
  486. package/template/src/features/showcase/FileShowcasePage.tsx +110 -0
  487. package/template/src/features/showcase/FormShowcasePage.tsx +156 -0
  488. package/template/src/features/showcase/MetadataShowcasePage.tsx +241 -0
  489. package/template/src/features/showcase/ShowcasePageHeader.tsx +24 -0
  490. package/template/src/features/showcase/TableShowcasePage.tsx +436 -0
  491. package/template/src/features/showcase/accessMessages.ts +67 -0
  492. package/template/src/features/showcase/index.ts +6 -0
  493. package/template/src/features/showcase/messages.ts +192 -0
  494. package/template/src/files/download.ts +82 -0
  495. package/template/src/files/errors.ts +15 -0
  496. package/template/src/files/filename.ts +61 -0
  497. package/template/src/files/index.ts +38 -0
  498. package/template/src/files/types.ts +299 -0
  499. package/template/src/files/useFileTask.ts +153 -0
  500. package/template/src/files/useFileUpload.ts +117 -0
  501. package/template/src/files/validation.ts +109 -0
  502. package/template/src/layouts/AppLayout.tsx +37 -0
  503. package/template/src/lib/accessControl.ts +42 -0
  504. package/template/src/lib/navigationRedirect.ts +26 -0
  505. package/template/src/lib/utils.ts +6 -0
  506. package/template/src/locale/LocaleProvider.tsx +37 -0
  507. package/template/src/locale/context.ts +15 -0
  508. package/template/src/locale/formatters.ts +123 -0
  509. package/template/src/locale/hooks.ts +35 -0
  510. package/template/src/locale/index.ts +17 -0
  511. package/template/src/locale/messages.ts +151 -0
  512. package/template/src/locale/types.ts +167 -0
  513. package/template/src/main.tsx +5 -0
  514. package/template/src/observability/browser.ts +37 -0
  515. package/template/src/observability/consoleAdapter.ts +18 -0
  516. package/template/src/observability/index.ts +26 -0
  517. package/template/src/observability/observer.ts +118 -0
  518. package/template/src/observability/redaction.ts +85 -0
  519. package/template/src/observability/types.ts +119 -0
  520. package/template/src/optionalEditors/controller.ts +327 -0
  521. package/template/src/optionalEditors/errors.ts +21 -0
  522. package/template/src/optionalEditors/index.ts +35 -0
  523. package/template/src/optionalEditors/model.ts +253 -0
  524. package/template/src/optionalEditors/react.ts +89 -0
  525. package/template/src/optionalEditors/types.ts +254 -0
  526. package/template/src/permissions/index.ts +3 -0
  527. package/template/src/permissions/types.ts +5 -0
  528. package/template/src/permissions/usePermission.ts +16 -0
  529. package/template/src/realtimeCollaboration/controller.ts +355 -0
  530. package/template/src/realtimeCollaboration/errors.ts +20 -0
  531. package/template/src/realtimeCollaboration/index.ts +39 -0
  532. package/template/src/realtimeCollaboration/model.ts +212 -0
  533. package/template/src/realtimeCollaboration/react.ts +72 -0
  534. package/template/src/realtimeCollaboration/types.ts +251 -0
  535. package/template/src/reporting/errors.ts +21 -0
  536. package/template/src/reporting/generation.ts +87 -0
  537. package/template/src/reporting/index.ts +42 -0
  538. package/template/src/reporting/model.ts +373 -0
  539. package/template/src/reporting/print.ts +16 -0
  540. package/template/src/reporting/query.ts +50 -0
  541. package/template/src/reporting/react.ts +17 -0
  542. package/template/src/reporting/source.ts +13 -0
  543. package/template/src/reporting/types.ts +219 -0
  544. package/template/src/router/RootRouteLayout.tsx +11 -0
  545. package/template/src/router/authLifecycle.ts +39 -0
  546. package/template/src/router/config.ts +293 -0
  547. package/template/src/router/interceptors.ts +48 -0
  548. package/template/src/router/lazyRouteComponents.ts +78 -0
  549. package/template/src/router/messages.ts +48 -0
  550. package/template/src/router/navigation.ts +167 -0
  551. package/template/src/router/router.ts +66 -0
  552. package/template/src/router/searchSchemas.ts +9 -0
  553. package/template/src/router/types.ts +76 -0
  554. package/template/src/stores/authSessionStorage.ts +27 -0
  555. package/template/src/stores/authStore.ts +165 -0
  556. package/template/src/stores/types.ts +36 -0
  557. package/template/src/stores/uiPreferenceStore.ts +34 -0
  558. package/template/src/styles/index.css +141 -0
  559. package/template/src/styles/theme.css +213 -0
  560. package/template/src/tenantWorkspace/TenantWorkspaceProvider.tsx +102 -0
  561. package/template/src/tenantWorkspace/index.ts +33 -0
  562. package/template/src/tenantWorkspace/store.ts +184 -0
  563. package/template/src/tenantWorkspace/switch.ts +206 -0
  564. package/template/src/tenantWorkspace/types.ts +155 -0
  565. package/template/src/vite-env.d.ts +20 -0
  566. package/template/stylelint.config.js +28 -0
  567. package/template/tests/integration/Application.test.tsx +269 -0
  568. package/template/tests/integration/layout/AppHeader.test.tsx +182 -0
  569. package/template/tests/integration/layout/AppSidebar.test.tsx +121 -0
  570. package/template/tests/integration/layout/__screenshots__/AppHeader.test.tsx/AppHeader-command-search-hides-the-duplicate-header-trigger-when-the-desktop-sidebar-collapses-1.png +0 -0
  571. package/template/tests/integration/router/__screenshots__/config.test.ts/route-tree-authentication-boundaries-exposes-only-scaffold-navigation-metadata-1.png +0 -0
  572. package/template/tests/integration/router/config.test.ts +123 -0
  573. package/template/tests/integration/router/interceptors.test.ts +100 -0
  574. package/template/tests/setup/accessibility.ts +25 -0
  575. package/template/tests/setup/runtimeConfig.ts +3 -0
  576. package/template/tests/unit/api/ApiError.test.ts +25 -0
  577. package/template/tests/unit/api/__screenshots__/authSession.test.ts/administrator-authentication-clears-the-session-if-a-refresh-identity-loses-administrator-access-1.png +0 -0
  578. package/template/tests/unit/api/__screenshots__/authSession.test.ts/administrator-authentication-creates-a-session-from-the-generated-login-response-for-an-admin-1.png +0 -0
  579. package/template/tests/unit/api/__screenshots__/authSession.test.ts/administrator-authentication-rejects-and-revokes-the-generated-login-result-for-an-ordinary-user-1.png +0 -0
  580. package/template/tests/unit/api/activity/ActivityProvider.test.tsx +131 -0
  581. package/template/tests/unit/api/activity/__screenshots__/transports.test.ts/activity-transport-adapters-polls-sequentially-and-advances-the-last-event-ID-1.png +0 -0
  582. package/template/tests/unit/api/activity/modelAndQuery.test.ts +144 -0
  583. package/template/tests/unit/api/activity/subscription.test.ts +103 -0
  584. package/template/tests/unit/api/activity/transports.test.ts +145 -0
  585. package/template/tests/unit/api/authClient.test.ts +110 -0
  586. package/template/tests/unit/api/authSession.test.ts +289 -0
  587. package/template/tests/unit/api/clients/configureApiClient.test.ts +198 -0
  588. package/template/tests/unit/api/demoAuthClient.test.ts +47 -0
  589. package/template/tests/unit/api/enums/access.test.ts +107 -0
  590. package/template/tests/unit/api/enums/catalog.test.ts +200 -0
  591. package/template/tests/unit/api/enums/query.test.ts +110 -0
  592. package/template/tests/unit/api/enums/useEnum.test.tsx +98 -0
  593. package/template/tests/unit/api/enums/useEnumCatalog.test.tsx +68 -0
  594. package/template/tests/unit/api/hooks/error.test.ts +168 -0
  595. package/template/tests/unit/api/hooks/request.test.ts +170 -0
  596. package/template/tests/unit/api/hooks/response.test.ts +46 -0
  597. package/template/tests/unit/api/metadata/MetadataProvider.test.tsx +102 -0
  598. package/template/tests/unit/api/parameters/catalog.test.ts +147 -0
  599. package/template/tests/unit/api/parameters/query.test.ts +78 -0
  600. package/template/tests/unit/api/parameters/useGlobalParameter.test.tsx +89 -0
  601. package/template/tests/unit/api/query/queryPolicy.test.ts +245 -0
  602. package/template/tests/unit/api/query/useAppQueryScope.test.tsx +74 -0
  603. package/template/tests/unit/auditLogs/auditLogHooks.test.tsx +194 -0
  604. package/template/tests/unit/auditLogs/auditLogs.test.ts +199 -0
  605. package/template/tests/unit/authentication/__screenshots__/authentication.test.ts/authentication-controller-completes-Step-up-callbacks-without-creating-a-second-login-result-1.png +0 -0
  606. package/template/tests/unit/authentication/__screenshots__/authentication.test.ts/authentication-controller-moves-from-challenge-to-completion-without-retaining-tokens-in-snapshot-1.png +0 -0
  607. package/template/tests/unit/authentication/authentication.test.ts +376 -0
  608. package/template/tests/unit/components/AppDialog.test.tsx +225 -0
  609. package/template/tests/unit/components/AppTable.test.tsx +129 -0
  610. package/template/tests/unit/components/AppTableLayoutTransition.test.ts +118 -0
  611. package/template/tests/unit/components/AppTableLocalization.test.ts +58 -0
  612. package/template/tests/unit/components/AppTableSensitiveData.test.ts +35 -0
  613. package/template/tests/unit/components/AppTableUpgrade.test.tsx +179 -0
  614. package/template/tests/unit/components/AppTableUpgradeCore.test.ts +258 -0
  615. package/template/tests/unit/components/BrandLogo.test.tsx +24 -0
  616. package/template/tests/unit/components/Can.test.tsx +80 -0
  617. package/template/tests/unit/components/Dialog.test.tsx +56 -0
  618. package/template/tests/unit/components/EnumPresentation.test.tsx +64 -0
  619. package/template/tests/unit/components/FilePreviewEngine.test.ts +51 -0
  620. package/template/tests/unit/components/JsonEditor.test.tsx +47 -0
  621. package/template/tests/unit/components/LocalizedSharedComponents.test.tsx +36 -0
  622. package/template/tests/unit/components/OverlayLayer.test.tsx +151 -0
  623. package/template/tests/unit/components/PageFeedback.test.tsx +143 -0
  624. package/template/tests/unit/components/PageForm.test.tsx +272 -0
  625. package/template/tests/unit/components/PageFormCore.test.ts +74 -0
  626. package/template/tests/unit/components/PasswordInput.test.tsx +105 -0
  627. package/template/tests/unit/components/ScaffoldComponents.test.tsx +64 -0
  628. package/template/tests/unit/components/SensitiveData.test.tsx +151 -0
  629. package/template/tests/unit/components/StatusBadge.test.tsx +36 -0
  630. package/template/tests/unit/components/TableComponent.test.tsx +644 -0
  631. package/template/tests/unit/components/TableCore.test.ts +145 -0
  632. package/template/tests/unit/components/ThemeAccessibility.test.tsx +27 -0
  633. package/template/tests/unit/components/__screenshots__/BatchOperationDialog.test.tsx/confirms-a-batch-action-and-presents-partial-failure-details-1.png +0 -0
  634. package/template/tests/unit/components/__screenshots__/PageForm.test.tsx/PageForm-writes-uploaded-values-through-the-public-file-field-and-resets-dirty-state-1.png +0 -0
  635. package/template/tests/unit/components/__screenshots__/PasswordInput.test.tsx/PasswordInput-toggles-the-password-visibility-when-the-show-password-button-is-clicked-1.png +0 -0
  636. package/template/tests/unit/components/__screenshots__/TableComponent.test.tsx/TableComponent-pins-trailing-action-columns-and-removes-their-header-menu-by-default-1.png +0 -0
  637. package/template/tests/unit/components/__screenshots__/TableComponent.test.tsx/TableComponent-renders-shadcn-components-through-cellComponent-1.png +0 -0
  638. package/template/tests/unit/components/__screenshots__/TableComponent.test.tsx/TableComponent-renders-the-toolbar-without-a-bottom-divider-1.png +0 -0
  639. package/template/tests/unit/components/__screenshots__/TableComponent.test.tsx/TableComponent-resyncs-adaptive-height-after-a-column-resize-changes-wrapped-row-height-1.png +0 -0
  640. package/template/tests/unit/config/RuntimeConfigErrorPage.test.tsx +23 -0
  641. package/template/tests/unit/config/appConfig.test.ts +98 -0
  642. package/template/tests/unit/config/appTableContracts.test.mjs +120 -0
  643. package/template/tests/unit/config/bundleBudget.test.mjs +190 -0
  644. package/template/tests/unit/config/componentGovernance.test.mjs +156 -0
  645. package/template/tests/unit/config/deployConfig.test.mjs +211 -0
  646. package/template/tests/unit/config/eslintConfig.test.mjs +101 -0
  647. package/template/tests/unit/config/featureBoundaries.test.mjs +126 -0
  648. package/template/tests/unit/config/npmPackage.test.mjs +37 -0
  649. package/template/tests/unit/config/releaseArtifact.test.mjs +105 -0
  650. package/template/tests/unit/config/runtimeConfig.test.ts +225 -0
  651. package/template/tests/unit/config/scaffoldCheck.test.mjs +53 -0
  652. package/template/tests/unit/config/scaffoldFeature.test.mjs +177 -0
  653. package/template/tests/unit/config/scaffoldInit.test.mjs +218 -0
  654. package/template/tests/unit/config/scaffoldProject.test.mjs +378 -0
  655. package/template/tests/unit/config/scaffoldTransaction.test.mjs +77 -0
  656. package/template/tests/unit/config/viteConfig.test.mjs +371 -0
  657. package/template/tests/unit/context/ThemeProvider.test.tsx +108 -0
  658. package/template/tests/unit/context/UnsavedChangesProvider.test.tsx +94 -0
  659. package/template/tests/unit/context/__screenshots__/ThemeProvider.test.tsx/ThemeProvider-uses-the-neutral-black-palette-for-the-app-and-scoped-table-theme-1.png +0 -0
  660. package/template/tests/unit/context/applicationScope.test.ts +62 -0
  661. package/template/tests/unit/dataMasking/dataMasking.test.ts +95 -0
  662. package/template/tests/unit/featureFlags/featureFlags.test.ts +169 -0
  663. package/template/tests/unit/featureFlags/useFeatureFlag.test.tsx +108 -0
  664. package/template/tests/unit/features/FeatureLocalization.test.tsx +54 -0
  665. package/template/tests/unit/features/RouteError.test.tsx +40 -0
  666. package/template/tests/unit/features/auth/signIn/UserAuthForm.test.tsx +79 -0
  667. package/template/tests/unit/features/auth/signIn/__screenshots__/UserAuthForm.test.tsx/UserAuthForm-passes-validated-values-to-onSubmit-1.png +0 -0
  668. package/template/tests/unit/features/auth/signIn/__screenshots__/UserAuthForm.test.tsx/UserAuthForm-shows-validation-messages-when-submitting-an-empty-form-1.png +0 -0
  669. package/template/tests/unit/files/fileHooks.test.tsx +130 -0
  670. package/template/tests/unit/files/files.test.ts +112 -0
  671. package/template/tests/unit/lib/accessControl.test.ts +69 -0
  672. package/template/tests/unit/locale/locale.test.tsx +90 -0
  673. package/template/tests/unit/observability/browser.test.ts +48 -0
  674. package/template/tests/unit/observability/observer.test.ts +115 -0
  675. package/template/tests/unit/optionalEditors/__screenshots__/useOptionalEditor.test.tsx/useOptionalEditor-fails-permission-precheck-before-loading-the-project-SDK-1.png +0 -0
  676. package/template/tests/unit/optionalEditors/__screenshots__/useOptionalEditor.test.tsx/useOptionalEditor-mounts-a-route-scoped-SDK-into-the-dedicated-host-with-permission-1.png +0 -0
  677. package/template/tests/unit/optionalEditors/optionalEditors.test.ts +313 -0
  678. package/template/tests/unit/optionalEditors/useOptionalEditor.test.tsx +141 -0
  679. package/template/tests/unit/realtimeCollaboration/collaboration.test.ts +240 -0
  680. package/template/tests/unit/realtimeCollaboration/useRealtimeCollaboration.test.tsx +115 -0
  681. package/template/tests/unit/reporting/reporting.test.ts +195 -0
  682. package/template/tests/unit/reporting/reportingHooks.test.tsx +203 -0
  683. package/template/tests/unit/router/authLifecycle.test.ts +55 -0
  684. package/template/tests/unit/router/navigation.test.ts +55 -0
  685. package/template/tests/unit/router/redirects.test.ts +22 -0
  686. package/template/tests/unit/scaffoldFeatureTemplate/featureTemplate.test.ts +42 -0
  687. package/template/tests/unit/scaffoldFeatureTemplate/publicContract.test.ts +28 -0
  688. package/template/tests/unit/scaffoldFeatureTemplate/queries.test.tsx +289 -0
  689. package/template/tests/unit/stores/authStore.test.ts +128 -0
  690. package/template/tests/unit/stores/uiPreferenceStore.test.ts +56 -0
  691. package/template/tests/unit/tenantWorkspace/tenantWorkspace.test.tsx +261 -0
  692. package/template/tools/bundle/budgets.json +48 -0
  693. package/template/tools/bundle/check.mjs +307 -0
  694. package/template/tools/component-governance/check.mjs +703 -0
  695. package/template/tools/component-governance/manifest.json +112 -0
  696. package/template/tools/deployment/browser-smoke.mjs +76 -0
  697. package/template/tools/deployment/browser-smoke.sh +141 -0
  698. package/template/tools/openapi/generate.mjs +268 -0
  699. package/template/tools/openapi/templates/README.md +14 -0
  700. package/template/tools/openapi/templates/base/README.md +7 -0
  701. package/template/tools/openapi/templates/base/data-contracts.eta +44 -0
  702. package/template/tools/openapi/templates/base/http-client.eta +3 -0
  703. package/template/tools/openapi/templates/base/http-clients/axios-http-client.eta +132 -0
  704. package/template/tools/openapi/templates/base/http-clients/fetch-http-client.eta +220 -0
  705. package/template/tools/openapi/templates/base/route-docs.eta +31 -0
  706. package/template/tools/openapi/templates/base/route-name.eta +43 -0
  707. package/template/tools/openapi/templates/base/route-type.eta +22 -0
  708. package/template/tools/openapi/templates/default/README.md +7 -0
  709. package/template/tools/openapi/templates/default/api.eta +67 -0
  710. package/template/tools/openapi/templates/default/http-client.eta +137 -0
  711. package/template/tools/openapi/templates/default/procedure-call.eta +99 -0
  712. package/template/tools/openapi/templates/default/route-docs.eta +40 -0
  713. package/template/tools/openapi/templates/default/route-types.eta +28 -0
  714. package/template/tools/openapi/templates/modular/README.md +7 -0
  715. package/template/tools/openapi/templates/modular/api.eta +28 -0
  716. package/template/tools/openapi/templates/modular/procedure-call.eta +99 -0
  717. package/template/tools/openapi/templates/modular/route-types.eta +18 -0
  718. package/template/tools/release/artifact.mjs +258 -0
  719. package/template/tools/scaffold/add-capability.mjs +409 -0
  720. package/template/tools/scaffold/capability-catalog.json +163 -0
  721. package/template/tools/scaffold/check.mjs +326 -0
  722. package/template/tools/scaffold/create-feature.mjs +444 -0
  723. package/template/tools/scaffold/create-project.mjs +482 -0
  724. package/template/tools/scaffold/init.example.json +64 -0
  725. package/template/tools/scaffold/init.mjs +419 -0
  726. package/template/tools/scaffold/lockfile.mjs +193 -0
  727. package/template/tools/scaffold/templates/feature/index.ts +19 -0
  728. package/template/tools/scaffold/templates/feature/model.ts +142 -0
  729. package/template/tools/scaffold/templates/feature/queries.ts +154 -0
  730. package/template/tools/scaffold/templates/feature/repository.ts +206 -0
  731. package/template/tools/scaffold/templates/feature/types.ts +168 -0
  732. package/template/tools/scaffold/workspace-transaction.mjs +111 -0
  733. package/template/tsconfig.app.json +31 -0
  734. package/template/tsconfig.json +12 -0
  735. package/template/tsconfig.node.json +24 -0
  736. package/template/vite.config.ts +121 -0
@@ -0,0 +1,156 @@
1
+ import assert from 'node:assert/strict'
2
+ import { spawnSync } from 'node:child_process'
3
+ import { mkdtemp, mkdir, readFile, rm, writeFile } from 'node:fs/promises'
4
+ import os from 'node:os'
5
+ import path from 'node:path'
6
+ import test from 'node:test'
7
+
8
+ const strProjectRoot = path.resolve(import.meta.dirname, '../../..')
9
+ const strGovernanceScript = path.resolve(
10
+ strProjectRoot,
11
+ 'tools/component-governance/check.mjs'
12
+ )
13
+
14
+ const fnRunGovernance = (...arrArguments) =>
15
+ spawnSync(process.execPath, [strGovernanceScript, ...arrArguments], {
16
+ cwd: strProjectRoot,
17
+ encoding: 'utf8',
18
+ })
19
+
20
+ const fnRunGit = (strDirectory, ...arrArguments) => {
21
+ const objResult = spawnSync('git', ['-C', strDirectory, ...arrArguments], {
22
+ encoding: 'utf8',
23
+ })
24
+ assert.equal(objResult.status, 0, objResult.stderr)
25
+ return objResult.stdout.trim()
26
+ }
27
+
28
+ test('component governance validates source, regression and license evidence', async () => {
29
+ const objManifest = JSON.parse(
30
+ await readFile(
31
+ path.join(strProjectRoot, 'tools/component-governance/manifest.json'),
32
+ 'utf8'
33
+ )
34
+ )
35
+ const objResult = fnRunGovernance('check')
36
+
37
+ assert.equal(objResult.status, 0, objResult.stderr || objResult.stdout)
38
+ assert.match(objResult.stdout, /COMPONENT_GOVERNANCE_READY/)
39
+ assert.match(
40
+ objResult.stdout,
41
+ new RegExp(`${objManifest.components.length} 个内建组件`)
42
+ )
43
+ assert.match(
44
+ objResult.stdout,
45
+ new RegExp(`${objManifest.thirdParty.length} 个第三方许可证边界`)
46
+ )
47
+ })
48
+
49
+ test('component diff reports a clean forward-only upgrade without mutating source', async () => {
50
+ const strTemporaryRoot = await mkdtemp(
51
+ path.join(os.tmpdir(), 'component-governance-')
52
+ )
53
+ const strSourceRoot = path.resolve(strTemporaryRoot, 'page-form')
54
+ const strSourceFile = path.resolve(
55
+ strSourceRoot,
56
+ 'packages/core/src/value.ts'
57
+ )
58
+ const strAddedFile = path.resolve(strSourceRoot, 'packages/core/src/added.ts')
59
+ const strManifestPath = path.resolve(strTemporaryRoot, 'manifest.json')
60
+
61
+ try {
62
+ await mkdir(path.dirname(strSourceFile), { recursive: true })
63
+ fnRunGit(strTemporaryRoot, 'init', strSourceRoot)
64
+ fnRunGit(strSourceRoot, 'config', 'user.name', 'Component Test')
65
+ fnRunGit(strSourceRoot, 'config', 'user.email', 'component@example.test')
66
+ fnRunGit(
67
+ strSourceRoot,
68
+ 'remote',
69
+ 'add',
70
+ 'origin',
71
+ 'ssh://git@example.test/frontend/package/page-form.git'
72
+ )
73
+ await writeFile(strSourceFile, 'export const nValue = 1\n')
74
+ fnRunGit(strSourceRoot, 'add', '.')
75
+ fnRunGit(strSourceRoot, 'commit', '-m', 'feat: initial source')
76
+ const strBaseRevision = fnRunGit(strSourceRoot, 'rev-parse', 'HEAD')
77
+
78
+ await writeFile(strSourceFile, 'export const nValue = 2\n')
79
+ await writeFile(strAddedFile, 'export const bAdded = true\n')
80
+ fnRunGit(strSourceRoot, 'add', '.')
81
+ fnRunGit(strSourceRoot, 'commit', '-m', 'feat: candidate source')
82
+
83
+ await writeFile(
84
+ strManifestPath,
85
+ JSON.stringify({
86
+ schemaVersion: 1,
87
+ components: [
88
+ {
89
+ name: 'AppPageForm',
90
+ localPath: 'src/components/AppPageForm',
91
+ publicEntry: 'src/components/AppPageForm/index.ts',
92
+ sourceNote: 'src/components/AppPageForm/SOURCE.md',
93
+ source: {
94
+ repository: 'frontend/package/page-form',
95
+ revision: strBaseRevision,
96
+ packageVersion: '0.1.0',
97
+ importedAt: '2026-08-27',
98
+ includedPaths: ['packages/core/src'],
99
+ excludedCapabilities: ['examples'],
100
+ license: {
101
+ status: 'not-provided',
102
+ distributionPolicy: 'internal-only',
103
+ },
104
+ },
105
+ localAdaptations: ['application boundary'],
106
+ regressionTests: ['tests/unit/components/PageForm.test.tsx'],
107
+ requiredCommands: ['pnpm components:check', 'pnpm verify'],
108
+ },
109
+ ],
110
+ thirdParty: [],
111
+ })
112
+ )
113
+
114
+ const objResult = fnRunGovernance(
115
+ 'diff',
116
+ '--',
117
+ '--component',
118
+ 'AppPageForm',
119
+ '--source-root',
120
+ strSourceRoot,
121
+ '--manifest',
122
+ strManifestPath
123
+ )
124
+
125
+ assert.equal(objResult.status, 0, objResult.stderr || objResult.stdout)
126
+ assert.match(objResult.stdout, /COMPONENT_UPGRADE_AVAILABLE/)
127
+ assert.match(objResult.stdout, /M\s+packages\/core\/src\/value\.ts/)
128
+ assert.match(objResult.stdout, /A\s+packages\/core\/src\/added\.ts/)
129
+ assert.match(objResult.stdout, /本命令不会修改本地组件或清单/)
130
+ assert.equal(fnRunGit(strSourceRoot, 'status', '--porcelain=v1'), '')
131
+
132
+ await writeFile(strAddedFile, 'export const bAdded = false\n')
133
+ const objDirtyResult = fnRunGovernance(
134
+ 'diff',
135
+ '--',
136
+ '--component',
137
+ 'AppPageForm',
138
+ '--source-root',
139
+ strSourceRoot,
140
+ '--manifest',
141
+ strManifestPath
142
+ )
143
+ assert.equal(objDirtyResult.status, 1)
144
+ assert.match(objDirtyResult.stderr, /COMPONENT_SOURCE_DIRTY/)
145
+ } finally {
146
+ await rm(strTemporaryRoot, { recursive: true, force: true })
147
+ }
148
+ })
149
+
150
+ test('component governance rejects unsupported commands with a stable fix', () => {
151
+ const objResult = fnRunGovernance('sync')
152
+
153
+ assert.equal(objResult.status, 1)
154
+ assert.match(objResult.stderr, /COMPONENT_GOVERNANCE_ARGUMENT_INVALID/)
155
+ assert.match(objResult.stderr, /pnpm components:check/)
156
+ })
@@ -0,0 +1,211 @@
1
+ import assert from 'node:assert/strict'
2
+ import { readFile } from 'node:fs/promises'
3
+ import path from 'node:path'
4
+ import test from 'node:test'
5
+ import { fileURLToPath } from 'node:url'
6
+
7
+ const strProjectRoot = path.resolve(
8
+ path.dirname(fileURLToPath(import.meta.url)),
9
+ '../../..'
10
+ )
11
+
12
+ async function fnReadProjectFile(strPath) {
13
+ return readFile(path.resolve(strProjectRoot, strPath), 'utf8')
14
+ }
15
+
16
+ test('GitLab promotes one verified artifact by immutable image digest', async () => {
17
+ const strPipeline = await fnReadProjectFile('.gitlab-ci.yml')
18
+ const strDockerfile = await fnReadProjectFile('Dockerfile')
19
+ const strBrowserSmoke = await fnReadProjectFile(
20
+ 'tools/deployment/browser-smoke.sh'
21
+ )
22
+ const strLocalBrowserSmoke = await fnReadProjectFile(
23
+ 'tools/deployment/browser-smoke.mjs'
24
+ )
25
+ const objPackage = JSON.parse(await fnReadProjectFile('package.json'))
26
+ const strPackageJob = strPipeline.slice(
27
+ strPipeline.indexOf('\npackage:'),
28
+ strPipeline.indexOf('\ndeploy:')
29
+ )
30
+ const strDeployJob = strPipeline.slice(strPipeline.indexOf('\ndeploy:'))
31
+
32
+ assert.match(strPipeline, /CI_COMMIT_BRANCH == "main"/)
33
+ assert.match(strPipeline, /docker build/)
34
+ assert.match(strPipeline, /APP_COMMIT_SHA="\$CI_COMMIT_SHA"/)
35
+ assert.match(strPipeline, /pnpm release:prepare/)
36
+ assert.match(strPipeline, /pnpm release:verify --commit/)
37
+ assert.match(strPipeline, /tar -cf - tools\/release\/artifact\.mjs/)
38
+ assert.doesNotMatch(strPipeline, /-v "\$CI_PROJECT_DIR:\/workspace"/)
39
+ assert.match(strPipeline, /\.artifacts\/release\//)
40
+ assert.match(strPipeline, /RELEASE_IMAGE_TAG.*CI_COMMIT_SHA/)
41
+ assert.match(strPipeline, /docker push "\$RELEASE_IMAGE_TAG"/)
42
+ assert.match(strPipeline, /RELEASE_IMAGE_DIGEST/)
43
+ assert.match(strPipeline, /dotenv: release\.env/)
44
+ assert.match(strPipeline, /ENABLE_PRODUCTION_DEPLOY: 'false'/)
45
+ assert.match(strPipeline, /ENABLE_PRODUCTION_DEPLOY == "true"/)
46
+ assert.match(strPipeline, /when: manual/)
47
+ assert.match(strPipeline, /ADMIN_PUBLIC_URL.*必须使用 HTTPS/s)
48
+ assert.match(strPipeline, /ADMIN_PUBLIC_URL 不能使用示例域名/)
49
+ assert.match(strPipeline, /ADMIN_RUNTIME_CONFIG_FILE/)
50
+ assert.match(strPipeline, /docker cp.*runtime-config\.json/s)
51
+ assert.match(strPipeline, /readFileSync\(0, 'utf8'\)/)
52
+ assert.doesNotMatch(
53
+ strPipeline,
54
+ /ADMIN_RUNTIME_CONFIG_FILE:\/runtime-config\.json/
55
+ )
56
+ assert.doesNotMatch(strPipeline, /\(200\|301\|302\|401\|403\|404\|502\)/)
57
+ assert.match(strPipeline, /candidate-\$\{CI_COMMIT_SHORT_SHA\}/)
58
+ assert.match(
59
+ strDeployJob,
60
+ /--network "container:\$CI_PROJECT_NAME-candidate-\$\{CI_COMMIT_SHORT_SHA\}"/
61
+ )
62
+ assert.match(strDeployJob, /mcr\.microsoft\.com\/playwright:v1\.59\.1-noble/)
63
+ assert.match(
64
+ strDeployJob,
65
+ /sh -s -- http:\/\/127\.0\.0\.1\/sign-in[\s\S]*browser-smoke\.sh/
66
+ )
67
+ assert.doesNotMatch(strDeployJob, /docker exec.*wget -q --spider/s)
68
+ assert.match(strBrowserSmoke, /--dump-dom/)
69
+ assert.match(strBrowserSmoke, /--timeout=10000/)
70
+ assert.match(strBrowserSmoke, /<form\(\[\[:space:\]>\]\)/)
71
+ assert.match(strBrowserSmoke, /DEPLOY_BROWSER_SMOKE_APP_NOT_READY/)
72
+ assert.match(strBrowserSmoke, /DEPLOY_BROWSER_SMOKE_TIMEOUT/)
73
+ assert.equal(
74
+ objPackage.scripts['deployment:smoke'],
75
+ 'node tools/deployment/browser-smoke.mjs'
76
+ )
77
+ assert.match(strLocalBrowserSmoke, /from 'playwright'/)
78
+ assert.match(strLocalBrowserSmoke, /locator\('form'\)/)
79
+ assert.match(strLocalBrowserSmoke, /DEPLOY_BROWSER_SMOKE_APP_NOT_READY/)
80
+ assert.match(strDeployJob, /docker pull "\$RELEASE_IMAGE_DIGEST"/)
81
+ assert.match(strDeployJob, /org\.opencontainers\.image\.revision/)
82
+ assert.match(strDeployJob, /sha256sum -c/)
83
+ assert.doesNotMatch(strDeployJob, /docker build/)
84
+ assert.ok(
85
+ strPackageJob.indexOf('artifact.mjs verify') <
86
+ strPackageJob.indexOf('docker build')
87
+ )
88
+ assert.ok(
89
+ strPackageJob.indexOf('docker build') < strPackageJob.indexOf('docker push')
90
+ )
91
+ assert.match(strPipeline, /ADMIN_WEB_HOST_PORT: '8084'/)
92
+ assert.match(strPipeline, /127\.0\.0\.1:\$\{ADMIN_WEB_HOST_PORT\}:80/)
93
+ assert.doesNotMatch(strDeployJob, /chroot \/host nginx/)
94
+ assert.match(strDockerfile, /ARG APP_COMMIT_SHA=unknown/)
95
+ assert.match(strDockerfile, /org\.opencontainers\.image\.revision/)
96
+ assert.match(strDockerfile, /artifact-manifest\.sha256/)
97
+ assert.match(strDockerfile, /sha256sum -c/)
98
+ assert.match(strDockerfile, /test ! -e runtime-config\.json/)
99
+ assert.doesNotMatch(strDockerfile, /FROM node|pnpm install|pnpm verify/)
100
+ assert.match(strDeployJob, /trap fnRollbackPromotion EXIT HUP INT TERM/)
101
+ assert.match(
102
+ strDeployJob,
103
+ /docker rename "\$CI_PROJECT_NAME" "\$strRollbackName"/
104
+ )
105
+ assert.match(
106
+ strDeployJob,
107
+ /docker rename "\$strRollbackName" "\$CI_PROJECT_NAME"/
108
+ )
109
+ assert.ok(
110
+ strDeployJob.indexOf('wget -q --spider "$ADMIN_PUBLIC_URL/sign-in"') <
111
+ strDeployJob.lastIndexOf('docker rm -f "$strRollbackName"')
112
+ )
113
+ })
114
+
115
+ test('GitLab verifies branches and merge requests before deployment', async () => {
116
+ const strPipeline = await fnReadProjectFile('.gitlab-ci.yml')
117
+
118
+ assert.match(strPipeline, /stages:\s+- verify\s+- package\s+- deploy/s)
119
+ assert.match(strPipeline, /CI_PIPELINE_SOURCE == "merge_request_event"/)
120
+ assert.match(strPipeline, /CI_COMMIT_BRANCH && \$CI_OPEN_MERGE_REQUESTS/)
121
+ assert.match(
122
+ strPipeline,
123
+ /verify:\s+stage: verify[\s\S]*pnpm install --frozen-lockfile[\s\S]*pnpm verify/
124
+ )
125
+ assert.match(
126
+ strPipeline,
127
+ /package:\s+stage: package[\s\S]*needs:\s+- job: verify\s+artifacts: true/
128
+ )
129
+ assert.match(
130
+ strPipeline,
131
+ /deploy:\s+stage: deploy[\s\S]*needs:\s+- job: package\s+artifacts: true/
132
+ )
133
+ })
134
+
135
+ test('runtime image only packages the verified static artifact', async () => {
136
+ const strPipeline = await fnReadProjectFile('.gitlab-ci.yml')
137
+ const strDockerfile = await fnReadProjectFile('Dockerfile')
138
+ const strDockerIgnore = await fnReadProjectFile('.dockerignore')
139
+ const strEslintConfig = await fnReadProjectFile('eslint.config.js')
140
+ const strGitIgnore = await fnReadProjectFile('.gitignore')
141
+
142
+ assert.doesNotMatch(strPipeline, /CI_JOB_TOKEN|gitlab_job_token/)
143
+ assert.doesNotMatch(strDockerfile, /gitlab-ci-token|gitlab_job_token/)
144
+ assert.doesNotMatch(strDockerfile, /101\.96\.199\.120/)
145
+ assert.doesNotMatch(strDockerfile, /--mount=type=ssh/)
146
+ assert.doesNotMatch(strDockerfile, /package\.json|pnpm-lock|node_modules/)
147
+ assert.match(strDockerfile, /FROM nginx:stable-alpine@sha256:[a-f0-9]{64}/)
148
+ assert.match(strDockerfile, /COPY \.artifacts\/release\/site/)
149
+ assert.match(strDockerIgnore, /^\*\*/m)
150
+ assert.doesNotMatch(strDockerIgnore, /!package\.json|!pnpm-lock/)
151
+ assert.match(strEslintConfig, /ignores:\s*\[[\s\S]*?'\.artifacts'/)
152
+ assert.match(strGitIgnore, /^\.artifacts\/$/m)
153
+ })
154
+
155
+ test('nginx serves the SPA and keeps host config route-only', async () => {
156
+ const [strContainerConfig, strApiConfig, strWebConfig] = await Promise.all([
157
+ fnReadProjectFile('deploy/nginx.conf'),
158
+ fnReadProjectFile('deploy/host-nginx/react-admin-api.conf'),
159
+ fnReadProjectFile('deploy/host-nginx/react-admin-web.conf'),
160
+ ])
161
+
162
+ assert.match(strContainerConfig, /try_files \$uri \$uri\/ \/index\.html/)
163
+ const strExpectedCsp =
164
+ "default-src 'self'; base-uri 'self'; connect-src 'self'; " +
165
+ "font-src 'self' data:; form-action 'self'; frame-ancestors 'none'; " +
166
+ "frame-src 'self' blob: https:; img-src 'self' blob: data: https:; " +
167
+ "object-src 'none'; script-src 'self'; script-src-attr 'none'; " +
168
+ "style-src 'self' 'unsafe-inline'"
169
+ const objCspMatch = strContainerConfig.match(
170
+ /add_header Content-Security-Policy "([^"]+)" always;/
171
+ )
172
+
173
+ assert.equal(objCspMatch?.[1], strExpectedCsp)
174
+ assert.doesNotMatch(
175
+ objCspMatch?.[1] ?? '',
176
+ /unsafe-eval|script-src[^;]*unsafe-inline/
177
+ )
178
+ assert.match(strContainerConfig, /Strict-Transport-Security/)
179
+ assert.match(strContainerConfig, /Cross-Origin-Opener-Policy "same-origin"/)
180
+ assert.match(strContainerConfig, /Cross-Origin-Resource-Policy "same-origin"/)
181
+ assert.match(strContainerConfig, /Permissions-Policy "camera=\(\)/)
182
+ assert.match(strContainerConfig, /X-Frame-Options "DENY"/)
183
+ assert.match(strContainerConfig, /X-Content-Type-Options "nosniff"/)
184
+ assert.match(
185
+ strContainerConfig,
186
+ /runtime-config\.json "no-store, no-cache, must-revalidate"/
187
+ )
188
+ assert.doesNotMatch(strApiConfig, /server\s*{/)
189
+ assert.doesNotMatch(strWebConfig, /server\s*{/)
190
+ assert.match(strApiConfig, /location \/api\//)
191
+ assert.match(strApiConfig, /proxy_pass http:\/\/127\.0\.0\.1:18085/)
192
+ assert.match(strWebConfig, /proxy_pass http:\/\/127\.0\.0\.1:8084/)
193
+ })
194
+
195
+ test('CI blocks high-severity dependency advisories before packaging', async () => {
196
+ const [strPackage, strPipeline] = await Promise.all([
197
+ fnReadProjectFile('package.json'),
198
+ fnReadProjectFile('.gitlab-ci.yml'),
199
+ ])
200
+ const objPackage = JSON.parse(strPackage)
201
+
202
+ assert.equal(
203
+ objPackage.scripts['security:audit'],
204
+ 'pnpm audit --audit-level high'
205
+ )
206
+ assert.match(strPipeline, /pnpm verify\s+- pnpm security:audit/)
207
+ assert.ok(
208
+ strPipeline.indexOf('pnpm security:audit') <
209
+ strPipeline.indexOf('pnpm release:prepare')
210
+ )
211
+ })
@@ -0,0 +1,101 @@
1
+ import { ESLint } from 'eslint'
2
+ import assert from 'node:assert/strict'
3
+ import nodePath from 'node:path'
4
+ import test from 'node:test'
5
+
6
+ const strProjectRoot = nodePath.resolve(import.meta.dirname, '../../..')
7
+ const strBusinessFile = nodePath.join(
8
+ strProjectRoot,
9
+ 'src/components/layout/AppHeader/AppHeader.tsx'
10
+ )
11
+ const strBoundaryFile = nodePath.join(strProjectRoot, 'src/api/hooks/error.ts')
12
+ const objEslint = new ESLint({ cache: false, cwd: strProjectRoot })
13
+
14
+ async function fnReadRuleIds(strSource, strFilePath = strBusinessFile) {
15
+ const [objResult] = await objEslint.lintText(strSource, {
16
+ filePath: strFilePath,
17
+ })
18
+ return objResult.messages.map((objMessage) => objMessage.ruleId)
19
+ }
20
+
21
+ test('TypeScript rules reject explicit and propagated any values', async () => {
22
+ const arrExplicitAnyRules = await fnReadRuleIds(
23
+ 'const objValue: any = null\nvoid objValue\n'
24
+ )
25
+ const arrPropagatedAnyRules = await fnReadRuleIds(
26
+ "const objPayload = JSON.parse('{}')\nvoid objPayload.strValue\n"
27
+ )
28
+
29
+ assert.ok(arrExplicitAnyRules.includes('@typescript-eslint/no-explicit-any'))
30
+ assert.ok(
31
+ arrPropagatedAnyRules.includes('@typescript-eslint/no-unsafe-assignment')
32
+ )
33
+ assert.ok(
34
+ arrPropagatedAnyRules.includes('@typescript-eslint/no-unsafe-member-access')
35
+ )
36
+ })
37
+
38
+ test('unknown is restricted to declared external-data boundaries', async () => {
39
+ const strSource = 'const objValue: unknown = null\nvoid objValue\n'
40
+ const arrBusinessRuleIds = await fnReadRuleIds(strSource)
41
+ const arrBoundaryRuleIds = await fnReadRuleIds(strSource, strBoundaryFile)
42
+
43
+ assert.ok(
44
+ arrBusinessRuleIds.includes('@typescript-eslint/no-restricted-types')
45
+ )
46
+ assert.ok(
47
+ !arrBoundaryRuleIds.includes('@typescript-eslint/no-restricted-types')
48
+ )
49
+ })
50
+
51
+ test('exported TypeScript contracts must be declared in types.ts', async () => {
52
+ const strSource = 'export interface ISharedContract { strValue: string }\n'
53
+ const arrImplementationRuleIds = await fnReadRuleIds(strSource)
54
+ const arrTypesRuleIds = await fnReadRuleIds(
55
+ strSource,
56
+ nodePath.join(strProjectRoot, 'src/context/types.ts')
57
+ )
58
+
59
+ assert.ok(
60
+ arrImplementationRuleIds.includes(
61
+ 'project-naming/public-types-in-types-file'
62
+ )
63
+ )
64
+ assert.ok(
65
+ !arrTypesRuleIds.includes('project-naming/public-types-in-types-file')
66
+ )
67
+ })
68
+
69
+ test('Swagger DTO fields preserve external names without disabling owned naming rules', async () => {
70
+ const strTypesFile = nodePath.join(
71
+ strProjectRoot,
72
+ 'src/features/auth/signIn/types.ts'
73
+ )
74
+ const arrDtoRuleIds = await fnReadRuleIds(
75
+ 'interface IGeneratedDto { id: string; name: string; enabled: boolean; revision: number; items: string[]; total: number }\n',
76
+ strTypesFile
77
+ )
78
+ const arrOwnedRuleIds = await fnReadRuleIds(
79
+ 'interface IOwnedModel { title: string }\n',
80
+ strTypesFile
81
+ )
82
+
83
+ assert.ok(!arrDtoRuleIds.includes('@typescript-eslint/naming-convention'))
84
+ assert.ok(arrOwnedRuleIds.includes('@typescript-eslint/naming-convention'))
85
+ })
86
+
87
+ test('owned components expose only their root public entry to application code', async () => {
88
+ const arrPublicRuleIds = await fnReadRuleIds(
89
+ "import { AppTable } from '@/components/AppTable'\nvoid AppTable\n"
90
+ )
91
+ const arrPrivateRuleIds = await fnReadRuleIds(
92
+ "import { TableComponent } from '@/components/AppTable/table'\nvoid TableComponent\n"
93
+ )
94
+ const arrDynamicRuleIds = await fnReadRuleIds(
95
+ "void import('@/components/AppPageForm/controller')\n"
96
+ )
97
+
98
+ assert.ok(!arrPublicRuleIds.includes('project-naming/component-boundaries'))
99
+ assert.ok(arrPrivateRuleIds.includes('project-naming/component-boundaries'))
100
+ assert.ok(arrDynamicRuleIds.includes('project-naming/component-boundaries'))
101
+ })
@@ -0,0 +1,126 @@
1
+ import { ESLint } from 'eslint'
2
+ import assert from 'node:assert/strict'
3
+ import { readFile, readdir } from 'node:fs/promises'
4
+ import nodePath from 'node:path'
5
+ import test from 'node:test'
6
+
7
+ const strProjectRoot = nodePath.resolve(import.meta.dirname, '../../..')
8
+ const strFeaturesRoot = nodePath.join(strProjectRoot, 'src/features')
9
+ const strRouterFile = nodePath.join(
10
+ strProjectRoot,
11
+ 'src/router/lazyRouteComponents.ts'
12
+ )
13
+ const strFeatureFile = nodePath.join(strFeaturesRoot, 'home/messages.ts')
14
+ const objEslint = new ESLint({ cache: false, cwd: strProjectRoot })
15
+
16
+ async function fnReadBoundaryMessages(strSource, strFilePath) {
17
+ const [objResult] = await objEslint.lintText(strSource, {
18
+ filePath: strFilePath,
19
+ })
20
+
21
+ return objResult.messages.filter(
22
+ (objMessage) => objMessage.ruleId === 'project-naming/feature-boundaries'
23
+ )
24
+ }
25
+
26
+ test('every top-level Feature exposes one public entry', async () => {
27
+ const arrEntries = await readdir(strFeaturesRoot, { withFileTypes: true })
28
+ const arrFeatureNames = arrEntries
29
+ .filter((objEntry) => objEntry.isDirectory())
30
+ .map((objEntry) => objEntry.name)
31
+ .sort()
32
+ const arrMissingEntries = []
33
+
34
+ for (const strFeatureName of arrFeatureNames) {
35
+ const arrFeatureEntries = await readdir(
36
+ nodePath.join(strFeaturesRoot, strFeatureName)
37
+ )
38
+ if (
39
+ !arrFeatureEntries.includes('index.ts') &&
40
+ !arrFeatureEntries.includes('index.tsx')
41
+ ) {
42
+ arrMissingEntries.push(strFeatureName)
43
+ }
44
+ }
45
+
46
+ assert.deepEqual(arrMissingEntries, [])
47
+ })
48
+
49
+ test('outside consumers can only import a Feature public entry', async () => {
50
+ const arrRootMessages = await fnReadBoundaryMessages(
51
+ "import { RouteError } from '@/features/errors'\nvoid RouteError\n",
52
+ strRouterFile
53
+ )
54
+ const arrDeepMessages = await fnReadBoundaryMessages(
55
+ "import { RouteError } from '@/features/errors/RouteError'\nvoid RouteError\n",
56
+ strRouterFile
57
+ )
58
+ const arrDynamicMessages = await fnReadBoundaryMessages(
59
+ "void import('@/features/errors/RouteError')\n",
60
+ strRouterFile
61
+ )
62
+ const arrExportMessages = await fnReadBoundaryMessages(
63
+ "export { RouteError } from '@/features/errors/RouteError'\n",
64
+ strRouterFile
65
+ )
66
+
67
+ assert.equal(arrRootMessages.length, 0)
68
+ assert.equal(arrDeepMessages[0]?.messageId, 'privateFeatureImport')
69
+ assert.equal(arrDynamicMessages[0]?.messageId, 'privateFeatureImport')
70
+ assert.equal(arrExportMessages[0]?.messageId, 'privateFeatureImport')
71
+ })
72
+
73
+ test('Feature code cannot bypass a peer public entry', async () => {
74
+ const arrRootMessages = await fnReadBoundaryMessages(
75
+ "import { RouteError } from '@/features/errors'\nvoid RouteError\n",
76
+ strFeatureFile
77
+ )
78
+ const arrDeepMessages = await fnReadBoundaryMessages(
79
+ "import { RouteError } from '@/features/errors/RouteError'\nvoid RouteError\n",
80
+ strFeatureFile
81
+ )
82
+ const arrRelativeMessages = await fnReadBoundaryMessages(
83
+ "import { RouteError } from '../errors/RouteError'\nvoid RouteError\n",
84
+ strFeatureFile
85
+ )
86
+ const arrOwnedMessages = await fnReadBoundaryMessages(
87
+ "import { objHomeMessages } from './messages'\nvoid objHomeMessages\n",
88
+ strFeatureFile
89
+ )
90
+
91
+ assert.equal(arrRootMessages.length, 0)
92
+ assert.equal(arrDeepMessages[0]?.messageId, 'privateFeatureImport')
93
+ assert.equal(arrRelativeMessages[0]?.messageId, 'relativeCrossFeatureImport')
94
+ assert.equal(arrOwnedMessages.length, 0)
95
+ })
96
+
97
+ test('Feature code cannot depend on router or application composition', async () => {
98
+ const arrRouterMessages = await fnReadBoundaryMessages(
99
+ "import { objRouter } from '@/router/router'\nvoid objRouter\n",
100
+ strFeatureFile
101
+ )
102
+ const arrLayoutMessages = await fnReadBoundaryMessages(
103
+ "import { AppLayout } from '@/layouts/AppLayout'\nvoid AppLayout\n",
104
+ strFeatureFile
105
+ )
106
+ const arrRelativeRouterMessages = await fnReadBoundaryMessages(
107
+ "import { objRouter } from '../../router/router'\nvoid objRouter\n",
108
+ strFeatureFile
109
+ )
110
+
111
+ assert.equal(arrRouterMessages[0]?.messageId, 'reverseApplicationDependency')
112
+ assert.equal(arrLayoutMessages[0]?.messageId, 'reverseApplicationDependency')
113
+ assert.equal(
114
+ arrRelativeRouterMessages[0]?.messageId,
115
+ 'reverseApplicationDependency'
116
+ )
117
+ })
118
+
119
+ test('root data entry does not re-export capability barrels', async () => {
120
+ const strApiEntry = await readFile(
121
+ nodePath.join(strProjectRoot, 'src/api/index.ts'),
122
+ 'utf8'
123
+ )
124
+
125
+ assert.doesNotMatch(strApiEntry, /export\s+\*\s+from/)
126
+ })
@@ -0,0 +1,37 @@
1
+ import assert from 'node:assert/strict'
2
+ import { readFile } from 'node:fs/promises'
3
+ import path from 'node:path'
4
+ import test from 'node:test'
5
+ import { fnVerifyNpmPackage } from '../../../packages/create-react-admin-template/scripts/smokePackage.mjs'
6
+
7
+ const strProjectRoot = path.resolve(import.meta.dirname, '../../..')
8
+
9
+ test('creator package owns its publish lifecycle without publishing the root application', async () => {
10
+ const objPackage = JSON.parse(
11
+ await readFile(
12
+ path.join(
13
+ strProjectRoot,
14
+ 'packages/create-react-admin-template/package.json'
15
+ ),
16
+ 'utf8'
17
+ )
18
+ )
19
+ const objRoot = JSON.parse(
20
+ await readFile(path.join(strProjectRoot, 'package.json'), 'utf8')
21
+ )
22
+ assert.equal(objRoot.private, true)
23
+ assert.equal(objRoot.scripts['npm:pack'], undefined)
24
+ assert.equal(objPackage.name, 'create-react-admin-template')
25
+ assert.equal(objPackage.dependencies, undefined)
26
+ assert.deepEqual(objPackage.bin, {
27
+ 'create-react-admin-template': 'bin/create.mjs',
28
+ })
29
+ assert.equal(objPackage.scripts.prepack, 'node scripts/buildTemplate.mjs')
30
+ assert.equal(objPackage.scripts.prepublishOnly, 'pnpm --dir ../.. verify')
31
+ })
32
+
33
+ test('packed CLI installs offline and creates core/full projects without maintainer files', async () => {
34
+ const objResult = await fnVerifyNpmPackage()
35
+ assert.equal(objResult.strPackageName, 'create-react-admin-template')
36
+ assert.ok(objResult.nFileCount > 0)
37
+ })