diff --git a/internals/cli/package.json b/internals/cli/package.json index b878fdca0..06ae60ff3 100644 --- a/internals/cli/package.json +++ b/internals/cli/package.json @@ -23,7 +23,7 @@ "rollup": "^3.7.3", "semver": "^7.3.8", "tsup": "7.2.0", - "vite": "catalog:", + "vite": "^4.3.8", "typescript": "catalog:", "tailwindcss": "^3.2.4" }, diff --git a/internals/unplugin-virtual-template/tsup.config.ts b/internals/unplugin-virtual-template/tsup.config.ts index 5f5f855c1..6f487b083 100644 --- a/internals/unplugin-virtual-template/tsup.config.ts +++ b/internals/unplugin-virtual-template/tsup.config.ts @@ -4,6 +4,6 @@ export default { entryPoints: ['src/*.ts'], clean: true, format: ['cjs', 'esm'], - dts: true, + dts: false, onSuccess: 'esno scripts/postbuild.ts' } diff --git a/package.json b/package.json index 49ee32ed9..ad3eaa095 100644 --- a/package.json +++ b/package.json @@ -229,8 +229,7 @@ "vue@3": "3.4.38", "vue2": "npm:vue@2.6.14", "vue2.7": "npm:vue@2.7.10", - "vue3": "npm:vue@3.4.38", - "vite": "catalog:" + "vue3": "npm:vue@3.4.38" }, "packageExtensions": { "vue-template-compiler@2.6.14": { diff --git a/packages/mobile/package.json b/packages/mobile/package.json index 10bca4527..d15081078 100644 --- a/packages/mobile/package.json +++ b/packages/mobile/package.json @@ -25,8 +25,7 @@ "sideEffects": false, "main": "index.ts", "scripts": { - "build": "pnpm -w build:ui", - "postversion": "pnpm build" + "build": "vite build" }, "dependencies": { "@better-scroll/core": "^2.5.0", @@ -36,6 +35,12 @@ "@opentiny/vue-locale": "workspace:~" }, "devDependencies": { - "vue": "^3.5.0" + "vue": "^3.5.0", + "typescript": "catalog:", + "vite": "catalog:", + "@vitejs/plugin-vue": "^5.2.1", + "@vitejs/plugin-vue-jsx": "^4.1.1", + "vite-plugin-dts": "^4.3.0", + "vite-svg-loader": "^5.1.0" } -} \ No newline at end of file +} diff --git a/packages/mobile/tsconfig.json b/packages/mobile/tsconfig.json new file mode 100644 index 000000000..56c154f08 --- /dev/null +++ b/packages/mobile/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["components/**/*.ts", "components/**/*.tsx", "components/**/*.vue"], + "references": [{ "path": "./tsconfig.node.json" }] +} diff --git a/packages/mobile/tsconfig.node.json b/packages/mobile/tsconfig.node.json new file mode 100644 index 000000000..42872c59f --- /dev/null +++ b/packages/mobile/tsconfig.node.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "composite": true, + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "bundler", + "allowSyntheticDefaultImports": true + }, + "include": ["vite.config.ts"] +} diff --git a/packages/mobile/vite.config.ts b/packages/mobile/vite.config.ts new file mode 100644 index 000000000..22680e7c5 --- /dev/null +++ b/packages/mobile/vite.config.ts @@ -0,0 +1,27 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' +import dts from 'vite-plugin-dts' +import svgLoader from 'vite-svg-loader' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [vue(), vueJsx(), dts(), svgLoader()], + build: { + lib: { + entry: './index.ts' + }, + minify: true, + rollupOptions: { + external: [/@better-scroll/, /@opentiny/], + input: ['index.ts'], + output: [ + { + format: 'es', + entryFileNames: '[name].js', + preserveModules: true + } + ] + } + } +}) diff --git a/packages/utils/package.json b/packages/utils/package.json index 5afaeaf9e..14e9ffb92 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -21,8 +21,8 @@ "xss": "1.0.14" }, "devDependencies": { - "typescript": "^5.2.2", + "typescript": "catalog:", "vite-plugin-dts": "~4.3.0", - "vite": "^6.0.0" + "vite": "catalog:" } } diff --git a/packages/utils/src/crypt/sha256.ts b/packages/utils/src/crypt/sha256.ts index 42dd825e1..0645ed1cd 100644 --- a/packages/utils/src/crypt/sha256.ts +++ b/packages/utils/src/crypt/sha256.ts @@ -36,7 +36,7 @@ while (mPrime < 64) { export class SHA256Algo extends Hasher { _hash: any - _data: any + declare _data: any _doReset() { this._hash = new WordArray(H.slice(0)) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index bfd27e332..ab608b729 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -6,6 +6,6 @@ packages: # 统一版本,方便维护 catalog: - 'vitest': '^0.31.0' - 'vite': '^4.3.8' + 'vitest': '^2.1.8' + 'vite': '^6.0.0' 'typescript': '~5.3.3'