@10stars/config 14.0.0 → 14.0.1
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 +1 -1
- package/src/index.ts +7 -8
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -11,7 +11,8 @@ interface Config {
|
|
|
11
11
|
|
|
12
12
|
const exec = (cmd: string) => {
|
|
13
13
|
console.info(`Executing: ${cmd}`)
|
|
14
|
-
|
|
14
|
+
// bunx is optimized for running scripts
|
|
15
|
+
execSync(`bunx ${cmd}`, { cwd, stdio: `inherit` }) // make execSync process to use the parent's: "stdin", "stdout", "stderr" streams
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
const getConfig = async (): Promise<Config | null> =>
|
|
@@ -28,8 +29,7 @@ const getESLintCommonCmd = async () => {
|
|
|
28
29
|
.join(` `)} ${process.env.CI ? `--quiet` : ``}`
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
const typecheck = () =>
|
|
32
|
-
exec(`bun run tsc --project ./tsconfig.json --noEmit --watch`)
|
|
32
|
+
const typecheck = () => exec(`tsc --project ./tsconfig.json --noEmit --watch`)
|
|
33
33
|
|
|
34
34
|
const actions = {
|
|
35
35
|
prepare: {
|
|
@@ -46,7 +46,7 @@ const actions = {
|
|
|
46
46
|
action: async () => {
|
|
47
47
|
const isMonorepo = await checkIsMonorepo(cwd)
|
|
48
48
|
exec(
|
|
49
|
-
`
|
|
49
|
+
`prettier -l --write './${isMonorepo ? `*/` : ``}src/**/*.{t,j}s{x,}'`,
|
|
50
50
|
)
|
|
51
51
|
},
|
|
52
52
|
},
|
|
@@ -60,19 +60,18 @@ const actions = {
|
|
|
60
60
|
},
|
|
61
61
|
typecheckOnce: {
|
|
62
62
|
info: `Typecheck code (once)`,
|
|
63
|
-
action: () => exec(`
|
|
63
|
+
action: () => exec(`tsc --project ./tsconfig.json --noEmit`),
|
|
64
64
|
},
|
|
65
65
|
lint: {
|
|
66
66
|
info: `Lint code (once)`,
|
|
67
|
-
action: async () =>
|
|
68
|
-
exec(`bun run eslint --fix ${await getESLintCommonCmd()}`),
|
|
67
|
+
action: async () => exec(`eslint --fix ${await getESLintCommonCmd()}`),
|
|
69
68
|
},
|
|
70
69
|
precommit: {
|
|
71
70
|
info: `Run pre-commit hooks`,
|
|
72
71
|
action: () => {
|
|
73
72
|
const pathCommitlint = new URL(`../commitlint.config.js`, import.meta.url)
|
|
74
73
|
.pathname
|
|
75
|
-
exec(`
|
|
74
|
+
exec(`commitlint --edit --config ${pathCommitlint}`)
|
|
76
75
|
},
|
|
77
76
|
},
|
|
78
77
|
} satisfies Record<string, { info: string; action: () => void | Promise<void> }>
|