@mateoserrano/simple-config 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mateoserrano/simple-config",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "Initialize ESLint, Prettier, Husky and lint-staged for modern TypeScript projects",
package/src/constants.js CHANGED
@@ -64,4 +64,9 @@ export const devDepFiles = {
64
64
  }
65
65
  export const addHuskyPrepare = 'npm pkg set scripts.prepare="husky"'
66
66
  export const installCmd = (installNames) => `npm install -D ${installNames.join(' ')} --save-exact`
67
- export const setupHuskyCommand = 'npx husky add .husky/pre-commit "npx lint-staged"'
67
+ export const setupHuskyCommand = 'echo "' +
68
+ '#!/usr/bin/env sh\n' +
69
+ '. "$(dirname -- "$0")/_/husky.sh"\n\n' +
70
+ 'npx lint-staged"' +
71
+ '> .husky/pre-commit'
72
+ export const authorizeHuskyCommand = 'chmod +x .husky/pre-commit'
package/src/functions.js CHANGED
@@ -2,12 +2,11 @@ import {
2
2
  copyFilesToTargetOrSkip,
3
3
  getInstallNames,
4
4
  getTemplatesFolder,
5
- runCommand,
6
5
  runCommandSilent,
7
6
  verifyNodePackage,
8
7
  } from './core/index.js'
9
8
  import {
10
- addHuskyPrepare,
9
+ addHuskyPrepare, authorizeHuskyCommand,
11
10
  devDepFiles,
12
11
  devDeps,
13
12
  installCmd,
@@ -17,7 +16,8 @@ import {
17
16
  const runAddPrepareCommand = () => runCommandSilent(addHuskyPrepare)
18
17
  const runInstallCommand = (installNames) => runCommandSilent(installCmd(installNames))
19
18
  const runHuskyCommand = () => {
20
- runCommand(setupHuskyCommand)
19
+ runCommandSilent(setupHuskyCommand)
20
+ runCommandSilent(authorizeHuskyCommand)
21
21
  }
22
22
  const getInstallationArguments = () => getInstallNames(devDeps)
23
23