Skip to content

Commit

Permalink
Merge pull request #357 from layer5io/351-pre-commit
Browse files Browse the repository at this point in the history
chore(repo): move pre-commit and prepare-commit-msg to package.json
  • Loading branch information
nebula-aac authored Nov 19, 2023
2 parents cf9b69e + 5ef0d06 commit 4b3dbf1
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 26 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@ jobs:

- name: Identify changed packages
run: |
CHANGED_PACKAGES=$(yarn lerna changed --json | jq -r '.[].name' || echo "Error parsing JSON")
echo $CHANGED_PACKAGES
CHANGED_PACKAGES=$(yarn lerna changed --json)
echo "Raw JSON output:"
echo "$CHANGED_PACKAGES"
CHANGED_PACKAGES_NAMES=$(echo "$CHANGED_PACKAGES" | jq -r '.[].name' || echo "Error parsing JSON")
echo "Parsed package names:"
echo "$CHANGED_PACKAGES_NAMES"
- name: Version packages
run: ./scripts/version-prerelease-packages.sh $CHANGED_PACKAGES
run: ./scripts/version-prerelease-packages.sh $CHANGED_PACKAGES_NAMES

- name: Commit changes
run: |
Expand Down
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

6 changes: 0 additions & 6 deletions .husky/prepare-commit-msg

This file was deleted.

33 changes: 21 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,38 @@
"packages/*"
],
"scripts": {
"prepare": "node -e \"try { require('husky').install() } catch (e) {if (e.code !== 'MODULE_NOT_FOUND') throw e}\"",
"commit:sign": "git cz -S",
"clean": "lerna clean -y",
"build-all": "lerna run build",
"clean": "lerna clean -y",
"commit": "cz",
"commit:sign": "cz -s",
"commitlint": "commitlint --edit",
"format:check": "prettier --check \"**/*.{ts,tsx,md}\" --config ./.prettierrc",
"format:write": "prettier --write \"**/*.{ts,tsx,md}\" --config ./.prettierrc",
"postinstall": "husky install",
"lint": "eslint ."
"lint": "eslint .",
"prepare": "node -e \"try { require('husky').install() } catch (e) {if (e.code !== 'MODULE_NOT_FOUND') throw e}\""
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"prepare-commit-msg": "exec < /dev/tty && yarn cz --hook || true"
}
},
"lint-staged": {
"*.{ts,tsx,md}": [
"eslint --fix",
"yarn format:write"
"prettier --write",
"eslint --fix"
]
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"devDependencies": {
"@commitlint/cli": "^17.7.2",
"@commitlint/config-conventional": "^17.7.0",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.49.0",
"husky": "^8.0.0",
Expand All @@ -37,10 +51,5 @@
"tsconfig": "workspace:^",
"typescript": "^5.2.2"
},
"packageManager": "[email protected]",
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
}
"packageManager": "[email protected]"
}
3 changes: 2 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3321,7 +3321,7 @@ __metadata:
languageName: node
linkType: hard

"commitizen@npm:^4.0.3":
"commitizen@npm:^4.0.3, commitizen@npm:^4.3.0":
version: 4.3.0
resolution: "commitizen@npm:4.3.0"
dependencies:
Expand Down Expand Up @@ -9328,6 +9328,7 @@ __metadata:
dependencies:
"@commitlint/cli": ^17.7.2
"@commitlint/config-conventional": ^17.7.0
commitizen: ^4.3.0
cz-conventional-changelog: ^3.3.0
eslint: ^8.49.0
husky: ^8.0.0
Expand Down

0 comments on commit 4b3dbf1

Please sign in to comment.