Skip to content

Commit e9bdc9c

Browse files
committed
fix does not include dist file, fix husky not initiate correctly, fix lint stage not working correctly
1 parent 578703e commit e9bdc9c

File tree

6 files changed

+20
-11
lines changed

6 files changed

+20
-11
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@
1010
my-app
1111

1212
# misc
13-
**/.DS_Store
13+
**/.DS_Store
14+
15+
abc

npx/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,8 @@ const { args } = cli.parse()
2121
console.log('Copying...')
2222
execaSync`cp -r ${resolve(getDirname(), '../template')} ${resolve(process.cwd(), args[0])}`
2323
console.log('Copy complete! Installing node modules...')
24-
execaSync('npm', ['i'], { cwd: args[0] })
24+
execaSync(`cd ${resolve(process.cwd(), args[0])} && npm run setup`, {
25+
shell: true,
26+
stdio: 'inherit',
27+
})
2528
console.log('Installation complete! Have fun!')

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "ts-hajime",
33
"description": "Delightfully bootstraps TypeScript npm libraries.",
4-
"version": "0.1.0",
4+
"version": "0.2.0",
55
"scripts": {
6-
"reset": "rm -rf node_modules && npm i",
6+
"setup": "rm -rf node_modules && npm i && husky",
77
"prepublishOnly": "npm run build",
88
"build": "pkgroll --clean-dist && tsup",
99
"test": "vitest",
@@ -20,7 +20,7 @@
2020
"./template/.gitignore"
2121
],
2222
"lint-staged": {
23-
"*": "npm run lint"
23+
"*.{ts,tsx}": "npm run lint"
2424
},
2525
"type": "module",
2626
"main": "./dist/index.cjs",

template/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
**/coverage
1010

1111
# misc
12-
**/.DS_Store
12+
**/.DS_Store

template/package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,25 @@
33
"description": "my-description",
44
"version": "0.0.0",
55
"scripts": {
6+
"setup": "rm -rf node_modules && npm i && git init && husky",
67
"prepublishOnly": "npm run build",
78
"build": "pkgroll --clean-dist && tsup",
89
"test": "vitest",
910
"lint": "eslint --fix",
10-
"tsc": "tsc",
1111
"npx": "tsx npx"
1212
},
1313
"bin": {
1414
"my-app": "./bin/index.cjs"
1515
},
1616
"files": [
17-
"./bin"
17+
"bin",
18+
"dist"
1819
],
1920
"lint-staged": {
20-
"*": "npm run lint"
21+
"*.{ts,tsx}": [
22+
"npm run lint",
23+
"npx tsc"
24+
]
2125
},
2226
"type": "module",
2327
"main": "./dist/index.cjs",

0 commit comments

Comments
 (0)