@origen-ui/admin-cli 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/package.json +3 -3
  2. package/templates/current/clean/CHANGELOG.md +34 -0
  3. package/templates/current/clean/component-catalog.json +9 -9
  4. package/templates/current/clean/package.json +41 -41
  5. package/templates/current/clean/scaffold.lock.json +2 -2
  6. package/templates/current/clean/scripts/vite-build-policy.spec.ts +71 -0
  7. package/templates/current/clean/src/App.vue +10 -3
  8. package/templates/current/clean/src/api/client.ts +90 -10
  9. package/templates/current/clean/src/api/generated/data-contracts.ts +3 -3
  10. package/templates/current/clean/src/api/generated/http-client.ts +1 -1
  11. 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 +1 -1
  12. 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 -1
  13. 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 +1 -1
  14. 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 +2 -3
  15. 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 +3 -5
  16. 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 +2 -3
  17. 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 +2 -3
  18. package/templates/current/clean/src/api/generated//350/256/244/350/257/201.ts +1 -1
  19. package/templates/current/clean/src/app/adminLocale.ts +90 -0
  20. package/templates/current/clean/src/app/createAdminUi.spec.ts +65 -9
  21. package/templates/current/clean/src/app/createAdminUi.ts +14 -29
  22. package/templates/current/clean/src/app/embedded-token.spec.ts +40 -0
  23. package/templates/current/clean/src/app/embedded.spec.ts +135 -0
  24. package/templates/current/clean/src/app/embedded.ts +255 -0
  25. package/templates/current/clean/src/app/localeFormat.ts +52 -0
  26. package/templates/current/clean/src/app/menu.spec.ts +26 -0
  27. package/templates/current/clean/src/app/menu.ts +4 -0
  28. package/templates/current/clean/src/app/menuTypes.ts +1 -0
  29. package/templates/current/clean/src/app/origenUiLocale.spec.ts +6 -5
  30. package/templates/current/clean/src/app/origenUiLocale.ts +3 -58
  31. package/templates/current/clean/src/app/permission.spec.ts +26 -0
  32. package/templates/current/clean/src/app/runtimeConfig.ts +8 -7
  33. package/templates/current/clean/src/env.d.ts +18 -0
  34. package/templates/current/clean/src/features/appearance/components/ThemePanel.vue +21 -17
  35. package/templates/current/clean/src/features/appearance/store/theme.ts +2 -1
  36. package/templates/current/clean/src/features/auth/pages/Login.vue +15 -11
  37. package/templates/current/clean/src/features/auth/store/auth.ts +13 -3
  38. package/templates/current/clean/src/features/security/components/DevtoolsProtectionOverlay.vue +5 -2
  39. package/templates/current/clean/src/features/security/devtoolsProtection.spec.ts +7 -10
  40. package/templates/current/clean/src/features/security/devtoolsProtection.ts +2 -1
  41. package/templates/current/clean/src/features/system/access/api/admin-repository.spec.ts +14 -0
  42. package/templates/current/clean/src/features/system/access/api/admin-repository.ts +38 -15
  43. package/templates/current/clean/src/features/system/access/api/rbac.ts +37 -27
  44. package/templates/current/clean/src/features/workspace/pages/Empty.vue +4 -1
  45. package/templates/current/clean/src/features/workspace/pages/Profile.vue +13 -11
  46. package/templates/current/clean/src/layouts/AdminLayout.vue +3 -1
  47. package/templates/current/clean/src/layouts/TopBar.vue +26 -8
  48. package/templates/current/clean/src/locales/en-US.json +490 -0
  49. package/templates/current/clean/src/locales/en-US.runtime.ts +20 -0
  50. package/templates/current/clean/src/locales/index.ts +129 -45
  51. package/templates/current/clean/src/locales/messages-types.ts +62 -0
  52. package/templates/current/clean/src/locales/messages.spec.ts +113 -6
  53. package/templates/current/clean/src/locales/vue-i18n.d.ts +5 -0
  54. package/templates/current/clean/src/locales/zh-CN.json +490 -0
  55. package/templates/current/clean/src/locales/zh-CN.runtime.ts +20 -0
  56. package/templates/current/clean/src/locales/zh-TW.json +490 -0
  57. package/templates/current/clean/src/locales/zh-TW.runtime.ts +20 -0
  58. package/templates/current/clean/src/router/bootstrap.ts +22 -7
  59. package/templates/current/clean/src/router/dynamicRoutes.ts +5 -1
  60. package/templates/current/clean/src/router/queryEncryption.spec.ts +30 -4
  61. package/templates/current/clean/src/router/queryEncryption.ts +48 -44
  62. package/templates/current/clean/src/router/useRouteQueryDefaults.spec.ts +2 -1
  63. package/templates/current/clean/src/router/useRouteQueryDefaults.types.ts +2 -1
  64. package/templates/current/clean/src/templates/og-table.ts +81 -37
  65. package/templates/current/clean/src/templates/templates.spec.ts +19 -0
  66. package/templates/current/clean/vite.build-policy.ts +114 -289
  67. package/templates/current/clean/vite.config.ts +4 -5
  68. package/templates/current/examples/CHANGELOG.md +34 -0
  69. package/templates/current/examples/component-catalog.json +9 -9
  70. package/templates/current/examples/package.json +41 -41
  71. package/templates/current/examples/scaffold.lock.json +2 -2
  72. package/templates/current/examples/scripts/vite-build-policy.spec.ts +71 -0
  73. package/templates/current/examples/src/App.vue +10 -3
  74. package/templates/current/examples/src/api/client.ts +90 -10
  75. package/templates/current/examples/src/api/generated/data-contracts.ts +3 -3
  76. package/templates/current/examples/src/api/generated/http-client.ts +1 -1
  77. 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 +1 -1
  78. 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 -1
  79. 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 +1 -1
  80. 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 +2 -3
  81. 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 +3 -5
  82. 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 +2 -3
  83. 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 +2 -3
  84. package/templates/current/examples/src/api/generated//350/256/244/350/257/201.ts +1 -1
  85. package/templates/current/examples/src/app/adminLocale.ts +90 -0
  86. package/templates/current/examples/src/app/createAdminUi.spec.ts +65 -9
  87. package/templates/current/examples/src/app/createAdminUi.ts +14 -29
  88. package/templates/current/examples/src/app/embedded-token.spec.ts +40 -0
  89. package/templates/current/examples/src/app/embedded.spec.ts +135 -0
  90. package/templates/current/examples/src/app/embedded.ts +255 -0
  91. package/templates/current/examples/src/app/localeFormat.ts +52 -0
  92. package/templates/current/examples/src/app/menu.spec.ts +26 -0
  93. package/templates/current/examples/src/app/menu.ts +4 -0
  94. package/templates/current/examples/src/app/menuTypes.ts +1 -0
  95. package/templates/current/examples/src/app/origenUiLocale.spec.ts +6 -5
  96. package/templates/current/examples/src/app/origenUiLocale.ts +3 -58
  97. package/templates/current/examples/src/app/permission.spec.ts +26 -0
  98. package/templates/current/examples/src/app/runtimeConfig.ts +8 -7
  99. package/templates/current/examples/src/env.d.ts +18 -0
  100. package/templates/current/examples/src/features/appearance/components/ThemePanel.vue +21 -17
  101. package/templates/current/examples/src/features/appearance/store/theme.ts +2 -1
  102. package/templates/current/examples/src/features/auth/pages/Login.vue +15 -11
  103. package/templates/current/examples/src/features/auth/store/auth.ts +13 -3
  104. package/templates/current/examples/src/features/errors/pages/Forbidden.vue +6 -2
  105. package/templates/current/examples/src/features/errors/pages/NotFound.vue +6 -2
  106. package/templates/current/examples/src/features/errors/pages/ServerError.vue +6 -2
  107. package/templates/current/examples/src/features/errors/pages/error-pages.spec.ts +9 -1
  108. package/templates/current/examples/src/features/feature-composables.spec.ts +36 -9
  109. package/templates/current/examples/src/features/security/components/DevtoolsProtectionOverlay.vue +5 -2
  110. package/templates/current/examples/src/features/security/devtoolsProtection.spec.ts +7 -10
  111. package/templates/current/examples/src/features/security/devtoolsProtection.ts +2 -1
  112. package/templates/current/examples/src/features/system/access/api/admin-repository.spec.ts +14 -0
  113. package/templates/current/examples/src/features/system/access/api/admin-repository.ts +38 -15
  114. package/templates/current/examples/src/features/system/access/api/rbac.ts +37 -27
  115. package/templates/current/examples/src/features/system/audit/composables/useAuditManagement.ts +43 -38
  116. package/templates/current/examples/src/features/system/menus/components/MenuEditorForm.vue +33 -30
  117. package/templates/current/examples/src/features/system/menus/composables/useMenuManagement.ts +81 -69
  118. package/templates/current/examples/src/features/system/menus/pages/MenuList.vue +3 -1
  119. package/templates/current/examples/src/features/system/roles/components/RoleEditorForm.vue +18 -15
  120. package/templates/current/examples/src/features/system/roles/composables/useRoleManagement.ts +49 -53
  121. package/templates/current/examples/src/features/system/roles/pages/RoleList.vue +3 -1
  122. package/templates/current/examples/src/features/system/users/components/UserEditorForm.vue +22 -19
  123. package/templates/current/examples/src/features/system/users/composables/useUserManagement.ts +59 -64
  124. package/templates/current/examples/src/features/system/users/pages/UserList.vue +3 -1
  125. package/templates/current/examples/src/features/workspace/pages/Dashboard.spec.ts +9 -0
  126. package/templates/current/examples/src/features/workspace/pages/Dashboard.vue +54 -26
  127. package/templates/current/examples/src/features/workspace/pages/Empty.vue +4 -1
  128. package/templates/current/examples/src/features/workspace/pages/Profile.vue +13 -11
  129. package/templates/current/examples/src/layouts/AdminLayout.vue +3 -1
  130. package/templates/current/examples/src/layouts/TopBar.vue +26 -8
  131. package/templates/current/examples/src/locales/en-US.json +490 -0
  132. package/templates/current/examples/src/locales/en-US.runtime.ts +20 -0
  133. package/templates/current/examples/src/locales/index.ts +129 -45
  134. package/templates/current/examples/src/locales/messages-types.ts +62 -0
  135. package/templates/current/examples/src/locales/messages.spec.ts +113 -6
  136. package/templates/current/examples/src/locales/vue-i18n.d.ts +5 -0
  137. package/templates/current/examples/src/locales/zh-CN.json +490 -0
  138. package/templates/current/examples/src/locales/zh-CN.runtime.ts +20 -0
  139. package/templates/current/examples/src/locales/zh-TW.json +490 -0
  140. package/templates/current/examples/src/locales/zh-TW.runtime.ts +20 -0
  141. package/templates/current/examples/src/main.ts +31 -5
  142. package/templates/current/examples/src/router/bootstrap.ts +22 -7
  143. package/templates/current/examples/src/router/dynamicRoutes.spec.ts +17 -0
  144. package/templates/current/examples/src/router/dynamicRoutes.ts +5 -1
  145. package/templates/current/examples/src/router/queryEncryption.spec.ts +30 -4
  146. package/templates/current/examples/src/router/queryEncryption.ts +48 -44
  147. package/templates/current/examples/src/router/staticRoutes.ts +1 -1
  148. package/templates/current/examples/src/router/useRouteQueryDefaults.spec.ts +2 -1
  149. package/templates/current/examples/src/router/useRouteQueryDefaults.types.ts +2 -1
  150. package/templates/current/examples/src/templates/og-table.ts +81 -37
  151. package/templates/current/examples/src/templates/templates.spec.ts +19 -0
  152. package/templates/current/examples/vite.build-policy.ts +114 -289
  153. package/templates/current/examples/vite.config.ts +4 -5
  154. package/templates/current/clean/scripts/check-admin-bundle.mjs +0 -214
  155. package/templates/current/clean/scripts/performance/baselines/bundle-gzip-v2-pre-entry-unification.json +0 -38
  156. package/templates/current/clean/src/locales/en-US.ts +0 -55
  157. package/templates/current/clean/src/locales/zh-CN.ts +0 -55
  158. package/templates/current/clean/src/locales/zh-TW.ts +0 -44
  159. package/templates/current/examples/scripts/check-admin-bundle.mjs +0 -214
  160. package/templates/current/examples/scripts/performance/baselines/bundle-gzip-v2-pre-entry-unification.json +0 -38
  161. package/templates/current/examples/src/locales/en-US.ts +0 -55
  162. package/templates/current/examples/src/locales/zh-CN.ts +0 -55
  163. package/templates/current/examples/src/locales/zh-TW.ts +0 -44
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@origen-ui/admin-cli",
3
3
  "type": "module",
