@lntvow/dev 0.1.6 → 0.1.8

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": "@lntvow/dev",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "开发环境依赖包",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -42,35 +42,30 @@ copyDirectorySync(path.resolve(__dirname, './tmp'), cwd)
42
42
  execSync('npx husky install', { cwd })
43
43
 
44
44
  // 写入 lint-staged 配置
45
- setTimeout(() => {
46
- const packageJson = fs.readFileSync(path.resolve(cwd, './package.json'), 'utf8')
47
- const packageJsonObj = JSON.parse(packageJson)
45
+ const packageJson = fs.readFileSync(path.resolve(cwd, './package.json'), 'utf8')
46
+ const packageJsonObj = JSON.parse(packageJson)
48
47
 
49
- if (!packageJsonObj['lint-staged']) {
50
- packageJsonObj['lint-staged'] = {
51
- '*.{js,jsx,ts,tsx,vue}': ['eslint --fix'],
52
- '*.{json,css,scss,md}': ['prettier --write'],
53
- }
54
- }
55
-
56
- if (!packageJsonObj.scripts) {
57
- packageJsonObj.scripts = {}
48
+ if (!packageJsonObj['lint-staged']) {
49
+ packageJsonObj['lint-staged'] = {
50
+ '*.{js,jsx,ts,tsx,vue}': ['eslint --fix'],
51
+ '*.{json,css,scss,md}': ['prettier --write'],
58
52
  }
53
+ }
59
54
 
60
- packageJsonObj.scripts = {
61
- dev: 'vite --host',
62
- 'build:test': 'vite build --mode development',
63
- 'build:uat': 'vite build --mode uat',
64
- 'build:prod': 'vite build',
65
- commit: 'git add . && git-cz && git push',
66
- rimraf: 'rimraf ./node_modules/',
67
- release: 'git add . && bumpp package.json --all --commit --no-tag --push',
68
- ...packageJsonObj.scripts,
69
- }
55
+ if (!packageJsonObj.scripts) {
56
+ packageJsonObj.scripts = {}
57
+ }
70
58
 
71
- fs.writeFileSync(path.resolve(cwd, './package.json'), JSON.stringify(packageJsonObj, null, 2))
72
- console.log('lint-staged 配置写入成功')
59
+ packageJsonObj.scripts = {
60
+ dev: 'vite --host',
61
+ 'build:test': 'vite build --mode development',
62
+ 'build:uat': 'vite build --mode uat',
63
+ 'build:prod': 'vite build',
64
+ commit: 'git add . && git-cz && git push',
65
+ rimraf: 'rimraf ./node_modules/',
66
+ release: 'git add . && bumpp package.json --all --commit --no-tag --push',
67
+ ...packageJsonObj.scripts,
68
+ }
73
69
 
74
- // 格式化代码
75
- execSync('npx lint-staged', { cwd })
76
- }, 5000)
70
+ fs.writeFileSync(path.resolve(cwd, './package.json'), `${JSON.stringify(packageJsonObj, null, 2)}\n`)
71
+ console.log('lint-staged 配置写入成功')