Skip to content

Commit

Permalink
Merge pull request #72 from ximing/pnpm-update
Browse files Browse the repository at this point in the history
refactor: 重构为 pnpm
  • Loading branch information
ximing committed Jul 12, 2023
2 parents 3fd46c8 + 5cb1908 commit 00e33d3
Show file tree
Hide file tree
Showing 13 changed files with 17,135 additions and 15,700 deletions.
46 changes: 46 additions & 0 deletions .cz-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
'use strict'
module.exports = {
types: [
{ value: '✨ feat', name: '新增: 新的内容' },
{ value: '🎨 fix', name: '修复: 修复一个Bug' },
{ value: '📝 docs', name: '文档: 变更的只有文档' },
{ value: '💄 style', name: '格式: 空格, 分号等格式修复' },
{ value: '♻️ refactor', name: '重构: 代码重构,注意和特性、修复区分开' },
{ value: '⚡️ pref', name: '性能: 提升性能' },
{ value: '✅ test', name: '测试: 添加一个测试' },
{ value: '🔧 util', name: '工具: 开发工具变动(构建、脚手架工具等)' },
{ value: '⏪ revert', name: '回滚: 代码回退' }
],
// scopes: [
// { name: "leetcode" },
// { name: "javascript" },
// { name: "typescript" },
// { name: "Vue" },
// { name: "node" },
// ],
// it needs to match the value for field type. Eg.: 'fix'
/* scopeOverrides: {
fix: [
{name: 'merge'},
{name: 'style'},
{name: 'e2eTest'},
{name: 'unitTest'}
]
}, */
// override the messages, defaults are as follows
messages: {
type: '选择一种你的提交类型:',
scope: '选择一个scope (可选):',
// used if allowCustomScopes is true
customScope: 'Denote the SCOPE of this change:',
subject: '短说明:\n',
body: '长说明,使用"|"换行(可选):\n',
breaking: '非兼容性说明 (可选):\n',
footer: '关联关闭的issue,例如:#31, #34(可选):\n',
confirmCommit: '确定提交说明?(yes/no)'
},
allowCustomScopes: true,
allowBreakingChanges: ['特性', '修复'],
// limit subject length
subjectLimit: 100
}
9 changes: 4 additions & 5 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: use Node.js 10
- name: use Node.js 14
uses: actions/setup-node@v1
with:
node-version: '10.x'
node-version: '14.x'
- name: npm script 🔧
run: |
npm install --registry=https://registry.npmjs.org
npm run install:website
npm run build:website
pnpm install --registry=https://registry.npmjs.org
pnpm run build:website
env:
CI: true
- name: Deploy 🚀
Expand Down
4 changes: 4 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.{js,jsx,ts,tsx}": ["prettier --write .", "eslint --fix", "git add"],
"*.md": ["prettier --write"]
}
6 changes: 3 additions & 3 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
registry=https://registry.npmmirror.com
disturl=https://npmmirror.com/mirrors/node/
sass_binary_site=http://npm.taobao.org/mirrors/node-sass/
sass_binary_site=http://npmmirror.com/mirrors/node-sass/
phantomjs_cdnurl=https://npmmirror.com/mirrors/phantomjs/
profiler_binary_host_mirror=https://npmmirror.com/mirrors/node-inspector/
fse_binary_host_mirror=https://npmmirror.com/mirrors/fsevents/
chromedriver_cdnurl=http://npm.taobao.org/mirrors/chromedriver/
selenium_cdnurl=http://npm.taobao.org/mirrorss/selenium/
chromedriver_cdnurl=http://npmmirror.com/mirrors/chromedriver/
selenium_cdnurl=http://npmmirror.com/mirrorss/selenium/
electron_mirror=https://npmmirror.com/mirrors/electron/
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10
14
11 changes: 2 additions & 9 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,8 @@
* Created by ximing on 2018/7/11.
*/
module.exports = {
extends: ['@commitlint/config-conventional'],
extends: ['cz'],
rules: {
'type-enum': [
2,
'always',
['feat', 'fix', 'docs', 'release', 'refactor', 'perf', 'test', 'build', 'ci', 'revert']
],
'scope-empty': [1, 'always'],
'subject-full-stop': [0, 'never'],
'subject-case': [0, 'never']

}
};
4 changes: 0 additions & 4 deletions lerna.json

