Skip to content

Commit

Permalink
Merge pull request #135 from zowe-actions/fix/lock-down-syncpack
Browse files Browse the repository at this point in the history
Lock down syncpack version and add husky pre-commit hook
  • Loading branch information
t1m0thyj committed Feb 21, 2024
2 parents 4eb88bb + 6383965 commit 0838328
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env sh

if [ -d "$HOME/.nvm" ]; then
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
fi

npm run pack
git add dist
2 changes: 1 addition & 1 deletion dist/run-script.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"test": "jest",
"typedoc": "typedoc --plugin typedoc-plugin-markdown --out docs/typedoc packages/core/src/index.ts",
"watch": "tsc -w",
"all": "npm run build && npm run lint && npm run pack && npm test"
"all": "npm run build && npm run lint && npm run pack && npm test",
"prepare": "husky"
},
"repository": {
"type": "git",
Expand All @@ -33,6 +34,7 @@
"eslint": "^8.33.0",
"eslint-plugin-jest": "^27.2.0",
"eslint-plugin-license-header": "^0.6.0",
"husky": "^9.0.11",
"jest": "^29.4.0",
"jest-circus": "^29.4.0",
"ts-jest": "^29.0.0",
Expand Down
2 changes: 1 addition & 1 deletion script/scripts/npmUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default async function (context: IContext): Promise<void> {
changedFiles.push("**/package.json");
const dependencyList = [...Object.keys(dependencies), ...Object.keys(devDependencies)];

await exec.exec("npx", ["-y", "--", "syncpack", "fix-mismatches", "--dev", "--prod", "--filter",
await exec.exec("npx", ["-y", "--", "syncpack@8", "fix-mismatches", "--dev", "--prod", "--filter",
dependencyList.join("|")]);
await exec.exec("git", ["checkout", lockfilePath]);
await exec.exec("npm", ["install"]);
Expand Down

0 comments on commit 0838328

Please sign in to comment.