Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix Husky #4041

Merged
merged 1 commit into from
Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
cache-dependency-path: 'npm-shrinkwrap.json'
check-latest: true
- name: Install dependencies
run: npm install --production --no-audit
run: npm ci --no-audit
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

husky is now an indirect dependency (through @netlify/eslint-config-node) instead of being direct.

Binaries of indirect dependencies are symlinked by npm to the top-level node_modules/.bin/ thanks to deduping. However, this seems to only work without the --production flag.

Also, this is more consistent with the other GitHub actions which all use npm ci --no-audit. Please note this is only for the GitHub action which computes the package size.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this give the wrong result now, though? It now includes devDependencies :/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ehmicky How about doing npm prune --prod after npm ci? It's not ideal but it should be close to what it was before :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #4066

- name: Get size
run: du -sk node_modules | cut -f1 > .delta.packageSize && echo "kb (Package size)" >> .delta.packageSize
- name: Run Delta
Expand Down
12 changes: 6 additions & 6 deletions npm-shrinkwrap.json

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

7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"url": "https://github.com/netlify/cli/issues"
},
"scripts": {
"prepare": "husky install node_modules/@netlify/eslint-config-node/.husky/",
"prepublishOnly": "run-s prepublishOnly:*",
"prepublishOnly:test": "run-local \"npm test\"",
"start": "node ./bin/run",
Expand Down Expand Up @@ -221,11 +222,5 @@
"failWithoutAssertions": false,
"tap": false,
"timeout": "5m"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-push": "npm run format"
}
}
}