@origen-ui/admin-cli 2.0.2 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -12
- package/bin/contract-sync.mjs +112 -0
- package/bin/lib/errors.mjs +8 -0
- package/bin/lib/fs-json.mjs +18 -0
- package/bin/lib/hash.mjs +9 -0
- package/bin/og-admin.mjs +165 -35
- package/bin/sync-project.mjs +717 -0
- package/package.json +21 -18
- package/templates/current/clean/.agents/skills/admin-component-usage/SKILL.md +27 -0
- package/templates/current/clean/.agents/skills/admin-component-usage/references/component-directory.md +232 -0
- package/templates/current/clean/.agents/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/clean/.agents/skills/build-admin-feature/references/component-selection.md +42 -0
- package/templates/current/{examples/.codex → clean/.agents}/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/{examples/.codex → clean/.agents}/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/clean/{.codex → .agents}/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/clean/.agents/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/{examples/.codex → clean/.agents}/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/clean/.api-client-e2e.config.ts +13 -0
- package/templates/current/clean/.claude/rules/01-feature-architecture.md +10 -0
- package/templates/current/clean/.claude/rules/02-vue-typescript.md +10 -0
- package/templates/current/clean/.claude/rules/03-component-policy.md +31 -0
- package/templates/current/clean/.claude/rules/04-api-auth-router.md +10 -0
- package/templates/current/clean/.claude/rules/05-style.md +10 -0
- package/templates/current/clean/.claude/rules/06-quality.md +10 -0
- package/templates/current/clean/.claude/skills/admin-component-usage/SKILL.md +27 -0
- package/templates/current/clean/.claude/skills/admin-component-usage/references/component-directory.md +232 -0
- package/templates/current/clean/.claude/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/clean/.claude/skills/build-admin-feature/references/component-selection.md +42 -0
- package/templates/current/clean/{.codex → .claude}/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/clean/{.codex → .claude}/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/clean/.claude/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/clean/{.codex → .claude}/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/clean/.codebuddy/rules/01-feature-architecture.md +2 -2
- package/templates/current/clean/.codebuddy/rules/03-component-policy.md +4 -1
- package/templates/current/clean/.codebuddy/skills/admin-component-usage/SKILL.md +30 -0
- package/templates/current/clean/.codebuddy/skills/admin-component-usage/references/component-directory.md +232 -0
- package/templates/current/clean/.codebuddy/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/clean/.codebuddy/skills/build-admin-feature/references/component-selection.md +42 -0
- package/templates/current/clean/.codebuddy/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/clean/.codebuddy/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/clean/.codebuddy/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/clean/.codebuddy/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/clean/.codebuddy/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/clean/.codex/AGENTS.md +55 -8
- package/templates/current/clean/.codex/rules/01-feature-architecture.md +2 -2
- package/templates/current/clean/.codex/rules/03-component-policy.md +4 -1
- package/templates/current/clean/.cursor/rules/.generated +5 -0
- package/templates/current/clean/.cursor/rules/01-feature-architecture.mdc +2 -2
- package/templates/current/clean/.cursor/rules/03-component-policy.mdc +4 -1
- package/templates/current/clean/.cursor/skills/admin-component-usage/SKILL.md +27 -0
- package/templates/current/clean/.cursor/skills/admin-component-usage/references/component-directory.md +232 -0
- package/templates/current/clean/.cursor/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/clean/.cursor/skills/build-admin-feature/references/component-selection.md +42 -0
- package/templates/current/clean/.cursor/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/clean/.cursor/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/clean/.cursor/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/clean/.cursor/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/clean/.cursor/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/clean/{.env.example → .env.dev} +3 -2
- package/templates/current/clean/.env.mock +4 -0
- package/templates/current/clean/.env.production +5 -0
- package/templates/current/clean/.env.test +4 -0
- package/templates/current/clean/.prettierignore +28 -0
- package/templates/current/clean/.prettierrc +8 -0
- package/templates/current/clean/.qoder/rules/01-feature-architecture.md +3 -4
- package/templates/current/clean/.qoder/rules/02-vue-typescript.md +1 -2
- package/templates/current/clean/.qoder/rules/03-component-policy.md +5 -3
- package/templates/current/clean/.qoder/rules/04-api-auth-router.md +1 -2
- package/templates/current/clean/.qoder/rules/05-style.md +1 -2
- package/templates/current/clean/.qoder/rules/06-quality.md +1 -2
- package/templates/current/clean/.qoder/skills/admin-component-usage/SKILL.md +27 -0
- package/templates/current/clean/.qoder/skills/admin-component-usage/references/component-directory.md +232 -0
- package/templates/current/clean/.qoder/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/clean/.qoder/skills/build-admin-feature/references/component-selection.md +42 -0
- package/templates/current/clean/.qoder/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/clean/.qoder/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/clean/.qoder/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/clean/.qoder/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/clean/.qoder/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/clean/.zcode/skills/admin-component-usage/SKILL.md +27 -0
- package/templates/current/clean/.zcode/skills/admin-component-usage/references/component-directory.md +232 -0
- package/templates/current/clean/.zcode/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/clean/.zcode/skills/build-admin-feature/references/component-selection.md +42 -0
- package/templates/current/clean/.zcode/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/clean/.zcode/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/clean/.zcode/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/clean/.zcode/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/clean/.zcode/skills/use-og-form-table/SKILL.md +26 -0
- package/templates/current/clean/.zcode/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/clean/.zcode/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/clean/.zcode/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/clean/.zcode/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/clean/.zcode/skills/use-og-upload/SKILL.md +26 -0
- package/templates/current/clean/AGENTS.md +55 -9
- package/templates/current/clean/CHANGELOG.md +128 -0
- package/templates/current/clean/CLAUDE.md +3 -0
- package/templates/current/clean/README.md +58 -88
- package/templates/current/clean/component-catalog.json +766 -348
- package/templates/current/clean/component-catalog.v2.json +2040 -0
- package/templates/current/clean/docs/components/dialog.md +405 -0
- package/templates/current/clean/docs/components/editor-viewer.md +87 -0
- package/templates/current/clean/docs/components/editor.md +275 -0
- package/templates/current/clean/docs/components/form-table.md +222 -0
- package/templates/current/clean/docs/components/form.md +750 -0
- package/templates/current/clean/docs/components/index.md +44 -0
- package/templates/current/clean/docs/components/router.md +452 -0
- package/templates/current/clean/docs/components/search.md +1205 -0
- package/templates/current/clean/docs/components/svg-icon.md +124 -0
- package/templates/current/clean/docs/components/table-local.md +176 -0
- package/templates/current/clean/docs/components/table-with-search.md +207 -0
- package/templates/current/clean/docs/components/table.md +813 -0
- package/templates/current/clean/docs/components/tabs.md +440 -0
- package/templates/current/clean/docs/components/upload.md +349 -0
- package/templates/current/clean/eslint.config.js +89 -0
- package/templates/current/clean/index.html +1 -1
- package/templates/current/clean/openapi.json +10048 -999
- package/templates/current/clean/package.json +47 -35
- package/templates/current/clean/playwright.config.ts +20 -6
- package/templates/current/clean/playwright.mock.config.ts +42 -0
- package/templates/current/clean/pnpm-workspace.yaml +19 -3
- package/templates/current/clean/recipes/remote-crud-dialog-form.vue +15 -13
- package/templates/current/clean/scaffold.lock.json +164 -4
- package/templates/current/clean/scripts/api-codegen.config.ts +35 -0
- package/templates/current/clean/scripts/api-codegen.ts +2015 -0
- package/templates/current/clean/scripts/api-templates/http-client.ejs +359 -0
- package/templates/current/clean/scripts/check-admin-scaffold.mjs +315 -30
- package/templates/current/clean/scripts/generate-api.ts +290 -85
- package/templates/current/clean/scripts/lib/admin-component-catalog.mjs +514 -0
- package/templates/current/clean/scripts/lib/admin-skill-inventory.mjs +18 -0
- package/templates/current/clean/scripts/lib/repository-root.mjs +9 -0
- package/templates/current/clean/scripts/mock-api.ts +1356 -0
- package/templates/current/clean/scripts/remove-examples.mjs +9 -34
- package/templates/current/clean/src/App.vue +9 -18
- package/templates/current/clean/src/api/generated/data-contracts.ts +23 -265
- package/templates/current/clean/src/api/generated/http-client.ts +351 -180
- package/templates/current/clean/src/api/generated/index.ts +22 -0
- package/templates/current/clean/src/api/generated/services/auth.ts +123 -0
- package/templates/current/clean/src/api/generated/services/common/files.ts +111 -0
- package/templates/current/clean/src/api/generated/services/monitor/cache.ts +164 -0
- package/templates/current/clean/src/api/generated/services/monitor/job.ts +195 -0
- package/templates/current/clean/src/api/generated/services/monitor/jobLog.ts +126 -0
- package/templates/current/clean/src/api/generated/services/monitor/logininfor.ts +126 -0
- package/templates/current/clean/src/api/generated/services/monitor/online.ts +66 -0
- package/templates/current/clean/src/api/generated/services/monitor/operlog.ts +106 -0
- package/templates/current/clean/src/api/generated/services/monitor/server.ts +41 -0
- package/templates/current/clean/src/api/generated/services/system/configs.ts +190 -0
- package/templates/current/clean/src/api/generated/services/system/departments.ts +173 -0
- package/templates/current/clean/src/api/generated/services/system/dictionaries/data.ts +169 -0
- package/templates/current/clean/src/api/generated/services/system/dictionaries/types.ts +187 -0
- package/templates/current/clean/src/api/generated/services/system/index.ts +158 -0
- package/templates/current/clean/src/api/generated/services/system/menus.ts +193 -0
- package/templates/current/clean/src/api/generated/services/system/notices.ts +221 -0
- package/templates/current/clean/src/api/generated/services/system/posts.ts +168 -0
- package/templates/current/clean/src/api/generated/services/system/roles.ts +354 -0
- package/templates/current/clean/src/api/generated/services/system/users.ts +425 -0
- package/templates/current/clean/src/api/generated/services/tool/code-generator.ts +304 -0
- package/templates/current/clean/src/api/generated/types/auth.types.ts +132 -0
- package/templates/current/clean/src/api/generated/types/common/files.types.ts +57 -0
- package/templates/current/clean/src/api/generated/types/common.ts +174 -0
- package/templates/current/clean/src/api/generated/types/enum-dict.ts +94 -0
- package/templates/current/clean/src/api/generated/types/enums.ts +155 -0
- package/templates/current/clean/src/api/generated/types/monitor/cache.types.ts +149 -0
- package/templates/current/clean/src/api/generated/types/monitor/job.types.ts +207 -0
- package/templates/current/clean/src/api/generated/types/monitor/jobLog.types.ts +134 -0
- package/templates/current/clean/src/api/generated/types/monitor/logininfor.types.ts +135 -0
- package/templates/current/clean/src/api/generated/types/monitor/online.types.ts +80 -0
- package/templates/current/clean/src/api/generated/types/monitor/operlog.types.ts +126 -0
- package/templates/current/clean/src/api/generated/types/monitor/server.types.ts +205 -0
- package/templates/current/clean/src/api/generated/types/system/configs.types.ts +200 -0
- package/templates/current/clean/src/api/generated/types/system/departments.types.ts +145 -0
- package/templates/current/clean/src/api/generated/types/system/dictionaries/data.types.ts +210 -0
- package/templates/current/clean/src/api/generated/types/system/dictionaries/types.types.ts +221 -0
- package/templates/current/clean/src/api/generated/types/system/index.types.ts +19 -0
- package/templates/current/clean/src/api/generated/types/system/menus.types.ts +234 -0
- package/templates/current/clean/src/api/generated/types/system/notices.types.ts +270 -0
- package/templates/current/clean/src/api/generated/types/system/posts.types.ts +198 -0
- package/templates/current/clean/src/api/generated/types/system/roles.types.ts +410 -0
- package/templates/current/clean/src/api/generated/types/system/users.types.ts +413 -0
- package/templates/current/clean/src/api/generated/types/tool/code-generator.types.ts +388 -0
- package/templates/current/clean/src/api/index.ts +44 -39
- package/templates/current/clean/src/app/__tests__/api-generated.types.ts +24 -0
- package/templates/current/clean/src/app/api.ts +6 -0
- package/templates/current/clean/src/app/authorization/permission.ts +9 -0
- package/templates/current/{examples/src/app → clean/src/app/config}/runtimeConfig.ts +44 -12
- package/templates/current/clean/src/app/errors/errorMessage.ts +80 -0
- package/templates/current/clean/src/app/http/client.ts +141 -0
- package/templates/current/clean/src/app/http/http-adapter.ts +71 -0
- package/templates/current/{examples/src/app → clean/src/app/i18n}/adminLocale.ts +25 -19
- package/templates/current/clean/src/app/{localeFormat.ts → i18n/localeFormat.ts} +29 -6
- package/templates/current/clean/src/app/i18n/origenUiLocale.ts +15 -0
- package/templates/current/clean/src/app/menu/menu.ts +175 -0
- package/templates/current/clean/src/app/menu/menuTypes.ts +20 -0
- package/templates/current/clean/src/{features → app}/security/devtoolsProtection.ts +8 -7
- package/templates/current/clean/src/app/ui/createAdminUi.ts +31 -0
- package/templates/current/clean/src/app/ui/iconCatalog.ts +71 -0
- package/templates/current/clean/src/assets/icons/appearance.svg +1 -0
- package/templates/current/clean/src/assets/icons/arrow-right.svg +1 -0
- package/templates/current/clean/src/assets/icons/check.svg +1 -0
- package/templates/current/clean/src/assets/icons/circle-check.svg +1 -0
- package/templates/current/clean/src/assets/icons/default.svg +4 -0
- package/templates/current/clean/src/assets/icons/directory/setting.svg +1 -0
- package/templates/current/clean/src/assets/icons/expand.svg +1 -0
- package/templates/current/clean/src/assets/icons/fold.svg +1 -0
- package/templates/current/clean/src/assets/icons/key.svg +1 -0
- package/templates/current/clean/src/assets/icons/lock.svg +1 -0
- package/templates/current/clean/src/assets/icons/monitor.svg +1 -0
- package/templates/current/clean/src/assets/icons/moon.svg +11 -0
- package/templates/current/clean/src/assets/icons/page/department.svg +1 -0
- package/templates/current/clean/src/assets/icons/page/dictionary.svg +1 -0
- package/templates/current/clean/src/assets/icons/page/menus.svg +1 -0
- package/templates/current/clean/src/assets/icons/page/user.svg +1 -0
- package/templates/current/clean/src/assets/icons/page/users.svg +1 -0
- package/templates/current/clean/src/assets/icons/plus.svg +1 -0
- package/templates/current/clean/src/assets/icons/profile.svg +1 -0
- package/templates/current/clean/src/assets/icons/refresh.svg +1 -0
- package/templates/current/clean/src/assets/icons/roles.svg +1 -0
- package/templates/current/clean/src/assets/icons/search.svg +1 -0
- package/templates/current/clean/src/assets/icons/sunny.svg +1 -0
- package/templates/current/clean/src/assets/icons/system.svg +1 -0
- package/templates/current/clean/src/assets/icons/theme-auto.svg +14 -0
- package/templates/current/clean/src/assets/icons/tune.svg +13 -0
- package/templates/current/clean/src/{features/shell/components → components}/RouteProgress.vue +2 -2
- package/templates/current/{examples/src/features/system/access → clean/src}/composables/useAuthorizationRefresh.ts +6 -1
- package/templates/current/clean/src/composables/useSystemTableSearchVisibility.ts +33 -0
- package/templates/current/clean/src/{features/appearance/composables → composables}/useTheme.ts +1 -1
- package/templates/current/clean/src/env.d.ts +6 -19
- package/templates/current/clean/src/layouts/AdminLayout.vue +7 -9
- package/templates/current/clean/src/{features/shell/components → layouts}/AdminWatermark.vue +2 -2
- package/templates/current/clean/src/layouts/BreadcrumbBar.vue +9 -1
- package/templates/current/clean/src/layouts/SideMenu.vue +7 -15
- package/templates/current/clean/src/{features/appearance/components → layouts}/ThemePanel.vue +39 -11
- package/templates/current/clean/src/layouts/TopBar.vue +60 -28
- package/templates/current/clean/src/layouts/WorkspaceTabs.vue +10 -1
- package/templates/current/clean/src/layouts/topBarMenuSearch.ts +25 -4
- package/templates/current/clean/src/locales/en-US.json +227 -219
- package/templates/current/clean/src/locales/index.ts +72 -32
- package/templates/current/clean/src/locales/messages-types.ts +15 -10
- package/templates/current/clean/src/locales/vue-i18n.d.ts +1 -1
- package/templates/current/clean/src/locales/zh-CN.json +226 -218
- package/templates/current/clean/src/locales/zh-TW.json +222 -214
- package/templates/current/clean/src/main.ts +59 -30
- package/templates/current/clean/src/router/bootstrap.ts +69 -24
- package/templates/current/clean/src/router/dynamic/componentLoader.ts +150 -0
- package/templates/current/clean/src/router/{dynamicMenuRefresh.ts → dynamic/dynamicMenuRefresh.ts} +6 -2
- package/templates/current/clean/src/router/dynamic/dynamicRoutes.ts +247 -0
- package/templates/current/clean/src/router/navigation/guards.ts +12 -0
- package/templates/current/clean/src/router/navigation/paths.ts +28 -0
- package/templates/current/clean/src/router/navigation/staticRoutes.ts +109 -0
- package/templates/current/clean/src/router/{queryEncryption.ts → query/queryEncryption.ts} +29 -12
- package/templates/current/clean/src/router/query/routeQuery.ts +29 -0
- package/templates/current/clean/src/router/{useRouteQueryDefaults.ts → query/useRouteQueryDefaults.ts} +9 -8
- package/templates/current/clean/src/router/query/useRouteQueryDefaults.types.ts +28 -0
- package/templates/current/clean/src/router/{runtimeErrorRecovery.ts → recovery/runtimeErrorRecovery.ts} +21 -3
- package/templates/current/clean/src/{features/auth/store → store}/auth.ts +97 -62
- package/templates/current/clean/src/store/dictionaries.ts +86 -0
- package/templates/current/clean/src/{features/shell/store → store}/sidebar.ts +9 -2
- package/templates/current/{examples/src/features/appearance → clean/src}/store/theme.ts +8 -4
- package/templates/current/clean/src/styles/layout.css +51 -0
- package/templates/current/clean/src/templates/og-form.ts +7 -2
- package/templates/current/clean/src/templates/og-table.ts +86 -20
- package/templates/current/clean/src/templates/router.ts +11 -2
- package/templates/current/clean/src/utils/color-mix.ts +6 -2
- package/templates/current/clean/src/utils/download.ts +11 -0
- package/templates/current/clean/src/utils/permissions.ts +1 -1
- package/templates/current/clean/src/utils/retryableDialog.ts +46 -0
- package/templates/current/clean/src/{features → views}/errors/pages/Forbidden.vue +6 -2
- package/templates/current/clean/src/views/errors/pages/MethodNotAllowed.vue +34 -0
- package/templates/current/clean/src/{features → views}/errors/pages/NotFound.vue +6 -2
- package/templates/current/clean/src/{features → views}/errors/pages/ServerError.vue +6 -2
- package/templates/current/clean/src/{features/auth/pages/Login.vue → views/login/pages/index.vue} +99 -10
- package/templates/current/clean/src/views/system/access/services/admin-repository.ts +489 -0
- package/templates/current/clean/src/views/system/access/services/rbac.ts +317 -0
- package/templates/current/clean/src/views/system/dept/components/DepartmentEditorForm.vue +87 -0
- package/templates/current/clean/src/views/system/dept/composables/useDepartmentManagement.ts +314 -0
- package/templates/current/clean/src/views/system/dept/pages/index.vue +44 -0
- package/templates/current/clean/src/views/system/dept/services/departments.ts +168 -0
- package/templates/current/clean/src/views/system/dict/components/DictionaryDataEditorForm.vue +98 -0
- package/templates/current/clean/src/views/system/dict/components/DictionaryDataPreview.vue +233 -0
- package/templates/current/clean/src/views/system/dict/components/DictionaryTypeEditorForm.vue +66 -0
- package/templates/current/clean/src/views/system/dict/composables/useDictionaryDataManagement.ts +406 -0
- package/templates/current/clean/src/views/system/dict/composables/useDictionaryTypeManagement.ts +329 -0
- package/templates/current/clean/src/views/system/dict/data/pages/index.vue +134 -0
- package/templates/current/clean/src/views/system/dict/pages/index.vue +113 -0
- package/templates/current/clean/src/views/system/dict/services/dictionaries.ts +239 -0
- package/templates/current/clean/src/views/system/menu/components/MenuEditorForm.vue +252 -0
- package/templates/current/clean/src/views/system/menu/composables/useMenuManagement.ts +357 -0
- package/templates/current/clean/src/views/system/menu/menuDraft.ts +45 -0
- package/templates/current/clean/src/views/system/menu/pages/ExternalLink.vue +37 -0
- package/templates/current/clean/src/views/system/menu/pages/index.vue +75 -0
- package/templates/current/clean/src/views/system/post/components/PostEditorForm.vue +69 -0
- package/templates/current/clean/src/views/system/post/composables/usePostManagement.ts +245 -0
- package/templates/current/clean/src/views/system/post/pages/index.vue +92 -0
- package/templates/current/clean/src/views/system/post/services/posts.ts +100 -0
- package/templates/current/clean/src/views/system/role/auth-users/pages/index.vue +100 -0
- package/templates/current/clean/src/views/system/role/components/RoleDataScopeForm.vue +167 -0
- package/templates/current/clean/src/views/system/role/components/RoleEditorForm.vue +165 -0
- package/templates/current/clean/src/views/system/role/components/RoleUserSelectForm.vue +129 -0
- package/templates/current/clean/src/views/system/role/composables/useRoleManagement.ts +422 -0
- package/templates/current/clean/src/views/system/role/composables/useRoleUserManagement.ts +233 -0
- package/templates/current/clean/src/views/system/role/pages/index.vue +110 -0
- package/templates/current/clean/src/views/system/role/services/roleAccess.ts +162 -0
- package/templates/current/clean/src/views/system/user/auth-roles/pages/index.vue +209 -0
- package/templates/current/clean/src/views/system/user/components/UserDetailsForm.vue +108 -0
- package/templates/current/clean/src/views/system/user/components/UserEditorForm.vue +207 -0
- package/templates/current/clean/src/views/system/user/components/UserImportDialog.vue +80 -0
- package/templates/current/clean/src/views/system/user/components/UserResetPasswordForm.vue +56 -0
- package/templates/current/clean/src/views/system/user/composables/useUserManagement.ts +502 -0
- package/templates/current/clean/src/views/system/user/pages/index.vue +459 -0
- package/templates/current/clean/tests/e2e/admin-access-business.spec.ts +33 -0
- package/templates/current/clean/tests/e2e/admin-shell.spec.ts +50 -0
- package/templates/current/clean/tests/e2e/fixtures/adminMockBackend.ts +95 -0
- package/templates/current/clean/tests/e2e/fixtures/labelGeometry.ts +52 -0
- package/templates/current/clean/tests/e2e/mock-api-generation.spec.ts +27 -0
- package/templates/current/clean/tests/e2e/mock-business.spec.ts +555 -0
- package/templates/current/clean/tests/e2e/mock-menu-retry-form-label.spec.ts +100 -0
- package/templates/current/clean/tests/e2e/mock-shell.spec.ts +25 -0
- package/templates/current/clean/tests/e2e/mock-tree-selection-layout.spec.ts +113 -0
- package/templates/current/clean/tests/unit/api/api-codegen.spec.ts +893 -0
- package/templates/current/clean/tests/unit/api/client.spec.ts +145 -0
- package/templates/current/clean/tests/unit/api/generated-http-client.spec.ts +290 -0
- package/templates/current/{examples/src → clean/tests/unit}/api/http-adapter.spec.ts +3 -3
- package/templates/current/clean/tests/unit/api/system-apis.spec.ts +118 -0
- package/templates/current/clean/tests/unit/app/createAdminUi.spec.ts +79 -0
- package/templates/current/clean/{src → tests/unit}/app/errorMessage.spec.ts +1 -1
- package/templates/current/clean/tests/unit/app/iconCatalog.spec.ts +12 -0
- package/templates/current/clean/tests/unit/app/menu.spec.ts +215 -0
- package/templates/current/{examples/src → clean/tests/unit}/app/origenUiLocale.spec.ts +1 -1
- package/templates/current/{examples/src → clean/tests/unit}/app/permission.spec.ts +4 -5
- package/templates/current/clean/tests/unit/app/runtimeConfig.spec.ts +36 -0
- package/templates/current/{examples/src/features → clean/tests/unit/app}/security/devtoolsProtection.spec.ts +17 -7
- package/templates/current/{examples/src/features/shell → clean/tests/unit}/composables/useRouteProgress.spec.ts +1 -1
- package/templates/current/{examples/src/features/shell/components → clean/tests/unit/layouts}/AdminWatermark.spec.ts +5 -7
- package/templates/current/{examples/src → clean/tests/unit}/layouts/topBarMenuSearch.spec.ts +25 -8
- package/templates/current/clean/{src → tests/unit}/locales/messages.spec.ts +43 -17
- package/templates/current/clean/tests/unit/router/dynamicMenuRefresh.spec.ts +151 -0
- package/templates/current/clean/tests/unit/router/dynamicRoutes.spec.ts +374 -0
- package/templates/current/clean/tests/unit/router/paths.spec.ts +103 -0
- package/templates/current/clean/{src → tests/unit}/router/queryEncryption.spec.ts +49 -12
- package/templates/current/{examples/src → clean/tests/unit}/router/routeQuery.spec.ts +8 -1
- package/templates/current/clean/{src → tests/unit}/router/runtimeErrorRecovery.spec.ts +11 -6
- package/templates/current/{examples/src → clean/tests/unit}/router/useRouteQueryDefaults.spec.ts +46 -12
- package/templates/current/clean/tests/unit/scripts/mock-api.spec.ts +440 -0
- package/templates/current/clean/{scripts → tests/unit/scripts}/vite-build-policy.spec.ts +35 -6
- package/templates/current/clean/{src/features/auth → tests/unit}/store/auth.spec.ts +100 -15
- package/templates/current/clean/tests/unit/store/dictionaries.spec.ts +106 -0
- package/templates/current/{examples/src → clean/tests/unit}/templates/templates.spec.ts +58 -16
- package/templates/current/clean/{src/utils/__tests__ → tests/unit/utils}/color-mix.spec.ts +1 -1
- package/templates/current/clean/tests/unit/utils/retryableDialog.spec.ts +61 -0
- package/templates/current/{examples/src/features/errors/pages → clean/tests/unit/views/errors}/error-pages.spec.ts +11 -7
- package/templates/current/clean/tests/unit/views/feature-composables.spec.ts +233 -0
- package/templates/current/clean/tests/unit/views/system/access/admin-repository.spec.ts +353 -0
- package/templates/current/clean/tests/unit/views/system/access/rbac.spec.ts +329 -0
- package/templates/current/clean/tests/unit/views/system/dept/departments.spec.ts +104 -0
- package/templates/current/clean/tests/unit/views/system/dict/dictionaries.spec.ts +234 -0
- package/templates/current/clean/tests/unit/views/system/menu/menuDraft.spec.ts +77 -0
- package/templates/current/clean/tests/unit/views/system/menu/useMenuManagement.spec.ts +339 -0
- package/templates/current/clean/tests/unit/views/system/user/searchControl.spec.ts +128 -0
- package/templates/current/clean/tsconfig.json +4 -19
- package/templates/current/clean/vite.build-policy.ts +97 -22
- package/templates/current/clean/vite.config.ts +50 -7
- package/templates/current/examples/.agents/skills/admin-component-usage/SKILL.md +27 -0
- package/templates/current/examples/.agents/skills/admin-component-usage/references/component-directory.md +232 -0
- package/templates/current/examples/.agents/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/examples/.agents/skills/build-admin-feature/references/component-selection.md +42 -0
- package/templates/current/examples/.agents/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/examples/.agents/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/examples/.agents/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/examples/.agents/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/examples/.agents/skills/use-og-form-table/SKILL.md +26 -0
- package/templates/current/examples/.agents/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/examples/.agents/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/examples/.agents/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/examples/.agents/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/examples/.agents/skills/use-og-upload/SKILL.md +26 -0
- package/templates/current/examples/.api-client-e2e.config.ts +13 -0
- package/templates/current/examples/.claude/rules/01-feature-architecture.md +10 -0
- package/templates/current/examples/.claude/rules/02-vue-typescript.md +10 -0
- package/templates/current/examples/.claude/rules/03-component-policy.md +31 -0
- package/templates/current/examples/.claude/rules/04-api-auth-router.md +10 -0
- package/templates/current/examples/.claude/rules/05-style.md +10 -0
- package/templates/current/examples/.claude/rules/06-quality.md +10 -0
- package/templates/current/examples/.claude/skills/admin-component-usage/SKILL.md +27 -0
- package/templates/current/examples/.claude/skills/admin-component-usage/references/component-directory.md +232 -0
- package/templates/current/examples/.claude/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/examples/.claude/skills/build-admin-feature/references/component-selection.md +42 -0
- package/templates/current/examples/.claude/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/examples/.claude/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/examples/.claude/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/examples/.claude/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/examples/.claude/skills/use-og-form-table/SKILL.md +26 -0
- package/templates/current/examples/.claude/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/examples/.claude/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/examples/.claude/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/examples/.claude/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/examples/.claude/skills/use-og-upload/SKILL.md +26 -0
- package/templates/current/examples/.codebuddy/rules/01-feature-architecture.md +2 -2
- package/templates/current/examples/.codebuddy/rules/03-component-policy.md +4 -1
- package/templates/current/examples/.codebuddy/skills/admin-component-usage/SKILL.md +30 -0
- package/templates/current/examples/.codebuddy/skills/admin-component-usage/references/component-directory.md +232 -0
- package/templates/current/examples/.codebuddy/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/examples/.codebuddy/skills/build-admin-feature/references/component-selection.md +42 -0
- package/templates/current/examples/.codebuddy/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/examples/.codebuddy/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/examples/.codebuddy/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/examples/.codebuddy/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/examples/.codebuddy/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/examples/.codex/AGENTS.md +55 -8
- package/templates/current/examples/.codex/rules/01-feature-architecture.md +2 -2
- package/templates/current/examples/.codex/rules/03-component-policy.md +4 -1
- package/templates/current/examples/.cursor/rules/.generated +5 -0
- package/templates/current/examples/.cursor/rules/01-feature-architecture.mdc +2 -2
- package/templates/current/examples/.cursor/rules/03-component-policy.mdc +4 -1
- package/templates/current/examples/.cursor/skills/admin-component-usage/SKILL.md +27 -0
- package/templates/current/examples/.cursor/skills/admin-component-usage/references/component-directory.md +232 -0
- package/templates/current/examples/.cursor/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/examples/.cursor/skills/build-admin-feature/references/component-selection.md +42 -0
- package/templates/current/examples/.cursor/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/examples/.cursor/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/examples/.cursor/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/examples/.cursor/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/examples/.cursor/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/examples/{.env.example → .env.dev} +3 -2
- package/templates/current/examples/.env.mock +4 -0
- package/templates/current/examples/.env.production +5 -0
- package/templates/current/examples/.env.test +4 -0
- package/templates/current/examples/.prettierignore +28 -0
- package/templates/current/examples/.prettierrc +8 -0
- package/templates/current/examples/.qoder/rules/01-feature-architecture.md +3 -4
- package/templates/current/examples/.qoder/rules/02-vue-typescript.md +1 -2
- package/templates/current/examples/.qoder/rules/03-component-policy.md +5 -3
- package/templates/current/examples/.qoder/rules/04-api-auth-router.md +1 -2
- package/templates/current/examples/.qoder/rules/05-style.md +1 -2
- package/templates/current/examples/.qoder/rules/06-quality.md +1 -2
- package/templates/current/examples/.qoder/skills/admin-component-usage/SKILL.md +27 -0
- package/templates/current/examples/.qoder/skills/admin-component-usage/references/component-directory.md +232 -0
- package/templates/current/examples/.qoder/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/examples/.qoder/skills/build-admin-feature/references/component-selection.md +42 -0
- package/templates/current/examples/.qoder/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/examples/.qoder/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/examples/.qoder/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/examples/.qoder/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/examples/.qoder/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/examples/.zcode/skills/admin-component-usage/SKILL.md +27 -0
- package/templates/current/examples/.zcode/skills/admin-component-usage/references/component-directory.md +232 -0
- package/templates/current/examples/.zcode/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/examples/.zcode/skills/build-admin-feature/references/component-selection.md +42 -0
- package/templates/current/examples/.zcode/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/examples/.zcode/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/examples/.zcode/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/examples/.zcode/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/examples/.zcode/skills/use-og-form-table/SKILL.md +26 -0
- package/templates/current/examples/.zcode/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/examples/.zcode/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/examples/.zcode/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/examples/.zcode/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/examples/.zcode/skills/use-og-upload/SKILL.md +26 -0
- package/templates/current/examples/AGENTS.md +55 -9
- package/templates/current/examples/CHANGELOG.md +128 -0
- package/templates/current/examples/CLAUDE.md +3 -0
- package/templates/current/examples/README.md +58 -88
- package/templates/current/examples/component-catalog.json +766 -348
- package/templates/current/examples/component-catalog.v2.json +2040 -0
- package/templates/current/examples/docs/components/dialog.md +405 -0
- package/templates/current/examples/docs/components/editor-viewer.md +87 -0
- package/templates/current/examples/docs/components/editor.md +275 -0
- package/templates/current/examples/docs/components/form-table.md +222 -0
- package/templates/current/examples/docs/components/form.md +750 -0
- package/templates/current/examples/docs/components/index.md +44 -0
- package/templates/current/examples/docs/components/router.md +452 -0
- package/templates/current/examples/docs/components/search.md +1205 -0
- package/templates/current/examples/docs/components/svg-icon.md +124 -0
- package/templates/current/examples/docs/components/table-local.md +176 -0
- package/templates/current/examples/docs/components/table-with-search.md +207 -0
- package/templates/current/examples/docs/components/table.md +813 -0
- package/templates/current/examples/docs/components/tabs.md +440 -0
- package/templates/current/examples/docs/components/upload.md +349 -0
- package/templates/current/examples/eslint.config.js +89 -0
- package/templates/current/examples/index.html +1 -1
- package/templates/current/examples/openapi.json +10048 -999
- package/templates/current/examples/package.json +47 -35
- package/templates/current/examples/playwright.config.ts +20 -6
- package/templates/current/examples/playwright.mock.config.ts +42 -0
- package/templates/current/examples/pnpm-workspace.yaml +19 -3
- package/templates/current/examples/recipes/remote-crud-dialog-form.vue +15 -13
- package/templates/current/examples/scaffold.lock.json +164 -4
- package/templates/current/examples/scripts/api-codegen.config.ts +35 -0
- package/templates/current/examples/scripts/api-codegen.ts +2015 -0
- package/templates/current/examples/scripts/api-templates/http-client.ejs +359 -0
- package/templates/current/examples/scripts/check-admin-scaffold.mjs +315 -30
- package/templates/current/examples/scripts/generate-api.ts +290 -85
- package/templates/current/examples/scripts/lib/admin-component-catalog.mjs +514 -0
- package/templates/current/examples/scripts/lib/admin-skill-inventory.mjs +18 -0
- package/templates/current/examples/scripts/lib/repository-root.mjs +9 -0
- package/templates/current/examples/scripts/mock-api.ts +1356 -0
- package/templates/current/examples/scripts/remove-examples.mjs +9 -34
- package/templates/current/examples/src/App.vue +9 -18
- package/templates/current/examples/src/api/generated/data-contracts.ts +23 -265
- package/templates/current/examples/src/api/generated/http-client.ts +351 -180
- package/templates/current/examples/src/api/generated/index.ts +22 -0
- package/templates/current/examples/src/api/generated/services/auth.ts +123 -0
- package/templates/current/examples/src/api/generated/services/common/files.ts +111 -0
- package/templates/current/examples/src/api/generated/services/monitor/cache.ts +164 -0
- package/templates/current/examples/src/api/generated/services/monitor/job.ts +195 -0
- package/templates/current/examples/src/api/generated/services/monitor/jobLog.ts +126 -0
- package/templates/current/examples/src/api/generated/services/monitor/logininfor.ts +126 -0
- package/templates/current/examples/src/api/generated/services/monitor/online.ts +66 -0
- package/templates/current/examples/src/api/generated/services/monitor/operlog.ts +106 -0
- package/templates/current/examples/src/api/generated/services/monitor/server.ts +41 -0
- package/templates/current/examples/src/api/generated/services/system/configs.ts +190 -0
- package/templates/current/examples/src/api/generated/services/system/departments.ts +173 -0
- package/templates/current/examples/src/api/generated/services/system/dictionaries/data.ts +169 -0
- package/templates/current/examples/src/api/generated/services/system/dictionaries/types.ts +187 -0
- package/templates/current/examples/src/api/generated/services/system/index.ts +158 -0
- package/templates/current/examples/src/api/generated/services/system/menus.ts +193 -0
- package/templates/current/examples/src/api/generated/services/system/notices.ts +221 -0
- package/templates/current/examples/src/api/generated/services/system/posts.ts +168 -0
- package/templates/current/examples/src/api/generated/services/system/roles.ts +354 -0
- package/templates/current/examples/src/api/generated/services/system/users.ts +425 -0
- package/templates/current/examples/src/api/generated/services/tool/code-generator.ts +304 -0
- package/templates/current/examples/src/api/generated/types/auth.types.ts +132 -0
- package/templates/current/examples/src/api/generated/types/common/files.types.ts +57 -0
- package/templates/current/examples/src/api/generated/types/common.ts +174 -0
- package/templates/current/examples/src/api/generated/types/enum-dict.ts +94 -0
- package/templates/current/examples/src/api/generated/types/enums.ts +155 -0
- package/templates/current/examples/src/api/generated/types/monitor/cache.types.ts +149 -0
- package/templates/current/examples/src/api/generated/types/monitor/job.types.ts +207 -0
- package/templates/current/examples/src/api/generated/types/monitor/jobLog.types.ts +134 -0
- package/templates/current/examples/src/api/generated/types/monitor/logininfor.types.ts +135 -0
- package/templates/current/examples/src/api/generated/types/monitor/online.types.ts +80 -0
- package/templates/current/examples/src/api/generated/types/monitor/operlog.types.ts +126 -0
- package/templates/current/examples/src/api/generated/types/monitor/server.types.ts +205 -0
- package/templates/current/examples/src/api/generated/types/system/configs.types.ts +200 -0
- package/templates/current/examples/src/api/generated/types/system/departments.types.ts +145 -0
- package/templates/current/examples/src/api/generated/types/system/dictionaries/data.types.ts +210 -0
- package/templates/current/examples/src/api/generated/types/system/dictionaries/types.types.ts +221 -0
- package/templates/current/examples/src/api/generated/types/system/index.types.ts +19 -0
- package/templates/current/examples/src/api/generated/types/system/menus.types.ts +234 -0
- package/templates/current/examples/src/api/generated/types/system/notices.types.ts +270 -0
- package/templates/current/examples/src/api/generated/types/system/posts.types.ts +198 -0
- package/templates/current/examples/src/api/generated/types/system/roles.types.ts +410 -0
- package/templates/current/examples/src/api/generated/types/system/users.types.ts +413 -0
- package/templates/current/examples/src/api/generated/types/tool/code-generator.types.ts +388 -0
- package/templates/current/examples/src/api/index.ts +44 -39
- package/templates/current/examples/src/app/__tests__/api-generated.types.ts +24 -0
- package/templates/current/examples/src/app/api.ts +6 -0
- package/templates/current/examples/src/app/authorization/permission.ts +9 -0
- package/templates/current/{clean/src/app → examples/src/app/config}/runtimeConfig.ts +44 -12
- package/templates/current/examples/src/app/errors/errorMessage.ts +80 -0
- package/templates/current/examples/src/app/http/client.ts +141 -0
- package/templates/current/examples/src/app/http/http-adapter.ts +71 -0
- package/templates/current/{clean/src/app → examples/src/app/i18n}/adminLocale.ts +25 -19
- package/templates/current/examples/src/app/{localeFormat.ts → i18n/localeFormat.ts} +29 -6
- package/templates/current/examples/src/app/i18n/origenUiLocale.ts +15 -0
- package/templates/current/examples/src/app/menu/menu.ts +175 -0
- package/templates/current/examples/src/app/menu/menuTypes.ts +20 -0
- package/templates/current/examples/src/{features → app}/security/devtoolsProtection.ts +8 -7
- package/templates/current/examples/src/app/ui/createAdminUi.ts +31 -0
- package/templates/current/examples/src/app/ui/iconCatalog.ts +71 -0
- package/templates/current/examples/src/assets/icons/appearance.svg +1 -0
- package/templates/current/examples/src/assets/icons/arrow-right.svg +1 -0
- package/templates/current/examples/src/assets/icons/check.svg +1 -0
- package/templates/current/examples/src/assets/icons/circle-check.svg +1 -0
- package/templates/current/examples/src/assets/icons/default.svg +4 -0
- package/templates/current/examples/src/assets/icons/directory/setting.svg +1 -0
- package/templates/current/examples/src/assets/icons/expand.svg +1 -0
- package/templates/current/examples/src/assets/icons/fold.svg +1 -0
- package/templates/current/examples/src/assets/icons/key.svg +1 -0
- package/templates/current/examples/src/assets/icons/lock.svg +1 -0
- package/templates/current/examples/src/assets/icons/monitor.svg +1 -0
- package/templates/current/examples/src/assets/icons/moon.svg +11 -0
- package/templates/current/examples/src/assets/icons/page/department.svg +1 -0
- package/templates/current/examples/src/assets/icons/page/dictionary.svg +1 -0
- package/templates/current/examples/src/assets/icons/page/menus.svg +1 -0
- package/templates/current/examples/src/assets/icons/page/user.svg +1 -0
- package/templates/current/examples/src/assets/icons/page/users.svg +1 -0
- package/templates/current/examples/src/assets/icons/plus.svg +1 -0
- package/templates/current/examples/src/assets/icons/profile.svg +1 -0
- package/templates/current/examples/src/assets/icons/refresh.svg +1 -0
- package/templates/current/examples/src/assets/icons/roles.svg +1 -0
- package/templates/current/examples/src/assets/icons/search.svg +1 -0
- package/templates/current/examples/src/assets/icons/sunny.svg +1 -0
- package/templates/current/examples/src/assets/icons/system.svg +1 -0
- package/templates/current/examples/src/assets/icons/theme-auto.svg +14 -0
- package/templates/current/examples/src/assets/icons/tune.svg +13 -0
- package/templates/current/examples/src/{features/shell/components → components}/RouteProgress.vue +2 -2
- package/templates/current/{clean/src/features/system/access → examples/src}/composables/useAuthorizationRefresh.ts +6 -1
- package/templates/current/examples/src/composables/useSystemTableSearchVisibility.ts +33 -0
- package/templates/current/examples/src/{features/appearance/composables → composables}/useTheme.ts +1 -1
- package/templates/current/examples/src/env.d.ts +6 -19
- package/templates/current/examples/src/layouts/AdminLayout.vue +7 -9
- package/templates/current/examples/src/{features/shell/components → layouts}/AdminWatermark.vue +2 -2
- package/templates/current/examples/src/layouts/BreadcrumbBar.vue +9 -1
- package/templates/current/examples/src/layouts/SideMenu.vue +7 -15
- package/templates/current/examples/src/{features/appearance/components → layouts}/ThemePanel.vue +39 -11
- package/templates/current/examples/src/layouts/TopBar.vue +60 -28
- package/templates/current/examples/src/layouts/WorkspaceTabs.vue +10 -1
- package/templates/current/examples/src/layouts/topBarMenuSearch.ts +25 -4
- package/templates/current/examples/src/locales/en-US.json +227 -219
- package/templates/current/examples/src/locales/index.ts +72 -32
- package/templates/current/examples/src/locales/messages-types.ts +15 -10
- package/templates/current/examples/src/locales/vue-i18n.d.ts +1 -1
- package/templates/current/examples/src/locales/zh-CN.json +226 -218
- package/templates/current/examples/src/locales/zh-TW.json +222 -214
- package/templates/current/examples/src/main.ts +50 -40
- package/templates/current/examples/src/router/bootstrap.ts +69 -24
- package/templates/current/examples/src/router/dynamic/componentLoader.ts +150 -0
- package/templates/current/examples/src/router/{dynamicMenuRefresh.ts → dynamic/dynamicMenuRefresh.ts} +6 -2
- package/templates/current/examples/src/router/dynamic/dynamicRoutes.ts +247 -0
- package/templates/current/examples/src/router/navigation/guards.ts +12 -0
- package/templates/current/examples/src/router/navigation/paths.ts +28 -0
- package/templates/current/examples/src/router/navigation/staticRoutes.ts +109 -0
- package/templates/current/examples/src/router/{queryEncryption.ts → query/queryEncryption.ts} +29 -12
- package/templates/current/examples/src/router/query/routeQuery.ts +29 -0
- package/templates/current/examples/src/router/{useRouteQueryDefaults.ts → query/useRouteQueryDefaults.ts} +9 -8
- package/templates/current/examples/src/router/query/useRouteQueryDefaults.types.ts +28 -0
- package/templates/current/examples/src/router/{runtimeErrorRecovery.ts → recovery/runtimeErrorRecovery.ts} +21 -3
- package/templates/current/examples/src/{features/auth/store → store}/auth.ts +97 -62
- package/templates/current/examples/src/store/dictionaries.ts +86 -0
- package/templates/current/examples/src/{features/shell/store → store}/sidebar.ts +9 -2
- package/templates/current/{clean/src/features/appearance → examples/src}/store/theme.ts +8 -4
- package/templates/current/examples/src/styles/layout.css +51 -0
- package/templates/current/examples/src/templates/og-form.ts +7 -2
- package/templates/current/examples/src/templates/og-table.ts +86 -20
- package/templates/current/examples/src/templates/router.ts +11 -2
- package/templates/current/examples/src/utils/color-mix.ts +6 -2
- package/templates/current/examples/src/utils/download.ts +11 -0
- package/templates/current/examples/src/utils/permissions.ts +1 -1
- package/templates/current/examples/src/utils/retryableDialog.ts +46 -0
- package/templates/current/{clean/scripts/clean-overlay/src/features → examples/src/views}/errors/pages/Forbidden.vue +6 -2
- package/templates/current/examples/src/views/errors/pages/MethodNotAllowed.vue +34 -0
- package/templates/current/examples/{scripts/clean-overlay/src/features → src/views}/errors/pages/NotFound.vue +6 -2
- package/templates/current/examples/{scripts/clean-overlay/src/features → src/views}/errors/pages/ServerError.vue +6 -2
- package/templates/current/examples/src/{features/auth/pages/Login.vue → views/login/pages/index.vue} +99 -10
- package/templates/current/examples/src/views/system/access/services/admin-repository.ts +489 -0
- package/templates/current/examples/src/views/system/access/services/rbac.ts +317 -0
- package/templates/current/examples/src/views/system/dept/components/DepartmentEditorForm.vue +87 -0
- package/templates/current/examples/src/views/system/dept/composables/useDepartmentManagement.ts +314 -0
- package/templates/current/examples/src/views/system/dept/pages/index.vue +44 -0
- package/templates/current/examples/src/views/system/dept/services/departments.ts +168 -0
- package/templates/current/examples/src/views/system/dict/components/DictionaryDataEditorForm.vue +98 -0
- package/templates/current/examples/src/views/system/dict/components/DictionaryDataPreview.vue +233 -0
- package/templates/current/examples/src/views/system/dict/components/DictionaryTypeEditorForm.vue +66 -0
- package/templates/current/examples/src/views/system/dict/composables/useDictionaryDataManagement.ts +406 -0
- package/templates/current/examples/src/views/system/dict/composables/useDictionaryTypeManagement.ts +329 -0
- package/templates/current/examples/src/views/system/dict/data/pages/index.vue +134 -0
- package/templates/current/examples/src/views/system/dict/pages/index.vue +113 -0
- package/templates/current/examples/src/views/system/dict/services/dictionaries.ts +239 -0
- package/templates/current/examples/src/views/system/menu/components/MenuEditorForm.vue +252 -0
- package/templates/current/examples/src/views/system/menu/composables/useMenuManagement.ts +357 -0
- package/templates/current/examples/src/views/system/menu/menuDraft.ts +45 -0
- package/templates/current/examples/src/views/system/menu/pages/ExternalLink.vue +37 -0
- package/templates/current/examples/src/views/system/menu/pages/index.vue +75 -0
- package/templates/current/examples/src/views/system/post/components/PostEditorForm.vue +69 -0
- package/templates/current/examples/src/views/system/post/composables/usePostManagement.ts +245 -0
- package/templates/current/examples/src/views/system/post/pages/index.vue +92 -0
- package/templates/current/examples/src/views/system/post/services/posts.ts +100 -0
- package/templates/current/examples/src/views/system/role/auth-users/pages/index.vue +100 -0
- package/templates/current/examples/src/views/system/role/components/RoleDataScopeForm.vue +167 -0
- package/templates/current/examples/src/views/system/role/components/RoleEditorForm.vue +165 -0
- package/templates/current/examples/src/views/system/role/components/RoleUserSelectForm.vue +129 -0
- package/templates/current/examples/src/views/system/role/composables/useRoleManagement.ts +422 -0
- package/templates/current/examples/src/views/system/role/composables/useRoleUserManagement.ts +233 -0
- package/templates/current/examples/src/views/system/role/pages/index.vue +110 -0
- package/templates/current/examples/src/views/system/role/services/roleAccess.ts +162 -0
- package/templates/current/examples/src/views/system/user/auth-roles/pages/index.vue +209 -0
- package/templates/current/examples/src/views/system/user/components/UserDetailsForm.vue +108 -0
- package/templates/current/examples/src/views/system/user/components/UserEditorForm.vue +207 -0
- package/templates/current/examples/src/views/system/user/components/UserImportDialog.vue +80 -0
- package/templates/current/examples/src/views/system/user/components/UserResetPasswordForm.vue +56 -0
- package/templates/current/examples/src/views/system/user/composables/useUserManagement.ts +502 -0
- package/templates/current/examples/src/views/system/user/pages/index.vue +459 -0
- package/templates/current/examples/tests/e2e/admin-access-business.spec.ts +33 -0
- package/templates/current/examples/tests/e2e/admin-shell.spec.ts +50 -0
- package/templates/current/examples/tests/e2e/fixtures/adminMockBackend.ts +95 -0
- package/templates/current/examples/tests/e2e/fixtures/labelGeometry.ts +52 -0
- package/templates/current/examples/tests/e2e/mock-api-generation.spec.ts +27 -0
- package/templates/current/examples/tests/e2e/mock-business.spec.ts +555 -0
- package/templates/current/examples/tests/e2e/mock-menu-retry-form-label.spec.ts +100 -0
- package/templates/current/examples/tests/e2e/mock-shell.spec.ts +25 -0
- package/templates/current/examples/tests/e2e/mock-tree-selection-layout.spec.ts +113 -0
- package/templates/current/examples/tests/unit/api/api-codegen.spec.ts +893 -0
- package/templates/current/examples/tests/unit/api/client.spec.ts +145 -0
- package/templates/current/examples/tests/unit/api/generated-http-client.spec.ts +290 -0
- package/templates/current/{clean/src → examples/tests/unit}/api/http-adapter.spec.ts +3 -3
- package/templates/current/examples/tests/unit/api/system-apis.spec.ts +118 -0
- package/templates/current/examples/tests/unit/app/createAdminUi.spec.ts +79 -0
- package/templates/current/examples/{src → tests/unit}/app/errorMessage.spec.ts +1 -1
- package/templates/current/examples/tests/unit/app/iconCatalog.spec.ts +12 -0
- package/templates/current/examples/tests/unit/app/menu.spec.ts +215 -0
- package/templates/current/{clean/src → examples/tests/unit}/app/origenUiLocale.spec.ts +1 -1
- package/templates/current/{clean/src → examples/tests/unit}/app/permission.spec.ts +4 -5
- package/templates/current/examples/tests/unit/app/runtimeConfig.spec.ts +36 -0
- package/templates/current/{clean/src/features → examples/tests/unit/app}/security/devtoolsProtection.spec.ts +17 -7
- package/templates/current/{clean/src/features/shell → examples/tests/unit}/composables/useRouteProgress.spec.ts +1 -1
- package/templates/current/{clean/src/features/shell/components → examples/tests/unit/layouts}/AdminWatermark.spec.ts +5 -7
- package/templates/current/{clean/src → examples/tests/unit}/layouts/topBarMenuSearch.spec.ts +25 -8
- package/templates/current/examples/{src → tests/unit}/locales/messages.spec.ts +43 -17
- package/templates/current/examples/tests/unit/router/dynamicMenuRefresh.spec.ts +151 -0
- package/templates/current/examples/tests/unit/router/dynamicRoutes.spec.ts +374 -0
- package/templates/current/examples/tests/unit/router/paths.spec.ts +103 -0
- package/templates/current/examples/{src → tests/unit}/router/queryEncryption.spec.ts +49 -12
- package/templates/current/{clean/src → examples/tests/unit}/router/routeQuery.spec.ts +8 -1
- package/templates/current/examples/{src → tests/unit}/router/runtimeErrorRecovery.spec.ts +11 -6
- package/templates/current/{clean/src → examples/tests/unit}/router/useRouteQueryDefaults.spec.ts +46 -12
- package/templates/current/examples/tests/unit/scripts/mock-api.spec.ts +440 -0
- package/templates/current/examples/{scripts → tests/unit/scripts}/vite-build-policy.spec.ts +35 -6
- package/templates/current/examples/{src/features/auth → tests/unit}/store/auth.spec.ts +100 -15
- package/templates/current/examples/tests/unit/store/dictionaries.spec.ts +106 -0
- package/templates/current/{clean/src → examples/tests/unit}/templates/templates.spec.ts +58 -16
- package/templates/current/examples/{src/utils/__tests__ → tests/unit/utils}/color-mix.spec.ts +1 -1
- package/templates/current/examples/tests/unit/utils/retryableDialog.spec.ts +61 -0
- package/templates/current/examples/{scripts/clean-overlay/src/features/errors/pages → tests/unit/views/errors}/error-pages.spec.ts +12 -9
- package/templates/current/examples/tests/unit/views/feature-composables.spec.ts +233 -0
- package/templates/current/examples/tests/unit/views/system/access/admin-repository.spec.ts +353 -0
- package/templates/current/examples/tests/unit/views/system/access/rbac.spec.ts +329 -0
- package/templates/current/examples/tests/unit/views/system/dept/departments.spec.ts +104 -0
- package/templates/current/examples/tests/unit/views/system/dict/dictionaries.spec.ts +234 -0
- package/templates/current/examples/tests/unit/views/system/menu/menuDraft.spec.ts +77 -0
- package/templates/current/examples/tests/unit/views/system/menu/useMenuManagement.spec.ts +339 -0
- package/templates/current/examples/tests/unit/views/system/user/searchControl.spec.ts +128 -0
- package/templates/current/examples/tsconfig.json +4 -19
- package/templates/current/examples/vite.build-policy.ts +97 -22
- package/templates/current/examples/vite.config.ts +50 -7
- package/templates/current/clean/.codebuddy/AGENTS.md +0 -18
- package/templates/current/clean/.codex/skills/build-admin-feature/SKILL.md +0 -14
- package/templates/current/clean/.codex/skills/build-admin-feature/references/component-selection.md +0 -25
- package/templates/current/clean/.codex/skills/use-og-table/SKILL.md +0 -16
- package/templates/current/clean/.cursor/AGENTS.md +0 -18
- package/templates/current/clean/.env.production.example +0 -31
- package/templates/current/clean/.qoder/AGENTS.md +0 -15
- package/templates/current/clean/e2e/admin-shell.spec.ts +0 -156
- package/templates/current/clean/e2e/demo-shell.spec.ts +0 -372
- package/templates/current/clean/playwright.demo.config.ts +0 -25
- package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/NotFound.vue +0 -31
- package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/ServerError.vue +0 -31
- package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/error-pages.spec.ts +0 -41
- package/templates/current/clean/scripts/clean-overlay/src/main.ts +0 -100
- package/templates/current/clean/scripts/clean-overlay/src/router/componentCache.ts +0 -12
- package/templates/current/clean/scripts/clean-overlay/src/router/componentRegistry.ts +0 -14
- package/templates/current/clean/scripts/clean-overlay/src/router/dynamicRoutes.spec.ts +0 -77
- package/templates/current/clean/scripts/clean-overlay/src/router/paths.ts +0 -21
- package/templates/current/clean/scripts/clean-overlay/src/router/staticRoutes.ts +0 -63
- package/templates/current/clean/scripts/demo-api.ts +0 -873
- package/templates/current/clean/src/api/client.spec.ts +0 -66
- package/templates/current/clean/src/api/client.ts +0 -152
- 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 +0 -144
- 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 +0 -50
- 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 +0 -63
- 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 +0 -169
- 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 +0 -180
- 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 +0 -167
- 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 +0 -168
- package/templates/current/clean/src/api/generated//350/256/244/350/257/201.ts +0 -95
- package/templates/current/clean/src/api/http-adapter.ts +0 -83
- package/templates/current/clean/src/app/createAdminUi.spec.ts +0 -166
- package/templates/current/clean/src/app/createAdminUi.ts +0 -63
- package/templates/current/clean/src/app/embedded-token.spec.ts +0 -40
- package/templates/current/clean/src/app/embedded.spec.ts +0 -135
- package/templates/current/clean/src/app/embedded.ts +0 -255
- package/templates/current/clean/src/app/errorMessage.ts +0 -53
- package/templates/current/clean/src/app/menu-host.spec.ts +0 -77
- package/templates/current/clean/src/app/menu.spec.ts +0 -320
- package/templates/current/clean/src/app/menu.ts +0 -308
- package/templates/current/clean/src/app/menuTypes.ts +0 -18
- package/templates/current/clean/src/app/origenUiLocale.ts +0 -10
- package/templates/current/clean/src/app/permission.ts +0 -9
- package/templates/current/clean/src/demo-api.spec.ts +0 -478
- package/templates/current/clean/src/features/errors/pages/error-pages.spec.ts +0 -41
- package/templates/current/clean/src/features/system/access/api/admin-repository.spec.ts +0 -14
- package/templates/current/clean/src/features/system/access/api/admin-repository.ts +0 -298
- package/templates/current/clean/src/features/system/access/api/rbac.spec.ts +0 -72
- package/templates/current/clean/src/features/system/access/api/rbac.ts +0 -292
- package/templates/current/clean/src/features/system/access/composables/useAuthorizationPolling.spec.ts +0 -134
- package/templates/current/clean/src/features/system/access/composables/useAuthorizationPolling.ts +0 -96
- package/templates/current/clean/src/features/workspace/pages/Profile.vue +0 -185
- package/templates/current/clean/src/router/componentCache.ts +0 -12
- package/templates/current/clean/src/router/componentRegistry.ts +0 -14
- package/templates/current/clean/src/router/dynamicMenuRefresh.spec.ts +0 -101
- package/templates/current/clean/src/router/dynamicRoutes.spec.ts +0 -77
- package/templates/current/clean/src/router/dynamicRoutes.ts +0 -177
- package/templates/current/clean/src/router/guards.ts +0 -5
- package/templates/current/clean/src/router/paths.spec.ts +0 -50
- package/templates/current/clean/src/router/paths.ts +0 -21
- package/templates/current/clean/src/router/routeQuery.ts +0 -6
- package/templates/current/clean/src/router/staticRoutes.ts +0 -63
- package/templates/current/clean/src/router/useRouteQueryDefaults.types.ts +0 -20
- package/templates/current/clean/tsconfig.node.json +0 -9
- package/templates/current/examples/.codebuddy/AGENTS.md +0 -18
- package/templates/current/examples/.codex/skills/build-admin-feature/SKILL.md +0 -14
- package/templates/current/examples/.codex/skills/build-admin-feature/references/component-selection.md +0 -25
- package/templates/current/examples/.codex/skills/use-og-table/SKILL.md +0 -16
- package/templates/current/examples/.cursor/AGENTS.md +0 -18
- package/templates/current/examples/.env.production.example +0 -31
- package/templates/current/examples/.qoder/AGENTS.md +0 -15
- package/templates/current/examples/e2e/admin-shell.spec.ts +0 -156
- package/templates/current/examples/e2e/demo-shell.spec.ts +0 -372
- package/templates/current/examples/playwright.demo.config.ts +0 -25
- package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/Forbidden.vue +0 -31
- package/templates/current/examples/scripts/clean-overlay/src/main.ts +0 -100
- package/templates/current/examples/scripts/clean-overlay/src/router/componentCache.ts +0 -12
- package/templates/current/examples/scripts/clean-overlay/src/router/componentRegistry.ts +0 -14
- package/templates/current/examples/scripts/clean-overlay/src/router/dynamicRoutes.spec.ts +0 -77
- package/templates/current/examples/scripts/clean-overlay/src/router/paths.ts +0 -21
- package/templates/current/examples/scripts/clean-overlay/src/router/staticRoutes.ts +0 -63
- package/templates/current/examples/scripts/demo-api.ts +0 -873
- package/templates/current/examples/src/api/client.spec.ts +0 -66
- package/templates/current/examples/src/api/client.ts +0 -152
- 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 +0 -144
- 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 +0 -50
- 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 +0 -63
- 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 +0 -169
- 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 +0 -180
- 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 +0 -167
- 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 +0 -168
- package/templates/current/examples/src/api/generated//350/256/244/350/257/201.ts +0 -95
- package/templates/current/examples/src/api/http-adapter.ts +0 -83
- package/templates/current/examples/src/app/createAdminUi.spec.ts +0 -166
- package/templates/current/examples/src/app/createAdminUi.ts +0 -63
- package/templates/current/examples/src/app/embedded-token.spec.ts +0 -40
- package/templates/current/examples/src/app/embedded.spec.ts +0 -135
- package/templates/current/examples/src/app/embedded.ts +0 -255
- package/templates/current/examples/src/app/errorMessage.ts +0 -53
- package/templates/current/examples/src/app/menu-host.spec.ts +0 -77
- package/templates/current/examples/src/app/menu.spec.ts +0 -320
- package/templates/current/examples/src/app/menu.ts +0 -308
- package/templates/current/examples/src/app/menuTypes.ts +0 -18
- package/templates/current/examples/src/app/origenUiLocale.ts +0 -10
- package/templates/current/examples/src/app/permission.ts +0 -9
- package/templates/current/examples/src/demo-api.spec.ts +0 -478
- package/templates/current/examples/src/features/errors/pages/Forbidden.vue +0 -31
- package/templates/current/examples/src/features/errors/pages/NotFound.vue +0 -31
- package/templates/current/examples/src/features/errors/pages/ServerError.vue +0 -31
- package/templates/current/examples/src/features/feature-composables.spec.ts +0 -245
- package/templates/current/examples/src/features/system/access/api/admin-repository.spec.ts +0 -14
- package/templates/current/examples/src/features/system/access/api/admin-repository.ts +0 -298
- package/templates/current/examples/src/features/system/access/api/rbac.spec.ts +0 -72
- package/templates/current/examples/src/features/system/access/api/rbac.ts +0 -292
- package/templates/current/examples/src/features/system/access/composables/useAuthorizationPolling.spec.ts +0 -134
- package/templates/current/examples/src/features/system/access/composables/useAuthorizationPolling.ts +0 -96
- package/templates/current/examples/src/features/system/audit/composables/useAuditManagement.ts +0 -122
- package/templates/current/examples/src/features/system/audit/pages/AuditList.vue +0 -20
- package/templates/current/examples/src/features/system/menus/components/MenuEditorForm.vue +0 -279
- package/templates/current/examples/src/features/system/menus/composables/useMenuManagement.ts +0 -435
- package/templates/current/examples/src/features/system/menus/menuDraft.spec.ts +0 -204
- package/templates/current/examples/src/features/system/menus/menuDraft.ts +0 -116
- package/templates/current/examples/src/features/system/menus/menuTreePrecheck.spec.ts +0 -268
- package/templates/current/examples/src/features/system/menus/menuTreePrecheck.ts +0 -317
- package/templates/current/examples/src/features/system/menus/pages/MenuList.vue +0 -51
- package/templates/current/examples/src/features/system/roles/components/RoleEditorForm.vue +0 -116
- package/templates/current/examples/src/features/system/roles/composables/useRoleManagement.ts +0 -194
- package/templates/current/examples/src/features/system/roles/pages/RoleList.vue +0 -47
- package/templates/current/examples/src/features/system/users/components/UserEditorForm.vue +0 -104
- package/templates/current/examples/src/features/system/users/composables/useUserManagement.ts +0 -228
- package/templates/current/examples/src/features/system/users/pages/UserList.vue +0 -51
- package/templates/current/examples/src/features/workspace/pages/Dashboard.spec.ts +0 -41
- package/templates/current/examples/src/features/workspace/pages/Dashboard.vue +0 -325
- package/templates/current/examples/src/features/workspace/pages/Profile.vue +0 -185
- package/templates/current/examples/src/router/componentCache.ts +0 -18
- package/templates/current/examples/src/router/componentRegistry.ts +0 -66
- package/templates/current/examples/src/router/dynamicMenuRefresh.spec.ts +0 -101
- package/templates/current/examples/src/router/dynamicRoutes.spec.ts +0 -144
- package/templates/current/examples/src/router/dynamicRoutes.ts +0 -177
- package/templates/current/examples/src/router/guards.ts +0 -5
- package/templates/current/examples/src/router/paths.spec.ts +0 -50
- package/templates/current/examples/src/router/paths.ts +0 -21
- package/templates/current/examples/src/router/routeQuery.ts +0 -6
- package/templates/current/examples/src/router/staticRoutes.ts +0 -63
- package/templates/current/examples/src/router/useRouteQueryDefaults.types.ts +0 -20
- package/templates/current/examples/tsconfig.node.json +0 -9
- /package/templates/current/clean/{.codex → .agents}/skills/style-og-origen-ui/SKILL.md +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/style-og-origen-ui/agents/openai.yaml +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-dialog/SKILL.md +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-dialog/agents/openai.yaml +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-editor/SKILL.md +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-http/SKILL.md +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-http/agents/openai.yaml +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-router-tabs/SKILL.md +0 -0
- /package/templates/current/{examples/.codex → clean/.claude}/skills/style-og-origen-ui/SKILL.md +0 -0
- /package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-dialog/SKILL.md +0 -0
- /package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-editor/SKILL.md +0 -0
- /package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-http/SKILL.md +0 -0
- /package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-router-tabs/SKILL.md +0 -0
- /package/templates/current/clean/src/{features/security/components → components}/DevtoolsProtectionOverlay.vue +0 -0
- /package/templates/current/clean/src/{features/shell/composables → composables}/useRouteProgress.ts +0 -0
- /package/templates/current/clean/src/{features/workspace → views/fallback}/pages/Empty.vue +0 -0
- /package/templates/current/examples/{.codex → .agents}/skills/style-og-origen-ui/agents/openai.yaml +0 -0
- /package/templates/current/examples/{.codex → .agents}/skills/use-og-dialog/agents/openai.yaml +0 -0
- /package/templates/current/examples/{.codex → .agents}/skills/use-og-http/agents/openai.yaml +0 -0
- /package/templates/current/examples/src/{features/security/components → components}/DevtoolsProtectionOverlay.vue +0 -0
- /package/templates/current/examples/src/{features/shell/composables → composables}/useRouteProgress.ts +0 -0
- /package/templates/current/examples/src/{features/workspace → views/fallback}/pages/Empty.vue +0 -0
|
@@ -0,0 +1,514 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs'
|
|
2
|
+
import { mkdir, readFile, writeFile } from 'node:fs/promises'
|
|
3
|
+
import { basename, isAbsolute, join, relative, resolve, sep } from 'node:path'
|
|
4
|
+
import prettier from 'prettier'
|
|
5
|
+
import { REPOSITORY_ROOT } from './repository-root.mjs'
|
|
6
|
+
|
|
7
|
+
const componentDirectoryStart = '<!-- component-directory:start -->'
|
|
8
|
+
const componentDirectoryEnd = '<!-- component-directory:end -->'
|
|
9
|
+
const componentCatalogStart = '<!-- component-catalog:start -->'
|
|
10
|
+
const componentCatalogEnd = '<!-- component-catalog:end -->'
|
|
11
|
+
// Kept as static text on purpose: rendering the pinned versions here would rewrite every
|
|
12
|
+
// managed guidance file on each release, while the versions themselves stay authoritative
|
|
13
|
+
// in component-catalog.v2.json and are verified by the scaffold lock.
|
|
14
|
+
const packageVersionPointer =
|
|
15
|
+
'Package versions are pinned in `component-catalog.v2.json` (`packageVersions`) and intentionally omitted here so this document stays release-independent.'
|
|
16
|
+
// Static on purpose: embedding per-component usage links made the distributed guidance go stale as
|
|
17
|
+
// soon as a consumer project replaced the scaffold demo tree, and sync never rescans project sources.
|
|
18
|
+
const adminIntegrationExamplesPointer =
|
|
19
|
+
'Integration examples live under `src/views/**` (pages) and `src/layouts/**` (workspace shell).'
|
|
20
|
+
const skillRoots = [
|
|
21
|
+
'.agents/skills',
|
|
22
|
+
'.claude/skills',
|
|
23
|
+
'.codebuddy/skills',
|
|
24
|
+
'.cursor/skills',
|
|
25
|
+
'.qoder/skills',
|
|
26
|
+
'.zcode/skills',
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
function tableCell(value) {
|
|
30
|
+
return String(value ?? '')
|
|
31
|
+
.replaceAll('|', '\\|')
|
|
32
|
+
.replace(/\s+/gu, ' ')
|
|
33
|
+
.trim()
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function usageByComponent(catalog) {
|
|
37
|
+
return new Map((catalog.adminUsage ?? []).map((usage) => [usage.componentId, usage]))
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function summarizeUsage(usage, usageLinkPrefix) {
|
|
41
|
+
if (!usage) return 'Available; no recorded use in this Admin project.'
|
|
42
|
+
const evidence = usage.evidence
|
|
43
|
+
.map((item) => {
|
|
44
|
+
const path = item.path.replaceAll('\\', '/')
|
|
45
|
+
return `[${path}](${usageLinkPrefix}${path}) (${item.match})`
|
|
46
|
+
})
|
|
47
|
+
.join('; ')
|
|
48
|
+
return `${usage.mode}: ${evidence}`
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated Component Admin-usage text is no longer rendered: the catalog evidence paths are
|
|
53
|
+
* scaffold demo paths that go stale in consumer projects. The `adminUsage` catalog data stays
|
|
54
|
+
* authoritative for validation; this helper remains exported for build-time callers.
|
|
55
|
+
*/
|
|
56
|
+
export function summarizeAdminUsage(catalog, component, usageLinkPrefix = '../../../../') {
|
|
57
|
+
return summarizeUsage(usageByComponent(catalog).get(component.id), usageLinkPrefix)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function skillLink(skill, skillPathPrefix) {
|
|
61
|
+
return `[${skill}](${skillPathPrefix}${skill}/SKILL.md)`
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function extensionSummary(component) {
|
|
65
|
+
const contract = component.wrapperContract ?? {}
|
|
66
|
+
const owned = contract.owned ?? {}
|
|
67
|
+
const surfaces = []
|
|
68
|
+
if (owned.props?.length) surfaces.push(`owned props: ${owned.props.join(', ')}`)
|
|
69
|
+
if (owned.events?.length) surfaces.push(`owned events: ${owned.events.join(', ')}`)
|
|
70
|
+
if (owned.slots?.length) surfaces.push(`owned slots: ${owned.slots.join(', ')}`)
|
|
71
|
+
if (owned.methods?.length) surfaces.push(`exposes: ${owned.methods.join(', ')}`)
|
|
72
|
+
if (contract.nativeAccess?.surface) surfaces.push(contract.nativeAccess.surface)
|
|
73
|
+
surfaces.push(...(contract.unsupportedRoute ?? []))
|
|
74
|
+
return surfaces.join('; ') || 'No additional extension surface is declared.'
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function apiSummary(api) {
|
|
78
|
+
const parts = []
|
|
79
|
+
if (api.coreProps?.length) parts.push(`props: ${api.coreProps.join(', ')}`)
|
|
80
|
+
if (api.events?.length) parts.push(`events: ${api.events.join(', ')}`)
|
|
81
|
+
if (api.slots?.length) parts.push(`slots: ${api.slots.join(', ')}`)
|
|
82
|
+
if (api.exposes?.length) parts.push(`exposes: ${api.exposes.join(', ')}`)
|
|
83
|
+
return parts.join('; ') || 'No component-level props, events, slots, or exposes.'
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function guideFilename(component) {
|
|
87
|
+
const guide = component.documentation?.guide
|
|
88
|
+
if (typeof guide !== 'string' || !guide) {
|
|
89
|
+
throw new Error(`${component.id}: a consumer guide is required`)
|
|
90
|
+
}
|
|
91
|
+
return basename(guide)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function rewriteTemplateTarget(target) {
|
|
95
|
+
const [pathname, ...fragmentParts] = target.split('#')
|
|
96
|
+
let fragment = ''
|
|
97
|
+
if (fragmentParts.length) fragment = `#${fragmentParts.join('#')}`
|
|
98
|
+
if (pathname.startsWith('/components/')) return `./${basename(pathname)}.md${fragment}`
|
|
99
|
+
if (pathname.startsWith('/examples/') || pathname.startsWith('../examples/')) {
|
|
100
|
+
return '../../.agents/skills/admin-component-usage/references/component-directory.md'
|
|
101
|
+
}
|
|
102
|
+
if (pathname === '/guide/styles' || pathname === '../guide/styles')
|
|
103
|
+
return '../../.codex/rules/05-style.md'
|
|
104
|
+
if (pathname.startsWith('./') && !/\.md$/u.test(pathname)) return `${pathname}.md${fragment}`
|
|
105
|
+
if (pathname.startsWith('/')) {
|
|
106
|
+
throw new Error(`No local Admin template mapping for documentation route ${target}`)
|
|
107
|
+
}
|
|
108
|
+
return target
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function rewriteDocumentationLine(line) {
|
|
112
|
+
const markdown = line.replace(/\]\(([^)]+)\)/gu, (_match, target) => {
|
|
113
|
+
const [pathname, ...suffixParts] = target.split(/\s+/u)
|
|
114
|
+
let suffix = ''
|
|
115
|
+
if (suffixParts.length) suffix = ` ${suffixParts.join(' ')}`
|
|
116
|
+
return `](${rewriteTemplateTarget(pathname)}${suffix})`
|
|
117
|
+
})
|
|
118
|
+
return markdown.replace(/\bhref=(['"])(.*?)\1/gu, (_match, quote, target) => {
|
|
119
|
+
return `href=${quote}${rewriteTemplateTarget(target)}${quote}`
|
|
120
|
+
})
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function findTagEnd(source, start) {
|
|
124
|
+
let quote
|
|
125
|
+
for (let index = start; index < source.length; index += 1) {
|
|
126
|
+
const character = source[index]
|
|
127
|
+
if (quote) {
|
|
128
|
+
if (character === quote) quote = undefined
|
|
129
|
+
continue
|
|
130
|
+
}
|
|
131
|
+
if (character === String.fromCharCode(34) || character === String.fromCharCode(39)) {
|
|
132
|
+
quote = character
|
|
133
|
+
continue
|
|
134
|
+
}
|
|
135
|
+
if (character === '>') return index
|
|
136
|
+
}
|
|
137
|
+
return -1
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function readAttribute(attributes, name) {
|
|
141
|
+
const escapedName = name.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&')
|
|
142
|
+
const match = new RegExp(`(?:^|\\s)${escapedName}=(?:"([^"]*)"|'([^']*)')`, 'u').exec(attributes)
|
|
143
|
+
return match?.[1] ?? match?.[2]
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function summarizeDemoPreview(tag) {
|
|
147
|
+
const attributes = tag.slice('<DemoPreview'.length, -1)
|
|
148
|
+
const title = readAttribute(attributes, 'title')
|
|
149
|
+
const description = readAttribute(attributes, 'description')
|
|
150
|
+
return [title && `### ${title}`, description].filter(Boolean).join('\n\n')
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const packageTestPathPattern =
|
|
154
|
+
/\bpackages\/[^\s/`)\]|]+\/(?:[^\s/`)\]|]+\/)*(?:__tests__|tests?|e2e)\/[^\s`)\]|]+/u
|
|
155
|
+
const e2eTestPathPattern =
|
|
156
|
+
/\b(?:apps\/[^\s/`)\]|]+\/)?e2e\/[^\s/`)\]|]+\/[^\s/`)\]|]+\.(?:spec|test)\.[^\s`)\]|]+/u
|
|
157
|
+
|
|
158
|
+
function isMonorepoTestPath(value) {
|
|
159
|
+
return packageTestPathPattern.test(value) || e2eTestPathPattern.test(value)
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function projectTestEvidenceLine(line) {
|
|
163
|
+
if (!isMonorepoTestPath(line)) return line
|
|
164
|
+
if (line.trimStart().startsWith('|')) {
|
|
165
|
+
return line
|
|
166
|
+
.split('|')
|
|
167
|
+
.map((cell) => {
|
|
168
|
+
if (isMonorepoTestPath(cell)) return ' The project test suite covers this behavior. '
|
|
169
|
+
return cell
|
|
170
|
+
})
|
|
171
|
+
.join('|')
|
|
172
|
+
}
|
|
173
|
+
return 'The project test suite covers these behaviors.'
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function collapseBlankLinesOutsideFences(lines) {
|
|
177
|
+
const output = []
|
|
178
|
+
let fence
|
|
179
|
+
for (const line of lines) {
|
|
180
|
+
if (fence) {
|
|
181
|
+
output.push(line)
|
|
182
|
+
if (new RegExp(`^\\s*${fence.marker}{${fence.length},}\\s*$`, 'u').test(line))
|
|
183
|
+
fence = undefined
|
|
184
|
+
continue
|
|
185
|
+
}
|
|
186
|
+
const fenceStart = line.match(/^\s*(`{3,}|~{3,})/u)?.[1]
|
|
187
|
+
if (fenceStart) {
|
|
188
|
+
fence = { marker: fenceStart[0], length: fenceStart.length }
|
|
189
|
+
output.push(line)
|
|
190
|
+
continue
|
|
191
|
+
}
|
|
192
|
+
if (line.trim() === '' && output.at(-1)?.trim() === '') continue
|
|
193
|
+
output.push(line)
|
|
194
|
+
}
|
|
195
|
+
return output.join('\n')
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export function renderTemplateConsumerGuide(source) {
|
|
199
|
+
const lines = source.split(/\r?\n/u)
|
|
200
|
+
const output = []
|
|
201
|
+
let fence
|
|
202
|
+
let skippedTag
|
|
203
|
+
let insideClientOnly = false
|
|
204
|
+
let pendingPreview
|
|
205
|
+
for (const line of lines) {
|
|
206
|
+
if (fence) {
|
|
207
|
+
output.push(line)
|
|
208
|
+
if (new RegExp(`^\\s*${fence.marker}{${fence.length},}\\s*$`, 'u').test(line))
|
|
209
|
+
fence = undefined
|
|
210
|
+
continue
|
|
211
|
+
}
|
|
212
|
+
const fenceStart = line.match(/^\s*(`{3,}|~{3,})/u)?.[1]
|
|
213
|
+
if (fenceStart) {
|
|
214
|
+
fence = { marker: fenceStart[0], length: fenceStart.length }
|
|
215
|
+
output.push(line)
|
|
216
|
+
continue
|
|
217
|
+
}
|
|
218
|
+
if (pendingPreview) {
|
|
219
|
+
pendingPreview.source += `\n${line}`
|
|
220
|
+
const tagEnd = findTagEnd(pendingPreview.source, 0)
|
|
221
|
+
if (tagEnd >= 0) {
|
|
222
|
+
output.push(summarizeDemoPreview(pendingPreview.source.slice(0, tagEnd + 1)))
|
|
223
|
+
if (pendingPreview.opensClientOnly && !pendingPreview.source.includes('</ClientOnly>'))
|
|
224
|
+
insideClientOnly = true
|
|
225
|
+
if (pendingPreview.source.includes('</ClientOnly>')) insideClientOnly = false
|
|
226
|
+
pendingPreview = undefined
|
|
227
|
+
}
|
|
228
|
+
continue
|
|
229
|
+
}
|
|
230
|
+
if (skippedTag) {
|
|
231
|
+
if (line.includes(`</${skippedTag}>`)) skippedTag = undefined
|
|
232
|
+
continue
|
|
233
|
+
}
|
|
234
|
+
if (/<script setup\b/u.test(line)) {
|
|
235
|
+
if (!line.includes('</script>')) skippedTag = 'script'
|
|
236
|
+
continue
|
|
237
|
+
}
|
|
238
|
+
const previewStart = line.search(/<DemoPreview\b/u)
|
|
239
|
+
if (previewStart >= 0) {
|
|
240
|
+
const tagEnd = findTagEnd(line, previewStart)
|
|
241
|
+
if (tagEnd < 0) {
|
|
242
|
+
pendingPreview = {
|
|
243
|
+
source: line.slice(previewStart),
|
|
244
|
+
opensClientOnly: line.includes('<ClientOnly') && !line.includes('</ClientOnly>'),
|
|
245
|
+
}
|
|
246
|
+
} else {
|
|
247
|
+
output.push(summarizeDemoPreview(line.slice(previewStart, tagEnd + 1)))
|
|
248
|
+
if (line.includes('</ClientOnly>')) insideClientOnly = false
|
|
249
|
+
}
|
|
250
|
+
if (line.includes('<ClientOnly') && !line.includes('</ClientOnly>')) insideClientOnly = true
|
|
251
|
+
continue
|
|
252
|
+
}
|
|
253
|
+
if (insideClientOnly || line.includes('<ClientOnly')) {
|
|
254
|
+
if (line.includes('<ClientOnly') && !line.includes('</ClientOnly>')) insideClientOnly = true
|
|
255
|
+
if (line.includes('</ClientOnly>')) insideClientOnly = false
|
|
256
|
+
continue
|
|
257
|
+
}
|
|
258
|
+
if (line.includes('component-contracts:sync')) {
|
|
259
|
+
output.push('The public API contract is summarized below.')
|
|
260
|
+
continue
|
|
261
|
+
}
|
|
262
|
+
const projectedLine = projectTestEvidenceLine(line)
|
|
263
|
+
if (projectedLine !== undefined) output.push(rewriteDocumentationLine(projectedLine))
|
|
264
|
+
}
|
|
265
|
+
return collapseBlankLinesOutsideFences(output)
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function sentence(value) {
|
|
269
|
+
return `${String(value).trim().replace(/\.+$/u, '')}.`
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export function renderComponentSelectionRows(catalog, options = {}) {
|
|
273
|
+
const skillPathPrefix = options.skillPathPrefix ?? '../../'
|
|
274
|
+
return catalog.components
|
|
275
|
+
.map((component) => {
|
|
276
|
+
const imports = component.imports.map((name) => `\`${name}\``).join(', ')
|
|
277
|
+
const importPath = component.importPath ?? component.package
|
|
278
|
+
return `| ${tableCell(component.useWhen)} | ${imports} from \`${importPath}\` | ${skillLink(component.skill, skillPathPrefix)} | ${tableCell(extensionSummary(component))} | ${tableCell(component.avoid)} | ${component.lifecycleStatus} |`
|
|
279
|
+
})
|
|
280
|
+
.join('\n')
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export function renderComponentDirectory(catalog, options = {}) {
|
|
284
|
+
const skillPathPrefix = options.skillPathPrefix ?? '../../'
|
|
285
|
+
const guideLinkPrefix = options.guideLinkPrefix ?? '../../../../apps/docs/components/'
|
|
286
|
+
const components = catalog.components.map((component) => {
|
|
287
|
+
const importPath = component.importPath ?? component.package
|
|
288
|
+
const api = apiSummary(component.api ?? {})
|
|
289
|
+
return [
|
|
290
|
+
`## ${component.id}`,
|
|
291
|
+
'',
|
|
292
|
+
`- Public import: \`${component.imports.join(', ')}\` from \`${importPath}\`.`,
|
|
293
|
+
`- Use when: ${sentence(component.useWhen)}`,
|
|
294
|
+
`- Lifecycle status: ${component.lifecycleStatus}.`,
|
|
295
|
+
`- API summary: ${sentence(api)}`,
|
|
296
|
+
`- Extension boundary: ${sentence(extensionSummary(component))}`,
|
|
297
|
+
`- Avoid: ${sentence(component.avoid)}`,
|
|
298
|
+
`- Consumer skill and call guidance: ${skillLink(component.skill, skillPathPrefix)}.`,
|
|
299
|
+
`- Detailed API, defaults, constraints, and examples: [${component.id}](${guideLinkPrefix}${guideFilename(component)}).`,
|
|
300
|
+
].join('\n')
|
|
301
|
+
})
|
|
302
|
+
const capabilities = (catalog.companionCapabilities ?? []).map((capability) => {
|
|
303
|
+
const importPath = capability.importPath ?? capability.package
|
|
304
|
+
return [
|
|
305
|
+
`### ${capability.id}`,
|
|
306
|
+
'',
|
|
307
|
+
`- Public import: \`${capability.imports.join(', ')}\` from \`${importPath}\`.`,
|
|
308
|
+
`- Use when: ${sentence(capability.useWhen)}`,
|
|
309
|
+
`- Lifecycle status: ${capability.lifecycleStatus}.`,
|
|
310
|
+
`- Avoid: ${sentence(capability.avoid)}`,
|
|
311
|
+
`- Consumer skill and call guidance: ${skillLink(capability.skill, skillPathPrefix)}.`,
|
|
312
|
+
].join('\n')
|
|
313
|
+
})
|
|
314
|
+
let sections = components.join('\n\n')
|
|
315
|
+
if (capabilities.length) {
|
|
316
|
+
sections = `${sections}\n\n## Companion capabilities\n\n${capabilities.join('\n\n')}`
|
|
317
|
+
}
|
|
318
|
+
return sections
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
function replaceMarkedSection(source, startMarker, endMarker, content) {
|
|
322
|
+
const start = source.indexOf(startMarker)
|
|
323
|
+
const end = source.indexOf(endMarker)
|
|
324
|
+
if (start < 0 || end < start)
|
|
325
|
+
throw new Error(`Component reference is missing markers ${startMarker} and ${endMarker}.`)
|
|
326
|
+
return `${source.slice(0, start + startMarker.length)}\n${content}\n${source.slice(end)}`
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export function renderComponentDirectoryDocument(source, catalog, options = {}) {
|
|
330
|
+
return replaceMarkedSection(
|
|
331
|
+
source,
|
|
332
|
+
componentDirectoryStart,
|
|
333
|
+
componentDirectoryEnd,
|
|
334
|
+
`\n${packageVersionPointer}\n\n${adminIntegrationExamplesPointer}\n\n${renderComponentDirectory(catalog, options)}\n`,
|
|
335
|
+
)
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export function renderComponentSelectionDocument(source, catalog, options = {}) {
|
|
339
|
+
const rows = renderComponentSelectionRows(catalog, options)
|
|
340
|
+
const tables = [
|
|
341
|
+
`## UI components\n\n| Use case | Public import | Skill | Extension surface | Avoid | Lifecycle |\n| --- | --- | --- | --- | --- | --- |\n${rows}`,
|
|
342
|
+
]
|
|
343
|
+
if (catalog.companionCapabilities?.length) {
|
|
344
|
+
const skillPathPrefix = options.skillPathPrefix ?? '../../'
|
|
345
|
+
const capabilities = catalog.companionCapabilities.map((capability) => {
|
|
346
|
+
const importPath = capability.importPath ?? capability.package
|
|
347
|
+
return `| ${tableCell(capability.useWhen)} | \`${capability.imports.join(', ')}\` from \`${importPath}\` | ${skillLink(capability.skill, skillPathPrefix)} | ${tableCell(capability.avoid)} | ${capability.lifecycleStatus} |`
|
|
348
|
+
})
|
|
349
|
+
tables.push(
|
|
350
|
+
`## Companion capabilities\n\n| Capability | Public import | Skill | Avoid | Lifecycle |\n| --- | --- | --- | --- | --- |\n${capabilities.join('\n')}`,
|
|
351
|
+
)
|
|
352
|
+
}
|
|
353
|
+
const table = `${packageVersionPointer}\n\n${adminIntegrationExamplesPointer}\n\n${tables.join('\n\n')}`
|
|
354
|
+
return replaceMarkedSection(source, componentCatalogStart, componentCatalogEnd, table)
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export async function formatTemplateFileContent(path, content) {
|
|
358
|
+
const config = (await prettier.resolveConfig(path)) ?? {}
|
|
359
|
+
return prettier.format(content, { ...config, filepath: path })
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
async function writeFormattedTemplateFile(path, content) {
|
|
363
|
+
await writeFile(path, await formatTemplateFileContent(path, content), 'utf8')
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export async function synchronizeTemplateComponentCatalog(templateRoot) {
|
|
367
|
+
const catalogPath = join(templateRoot, 'component-catalog.v2.json')
|
|
368
|
+
const catalog = JSON.parse(await readFile(catalogPath, 'utf8'))
|
|
369
|
+
const adminUsage = []
|
|
370
|
+
for (const usage of catalog.adminUsage ?? []) {
|
|
371
|
+
const evidence = []
|
|
372
|
+
for (const item of usage.evidence ?? []) {
|
|
373
|
+
const evidencePath = resolve(templateRoot, item.path)
|
|
374
|
+
const relativePath = relative(resolve(templateRoot), evidencePath)
|
|
375
|
+
if (
|
|
376
|
+
!relativePath ||
|
|
377
|
+
relativePath === '..' ||
|
|
378
|
+
relativePath.startsWith(`..${sep}`) ||
|
|
379
|
+
isAbsolute(relativePath)
|
|
380
|
+
) {
|
|
381
|
+
throw new Error(`Admin usage evidence escapes the template root: ${item.path}`)
|
|
382
|
+
}
|
|
383
|
+
if (!existsSync(evidencePath)) continue
|
|
384
|
+
if ((await readFile(evidencePath, 'utf8')).includes(item.match)) evidence.push(item)
|
|
385
|
+
}
|
|
386
|
+
if (evidence.length) adminUsage.push({ ...usage, evidence })
|
|
387
|
+
}
|
|
388
|
+
catalog.adminUsage = adminUsage
|
|
389
|
+
for (const capability of catalog.companionCapabilities ?? []) {
|
|
390
|
+
if (!capability.adminUsage) continue
|
|
391
|
+
const evidence = []
|
|
392
|
+
for (const item of capability.adminUsage.evidence ?? []) {
|
|
393
|
+
const evidencePath = resolve(templateRoot, item.path)
|
|
394
|
+
const relativePath = relative(resolve(templateRoot), evidencePath)
|
|
395
|
+
if (
|
|
396
|
+
!relativePath ||
|
|
397
|
+
relativePath === '..' ||
|
|
398
|
+
relativePath.startsWith(`..${sep}`) ||
|
|
399
|
+
isAbsolute(relativePath)
|
|
400
|
+
) {
|
|
401
|
+
throw new Error(`Admin usage evidence escapes the template root: ${item.path}`)
|
|
402
|
+
}
|
|
403
|
+
if (!existsSync(evidencePath)) continue
|
|
404
|
+
if ((await readFile(evidencePath, 'utf8')).includes(item.match)) evidence.push(item)
|
|
405
|
+
}
|
|
406
|
+
if (evidence.length) {
|
|
407
|
+
capability.adminUsage = { ...capability.adminUsage, evidence }
|
|
408
|
+
} else {
|
|
409
|
+
delete capability.adminUsage
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
const componentGuideRoot = join(templateRoot, 'docs', 'components')
|
|
414
|
+
await mkdir(componentGuideRoot, { recursive: true })
|
|
415
|
+
const guideSources = new Map()
|
|
416
|
+
for (const component of catalog.components) {
|
|
417
|
+
const sourceGuide = component.documentation?.guide
|
|
418
|
+
if (typeof sourceGuide !== 'string' || !sourceGuide) {
|
|
419
|
+
throw new Error(`${component.id}: consumer guide is required for the CLI template`)
|
|
420
|
+
}
|
|
421
|
+
const resolvedSource = resolve(REPOSITORY_ROOT, sourceGuide)
|
|
422
|
+
const relativeSource = relative(REPOSITORY_ROOT, resolvedSource)
|
|
423
|
+
if (
|
|
424
|
+
!relativeSource ||
|
|
425
|
+
relativeSource === '..' ||
|
|
426
|
+
relativeSource.startsWith(`..${sep}`) ||
|
|
427
|
+
isAbsolute(relativeSource)
|
|
428
|
+
) {
|
|
429
|
+
throw new Error(`${component.id}: consumer guide escapes the repository: ${sourceGuide}`)
|
|
430
|
+
}
|
|
431
|
+
if (!existsSync(resolvedSource)) {
|
|
432
|
+
throw new Error(`${component.id}: consumer guide is missing: ${sourceGuide}`)
|
|
433
|
+
}
|
|
434
|
+
const filename = basename(sourceGuide)
|
|
435
|
+
const previousSource = guideSources.get(filename)
|
|
436
|
+
if (previousSource && previousSource !== relativeSource) {
|
|
437
|
+
throw new Error(`${component.id}: consumer guide filename collides: ${filename}`)
|
|
438
|
+
}
|
|
439
|
+
if (!previousSource) {
|
|
440
|
+
const guideSourceText = await readFile(resolvedSource, 'utf8')
|
|
441
|
+
await writeFormattedTemplateFile(
|
|
442
|
+
join(componentGuideRoot, filename),
|
|
443
|
+
renderTemplateConsumerGuide(guideSourceText),
|
|
444
|
+
)
|
|
445
|
+
guideSources.set(filename, relativeSource)
|
|
446
|
+
}
|
|
447
|
+
component.documentation = {
|
|
448
|
+
...component.documentation,
|
|
449
|
+
guide: `docs/components/${filename}`,
|
|
450
|
+
}
|
|
451
|
+
delete component.documentation.readme
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
const sourceIndex = await readFile(
|
|
455
|
+
join(REPOSITORY_ROOT, 'apps', 'docs', 'components', 'index.md'),
|
|
456
|
+
'utf8',
|
|
457
|
+
)
|
|
458
|
+
const portableIndex = sourceIndex.replace(
|
|
459
|
+
'详见[包与运行时参考](/package-origen-ui)及[组件配置参考](/guide/component-config-reference)。',
|
|
460
|
+
'配套能力与 Admin 消费边界见项目根目录的 `component-catalog.v2.json` 和组件使用技能。',
|
|
461
|
+
)
|
|
462
|
+
await writeFormattedTemplateFile(
|
|
463
|
+
join(componentGuideRoot, 'index.md'),
|
|
464
|
+
renderTemplateConsumerGuide(portableIndex),
|
|
465
|
+
)
|
|
466
|
+
|
|
467
|
+
const legacyCatalogPath = join(templateRoot, 'component-catalog.json')
|
|
468
|
+
if (existsSync(legacyCatalogPath)) {
|
|
469
|
+
const legacyCatalog = JSON.parse(await readFile(legacyCatalogPath, 'utf8'))
|
|
470
|
+
for (const component of legacyCatalog.components ?? []) {
|
|
471
|
+
const current = catalog.components.find((item) => item.id === component.id)
|
|
472
|
+
if (current?.documentation) component.documentation = { ...current.documentation }
|
|
473
|
+
}
|
|
474
|
+
await writeFormattedTemplateFile(
|
|
475
|
+
legacyCatalogPath,
|
|
476
|
+
`${JSON.stringify(legacyCatalog, null, 2)}\n`,
|
|
477
|
+
)
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
await writeFormattedTemplateFile(catalogPath, `${JSON.stringify(catalog, null, 2)}\n`)
|
|
481
|
+
|
|
482
|
+
for (const skillRoot of skillRoots) {
|
|
483
|
+
const directoryPath = join(
|
|
484
|
+
templateRoot,
|
|
485
|
+
skillRoot,
|
|
486
|
+
'admin-component-usage',
|
|
487
|
+
'references',
|
|
488
|
+
'component-directory.md',
|
|
489
|
+
)
|
|
490
|
+
const selectionPath = join(
|
|
491
|
+
templateRoot,
|
|
492
|
+
skillRoot,
|
|
493
|
+
'build-admin-feature',
|
|
494
|
+
'references',
|
|
495
|
+
'component-selection.md',
|
|
496
|
+
)
|
|
497
|
+
if (existsSync(directoryPath)) {
|
|
498
|
+
const source = await readFile(directoryPath, 'utf8')
|
|
499
|
+
await writeFormattedTemplateFile(
|
|
500
|
+
directoryPath,
|
|
501
|
+
renderComponentDirectoryDocument(source, catalog, {
|
|
502
|
+
guideLinkPrefix: '../../../../docs/components/',
|
|
503
|
+
}),
|
|
504
|
+
)
|
|
505
|
+
}
|
|
506
|
+
if (existsSync(selectionPath)) {
|
|
507
|
+
const source = await readFile(selectionPath, 'utf8')
|
|
508
|
+
await writeFormattedTemplateFile(
|
|
509
|
+
selectionPath,
|
|
510
|
+
renderComponentSelectionDocument(source, catalog),
|
|
511
|
+
)
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Skills shipped to the Admin scaffold. This module is the single source of truth:
|
|
2
|
+
// the monorepo contract checker, the template validator and the scaffold exporter all
|
|
3
|
+
// read it, and the exporter copies this file into every generated project.
|
|
4
|
+
// Keep it import-free so the copy stays portable inside the template.
|
|
5
|
+
export const ADMIN_SKILL_NAMES = Object.freeze([
|
|
6
|
+
'admin-component-usage',
|
|
7
|
+
'build-admin-feature',
|
|
8
|
+
'use-og-http',
|
|
9
|
+
'use-og-table',
|
|
10
|
+
'use-og-search',
|
|
11
|
+
'use-og-form',
|
|
12
|
+
'use-og-editor',
|
|
13
|
+
'use-og-upload',
|
|
14
|
+
'use-og-form-table',
|
|
15
|
+
'use-og-dialog',
|
|
16
|
+
'use-og-router-tabs',
|
|
17
|
+
'style-og-origen-ui',
|
|
18
|
+
])
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { dirname, resolve } from 'node:path'
|
|
2
|
+
import { fileURLToPath } from 'node:url'
|
|
3
|
+
|
|
4
|
+
/** Absolute path to the repository root, independent of the caller's cwd. */
|
|
5
|
+
export const REPOSITORY_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '../..')
|
|
6
|
+
|
|
7
|
+
export function resolveRepositoryPath(...segments) {
|
|
8
|
+
return resolve(REPOSITORY_ROOT, ...segments)
|
|
9
|
+
}
|