Skip to content

Commit

Permalink
Revert "chore: remove husky"
Browse files Browse the repository at this point in the history
This reverts commit 7e928cb.
  • Loading branch information
MilanKovacic committed Apr 8, 2024
1 parent cc74ce7 commit 6e466bd
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

<%= packageManager %> exec pretty-quick --staged && <%= packageManager %> exec concurrently <%= packageManager %>:test <%= packageManager %>:lint
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ module.exports = class SingleSpaReactGenerator extends PnpmGenerator {
this.destinationPath(".gitignore"),
this.options
);
this.fs.copyTpl(
this.templatePath(`../../common-templates/.husky/pre-commit`),
this.destinationPath(`.husky/pre-commit`),
this.options
);

if (this.options.typescript) {
this.fs.copyTpl(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"check-format": "prettier --check .",
"test": "cross-env BABEL_ENV=test jest",
"watch-tests": "cross-env BABEL_ENV=test jest --watch",
"prepare": "husky install",
"coverage": "cross-env BABEL_ENV=test jest --coverage"
},
"devDependencies": {
Expand All @@ -29,6 +30,7 @@
"eslint-config-prettier": "^8.3.0",
"eslint-config-react-important-stuff": "^3.0.0",
"eslint-plugin-prettier": "^3.4.1",
"husky": "^7.0.2",
"identity-obj-proxy": "^3.0.0",
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ module.exports = class SingleSpaRootConfigGenerator extends PnpmGenerator {
this.options
);

this.fs.copyTpl(
this.templatePath(`../../common-templates/.husky/pre-commit`),
this.destinationPath(`.husky/pre-commit`),
this.options
);

this.fs.copyTpl(
this.templatePath(".eslintrc.ejs"),
this.destinationPath(".eslintrc"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"test": "cross-env BABEL_ENV=test jest --passWithNoTests",
"format": "prettier --write .",
"check-format": "prettier --check .",
"prepare": "husky install",
"build": "concurrently <%- packageManager %>:build:*",
"build:webpack": "webpack --mode=production"
},
Expand All @@ -22,6 +23,7 @@
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.1",
"html-webpack-plugin": "^5.3.2",
"husky": "^7.0.2",
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
"prettier": "^2.3.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ module.exports = class SingleSpaSvelteGenerator extends PnpmGenerator {
this.destinationPath(`.gitignore`),
this.options
);
this.fs.copyTpl(
this.templatePath(`../../common-templates/.husky/pre-commit`),
this.destinationPath(`.husky/pre-commit`),
this.options
);
this.fs.copyTpl(
this.templatePath(`.prettierignore`),
this.destinationPath(`.prettierignore`),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"start": "rollup -c -w",
"serve": "sirv dist -c",
"test": "jest",
"prepare": "husky install",
"format": "prettier --write --plugin-search-dir=. .",
"check-format": "prettier --plugin-search-dir=. --check ."
},
Expand All @@ -26,7 +27,7 @@
"rollup-plugin-svelte": "^7.1.0",
"rollup-plugin-terser": "^7.0.2",
"svelte": "^3.42.3",
"svelte-jester": "^2.3.2"
"svelte-jester": "^2.0.0"
},
"dependencies": {
"single-spa-svelte": "^2.1.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ module.exports = class SingleSpaUtilModuleGenerator extends PnpmGenerator {
this.destinationPath(".gitignore"),
this.options
);
this.fs.copyTpl(
this.templatePath(`../../common-templates/.husky/pre-commit`),
this.destinationPath(`.husky/pre-commit`),
this.options
);
this.fs.copyTpl(
this.templatePath("webpack.config.js"),
this.destinationPath("webpack.config.js"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint": "eslint src --ext js<% if (typescript) { %>,ts,tsx<% } %>",
"format": "prettier --write .",
"check-format": "prettier --check .",
"prepare": "husky install",
"test": "cross-env BABEL_ENV=test jest --passWithNoTests",
"watch-tests": "cross-env BABEL_ENV=test jest --watch",
"coverage": "cross-env BABEL_ENV=test jest --coverage"
Expand All @@ -26,6 +27,7 @@
"eslint-config-prettier": "^8.3.0",
"eslint-config-important-stuff": "^1.1.0",
"eslint-plugin-prettier": "^3.4.1",
"husky": "^7.0.2",
"identity-obj-proxy": "^3.0.0",
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
Expand Down
1 change: 1 addition & 0 deletions packages/generator-single-spa/test/react.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ describe("generator-single-spa-react", () => {
});
runResult.assertFile("jest.config.js");
runResult.assertFile("babel.config.json");
runResult.assertFile(".husky/pre-commit");
});
});

0 comments on commit 6e466bd

Please sign in to comment.