Skip to content

Commit

Permalink
chore: upgrade lerna/commitlint/husky/commitlint
Browse files Browse the repository at this point in the history
  • Loading branch information
ambar committed Mar 18, 2024
1 parent 753f71a commit 638491c
Show file tree
Hide file tree
Showing 7 changed files with 2,959 additions and 4,945 deletions.
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn lint-staged
22 changes: 22 additions & 0 deletions .yarn/plugins/plugin-hook-scripts.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
name: `plugin-hook-scripts`,
factory: (require) => {
/** @type {import('@yarnpkg/core')} */
const {scriptUtils} = require('@yarnpkg/core')
return {
hooks: {
async afterAllInstalled(
/** @type {import('@yarnpkg/core').Project} */ project
) {
const script = 'yarn:afterAllInstalled'
const locator = project.topLevelWorkspace.anchoredLocator
if (await scriptUtils.hasPackageScript(locator, script, {project})) {
await scriptUtils.executePackageScript(locator, script, [], {
project,
})
}
},
},
}
},
}
3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ plugins:
- checksum: 7930a64ba6239d4502df0204edda913788df1a9614a9056d23b53345d844f6f13526dae71c2be5282071502c3c077db7b1e97bcf019037db3ca35c737cd25b0c
path: .yarn/plugins/plugin-dedupe-on-install.cjs
spec: "https://raw.githubusercontent.com/ambar/yarn-plugin-dedupe-on-install/main/index.js"
- checksum: 2bf08235ccdfb0b95f511d4f0b0383a14de6c06e0c37e20e61c6ba939b85934542fbc6ff502387858722ac8b10f24c6b0a28a93536b628bd2e9446a491b40f29
path: .yarn/plugins/plugin-hook-scripts.cjs
spec: "https://raw.githubusercontent.com/ambar/yarn-plugin-hook-scripts/main/index.js"
3 changes: 1 addition & 2 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@
],
"version": "1.31.0",
"conventionalCommits": true,
"npmClient": "yarn",
"useWorkspaces": true
"npmClient": "yarn"
}
17 changes: 6 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"zhihu-video-player"
],
"scripts": {
"yarn:afterAllInstalled": "husky",
"lint": "eslint --cache . ",
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
"test:coverage": "yarn test --coverage",
Expand All @@ -45,7 +46,7 @@
"start": "yarn start-server"
},
"devDependencies": {
"@commitlint/config-conventional": "^7.5.0",
"@commitlint/config-conventional": "^19.1.0",
"@rollup/plugin-alias": "^5.1.0",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
Expand All @@ -56,19 +57,19 @@
"@types/jest": "^27.0.1",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"commitlint": "^7.5.2",
"commitlint": "^19.2.0",
"es-jest": "^2.1.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"husky": "^1.3.1",
"husky": "^9.0.11",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lerna": "^3.13.1",
"lint-staged": "^8.1.5",
"lerna": "^8.1.2",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand All @@ -77,12 +78,6 @@
"rollup-plugin-typescript2": "^0.36.0",
"typescript": "^5.4.2"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"lint-staged": {
"*.{json,md,css}": [
"prettier --write",
Expand Down
Loading

0 comments on commit 638491c

Please sign in to comment.