Skip to content

Commit 74b406e

Browse files
committed
chore: v4.0 init pnpm vite3x
1 parent 8d0001f commit 74b406e

File tree

9 files changed

+9004
-24
lines changed

9 files changed

+9004
-24
lines changed

.npmrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
registry=https://registry.npmjs.org
1+
registry=https://registry.npmmirror.com/
22
engine-strict=true
3+
strict-peer-dependencies=false

jd/generate-nutui.js

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
const package = require('../package.json');
2-
const config = require('../src/config.json');
3-
const path = require('path');
4-
const fs = require('fs-extra');
1+
import packageConfig from '../package.json' assert { type: 'json' };
2+
import config from '../src/config.json' assert { type: 'json' };
3+
import { fileURLToPath } from 'url';
4+
import { resolve, dirname } from 'path';
5+
const __filename = fileURLToPath(import.meta.url);
6+
const __dirname = dirname(__filename);
7+
import { outputFile } from 'fs-extra';
58
let importStr = `import { App } from 'vue';
69
import Locale from './locale';\n`;
710
let importScssStr = `\n`;
@@ -26,11 +29,11 @@ let installFunction = `function install(app: App) {
2629
}`;
2730
let fileStrBuild = `${importStr}
2831
${installFunction}
29-
const version = '${package.version}';
32+
const version = '${packageConfig.version}';
3033
export { install, version, Locale, ${packages.join(',')}};
3134
export default { install, version, Locale};`;
3235

33-
fs.outputFile(path.resolve(__dirname, '../src/packages/nutui.vue.build.ts'), fileStrBuild, 'utf8', (error) => {
36+
outputFile(resolve(__dirname, '../src/packages/nutui.vue.build.ts'), fileStrBuild, 'utf8', (error) => {
3437
// logger.success(`${package_config_path} 文件写入成功`);
3538
});
3639

@@ -39,7 +42,7 @@ ${installFunction}
3942
${importScssStr}
4043
export const testComponents = { ${packages.join(',')}};
4144
export { install, Locale, ${packages.join(',')} };
42-
export default { install, version:'${package.version}', Locale};`;
43-
fs.outputFile(path.resolve(__dirname, '../src/packages/nutui.vue.ts'), fileStrDev, 'utf8', (error) => {
45+
export default { install, version:'${packageConfig.version}', Locale};`;
46+
outputFile(resolve(__dirname, '../src/packages/nutui.vue.ts'), fileStrDev, 'utf8', (error) => {
4447
// logger.success(`${package_config_path} 文件写入成功`);
4548
});

package.json

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"name": "@nutui/nutui",
3-
"version": "3.2.7",
3+
"version": "4.0.0",
44
"description": "京东风格的轻量级移动端 Vue2、Vue3 组件库(支持小程序开发)",
55
"main": "dist/nutui.umd.js",
66
"module": "dist/nutui.es.js",
77
"style": "dist/style.css",
8+
"type": "module",
89
"typings": "dist/types/index.d.ts",
910
"vetur": {
1011
"tags": "dist/smartips/tags.json",
@@ -89,15 +90,15 @@
8990
"@types/node": "^17.0.16",
9091
"@typescript-eslint/eslint-plugin": "^4.20.0",
9192
"@typescript-eslint/parser": "^4.20.0",
92-
"@vitejs/plugin-legacy": "^1.6.4",
93-
"@vitejs/plugin-vue": "^2.1.0",
94-
"@vue/compiler-sfc": "^3.2.30",
93+
"@vitejs/plugin-vue": "^3.2.0",
94+
"@vue/compiler-sfc": "^3.2.45",
9595
"@vue/eslint-config-prettier": "^6.0.0",
9696
"@vue/eslint-config-typescript": "^7.0.0",
9797
"@vue/test-utils": "^2.0.0-rc.18",
9898
"autoprefixer": "^10.3.4",
9999
"axios": "^0.21.0",
100100
"canvas": "^2.9.0",
101+
"codesandbox": "^2.2.3",
101102
"cz-git": "^1.3.8",
102103
"eslint": "^7.23.2",
103104
"eslint-plugin-prettier": "^3.3.1",
@@ -113,14 +114,15 @@
113114
"markdown-it-container": "^3.0.0",
114115
"prettier": "^2.0.0",
115116
"remark-codesandbox": "^0.10.1",
117+
"rollup-plugin-visualizer": "^5.8.3",
116118
"standard-version": "^9.3.0",
117119
"swiper": "6.5.1",
118120
"transliteration": "^2.2.0",
119121
"ts-jest": "^26.5.5",
120-
"typescript": "^4.6.4",
121-
"vite": "^2.9.15",
122-
"vite-plugin-dts": "1.4.1",
123-
"vite-plugin-md": "^0.11.8",
122+
"typescript": "^4.9.3",
123+
"vite": "^3.2.4",
124+
"vite-plugin-dts": "^1.7.1",
125+
"vite-plugin-md": "^0.20.4",
124126
"vue": "^3.2.24",
125127
"vue-jest": "^5.0.0-alpha.7"
126128
},
@@ -149,6 +151,10 @@
149151
"path": "node_modules/cz-git"
150152
}
151153
},
154+
"engines": {
155+
"node": ">= 16.0.0",
156+
"pnpm": ">= 7.0.0"
157+
},
152158
"lint-staged": {
153159
"*.md": "prettier --write",
154160
"*.{ts,tsx,js,vue,scss}": "prettier --write"

0 commit comments

Comments
 (0)