7 Commits

Author SHA1 Message Date
严浩
09ec2c7d12 feat(auto-import): 更新图标引入方式并升级相关依赖
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m8s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m3s
2025-10-27 12:46:08 +08:00
严浩
ad0df6b140 docs(agents): 更新 TypeScript/TSX 文件中图标自动导入的说明
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 4m9s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m22s
2025-10-27 12:18:51 +08:00
严浩
3269b10bfd fix(vite): 修复 rollup 手动分块逻辑
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 3m49s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m7s
2025-10-27 09:42:45 +08:00
严浩
047632b75f chore: lint format
Some checks failed
CI/CD Pipeline / playwright (push) Failing after 8m18s
CI/CD Pipeline / build-and-deploy (push) Has been skipped
测试最新依赖 / build-and-test (push) Failing after 1m44s
测试最新依赖 / playwright (push) Failing after 6m28s
2025-10-27 02:31:48 +08:00
严浩
7830ad0ebb Merge branch 'eslint-plugin-import' 2025-10-27 02:29:54 +08:00
严浩
a61a22569d fix(vite-config): 移除对 index.page.vue 文件的特殊处理逻辑 2025-10-27 02:29:25 +08:00
严浩
c27c8544de feat(vite-plugins): 更新cloudflare插件环境变量加载方式 2025-10-27 02:25:33 +08:00
12 changed files with 57 additions and 341 deletions

View File

@@ -22,14 +22,15 @@ Multiple auto-import systems are active:
- **Vue APIs**: Core Vue, VueUse, Pinia, Vue Router, vue-i18n - **Vue APIs**: Core Vue, VueUse, Pinia, Vue Router, vue-i18n
- **Components**: Auto-registered from multiple UI libraries (Naive UI, PrimeVue) - **Components**: Auto-registered from multiple UI libraries (Naive UI, PrimeVue)
- **Icons**: Uses `unplugin-icons` with `icon-` prefix; custom SVGs from `src/assets/icons/svgs/` available via `icon-svg:filename` - **Icons**: Uses `unplugin-icons` with `icon-` prefix; custom SVGs from `src/assets/icons/svgs/` available via `icon-svg-filename`
**IMPORTANT - Auto-Import Limitations**: **IMPORTANT - Auto-Import Limitations**:
- **Dynamic components**: Auto-imported components cannot be used with `<component :is="..." />` syntax - **Dynamic components**: Auto-imported components cannot be used with `<component :is="..." />` syntax
- ❌ Avoid: `<component :is="`icon-${name}`" />` - ❌ Avoid: `<component :is="`icon-${name}`" />`
- ✅ Use: `<icon-foo v-if="condition" />` with `v-if`/`v-else-if`/`v-else` directives - ✅ Use: `<icon-foo v-if="condition" />` with `v-if`/`v-else-if`/`v-else` directives
- **In TypeScript/TSX files**: Auto-import does NOT work. You must explicitly import icons using the `~icons/` prefix:
- **Icons in TypeScript/TSX files**: Auto-import for icons does NOT work. You must explicitly import them using the `~icons/` prefix:
```tsx ```tsx
import IconMenuRounded from '~icons/material-symbols/menu-rounded'; import IconMenuRounded from '~icons/material-symbols/menu-rounded';

308
auto-imports.d.ts vendored
View File

