diff --git a/package-lock.json b/package-lock.json index f74587b..37d5424 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,6 @@ "eslint-plugin-regexp": "^1.5.1", "eslint-plugin-simple-import-sort": "^7.0.0", "nano-staged": "^0.5.0", - "simple-git-hooks": "^2.7.0", "typescript": "^4.5.5", "uvu": "^0.5.3", "watchlist": "^0.3.0" @@ -2172,16 +2171,6 @@ "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==", "dev": true }, - "node_modules/simple-git-hooks": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/simple-git-hooks/-/simple-git-hooks-2.7.0.tgz", - "integrity": "sha512-nQe6ASMO9zn5/htIrU37xEIHGr9E6wikXelLbOeTcfsX2O++DHaVug7RSQoq+kO7DvZTH37WA5gW49hN9HTDmQ==", - "dev": true, - "hasInstallScript": true, - "bin": { - "simple-git-hooks": "cli.js" - } - }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -4025,12 +4014,6 @@ "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==", "dev": true }, - "simple-git-hooks": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/simple-git-hooks/-/simple-git-hooks-2.7.0.tgz", - "integrity": "sha512-nQe6ASMO9zn5/htIrU37xEIHGr9E6wikXelLbOeTcfsX2O++DHaVug7RSQoq+kO7DvZTH37WA5gW49hN9HTDmQ==", - "dev": true - }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", diff --git a/package.json b/package.json index b6779c8..39f337a 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,6 @@ "eslint-plugin-regexp": "^1.5.1", "eslint-plugin-simple-import-sort": "^7.0.0", "nano-staged": "^0.5.0", - "simple-git-hooks": "^2.7.0", "typescript": "^4.5.5", "uvu": "^0.5.3", "watchlist": "^0.3.0" diff --git a/postinstall.mjs b/postinstall.mjs index 2892ae3..0c65f4b 100644 --- a/postinstall.mjs +++ b/postinstall.mjs @@ -1,7 +1,7 @@ #!/usr/bin/env zx const { - CI = false, + CI = 'false', INIT_CWD = '', } = process.env; @@ -14,7 +14,14 @@ if (CI !== 'true') { !INIT_CWD.endsWith(`node_modules/${moduleName}`) && INIT_CWD.endsWith(moduleName) ) { + /** + * NOTE: To skip running `simple-git-hooks` in CI environment. + * But `npm x -y -- simple-git-hooks@latest` does not work as expected so splitting it into + * a 2-step process: install without saving as dependency then execute it. + */ + await $`npm i --no-save simple-git-hooks` await $`simple-git-hooks`; + await $`npm dedupe`; } }