diff --git a/apps/admin/autoResolver/components.d.ts b/apps/admin/autoResolver/components.d.ts index 023b1f5..5b641ad 100644 --- a/apps/admin/autoResolver/components.d.ts +++ b/apps/admin/autoResolver/components.d.ts @@ -11,38 +11,64 @@ declare module 'vue' { CAAppNaiveUIProvider: typeof import('@celeris/components')['CAAppNaiveUIProvider'] CACharts: typeof import('@celeris/components')['CACharts'] CAIcon: typeof import('@celeris/components')['CAIcon'] + NAlert: typeof import('@celeris/ca-components')['NAlert'] NAvatar: typeof import('@celeris/ca-components')['NAvatar'] + NBadge: typeof import('@celeris/ca-components')['NBadge'] NBreadcrumb: typeof import('@celeris/ca-components')['NBreadcrumb'] NBreadcrumbItem: typeof import('@celeris/ca-components')['NBreadcrumbItem'] NButton: typeof import('@celeris/ca-components')['NButton'] NCard: typeof import('@celeris/ca-components')['NCard'] + NCheckbox: typeof import('@celeris/ca-components')['NCheckbox'] NCol: typeof import('@celeris/ca-components')['NCol'] + NCollapse: typeof import('@celeris/ca-components')['NCollapse'] + NCollapseItem: typeof import('@celeris/ca-components')['NCollapseItem'] NColorPicker: typeof import('@celeris/ca-components')['NColorPicker'] NConfigProvider: typeof import('@celeris/ca-components')['NConfigProvider'] + NDescriptions: typeof import('@celeris/ca-components')['NDescriptions'] + NDescriptionsItem: typeof import('@celeris/ca-components')['NDescriptionsItem'] NDialogProvider: typeof import('@celeris/ca-components')['NDialogProvider'] NDivider: typeof import('@celeris/ca-components')['NDivider'] NDrawer: typeof import('@celeris/ca-components')['NDrawer'] NDrawerContent: typeof import('@celeris/ca-components')['NDrawerContent'] NDropdown: typeof import('@celeris/ca-components')['NDropdown'] NEl: typeof import('@celeris/ca-components')['NEl'] + NEmpty: typeof import('@celeris/ca-components')['NEmpty'] + NForm: typeof import('@celeris/ca-components')['NForm'] + NFormItem: typeof import('@celeris/ca-components')['NFormItem'] NGlobalStyle: typeof import('@celeris/ca-components')['NGlobalStyle'] NGrid: typeof import('@celeris/ca-components')['NGrid'] NGridItem: typeof import('@celeris/ca-components')['NGridItem'] + NInput: typeof import('@celeris/ca-components')['NInput'] + NInputGroup: typeof import('@celeris/ca-components')['NInputGroup'] + NLayout: typeof import('@celeris/ca-components')['NLayout'] + NLayoutContent: typeof import('@celeris/ca-components')['NLayoutContent'] + NLayoutSider: typeof import('@celeris/ca-components')['NLayoutSider'] NLoadingBarProvider: typeof import('@celeris/ca-components')['NLoadingBarProvider'] NMenu: typeof import('@celeris/ca-components')['NMenu'] NMessageProvider: typeof import('@celeris/ca-components')['NMessageProvider'] NModal: typeof import('@celeris/ca-components')['NModal'] NNotificationProvider: typeof import('@celeris/ca-components')['NNotificationProvider'] + NPagination: typeof import('@celeris/ca-components')['NPagination'] NPopover: typeof import('@celeris/ca-components')['NPopover'] + NResult: typeof import('@celeris/ca-components')['NResult'] NRow: typeof import('@celeris/ca-components')['NRow'] NScrollbar: typeof import('@celeris/ca-components')['NScrollbar'] NSelect: typeof import('@celeris/ca-components')['NSelect'] NSpace: typeof import('@celeris/ca-components')['NSpace'] NSpin: typeof import('@celeris/ca-components')['NSpin'] + NSplit: typeof import('@celeris/ca-components')['NSplit'] NStatistic: typeof import('@celeris/ca-components')['NStatistic'] + NStep: typeof import('@celeris/ca-components')['NStep'] + NSteps: typeof import('@celeris/ca-components')['NSteps'] NSwitch: typeof import('@celeris/ca-components')['NSwitch'] + NTab: typeof import('@celeris/ca-components')['NTab'] + NTable: typeof import('@celeris/ca-components')['NTable'] + NTabPane: typeof import('@celeris/ca-components')['NTabPane'] + NTabs: typeof import('@celeris/ca-components')['NTabs'] NText: typeof import('@celeris/ca-components')['NText'] + NTime: typeof import('@celeris/ca-components')['NTime'] NTooltip: typeof import('@celeris/ca-components')['NTooltip'] + NVirtualList: typeof import('@celeris/ca-components')['NVirtualList'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] } diff --git a/packages/shared/vite/src/plugins/unocss.ts b/packages/shared/vite/src/plugins/unocss.ts index 76715a4..a17b714 100644 --- a/packages/shared/vite/src/plugins/unocss.ts +++ b/packages/shared/vite/src/plugins/unocss.ts @@ -1,6 +1,6 @@ import UnoCSS from "unocss/vite"; import type { PluginOption } from "vite"; -import unoShareConfig from "@celeris/styles/unoconfig"; +import unoShareConfig from "@celeris/styles/uno.config"; export function createUnoCSSPluginConfig(): PluginOption { return UnoCSS({ diff --git a/packages/web/directives/package.json b/packages/web/directives/package.json index d66f19a..ce80e93 100644 --- a/packages/web/directives/package.json +++ b/packages/web/directives/package.json @@ -6,13 +6,24 @@ "author": "Kirk Lin (https://github.com/kirklin)", "license": "MIT", "homepage": "https://github.com/kirklin/celeris-web", - "main": "index.ts", - "module": "index.ts", - "unpkg": "index.js", - "jsdelivr": "index.js", - "types": "index.d.js", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "require": "./dist/index.cjs" + } + }, + "main": "./index.ts", + "module": "./index.ts", + "types": "./dist/index.d.ts", "scripts": { - "clean": "pnpm rimraf node_modules && pnpm rimraf dist" + "build": "tsup", + "dev": "tsup --stub", + "clean": "pnpm rimraf node_modules && pnpm rimraf dist", + "test": "vitest", + "test:coverage": "vitest run --coverage", + "prepublishOnly": "npm run build", + "postinstall": "npm run build" }, "peerDependencies": { "vue": ">3.0.0" diff --git a/packages/web/styles/tsconfig.json b/packages/web/directives/tsconfig.json similarity index 91% rename from packages/web/styles/tsconfig.json rename to packages/web/directives/tsconfig.json index fd98bd6..33d5487 100644 --- a/packages/web/styles/tsconfig.json +++ b/packages/web/directives/tsconfig.json @@ -8,7 +8,7 @@ ], "baseUrl": ".", "module": "esnext", - "moduleResolution": "Bundler", + "moduleResolution": "Node", "strict": true, "sourceMap": false, "allowSyntheticDefaultImports": true, diff --git a/packages/web/styles/tsup.config.ts b/packages/web/directives/tsup.config.ts similarity index 88% rename from packages/web/styles/tsup.config.ts rename to packages/web/directives/tsup.config.ts index ad32e5e..d41731d 100644 --- a/packages/web/styles/tsup.config.ts +++ b/packages/web/directives/tsup.config.ts @@ -4,7 +4,7 @@ export default defineConfig({ entry: ["./index.ts"], clean: true, format: ["esm", "cjs", "iife"], - external: ["vite"], + external: ["vue"], dts: true, minify: true, }); diff --git a/packages/web/hooks/package.json b/packages/web/hooks/package.json index d9a544c..f9dd814 100644 --- a/packages/web/hooks/package.json +++ b/packages/web/hooks/package.json @@ -6,18 +6,29 @@ "author": "Kirk Lin (https://github.com/kirklin)", "license": "MIT", "homepage": "https://github.com/kirklin/celeris-web", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "require": "./dist/index.cjs" + } + }, "main": "./index.ts", "module": "./index.ts", + "types": "./dist/index.d.ts", "scripts": { + "build": "tsup", + "dev": "tsup --stub", "clean": "pnpm rimraf node_modules && pnpm rimraf dist", "test": "vitest", - "test:coverage": "vitest run --coverage" + "test:coverage": "vitest run --coverage", + "prepublishOnly": "npm run build", + "postinstall": "npm run build" }, "peerDependencies": { "vue": ">=3.3.4" }, "dependencies": { - "@celeris/types": "workspace:*", "@celeris/utils": "workspace:*", "@vueuse/core": "^10.11.0", "@vueuse/integrations": "^10.11.0" diff --git a/packages/web/hooks/src/useLoading.ts b/packages/web/hooks/src/useLoading.ts index 18677fb..7b10777 100644 --- a/packages/web/hooks/src/useLoading.ts +++ b/packages/web/hooks/src/useLoading.ts @@ -1,4 +1,7 @@ -export function useLoading(initValue = false) { +import type { Ref } from "vue"; +import { ref } from "vue"; + +export function useLoading(initValue = false): { loading: Ref; setLoading: (loadingValue: boolean) => void } { const loading = ref(initValue); const setLoading = (loadingValue: boolean) => { loading.value = loadingValue; diff --git a/packages/web/hooks/tsconfig.json b/packages/web/hooks/tsconfig.json new file mode 100644 index 0000000..33d5487 --- /dev/null +++ b/packages/web/hooks/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "@celeris/tsconfig/tsconfig.base.json", + "compilerOptions": { + "target": "esnext", + "lib": [ + "esnext", + "dom" + ], + "baseUrl": ".", + "module": "esnext", + "moduleResolution": "Node", + "strict": true, + "sourceMap": false, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true + }, + "include": [ + "src/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} diff --git a/packages/web/hooks/tsup.config.ts b/packages/web/hooks/tsup.config.ts new file mode 100644 index 0000000..d41731d --- /dev/null +++ b/packages/web/hooks/tsup.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["./index.ts"], + clean: true, + format: ["esm", "cjs", "iife"], + external: ["vue"], + dts: true, + minify: true, +}); diff --git a/packages/web/styles/package.json b/packages/web/styles/package.json index 9395912..a0f13cf 100644 --- a/packages/web/styles/package.json +++ b/packages/web/styles/package.json @@ -7,24 +7,13 @@ "license": "MIT", "homepage": "https://github.com/kirklin/celeris-web", "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs" - }, - "./unoconfig": "./uno.config.ts" + "./*": "./*", + ".": "./" }, - "main": "./index.ts", - "module": "./index.ts", "files": [ - "src", - "uno.config.ts" + "**/*.css" ], "scripts": { - "build": "tsup", - "dev": "tsup --stub", - "clean": "pnpm rimraf node_modules && pnpm rimraf dist", - "prepublishOnly": "nr build" }, "peerDependencies": { "unocss": "^0.61.0" diff --git a/packages/web/utils/package.json b/packages/web/utils/package.json index 03b4eab..f8d7a41 100644 --- a/packages/web/utils/package.json +++ b/packages/web/utils/package.json @@ -14,7 +14,7 @@ "require": "./dist/index.cjs" } }, - "main": "./dist/index.cjs", + "main": "src/index.ts", "module": "src/index.ts", "types": "./dist/index.d.ts", "files": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e3cada3..75cc827 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -387,9 +387,6 @@ importers: packages/web/hooks: dependencies: - '@celeris/types': - specifier: workspace:* - version: link:../types '@celeris/utils': specifier: workspace:* version: link:../utils