@origen-ui/admin-cli 1.0.3 → 2.0.1

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 (237) hide show
  1. package/README.md +11 -7
  2. package/package.json +19 -3
  3. package/templates/current/clean/CHANGELOG.md +137 -0
  4. package/templates/current/clean/component-catalog.json +58 -17
  5. package/templates/current/clean/e2e/admin-shell.spec.ts +6 -0
  6. package/templates/current/clean/e2e/demo-shell.spec.ts +90 -46
  7. package/templates/current/clean/package.json +55 -41
  8. package/templates/current/clean/playwright.config.ts +1 -0
  9. package/templates/current/clean/playwright.demo.config.ts +1 -1
  10. package/templates/current/clean/scaffold.lock.json +2 -2
  11. package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/Forbidden.vue +7 -2
  12. package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/NotFound.vue +7 -2
  13. package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/ServerError.vue +7 -2
  14. package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/error-pages.spec.ts +11 -2
  15. package/templates/current/clean/scripts/clean-overlay/src/main.ts +23 -14
  16. package/templates/current/clean/scripts/clean-overlay/src/router/componentCache.ts +12 -0
  17. package/templates/current/clean/scripts/clean-overlay/src/router/componentRegistry.ts +2 -13
  18. package/templates/current/clean/scripts/clean-overlay/src/router/dynamicRoutes.spec.ts +34 -4
  19. package/templates/current/clean/scripts/clean-overlay/src/router/paths.ts +21 -0
  20. package/templates/current/clean/scripts/clean-overlay/src/router/staticRoutes.ts +6 -6
  21. package/templates/current/clean/scripts/demo-api.ts +84 -8
  22. package/templates/current/clean/scripts/generate-api.ts +87 -3
  23. package/templates/current/clean/scripts/vite-build-policy.spec.ts +72 -0
  24. package/templates/current/clean/src/App.vue +10 -3
  25. package/templates/current/clean/src/api/client.ts +90 -10
  26. package/templates/current/clean/src/api/generated/data-contracts.ts +0 -3
  27. package/templates/current/clean/src/api/generated/http-client.ts +28 -26
  28. 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 +5 -8
  29. 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 +1 -4
  30. 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 +2 -5
  31. 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 +6 -9
  32. 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 +7 -10
  33. 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 +6 -9
  34. 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 +6 -9
  35. package/templates/current/clean/src/api/generated//350/256/244/350/257/201.ts +3 -6
  36. package/templates/current/clean/src/app/adminLocale.ts +90 -0
  37. package/templates/current/clean/src/app/createAdminUi.spec.ts +65 -9
  38. package/templates/current/clean/src/app/createAdminUi.ts +14 -29
  39. package/templates/current/clean/src/app/embedded-token.spec.ts +40 -0
  40. package/templates/current/clean/src/app/embedded.spec.ts +135 -0
  41. package/templates/current/clean/src/app/embedded.ts +255 -0
  42. package/templates/current/clean/src/app/errorMessage.spec.ts +76 -0
  43. package/templates/current/clean/src/app/errorMessage.ts +53 -0
  44. package/templates/current/clean/src/app/localeFormat.ts +52 -0
  45. package/templates/current/clean/src/app/menu-host.spec.ts +77 -0
  46. package/templates/current/clean/src/app/menu.spec.ts +65 -0
  47. package/templates/current/clean/src/app/menu.ts +52 -12
  48. package/templates/current/clean/src/app/menuTypes.ts +1 -0
  49. package/templates/current/clean/src/app/origenUiLocale.spec.ts +6 -5
  50. package/templates/current/clean/src/app/origenUiLocale.ts +3 -58
  51. package/templates/current/clean/src/app/permission.spec.ts +26 -0
  52. package/templates/current/clean/src/app/runtimeConfig.ts +9 -8
  53. package/templates/current/clean/src/demo-api.spec.ts +311 -0
  54. package/templates/current/clean/src/env.d.ts +18 -0
  55. package/templates/current/clean/src/features/appearance/components/ThemePanel.vue +21 -17
  56. package/templates/current/clean/src/features/appearance/store/theme.ts +2 -1
  57. package/templates/current/clean/src/features/auth/pages/Login.vue +22 -12
  58. package/templates/current/clean/src/features/auth/store/auth.ts +6 -9
  59. package/templates/current/clean/src/features/errors/pages/Forbidden.vue +7 -2
  60. package/templates/current/clean/src/features/errors/pages/NotFound.vue +7 -2
  61. package/templates/current/clean/src/features/errors/pages/ServerError.vue +7 -2
  62. package/templates/current/clean/src/features/errors/pages/error-pages.spec.ts +11 -2
  63. package/templates/current/clean/src/features/security/components/DevtoolsProtectionOverlay.vue +5 -2
  64. package/templates/current/clean/src/features/security/devtoolsProtection.spec.ts +7 -10
  65. package/templates/current/clean/src/features/security/devtoolsProtection.ts +2 -1
  66. package/templates/current/clean/src/features/system/access/api/admin-repository.spec.ts +14 -0
  67. package/templates/current/clean/src/features/system/access/api/admin-repository.ts +34 -15
  68. package/templates/current/clean/src/features/system/access/api/rbac.ts +52 -32
  69. package/templates/current/clean/src/features/system/access/composables/useAuthorizationPolling.spec.ts +134 -0
  70. package/templates/current/clean/src/features/system/access/composables/useAuthorizationPolling.ts +96 -0
  71. package/templates/current/clean/src/features/workspace/pages/Empty.vue +4 -1
  72. package/templates/current/clean/src/features/workspace/pages/Profile.vue +14 -12
  73. package/templates/current/clean/src/layouts/AdminLayout.vue +6 -1
  74. package/templates/current/clean/src/layouts/TopBar.vue +60 -11
  75. package/templates/current/clean/src/layouts/topBarMenuSearch.spec.ts +24 -1
  76. package/templates/current/clean/src/layouts/topBarMenuSearch.ts +10 -0
  77. package/templates/current/clean/src/locales/en-US.json +517 -0
  78. package/templates/current/clean/src/locales/en-US.runtime.ts +22 -0
  79. package/templates/current/clean/src/locales/index.ts +144 -47
  80. package/templates/current/clean/src/locales/messages-types.ts +62 -0
  81. package/templates/current/clean/src/locales/messages.spec.ts +113 -6
  82. package/templates/current/clean/src/locales/vue-i18n.d.ts +5 -0
  83. package/templates/current/clean/src/locales/zh-CN.json +517 -0
  84. package/templates/current/clean/src/locales/zh-CN.runtime.ts +22 -0
  85. package/templates/current/clean/src/locales/zh-TW.json +517 -0
  86. package/templates/current/clean/src/locales/zh-TW.runtime.ts +22 -0
  87. package/templates/current/clean/src/main.ts +23 -14
  88. package/templates/current/clean/src/router/bootstrap.ts +20 -11
  89. package/templates/current/clean/src/router/componentCache.ts +12 -0
  90. package/templates/current/clean/src/router/componentRegistry.ts +2 -13
  91. package/templates/current/clean/src/router/dynamicMenuRefresh.spec.ts +101 -0
  92. package/templates/current/clean/src/router/dynamicMenuRefresh.ts +24 -0
  93. package/templates/current/clean/src/router/dynamicRoutes.spec.ts +34 -4
  94. package/templates/current/clean/src/router/dynamicRoutes.ts +19 -4
  95. package/templates/current/clean/src/router/paths.spec.ts +50 -0
  96. package/templates/current/clean/src/router/paths.ts +21 -0
  97. package/templates/current/clean/src/router/queryEncryption.spec.ts +30 -4
  98. package/templates/current/clean/src/router/queryEncryption.ts +48 -44
  99. package/templates/current/clean/src/router/staticRoutes.ts +6 -6
  100. package/templates/current/clean/src/router/useRouteQueryDefaults.spec.ts +2 -1
  101. package/templates/current/clean/src/router/useRouteQueryDefaults.types.ts +2 -1
  102. package/templates/current/clean/src/templates/og-table.ts +79 -37
  103. package/templates/current/clean/src/templates/templates.spec.ts +19 -0
  104. package/templates/current/clean/tsconfig.json +0 -1
  105. package/templates/current/clean/vite.build-policy.ts +161 -289
  106. package/templates/current/clean/vite.config.ts +34 -5
  107. package/templates/current/examples/CHANGELOG.md +137 -0
  108. package/templates/current/examples/component-catalog.json +58 -17
  109. package/templates/current/examples/e2e/admin-shell.spec.ts +6 -0
  110. package/templates/current/examples/e2e/demo-shell.spec.ts +90 -46
  111. package/templates/current/examples/package.json +55 -41
  112. package/templates/current/examples/playwright.config.ts +1 -0
  113. package/templates/current/examples/playwright.demo.config.ts +1 -1
  114. package/templates/current/examples/scaffold.lock.json +2 -2
  115. package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/Forbidden.vue +7 -2
  116. package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/NotFound.vue +7 -2
  117. package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/ServerError.vue +7 -2
  118. package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/error-pages.spec.ts +11 -2
  119. package/templates/current/examples/scripts/clean-overlay/src/main.ts +23 -14
  120. package/templates/current/examples/scripts/clean-overlay/src/router/componentCache.ts +12 -0
  121. package/templates/current/examples/scripts/clean-overlay/src/router/componentRegistry.ts +2 -13
  122. package/templates/current/examples/scripts/clean-overlay/src/router/dynamicRoutes.spec.ts +34 -4
  123. package/templates/current/examples/scripts/clean-overlay/src/router/paths.ts +21 -0
  124. package/templates/current/examples/scripts/clean-overlay/src/router/staticRoutes.ts +6 -6
  125. package/templates/current/examples/scripts/demo-api.ts +84 -8
  126. package/templates/current/examples/scripts/generate-api.ts +87 -3
  127. package/templates/current/examples/scripts/vite-build-policy.spec.ts +72 -0
  128. package/templates/current/examples/src/App.vue +10 -3
  129. package/templates/current/examples/src/api/client.ts +90 -10
  130. package/templates/current/examples/src/api/generated/data-contracts.ts +0 -3
  131. package/templates/current/examples/src/api/generated/http-client.ts +28 -26
  132. 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 +5 -8
  133. 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 +1 -4
  134. 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 +2 -5
  135. 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 +6 -9
  136. 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 +7 -10
  137. 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 +6 -9
  138. 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 +6 -9
  139. package/templates/current/examples/src/api/generated//350/256/244/350/257/201.ts +3 -6
  140. package/templates/current/examples/src/app/adminLocale.ts +90 -0
  141. package/templates/current/examples/src/app/createAdminUi.spec.ts +65 -9
  142. package/templates/current/examples/src/app/createAdminUi.ts +14 -29
  143. package/templates/current/examples/src/app/embedded-token.spec.ts +40 -0
  144. package/templates/current/examples/src/app/embedded.spec.ts +135 -0
  145. package/templates/current/examples/src/app/embedded.ts +255 -0
  146. package/templates/current/examples/src/app/errorMessage.spec.ts +76 -0
  147. package/templates/current/examples/src/app/errorMessage.ts +53 -0
  148. package/templates/current/examples/src/app/localeFormat.ts +52 -0
  149. package/templates/current/examples/src/app/menu-host.spec.ts +77 -0
  150. package/templates/current/examples/src/app/menu.spec.ts +65 -0
  151. package/templates/current/examples/src/app/menu.ts +52 -12
  152. package/templates/current/examples/src/app/menuTypes.ts +1 -0
  153. package/templates/current/examples/src/app/origenUiLocale.spec.ts +6 -5
  154. package/templates/current/examples/src/app/origenUiLocale.ts +3 -58
  155. package/templates/current/examples/src/app/permission.spec.ts +26 -0
  156. package/templates/current/examples/src/app/runtimeConfig.ts +9 -8
  157. package/templates/current/examples/src/demo-api.spec.ts +311 -0
  158. package/templates/current/examples/src/env.d.ts +18 -0
  159. package/templates/current/examples/src/features/appearance/components/ThemePanel.vue +21 -17
  160. package/templates/current/examples/src/features/appearance/store/theme.ts +2 -1
  161. package/templates/current/examples/src/features/auth/pages/Login.vue +22 -12
  162. package/templates/current/examples/src/features/auth/store/auth.ts +6 -9
  163. package/templates/current/examples/src/features/errors/pages/Forbidden.vue +7 -2
  164. package/templates/current/examples/src/features/errors/pages/NotFound.vue +7 -2
  165. package/templates/current/examples/src/features/errors/pages/ServerError.vue +7 -2
  166. package/templates/current/examples/src/features/errors/pages/error-pages.spec.ts +9 -1
  167. package/templates/current/examples/src/features/feature-composables.spec.ts +47 -10
  168. package/templates/current/examples/src/features/security/components/DevtoolsProtectionOverlay.vue +5 -2
  169. package/templates/current/examples/src/features/security/devtoolsProtection.spec.ts +7 -10
  170. package/templates/current/examples/src/features/security/devtoolsProtection.ts +2 -1
  171. package/templates/current/examples/src/features/system/access/api/admin-repository.spec.ts +14 -0
  172. package/templates/current/examples/src/features/system/access/api/admin-repository.ts +34 -15
  173. package/templates/current/examples/src/features/system/access/api/rbac.ts +52 -32
  174. package/templates/current/examples/src/features/system/access/composables/useAuthorizationPolling.spec.ts +134 -0
  175. package/templates/current/examples/src/features/system/access/composables/useAuthorizationPolling.ts +96 -0
  176. package/templates/current/examples/src/features/system/audit/composables/useAuditManagement.ts +43 -38
  177. package/templates/current/examples/src/features/system/menus/components/MenuEditorForm.vue +137 -47
  178. package/templates/current/examples/src/features/system/menus/composables/useMenuManagement.ts +215 -107
  179. package/templates/current/examples/src/features/system/menus/menuDraft.spec.ts +204 -0
  180. package/templates/current/examples/src/features/system/menus/menuDraft.ts +116 -0
  181. package/templates/current/examples/src/features/system/menus/menuTreePrecheck.spec.ts +268 -0
  182. package/templates/current/examples/src/features/system/menus/menuTreePrecheck.ts +317 -0
  183. package/templates/current/examples/src/features/system/menus/pages/MenuList.vue +3 -1
  184. package/templates/current/examples/src/features/system/roles/components/RoleEditorForm.vue +19 -15
  185. package/templates/current/examples/src/features/system/roles/composables/useRoleManagement.ts +49 -53
  186. package/templates/current/examples/src/features/system/roles/pages/RoleList.vue +3 -1
  187. package/templates/current/examples/src/features/system/users/components/UserEditorForm.vue +22 -19
  188. package/templates/current/examples/src/features/system/users/composables/useUserManagement.ts +59 -64
  189. package/templates/current/examples/src/features/system/users/pages/UserList.vue +3 -1
  190. package/templates/current/examples/src/features/workspace/pages/Dashboard.spec.ts +9 -0
  191. package/templates/current/examples/src/features/workspace/pages/Dashboard.vue +54 -26
  192. package/templates/current/examples/src/features/workspace/pages/Empty.vue +4 -1
  193. package/templates/current/examples/src/features/workspace/pages/Profile.vue +14 -12
  194. package/templates/current/examples/src/layouts/AdminLayout.vue +6 -1
  195. package/templates/current/examples/src/layouts/TopBar.vue +60 -11
  196. package/templates/current/examples/src/layouts/topBarMenuSearch.spec.ts +24 -1
  197. package/templates/current/examples/src/layouts/topBarMenuSearch.ts +10 -0
  198. package/templates/current/examples/src/locales/en-US.json +517 -0
  199. package/templates/current/examples/src/locales/en-US.runtime.ts +22 -0
  200. package/templates/current/examples/src/locales/index.ts +144 -47
  201. package/templates/current/examples/src/locales/messages-types.ts +62 -0
  202. package/templates/current/examples/src/locales/messages.spec.ts +113 -6
  203. package/templates/current/examples/src/locales/vue-i18n.d.ts +5 -0
  204. package/templates/current/examples/src/locales/zh-CN.json +517 -0
  205. package/templates/current/examples/src/locales/zh-CN.runtime.ts +22 -0
  206. package/templates/current/examples/src/locales/zh-TW.json +517 -0
  207. package/templates/current/examples/src/locales/zh-TW.runtime.ts +22 -0
  208. package/templates/current/examples/src/main.ts +43 -15
  209. package/templates/current/examples/src/router/bootstrap.ts +20 -11
  210. package/templates/current/examples/src/router/componentCache.ts +18 -0
  211. package/templates/current/examples/src/router/componentRegistry.ts +1 -18
  212. package/templates/current/examples/src/router/dynamicMenuRefresh.spec.ts +101 -0
  213. package/templates/current/examples/src/router/dynamicMenuRefresh.ts +24 -0
  214. package/templates/current/examples/src/router/dynamicRoutes.spec.ts +37 -2
  215. package/templates/current/examples/src/router/dynamicRoutes.ts +19 -4
  216. package/templates/current/examples/src/router/paths.spec.ts +50 -0
  217. package/templates/current/examples/src/router/paths.ts +21 -0
  218. package/templates/current/examples/src/router/queryEncryption.spec.ts +30 -4
  219. package/templates/current/examples/src/router/queryEncryption.ts +48 -44
  220. package/templates/current/examples/src/router/staticRoutes.ts +4 -4
  221. package/templates/current/examples/src/router/useRouteQueryDefaults.spec.ts +2 -1
  222. package/templates/current/examples/src/router/useRouteQueryDefaults.types.ts +2 -1
  223. package/templates/current/examples/src/templates/og-table.ts +79 -37
  224. package/templates/current/examples/src/templates/templates.spec.ts +19 -0
  225. package/templates/current/examples/tsconfig.json +0 -1
  226. package/templates/current/examples/vite.build-policy.ts +161 -289
  227. package/templates/current/examples/vite.config.ts +34 -5
  228. package/templates/current/clean/scripts/check-admin-bundle.mjs +0 -214
  229. package/templates/current/clean/scripts/performance/baselines/bundle-gzip-v2-pre-entry-unification.json +0 -38
  230. package/templates/current/clean/src/locales/en-US.ts +0 -55
  231. package/templates/current/clean/src/locales/zh-CN.ts +0 -55
  232. package/templates/current/clean/src/locales/zh-TW.ts +0 -44
  233. package/templates/current/examples/scripts/check-admin-bundle.mjs +0 -214
  234. package/templates/current/examples/scripts/performance/baselines/bundle-gzip-v2-pre-entry-unification.json +0 -38
  235. package/templates/current/examples/src/locales/en-US.ts +0 -55
  236. package/templates/current/examples/src/locales/zh-CN.ts +0 -55
  237. package/templates/current/examples/src/locales/zh-TW.ts +0 -44
