@_tc/template-core 0.2.12 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.skills/tc-component-usage-skills/SKILL.md +7 -9
- package/.skills/tc-component-usage-skills/reference/component-api.md +2 -2
- package/.skills/tc-component-usage-skills/reference/examples.md +9 -9
- package/.skills/tc-component-usage-skills/reference/patterns.md +5 -5
- package/.skills/tc-component-usage-skills/reference/template-core-frontend.md +1 -1
- package/.skills/tc-generator/SKILL.md +30 -14
- package/.skills/tc-generator/reference/example.md +4 -4
- package/.skills/tc-generator/reference/model-schema.md +9 -5
- package/.skills/tc-generator/reference/runtime-extensions.md +9 -7
- package/AGENT_README.md +52 -33
- package/CHANGE.md +48 -5
- package/README.md +147 -46
- package/cjs/app/controller/ssr.js +1 -0
- package/cjs/app/controller/view.js +1 -1
- package/cjs/app/html/shell.js +36 -0
- package/cjs/app/middleware.js +1 -1
- package/cjs/app/router/ssr.js +1 -0
- package/cjs/app/router/view.js +1 -1
- package/cjs/app/ssr/html.js +17 -0
- package/cjs/app/ssr/manifest.js +2 -0
- package/cjs/app/view/entry.tpl +2 -37
- package/cjs/bundler/buildBE.js +1 -1
- package/cjs/bundler/buildSSR.js +1 -0
- package/cjs/bundler/entryCollect.js +1 -0
- package/cjs/bundler/feSharedConfig.js +1 -0
- package/cjs/bundler/index.js +1 -1
- package/cjs/bundler/ssrClientManifest.js +1 -0
- package/cjs/bundler/ssrEntries.js +1 -0
- package/cjs/bundler/utils.js +3 -3
- package/cjs/packages/common/i18n/index.js +1 -1
- package/cjs/packages/common/index.js +1 -1
- package/cjs/packages/common/ssr/hydration.js +1 -0
- package/cjs/packages/common/ssr/index.js +1 -0
- package/cjs/packages/core/index.js +1 -1
- package/cjs/packages/core/loader/controller.js +1 -1
- package/cjs/packages/core/loader/extend.js +1 -1
- package/cjs/packages/core/loader/merge.js +1 -0
- package/cjs/packages/core/loader/middleware.js +1 -1
- package/cjs/packages/core/loader/model.js +1 -1
- package/cjs/packages/core/loader/router-schema.js +1 -1
- package/cjs/packages/core/loader/router.js +1 -1
- package/cjs/packages/core/loader/service.js +1 -1
- package/cjs/packages/core/paths.js +1 -1
- package/cjs/scripts/vite-build/build.js +3 -3
- package/cjs/scripts/vite-build/collect.js +1 -1
- package/cjs/scripts/vite-build/dts.js +1 -1
- package/cjs/scripts/vite-build/normalize.js +1 -1
- package/cjs/ssrSharedData/outputPaths.js +1 -0
- package/esm/app/controller/ssr.js +215 -0
- package/esm/app/controller/view.js +26 -25
- package/esm/app/html/shell.js +69 -0
- package/esm/app/middleware.js +18 -9
- package/esm/app/router/ssr.js +8 -0
- package/esm/app/router/view.js +5 -4
- package/esm/app/ssr/html.js +90 -0
- package/esm/app/ssr/manifest.js +47 -0
- package/esm/app/view/entry.tpl +2 -37
- package/esm/bundler/buildBE.js +1 -1
- package/esm/bundler/buildSSR.js +126 -0
- package/esm/bundler/entryCollect.js +45 -0
- package/esm/bundler/feSharedConfig.js +143 -0
- package/esm/bundler/index.js +4 -2
- package/esm/bundler/ssrClientManifest.js +14 -0
- package/esm/bundler/ssrEntries.js +13 -0
- package/esm/bundler/utils.js +248 -255
- package/esm/packages/common/i18n/index.js +5 -1
- package/esm/packages/common/index.js +4 -2
- package/esm/packages/common/ssr/hydration.js +55 -0
- package/esm/packages/common/ssr/index.js +20 -0
- package/esm/packages/core/index.js +42 -42
- package/esm/packages/core/loader/controller.js +11 -9
- package/esm/packages/core/loader/extend.js +20 -16
- package/esm/packages/core/loader/merge.js +7 -0
- package/esm/packages/core/loader/middleware.js +11 -12
- package/esm/packages/core/loader/model.js +2 -2
- package/esm/packages/core/loader/router-schema.js +22 -15
- package/esm/packages/core/loader/router.js +32 -26
- package/esm/packages/core/loader/service.js +11 -9
- package/esm/packages/core/paths.js +9 -1
- package/esm/scripts/vite-build/build.js +88 -83
- package/esm/scripts/vite-build/collect.js +31 -27
- package/esm/scripts/vite-build/dts.js +1 -1
- package/esm/scripts/vite-build/normalize.js +6 -3
- package/esm/ssrSharedData/outputPaths.js +33 -0
- package/fe/frontend/apps/dash/Dashboard.d.ts +5 -1
- package/fe/frontend/apps/dash/Dashboard.js +22 -13
- package/fe/frontend/apps/dash/types.d.ts +2 -0
- package/fe/frontend/src/api/baseInfo.d.ts +1 -1
- package/fe/frontend/src/common/CRUD/CRUD.js +1 -1
- package/fe/frontend/src/common/CRUD/index.js +1 -1
- package/fe/frontend/src/common/menu.d.ts +1 -1
- package/fe/frontend/src/common/menu.js +8 -7
- package/fe/frontend/src/common/request.js +1 -1
- package/fe/frontend/src/common/schemaForm.d.ts +1 -0
- package/fe/frontend/src/common/schemaForm.js +12 -0
- package/fe/frontend/src/components/AsyncSelect/AsyncSelect.d.ts +1 -1
- package/fe/frontend/src/components/Router/basename.d.ts +3 -0
- package/fe/frontend/src/components/Router/basename.js +11 -0
- package/fe/frontend/src/components/Router/index.d.ts +1 -1
- package/fe/frontend/src/components/Router/index.js +3 -1
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/builtIn.d.ts +1 -1
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaTable/data.d.ts +1 -1
- package/fe/frontend/src/defaultPages/SchemaPage/schemaType.d.ts +2 -2
- package/fe/frontend/src/defaultPages/SchemaPage/utils/schemaConversion.d.ts +1 -1
- package/fe/frontend/src/defaultPages/SidebarSlotPage/SidebarSlotContainer.d.ts +2 -1
- package/fe/frontend/src/defaultPages/SidebarSlotPage/SidebarSlotContainer.js +8 -4
- package/fe/frontend/src/defaultPages/SidebarSlotPageTmp.js +2 -1
- package/fe/frontend/src/exportStore.js +2 -2
- package/fe/frontend/src/hooks/useCurrentMenuData.d.ts +1 -1
- package/fe/frontend/src/hooks/useCurrentMenuData.js +2 -2
- package/fe/frontend/src/hooks/useRouterParams.js +4 -3
- package/fe/frontend/src/index.d.ts +1 -0
- package/fe/frontend/src/index.js +4 -3
- package/fe/frontend/src/main.js +2 -0
- package/fe/frontend/src/stores/mode.d.ts +15 -2
- package/fe/frontend/src/stores/mode.js +19 -5
- package/fe/frontend/src/typing/window.d.ts +2 -0
- package/fe/packages/common/LRUCache.js +2 -0
- package/fe/packages/common/array/index.js +37 -0
- package/fe/packages/common/cache/index.js +2 -0
- package/fe/packages/common/guards/index.js +19 -1
- package/fe/packages/common/http/index.js +1 -1
- package/fe/packages/common/i18n/index.js +8 -4
- package/fe/packages/common/i18n/locales.js +1 -1
- package/fe/packages/common/i18n/types.d.ts +1 -0
- package/fe/packages/common/i18n/types.js +0 -0
- package/fe/packages/common/index.d.ts +1 -0
- package/fe/packages/common/index.js +17 -0
- package/fe/packages/common/log/index.js +146 -0
- package/fe/packages/common/number/index.js +11 -0
- package/fe/packages/common/object/filterEmpty.js +2 -1
- package/fe/packages/common/object/filtereEmpty.js +2 -0
- package/fe/packages/common/object/index.js +20 -0
- package/fe/packages/common/ssr/hydration.d.ts +23 -0
- package/fe/packages/common/ssr/hydration.js +88 -0
- package/fe/packages/common/ssr/index.d.ts +8 -0
- package/fe/packages/common/ssr/index.js +52 -0
- package/fe/packages/common/string/index.js +32 -0
- package/fe/packages/common/types/index.js +0 -0
- package/fe/packages/react/hooks/index.d.ts +2 -0
- package/fe/packages/react/hooks/index.js +3 -1
- package/fe/packages/react/hooks/useHydrationData.d.ts +2 -0
- package/fe/packages/react/hooks/useHydrationData.js +23 -0
- package/fe/packages/react/hooks/useSSR.d.ts +6 -0
- package/fe/packages/react/hooks/useSSR.js +46 -0
- package/fe/packages/react/ui/components/DataTable/index.js +16 -15
- package/fe/packages/react/ui/components/Form/SchemaForm/data.d.ts +3 -2
- package/fe/packages/react/ui/components/Form/SchemaForm/data.js +5 -6
- package/fe/packages/react/ui/components/Form/SchemaForm/index.d.ts +1 -0
- package/fe/packages/react/ui/components/Form/SchemaForm/index.js +2 -2
- package/fe/packages/react/ui/components/Form/index.js +2 -1
- package/fe/packages/react/ui/components/Input/Input.js +5 -1
- package/fe/packages/react/ui/components/Popup/Popup.js +6 -1
- package/fe/packages/react/ui/components/index.js +2 -1
- package/fe/packages/react/ui/components/testPage/demos/core/DataTableDemo.js +241 -211
- package/fe/packages/react/ui/components/testPage/demos/core/DataTableDemo2.js +1 -1
- package/fe/packages/react/ui/i18n/I18nProvider.js +4 -0
- package/fe/packages/react/ui/index.js +2 -1
- package/fe/ssr/apps/dash/dash.entry.d.ts +13 -0
- package/fe/ssr/apps/dash/dash.entry.js +162 -0
- package/fe/ssr/apps/demo/demo.entry.d.ts +13 -0
- package/fe/ssr/apps/demo/demo.entry.js +38 -0
- package/fe/ssr/apps/server-data/server-data.entry.d.ts +26 -0
- package/fe/ssr/apps/server-data/server-data.entry.js +275 -0
- package/fe/ssr/apps/ui-components/ui-components.entry.d.ts +5 -0
- package/fe/ssr/apps/ui-components/ui-components.entry.js +17 -0
- package/fe/ssr/components/StreamingRender/StreamingCache.d.ts +2 -0
- package/fe/ssr/components/StreamingRender/StreamingCache.js +31 -0
- package/fe/ssr/components/StreamingRender/StreamingRender.d.ts +3 -0
- package/fe/ssr/components/StreamingRender/StreamingRender.js +48 -0
- package/fe/ssr/components/StreamingRender/StreamingScript.d.ts +8 -0
- package/fe/ssr/components/StreamingRender/StreamingScript.js +58 -0
- package/fe/ssr/components/StreamingRender/index.d.ts +4 -0
- package/fe/ssr/components/StreamingRender/index.js +5 -0
- package/fe/ssr/components/StreamingRender/type.d.ts +9 -0
- package/fe/ssr/components/StreamingRender/type.js +0 -0
- package/fe/ssr/components/index.d.ts +2 -0
- package/fe/ssr/components/index.js +2 -0
- package/fe/ssr/createSSREntry.d.ts +6 -0
- package/fe/ssr/createSSREntry.js +42 -0
- package/fe/ssr/hooks/index.d.ts +1 -0
- package/fe/ssr/hooks/index.js +2 -0
- package/fe/ssr/hooks/useSuspensePromise.d.ts +1 -0
- package/fe/ssr/hooks/useSuspensePromise.js +31 -0
- package/fe/ssr/index.d.ts +4 -0
- package/fe/ssr/index.js +6 -0
- package/fe/ssr/types.d.ts +13 -0
- package/fe/ssr/types.js +0 -0
- package/{model → models}/frontend/src/typing/window.d.ts +2 -0
- package/{model → models}/packages/common/i18n/types.d.ts +1 -0
- package/{model → models}/packages/common/index.d.ts +1 -0
- package/models/packages/common/ssr/hydration.d.ts +23 -0
- package/models/packages/common/ssr/index.d.ts +8 -0
- package/{model → models}/packages/react/ui/components/Form/SchemaForm/data.d.ts +3 -2
- package/{model → models}/packages/react/ui/components/Form/SchemaForm/index.d.ts +1 -0
- package/package.json +43 -6
- package/types/app/controller/ssr.d.ts +14 -0
- package/types/app/html/shell.d.ts +101 -0
- package/types/app/router/ssr.d.ts +6 -0
- package/types/app/ssr/html.d.ts +53 -0
- package/types/app/ssr/manifest.d.ts +17 -0
- package/types/app/typings.d.ts +2 -0
- package/types/bundler/buildSSR.d.ts +56 -0
- package/types/bundler/entryCollect.d.ts +36 -0
- package/types/bundler/feSharedConfig.d.ts +35 -0
- package/types/bundler/index.d.ts +4 -0
- package/types/bundler/ssrClientManifest.d.ts +4 -0
- package/types/bundler/ssrEntries.d.ts +23 -0
- package/types/bundler/state.d.ts +2 -2
- package/types/bundler/utils.d.ts +35 -2
- package/types/config/config.default.d.ts +10 -0
- package/types/packages/common/i18n/types.d.ts +2 -0
- package/types/packages/common/index.d.ts +1 -0
- package/types/packages/common/ssr/hydration.d.ts +72 -0
- package/types/packages/common/ssr/index.d.ts +34 -0
- package/types/packages/core/loader/merge.d.ts +3 -0
- package/types/packages/core/loader/model.d.ts +2 -2
- package/types/packages/core/paths.d.ts +5 -0
- package/types/packages/core/types.d.ts +10 -1
- package/types/scripts/vite-build/build.d.ts +1 -0
- package/types/scripts/vite-build/types.d.ts +3 -0
- package/types/ssrSharedData/outputPaths.d.ts +59 -0
- package/fe/packages/react/hooks/useWatch.test.js +0 -24
- package/fe/packages/react/ui/assets/table/no-result.js +0 -4
- package/fe/packages/react/ui/components/DataTable/dataTableWidth.test.js +0 -39
- package/fe/packages/react/ui/components/InputNumber/inputNumberUtils.test.js +0 -59
- /package/.skills/tc-generator/reference/project-template/{model → models}/product/mode.js +0 -0
- /package/.skills/tc-generator/reference/project-template/{model → models}/product/project/default.js +0 -0
- /package/fe/{model → models}/types/data/button.d.ts +0 -0
- /package/fe/{model → models}/types/data/component.d.ts +0 -0
- /package/fe/{model → models}/types/data/fetchInfo.d.ts +0 -0
- /package/fe/{model → models}/types/data/schema.d.ts +0 -0
- /package/fe/{model → models}/types/data/search.d.ts +0 -0
- /package/fe/{model → models}/types/index.d.ts +0 -0
- /package/fe/{model → models}/types/menuType.d.ts +0 -0
- /package/fe/{model → models}/types/model.d.ts +0 -0
- /package/{model → models}/frontend/extended/SchemaForm/data.d.ts +0 -0
- /package/{model → models}/frontend/src/common/auth/index.d.ts +0 -0
- /package/{model → models}/frontend/src/common/fetchErrorShow.d.ts +0 -0
- /package/{model → models}/frontend/src/common/language.d.ts +0 -0
- /package/{model → models}/frontend/src/common/logFn/index.d.ts +0 -0
- /package/{model → models}/frontend/src/common/request.d.ts +0 -0
- /package/{model → models}/frontend/src/components/AsyncSelect/AsyncSelect.d.ts +0 -0
- /package/{model → models}/frontend/src/components/AsyncSelect/index.d.ts +0 -0
- /package/{model → models}/frontend/src/defaultPages/SchemaPage/components/CallCom/DetailPanel.d.ts +0 -0
- /package/{model → models}/frontend/src/defaultPages/SchemaPage/components/CallCom/PopFrom.d.ts +0 -0
- /package/{model → models}/frontend/src/defaultPages/SchemaPage/components/CallCom/builtIn.d.ts +0 -0
- /package/{model → models}/frontend/src/defaultPages/SchemaPage/data/eventInfo.d.ts +0 -0
- /package/{model → models}/frontend/src/defaultPages/SchemaPage/data/index.d.ts +0 -0
- /package/{model → models}/frontend/src/defaultPages/SchemaPage/hooks/useComConfig.d.ts +0 -0
- /package/{model → models}/frontend/src/defaultPages/SchemaPage/schemaType.d.ts +0 -0
- /package/{model → models}/frontend/src/defaultPages/SchemaPage/utils/permissions.d.ts +0 -0
- /package/{model → models}/frontend/src/defaultPages/SchemaPage/utils/validator.d.ts +0 -0
- /package/{model → models}/frontend/src/hooks/useText.d.ts +0 -0
- /package/{model → models}/frontend/src/language/en-US.d.ts +0 -0
- /package/{model → models}/frontend/src/language/index.d.ts +0 -0
- /package/{model → models}/frontend/src/language/resources.d.ts +0 -0
- /package/{model → models}/frontend/src/language/zh-CN.d.ts +0 -0
- /package/{model → models}/frontend/src/stores/apiFreezer.d.ts +0 -0
- /package/{model → models}/frontend/src/stores/schemaEventBus.d.ts +0 -0
- /package/{model → models}/frontend/src/stores/schemaStore.d.ts +0 -0
- /package/{model → models}/frontend/src/typing/scalability.d.ts +0 -0
- /package/{model/model → models/models}/index.d.ts +0 -0
- /package/{model/model → models/models}/test.d.ts +0 -0
- /package/{model/model → models/models}/types/data/button.d.ts +0 -0
- /package/{model/model → models/models}/types/data/component.d.ts +0 -0
- /package/{model/model → models/models}/types/data/fetchInfo.d.ts +0 -0
- /package/{model/model → models/models}/types/data/schema.d.ts +0 -0
- /package/{model/model → models/models}/types/data/search.d.ts +0 -0
- /package/{model/model → models/models}/types/index.d.ts +0 -0
- /package/{model/model → models/models}/types/menuType.d.ts +0 -0
- /package/{model/model → models/models}/types/model.d.ts +0 -0
- /package/{model → models}/packages/common/array/index.d.ts +0 -0
- /package/{model → models}/packages/common/cache/LRUCache.d.ts +0 -0
- /package/{model → models}/packages/common/cache/index.d.ts +0 -0
- /package/{model → models}/packages/common/guards/index.d.ts +0 -0
- /package/{model → models}/packages/common/http/index.d.ts +0 -0
- /package/{model → models}/packages/common/i18n/default.d.ts +0 -0
- /package/{model → models}/packages/common/i18n/en-US.d.ts +0 -0
- /package/{model → models}/packages/common/i18n/index.d.ts +0 -0
- /package/{model → models}/packages/common/i18n/locales.d.ts +0 -0
- /package/{model → models}/packages/common/log/index.d.ts +0 -0
- /package/{model → models}/packages/common/number/index.d.ts +0 -0
- /package/{model → models}/packages/common/object/filterEmpty.d.ts +0 -0
- /package/{model → models}/packages/common/object/index.d.ts +0 -0
- /package/{model → models}/packages/common/rafTimer.d.ts +0 -0
- /package/{model → models}/packages/common/string/index.d.ts +0 -0
- /package/{model → models}/packages/common/types/index.d.ts +0 -0
- /package/{model → models}/packages/react/hooks/useBreadcrumb.d.ts +0 -0
- /package/{model → models}/packages/react/hooks/useExecuteOnce.d.ts +0 -0
- /package/{model → models}/packages/react/hooks/useLanguage.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Button/Button.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Button/SubmitButton.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Button/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Card/Card.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Card/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Checkbox/Checkbox.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Checkbox/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/ConfirmDialog/ConfirmDialog.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/ConfirmDialog/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/DataTable/ActionBtn.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/DataTable/dataTableWidth.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/DataTable/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Date/Calendar.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Date/Date.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Date/LocaleContext.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Date/LocaleProvider.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Date/TimePicker.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Date/data.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Date/dateLocaleStore.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Date/dropdownPositioning.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Date/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Date/locales.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Drawer/Drawer.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Drawer/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Dropdown/Dropdown.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Dropdown/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Form/Form.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Form/FormItem.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Form/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Form/useForm.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/ImagePreview/ImagePreview.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/ImagePreview/PreviewImage.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/ImagePreview/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Input/Input.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Input/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/InputNumber/InputNumber.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/InputNumber/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/InputNumber/inputNumberUtils.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Label/Label.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Label/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Layout/Layout.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Layout/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Loading/Loading.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Loading/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Menu/Menu.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Menu/MenuContext.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Menu/MenuItem.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Menu/SubMenu.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Menu/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Menu/menuTypes.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Menu/utils.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Message/Message.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Message/MessageManager.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Message/data.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Message/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Modal/Modal.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Modal/ModalManager.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Modal/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Notification/Notification.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Notification/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Overlay/Overlay.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Overlay/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Pagination/Pagination.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Pagination/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Popup/Popup.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Popup/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Radio/Radio.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Radio/RadioGroup.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Radio/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Search/Search.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Search/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Select/Select.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Select/dropdownPositioning.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Select/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Skeleton/Skeleton.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Skeleton/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Switch/Switch.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Switch/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/TableSearch/TableSearch.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/TableSearch/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/TableSearch/lang.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/TableSearch/tableSearchLocaleStore.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Tabs/Tabs.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Tabs/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Textarea/Textarea.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Textarea/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Tooltip/Tooltip.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Tooltip/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/TreeSelect/TreeSelect.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/TreeSelect/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Upload/ImageUpload.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Upload/Upload.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/Upload/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/breadcrumb/breadcrumb.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/breadcrumb/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/hooks/useDropdownPositioning.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/hooks/useInputController.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/table/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/table/table.d.ts +0 -0
- /package/{model → models}/packages/react/ui/components/types/baseType.d.ts +0 -0
- /package/{model → models}/packages/react/ui/i18n/I18nProvider.d.ts +0 -0
- /package/{model → models}/packages/react/ui/i18n/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/i18n/useI18n.d.ts +0 -0
- /package/{model → models}/packages/react/ui/index.d.ts +0 -0
- /package/{model → models}/packages/react/ui/lib/createStoreHook.d.ts +0 -0
- /package/{model → models}/packages/react/ui/lib/export.d.ts +0 -0
- /package/{model → models}/packages/react/ui/lib/utils.d.ts +0 -0
- /package/{model → models}/packages/react/ui/stores/breadcrumb.d.ts +0 -0
- /package/{model → models}/packages/react/ui/stores/language.d.ts +0 -0
- /package/{model → models}/packages/react/ui/types/index.d.ts +0 -0
- /package/{model → models}/typings/type.d.ts +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type EntryMap = Record<string, string>;
|
|
2
|
+
export type SSREntriesMode = 'merge' | 'replace';
|
|
3
|
+
export type SSREntriesConfig = EntryMap;
|
|
4
|
+
export interface SSREntriesOptions {
|
|
5
|
+
baseDir?: string;
|
|
6
|
+
ssrEntries?: SSREntriesConfig;
|
|
7
|
+
ssrEntriesMode?: SSREntriesMode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 判断入口文件是否位于根级 ssr/apps 目录。
|
|
11
|
+
*/
|
|
12
|
+
export declare const isSSRAppsPath: (filePath: string) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* 从 *.entry.* 文件名中提取入口名。
|
|
15
|
+
*/
|
|
16
|
+
export declare const toEntryName: (filePath: string) => string;
|
|
17
|
+
/**
|
|
18
|
+
* 收集非 SSR 的 CSR 入口文件。
|
|
19
|
+
*/
|
|
20
|
+
export declare function collectCSREntryFiles(scanPaths: string[]): string[];
|
|
21
|
+
/**
|
|
22
|
+
* 收集 SSR 入口文件。
|
|
23
|
+
*/
|
|
24
|
+
export declare function collectSSREntryFiles(scanPaths: string[]): string[];
|
|
25
|
+
/**
|
|
26
|
+
* 将入口文件列表转换成 Vite input map。
|
|
27
|
+
*/
|
|
28
|
+
export declare function createEntryMap(files: string[]): EntryMap;
|
|
29
|
+
/**
|
|
30
|
+
* 标准化用户传入的 ssrEntries 配置。
|
|
31
|
+
*/
|
|
32
|
+
export declare function normalizeConfiguredSSREntries(options?: SSREntriesOptions): EntryMap;
|
|
33
|
+
/**
|
|
34
|
+
* 合并自动扫描和显式配置的 SSR entries。
|
|
35
|
+
*/
|
|
36
|
+
export declare function collectSSREntries(scanPaths: string[], options?: SSREntriesOptions): EntryMap;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { PluginOption } from "vite";
|
|
2
|
+
import { type ResolveFEOutDirOptions } from "../ssrSharedData/outputPaths";
|
|
3
|
+
export interface BundlerPaths {
|
|
4
|
+
currentDir: string;
|
|
5
|
+
frameNodePath: string;
|
|
6
|
+
framePackagePath: string;
|
|
7
|
+
frameFEPath: string;
|
|
8
|
+
frameSSRPath: string;
|
|
9
|
+
frameSSRAppsPath: string;
|
|
10
|
+
frameReactUIPath: string;
|
|
11
|
+
frameReactHooksPath: string;
|
|
12
|
+
frameCommonPath: string;
|
|
13
|
+
hasFramePublishedSSREntries: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 从当前框架包位置推导源码态/发布态路径。
|
|
17
|
+
*/
|
|
18
|
+
export declare function createBundlerPaths(): BundlerPaths;
|
|
19
|
+
/**
|
|
20
|
+
* 从当前包位置解析依赖包目录,保证框架和业务使用同一份依赖。
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolvePackageDir(packageName: string): string;
|
|
23
|
+
export declare function createReactResolveAlias(): Record<string, string>;
|
|
24
|
+
export declare function resolveAliasWithFallback(aliasList: [aliasName: string, aliasPath: string, basePath: string, fallbackPath?: string][], paths: Pick<BundlerPaths, 'currentDir'>): Record<string, string>;
|
|
25
|
+
export declare function createScalabilityAliases(runFEPath: string, paths: Pick<BundlerPaths, 'currentDir' | 'frameFEPath'>): Record<string, string>;
|
|
26
|
+
export declare function createFECompatibleResolveAlias(options: {
|
|
27
|
+
runFEPath: string;
|
|
28
|
+
paths: BundlerPaths;
|
|
29
|
+
includeSourceOnlyAliases?: boolean;
|
|
30
|
+
}): Record<string, string>;
|
|
31
|
+
export declare function createCSRResolveAlias(paths: BundlerPaths, options?: ResolveFEOutDirOptions): Record<string, string>;
|
|
32
|
+
export declare function createSSRResolveAlias(paths: BundlerPaths, options?: ResolveFEOutDirOptions): Record<string, string>;
|
|
33
|
+
export declare const ssrReactExternal: string[];
|
|
34
|
+
export declare function createSSRNoExternal(paths: Pick<BundlerPaths, 'framePackagePath'>, extraNoExternal?: string[]): string[];
|
|
35
|
+
export declare function createFEBasePlugins(): PluginOption[];
|
package/types/bundler/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export { buildBE } from "./buildBE";
|
|
2
2
|
export type { BuildBEAlias, BuildBEFormat, BuildBEOptions, BuildBEResult } from "./buildBE";
|
|
3
3
|
export { buildFE } from "./buildFE";
|
|
4
|
+
export { buildSSR, ssrClientOutDir, ssrEntries, ssrManifestOutDir, ssrServerOutDir, watchSSRFiles } from "./buildSSR";
|
|
5
|
+
export type { BuildSSROptions, WatchSSRFilesOptions } from "./buildSSR";
|
|
6
|
+
export { resolveFEOutDir } from "./utils";
|
|
7
|
+
export type { FEOutDirOutput, ResolveFEOutDirOptions } from "./utils";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ResolveFEOutDirOptions } from "../ssrSharedData/outputPaths";
|
|
2
|
+
import { type SSREntriesConfig, type SSREntriesMode } from "./entryCollect";
|
|
3
|
+
import type { BundlerPaths } from "./feSharedConfig";
|
|
4
|
+
export interface BundlerSSREntriesOptions extends ResolveFEOutDirOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Additional or replacement SSR entry map.
|
|
7
|
+
*/
|
|
8
|
+
ssrEntries?: SSREntriesConfig;
|
|
9
|
+
/**
|
|
10
|
+
* - merge: auto-discovered entries + configured entries, configured wins.
|
|
11
|
+
* - replace: only configured entries are used.
|
|
12
|
+
*/
|
|
13
|
+
ssrEntriesMode?: SSREntriesMode;
|
|
14
|
+
}
|
|
15
|
+
export interface CollectBundlerSSREntriesLogOptions {
|
|
16
|
+
enabled?: boolean;
|
|
17
|
+
emptyMessage?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 扫描业务和框架 ssr/apps/ 下的 .entry.* 文件。
|
|
21
|
+
* 默认同时合并框架和业务入口;重名时业务优先。
|
|
22
|
+
*/
|
|
23
|
+
export declare function collectBundlerSSREntries(bundlerPaths: Pick<BundlerPaths, 'frameSSRAppsPath'>, options?: BundlerSSREntriesOptions, logOptions?: CollectBundlerSSREntriesLogOptions): Record<string, string>;
|
package/types/bundler/state.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ResolveFEOutDirOptions } from "../ssrSharedData/outputPaths";
|
|
2
|
+
export interface BuildFEOptions extends ResolveFEOutDirOptions {
|
|
2
3
|
/**
|
|
3
4
|
* - frame
|
|
4
5
|
* - The build output will be placed under node_modules/.../app/public.
|
|
@@ -10,7 +11,6 @@ export interface BuildFEOptions {
|
|
|
10
11
|
* - Function
|
|
11
12
|
* - Maybe you really do not need it.
|
|
12
13
|
*/
|
|
13
|
-
output?: 'frame' | 'run' | (() => string);
|
|
14
14
|
/**
|
|
15
15
|
* Compress the html content emitted by Vite before writing final `.tpl` / `.html` files.
|
|
16
16
|
*/
|
package/types/bundler/utils.d.ts
CHANGED
|
@@ -1,14 +1,47 @@
|
|
|
1
1
|
import { Plugin } from "vite";
|
|
2
|
+
import { resolveRunPath, type ResolveFEOutDirOptions } from "../ssrSharedData/outputPaths";
|
|
3
|
+
export type { FEOutDirOutput, ResolveFEOutDirOptions } from "../ssrSharedData/outputPaths";
|
|
4
|
+
export { resolveRunPath };
|
|
5
|
+
/**
|
|
6
|
+
* 兼容旧 bundler 入口的 FE dist 目录解析函数。
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveFEOutDir(options?: ResolveFEOutDirOptions): string;
|
|
2
9
|
/**
|
|
3
10
|
*
|
|
4
11
|
* 寻找 frontend\/**\/*.entry.[j|t]s(x)?
|
|
5
12
|
* 生成入口
|
|
6
13
|
*/
|
|
7
|
-
export declare function entries(): Record<string, string>;
|
|
14
|
+
export declare function entries(options?: ResolveFEOutDirOptions): Record<string, string>;
|
|
8
15
|
export declare function outDir(): string;
|
|
9
16
|
export declare const watchFiles: (callback?: () => Promise<any>) => Promise<void>;
|
|
10
17
|
/**
|
|
11
18
|
* 打包完成后触发
|
|
12
19
|
*/
|
|
13
20
|
export declare function generateBuildKeyPlugin(): Plugin;
|
|
14
|
-
|
|
21
|
+
/**
|
|
22
|
+
* 创建 CSR/SSR 复用的 FE chunk 分组规则。
|
|
23
|
+
*/
|
|
24
|
+
export declare const createFECodeSplittingGroups: () => ({
|
|
25
|
+
name: string;
|
|
26
|
+
test: (moduleId: string) => boolean;
|
|
27
|
+
maxSize: number;
|
|
28
|
+
priority: number;
|
|
29
|
+
minShareCount?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
name: string;
|
|
32
|
+
test: (moduleId: string) => boolean;
|
|
33
|
+
maxSize: number;
|
|
34
|
+
minShareCount: number;
|
|
35
|
+
priority: number;
|
|
36
|
+
})[];
|
|
37
|
+
export interface VBuildFEOptions {
|
|
38
|
+
/**
|
|
39
|
+
* SSR hydration entries to include in the same browser build.
|
|
40
|
+
*/
|
|
41
|
+
ssrInput?: Record<string, string>;
|
|
42
|
+
/**
|
|
43
|
+
* Private output directory for the client manifest used by SSR rendering.
|
|
44
|
+
*/
|
|
45
|
+
ssrManifestOutDir?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare const VBuildFE: (input: Record<string, string>, OperatingEnv?: "dev" | "prod", options?: VBuildFEOptions) => Promise<void>;
|
|
@@ -45,6 +45,16 @@ export interface DefaultAppConfig {
|
|
|
45
45
|
* @default 5 * 60 * 1000
|
|
46
46
|
*/
|
|
47
47
|
resourceCacheTimeMs?: number;
|
|
48
|
+
/**
|
|
49
|
+
* SSR 运行时配置。
|
|
50
|
+
*/
|
|
51
|
+
ssr?: {
|
|
52
|
+
/**
|
|
53
|
+
* 是否在 SSR 错误页输出详细异常信息。
|
|
54
|
+
* 默认 local 环境输出,非 local 环境隐藏。
|
|
55
|
+
*/
|
|
56
|
+
exposeErrorDetails?: boolean;
|
|
57
|
+
};
|
|
48
58
|
/**
|
|
49
59
|
* 登陆验证相关
|
|
50
60
|
*/
|
|
@@ -76,6 +76,8 @@ export type I18nTranslator = <T = string>(key: string, fillingData?: I18nInterpo
|
|
|
76
76
|
export interface I18nActions {
|
|
77
77
|
/** 设置当前展示语言。 */
|
|
78
78
|
setLanguage: (language: I18nLanguage) => void;
|
|
79
|
+
/** 从本地缓存恢复语言,通常在客户端挂载后调用。 */
|
|
80
|
+
hydrateStoredLanguage: () => void;
|
|
79
81
|
/** 设置兜底语言。 */
|
|
80
82
|
setFallbackLanguage: (language: I18nLanguage) => void;
|
|
81
83
|
/** 批量设置多语言资源,可选择替换或合并。 */
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SSR Hydration 注水协议
|
|
3
|
+
*
|
|
4
|
+
* 服务端渲染时,将初始数据序列化为 base64 后注入到 HTML 中:
|
|
5
|
+
* <script>window.__SSR_DATA__ = "..."</script>
|
|
6
|
+
*
|
|
7
|
+
* 客户端 hydration 时,从 window.__SSR_DATA__ 解码恢复状态。
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* 注水数据结构
|
|
11
|
+
*/
|
|
12
|
+
export interface SSRHydrationData<Props = Record<string, unknown>, State = Record<string, unknown>> {
|
|
13
|
+
/** 页面组件 props */
|
|
14
|
+
props: Props;
|
|
15
|
+
/** 初始 store 状态(可选) */
|
|
16
|
+
state: State;
|
|
17
|
+
/** 页面元信息 */
|
|
18
|
+
meta: SSRPageMeta;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 页面元信息
|
|
22
|
+
*/
|
|
23
|
+
export interface SSRPageMeta {
|
|
24
|
+
/** 页面标题 */
|
|
25
|
+
title?: string;
|
|
26
|
+
/** 页面描述 */
|
|
27
|
+
description?: string;
|
|
28
|
+
/** 渲染时间戳(服务端生成) */
|
|
29
|
+
renderedAt: number;
|
|
30
|
+
/** 请求路径 */
|
|
31
|
+
pathname: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 全局注水数据的 key
|
|
35
|
+
*/
|
|
36
|
+
export declare const SSR_DATA_KEY = "__SSR_DATA__";
|
|
37
|
+
/**
|
|
38
|
+
* 声明 window 上的注水数据类型
|
|
39
|
+
*/
|
|
40
|
+
declare global {
|
|
41
|
+
interface Window {
|
|
42
|
+
[SSR_DATA_KEY]?: SSRHydrationData | string;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 服务端:将注水数据序列化为 inline script 内容。
|
|
47
|
+
* 数据内容以 base64 字符串注入,避免在 HTML 中明文暴露 JSON。
|
|
48
|
+
*/
|
|
49
|
+
export declare function serializeHydrationDataScriptContent(data: SSRHydrationData): string;
|
|
50
|
+
/**
|
|
51
|
+
* 服务端:将注水数据序列化为 script 标签。
|
|
52
|
+
*/
|
|
53
|
+
export declare function serializeHydrationData(data: SSRHydrationData): string;
|
|
54
|
+
/**
|
|
55
|
+
* 客户端:从 window 查看注水数据
|
|
56
|
+
* 不会清除全局数据,适合入口工厂与组件 hook 在同一次 hydration 中共享。
|
|
57
|
+
*/
|
|
58
|
+
export declare function peekHydrationData<Props = Record<string, unknown>, State = Record<string, unknown>>(): SSRHydrationData<Props, State> | null;
|
|
59
|
+
/**
|
|
60
|
+
* 客户端:清除 window 上的注水数据
|
|
61
|
+
* 推荐在 hydration 首次提交后调用,避免初次渲染期间的读取竞争。
|
|
62
|
+
*/
|
|
63
|
+
export declare function clearHydrationData(): void;
|
|
64
|
+
/**
|
|
65
|
+
* 客户端:从 window 读取注水数据
|
|
66
|
+
* 保持历史兼容:读取后立即清除。
|
|
67
|
+
*/
|
|
68
|
+
export declare function readHydrationData<Props = Record<string, unknown>, State = Record<string, unknown>>(): SSRHydrationData<Props, State> | null;
|
|
69
|
+
/**
|
|
70
|
+
* 服务端:创建注水数据对象
|
|
71
|
+
*/
|
|
72
|
+
export declare function createHydrationData<Props = Record<string, unknown>, State = Record<string, unknown>>(props: Props, meta: Omit<SSRPageMeta, 'renderedAt'>, state?: State): SSRHydrationData<Props, State>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SSR 环境检测与守卫工具
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* 是否在浏览器环境中运行
|
|
6
|
+
*/
|
|
7
|
+
export declare const isBrowser: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* 是否在服务端环境中运行
|
|
10
|
+
*/
|
|
11
|
+
export declare const isServer: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* 仅在浏览器环境执行回调,服务端返回 fallback
|
|
14
|
+
*/
|
|
15
|
+
export declare function clientOnly<T>(fn: () => T, fallback: T): T;
|
|
16
|
+
/**
|
|
17
|
+
* 安全访问 window 对象
|
|
18
|
+
* 服务端返回 undefined
|
|
19
|
+
*/
|
|
20
|
+
export declare function safeWindow(): Window | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* 安全访问 document 对象
|
|
23
|
+
* 服务端返回 undefined
|
|
24
|
+
*/
|
|
25
|
+
export declare function safeDocument(): Document | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* 安全读取 localStorage
|
|
28
|
+
*/
|
|
29
|
+
export declare function safeLocalStorage(key: string, fallback?: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* 安全写入 localStorage
|
|
32
|
+
*/
|
|
33
|
+
export declare function safeSetLocalStorage(key: string, value: string): void;
|
|
34
|
+
export * from "./hydration";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KoaApp } from "../types";
|
|
2
2
|
/**
|
|
3
|
-
* xx/
|
|
3
|
+
* xx/models/* ->
|
|
4
4
|
* [
|
|
5
5
|
* {
|
|
6
6
|
* model:{
|
|
@@ -29,7 +29,7 @@ export interface ModelItem {
|
|
|
29
29
|
}
|
|
30
30
|
export type ModelConfig = ModelItem[];
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* 获取使用方的根路径下的 models 文件夹
|
|
33
33
|
* @param app
|
|
34
34
|
*/
|
|
35
35
|
declare const modelLoader: (app: KoaApp) => ModelConfig;
|
|
@@ -12,3 +12,8 @@ export declare function getAppPath(app: KoaApp, type: AppPathType): string | und
|
|
|
12
12
|
* 获取所有app目录
|
|
13
13
|
*/
|
|
14
14
|
export declare function getAppPaths(app: KoaApp): string[];
|
|
15
|
+
/**
|
|
16
|
+
* 规范化路由前缀,保留根路径为空串的语义。
|
|
17
|
+
*/
|
|
18
|
+
export declare function normalizeRouteBasePath(basePath?: string, fallback?: string): string;
|
|
19
|
+
export declare function assertRouteBasePathNotConflict(pageBasePath?: string, ssrPageBasePath?: string): void;
|
|
@@ -128,8 +128,17 @@ export interface StartOptions {
|
|
|
128
128
|
* - 所有前端页面的路径以 /test开头
|
|
129
129
|
* - 如: '/test/dash'
|
|
130
130
|
*
|
|
131
|
+
*/
|
|
132
|
+
pageBasePath?: string;
|
|
133
|
+
/**
|
|
134
|
+
* - 页面访问前缀 默认为 /fessr
|
|
135
|
+
* @default '/fessr'
|
|
136
|
+
* @example
|
|
137
|
+
* - 配置 '/tssr'
|
|
138
|
+
* - 所有ssr页面的路径以 /tssr 开头
|
|
139
|
+
* - 如: '/tssr/dash'
|
|
131
140
|
*/
|
|
132
|
-
|
|
141
|
+
ssrPageBasePath?: string;
|
|
133
142
|
}
|
|
134
143
|
export interface AppOptions extends StartOptions {
|
|
135
144
|
overwriteOriginalLogs?: boolean;
|
|
@@ -16,6 +16,7 @@ import type { BuildEntriesConfig, BuildEntriesResult } from "./types.ts";
|
|
|
16
16
|
* @param config.extensions - 需要处理的文件扩展名
|
|
17
17
|
* @param config.nonCodeExtensions - 非代码文件扩展名
|
|
18
18
|
* @param config.plugins - Vite 插件配置
|
|
19
|
+
* @param config.emptyOutDir - 是否在每个输出目录首次写入前清空目录
|
|
19
20
|
* @param config.dts - 类型声明文件配置
|
|
20
21
|
* @param config.outDir - 输出根目录,默认 'dist'
|
|
21
22
|
* @param config.rootDir - 项目根目录,默认当前工作目录
|
|
@@ -82,6 +82,7 @@ export type BuildEntriesConfig = {
|
|
|
82
82
|
ignore?: IgnoreConfig;
|
|
83
83
|
copy?: CopyConfig;
|
|
84
84
|
minify?: boolean;
|
|
85
|
+
emptyOutDir?: boolean;
|
|
85
86
|
dtsOnly?: boolean;
|
|
86
87
|
preserveSideEffectStyleImports?: boolean;
|
|
87
88
|
extensions?: ExtensionConfig;
|
|
@@ -97,6 +98,7 @@ export type BuildEntriesConfig = {
|
|
|
97
98
|
rewriteAlias?: Record<string, string> | Alias[];
|
|
98
99
|
useInputFiles?: boolean;
|
|
99
100
|
clean?: boolean;
|
|
101
|
+
preserveExisting?: boolean;
|
|
100
102
|
};
|
|
101
103
|
outDir?: string;
|
|
102
104
|
rootDir?: string;
|
|
@@ -167,6 +169,7 @@ export type NormalizedDtsConfig = {
|
|
|
167
169
|
rewriteAlias?: Record<string, string> | Alias[];
|
|
168
170
|
useInputFiles: boolean;
|
|
169
171
|
clean: boolean;
|
|
172
|
+
preserveExisting: boolean;
|
|
170
173
|
};
|
|
171
174
|
export type AliasRewriteRule = {
|
|
172
175
|
find: string;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export declare const SSR_SERVER_OUT_DIR = "ssr-server";
|
|
2
|
+
export declare const SSR_MANIFEST_OUT_DIR = "ssr-manifest";
|
|
3
|
+
export declare const SSR_CLIENT_MANIFEST_FILE = "manifest.json";
|
|
4
|
+
export declare const SSR_CLIENT_URL_PREFIX = "/dist";
|
|
5
|
+
export declare const SSR_PRIVATE_ROOT_DIR = ".tc";
|
|
6
|
+
export declare const SSR_PRIVATE_RUNTIME_DIR = "ssr";
|
|
7
|
+
export type SSRPrivateOutDir = typeof SSR_SERVER_OUT_DIR | typeof SSR_MANIFEST_OUT_DIR;
|
|
8
|
+
/**
|
|
9
|
+
* 从 Koa public 根目录解析私有 SSR runtime 根目录。
|
|
10
|
+
*
|
|
11
|
+
* 例:app/public -> app/.tc/ssr。
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveSSRPrivateRootFromPublicPath(publicPath: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* 从 Koa public 根目录解析私有 SSR 子产物目录。
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveSSRPrivateDir(publicPath: string, subDir: SSRPrivateOutDir): string;
|
|
18
|
+
/**
|
|
19
|
+
* 将 SSR client 产物相对路径转换成浏览器 URL。
|
|
20
|
+
*/
|
|
21
|
+
export declare function ssrClientAssetUrl(filePath: string): string;
|
|
22
|
+
export type FEOutDirOutput = 'frame' | 'run' | (() => string);
|
|
23
|
+
export interface ResolveFEOutDirOptions {
|
|
24
|
+
baseDir?: string;
|
|
25
|
+
output?: FEOutDirOutput;
|
|
26
|
+
}
|
|
27
|
+
export interface ResolveFEOutDirInternalOptions extends ResolveFEOutDirOptions {
|
|
28
|
+
frameNodePath?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 解析当前业务项目根目录。
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveRunPath(options?: Pick<ResolveFEOutDirOptions, 'baseDir'>): string;
|
|
34
|
+
/**
|
|
35
|
+
* 解析前端 dist 输出目录。
|
|
36
|
+
*/
|
|
37
|
+
export declare function resolveFEOutDir(options?: ResolveFEOutDirInternalOptions): string;
|
|
38
|
+
/**
|
|
39
|
+
* 从 FE dist 输出目录解析私有 SSR runtime 根目录。
|
|
40
|
+
*
|
|
41
|
+
* 例:app/public/dist -> app/.tc/ssr。
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveSSRPrivateRootFromFEOutDir(feOutDir: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* 解析私有 SSR server bundle 输出目录。
|
|
46
|
+
*/
|
|
47
|
+
export declare function resolveSSRServerOutDir(options?: ResolveFEOutDirInternalOptions): string;
|
|
48
|
+
/**
|
|
49
|
+
* 解析共享 client bundle 输出目录。
|
|
50
|
+
*/
|
|
51
|
+
export declare function resolveSSRClientOutDir(options?: ResolveFEOutDirInternalOptions): string;
|
|
52
|
+
/**
|
|
53
|
+
* 解析私有 SSR client manifest 输出目录。
|
|
54
|
+
*/
|
|
55
|
+
export declare function resolveSSRManifestOutDir(options?: ResolveFEOutDirInternalOptions): string;
|
|
56
|
+
/**
|
|
57
|
+
* 解析私有 SSR client manifest 文件路径。
|
|
58
|
+
*/
|
|
59
|
+
export declare function resolveSSRManifestFile(options?: ResolveFEOutDirInternalOptions): string;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { defaultCompare, identityCompare, shallowCompare } from "./useWatch.js";
|
|
2
|
-
import assert from "node:assert/strict";
|
|
3
|
-
import test from "node:test";
|
|
4
|
-
//#region packages/react/hooks/useWatch.test.ts
|
|
5
|
-
test("defaultCompare treats inline arrays with the same items as equal", () => {
|
|
6
|
-
assert.equal(defaultCompare([1, "a"], [1, "a"]), true);
|
|
7
|
-
});
|
|
8
|
-
test("defaultCompare detects changed array items", () => {
|
|
9
|
-
assert.equal(defaultCompare([1, "a"], [1, "b"]), false);
|
|
10
|
-
});
|
|
11
|
-
test("defaultCompare uses identity for object values", () => {
|
|
12
|
-
assert.equal(defaultCompare({ current: 1 }, { current: 1 }), false);
|
|
13
|
-
});
|
|
14
|
-
test("identityCompare detects changed array references", () => {
|
|
15
|
-
assert.equal(identityCompare([1, 2], [1, 2]), false);
|
|
16
|
-
});
|
|
17
|
-
test("shallowCompare supports selector array results", () => {
|
|
18
|
-
assert.equal(shallowCompare([1, 10], [1, 10]), true);
|
|
19
|
-
assert.equal(shallowCompare([1, 10], [2, 10]), false);
|
|
20
|
-
});
|
|
21
|
-
test("shallowCompare does not treat non-plain objects as equal by empty keys", () => {
|
|
22
|
-
assert.equal(shallowCompare(/* @__PURE__ */ new Date(0), /* @__PURE__ */ new Date(0)), false);
|
|
23
|
-
});
|
|
24
|
-
//#endregion
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
//#region packages/react/ui/assets/table/no-result.svg
|
|
2
|
-
var no_result_default = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='120'%20height='120'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='currentColor'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3crect%20x='3'%20y='3'%20width='18'%20height='18'%20rx='2'%20ry='2'/%3e%3cline%20x1='3'%20y1='9'%20x2='21'%20y2='9'/%3e%3cline%20x1='9'%20y1='21'%20x2='9'%20y2='9'/%3e%3c/svg%3e";
|
|
3
|
-
//#endregion
|
|
4
|
-
export { no_result_default as default };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { getDataTableColumnStyle, getDataTableColumnWidth, getDataTableFixedOffset, normalizeTableWidth } from "./dataTableWidth.js";
|
|
2
|
-
import assert from "node:assert/strict";
|
|
3
|
-
import test from "node:test";
|
|
4
|
-
//#region packages/react/ui/components/DataTable/dataTableWidth.test.ts
|
|
5
|
-
test("normalizeTableWidth converts numeric widths to px", () => {
|
|
6
|
-
assert.equal(normalizeTableWidth(160), "160px");
|
|
7
|
-
assert.equal(normalizeTableWidth("160"), "160px");
|
|
8
|
-
assert.equal(normalizeTableWidth("160px"), "160px");
|
|
9
|
-
assert.equal(normalizeTableWidth("calc(100% - 20px)"), "calc(100% - 20px)");
|
|
10
|
-
assert.equal(normalizeTableWidth(""), void 0);
|
|
11
|
-
});
|
|
12
|
-
test("getDataTableColumnWidth falls back to default and action widths", () => {
|
|
13
|
-
assert.equal(getDataTableColumnWidth({ key: "name" }, 120), "120px");
|
|
14
|
-
assert.equal(getDataTableColumnWidth({ key: "action" }, 120), "96px");
|
|
15
|
-
assert.equal(getDataTableColumnWidth({
|
|
16
|
-
key: "name",
|
|
17
|
-
width: "180"
|
|
18
|
-
}, 120), "180px");
|
|
19
|
-
assert.equal(getDataTableColumnWidth({
|
|
20
|
-
key: "name",
|
|
21
|
-
isAction: true
|
|
22
|
-
}, 120), "96px");
|
|
23
|
-
});
|
|
24
|
-
test("getDataTableColumnStyle keeps width and minWidth aligned", () => {
|
|
25
|
-
assert.deepEqual(getDataTableColumnStyle({
|
|
26
|
-
key: "name",
|
|
27
|
-
width: "240"
|
|
28
|
-
}, 120), {
|
|
29
|
-
width: "240px",
|
|
30
|
-
minWidth: "240px"
|
|
31
|
-
});
|
|
32
|
-
assert.deepEqual(getDataTableColumnStyle({ key: "name" }, 120), { minWidth: "120px" });
|
|
33
|
-
});
|
|
34
|
-
test("getDataTableFixedOffset combines widths in order", () => {
|
|
35
|
-
assert.equal(getDataTableFixedOffset([]), "0px");
|
|
36
|
-
assert.equal(getDataTableFixedOffset(["48px"]), "48px");
|
|
37
|
-
assert.equal(getDataTableFixedOffset(["48px", "120px"]), "calc(48px + 120px)");
|
|
38
|
-
});
|
|
39
|
-
//#endregion
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { clampValue, formatNumber, parseInputNumber, shouldSyncDisplayValue, stepValue } from "./inputNumberUtils.js";
|
|
2
|
-
import assert from "node:assert/strict";
|
|
3
|
-
import test from "node:test";
|
|
4
|
-
//#region packages/react/ui/components/InputNumber/inputNumberUtils.test.ts
|
|
5
|
-
test("parseInputNumber keeps empty and transitional values unresolved", () => {
|
|
6
|
-
assert.deepEqual(parseInputNumber(""), { kind: "empty" });
|
|
7
|
-
assert.deepEqual(parseInputNumber("-"), { kind: "incomplete" });
|
|
8
|
-
assert.deepEqual(parseInputNumber("."), { kind: "incomplete" });
|
|
9
|
-
assert.deepEqual(parseInputNumber("1."), { kind: "incomplete" });
|
|
10
|
-
assert.deepEqual(parseInputNumber("-1."), { kind: "incomplete" });
|
|
11
|
-
assert.deepEqual(parseInputNumber("1.25"), {
|
|
12
|
-
kind: "number",
|
|
13
|
-
value: 1.25
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
test("formatNumber applies precision and clamps boundaries", () => {
|
|
17
|
-
assert.equal(formatNumber(1.236, { precision: 2 }), "1.24");
|
|
18
|
-
assert.equal(formatNumber(12, { max: 10 }), "10");
|
|
19
|
-
assert.equal(clampValue(-3, { min: 0 }), 0);
|
|
20
|
-
});
|
|
21
|
-
test("stepValue respects min max precision and step", () => {
|
|
22
|
-
assert.equal(stepValue(void 0, "up", {
|
|
23
|
-
step: .25,
|
|
24
|
-
precision: 2
|
|
25
|
-
}), .25);
|
|
26
|
-
assert.equal(stepValue(9.9, "up", {
|
|
27
|
-
step: 1,
|
|
28
|
-
max: 10,
|
|
29
|
-
precision: 1
|
|
30
|
-
}), 10);
|
|
31
|
-
assert.equal(stepValue(.3, "down", {
|
|
32
|
-
step: .2,
|
|
33
|
-
min: 0,
|
|
34
|
-
precision: 1
|
|
35
|
-
}), .1);
|
|
36
|
-
});
|
|
37
|
-
test("shouldSyncDisplayValue preserves editable decimals while focused", () => {
|
|
38
|
-
assert.equal(shouldSyncDisplayValue({
|
|
39
|
-
isFocused: true,
|
|
40
|
-
displayValue: "12.5",
|
|
41
|
-
currentValue: 12.5
|
|
42
|
-
}), false);
|
|
43
|
-
assert.equal(shouldSyncDisplayValue({
|
|
44
|
-
isFocused: true,
|
|
45
|
-
displayValue: "12.56",
|
|
46
|
-
currentValue: 12.56
|
|
47
|
-
}), false);
|
|
48
|
-
assert.equal(shouldSyncDisplayValue({
|
|
49
|
-
isFocused: true,
|
|
50
|
-
displayValue: "12.56",
|
|
51
|
-
currentValue: 3.14
|
|
52
|
-
}), true);
|
|
53
|
-
assert.equal(shouldSyncDisplayValue({
|
|
54
|
-
isFocused: false,
|
|
55
|
-
displayValue: "12.56",
|
|
56
|
-
currentValue: 12.56
|
|
57
|
-
}), true);
|
|
58
|
-
});
|
|
59
|
-
//#endregion
|
|
File without changes
|
/package/.skills/tc-generator/reference/project-template/{model → models}/product/project/default.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{model → models}/frontend/src/defaultPages/SchemaPage/components/CallCom/DetailPanel.d.ts
RENAMED
|
File without changes
|
/package/{model → models}/frontend/src/defaultPages/SchemaPage/components/CallCom/PopFrom.d.ts
RENAMED
|
File without changes
|
/package/{model → models}/frontend/src/defaultPages/SchemaPage/components/CallCom/builtIn.d.ts
RENAMED
|
File without changes
|
|
File without changes
|