4
- "version": "1.0.3",
4
+ "version": "1.1.0",
5
5
  "description": "Project creation CLI for the Origen UI Admin scaffold",
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -13,7 +13,7 @@
13
13
  "templates/current"
14
14
  ],
15
15
  "engines": {
16
- "node": ">=20.0.0"
16
+ "node": "^22.22.1 || ^24.15.0"
17
17
  },
18
18
  "publishConfig": {
19
19
  "access": "public"
@@ -23,7 +23,7 @@
23
23
  "templates:sync": "node scripts/prepare-templates.mjs",
24
24
  "templates:check": "node scripts/check-templates.mjs",
25
25
  "type-check": "tsc --noEmit --allowJs --checkJs --target ES2022 --module NodeNext --moduleResolution NodeNext --strict --skipLibCheck bin/og-admin.mjs",
26
- "test": "vitest run --testTimeout 30000 test/admin-cli.test.mjs",
26
+ "test": "vitest run --testTimeout 180000 test/admin-cli.test.mjs",
27
27
  "lint": "eslint bin scripts test --max-warnings=0"
28
28
  }
29
29
  }
@@ -1,5 +1,39 @@
1
1
  # @origen-ui/admin
2
2
 
3
+ ## 1.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [f8fa05d]
8
+ - Updated dependencies [35487cf]
9
+ - Updated dependencies [a6ecb91]
10
+ - Updated dependencies [37da328]
11
+ - Updated dependencies [35487cf]
12
+ - Updated dependencies [0c985fd]
13
+ - Updated dependencies [35487cf]
14
+ - Updated dependencies [37da328]
15
+ - Updated dependencies [ed3e4b6]
16
+ - Updated dependencies [15b5342]
17
+ - Updated dependencies [35487cf]
18
+ - Updated dependencies [35487cf]
19
+ - Updated dependencies [35487cf]
20
+ - Updated dependencies [bf61dac]
21
+ - Updated dependencies [35487cf]
22
+ - Updated dependencies [0c985fd]
23
+ - origen-ui@1.1.0
24
+ - @origen-ui/router@1.1.0
25
+ - @origen-ui/form@1.1.0
26
+ - @origen-ui/tabs@1.1.0
27
+ - @origen-ui/upload@1.1.0
28
+ - @origen-ui/dialog@1.1.0
29
+ - @origen-ui/editor@1.1.0
30
+ - @origen-ui/search@1.1.0
31
+ - @origen-ui/table@1.1.0
32
+ - @origen-ui/table-search@1.1.0
33
+ - @origen-ui/shared@1.1.0
34
+ - @origen-ui/permission@1.1.0
35
+ - @origen-ui/http@1.1.0
36
+
3
37
  ## 1.0.3