This file was deleted.

15,641 changes: 0 additions & 15,641 deletions package-lock.json

This file was deleted.

76 changes: 46 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,32 @@
"description": "",
"main": "src/index.js",
"scripts": {
"init": "npm i && lerna bootstrap --force-local --registry=https://registry.npm.taobao.org",
"rm": "rm -rf node_modules && find . -name \"node_modules\" -type d -prune -exec rm -rf '{}' +",
"release": "standard-version",
"release:patch": "npm run release -- --release-as patch",
"release:minor": "npm run release -- --release-as minor",
"release:major": "npm run release -- --release-as major",
"lint": "lint-staged",
"pretty": "prettier --write \"src/**/*.js\"",
"install:website": "cd packages/website && npm i --registry=https://registry.npmjs.com",
"build:website": "cd packages/website && rm -rf .umi dist && npm run build"
"build:website": "cd packages/website && rm -rf .umi dist && npm run build",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"prettier-watch": "onchange '**/*.ts' -- prettier --write {{changed}}",
"eslint": "eslint . --ext .ts,.vue,.js,.tsx",
"prepare": "husky install",
"commit": "git add . && cz",
"preinstall": "npx only-allow pnpm",
"clean": "rimraf node_modules **/*/node_modules",
"cs": "changeset",
"cs:update": "node ./scripts/changeset.mjs",
"cs:version": "changeset version",
"cs:tag": "changeset tag",
"prerelease": "pnpm build",
"release": "changeset publish"
},
"packageManager": "pnpm@7.2.1",
"config": {
"commitizen": {
"path": "node_modules/cz-customizable"
}
},
"repository": {
"type": "git",
Expand All @@ -39,46 +55,46 @@
},
"dependencies": {},
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@changesets/cli": "^2.26.0",
"@commitlint/cli": "^17.4.4",
"@commitlint/config-conventional": "^17.4.4",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"commitizen": "^4.3.0",
"commitlint": "^17.4.4",
"commitlint-config-cz": "^0.13.3",
"cross-env": "^7.0.3",
"cz-conventional-changelog": "^3.3.0",
"cz-customizable": "^6.9.2",
"eslint": "^7.32.0",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-flowtype": "^5.10.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^24.7.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"glob": "^7.2.3",
"husky": "^8.0.3",
"lint-staged": "^13.2.0",
"prettier": "^2.8.6",
"typescript": "^4.9.5",
"@types/core-js": "^2.5.2",
"@types/jest": "^24.0.15",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^24.8.0",
"eslint": "^7.16.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-prettier": "^7.1.0",
"eslint-html-reporter": "^0.7.3",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.21.5",
"husky": "^2.4.1",
"jest": "^24.8.0",
"lerna": "^3.22.1",
"lint-staged": "^10.5.3",
"prettier": "^2.2.1",
"standard-version": "^8.0.1",
"ts-jest": "^24.0.2",
"tsconfig": "^7.0.0",
"typescript-eslint-parser": "^22.0.0"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -e $GIT_PARAMS",
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.js": [
"prettier --write",
"eslint --fix"
]
},
"engines": {
"node": ">=10.0.0"
"node": ">=14.0.0"
},
"standard-version": {}
}
14 changes: 7 additions & 7 deletions packages/mpbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
"registry": "https://registry.npmjs.org"
},
"dependencies": {
"@babel/code-frame": "^7.0.0",
"@babel/core": "^7.22.6",
"@babel/generator": "^7.4.4",
"@babel/parser": "^7.4.5",
"@babel/traverse": "^7.4.5",
"@babel/types": "^7.4.4",
"@babel/register": "^7.4.4",
"@babel/code-frame": "^7.21.4",
"@babel/core": "^7.21.4",
"@babel/generator": "^7.21.4",
"@babel/parser": "^7.21.4",
"@babel/traverse": "^7.21.4",
"@babel/types": "^7.21.4",
"@babel/register": "^7.21.0",
"@yeanzhi/imagemin-jpegtran": "^6.0.0",
"@yeanzhi/imagemin-pngquant": "^8.0.0",
"browser-resolve": "^2.0.0",
Expand Down
Loading

0 comments on commit 00e33d3

Please sign in to comment.