@origen-ui/admin-cli 1.0.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 (430) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +17 -0
  3. package/bin/og-admin.mjs +131 -0
  4. package/package.json +28 -0
  5. package/templates/current/clean/.codebuddy/AGENTS.md +18 -0
  6. package/templates/current/clean/.codebuddy/rules/01-feature-architecture.md +12 -0
  7. package/templates/current/clean/.codebuddy/rules/02-vue-typescript.md +12 -0
  8. package/templates/current/clean/.codebuddy/rules/03-component-policy.md +30 -0
  9. package/templates/current/clean/.codebuddy/rules/04-api-auth-router.md +12 -0
  10. package/templates/current/clean/.codebuddy/rules/05-style.md +12 -0
  11. package/templates/current/clean/.codebuddy/rules/06-quality.md +12 -0
  12. package/templates/current/clean/.codebuddy/skills/build-admin-feature/SKILL.md +17 -0
  13. package/templates/current/clean/.codebuddy/skills/style-og-origen-ui/SKILL.md +14 -0
  14. package/templates/current/clean/.codebuddy/skills/use-og-dialog/SKILL.md +15 -0
  15. package/templates/current/clean/.codebuddy/skills/use-og-editor/SKILL.md +28 -0
  16. package/templates/current/clean/.codebuddy/skills/use-og-form/SKILL.md +15 -0
  17. package/templates/current/clean/.codebuddy/skills/use-og-form-table/SKILL.md +28 -0
  18. package/templates/current/clean/.codebuddy/skills/use-og-http/SKILL.md +16 -0
  19. package/templates/current/clean/.codebuddy/skills/use-og-router-tabs/SKILL.md +14 -0
  20. package/templates/current/clean/.codebuddy/skills/use-og-search/SKILL.md +17 -0
  21. package/templates/current/clean/.codebuddy/skills/use-og-table/SKILL.md +19 -0
  22. package/templates/current/clean/.codebuddy/skills/use-og-upload/SKILL.md +28 -0
  23. package/templates/current/clean/.codex/AGENTS.md +15 -0
  24. package/templates/current/clean/.codex/rules/01-feature-architecture.md +6 -0
  25. package/templates/current/clean/.codex/rules/02-vue-typescript.md +6 -0
  26. package/templates/current/clean/.codex/rules/03-component-policy.md +24 -0
  27. package/templates/current/clean/.codex/rules/04-api-auth-router.md +6 -0
  28. package/templates/current/clean/.codex/rules/05-style.md +6 -0
  29. package/templates/current/clean/.codex/rules/06-quality.md +6 -0
  30. package/templates/current/clean/.codex/skills/build-admin-feature/SKILL.md +14 -0
  31. package/templates/current/clean/.codex/skills/build-admin-feature/references/component-selection.md +25 -0
  32. package/templates/current/clean/.codex/skills/style-og-origen-ui/SKILL.md +11 -0
  33. package/templates/current/clean/.codex/skills/style-og-origen-ui/agents/openai.yaml +4 -0
  34. package/templates/current/clean/.codex/skills/use-og-dialog/SKILL.md +12 -0
  35. package/templates/current/clean/.codex/skills/use-og-dialog/agents/openai.yaml +4 -0
  36. package/templates/current/clean/.codex/skills/use-og-editor/SKILL.md +25 -0
  37. package/templates/current/clean/.codex/skills/use-og-form/SKILL.md +12 -0
  38. package/templates/current/clean/.codex/skills/use-og-form-table/SKILL.md +25 -0
  39. package/templates/current/clean/.codex/skills/use-og-http/SKILL.md +13 -0
  40. package/templates/current/clean/.codex/skills/use-og-http/agents/openai.yaml +4 -0
  41. package/templates/current/clean/.codex/skills/use-og-router-tabs/SKILL.md +11 -0
  42. package/templates/current/clean/.codex/skills/use-og-search/SKILL.md +14 -0
  43. package/templates/current/clean/.codex/skills/use-og-table/SKILL.md +16 -0
  44. package/templates/current/clean/.codex/skills/use-og-upload/SKILL.md +25 -0
  45. package/templates/current/clean/.cursor/AGENTS.md +18 -0
  46. package/templates/current/clean/.cursor/rules/01-feature-architecture.mdc +12 -0
  47. package/templates/current/clean/.cursor/rules/02-vue-typescript.mdc +12 -0
  48. package/templates/current/clean/.cursor/rules/03-component-policy.mdc +30 -0
  49. package/templates/current/clean/.cursor/rules/04-api-auth-router.mdc +12 -0
  50. package/templates/current/clean/.cursor/rules/05-style.mdc +12 -0
  51. package/templates/current/clean/.cursor/rules/06-quality.mdc +12 -0
  52. package/templates/current/clean/.cursor/skills/build-admin-feature/SKILL.md +14 -0
  53. package/templates/current/clean/.cursor/skills/style-og-origen-ui/SKILL.md +11 -0
  54. package/templates/current/clean/.cursor/skills/use-og-dialog/SKILL.md +12 -0
  55. package/templates/current/clean/.cursor/skills/use-og-editor/SKILL.md +25 -0
  56. package/templates/current/clean/.cursor/skills/use-og-form/SKILL.md +12 -0
  57. package/templates/current/clean/.cursor/skills/use-og-form-table/SKILL.md +25 -0
  58. package/templates/current/clean/.cursor/skills/use-og-http/SKILL.md +13 -0
  59. package/templates/current/clean/.cursor/skills/use-og-router-tabs/SKILL.md +11 -0
  60. package/templates/current/clean/.cursor/skills/use-og-search/SKILL.md +14 -0
  61. package/templates/current/clean/.cursor/skills/use-og-table/SKILL.md +16 -0
  62. package/templates/current/clean/.cursor/skills/use-og-upload/SKILL.md +25 -0
  63. package/templates/current/clean/.env.example +7 -0
  64. package/templates/current/clean/.env.production.example +31 -0
  65. package/templates/current/clean/.qoder/AGENTS.md +15 -0
  66. package/templates/current/clean/.qoder/rules/01-feature-architecture.md +12 -0
  67. package/templates/current/clean/.qoder/rules/02-vue-typescript.md +12 -0
  68. package/templates/current/clean/.qoder/rules/03-component-policy.md +30 -0
  69. package/templates/current/clean/.qoder/rules/04-api-auth-router.md +12 -0
  70. package/templates/current/clean/.qoder/rules/05-style.md +12 -0
  71. package/templates/current/clean/.qoder/rules/06-quality.md +12 -0
  72. package/templates/current/clean/.qoder/skills/build-admin-feature/SKILL.md +14 -0
  73. package/templates/current/clean/.qoder/skills/style-og-origen-ui/SKILL.md +11 -0
  74. package/templates/current/clean/.qoder/skills/use-og-dialog/SKILL.md +12 -0
  75. package/templates/current/clean/.qoder/skills/use-og-editor/SKILL.md +25 -0
  76. package/templates/current/clean/.qoder/skills/use-og-form/SKILL.md +12 -0
  77. package/templates/current/clean/.qoder/skills/use-og-form-table/SKILL.md +25 -0
  78. package/templates/current/clean/.qoder/skills/use-og-http/SKILL.md +13 -0
  79. package/templates/current/clean/.qoder/skills/use-og-router-tabs/SKILL.md +11 -0
  80. package/templates/current/clean/.qoder/skills/use-og-search/SKILL.md +14 -0
  81. package/templates/current/clean/.qoder/skills/use-og-table/SKILL.md +16 -0
  82. package/templates/current/clean/.qoder/skills/use-og-upload/SKILL.md +25 -0
  83. package/templates/current/clean/AGENTS.md +16 -0
  84. package/templates/current/clean/README.md +116 -0
  85. package/templates/current/clean/component-catalog.json +765 -0
  86. package/templates/current/clean/e2e/admin-shell.spec.ts +150 -0
  87. package/templates/current/clean/e2e/demo-shell.spec.ts +328 -0
  88. package/templates/current/clean/evals/component-selection.json +29 -0
  89. package/templates/current/clean/gitignore +3 -0
  90. package/templates/current/clean/index.html +13 -0
  91. package/templates/current/clean/openapi.json +1623 -0
  92. package/templates/current/clean/package.json +65 -0
  93. package/templates/current/clean/playwright.config.ts +31 -0
  94. package/templates/current/clean/playwright.demo.config.ts +25 -0
  95. package/templates/current/clean/recipes/README.md +7 -0
  96. package/templates/current/clean/recipes/remote-crud-dialog-form.json +15 -0
  97. package/templates/current/clean/recipes/remote-crud-dialog-form.vue +66 -0
  98. package/templates/current/clean/scaffold.lock.json +12 -0
  99. package/templates/current/clean/scripts/check-admin-bundle.mjs +214 -0
  100. package/templates/current/clean/scripts/check-admin-scaffold.mjs +168 -0
  101. package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/Forbidden.vue +26 -0
  102. package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/NotFound.vue +26 -0
  103. package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/ServerError.vue +26 -0
  104. package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/error-pages.spec.ts +32 -0
  105. package/templates/current/clean/scripts/clean-overlay/src/main.ts +91 -0
  106. package/templates/current/clean/scripts/clean-overlay/src/router/componentRegistry.ts +25 -0
  107. package/templates/current/clean/scripts/clean-overlay/src/router/dynamicRoutes.spec.ts +47 -0
  108. package/templates/current/clean/scripts/clean-overlay/src/router/staticRoutes.ts +63 -0
  109. package/templates/current/clean/scripts/demo-api.ts +797 -0
  110. package/templates/current/clean/scripts/generate-api.ts +27 -0
  111. package/templates/current/clean/scripts/performance/baselines/bundle-gzip-v2-pre-entry-unification.json +38 -0
  112. package/templates/current/clean/scripts/remove-examples.mjs +54 -0
  113. package/templates/current/clean/src/App.vue +67 -0
  114. package/templates/current/clean/src/api/client.spec.ts +66 -0
  115. package/templates/current/clean/src/api/client.ts +72 -0
  116. package/templates/current/clean/src/api/generated/data-contracts.ts +268 -0
  117. package/templates/current/clean/src/api/generated/http-client.ts +266 -0
  118. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/206/205/345/256/271/346/226/207/347/253/240.ts +147 -0
  119. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/256/241/350/256/241.ts +53 -0
  120. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/346/226/207/344/273/266/344/270/212/344/274/240.ts +66 -0
  121. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/347/224/250/346/210/267.ts +171 -0
  122. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/217/234/345/215/225.ts +181 -0
  123. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/247/222/350/211/262.ts +169 -0
  124. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/256/242/345/215/225/350/215/211/347/250/277.ts +170 -0
  125. package/templates/current/clean/src/api/generated//350/256/244/350/257/201.ts +98 -0
  126. package/templates/current/clean/src/api/http-adapter.spec.ts +33 -0
  127. package/templates/current/clean/src/api/http-adapter.ts +83 -0
  128. package/templates/current/clean/src/api/index.ts +41 -0
  129. package/templates/current/clean/src/app/createAdminUi.spec.ts +110 -0
  130. package/templates/current/clean/src/app/createAdminUi.ts +78 -0
  131. package/templates/current/clean/src/app/menu.spec.ts +255 -0
  132. package/templates/current/clean/src/app/menu.ts +268 -0
  133. package/templates/current/clean/src/app/menuTypes.ts +17 -0
  134. package/templates/current/clean/src/app/origenUiLocale.spec.ts +14 -0
  135. package/templates/current/clean/src/app/origenUiLocale.ts +65 -0
  136. package/templates/current/clean/src/app/permission.ts +9 -0
  137. package/templates/current/clean/src/app/runtimeConfig.ts +77 -0
  138. package/templates/current/clean/src/demo-api.spec.ts +167 -0
  139. package/templates/current/clean/src/env.d.ts +14 -0
  140. package/templates/current/clean/src/features/appearance/components/ThemePanel.vue +200 -0
  141. package/templates/current/clean/src/features/appearance/composables/useTheme.ts +17 -0
  142. package/templates/current/clean/src/features/appearance/store/theme.ts +140 -0
  143. package/templates/current/clean/src/features/auth/pages/Login.vue +159 -0
  144. package/templates/current/clean/src/features/auth/store/auth.spec.ts +131 -0
  145. package/templates/current/clean/src/features/auth/store/auth.ts +210 -0
  146. package/templates/current/clean/src/features/errors/pages/Forbidden.vue +26 -0
  147. package/templates/current/clean/src/features/errors/pages/NotFound.vue +26 -0
  148. package/templates/current/clean/src/features/errors/pages/ServerError.vue +26 -0
  149. package/templates/current/clean/src/features/errors/pages/error-pages.spec.ts +32 -0
  150. package/templates/current/clean/src/features/security/components/DevtoolsProtectionOverlay.vue +56 -0
  151. package/templates/current/clean/src/features/security/devtoolsProtection.spec.ts +211 -0
  152. package/templates/current/clean/src/features/security/devtoolsProtection.ts +242 -0
  153. package/templates/current/clean/src/features/shell/components/AdminWatermark.spec.ts +90 -0
  154. package/templates/current/clean/src/features/shell/components/AdminWatermark.vue +47 -0
  155. package/templates/current/clean/src/features/shell/components/RouteProgress.vue +68 -0
  156. package/templates/current/clean/src/features/shell/composables/useRouteProgress.spec.ts +95 -0
  157. package/templates/current/clean/src/features/shell/composables/useRouteProgress.ts +52 -0
  158. package/templates/current/clean/src/features/shell/store/sidebar.ts +55 -0
  159. package/templates/current/clean/src/features/system/access/api/admin-repository.ts +279 -0
  160. package/templates/current/clean/src/features/system/access/api/rbac.spec.ts +72 -0
  161. package/templates/current/clean/src/features/system/access/api/rbac.ts +272 -0
  162. package/templates/current/clean/src/features/system/access/composables/useAuthorizationRefresh.ts +15 -0
  163. package/templates/current/clean/src/features/workspace/pages/Empty.vue +18 -0
  164. package/templates/current/clean/src/features/workspace/pages/Profile.vue +183 -0
  165. package/templates/current/clean/src/layouts/AdminLayout.vue +61 -0
  166. package/templates/current/clean/src/layouts/BreadcrumbBar.vue +27 -0
  167. package/templates/current/clean/src/layouts/SideMenu.vue +119 -0
  168. package/templates/current/clean/src/layouts/TopBar.vue +301 -0
  169. package/templates/current/clean/src/layouts/WorkspaceTabs.vue +44 -0
  170. package/templates/current/clean/src/layouts/topBarMenuSearch.spec.ts +31 -0
  171. package/templates/current/clean/src/layouts/topBarMenuSearch.ts +21 -0
  172. package/templates/current/clean/src/locales/en-US.ts +55 -0
  173. package/templates/current/clean/src/locales/index.ts +119 -0
  174. package/templates/current/clean/src/locales/messages.spec.ts +23 -0
  175. package/templates/current/clean/src/locales/zh-CN.ts +55 -0
  176. package/templates/current/clean/src/locales/zh-TW.ts +44 -0
  177. package/templates/current/clean/src/main.ts +91 -0
  178. package/templates/current/clean/src/router/bootstrap.ts +76 -0
  179. package/templates/current/clean/src/router/componentRegistry.ts +25 -0
  180. package/templates/current/clean/src/router/dynamicRoutes.spec.ts +47 -0
  181. package/templates/current/clean/src/router/dynamicRoutes.ts +162 -0
  182. package/templates/current/clean/src/router/guards.ts +5 -0
  183. package/templates/current/clean/src/router/queryEncryption.spec.ts +82 -0
  184. package/templates/current/clean/src/router/queryEncryption.ts +133 -0
  185. package/templates/current/clean/src/router/routeQuery.spec.ts +11 -0
  186. package/templates/current/clean/src/router/routeQuery.ts +3 -0
  187. package/templates/current/clean/src/router/runtimeErrorRecovery.spec.ts +161 -0
  188. package/templates/current/clean/src/router/runtimeErrorRecovery.ts +108 -0
  189. package/templates/current/clean/src/router/staticRoutes.ts +63 -0
  190. package/templates/current/clean/src/router/useRouteQueryDefaults.spec.ts +90 -0
  191. package/templates/current/clean/src/router/useRouteQueryDefaults.ts +51 -0
  192. package/templates/current/clean/src/router/useRouteQueryDefaults.types.ts +19 -0
  193. package/templates/current/clean/src/store/index.ts +3 -0
  194. package/templates/current/clean/src/styles/element/index.scss +33 -0
  195. package/templates/current/clean/src/styles/index.css +39 -0
  196. package/templates/current/clean/src/styles/layout.css +115 -0
  197. package/templates/current/clean/src/styles/shell.css +196 -0
  198. package/templates/current/clean/src/styles/source-package-style-compat.css +1 -0
  199. package/templates/current/clean/src/templates/og-form.ts +48 -0
  200. package/templates/current/clean/src/templates/og-table.ts +212 -0
  201. package/templates/current/clean/src/templates/router.ts +51 -0
  202. package/templates/current/clean/src/templates/templates.spec.ts +90 -0
  203. package/templates/current/clean/src/theme/index.ts +7 -0
  204. package/templates/current/clean/src/utils/__tests__/color-mix.spec.ts +39 -0
  205. package/templates/current/clean/src/utils/color-mix.ts +76 -0
  206. package/templates/current/clean/src/utils/permissions.ts +6 -0
  207. package/templates/current/clean/tsconfig.json +40 -0
  208. package/templates/current/clean/tsconfig.node.json +9 -0
  209. package/templates/current/clean/vite.build-policy.ts +405 -0
  210. package/templates/current/clean/vite.config.ts +37 -0
  211. package/templates/current/examples/.codebuddy/AGENTS.md +18 -0
  212. package/templates/current/examples/.codebuddy/rules/01-feature-architecture.md +12 -0
  213. package/templates/current/examples/.codebuddy/rules/02-vue-typescript.md +12 -0
  214. package/templates/current/examples/.codebuddy/rules/03-component-policy.md +30 -0
  215. package/templates/current/examples/.codebuddy/rules/04-api-auth-router.md +12 -0
  216. package/templates/current/examples/.codebuddy/rules/05-style.md +12 -0
  217. package/templates/current/examples/.codebuddy/rules/06-quality.md +12 -0
  218. package/templates/current/examples/.codebuddy/skills/build-admin-feature/SKILL.md +17 -0
  219. package/templates/current/examples/.codebuddy/skills/style-og-origen-ui/SKILL.md +14 -0
  220. package/templates/current/examples/.codebuddy/skills/use-og-dialog/SKILL.md +15 -0
  221. package/templates/current/examples/.codebuddy/skills/use-og-editor/SKILL.md +28 -0
  222. package/templates/current/examples/.codebuddy/skills/use-og-form/SKILL.md +15 -0
  223. package/templates/current/examples/.codebuddy/skills/use-og-form-table/SKILL.md +28 -0
  224. package/templates/current/examples/.codebuddy/skills/use-og-http/SKILL.md +16 -0
  225. package/templates/current/examples/.codebuddy/skills/use-og-router-tabs/SKILL.md +14 -0
  226. package/templates/current/examples/.codebuddy/skills/use-og-search/SKILL.md +17 -0
  227. package/templates/current/examples/.codebuddy/skills/use-og-table/SKILL.md +19 -0
  228. package/templates/current/examples/.codebuddy/skills/use-og-upload/SKILL.md +28 -0
  229. package/templates/current/examples/.codex/AGENTS.md +15 -0
  230. package/templates/current/examples/.codex/rules/01-feature-architecture.md +6 -0
  231. package/templates/current/examples/.codex/rules/02-vue-typescript.md +6 -0
  232. package/templates/current/examples/.codex/rules/03-component-policy.md +24 -0
  233. package/templates/current/examples/.codex/rules/04-api-auth-router.md +6 -0
  234. package/templates/current/examples/.codex/rules/05-style.md +6 -0
  235. package/templates/current/examples/.codex/rules/06-quality.md +6 -0
  236. package/templates/current/examples/.codex/skills/build-admin-feature/SKILL.md +14 -0
  237. package/templates/current/examples/.codex/skills/build-admin-feature/references/component-selection.md +25 -0
  238. package/templates/current/examples/.codex/skills/style-og-origen-ui/SKILL.md +11 -0
  239. package/templates/current/examples/.codex/skills/style-og-origen-ui/agents/openai.yaml +4 -0
  240. package/templates/current/examples/.codex/skills/use-og-dialog/SKILL.md +12 -0
  241. package/templates/current/examples/.codex/skills/use-og-dialog/agents/openai.yaml +4 -0
  242. package/templates/current/examples/.codex/skills/use-og-editor/SKILL.md +25 -0
  243. package/templates/current/examples/.codex/skills/use-og-form/SKILL.md +12 -0
  244. package/templates/current/examples/.codex/skills/use-og-form-table/SKILL.md +25 -0
  245. package/templates/current/examples/.codex/skills/use-og-http/SKILL.md +13 -0
  246. package/templates/current/examples/.codex/skills/use-og-http/agents/openai.yaml +4 -0
  247. package/templates/current/examples/.codex/skills/use-og-router-tabs/SKILL.md +11 -0
  248. package/templates/current/examples/.codex/skills/use-og-search/SKILL.md +14 -0
  249. package/templates/current/examples/.codex/skills/use-og-table/SKILL.md +16 -0
  250. package/templates/current/examples/.codex/skills/use-og-upload/SKILL.md +25 -0
  251. package/templates/current/examples/.cursor/AGENTS.md +18 -0
  252. package/templates/current/examples/.cursor/rules/01-feature-architecture.mdc +12 -0
  253. package/templates/current/examples/.cursor/rules/02-vue-typescript.mdc +12 -0
  254. package/templates/current/examples/.cursor/rules/03-component-policy.mdc +30 -0
  255. package/templates/current/examples/.cursor/rules/04-api-auth-router.mdc +12 -0
  256. package/templates/current/examples/.cursor/rules/05-style.mdc +12 -0
  257. package/templates/current/examples/.cursor/rules/06-quality.mdc +12 -0
  258. package/templates/current/examples/.cursor/skills/build-admin-feature/SKILL.md +14 -0
  259. package/templates/current/examples/.cursor/skills/style-og-origen-ui/SKILL.md +11 -0
  260. package/templates/current/examples/.cursor/skills/use-og-dialog/SKILL.md +12 -0
  261. package/templates/current/examples/.cursor/skills/use-og-editor/SKILL.md +25 -0
  262. package/templates/current/examples/.cursor/skills/use-og-form/SKILL.md +12 -0
  263. package/templates/current/examples/.cursor/skills/use-og-form-table/SKILL.md +25 -0
  264. package/templates/current/examples/.cursor/skills/use-og-http/SKILL.md +13 -0
  265. package/templates/current/examples/.cursor/skills/use-og-router-tabs/SKILL.md +11 -0
  266. package/templates/current/examples/.cursor/skills/use-og-search/SKILL.md +14 -0
  267. package/templates/current/examples/.cursor/skills/use-og-table/SKILL.md +16 -0
  268. package/templates/current/examples/.cursor/skills/use-og-upload/SKILL.md +25 -0
  269. package/templates/current/examples/.env.example +7 -0
  270. package/templates/current/examples/.env.production.example +31 -0
  271. package/templates/current/examples/.qoder/AGENTS.md +15 -0
  272. package/templates/current/examples/.qoder/rules/01-feature-architecture.md +12 -0
  273. package/templates/current/examples/.qoder/rules/02-vue-typescript.md +12 -0
  274. package/templates/current/examples/.qoder/rules/03-component-policy.md +30 -0
  275. package/templates/current/examples/.qoder/rules/04-api-auth-router.md +12 -0
  276. package/templates/current/examples/.qoder/rules/05-style.md +12 -0
  277. package/templates/current/examples/.qoder/rules/06-quality.md +12 -0
  278. package/templates/current/examples/.qoder/skills/build-admin-feature/SKILL.md +14 -0
  279. package/templates/current/examples/.qoder/skills/style-og-origen-ui/SKILL.md +11 -0
  280. package/templates/current/examples/.qoder/skills/use-og-dialog/SKILL.md +12 -0
  281. package/templates/current/examples/.qoder/skills/use-og-editor/SKILL.md +25 -0
  282. package/templates/current/examples/.qoder/skills/use-og-form/SKILL.md +12 -0
  283. package/templates/current/examples/.qoder/skills/use-og-form-table/SKILL.md +25 -0
  284. package/templates/current/examples/.qoder/skills/use-og-http/SKILL.md +13 -0
  285. package/templates/current/examples/.qoder/skills/use-og-router-tabs/SKILL.md +11 -0
  286. package/templates/current/examples/.qoder/skills/use-og-search/SKILL.md +14 -0
  287. package/templates/current/examples/.qoder/skills/use-og-table/SKILL.md +16 -0
  288. package/templates/current/examples/.qoder/skills/use-og-upload/SKILL.md +25 -0
  289. package/templates/current/examples/AGENTS.md +16 -0
  290. package/templates/current/examples/README.md +116 -0
  291. package/templates/current/examples/component-catalog.json +765 -0
  292. package/templates/current/examples/e2e/admin-shell.spec.ts +150 -0
  293. package/templates/current/examples/e2e/demo-shell.spec.ts +328 -0
  294. package/templates/current/examples/evals/component-selection.json +29 -0
  295. package/templates/current/examples/gitignore +3 -0
  296. package/templates/current/examples/index.html +13 -0
  297. package/templates/current/examples/openapi.json +1623 -0
  298. package/templates/current/examples/package.json +65 -0
  299. package/templates/current/examples/playwright.config.ts +31 -0
  300. package/templates/current/examples/playwright.demo.config.ts +25 -0
  301. package/templates/current/examples/recipes/README.md +7 -0
  302. package/templates/current/examples/recipes/remote-crud-dialog-form.json +15 -0
  303. package/templates/current/examples/recipes/remote-crud-dialog-form.vue +66 -0
  304. package/templates/current/examples/scaffold.lock.json +12 -0
  305. package/templates/current/examples/scripts/check-admin-bundle.mjs +214 -0
  306. package/templates/current/examples/scripts/check-admin-scaffold.mjs +168 -0
  307. package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/Forbidden.vue +26 -0
  308. package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/NotFound.vue +26 -0
  309. package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/ServerError.vue +26 -0
  310. package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/error-pages.spec.ts +32 -0
  311. package/templates/current/examples/scripts/clean-overlay/src/main.ts +91 -0
  312. package/templates/current/examples/scripts/clean-overlay/src/router/componentRegistry.ts +25 -0
  313. package/templates/current/examples/scripts/clean-overlay/src/router/dynamicRoutes.spec.ts +47 -0
  314. package/templates/current/examples/scripts/clean-overlay/src/router/staticRoutes.ts +63 -0
  315. package/templates/current/examples/scripts/demo-api.ts +797 -0
  316. package/templates/current/examples/scripts/generate-api.ts +27 -0
  317. package/templates/current/examples/scripts/performance/baselines/bundle-gzip-v2-pre-entry-unification.json +38 -0
  318. package/templates/current/examples/scripts/remove-examples.mjs +54 -0
  319. package/templates/current/examples/src/App.vue +67 -0
  320. package/templates/current/examples/src/api/client.spec.ts +66 -0
  321. package/templates/current/examples/src/api/client.ts +72 -0
  322. package/templates/current/examples/src/api/generated/data-contracts.ts +268 -0
  323. package/templates/current/examples/src/api/generated/http-client.ts +266 -0
  324. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/206/205/345/256/271/346/226/207/347/253/240.ts +147 -0
  325. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/256/241/350/256/241.ts +53 -0
  326. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/346/226/207/344/273/266/344/270/212/344/274/240.ts +66 -0
  327. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/347/224/250/346/210/267.ts +171 -0
  328. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/217/234/345/215/225.ts +181 -0
  329. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/247/222/350/211/262.ts +169 -0
  330. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/256/242/345/215/225/350/215/211/347/250/277.ts +170 -0
  331. package/templates/current/examples/src/api/generated//350/256/244/350/257/201.ts +98 -0
  332. package/templates/current/examples/src/api/http-adapter.spec.ts +33 -0
  333. package/templates/current/examples/src/api/http-adapter.ts +83 -0
  334. package/templates/current/examples/src/api/index.ts +41 -0
  335. package/templates/current/examples/src/app/createAdminUi.spec.ts +110 -0
  336. package/templates/current/examples/src/app/createAdminUi.ts +78 -0
  337. package/templates/current/examples/src/app/menu.spec.ts +255 -0
  338. package/templates/current/examples/src/app/menu.ts +268 -0
  339. package/templates/current/examples/src/app/menuTypes.ts +17 -0
  340. package/templates/current/examples/src/app/origenUiLocale.spec.ts +14 -0
  341. package/templates/current/examples/src/app/origenUiLocale.ts +65 -0
  342. package/templates/current/examples/src/app/permission.ts +9 -0
  343. package/templates/current/examples/src/app/runtimeConfig.ts +77 -0
  344. package/templates/current/examples/src/demo-api.spec.ts +167 -0
  345. package/templates/current/examples/src/env.d.ts +14 -0
  346. package/templates/current/examples/src/features/appearance/components/ThemePanel.vue +200 -0
  347. package/templates/current/examples/src/features/appearance/composables/useTheme.ts +17 -0
  348. package/templates/current/examples/src/features/appearance/store/theme.ts +140 -0
  349. package/templates/current/examples/src/features/auth/pages/Login.vue +159 -0
  350. package/templates/current/examples/src/features/auth/store/auth.spec.ts +131 -0
  351. package/templates/current/examples/src/features/auth/store/auth.ts +210 -0
  352. package/templates/current/examples/src/features/errors/pages/Forbidden.vue +26 -0
  353. package/templates/current/examples/src/features/errors/pages/NotFound.vue +26 -0
  354. package/templates/current/examples/src/features/errors/pages/ServerError.vue +26 -0
  355. package/templates/current/examples/src/features/errors/pages/error-pages.spec.ts +32 -0
  356. package/templates/current/examples/src/features/feature-composables.spec.ts +208 -0
  357. package/templates/current/examples/src/features/security/components/DevtoolsProtectionOverlay.vue +56 -0
  358. package/templates/current/examples/src/features/security/devtoolsProtection.spec.ts +211 -0
  359. package/templates/current/examples/src/features/security/devtoolsProtection.ts +242 -0
  360. package/templates/current/examples/src/features/shell/components/AdminWatermark.spec.ts +90 -0
  361. package/templates/current/examples/src/features/shell/components/AdminWatermark.vue +47 -0
  362. package/templates/current/examples/src/features/shell/components/RouteProgress.vue +68 -0
  363. package/templates/current/examples/src/features/shell/composables/useRouteProgress.spec.ts +95 -0
  364. package/templates/current/examples/src/features/shell/composables/useRouteProgress.ts +52 -0
  365. package/templates/current/examples/src/features/shell/store/sidebar.ts +55 -0
  366. package/templates/current/examples/src/features/system/access/api/admin-repository.ts +279 -0
  367. package/templates/current/examples/src/features/system/access/api/rbac.spec.ts +72 -0
  368. package/templates/current/examples/src/features/system/access/api/rbac.ts +272 -0
  369. package/templates/current/examples/src/features/system/access/composables/useAuthorizationRefresh.ts +15 -0
  370. package/templates/current/examples/src/features/system/audit/composables/useAuditManagement.ts +117 -0
  371. package/templates/current/examples/src/features/system/audit/pages/AuditList.vue +20 -0
  372. package/templates/current/examples/src/features/system/menus/components/MenuEditorForm.vue +189 -0
  373. package/templates/current/examples/src/features/system/menus/composables/useMenuManagement.ts +327 -0
  374. package/templates/current/examples/src/features/system/menus/pages/MenuList.vue +49 -0
  375. package/templates/current/examples/src/features/system/roles/components/RoleEditorForm.vue +112 -0
  376. package/templates/current/examples/src/features/system/roles/composables/useRoleManagement.ts +198 -0
  377. package/templates/current/examples/src/features/system/roles/pages/RoleList.vue +45 -0
  378. package/templates/current/examples/src/features/system/users/components/UserEditorForm.vue +101 -0
  379. package/templates/current/examples/src/features/system/users/composables/useUserManagement.ts +233 -0
  380. package/templates/current/examples/src/features/system/users/pages/UserList.vue +49 -0
  381. package/templates/current/examples/src/features/workspace/pages/Dashboard.spec.ts +32 -0
  382. package/templates/current/examples/src/features/workspace/pages/Dashboard.vue +297 -0
  383. package/templates/current/examples/src/features/workspace/pages/Empty.vue +18 -0
  384. package/templates/current/examples/src/features/workspace/pages/Profile.vue +183 -0
  385. package/templates/current/examples/src/layouts/AdminLayout.vue +61 -0
  386. package/templates/current/examples/src/layouts/BreadcrumbBar.vue +27 -0
  387. package/templates/current/examples/src/layouts/SideMenu.vue +119 -0
  388. package/templates/current/examples/src/layouts/TopBar.vue +301 -0
  389. package/templates/current/examples/src/layouts/WorkspaceTabs.vue +44 -0
  390. package/templates/current/examples/src/layouts/topBarMenuSearch.spec.ts +31 -0
  391. package/templates/current/examples/src/layouts/topBarMenuSearch.ts +21 -0
  392. package/templates/current/examples/src/locales/en-US.ts +55 -0
  393. package/templates/current/examples/src/locales/index.ts +119 -0
  394. package/templates/current/examples/src/locales/messages.spec.ts +23 -0
  395. package/templates/current/examples/src/locales/zh-CN.ts +55 -0
  396. package/templates/current/examples/src/locales/zh-TW.ts +44 -0
  397. package/templates/current/examples/src/main.ts +91 -0
  398. package/templates/current/examples/src/router/bootstrap.ts +76 -0
  399. package/templates/current/examples/src/router/componentRegistry.ts +83 -0
  400. package/templates/current/examples/src/router/dynamicRoutes.spec.ts +109 -0
  401. package/templates/current/examples/src/router/dynamicRoutes.ts +162 -0
  402. package/templates/current/examples/src/router/guards.ts +5 -0
  403. package/templates/current/examples/src/router/queryEncryption.spec.ts +82 -0
  404. package/templates/current/examples/src/router/queryEncryption.ts +133 -0
  405. package/templates/current/examples/src/router/routeQuery.spec.ts +11 -0
  406. package/templates/current/examples/src/router/routeQuery.ts +3 -0
  407. package/templates/current/examples/src/router/runtimeErrorRecovery.spec.ts +161 -0
  408. package/templates/current/examples/src/router/runtimeErrorRecovery.ts +108 -0
  409. package/templates/current/examples/src/router/staticRoutes.ts +63 -0
  410. package/templates/current/examples/src/router/useRouteQueryDefaults.spec.ts +90 -0
  411. package/templates/current/examples/src/router/useRouteQueryDefaults.ts +51 -0
  412. package/templates/current/examples/src/router/useRouteQueryDefaults.types.ts +19 -0
  413. package/templates/current/examples/src/store/index.ts +3 -0
  414. package/templates/current/examples/src/styles/element/index.scss +33 -0
  415. package/templates/current/examples/src/styles/index.css +39 -0
  416. package/templates/current/examples/src/styles/layout.css +115 -0
  417. package/templates/current/examples/src/styles/shell.css +196 -0
  418. package/templates/current/examples/src/styles/source-package-style-compat.css +1 -0
  419. package/templates/current/examples/src/templates/og-form.ts +48 -0
  420. package/templates/current/examples/src/templates/og-table.ts +212 -0
  421. package/templates/current/examples/src/templates/router.ts +51 -0
  422. package/templates/current/examples/src/templates/templates.spec.ts +90 -0
  423. package/templates/current/examples/src/theme/index.ts +7 -0
  424. package/templates/current/examples/src/utils/__tests__/color-mix.spec.ts +39 -0
  425. package/templates/current/examples/src/utils/color-mix.ts +76 -0
  426. package/templates/current/examples/src/utils/permissions.ts +6 -0
  427. package/templates/current/examples/tsconfig.json +40 -0
  428. package/templates/current/examples/tsconfig.node.json +9 -0
  429. package/templates/current/examples/vite.build-policy.ts +405 -0
  430. package/templates/current/examples/vite.config.ts +37 -0
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@origen-ui/admin-scaffold",
3
+ "type": "module",
4
+ "version": "1.0.0",
5
+ "private": true,
6
+ "engines": {
7
+ "node": ">=20.0.0"
8
+ },
9
+ "scripts": {
10
+ "dev": "vite",
11
+ "dev:demo": "vite --mode demo",
12
+ "build": "vue-tsc --noEmit && vite build && node scripts/check-admin-bundle.mjs",
13
+ "build:debug": "vue-tsc --noEmit && vite build --mode debug && node scripts/check-admin-bundle.mjs --debug",
14
+ "preview": "vite preview",
15
+ "type-check": "vue-tsc --noEmit",
16
+ "test": "vitest run",
17
+ "test:e2e": "playwright test -c playwright.config.ts",
18
+ "test:demo:e2e": "playwright test -c playwright.demo.config.ts",
19
+ "agents:check": "node scripts/check-admin-scaffold.mjs",
20
+ "generate:api": "tsx scripts/generate-api.ts",
21
+ "examples:remove": "node scripts/remove-examples.mjs"
22
+ },
23
+ "dependencies": {
24
+ "@element-plus/icons-vue": "^2.3.2",
25
+ "@origen-ui/dialog": "1.0.0",
26
+ "@origen-ui/editor": "1.0.0",
27
+ "@origen-ui/form": "1.0.0",
28
+ "@origen-ui/http": "1.0.0",
29
+ "@origen-ui/permission": "1.0.0",
30
+ "@origen-ui/router": "1.0.0",
31
+ "@origen-ui/search": "1.0.0",
32
+ "@origen-ui/shared": "1.0.0",
33
+ "@origen-ui/table": "1.0.0",
34
+ "@origen-ui/table-search": "1.0.0",
35
+ "@origen-ui/tabs": "1.0.0",
36
+ "@origen-ui/upload": "1.0.0",
37
+ "axios": "^1.7.7",
38
+ "crypto-js": "^4.2.0",
39
+ "element-plus": "^2.14.4",
40
+ "origen-ui": "1.0.0",
41
+ "pinia": "^2.2.0",
42
+ "vue": "^3.5.40",
43
+ "vue-i18n": "~11.1.12",
44
+ "vue-router": "^4.6.4"
45
+ },
46
+ "devDependencies": {
47
+ "@origen-ui/admin-cli": "1.0.0",
48
+ "@playwright/test": "^1.62.0",
49
+ "@types/crypto-js": "^4.2.2",
50
+ "@types/node": "^22.7.4",
51
+ "@vitejs/plugin-vue": "^6.0.1",
52
+ "@vitejs/plugin-vue-jsx": "^5.1.1",
53
+ "@vitest/coverage-v8": "^3.2.6",
54
+ "@vue/compiler-sfc": "^3.5.40",
55
+ "@vue/test-utils": "^2.4.6",
56
+ "jsdom": "^24.1.3",
57
+ "sass": "^1.79.4",
58
+ "swagger-typescript-api": "^13.12.6",
59
+ "typescript": "^5.6.2",
60
+ "unplugin-element-plus": "^0.10.0",
61
+ "vite": "^7.3.6",
62
+ "vitest": "^3.2.6",
63
+ "vue-tsc": "^3.1.8"
64
+ }
65
+ }
@@ -0,0 +1,31 @@
1
+ import { existsSync } from 'node:fs'
2
+ import process from 'node:process'
3
+ import { defineConfig, devices } from '@playwright/test'
4
+
5
+ const localChromePath = 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe'
6
+ const launchOptions = existsSync(localChromePath) ? { executablePath: localChromePath } : {}
7
+
8
+ export default defineConfig({
9
+ testDir: './e2e',
10
+ testIgnore: 'demo-*.spec.ts',
11
+ fullyParallel: false,
12
+ forbidOnly: Boolean(process.env.CI),
13
+ workers: 1,
14
+ retries: process.env.CI ? 2 : 0,
15
+ reporter: [['list'], ['html', { open: 'never' }]],
16
+ use: {
17
+ baseURL: 'http://127.0.0.1:4175',
18
+ screenshot: 'only-on-failure',
19
+ trace: 'on-first-retry',
20
+ },
21
+ projects: [
22
+ { name: 'desktop-chromium', use: { ...devices['Desktop Chrome'], launchOptions } },
23
+ { name: 'mobile-chromium', use: { ...devices['Pixel 7'], launchOptions } },
24
+ ],
25
+ webServer: {
26
+ command: 'pnpm build && pnpm preview --host 127.0.0.1 --port 4175 --strictPort',
27
+ url: 'http://127.0.0.1:4175',
28
+ reuseExistingServer: false,
29
+ timeout: 900_000,
30
+ },
31
+ })
@@ -0,0 +1,25 @@
1
+ import { existsSync } from 'node:fs'
2
+ import { defineConfig, devices } from '@playwright/test'
3
+
4
+ const localChromePath = 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe'
5
+ const launchOptions = existsSync(localChromePath) ? { executablePath: localChromePath } : {}
6
+
7
+ export default defineConfig({
8
+ testDir: './e2e',
9
+ testMatch: 'demo-shell.spec.ts',
10
+ fullyParallel: false,
11
+ workers: 1,
12
+ reporter: [['list'], ['html', { open: 'never' }]],
13
+ use: {
14
+ baseURL: 'http://127.0.0.1:4176',
15
+ screenshot: 'only-on-failure',
16
+ trace: 'on-first-retry',
17
+ },
18
+ projects: [{ name: 'demo-chromium', use: { ...devices['Desktop Chrome'], launchOptions } }],
19
+ webServer: {
20
+ command: 'pnpm exec vite --mode demo --host 127.0.0.1 --port 4176 --strictPort',
21
+ url: 'http://127.0.0.1:4176',
22
+ reuseExistingServer: false,
23
+ timeout: 120_000,
24
+ },
25
+ })
@@ -0,0 +1,7 @@
1
+ # Admin recipes
2
+
3
+ Copy a recipe only after selecting the matching component skill. Replace its
4
+ placeholder transport calls with the feature's `@origen-ui/http` adapter.
5
+
6
+ - `remote-crud-dialog-form.vue`: remote paginated CRUD list, schema form, and
7
+ parent-owned dialog. Use `OgTableWithSearch`, `OgForm`, and `OgDialog`.
@@ -0,0 +1,15 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "kind": "recipe",
4
+ "id": "remote-crud-dialog-form",
5
+ "title": "Remote CRUD list with dialog form",
6
+ "useWhen": "A server-backed list needs filtering, paging, row actions, and create or edit dialogs.",
7
+ "components": ["table-with-search", "form", "dialog"],
8
+ "skills": ["use-og-table", "use-og-form", "use-og-dialog"],
9
+ "source": "source/codex/skills/build-admin-feature/references/component-selection.md",
10
+ "checks": [
11
+ "Pass the data-source AbortSignal to the API service.",
12
+ "Use OgTableWithSearch as the single owner of remote list state.",
13
+ "Keep form values and dialog state outside row objects."
14
+ ]
15
+ }
@@ -0,0 +1,66 @@
1
+ <script setup lang="ts">
2
+ import type { FormField } from '@origen-ui/form/core'
3
+ import type { OgTableExpose, OgTableRow } from '@origen-ui/table'
4
+ import { OgDialog } from '@origen-ui/dialog'
5
+ import { OgForm } from '@origen-ui/form/core'
6
+ import { OgTableWithSearch } from '@origen-ui/table-search'
7
+ import { ref, useTemplateRef } from 'vue'
8
+ import { apiClient } from '@/api/client'
9
+
10
+ interface UserRow extends OgTableRow {
11
+ id: string
12
+ name: string
13
+ email: string
14
+ }
15
+
16
+ interface UserDraft {
17
+ name: string
18
+ email: string
19
+ }
20
+
21
+ const table = useTemplateRef<OgTableExpose<UserRow>>('table')
22
+ const dialogVisible = ref(false)
23
+ const draft = ref<UserDraft>({ name: '', email: '' })
24
+ const fields: FormField<UserDraft>[] = [
25
+ { prop: 'name', label: 'Name', required: true },
26
+ { prop: 'email', label: 'Email', required: true, rules: [{ type: 'email', trigger: 'blur' }] },
27
+ ]
28
+ const columns = [
29
+ { key: 'name', label: 'Name' },
30
+ { key: 'email', label: 'Email' },
31
+ ]
32
+ const dataSource = {
33
+ async list(request: { page: number, pageSize: number }, context: { signal: AbortSignal }) {
34
+ return await apiClient.get<{ rows: UserRow[], total: number }>('/users', {
35
+ params: request,
36
+ signal: context.signal,
37
+ })
38
+ },
39
+ }
40
+
41
+ function openCreate() {
42
+ draft.value = { name: '', email: '' }
43
+ dialogVisible.value = true
44
+ }
45
+
46
+ async function save() {
47
+ await apiClient.post('/users', draft.value)
48
+ dialogVisible.value = false
49
+ await table.value?.refresh()
50
+ }
51
+ </script>
52
+
53
+ <template>
54
+ <OgTableWithSearch
55
+ ref="table"
56
+ table-id="users"
57
+ row-key="id"
58
+ :columns="columns"
59
+ :data-source="dataSource"
60
+ >
61
+ <template #beforeToolbar><button type="button" @click="openCreate">Create</button></template>
62
+ </OgTableWithSearch>
63
+ <OgDialog v-model="dialogVisible" title="Create user" @confirm="save">
64
+ <OgForm v-model="draft" :fields="fields" />
65
+ </OgDialog>
66
+ </template>
@@ -0,0 +1,12 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "scaffoldVersion": "1.0.0",
4
+ "agentContractsVersion": "1.0.0",
5
+ "variant": "clean",
6
+ "examplesPresent": false,
7
+ "appliedMigrations": [],
8
+ "managedFiles": {
9
+ "AGENTS.md": "2c0e0fb14c1c981619738c71306e13f62073a62c65cf7d8ccc5072e96b2e88c9",
10
+ ".codex/AGENTS.md": "92e23df763d15b76e81977b0aba100a9b18ec8a17f29d5021c7a239959d0ab08"
11
+ }
12
+ }
@@ -0,0 +1,214 @@
1
+ #!/usr/bin/env node
2
+ /** Verifies Admin build artifacts for release and controlled debug builds. */
3
+
4
+ import { access, readdir, readFile, stat } from 'node:fs/promises'
5
+ import { dirname, relative, resolve } from 'node:path'
6
+ import process from 'node:process'
7
+ import { fileURLToPath } from 'node:url'
8
+ import { gzipSync } from 'node:zlib'
9
+
10
+ const __dirname = dirname(fileURLToPath(import.meta.url))
11
+ const ROOT = resolve(__dirname, '..')
12
+ const MAX_CHUNK_BYTES = 500 * 1024
13
+ const MAX_CHUNK_COUNT = 140
14
+ const MAX_TOTAL_BYTES = 2_560 * 1024
15
+ const MAX_ENTRY_BYTES = 96 * 1024
16
+ const MAX_INITIAL_JS_BYTES = 900 * 1024
17
+ const MAX_INITIAL_JS_FILES = 24
18
+ const DEBUG_BUILD = process.argv.includes('--debug')
19
+ const GZIP_SAFETY_MARGIN_BYTES = 10 * 1024
20
+ const MAX_GZIP_BYTES = 502_650
21
+ const BUNDLE_BASELINE_PATH = resolve(
22
+ ROOT,
23
+ 'scripts/performance/baselines/bundle-gzip-v2-pre-entry-unification.json',
24
+ )
25
+ const MAX_GZIP_GROWTH = 0.05
26
+ const bundleBaseline = JSON.parse(await readFile(BUNDLE_BASELINE_PATH, 'utf8'))
27
+ const expectedGzipLimit = Math.floor(
28
+ bundleBaseline.admin.javaScriptGzipBytes * (1 + MAX_GZIP_GROWTH) - GZIP_SAFETY_MARGIN_BYTES,
29
+ )
30
+ if (MAX_GZIP_BYTES !== expectedGzipLimit) {
31
+ throw new Error(
32
+ `Admin gzip hard limit ${MAX_GZIP_BYTES} does not match the immutable baseline calculation ${expectedGzipLimit}.`,
33
+ )
34
+ }
35
+
36
+ const appRoot = await applicationRoot()
37
+ const DIST_DIRECTORY = resolve(appRoot, 'dist')
38
+ const ASSETS_DIRECTORY = resolve(DIST_DIRECTORY, 'assets')
39
+
40
+ async function findJavaScriptChunks(directory, chunks = []) {
41
+ const entries = await readdir(directory, { withFileTypes: true })
42
+ for (const entry of entries) {
43
+ const path = resolve(directory, entry.name)
44
+ if (entry.isDirectory()) await findJavaScriptChunks(path, chunks)
45
+ else if (entry.isFile() && entry.name.endsWith('.js')) chunks.push(path)
46
+ }
47
+ return chunks
48
+ }
49
+
50
+ async function findSourceMaps(directory, maps = []) {
51
+ const entries = await readdir(directory, { withFileTypes: true })
52
+ for (const entry of entries) {
53
+ const path = resolve(directory, entry.name)
54
+ if (entry.isDirectory()) await findSourceMaps(path, maps)
55
+ else if (entry.isFile() && entry.name.endsWith('.map')) maps.push(path)
56
+ }
57
+ return maps
58
+ }
59
+
60
+ async function applicationRoot() {
61
+ const workspaceAdmin = resolve(ROOT, 'apps', 'admin')
62
+ try {
63
+ await access(workspaceAdmin)
64
+ return workspaceAdmin
65
+ } catch {
66
+ // The same checker is copied into an exported standalone Admin app.
67
+ return ROOT
68
+ }
69
+ }
70
+
71
+ function containsExecutableDebugCode(source) {
72
+ return /\bdebugger\s*;|\bconsole\s*\.\s*(?:assert|clear|count|debug|dir|error|group|info|log|profile|table|time|trace|warn)\s*\(/.test(
73
+ source,
74
+ )
75
+ }
76
+
77
+ function containsJavaScriptPayload(source) {
78
+ const withoutComments = source
79
+ .replaceAll(/\/\*[\s\S]*?\*\//g, '')
80
+ .replaceAll(/(^|\n)\s*\/\/[^\n]*/g, '$1')
81
+ .trim()
82
+ return withoutComments !== '' && !/^export\s*\{\s*\}\s*;?$/.test(withoutComments)
83
+ }
84
+
85
+ function formatKib(bytes) {
86
+ return `${(bytes / 1024).toFixed(1)} KiB`
87
+ }
88
+
89
+ function assetPathFromUrl(url) {
90
+ const cleanUrl = url.split(/[?#]/, 1)[0].replaceAll('\\', '/')
91
+ const marker = 'assets/'
92
+ const markerIndex = cleanUrl.indexOf(marker)
93
+ if (markerIndex < 0 || !cleanUrl.endsWith('.js')) return undefined
94
+ const relativePath = cleanUrl.slice(markerIndex + marker.length)
95
+ if (!relativePath || relativePath.includes('../')) return undefined
96
+ return resolve(ASSETS_DIRECTORY, relativePath)
97
+ }
98
+
99
+ async function readInitialJavaScript() {
100
+ const html = await readFile(resolve(DIST_DIRECTORY, 'index.html'), 'utf8')
101
+ const initial = new Set()
102
+ const entries = new Set()
103
+
104
+ for (const match of html.matchAll(
105
+ /<(script|link)\s[^>]*(?:src|href)=["']([^"']+\.js(?:[?#][^"']*)?)["'][^>]*>/gi,
106
+ )) {
107
+ const path = assetPathFromUrl(match[2])
108
+ if (!path) continue
109
+ initial.add(path)
110
+ if (match[1].toLowerCase() === 'script') entries.add(path)
111
+ }
112
+
113
+ if (entries.size === 0) throw new Error('Admin index.html does not reference a JavaScript entry.')
114
+
115
+ const sizes = await Promise.all(
116
+ [...initial].map(async (path) => ({ path, size: (await stat(path)).size })),
117
+ )
118
+ const entrySizes = sizes.filter(({ path }) => entries.has(path))
119
+ return {
120
+ entryBytes: entrySizes.reduce((total, { size }) => total + size, 0),
121
+ initialBytes: sizes.reduce((total, { size }) => total + size, 0),
122
+ initialFiles: sizes.length,
123
+ }
124
+ }
125
+
126
+ async function main() {
127
+ const chunks = await findJavaScriptChunks(ASSETS_DIRECTORY)
128
+ if (chunks.length === 0) throw new Error('No JavaScript chunks were produced by the Admin build.')
129
+
130
+ const sourceMaps = await findSourceMaps(DIST_DIRECTORY)
131
+ if (DEBUG_BUILD) {
132
+ if (sourceMaps.length === 0) throw new Error('Debug build did not produce source maps.')
133
+ return
134
+ }
135
+
136
+ if (sourceMaps.length > 0) {
137
+ throw new Error('Production build produced source maps.')
138
+ }
139
+
140
+ const artifacts = []
141
+ const empty = []
142
+ const debugCode = []
143
+ for (const chunk of chunks) {
144
+ const path = relative(ROOT, chunk)
145
+ const size = (await stat(chunk)).size
146
+ const source = await readFile(chunk, 'utf8')
147
+ artifacts.push({ path, size })
148
+ if (!containsJavaScriptPayload(source)) empty.push(path)
149
+ if (containsExecutableDebugCode(source)) debugCode.push(path)
150
+ }
151
+
152
+ artifacts.sort((left, right) => right.size - left.size || left.path.localeCompare(right.path))
153
+ const oversized = artifacts.filter(({ size }) => size > MAX_CHUNK_BYTES)
154
+ const totalBytes = artifacts.reduce((total, { size }) => total + size, 0)
155
+ const totalGzipBytes = (
156
+ await Promise.all(chunks.map(async (chunk) => gzipSync(await readFile(chunk)).length))
157
+ ).reduce((total, size) => total + size, 0)
158
+ const gzipHeadroomBytes = MAX_GZIP_BYTES - totalGzipBytes
159
+ const largest = artifacts[0]
160
+ const initial = await readInitialJavaScript()
161
+
162
+ console.log(
163
+ `[admin-bundle] ${artifacts.length} JavaScript chunks, ${formatKib(totalBytes)} total; ` +
164
+ `largest ${largest.path} (${formatKib(largest.size)}, ${Math.round((largest.size / MAX_CHUNK_BYTES) * 100)}% of budget); ` +
165
+ `entry ${formatKib(initial.entryBytes)}, initial ${initial.initialFiles} files / ${formatKib(initial.initialBytes)}; ` +
166
+ `gzip ${formatKib(totalGzipBytes)} / ${formatKib(MAX_GZIP_BYTES)} hard limit; ` +
167
+ `${formatKib(gzipHeadroomBytes)} headroom`,
168
+ )
169
+
170
+ if (oversized.length > 0) {
171
+ for (const { path, size } of oversized.sort((left, right) => right.size - left.size)) {
172
+ console.error(
173
+ `[admin-bundle] ${path}: ${formatKib(size)} exceeds the ${formatKib(MAX_CHUNK_BYTES)} budget`,
174
+ )
175
+ }
176
+ process.exitCode = 1
177
+ }
178
+
179
+ if (empty.length > 0) {
180
+ for (const path of empty.sort())
181
+ console.error(`[admin-bundle] ${path}: empty JavaScript chunk is not allowed`)
182
+ process.exitCode = 1
183
+ }
184
+
185
+ const budgetFailures = [
186
+ artifacts.length > MAX_CHUNK_COUNT &&
187
+ `${artifacts.length} chunks exceeds the ${MAX_CHUNK_COUNT}-chunk budget`,
188
+ totalBytes > MAX_TOTAL_BYTES &&
189
+ `${formatKib(totalBytes)} total exceeds the ${formatKib(MAX_TOTAL_BYTES)} budget`,
190
+ initial.entryBytes > MAX_ENTRY_BYTES &&
191
+ `${formatKib(initial.entryBytes)} entry exceeds the ${formatKib(MAX_ENTRY_BYTES)} budget`,
192
+ initial.initialFiles > MAX_INITIAL_JS_FILES &&
193
+ `${initial.initialFiles} initial files exceeds the ${MAX_INITIAL_JS_FILES}-file budget`,
194
+ initial.initialBytes > MAX_INITIAL_JS_BYTES &&
195
+ `${formatKib(initial.initialBytes)} initial JavaScript exceeds the ${formatKib(MAX_INITIAL_JS_BYTES)} budget`,
196
+ totalGzipBytes > MAX_GZIP_BYTES &&
197
+ `${formatKib(totalGzipBytes)} JavaScript gzip exceeds the ${formatKib(MAX_GZIP_BYTES)} hard limit (5% historical growth less 10 KiB safety margin)`,
198
+ ].filter(Boolean)
199
+ for (const failure of budgetFailures) {
200
+ console.error(`[admin-bundle] ${failure}`)
201
+ process.exitCode = 1
202
+ }
203
+
204
+ if (debugCode.length > 0) {
205
+ for (const path of debugCode)
206
+ console.error(`[admin-bundle] ${path}: executable console/debugger code is not allowed`)
207
+ process.exitCode = 1
208
+ }
209
+ }
210
+
211
+ main().catch((error) => {
212
+ console.error(`[admin-bundle] ${error.message}`)
213
+ process.exitCode = 1
214
+ })
@@ -0,0 +1,168 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync } from 'node:fs'
3
+ import { readdir, readFile } from 'node:fs/promises'
4
+ import { join, resolve } from 'node:path'
5
+ import process from 'node:process'
6
+ import { parse } from '@vue/compiler-sfc'
7
+ import ts from 'typescript'
8
+
9
+ const root = resolve(process.cwd())
10
+ const source = existsSync(join(root, 'apps', 'admin', 'scaffold', 'agent-contracts'))
11
+ ? join(root, 'apps', 'admin', 'scaffold', 'agent-contracts')
12
+ : root
13
+ const codex = join(source, '.codex')
14
+ const catalogPath = join(source, 'component-catalog.json')
15
+ const requiredSkills = [
16
+ 'build-admin-feature',
17
+ 'use-og-http',
18
+ 'use-og-table',
19
+ 'use-og-search',
20
+ 'use-og-form',
21
+ 'use-og-editor',
22
+ 'use-og-upload',
23
+ 'use-og-form-table',
24
+ 'use-og-dialog',
25
+ 'use-og-router-tabs',
26
+ 'style-og-origen-ui',
27
+ ]
28
+ const failures = []
29
+
30
+ if (!existsSync(join(source, 'AGENTS.md')) || !existsSync(join(codex, 'AGENTS.md')))
31
+ failures.push('missing canonical AGENTS.md')
32
+ if (!existsSync(catalogPath)) {
33
+ failures.push('missing component-catalog.json')
34
+ } else {
35
+ try {
36
+ const catalog = JSON.parse(await readFile(catalogPath, 'utf8'))
37
+ if (
38
+ catalog.schemaVersion !== 1 ||
39
+ !Array.isArray(catalog.components) ||
40
+ catalog.components.length === 0
41
+ ) {
42
+ failures.push('component-catalog.json must contain at least one component')
43
+ }
44
+ } catch {
45
+ failures.push('invalid component-catalog.json')
46
+ }
47
+ }
48
+
49
+ for (const name of requiredSkills) {
50
+ const path = join(codex, 'skills', name, 'SKILL.md')
51
+ if (!existsSync(path)) {
52
+ failures.push(`missing skill ${name}`)
53
+ continue
54
+ }
55
+ const contents = await readFile(path, 'utf8')
56
+ if (!/^---\r?\nname: [a-z0-9-]+\r?\ndescription: .+\r?\n---/u.test(contents))
57
+ failures.push(`${name}: invalid frontmatter`)
58
+ if (/\[TODO:|TODO:/u.test(contents)) failures.push(`${name}: unresolved TODO`)
59
+ }
60
+
61
+ const ruleDirectory = join(codex, 'rules')
62
+ const rules = existsSync(ruleDirectory) ? await readdir(ruleDirectory) : []
63
+ if (rules.length < 6) failures.push('expected six scaffold rules')
64
+
65
+ await validateBusinessComponentUsage()
66
+
67
+ if (failures.length) {
68
+ for (const failure of failures) console.error(`[admin-scaffold] ${failure}`)
69
+ process.exit(1)
70
+ }
71
+
72
+ console.warn(
73
+ `[admin-scaffold] contracts valid (${requiredSkills.length} skills, ${rules.length} rules)`,
74
+ )
75
+
76
+ async function walk(directory, files = []) {
77
+ let entries
78
+ try {
79
+ entries = await readdir(directory, { withFileTypes: true })
80
+ } catch (error) {
81
+ if (error.code === 'ENOENT') return files
82
+ throw error
83
+ }
84
+ for (const entry of entries) {
85
+ const path = join(directory, entry.name)
86
+ if (entry.isDirectory()) await walk(path, files)
87
+ else if (entry.isFile() && ['.vue', '.ts'].some((extension) => entry.name.endsWith(extension)))
88
+ files.push(path)
89
+ }
90
+ return files
91
+ }
92
+
93
+ function lineAt(source, index) {
94
+ return source.slice(0, index).split(/\r?\n/).length
95
+ }
96
+
97
+ function report(path, source, index, message) {
98
+ failures.push(`${path}:${lineAt(source, index)}: ${message}`)
99
+ }
100
+
101
+ async function validateBusinessComponentUsage() {
102
+ const features = join(source, 'src', 'features')
103
+ const exemptFeatures = new Set(['appearance', 'auth', 'errors', 'security', 'shell'])
104
+ for (const path of await walk(features)) {
105
+ const relative = path.slice(features.length + 1).replaceAll('\\', '/')
106
+ if (exemptFeatures.has(relative.split('/')[0])) continue
107
+ const contents = await readFile(path, 'utf8')
108
+ const script = path.endsWith('.vue')
109
+ ? (parse(contents, { filename: path }).descriptor.scriptSetup?.content ??
110
+ parse(contents, { filename: path }).descriptor.script?.content ??
111
+ '')
112
+ : contents
113
+ const sourceFile = ts.createSourceFile(path, script, ts.ScriptTarget.Latest, true)
114
+ for (const statement of sourceFile.statements) {
115
+ if (!ts.isImportDeclaration(statement) || !ts.isStringLiteral(statement.moduleSpecifier))
116
+ continue
117
+ const moduleName = statement.moduleSpecifier.text
118
+ const imported = statement.importClause?.namedBindings
119
+ const names =
120
+ imported && ts.isNamedImports(imported)
121
+ ? imported.elements.map((element) => (element.propertyName ?? element.name).text)
122
+ : []
123
+ if (
124
+ moduleName === 'element-plus' &&
125
+ names.some((name) => ['ElTable', 'ElForm', 'ElDialog'].includes(name))
126
+ ) {
127
+ report(
128
+ path,
129
+ contents,
130
+ statement.getStart(sourceFile),
131
+ 'business features must use the matching Origen UI component instead of ElTable, ElForm, or ElDialog',
132
+ )
133
+ }
134
+ if ((moduleName === 'axios' || moduleName === 'node-fetch') && relative.startsWith('system/')) {
135
+ report(
136
+ path,
137
+ contents,
138
+ statement.getStart(sourceFile),
139
+ 'business features must use @origen-ui/http instead of a transport client',
140
+ )
141
+ }
142
+ }
143
+ for (const legacy of ['fetch=', 'search-schema=', 'searchSchema']) {
144
+ const index = contents.indexOf(legacy)
145
+ if (index >= 0) {
146
+ report(
147
+ path,
148
+ contents,
149
+ index,
150
+ `legacy table API ${legacy} is not allowed; use OgTableWithSearch dataSource and config.search`,
151
+ )
152
+ }
153
+ }
154
+ if (!path.endsWith('.vue')) continue
155
+ const template = parse(contents, { filename: path }).descriptor.template?.content ?? ''
156
+ for (const tag of ['ElTable', 'ElForm', 'ElDialog']) {
157
+ const index = template.search(new RegExp(`<${tag}(?:\\s|>)`))
158
+ if (index >= 0) {
159
+ report(
160
+ path,
161
+ contents,
162
+ contents.indexOf(template) + index,
163
+ `business features must use the matching Origen UI component instead of ${tag}`,
164
+ )
165
+ }
166
+ }
167
+ }
168
+ }
@@ -0,0 +1,26 @@
1
+ <script setup lang="ts">
2
+ import { ElButton, ElResult } from 'element-plus'
3
+ import { useRouter } from 'vue-router'
4
+
5
+ defineOptions({ name: 'ForbiddenPage' })
6
+
7
+ const router = useRouter()
8
+ </script>
9
+
10
+ <template>
11
+ <main class="error-page">
12
+ <ElResult icon="warning" title="403" sub-title="抱歉,你没有访问此页面的权限。">
13
+ <template #extra>
14
+ <ElButton type="primary" @click="router.push('/workspace')"> 回到工作台 </ElButton>
15
+ </template>
16
+ </ElResult>
17
+ </main>
18
+ </template>
19
+
20
+ <style scoped>
21
+ .error-page {
22
+ display: grid;
23
+ min-height: 100vh;
24
+ place-items: center;
25
+ }
26
+ </style>
@@ -0,0 +1,26 @@
1
+ <script setup lang="ts">
2
+ import { ElButton, ElResult } from 'element-plus'
3
+ import { useRouter } from 'vue-router'
4
+
5
+ defineOptions({ name: 'NotFoundPage' })
6
+
7
+ const router = useRouter()
8
+ </script>
9
+
10
+ <template>
11
+ <main class="error-page">
12
+ <ElResult icon="warning" title="404" sub-title="你访问的页面不存在或已经被移除。">
13
+ <template #extra>
14
+ <ElButton type="primary" @click="router.push('/workspace')"> 回到工作台 </ElButton>
15
+ </template>
16
+ </ElResult>
17
+ </main>
18
+ </template>
19
+
20
+ <style scoped>
21
+ .error-page {
22
+ display: grid;
23
+ min-height: 100vh;
24
+ place-items: center;
25
+ }
26
+ </style>