4
38
 
5
39
  ### Patch Changes
@@ -51,7 +51,7 @@
51
51
  "mode": "prop-bag-and-expose",
52
52
  "surface": "dialogProps, drawerProps, getSurfaceInstance"
53
53
  },
54
- "compatibilityVersion": "^2.14.4"
54
+ "compatibilityVersion": "2.14.5"
55
55
  }
56
56
  },
57
57
  {
@@ -141,7 +141,7 @@
141
141
  "mode": "expose",
142
142
  "surface": "OgEditorExpose.getEditor"
143
143
  },
144
- "compatibilityVersion": "^2.14.4"
144
+ "compatibilityVersion": "2.14.5"
145
145
  }
146
146
  },
147
147
  {
@@ -229,7 +229,7 @@
229
229
  "mode": "prop-bag-and-expose",
230
230
  "surface": "formProps, formRef"
231
231
  },
232
- "compatibilityVersion": "^2.14.4"
232
+ "compatibilityVersion": "2.14.5"
233
233
  }
234
234
  },
235
235
  {
@@ -332,7 +332,7 @@
332
332
  "mode": "prop-bag-and-expose",
333
333
  "surface": "formProps, formRef"
334
334
  },
335
- "compatibilityVersion": "^2.14.4"
335
+ "compatibilityVersion": "2.14.5"
336
336
  },
