Skip to content

Commit

Permalink
chore: v4.0 init pnpm vite3x
Browse files Browse the repository at this point in the history
  • Loading branch information
richard1015 committed Nov 25, 2022
1 parent 8d0001f commit 74b406e
Show file tree
Hide file tree
Showing 9 changed files with 9,004 additions and 24 deletions.
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
registry=https://registry.npmjs.org
registry=https://registry.npmmirror.com/
engine-strict=true
strict-peer-dependencies=false
19 changes: 11 additions & 8 deletions jd/generate-nutui.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const package = require('../package.json');
const config = require('../src/config.json');
const path = require('path');
const fs = require('fs-extra');
import packageConfig from '../package.json' assert { type: 'json' };
import config from '../src/config.json' assert { type: 'json' };
import { fileURLToPath } from 'url';
import { resolve, dirname } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
import { outputFile } from 'fs-extra';
let importStr = `import { App } from 'vue';
import Locale from './locale';\n`;
let importScssStr = `\n`;
Expand All @@ -26,11 +29,11 @@ let installFunction = `function install(app: App) {
}`;
let fileStrBuild = `${importStr}
${installFunction}
const version = '${package.version}';
const version = '${packageConfig.version}';
export { install, version, Locale, ${packages.join(',')}};
export default { install, version, Locale};`;

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

Expand All @@ -39,7 +42,7 @@ ${installFunction}
${importScssStr}
export const testComponents = { ${packages.join(',')}};
export { install, Locale, ${packages.join(',')} };
export default { install, version:'${package.version}', Locale};`;
fs.outputFile(path.resolve(__dirname, '../src/packages/nutui.vue.ts'), fileStrDev, 'utf8', (error) => {
export default { install, version:'${packageConfig.version}', Locale};`;
outputFile(resolve(__dirname, '../src/packages/nutui.vue.ts'), fileStrDev, 'utf8', (error) => {
// logger.success(`${package_config_path} 文件写入成功`);
});
22 changes: 14 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "@nutui/nutui",
"version": "3.2.7",
"version": "4.0.0",
"description": "京东风格的轻量级移动端 Vue2、Vue3 组件库(支持小程序开发)",
"main": "dist/nutui.umd.js",
"module": "dist/nutui.es.js",
"style": "dist/style.css",
"type": "module",
"typings": "dist/types/index.d.ts",
"vetur": {
"tags": "dist/smartips/tags.json",
Expand Down Expand Up @@ -89,15 +90,15 @@
"@types/node": "^17.0.16",
"@typescript-eslint/eslint-plugin": "^4.20.0",
"@typescript-eslint/parser": "^4.20.0",
"@vitejs/plugin-legacy": "^1.6.4",
"@vitejs/plugin-vue": "^2.1.0",
"@vue/compiler-sfc": "^3.2.30",
"@vitejs/plugin-vue": "^3.2.0",
"@vue/compiler-sfc": "^3.2.45",
"@vue/eslint-config-prettier": "^6.0.0",
"@vue/eslint-config-typescript": "^7.0.0",
"@vue/test-utils": "^2.0.0-rc.18",
"autoprefixer": "^10.3.4",
"axios": "^0.21.0",
"canvas": "^2.9.0",
"codesandbox": "^2.2.3",
"cz-git": "^1.3.8",
"eslint": "^7.23.2",
"eslint-plugin-prettier": "^3.3.1",
Expand All @@ -113,14 +114,15 @@
"markdown-it-container": "^3.0.0",
"prettier": "^2.0.0",
"remark-codesandbox": "^0.10.1",
"rollup-plugin-visualizer": "^5.8.3",
"standard-version": "^9.3.0",
"swiper": "6.5.1",
"transliteration": "^2.2.0",
"ts-jest": "^26.5.5",
"typescript": "^4.6.4",
"vite": "^2.9.15",
"vite-plugin-dts": "1.4.1",
"vite-plugin-md": "^0.11.8",
"typescript": "^4.9.3",
"vite": "^3.2.4",
"vite-plugin-dts": "^1.7.1",
"vite-plugin-md": "^0.20.4",
"vue": "^3.2.24",
"vue-jest": "^5.0.0-alpha.7"
},
Expand Down Expand Up @@ -149,6 +151,10 @@
"path": "node_modules/cz-git"
}
},
"engines": {
"node": ">= 16.0.0",
"pnpm": ">= 7.0.0"
},
"lint-staged": {
"*.md": "prettier --write",
"*.{ts,tsx,js,vue,scss}": "prettier --write"
Expand Down
Loading

0 comments on commit 74b406e

Please sign in to comment.