@@ -1,214 +0,0 @@
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
- })
@@ -1,38 +0,0 @@
1
- {
2
- "schemaVersion": 1,
3
- "recordedAt": "2026-08-15T09:31:18.000Z",
4
- "source": {
5
- "commit": "ac962ddbcbd91470376194b95d2e6323db290277",
6
- "description": "Production artifacts built before ae4ff1e unified public component entry points. Package values are the gzip sum of every published dist runtime artifact and declared root CSS asset. Baselines are immutable release evidence, not generated by the checker.",
7
- "adminDistSha256": "4651bb36dcfa1d6bf93667409765fd85e4a2ee7e61592aee14ae0346e99445e6",
8
- "docsDistSha256": "3a250df67f9ff3b46218972f9e2dff5d31a234bca4f4379add487b14d1fa8740"
9
- },
10
- "admin": {
11
- "javaScriptGzipBytes": 488467
12
- },
13
- "docs": {
14
- "javaScriptGzipBytes": 1023857
15
- },
16
- "packages": {
17
- "http": 7081,
18
- "icons": 78087,
19
- "dialog": 17024,
20
- "editor": 26511,
21
- "form": 44729,
22
- "form-table": 8348,
23
- "search": 16676,
24
- "table": 79906,
25
- "table-search": 4713,
26
- "tabs": 48200,
27
- "origen-ui": 2206,
28
- "upload": 17729,
29
- "router": 15749,
30
- "shared": 2901
31
- },
32
- "introducedAfterBaseline": {
33
- "permission": "Added by ae4ff1e after the pre-entry-unification baseline; its first released artifact establishes the next baseline."
34
- },
35
- "nonBrowserRuntimePackages": {
36
- "admin-cli": "The CLI publishes templates and Node scripts rather than browser runtime artifacts. Its generated Admin application is covered by the Admin bundle gates."
37
- }
38
- }
@@ -1,55 +0,0 @@
1
- import { OG_DIALOG_LOCALE_EN_US } from '@origen-ui/dialog/locale'
2
- import { OG_EDITOR_LOCALE_EN_US } from '@origen-ui/editor/locale'
3
- import { OG_FORM_LOCALE_EN_US } from '@origen-ui/form/locale'
4
- import { OG_SEARCH_LOCALE_EN_US } from '@origen-ui/search/locale'
5
- import { OG_TABLE_LOCALE_EN_US } from '@origen-ui/table/locale'
6
- import { OG_TABS_LOCALE_EN_US } from '@origen-ui/tabs/locale'
7
- import { OG_UPLOAD_LOCALE_EN_US } from '@origen-ui/upload/locale'
8
- import enElement from 'element-plus/es/locale/lang/en'
9
- import { defineOrigenUiLanguage } from 'origen-ui/language'
10
-
11
- const messages = {
12
- app: {
13
- title: 'Origen UI Admin Console',
14
- },
15
- menu: {
16
- dashboard: 'Dashboard',
17
- profile: 'Profile',
18
- system: {
19
- label: 'System',
20
- userList: 'Users',
21
- roleList: 'Roles',
22
- },
23
- },
24
- auth: {
25
- login: 'Sign in',
26
- logout: 'Sign out',
27
- username: 'Username',
28
- password: 'Password',
29
- },
30
- shell: {
31
- applicationNavigation: 'Application navigation',
32
- collapseNavigation: 'Collapse navigation',
33
- expandNavigation: 'Expand navigation',
34
- languageLoadFailed: 'Unable to load language. Please try again.',
35
- openUserMenu: 'Open user menu',
36
- preferences: 'Preferences',
37
- searchMenu: 'Search menus or pages',
38
- },
39
- errors: { forbidden: 'Access denied', notFound: 'Page not found', server: 'Server error' },
40
- }
41
-
42
- export default defineOrigenUiLanguage({
43
- locale: 'en-US',
44
- messages,
45
- elementPlus: enElement,
46
- origenUi: {
47
- dialog: OG_DIALOG_LOCALE_EN_US,
48
- editor: OG_EDITOR_LOCALE_EN_US,
49
- form: OG_FORM_LOCALE_EN_US,
50
- search: OG_SEARCH_LOCALE_EN_US,
51
- table: OG_TABLE_LOCALE_EN_US,
52
- tabs: OG_TABS_LOCALE_EN_US,
53
- upload: OG_UPLOAD_LOCALE_EN_US,
54
- },
55
- })
@@ -1,55 +0,0 @@
1
- import { OG_DIALOG_LOCALE_ZH_CN } from '@origen-ui/dialog/locale'
2
- import { OG_EDITOR_LOCALE_ZH_CN } from '@origen-ui/editor/locale'
3
- import { OG_FORM_LOCALE_ZH_CN } from '@origen-ui/form/locale'
4
- import { OG_SEARCH_LOCALE_ZH_CN } from '@origen-ui/search/locale'
5
- import { OG_TABLE_LOCALE_ZH_CN } from '@origen-ui/table/locale'
6
- import { OG_TABS_LOCALE_ZH_CN } from '@origen-ui/tabs/locale'
7
- import { OG_UPLOAD_LOCALE_ZH_CN } from '@origen-ui/upload/locale'
8
- import zhCnElement from 'element-plus/es/locale/lang/zh-cn'
9
- import { defineOrigenUiLanguage } from 'origen-ui/language'
10
-
11
- const messages = {
12
- app: {
13
- title: 'Origen UI Admin Console',
14
- },
15
- menu: {
16
- dashboard: '仪表盘',
17
- profile: '个人资料',
18
- system: {
19
- label: '系统管理',
20
- userList: '用户管理',
21
- roleList: '角色管理',
22
- },
23
- },
24
- auth: {
25
- login: '登录',
26
- logout: '退出登录',
27
- username: '账号',
28
- password: '密码',
29
- },
30
- shell: {
31
- applicationNavigation: '应用导航',
32
- collapseNavigation: '折叠侧边栏',
33
- expandNavigation: '展开侧边栏',
34
- languageLoadFailed: '语言加载失败,请稍后重试',
35
- openUserMenu: '打开用户菜单',
36
- preferences: '偏好设置',
37
- searchMenu: '搜索菜单或页面',
38
- },
39
- errors: { forbidden: '无权访问', notFound: '页面不存在', server: '服务异常' },
40
- }
41
-
42
- export default defineOrigenUiLanguage({
43
- locale: 'zh-CN',
44
- messages,
45
- elementPlus: zhCnElement,
46
- origenUi: {
47
- dialog: OG_DIALOG_LOCALE_ZH_CN,
48
- editor: OG_EDITOR_LOCALE_ZH_CN,
49
- form: OG_FORM_LOCALE_ZH_CN,
50
- search: OG_SEARCH_LOCALE_ZH_CN,
51
- table: OG_TABLE_LOCALE_ZH_CN,
52
- tabs: OG_TABS_LOCALE_ZH_CN,
53
- upload: OG_UPLOAD_LOCALE_ZH_CN,
54
- },
55
- })
@@ -1,44 +0,0 @@
1
- import { OG_DIALOG_LOCALE_ZH_TW } from '@origen-ui/dialog/locale'
2
- import { OG_EDITOR_LOCALE_ZH_TW } from '@origen-ui/editor/locale'
3
- import { OG_FORM_LOCALE_ZH_TW } from '@origen-ui/form/locale'
4
- import { OG_SEARCH_LOCALE_ZH_TW } from '@origen-ui/search/locale'
5
- import { OG_TABLE_LOCALE_ZH_TW } from '@origen-ui/table/locale'
6
- import { OG_TABS_LOCALE_ZH_TW } from '@origen-ui/tabs/locale'
7
- import { OG_UPLOAD_LOCALE_ZH_TW } from '@origen-ui/upload/locale'
8
- import zhTwElement from 'element-plus/es/locale/lang/zh-tw'
9
- import { defineOrigenUiLanguage } from 'origen-ui/language'
10
-
11
- const messages = {
12
- app: { title: '禾數營運控制台' },
13
- menu: {
14
- dashboard: '儀表板',
15
- profile: '個人資料',
16
- system: { label: '系統管理', userList: '使用者管理', roleList: '角色管理' },
17
- },
18
- auth: { login: '登入', logout: '登出', username: '帳號', password: '密碼' },
19
- shell: {
20
- applicationNavigation: '應用程式導覽',
21
- collapseNavigation: '收合側邊欄',
22
- expandNavigation: '展開側邊欄',
23
- languageLoadFailed: '語言載入失敗,請稍後再試。',
24
- openUserMenu: '開啟使用者選單',
25
- preferences: '偏好設定',
26
- searchMenu: '搜尋選單或頁面',
27
- },
28
- errors: { forbidden: '沒有存取權限', notFound: '找不到頁面', server: '服務錯誤' },
29
- }
30
-
31
- export default defineOrigenUiLanguage({
32
- locale: 'zh-TW',
33
- messages,
34
- elementPlus: zhTwElement,
35
- origenUi: {
36
- dialog: OG_DIALOG_LOCALE_ZH_TW,
37
- editor: OG_EDITOR_LOCALE_ZH_TW,
38
- form: OG_FORM_LOCALE_ZH_TW,
39
- search: OG_SEARCH_LOCALE_ZH_TW,
40
- table: OG_TABLE_LOCALE_ZH_TW,
41
- tabs: OG_TABS_LOCALE_ZH_TW,
42
- upload: OG_UPLOAD_LOCALE_ZH_TW,
43
- },
44
- })
@@ -1,214 +0,0 @@
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
- })
@@ -1,38 +0,0 @@
1
- {
2
- "schemaVersion": 1,
3
- "recordedAt": "2026-08-15T09:31:18.000Z",
4
- "source": {
5
- "commit": "ac962ddbcbd91470376194b95d2e6323db290277",
6
- "description": "Production artifacts built before ae4ff1e unified public component entry points. Package values are the gzip sum of every published dist runtime artifact and declared root CSS asset. Baselines are immutable release evidence, not generated by the checker.",
7
- "adminDistSha256": "4651bb36dcfa1d6bf93667409765fd85e4a2ee7e61592aee14ae0346e99445e6",
8
- "docsDistSha256": "3a250df67f9ff3b46218972f9e2dff5d31a234bca4f4379add487b14d1fa8740"
9
- },
10
- "admin": {
11
- "javaScriptGzipBytes": 488467
12
- },
13
- "docs": {
14
- "javaScriptGzipBytes": 1023857
15
- },
16
- "packages": {
17
- "http": 7081,
18
- "icons": 78087,
19
- "dialog": 17024,
20
- "editor": 26511,
21
- "form": 44729,
22
- "form-table": 8348,
23
- "search": 16676,
24
- "table": 79906,
25
- "table-search": 4713,
26
- "tabs": 48200,
27
- "origen-ui": 2206,
28
- "upload": 17729,
29
- "router": 15749,
30
- "shared": 2901
31
- },
32
- "introducedAfterBaseline": {
33
- "permission": "Added by ae4ff1e after the pre-entry-unification baseline; its first released artifact establishes the next baseline."
34
- },
35
- "nonBrowserRuntimePackages": {
36
- "admin-cli": "The CLI publishes templates and Node scripts rather than browser runtime artifacts. Its generated Admin application is covered by the Admin bundle gates."
37
- }
38
- }