337
337
  "legacyTokens": [
338
338
  "defaultExpanded",
@@ -388,7 +388,7 @@
388
388
  "mode": "config-and-expose",
389
389
  "surface": "config.virtual.enabled selects the surface; config.nativeTable.standard or config.nativeTable.virtual, getNativeTable"
390
390
  },
391
- "compatibilityVersion": "^2.14.4"
391
+ "compatibilityVersion": "2.14.5"
392
392
  },
393
393
  "legacyTokens": [
394
394
  "config.plugins",
@@ -542,7 +542,7 @@
542
542
  "mode": "prop-bag-and-expose",
543
543
  "surface": "tabsProps, getNativeTabs"
544
544
  },
545
- "compatibilityVersion": "^2.14.4"
545
+ "compatibilityVersion": "2.14.5"
546
546
  },
547
547
  "legacyTokens": [
548
548
  "allowActions",
@@ -597,7 +597,7 @@
597
597
  "mode": "prop-bag-and-expose",
598
598
  "surface": "uploadProps, getNativeUpload"
599
599
  },
600
- "compatibilityVersion": "^2.14.4"
600
+ "compatibilityVersion": "2.14.5"
601
601
  },
602
602
  "legacyTokens": [
603
603
  "withCredentials"
@@ -638,7 +638,7 @@
638
638
  "unsupportedRoute": [
639
639
  "Use ElFormItem directly for raw Element Plus form-item behavior outside OgForm context."
640
640
  ],
641
- "compatibilityVersion": "^2.14.4"
641
+ "compatibilityVersion": "2.14.5"
642
642
  }
643
643
  },
644
644
  {
@@ -674,7 +674,7 @@
674
674
  "unsupportedRoute": [
675
675
  "Use the required Element Plus control directly when the schema renderer contract is not needed."
676
676
  ],
677
- "compatibilityVersion": "^2.14.4"
677
+ "compatibilityVersion": "2.14.5"
678
678
  }
679
679
  },
