Skip to content

Commit 8d0429d

Browse files
authored
feat: use catalog to globally upgrade vite and vitest (#2680)
1 parent 1bc3a1e commit 8d0429d

File tree

10 files changed

+79
-13
lines changed

10 files changed

+79
-13
lines changed

internals/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"rollup": "^3.7.3",
2424
"semver": "^7.3.8",
2525
"tsup": "7.2.0",
26-
"vite": "catalog:",
26+
"vite": "^4.3.8",
2727
"typescript": "catalog:",
2828
"tailwindcss": "^3.2.4"
2929
},

internals/unplugin-virtual-template/tsup.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ export default <Options>{
44
entryPoints: ['src/*.ts'],
55
clean: true,
66
format: ['cjs', 'esm'],
7-
dts: true,
7+
dts: false,
88
onSuccess: 'esno scripts/postbuild.ts'
99
}

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,7 @@
229229
"vue@3": "3.4.38",
230230
"vue2": "npm:vue@2.6.14",
231231
"vue2.7": "npm:vue@2.7.10",
232-
"vue3": "npm:vue@3.4.38",
233-
"vite": "catalog:"
232+
"vue3": "npm:vue@3.4.38"
234233
},
235234
"packageExtensions": {
236235
"vue-template-compiler@2.6.14": {

packages/mobile/package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
"sideEffects": false,
2626
"main": "index.ts",
2727
"scripts": {
28-
"build": "pnpm -w build:ui",
29-
"postversion": "pnpm build"
28+
"build": "vite build"
3029
},
3130
"dependencies": {
3231
"@better-scroll/core": "^2.5.0",
@@ -36,6 +35,12 @@
3635
"@opentiny/vue-locale": "workspace:~"
3736
},
3837
"devDependencies": {
39-
"vue": "^3.5.0"
38+
"vue": "^3.5.0",
39+
"typescript": "catalog:",
40+
"vite": "catalog:",
41+
"@vitejs/plugin-vue": "^5.2.1",
42+
"@vitejs/plugin-vue-jsx": "^4.1.1",
43+
"vite-plugin-dts": "^4.3.0",
44+
"vite-svg-loader": "^5.1.0"
4045
}
41-
}
46+
}

packages/mobile/tsconfig.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2020",
4+
"useDefineForClassFields": true,
5+
"module": "ESNext",
6+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
7+
"skipLibCheck": true,
8+
9+
/* Bundler mode */
10+
"moduleResolution": "bundler",
11+
"allowImportingTsExtensions": true,
12+
"resolveJsonModule": true,
13+
"isolatedModules": true,
14+
"noEmit": true,
15+
"jsx": "preserve",
16+
17+
/* Linting */
18+
"strict": true,
19+
"noUnusedLocals": true,
20+
"noUnusedParameters": true,
21+
"noFallthroughCasesInSwitch": true
22+
},
23+
"include": ["components/**/*.ts", "components/**/*.tsx", "components/**/*.vue"],
24+
"references": [{ "path": "./tsconfig.node.json" }]
25+
}

packages/mobile/tsconfig.node.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"composite": true,
4+
"skipLibCheck": true,
5+
"module": "ESNext",
6+
"moduleResolution": "bundler",
7+
"allowSyntheticDefaultImports": true
8+
},
9+
"include": ["vite.config.ts"]
10+
}

packages/mobile/vite.config.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { defineConfig } from 'vite'
2+
import vue from '@vitejs/plugin-vue'
3+
import vueJsx from '@vitejs/plugin-vue-jsx'
4+
import dts from 'vite-plugin-dts'
5+
import svgLoader from 'vite-svg-loader'
6+
7+
// https://vitejs.dev/config/
8+
export default defineConfig({
9+
plugins: [vue(), vueJsx(), dts(), svgLoader()],
10+
build: {
11+
lib: {
12+
entry: './index.ts'
13+
},
14+
minify: true,
15+
rollupOptions: {
16+
external: [/@better-scroll/, /@opentiny/],
17+
input: ['index.ts'],
18+
output: [
19+
{
20+
format: 'es',
21+
entryFileNames: '[name].js',
22+
preserveModules: true
23+
}
24+
]
25+
}
26+
}
27+
})

packages/utils/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"xss": "1.0.14"
2222
},
2323
"devDependencies": {
24-
"typescript": "^5.2.2",
24+
"typescript": "catalog:",
2525
"vite-plugin-dts": "~4.3.0",
26-
"vite": "^6.0.0"
26+
"vite": "catalog:"
2727
}
2828
}

packages/utils/src/crypt/sha256.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ while (mPrime < 64) {
3636

3737
export class SHA256Algo extends Hasher {
3838
_hash: any
39-
_data: any
39+
declare _data: any
4040

4141
_doReset() {
4242
this._hash = new WordArray(H.slice(0))

pnpm-workspace.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ packages:
66

77
# 统一版本,方便维护
88
catalog:
9-
'vitest': '^0.31.0'
10-
'vite': '^4.3.8'
9+
'vitest': '^2.1.8'
10+
'vite': '^6.0.0'
1111
'typescript': '~5.3.3'

0 commit comments

Comments
 (0)