@@ -8,160 +8,6 @@ export {}
declare global { declare global {
const APP_THEME_MODES: typeof import('./src/stores/app-store')['APP_THEME_MODES'] const APP_THEME_MODES: typeof import('./src/stores/app-store')['APP_THEME_MODES']
const EffectScope: typeof import('vue')['EffectScope'] const EffectScope: typeof import('vue')['EffectScope']
const NA: typeof import('naive-ui')['NA']
const NAffix: typeof import('naive-ui')['NAffix']
const NAlert: typeof import('naive-ui')['NAlert']
const NAnchor: typeof import('naive-ui')['NAnchor']
const NAnchorLink: typeof import('naive-ui')['NAnchorLink']
const NAutoComplete: typeof import('naive-ui')['NAutoComplete']
const NAvatar: typeof import('naive-ui')['NAvatar']
const NAvatarGroup: typeof import('naive-ui')['NAvatarGroup']
const NBackTop: typeof import('naive-ui')['NBackTop']
const NBadge: typeof import('naive-ui')['NBadge']
const NBlockquote: typeof import('naive-ui')['NBlockquote']
const NBreadcrumb: typeof import('naive-ui')['NBreadcrumb']
const NBreadcrumbItem: typeof import('naive-ui')['NBreadcrumbItem']
const NButton: typeof import('naive-ui')['NButton']
const NButtonGroup: typeof import('naive-ui')['NButtonGroup']
const NCalendar: typeof import('naive-ui')['NCalendar']
const NCard: typeof import('naive-ui')['NCard']
const NCarousel: typeof import('naive-ui')['NCarousel']
const NCarouselItem: typeof import('naive-ui')['NCarouselItem']
const NCascader: typeof import('naive-ui')['NCascader']
const NCheckbox: typeof import('naive-ui')['NCheckbox']
const NCheckboxGroup: typeof import('naive-ui')['NCheckboxGroup']
const NCode: typeof import('naive-ui')['NCode']
const NCol: typeof import('naive-ui')['NCol']
const NCollapse: typeof import('naive-ui')['NCollapse']
const NCollapseItem: typeof import('naive-ui')['NCollapseItem']
const NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
const NColorPicker: typeof import('naive-ui')['NColorPicker']
const NConfigProvider: typeof import('naive-ui')['NConfigProvider']
const NCountdown: typeof import('naive-ui')['NCountdown']
const NDataTable: typeof import('naive-ui')['NDataTable']
const NDatePicker: typeof import('naive-ui')['NDatePicker']
const NDescriptions: typeof import('naive-ui')['NDescriptions']
const NDescriptionsItem: typeof import('naive-ui')['NDescriptionsItem']
const NDialog: typeof import('naive-ui')['NDialog']
const NDialogProvider: typeof import('naive-ui')['NDialogProvider']
const NDivider: typeof import('naive-ui')['NDivider']
const NDrawer: typeof import('naive-ui')['NDrawer']
const NDrawerContent: typeof import('naive-ui')['NDrawerContent']
const NDropdown: typeof import('naive-ui')['NDropdown']
const NDynamicInput: typeof import('naive-ui')['NDynamicInput']
const NDynamicTags: typeof import('naive-ui')['NDynamicTags']
const NEl: typeof import('naive-ui')['NEl']
const NElement: typeof import('naive-ui')['NElement']
const NEllipsis: typeof import('naive-ui')['NEllipsis']
const NEmpty: typeof import('naive-ui')['NEmpty']
const NEquation: typeof import('naive-ui')['NEquation']
const NFlex: typeof import('naive-ui')['NFlex']
const NFloatButton: typeof import('naive-ui')['NFloatButton']
const NFloatButtonGroup: typeof import('naive-ui')['NFloatButtonGroup']
const NForm: typeof import('naive-ui')['NForm']
const NFormItem: typeof import('naive-ui')['NFormItem']
const NFormItemCol: typeof import('naive-ui')['NFormItemCol']
const NFormItemGi: typeof import('naive-ui')['NFormItemGi']
const NFormItemGridItem: typeof import('naive-ui')['NFormItemGridItem']
const NFormItemRow: typeof import('naive-ui')['NFormItemRow']
const NGi: typeof import('naive-ui')['NGi']
const NGlobalStyle: typeof import('naive-ui')['NGlobalStyle']
const NGradientText: typeof import('naive-ui')['NGradientText']
const NGrid: typeof import('naive-ui')['NGrid']
const NGridItem: typeof import('naive-ui')['NGridItem']
const NH1: typeof import('naive-ui')['NH1']
const NH2: typeof import('naive-ui')['NH2']
const NH3: typeof import('naive-ui')['NH3']
const NH4: typeof import('naive-ui')['NH4']
const NH5: typeof import('naive-ui')['NH5']
const NH6: typeof import('naive-ui')['NH6']
const NHeatmap: typeof import('naive-ui')['NHeatmap']
const NHighlight: typeof import('naive-ui')['NHighlight']
const NHr: typeof import('naive-ui')['NHr']
const NIcon: typeof import('naive-ui')['NIcon']
const NIconWrapper: typeof import('naive-ui')['NIconWrapper']
const NImage: typeof import('naive-ui')['NImage']
const NImageGroup: typeof import('naive-ui')['NImageGroup']
const NImagePreview: typeof import('naive-ui')['NImagePreview']
const NInfiniteScroll: typeof import('naive-ui')['NInfiniteScroll']
const NInput: typeof import('naive-ui')['NInput']
const NInputGroup: typeof import('naive-ui')['NInputGroup']
const NInputGroupLabel: typeof import('naive-ui')['NInputGroupLabel']
const NInputNumber: typeof import('naive-ui')['NInputNumber']
const NInputOtp: typeof import('naive-ui')['NInputOtp']
const NLayout: typeof import('naive-ui')['NLayout']
const NLayoutContent: typeof import('naive-ui')['NLayoutContent']
const NLayoutFooter: typeof import('naive-ui')['NLayoutFooter']
const NLayoutHeader: typeof import('naive-ui')['NLayoutHeader']
const NLayoutSider: typeof import('naive-ui')['NLayoutSider']
const NLegacyTransfer: typeof import('naive-ui')['NLegacyTransfer']
const NLi: typeof import('naive-ui')['NLi']
const NList: typeof import('naive-ui')['NList']
const NListItem: typeof import('naive-ui')['NListItem']
const NLoadingBarProvider: typeof import('naive-ui')['NLoadingBarProvider']
const NLog: typeof import('naive-ui')['NLog']
const NMarquee: typeof import('naive-ui')['NMarquee']
const NMention: typeof import('naive-ui')['NMention']
const NMenu: typeof import('naive-ui')['NMenu']
const NMessageProvider: typeof import('naive-ui')['NMessageProvider']
const NModal: typeof import('naive-ui')['NModal']
const NModalProvider: typeof import('naive-ui')['NModalProvider']
const NNotificationProvider: typeof import('naive-ui')['NNotificationProvider']
const NNumberAnimation: typeof import('naive-ui')['NNumberAnimation']
const NOl: typeof import('naive-ui')['NOl']
const NP: typeof import('naive-ui')['NP']
const NPageHeader: typeof import('naive-ui')['NPageHeader']
const NPagination: typeof import('naive-ui')['NPagination']
const NPerformantEllipsis: typeof import('naive-ui')['NPerformantEllipsis']
const NPopconfirm: typeof import('naive-ui')['NPopconfirm']
const NPopover: typeof import('naive-ui')['NPopover']
const NPopselect: typeof import('naive-ui')['NPopselect']
const NProgress: typeof import('naive-ui')['NProgress']
const NQrCode: typeof import('naive-ui')['NQrCode']
const NRadio: typeof import('naive-ui')['NRadio']
const NRadioButton: typeof import('naive-ui')['NRadioButton']
const NRadioGroup: typeof import('naive-ui')['NRadioGroup']
const NRate: typeof import('naive-ui')['NRate']
const NResult: typeof import('naive-ui')['NResult']
const NRow: typeof import('naive-ui')['NRow']
const NScrollbar: typeof import('naive-ui')['NScrollbar']
const NSelect: typeof import('naive-ui')['NSelect']
const NSkeleton: typeof import('naive-ui')['NSkeleton']
const NSlider: typeof import('naive-ui')['NSlider']
const NSpace: typeof import('naive-ui')['NSpace']
const NSpin: typeof import('naive-ui')['NSpin']
const NSplit: typeof import('naive-ui')['NSplit']
const NStatistic: typeof import('naive-ui')['NStatistic']
const NStep: typeof import('naive-ui')['NStep']
const NSteps: typeof import('naive-ui')['NSteps']
const NSwitch: typeof import('naive-ui')['NSwitch']
const NTab: typeof import('naive-ui')['NTab']
const NTabPane: typeof import('naive-ui')['NTabPane']
const NTable: typeof import('naive-ui')['NTable']
const NTabs: typeof import('naive-ui')['NTabs']
const NTag: typeof import('naive-ui')['NTag']
const NTbody: typeof import('naive-ui')['NTbody']
const NTd: typeof import('naive-ui')['NTd']
const NText: typeof import('naive-ui')['NText']
const NTh: typeof import('naive-ui')['NTh']
const NThead: typeof import('naive-ui')['NThead']
const NThing: typeof import('naive-ui')['NThing']
const NTime: typeof import('naive-ui')['NTime']
const NTimePicker: typeof import('naive-ui')['NTimePicker']
const NTimeline: typeof import('naive-ui')['NTimeline']
const NTimelineItem: typeof import('naive-ui')['NTimelineItem']
const NTooltip: typeof import('naive-ui')['NTooltip']
const NTr: typeof import('naive-ui')['NTr']
const NTransfer: typeof import('naive-ui')['NTransfer']
const NTree: typeof import('naive-ui')['NTree']
const NTreeSelect: typeof import('naive-ui')['NTreeSelect']
const NUl: typeof import('naive-ui')['NUl']
const NUpload: typeof import('naive-ui')['NUpload']
const NUploadDragger: typeof import('naive-ui')['NUploadDragger']
const NUploadFileList: typeof import('naive-ui')['NUploadFileList']
const NUploadTrigger: typeof import('naive-ui')['NUploadTrigger']
const NVirtualList: typeof import('naive-ui')['NVirtualList']
const NWatermark: typeof import('naive-ui')['NWatermark']
const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate'] const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
const arrayToTree: typeof import('utils4u/array')['arrayToTree'] const arrayToTree: typeof import('utils4u/array')['arrayToTree']
const asyncComputed: typeof import('@vueuse/core')['asyncComputed'] const asyncComputed: typeof import('@vueuse/core')['asyncComputed']
@@ -500,160 +346,6 @@ declare module 'vue' {
interface ComponentCustomProperties { interface ComponentCustomProperties {
readonly APP_THEME_MODES: UnwrapRef<typeof import('./src/stores/app-store')['APP_THEME_MODES']> readonly APP_THEME_MODES: UnwrapRef<typeof import('./src/stores/app-store')['APP_THEME_MODES']>
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']> readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly NA: UnwrapRef<typeof import('naive-ui')['NA']>
readonly NAffix: UnwrapRef<typeof import('naive-ui')['NAffix']>
readonly NAlert: UnwrapRef<typeof import('naive-ui')['NAlert']>
readonly NAnchor: UnwrapRef<typeof import('naive-ui')['NAnchor']>
readonly NAnchorLink: UnwrapRef<typeof import('naive-ui')['NAnchorLink']>
readonly NAutoComplete: UnwrapRef<typeof import('naive-ui')['NAutoComplete']>
readonly NAvatar: UnwrapRef<typeof import('naive-ui')['NAvatar']>
readonly NAvatarGroup: UnwrapRef<typeof import('naive-ui')['NAvatarGroup']>
readonly NBackTop: UnwrapRef<typeof import('naive-ui')['NBackTop']>
readonly NBadge: UnwrapRef<typeof import('naive-ui')['NBadge']>
readonly NBlockquote: UnwrapRef<typeof import('naive-ui')['NBlockquote']>
readonly NBreadcrumb: UnwrapRef<typeof import('naive-ui')['NBreadcrumb']>
readonly NBreadcrumbItem: UnwrapRef<typeof import('naive-ui')['NBreadcrumbItem']>
readonly NButton: UnwrapRef<typeof import('naive-ui')['NButton']>
readonly NButtonGroup: UnwrapRef<typeof import('naive-ui')['NButtonGroup']>
readonly NCalendar: UnwrapRef<typeof import('naive-ui')['NCalendar']>
readonly NCard: UnwrapRef<typeof import('naive-ui')['NCard']>
readonly NCarousel: UnwrapRef<typeof import('naive-ui')['NCarousel']>
readonly NCarouselItem: UnwrapRef<typeof import('naive-ui')['NCarouselItem']>
readonly NCascader: UnwrapRef<typeof import('naive-ui')['NCascader']>
readonly NCheckbox: UnwrapRef<typeof import('naive-ui')['NCheckbox']>
readonly NCheckboxGroup: UnwrapRef<typeof import('naive-ui')['NCheckboxGroup']>
readonly NCode: UnwrapRef<typeof import('naive-ui')['NCode']>
readonly NCol: UnwrapRef<typeof import('naive-ui')['NCol']>
readonly NCollapse: UnwrapRef<typeof import('naive-ui')['NCollapse']>
readonly NCollapseItem: UnwrapRef<typeof import('naive-ui')['NCollapseItem']>
readonly NCollapseTransition: UnwrapRef<typeof import('naive-ui')['NCollapseTransition']>
readonly NColorPicker: UnwrapRef<typeof import('naive-ui')['NColorPicker']>
readonly NConfigProvider: UnwrapRef<typeof import('naive-ui')['NConfigProvider']>
readonly NCountdown: UnwrapRef<typeof import('naive-ui')['NCountdown']>
readonly NDataTable: UnwrapRef<typeof import('naive-ui')['NDataTable']>
readonly NDatePicker: UnwrapRef<typeof import('naive-ui')['NDatePicker']>
readonly NDescriptions: UnwrapRef<typeof import('naive-ui')['NDescriptions']>
readonly NDescriptionsItem: UnwrapRef<typeof import('naive-ui')['NDescriptionsItem']>
readonly NDialog: UnwrapRef<typeof import('naive-ui')['NDialog']>
readonly NDialogProvider: UnwrapRef<typeof import('naive-ui')['NDialogProvider']>
readonly NDivider: UnwrapRef<typeof import('naive-ui')['NDivider']>
readonly NDrawer: UnwrapRef<typeof import('naive-ui')['NDrawer']>
readonly NDrawerContent: UnwrapRef<typeof import('naive-ui')['NDrawerContent']>
readonly NDropdown: UnwrapRef<typeof import('naive-ui')['NDropdown']>
readonly NDynamicInput: UnwrapRef<typeof import('naive-ui')['NDynamicInput']>
readonly NDynamicTags: UnwrapRef<typeof import('naive-ui')['NDynamicTags']>
readonly NEl: UnwrapRef<typeof import('naive-ui')['NEl']>
readonly NElement: UnwrapRef<typeof import('naive-ui')['NElement']>
readonly NEllipsis: UnwrapRef<typeof import('naive-ui')['NEllipsis']>
readonly NEmpty: UnwrapRef<typeof import('naive-ui')['NEmpty']>
readonly NEquation: UnwrapRef<typeof import('naive-ui')['NEquation']>
readonly NFlex: UnwrapRef<typeof import('naive-ui')['NFlex']>
readonly NFloatButton: UnwrapRef<typeof import('naive-ui')['NFloatButton']>
readonly NFloatButtonGroup: UnwrapRef<typeof import('naive-ui')['NFloatButtonGroup']>
readonly NForm: UnwrapRef<typeof import('naive-ui')['NForm']>
readonly NFormItem: UnwrapRef<typeof import('naive-ui')['NFormItem']>
readonly NFormItemCol: UnwrapRef<typeof import('naive-ui')['NFormItemCol']>
readonly NFormItemGi: UnwrapRef<typeof import('naive-ui')['NFormItemGi']>
readonly NFormItemGridItem: UnwrapRef<typeof import('naive-ui')['NFormItemGridItem']>
readonly NFormItemRow: UnwrapRef<typeof import('naive-ui')['NFormItemRow']>
readonly NGi: UnwrapRef<typeof import('naive-ui')['NGi']>
readonly NGlobalStyle: UnwrapRef<typeof import('naive-ui')['NGlobalStyle']>
readonly NGradientText: UnwrapRef<typeof import('naive-ui')['NGradientText']>
readonly NGrid: UnwrapRef<typeof import('naive-ui')['NGrid']>
readonly NGridItem: UnwrapRef<typeof import('naive-ui')['NGridItem']>
readonly NH1: UnwrapRef<typeof import('naive-ui')['NH1']>
readonly NH2: UnwrapRef<typeof import('naive-ui')['NH2']>
readonly NH3: UnwrapRef<typeof import('naive-ui')['NH3']>
readonly NH4: UnwrapRef<typeof import('naive-ui')['NH4']>
readonly NH5: UnwrapRef<typeof import('naive-ui')['NH5']>
readonly NH6: UnwrapRef<typeof import('naive-ui')['NH6']>
readonly NHeatmap: UnwrapRef<typeof import('naive-ui')['NHeatmap']>
readonly NHighlight: UnwrapRef<typeof import('naive-ui')['NHighlight']>
readonly NHr: UnwrapRef<typeof import('naive-ui')['NHr']>
readonly NIcon: UnwrapRef<typeof import('naive-ui')['NIcon']>
readonly NIconWrapper: UnwrapRef<typeof import('naive-ui')['NIconWrapper']>
readonly NImage: UnwrapRef<typeof import('naive-ui')['NImage']>
readonly NImageGroup: UnwrapRef<typeof import('naive-ui')['NImageGroup']>
readonly NImagePreview: UnwrapRef<typeof import('naive-ui')['NImagePreview']>
readonly NInfiniteScroll: UnwrapRef<typeof import('naive-ui')['NInfiniteScroll']>
readonly NInput: UnwrapRef<typeof import('naive-ui')['NInput']>
readonly NInputGroup: UnwrapRef<typeof import('naive-ui')['NInputGroup']>
readonly NInputGroupLabel: UnwrapRef<typeof import('naive-ui')['NInputGroupLabel']>
readonly NInputNumber: UnwrapRef<typeof import('naive-ui')['NInputNumber']>
readonly NInputOtp: UnwrapRef<typeof import('naive-ui')['NInputOtp']>
readonly NLayout: UnwrapRef<typeof import('naive-ui')['NLayout']>
readonly NLayoutContent: UnwrapRef<typeof import('naive-ui')['NLayoutContent']>
readonly NLayoutFooter: UnwrapRef<typeof import('naive-ui')['NLayoutFooter']>
readonly NLayoutHeader: UnwrapRef<typeof import('naive-ui')['NLayoutHeader']>
readonly NLayoutSider: UnwrapRef<typeof import('naive-ui')['NLayoutSider']>
readonly NLegacyTransfer: UnwrapRef<typeof import('naive-ui')['NLegacyTransfer']>
readonly NLi: UnwrapRef<typeof import('naive-ui')['NLi']>
readonly NList: UnwrapRef<typeof import('naive-ui')['NList']>
readonly NListItem: UnwrapRef<typeof import('naive-ui')['NListItem']>
readonly NLoadingBarProvider: UnwrapRef<typeof import('naive-ui')['NLoadingBarProvider']>
readonly NLog: UnwrapRef<typeof import('naive-ui')['NLog']>
readonly NMarquee: UnwrapRef<typeof import('naive-ui')['NMarquee']>
readonly NMention: UnwrapRef<typeof import('naive-ui')['NMention']>
readonly NMenu: UnwrapRef<typeof import('naive-ui')['NMenu']>
readonly NMessageProvider: UnwrapRef<typeof import('naive-ui')['NMessageProvider']>
readonly NModal: UnwrapRef<typeof import('naive-ui')['NModal']>
readonly NModalProvider: UnwrapRef<typeof import('naive-ui')['NModalProvider']>
readonly NNotificationProvider: UnwrapRef<typeof import('naive-ui')['NNotificationProvider']>
readonly NNumberAnimation: UnwrapRef<typeof import('naive-ui')['NNumberAnimation']>
readonly NOl: UnwrapRef<typeof import('naive-ui')['NOl']>
readonly NP: UnwrapRef<typeof import('naive-ui')['NP']>
readonly NPageHeader: UnwrapRef<typeof import('naive-ui')['NPageHeader']>
readonly NPagination: UnwrapRef<typeof import('naive-ui')['NPagination']>
readonly NPerformantEllipsis: UnwrapRef<typeof import('naive-ui')['NPerformantEllipsis']>
readonly NPopconfirm: UnwrapRef<typeof import('naive-ui')['NPopconfirm']>
readonly NPopover: UnwrapRef<typeof import('naive-ui')['NPopover']>
readonly NPopselect: UnwrapRef<typeof import('naive-ui')['NPopselect']>
readonly NProgress: UnwrapRef<typeof import('naive-ui')['NProgress']>
readonly NQrCode: UnwrapRef<typeof import('naive-ui')['NQrCode']>
readonly NRadio: UnwrapRef<typeof import('naive-ui')['NRadio']>
readonly NRadioButton: UnwrapRef<typeof import('naive-ui')['NRadioButton']>
readonly NRadioGroup: UnwrapRef<typeof import('naive-ui')['NRadioGroup']>
readonly NRate: UnwrapRef<typeof import('naive-ui')['NRate']>
readonly NResult: UnwrapRef<typeof import('naive-ui')['NResult']>
readonly NRow: UnwrapRef<typeof import('naive-ui')['NRow']>
readonly NScrollbar: UnwrapRef<typeof import('naive-ui')['NScrollbar']>
readonly NSelect: UnwrapRef<typeof import('naive-ui')['NSelect']>
readonly NSkeleton: UnwrapRef<typeof import('naive-ui')['NSkeleton']>
readonly NSlider: UnwrapRef<typeof import('naive-ui')['NSlider']>
readonly NSpace: UnwrapRef<typeof import('naive-ui')['NSpace']>
readonly NSpin: UnwrapRef<typeof import('naive-ui')['NSpin']>
readonly NSplit: UnwrapRef<typeof import('naive-ui')['NSplit']>
readonly NStatistic: UnwrapRef<typeof import('naive-ui')['NStatistic']>
readonly NStep: UnwrapRef<typeof import('naive-ui')['NStep']>
readonly NSteps: UnwrapRef<typeof import('naive-ui')['NSteps']>
readonly NSwitch: UnwrapRef<typeof import('naive-ui')['NSwitch']>
readonly NTab: UnwrapRef<typeof import('naive-ui')['NTab']>
readonly NTabPane: UnwrapRef<typeof import('naive-ui')['NTabPane']>
readonly NTable: UnwrapRef<typeof import('naive-ui')['NTable']>
readonly NTabs: UnwrapRef<typeof import('naive-ui')['NTabs']>
readonly NTag: UnwrapRef<typeof import('naive-ui')['NTag']>
readonly NTbody: UnwrapRef<typeof import('naive-ui')['NTbody']>
readonly NTd: UnwrapRef<typeof import('naive-ui')['NTd']>
readonly NText: UnwrapRef<typeof import('naive-ui')['NText']>
readonly NTh: UnwrapRef<typeof import('naive-ui')['NTh']>
readonly NThead: UnwrapRef<typeof import('naive-ui')['NThead']>
readonly NThing: UnwrapRef<typeof import('naive-ui')['NThing']>
readonly NTime: UnwrapRef<typeof import('naive-ui')['NTime']>
readonly NTimePicker: UnwrapRef<typeof import('naive-ui')['NTimePicker']>
readonly NTimeline: UnwrapRef<typeof import('naive-ui')['NTimeline']>
readonly NTimelineItem: UnwrapRef<typeof import('naive-ui')['NTimelineItem']>
readonly NTooltip: UnwrapRef<typeof import('naive-ui')['NTooltip']>
readonly NTr: UnwrapRef<typeof import('naive-ui')['NTr']>
readonly NTransfer: UnwrapRef<typeof import('naive-ui')['NTransfer']>
readonly NTree: UnwrapRef<typeof import('naive-ui')['NTree']>
readonly NTreeSelect: UnwrapRef<typeof import('naive-ui')['NTreeSelect']>
readonly NUl: UnwrapRef<typeof import('naive-ui')['NUl']>
readonly NUpload: UnwrapRef<typeof import('naive-ui')['NUpload']>
readonly NUploadDragger: UnwrapRef<typeof import('naive-ui')['NUploadDragger']>
readonly NUploadFileList: UnwrapRef<typeof import('naive-ui')['NUploadFileList']>
readonly NUploadTrigger: UnwrapRef<typeof import('naive-ui')['NUploadTrigger']>
readonly NVirtualList: UnwrapRef<typeof import('naive-ui')['NVirtualList']>
readonly NWatermark: UnwrapRef<typeof import('naive-ui')['NWatermark']>
readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']> readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
readonly arrayToTree: UnwrapRef<typeof import('utils4u/array')['arrayToTree']> readonly arrayToTree: UnwrapRef<typeof import('utils4u/array')['arrayToTree']>
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']> readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>

View File

@@ -125,8 +125,8 @@
"unocss-preset-animations": "^1.2.1", "unocss-preset-animations": "^1.2.1",
"unplugin-auto-import": "^20.1.0", "unplugin-auto-import": "^20.1.0",
"unplugin-icons": "^22.2.0", "unplugin-icons": "^22.2.0",
"unplugin-vue-components": "^29.0.0", "unplugin-vue-components": "^29.2.0",
"unplugin-vue-markdown": "^29.1.0", "unplugin-vue-markdown": "^29.2.0",
"unplugin-vue-router": "^0.16.0", "unplugin-vue-router": "^0.16.0",
"vite": "^7.1.5", "vite": "^7.1.5",
"vite-plugin-checker": "^0.11.0", "vite-plugin-checker": "^0.11.0",

12
pnpm-lock.yaml generated
View File

@@ -232,10 +232,10 @@ importers:
specifier: ^22.2.0 specifier: ^22.2.0
version: 22.4.2(@vue/compiler-sfc@3.5.22) version: 22.4.2(@vue/compiler-sfc@3.5.22)
unplugin-vue-components: unplugin-vue-components:
specifier: ^29.0.0 specifier: ^29.2.0
version: 29.1.0(@babel/parser@7.28.4)(vue@3.5.22(typescript@5.9.2)) version: 29.2.0(@babel/parser@7.28.4)(vue@3.5.22(typescript@5.9.2))
unplugin-vue-markdown: unplugin-vue-markdown:
specifier: ^29.1.0 specifier: ^29.2.0
version: 29.2.0(vite@7.1.10(@types/node@22.18.11)(jiti@2.6.1)(lightningcss@1.30.1)(sass-embedded@1.93.2)(sass@1.93.2)(terser@5.44.0)(yaml@2.8.1)) version: 29.2.0(vite@7.1.10(@types/node@22.18.11)(jiti@2.6.1)(lightningcss@1.30.1)(sass-embedded@1.93.2)(sass@1.93.2)(terser@5.44.0)(yaml@2.8.1))
unplugin-vue-router: unplugin-vue-router:
specifier: ^0.16.0 specifier: ^0.16.0
@@ -5402,8 +5402,8 @@ packages:
resolution: {integrity: sha512-5lWVjgi6vuHhJ526bI4nlCOmkCIF3nnfXkCMDeMJrtdvxTs6ZFCM8oNufGTsDbKv/tJ/xj8RpvXjRuPBZJuJog==} resolution: {integrity: sha512-5lWVjgi6vuHhJ526bI4nlCOmkCIF3nnfXkCMDeMJrtdvxTs6ZFCM8oNufGTsDbKv/tJ/xj8RpvXjRuPBZJuJog==}
engines: {node: '>=20.19.0'} engines: {node: '>=20.19.0'}
unplugin-vue-components@29.1.0: unplugin-vue-components@29.2.0:
resolution: {integrity: sha512-z/9ACPXth199s9aCTCdKZAhe5QGOpvzJYP+Hkd0GN1/PpAmsu+W3UlRY3BJAewPqQxh5xi56+Og6mfiCV1Jzpg==} resolution: {integrity: sha512-QxBeBdmEflgtJRgMQMc/z/JVV5lcwXN5nOy5ehX6CKDGylIu6Qn4Goy8X95S0qOxF7EdI+uNhdBd4v5i0bvzCw==}
engines: {node: '>=14'} engines: {node: '>=14'}
peerDependencies: peerDependencies:
'@babel/parser': ^7.15.8 '@babel/parser': ^7.15.8
@@ -11229,7 +11229,7 @@ snapshots:
pathe: 2.0.3 pathe: 2.0.3
picomatch: 4.0.3 picomatch: 4.0.3
unplugin-vue-components@29.1.0(@babel/parser@7.28.4)(vue@3.5.22(typescript@5.9.2)): unplugin-vue-components@29.2.0(@babel/parser@7.28.4)(vue@3.5.22(typescript@5.9.2)):
dependencies: dependencies:
chokidar: 3.6.0 chokidar: 3.6.0
debug: 4.4.3 debug: 4.4.3

View File

@@ -25,7 +25,7 @@ function handleSelect(key: string) {
<NDropdown trigger="hover" placement="bottom-end" :options="options" @select="handleSelect"> <NDropdown trigger="hover" placement="bottom-end" :options="options" @select="handleSelect">
<NButton quaternary class="flex items-center gap-1"> <NButton quaternary class="flex items-center gap-1">
<template #icon> <template #icon>
<icon-clarity:language-line w-4.5 h-4.5 /> <icon-clarity-language-line w-4.5 h-4.5 />
</template> </template>
<span>{{ languageLabels[locale] }}</span> <span>{{ languageLabels[locale] }}</span>
</NButton> </NButton>

View File

@@ -13,17 +13,17 @@ const themeLabels: Record<AppThemeMode, string> = {
{{ themeLabels[appStore.themeMode] }} {{ themeLabels[appStore.themeMode] }}
<template #trigger> <template #trigger>
<NButton quaternary @click="appStore.cycleTheme"> <NButton quaternary @click="appStore.cycleTheme">
<icon-line-md:sunny-filled-loop-to-moon-filled-loop-transition <icon-line-md-sunny-filled-loop-to-moon-filled-loop-transition
v-if="appStore.themeMode === 'light'" v-if="appStore.themeMode === 'light'"
w-4.5 w-4.5
h-4.5 h-4.5
/> />
<icon-line-md:moon-filled-to-sunny-filled-loop-transition <icon-line-md-moon-filled-to-sunny-filled-loop-transition
v-else-if="appStore.themeMode === 'dark'" v-else-if="appStore.themeMode === 'dark'"
w-4.5 w-4.5
h-4.5 h-4.5
/> />
<icon-line-md:computer v-else w-4.5 h-4.5 /> <icon-line-md-computer v-else w-4.5 h-4.5 />
</NButton> </NButton>
</template> </template>
</NTooltip> </NTooltip>

View File

@@ -15,8 +15,8 @@ function toggleCollapsed() {
{{ appStore.sidebarCollapsed ? '展开菜单' : '收起菜单' }} {{ appStore.sidebarCollapsed ? '展开菜单' : '收起菜单' }}
<template #trigger> <template #trigger>
<NButton ref="buttonRef" quaternary @click="toggleCollapsed"> <NButton ref="buttonRef" quaternary @click="toggleCollapsed">
<icon-line-md:menu-fold-right v-if="appStore.sidebarCollapsed" w-4.5 h-4.5 /> <icon-line-md-menu-fold-right v-if="appStore.sidebarCollapsed" w-4.5 h-4.5 />
<icon-line-md:menu-fold-left v-else w-4.5 h-4.5 /> <icon-line-md-menu-fold-left v-else w-4.5 h-4.5 />
</NButton> </NButton>
</template> </template>
</NTooltip> </NTooltip>

View File

@@ -4,6 +4,7 @@ import path from 'node:path';
import AutoImport from 'unplugin-auto-import/vite'; import AutoImport from 'unplugin-auto-import/vite';
import { FileSystemIconLoader } from 'unplugin-icons/loaders'; import { FileSystemIconLoader } from 'unplugin-icons/loaders';
import IconsResolver from 'unplugin-icons/resolver';
import Icons from 'unplugin-icons/vite'; import Icons from 'unplugin-icons/vite';
import Components from 'unplugin-vue-components/vite'; import Components from 'unplugin-vue-components/vite';
import { VueRouterAutoImports } from 'unplugin-vue-router'; import { VueRouterAutoImports } from 'unplugin-vue-router';
@@ -22,12 +23,12 @@ import { TDesignResolver } from 'unplugin-vue-components/resolvers';
import { PrimeVueResolver } from '@primevue/auto-import-resolver'; import { PrimeVueResolver } from '@primevue/auto-import-resolver';
import IconsResolver from 'unplugin-icons/resolver';
import { VantResolver } from '@vant/auto-import-resolver'; import { VantResolver } from '@vant/auto-import-resolver';
// <<<<< // <<<<<
function _getNaiveUiComponentNames() { function _getNaiveUiComponentNames() {
// [dtsTsx](https://github.com/unplugin/unplugin-vue-components/pull/673/files/84e80738885cfe11298f41f070cda94a7a779276)
// 方法1: 从 web-types.json 读取(推荐) // 方法1: 从 web-types.json 读取(推荐)
const webTypesPath = path.resolve('node_modules/naive-ui/web-types.json'); const webTypesPath = path.resolve('node_modules/naive-ui/web-types.json');
if (fs.existsSync(webTypesPath)) { if (fs.existsSync(webTypesPath)) {
@@ -82,7 +83,7 @@ export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
'useMessage', 'useMessage',
'useNotification', 'useNotification',
'useLoadingBar', 'useLoadingBar',
..._getNaiveUiComponentNames(), // ..._getNaiveUiComponentNames(),
], ],
}, },
], ],
@@ -91,12 +92,25 @@ export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
// https://github.com/antfu/unplugin-vue-components // https://github.com/antfu/unplugin-vue-components
Components({ Components({
syncMode: 'default', syncMode: 'default',
dtsTsx: true,
// `__`开头的 // `__`开头的
excludeNames: [/^__/], excludeNames: [/^__/],
// allow auto load markdown components under `./src/components/` // allow auto load markdown components under `./src/components/`
extensions: ['vue', 'md'], extensions: ['vue', 'md'],
// allow auto import and register components used in markdown
include: [/\.vue$/, /\.vue\?vue/, /\.md$/], include: [
// https://github.com/unplugin/unplugin-vue-components/blob/c9117ae93f60f81c8b5a41890cb7fa0133f34a12/src/core/unplugin.ts#L17
/\.vue$/,
/\.vue\?vue/,
/\.vue\.[tj]sx?\?vue/, // for vue-loader with experimentalInlineMatchResource enabled
/\.vue\?v=/,
//
/\.md$/, // allow auto import and register components used in markdown
/\.tsx/,
],
resolvers: [ resolvers: [
AntDesignVueResolver({ AntDesignVueResolver({
importStyle: false, // css in js importStyle: false, // css in js

View File

@@ -1,13 +1,14 @@
import { cloudflare } from '@cloudflare/vite-plugin'; import { cloudflare } from '@cloudflare/vite-plugin';
import { loadEnv } from 'vite';
import type { ConfigEnv, PluginOption } from 'vite'; import type {ConfigEnv, PluginOption} from 'vite';
export function loadPlugin(_configEnv: ConfigEnv): PluginOption { export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
const env = loadEnv(_configEnv.mode, process.cwd());
if (_configEnv.mode === 'test') { if (_configEnv.mode === 'test') {
console.log('cloudflare plugin disabled in test mode'); console.log('cloudflare plugin disabled in test mode');
return []; return [];
} }
if (process.env.VITE_CLOUDFLARE_SERVER_ENABLED !== 'true') { if (env.VITE_CLOUDFLARE_SERVER_ENABLED !== 'true') {
console.log('cloudflare plugin disabled by env'); console.log('cloudflare plugin disabled by env');
return []; return [];
} }

View File

@@ -43,7 +43,10 @@ export const viteConfigRollupOptions: RollupOptions = {
manualChunks: (id: string, _meta: ManualChunkMeta) => { manualChunks: (id: string, _meta: ManualChunkMeta) => {
if (['/src/layouts'].some((prefix) => id.includes(prefix))) { if (['/src/layouts'].some((prefix) => id.includes(prefix))) {
return 'layouts'; const url = new URL(id, 'file://');
if (!url.search /* ?vue&type=script&setup=true&lang.ts */) {
return 'layouts';
}
} }
if (id.includes('meta-layouts')) { if (id.includes('meta-layouts')) {
@@ -53,8 +56,11 @@ export const viteConfigRollupOptions: RollupOptions = {
} }
if (id.includes('index.page.vue')) { if (id.includes('index.page.vue')) {
const parentDir = path.basename(path.dirname(id)); const url = new URL(id, 'file://');
return `${parentDir}-index.page`; if (!url.search /* ?vue&type=script&setup=true&lang.ts */) {
const parentDir = path.basename(path.dirname(id));
return `${parentDir}-index.page`;
}
} }
if (!id.includes('node_modules')) return; if (!id.includes('node_modules')) return;
@@ -84,9 +90,10 @@ export const viteConfigRollupOptions: RollupOptions = {
return 'lib-vendor'; return 'lib-vendor';
} }
if (['naive-ui'].includes(packageName) && id.includes('_internal')) { // // 拆了有问题
return 'lib-naive-ui-internal'; // if (['naive-ui'].includes(packageName) && id.includes('_internal')) {
} // return 'lib-naive-ui-internal';
// }
if (['naive-ui'].includes(packageName)) { if (['naive-ui'].includes(packageName)) {
return 'lib-naive-ui'; return 'lib-naive-ui';

View File

@@ -39,8 +39,6 @@ export default defineConfig(async (configEnv) => {
}, },
define: { define: {
__DEV__: JSON.stringify(!isBuild), __DEV__: JSON.stringify(!isBuild),
// // https://github.com/fi3ework/vite-plugin-checker/issues/569#issuecomment-3254311799
// 'process.env.NODE_ENV': JSON.stringify('production'),
}, },
server: { server: {
allowedHosts: ['.NWCT.DEV'], allowedHosts: ['.NWCT.DEV'],

View File

@@ -1,5 +1,5 @@
/* eslint-disable */ /* eslint-disable */
// Generated by Wrangler by running `wrangler types` (hash: b487ccbfcb48074f7cafff7488cb3acb) // Generated by Wrangler by running `wrangler types` (hash: 84692d03acd392dfe81b48b26e3d156f)
// Runtime types generated with workerd@1.20251008.0 2025-09-09 // Runtime types generated with workerd@1.20251008.0 2025-09-09
declare namespace Cloudflare { declare namespace Cloudflare {
interface GlobalProps { interface GlobalProps {
@@ -10,10 +10,13 @@ declare namespace Cloudflare {
VITE_APP_TITLE: string; VITE_APP_TITLE: string;
VITE_APP_BASE: string; VITE_APP_BASE: string;
VITE_APP_BUILD_SOURCE_MAP: string; VITE_APP_BUILD_SOURCE_MAP: string;
VITE_APP_BUILD_MINIFY: string;
VITE_APP_BUILD_COMMIT: string; VITE_APP_BUILD_COMMIT: string;
VITE_APP_BUILD_TIME: string; VITE_APP_BUILD_TIME: string;
VITE_ENABLE_VUE_DEVTOOLS: string; VITE_ENABLE_VUE_DEVTOOLS: string;
VITE_MENU_SHOW_DEMOS: string; VITE_MENU_SHOW_DEMOS: string;
VITE_MENU_SHOW_ORDER: string;
VITE_CLOUDFLARE_SERVER_ENABLED: string;
} }
} }
interface Env extends Cloudflare.Env {} interface Env extends Cloudflare.Env {}