680
680
  {
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@origen-ui/admin-scaffold",
3
3
  "type": "module",
4
- "version": "1.0.3",
4
+ "version": "1.1.0",
5
5
  "private": true,
6
6
  "engines": {
7
- "node": ">=20.0.0"
7
+ "node": "^22.22.1 || ^24.15.0"
8
8
  },
9
9
  "scripts": {
10
10
  "dev": "vite",
11
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",
12
+ "build": "vue-tsc --noEmit && vite build",
13
+ "build:debug": "vue-tsc --noEmit && vite build --mode debug",
14
14
  "preview": "vite preview",
15
15
  "type-check": "vue-tsc --noEmit",
16
16
  "test": "vitest run",
@@ -21,45 +21,45 @@
21
21
  "examples:remove": "node scripts/remove-examples.mjs"
22
22
  },
23
23
  "dependencies": {
24
- "@element-plus/icons-vue": "^2.3.2",
25
- "@origen-ui/dialog": "1.0.3",
26
- "@origen-ui/editor": "1.0.3",
27
- "@origen-ui/form": "1.0.3",
28
- "@origen-ui/http": "1.0.3",
29
- "@origen-ui/permission": "1.0.3",
30
- "@origen-ui/router": "1.0.3",
31
- "@origen-ui/search": "1.0.3",
32
- "@origen-ui/shared": "1.0.3",
33
- "@origen-ui/table": "1.0.3",
34
- "@origen-ui/table-search": "1.0.3",
35
- "@origen-ui/tabs": "1.0.3",
36
- "@origen-ui/upload": "1.0.3",
37
- "axios": "^1.7.7",
38
- "crypto-js": "^4.2.0",
39
- "element-plus": "^2.14.4",
40
- "origen-ui": "1.0.3",
41
- "pinia": "^2.2.0",
42
- "vue": "^3.5.40",
43
- "vue-i18n": "~11.1.12",
44
- "vue-router": "^4.6.4"
24
+ "@element-plus/icons-vue": "2.3.2",
25
+ "@noble/ciphers": "2.3.0",
26
+ "@origen-ui/dialog": "1.1.0",
27
+ "@origen-ui/editor": "1.1.0",
28
+ "@origen-ui/form": "1.1.0",
29
+ "@origen-ui/http": "1.1.0",
30
+ "@origen-ui/permission": "1.1.0",
31
+ "@origen-ui/router": "1.1.0",
32
+ "@origen-ui/search": "1.1.0",
33
+ "@origen-ui/shared": "1.1.0",
34
+ "@origen-ui/table": "1.1.0",
35
+ "@origen-ui/table-search": "1.1.0",
36
+ "@origen-ui/tabs": "1.1.0",
37
+ "@origen-ui/upload": "1.1.0",
38
+ "@vue/devtools-api": "8.2.1",
39
+ "axios": "1.19.0",
40
+ "element-plus": "2.14.5",
41
+ "origen-ui": "1.1.0",
42
+ "pinia": "4.0.3",
43
+ "vue": "3.5.41",
44
+ "vue-i18n": "11.4.8",
45
+ "vue-router": "5.2.0"
45
46
  },
46
47
  "devDependencies": {
47
- "@origen-ui/admin-cli": "1.0.3",
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",
48
+ "@origen-ui/admin-cli": "1.1.0",
49
+ "@playwright/test": "1.62.1",
50
+ "@types/node": "22.20.1",
51
+ "@vitejs/plugin-vue": "6.0.8",
52
+ "@vitejs/plugin-vue-jsx": "5.1.6",
53
+ "@vitest/coverage-v8": "4.1.11",
54
+ "@vue/compiler-sfc": "3.5.41",
55
+ "@vue/test-utils": "2.4.11",
56
+ "jsdom": "30.0.1",
57
+ "sass": "1.103.0",
58
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"
59
+ "typescript": "5.9.3",
60
+ "unplugin-element-plus": "0.11.2",
61
+ "vite": "8.2.2",
62
+ "vitest": "4.1.11",
63
+ "vue-tsc": "3.3.10"
64
64
  }
65
65
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "scaffoldVersion": "1.0.3",
4
- "agentContractsVersion": "1.0.3",
3
+ "scaffoldVersion": "1.1.0",
4
+ "agentContractsVersion": "1.1.0",
5
5
  "variant": "clean",
6
6
  "examplesPresent": false,
7
7
  "appliedMigrations": [],
@@ -0,0 +1,71 @@
1
+ import { describe, expect, it } from 'vitest'
2
+ import { createAdminBuildOptions, createAdminBuildPlugins } from '../vite.build-policy'
3
+
4
+ describe('admin build chunk policy', () => {
5
+ it('uses native Rolldown code splitting groups', () => {
6
+ const output = createAdminBuildOptions(false)?.rolldownOptions?.output
7
+ expect(Array.isArray(output)).toBe(false)
8
+ if (!output || Array.isArray(output)) throw new Error('Expected one Admin output configuration')
9
+
10
+ expect(output.manualChunks).toBeUndefined()
11
+ expect(output.codeSplitting).not.toBe(true)
12
+ expect(output.codeSplitting).not.toBe(false)
13
+ if (!output.codeSplitting || typeof output.codeSplitting !== 'object') {
14
+ throw new Error('Expected native Rolldown code splitting options')
15
+ }
16
+
17
+ const groupNames = output.codeSplitting.groups
18
+ ?.map((group) => group.name)
19
+ .filter((name): name is string => typeof name === 'string')
20
+ expect(groupNames).toEqual(
21
+ expect.arrayContaining([
22
+ 'vendor-vue-runtime',
23
+ 'vendor-vue-i18n',
24
+ 'vendor-vueuse',
25
+ 'vendor-positioning',
26
+ 'vendor-table-suite',
27
+ 'vendor-initial',
28
+ ]),
29
+ )
30
+ expect(output.codeSplitting.groups?.some((group) => group.entriesAware)).toBe(true)
31
+ const tableSuite = output.codeSplitting.groups?.find(
32
+ (group) => group.name === 'vendor-table-suite',
33
+ )
34
+ expect(tableSuite?.maxSize).toBeUndefined()
35
+ })
36
+
37
+ it('drops debug calls in the production output minifier only', () => {
38
+ const productionOutput = createAdminBuildOptions(false)?.rolldownOptions?.output
39
+ const debugOutput = createAdminBuildOptions(true)?.rolldownOptions?.output
40
+ if (!productionOutput || Array.isArray(productionOutput)) {
41
+ throw new Error('Expected one production output configuration')
42
+ }
43
+ if (!debugOutput || Array.isArray(debugOutput)) {
44
+ throw new Error('Expected one debug output configuration')
45
+ }
46
+
47
+ expect(productionOutput.minify).toMatchObject({
48
+ compress: { dropConsole: true, dropDebugger: true },
49
+ mangle: true,
50
+ codegen: true,
51
+ })
52
+ expect(debugOutput.minify).toBeUndefined()
53
+ })
54
+
55
+ it('keeps sourcemaps valid when normalizing empty chunks', async () => {
56
+ const renderChunk = createAdminBuildPlugins()[0]?.renderChunk
57
+ if (typeof renderChunk !== 'function') throw new Error('Expected the empty chunk render hook')
58
+
59
+ const result = await renderChunk.call(
60
+ {} as never,
61
+ 'export {};',
62
+ {} as never,
63
+ {} as never,
64
+ {} as never,
65
+ )
66
+ expect(result).toMatchObject({
67
+ code: 'void 0;\n',
68
+ map: { mappings: '' },
69
+ })
70
+ })
71
+ })
@@ -4,6 +4,7 @@ import zhCn from 'element-plus/es/locale/lang/zh-cn'
4
4
  import { useOrigenUiLanguage } from 'origen-ui/language'
5
5
  import { computed, defineAsyncComponent, onBeforeUnmount, onMounted } from 'vue'
6
6
  import { RouterView, useRoute } from 'vue-router'
7
+ import { embeddedMode } from './app/embedded'
7
8
  import { useThemeStore } from './features/appearance/store/theme'
8
9
  import DevtoolsProtectionOverlay from './features/security/components/DevtoolsProtectionOverlay.vue'
9
10
  import { devtoolsProtection } from './features/security/devtoolsProtection'
@@ -27,12 +28,17 @@ const elementLocale = computed(
27
28
  )
28
29
 
29
30
  const theme = useThemeStore()
30
- theme.hydrate()
31
- theme.apply()
31
+ // 嵌入模式下 dark class 由主壳注入桥持有(embedded.ts applyHostTheme),
32
+ // 本应用自身的主题持久化/auto 跟随不生效,避免与主壳下发互相覆盖
33
+ if (!embeddedMode) {
34
+ theme.hydrate()
35
+ theme.apply()
36
+ }
32
37
  let mql: MediaQueryList | null = null
33
38
  let listener: ((e: MediaQueryListEvent) => void) | null = null
34
39
 
35
40
  onMounted(() => {
41
+ if (embeddedMode) return
36
42
  mql = window.matchMedia('(prefers-color-scheme: dark)')
37
43
  listener = () => {
38
44
  if (theme.mode === 'auto') theme.apply()
@@ -53,7 +59,8 @@ onBeforeUnmount(() => {
53
59
  :aria-hidden="devtoolsBlocked ? 'true' : undefined"
54
60
  >
55
61
  <RouteProgress />
56
- <RouterView v-if="isPublic" />
62
+ <!-- 嵌入模式渲染裸内容页:外壳(侧栏/页签)由主壳提供,壳中壳取一层 -->
63
+ <RouterView v-if="isPublic || embeddedMode" />
57
64
  <AdminLayout v-else />
58
65
  </div>
59
66
  <DevtoolsProtectionOverlay :blocked="devtoolsBlocked" />
@@ -1,22 +1,92 @@
1
1
  import type { RefreshResult, TokenStorage } from '@origen-ui/http'
2
+ import type { AxiosAdapter, AxiosResponse, InternalAxiosRequestConfig } from 'axios'
2
3
  import {
3
4
  ApiClient,
4
5
  createApiEnvelopeAdapter,
5
6
  createBearerAuthStrategy,
6
7
  TokenManager,
7
8
  } from '@origen-ui/http'
9
+ import axios, { AxiosHeaders } from 'axios'
10
+ import { embeddedMode, embeddedTokenStorage, notifyHostUnauthorized, readHostInjection } from '../app/embedded'
11
+ import { currentAdminLocale } from '../app/localeFormat'
8
12
  import { appRuntimeConfig } from '../app/runtimeConfig'
9
13
 
10
14
  const { http } = appRuntimeConfig
11
15
  const responseAdapter = createApiEnvelopeAdapter(http.responseSuccessCode)
12
16
 
13
- function currentLocale(): string {
14
- if (typeof document !== 'undefined' && document.documentElement.lang) {
15
- return document.documentElement.lang
17
+ // 嵌入模式:iframe 沙箱内相对路径解析到主壳源,API 基址改用主壳按注册表
18
+ // 下发的同源网关路径(dev 期 Vite proxy,生产经网关);独立模式保持相对路径。
19
+ // 沙箱补丁与 Rolldown 打包的 axios XHR/fetch 内置适配器不兼容(请求 status 0
20
+ // 或挂起),嵌入模式改用直调 window.fetch 的自定义适配器,绕开沙箱 XHR 补丁。
21
+ const injected = readHostInjection()
22
+ const apiBaseURL =
23
+ embeddedMode && typeof injected.apiBaseURL === 'string' && injected.apiBaseURL !== ''
24
+ ? injected.apiBaseURL
25
+ : http.baseURL
26
+
27
+ function serializeParams(
28
+ url: string,
29
+ params: Record<string, unknown> | URLSearchParams | undefined,
30
+ ): string {
31
+ if (!params) return url
32
+ const search = new URLSearchParams()
33
+ if (params instanceof URLSearchParams) {
34
+ params.forEach((value, key) => search.append(key, value))
35
+ } else {
36
+ for (const [key, value] of Object.entries(params)) {
37
+ if (value === undefined || value === null) continue
38
+ if (Array.isArray(value)) {
39
+ for (const item of value) search.append(key, String(item))
40
+ } else {
41
+ search.append(key, String(value))
42
+ }
43
+ }
16
44
  }
17
- return appRuntimeConfig.locale.default
45
+ const query = search.toString()
46
+ if (query === '') return url
47
+ return url + (url.includes('?') ? '&' : '?') + query
18
48
  }
19
49
 
50
+ function createWindowFetchAdapter(): AxiosAdapter {
51
+ return async (config: InternalAxiosRequestConfig): Promise<AxiosResponse> => {
52
+ const method = (config.method ?? 'get').toUpperCase()
53
+ const headers = AxiosHeaders.from(config.headers)
54
+ headers.set('Accept-Language', currentAdminLocale())
55
+ let body: string | undefined
56
+ if (config.data !== undefined && method !== 'GET' && method !== 'HEAD') {
57
+ headers.setContentType('application/json')
58
+ body = typeof config.data === 'string' ? config.data : JSON.stringify(config.data)
59
+ }
60
+ const url = serializeParams(axios.getUri(config), config.params as never)
61
+ const response = await fetch(url, {
62
+ method,
63
+ headers: headers.toJSON() as Record<string, string>,
64
+ body,
65
+ signal: config.signal as AbortSignal | undefined,
66
+ })
67
+ const text = await response.text()
68
+ let data: unknown = text
69
+ try {
70
+ data = text === '' ? null : JSON.parse(text)
71
+ } catch {
72
+ data = text
73
+ }
74
+ const responseHeaders = AxiosHeaders.from(response.headers as unknown as Record<string, string>)
75
+ return {
76
+ data,
77
+ status: response.status,
78
+ statusText: response.statusText,
79
+ headers: responseHeaders,
80
+ config,
81
+ request: { responseURL: response.url },
82
+ }
83
+ }
84
+ }
85
+
86
+ const embeddedFetchAdapter: AxiosAdapter | undefined = embeddedMode
87
+ ? createWindowFetchAdapter()
88
+ : undefined
89
+
20
90
  function browserStorage(): TokenStorage | undefined {
21
91
  return typeof localStorage === 'undefined' ? undefined : localStorage
22
92
  }
@@ -30,21 +100,27 @@ function readCookie(name: string): string | null {
30
100
 
31
101
  export const tokenManager = new TokenManager({
32
102
  accessKey: http.tokenKey,
33
- accessStorage: browserStorage(),
103
+ accessStorage: embeddedMode ? embeddedTokenStorage : browserStorage(),
34
104
  })
35
105
 
36
106
  const refreshClient = new ApiClient({
37
- baseURL: http.baseURL,
107
+ baseURL: apiBaseURL,
108
+ ...(embeddedFetchAdapter ? { adapter: embeddedFetchAdapter } : {}),
38
109
  responseAdapter,
39
110
  retry: http.refreshRetry,
40
111
  timeout: http.timeout,
41
- resolveHeaders: () => ({ 'Accept-Language': currentLocale() }),
112
+ resolveHeaders: () => ({ 'Accept-Language': currentAdminLocale() }),
42
113
  })
43
114
 
44
115
  export const apiClient = new ApiClient({
45
116
  auth: createBearerAuthStrategy({
46
117
  csrfToken: () => readCookie(http.csrfCookieName),
47
118
  onExpired: () => {
119
+ // 嵌入模式:认证由主壳唯一持有,通知主壳重新授权,不做沙箱内硬导航
120
+ if (embeddedMode) {
121
+ notifyHostUnauthorized()
122
+ return
123
+ }
48
124
  if (typeof window !== 'undefined' && window.location.pathname !== '/login')
49
125
  window.location.assign('/login')
50
126
  },
@@ -60,13 +136,17 @@ export const apiClient = new ApiClient({
60
136
  },
61
137
  )
62
138
  },
139
+ // 嵌入模式冻结自刷新:token 轮换由主壳唯一执行(data 通道推送)
63
140
  shouldRefresh: (error) =>
64
- error.kind === 'business' && http.refreshBusinessCodes.includes(error.code ?? -1),
141
+ !embeddedMode &&
142
+ error.kind === 'business' &&
143
+ http.refreshBusinessCodes.includes(error.code ?? -1),
65
144
  tokenManager,
66
145
  }),
67
- baseURL: http.baseURL,
146
+ ...(embeddedFetchAdapter ? { adapter: embeddedFetchAdapter } : {}),
147
+ baseURL: apiBaseURL,
68
148
  responseAdapter,
69
149
  retry: http.retry,
70
150
  timeout: http.timeout,
71
- resolveHeaders: () => ({ 'Accept-Language': currentLocale() }),
151
+ resolveHeaders: () => ({ 'Accept-Language': currentAdminLocale() }),
72
152
  })
@@ -1,4 +1,4 @@
1
- /* eslint-disable */
1
+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
2
2
  /* tslint:disable */
3
3
  // @ts-nocheck
4
4
  /*
@@ -11,7 +11,7 @@
11
11
  */
12
12
 
13
13
  export interface LoginCredentials {
14
- /** 用户名 */
14
+ /** 用户�?*/
15
15
  username: string;
16
16
  /** 密码 */
17
17
  password: string;
@@ -27,7 +27,7 @@ export interface LoginResponse {
27
27
  permissions?: string[];
28
28
  /** 角色ID列表 */
29
29
  roleIds?: string[];
30
- /** 授权版本号 */
30
+ /** 授权版本�?*/
31
31
  authorizationRevision?: number;
32
32
  }
33
33
 
@@ -1,4 +1,4 @@
1
- /* eslint-disable */
1
+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
2
2
  /* tslint:disable */
3
3
  // @ts-nocheck
4
4
  /*
@@ -1,4 +1,4 @@
1
- /* eslint-disable */
1
+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
2
2
  /* tslint:disable */
3
3
  // @ts-nocheck
4
4
  /*
@@ -1,4 +1,4 @@
1
- /* eslint-disable */
1
+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
2
2
  /* tslint:disable */
3
3
  // @ts-nocheck
4
4
  /*
@@ -1,4 +1,4 @@
1
- /* eslint-disable */
1
+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
2
2
  /* tslint:disable */
3
3
  // @ts-nocheck
4
4
  /*
@@ -1,4 +1,4 @@
1
- /* eslint-disable */
1
+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
2
2
  /* tslint:disable */
3
3
  // @ts-nocheck
4
4
  /*
@@ -149,8 +149,7 @@ export class 系统管理用户<SecurityDataType = unknown> {
149
149
  *
150
150
  * @tags 系统管理-用户
151
151
  * @name UsersStatusPartialUpdate
152
- * @summary 批量更新用户状态
153
- * @request PATCH:/system/users/status
152
+ * @summary 批量更新用户状�? * @request PATCH:/system/users/status
154
153
  * @secure
155
154
  * @response `204` `void` 更新成功
156
155
  */
@@ -1,4 +1,4 @@
1
- /* eslint-disable */
1
+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
2
2
  /* tslint:disable */
3
3
  // @ts-nocheck
4
4
  /*
@@ -30,8 +30,7 @@ export class 系统管理菜单<SecurityDataType = unknown> {
30
30
  *
31
31
  * @tags 系统管理-菜单
32
32
  * @name MenusTreeList
33
- * @summary 获取菜单树
34
- * @request GET:/system/menus/tree
33
+ * @summary 获取菜单�? * @request GET:/system/menus/tree
35
34
  * @secure
36
35
  * @response `200` `(BackendMenuNode)[]` 成功
37
36
  */
@@ -160,8 +159,7 @@ export class 系统管理菜单<SecurityDataType = unknown> {
160
159
  *
161
160
  * @tags 系统管理-菜单
162
161
  * @name MenusStatusPartialUpdate
163
- * @summary 批量更新菜单状态
164
- * @request PATCH:/system/menus/status
162
+ * @summary 批量更新菜单状�? * @request PATCH:/system/menus/status
165
163
  * @secure
166
164
  * @response `204` `void` 更新成功
167
165
  */
@@ -1,4 +1,4 @@
1
- /* eslint-disable */
1
+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
2
2
  /* tslint:disable */
3
3
  // @ts-nocheck
4
4
  /*
@@ -147,8 +147,7 @@ export class 系统管理角色<SecurityDataType = unknown> {
147
147
  *
148
148
  * @tags 系统管理-角色
149
149
  * @name RolesStatusPartialUpdate
150
- * @summary 批量更新角色状态
151
- * @request PATCH:/system/roles/status
150
+ * @summary 批量更新角色状�? * @request PATCH:/system/roles/status
152
151
  * @secure
153
152
  * @response `204` `void` 更新成功
154
153
  */
@@ -1,4 +1,4 @@
1
- /* eslint-disable */
1
+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
2
2
  /* tslint:disable */
3
3
  // @ts-nocheck
4
4
  /*
@@ -147,8 +147,7 @@ export class 系统管理订单草稿<SecurityDataType = unknown> {
147
147
  *
148
148
  * @tags 系统管理-订单草稿
149
149
  * @name OrderDraftsStatusPartialUpdate
150
- * @summary 更新订单草稿状态
151
- * @request PATCH:/system/order-drafts/{id}/status
150
+ * @summary 更新订单草稿状�? * @request PATCH:/system/order-drafts/{id}/status
152
151
  * @secure
153
152
  * @response `200` `OrderDraft` 更新成功
154
153
  */
@@ -1,4 +1,4 @@
1
- /* eslint-disable */
1
+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
2
2
  /* tslint:disable */
3
3
  // @ts-nocheck
4
4
  /*