@lntvow/dev 3.1.1 → 3.2.5
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": "3.
|
|
3
|
+
"version": "3.2.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "开发环境依赖包",
|
|
6
6
|
"keywords": [
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@commitlint/cli": "^19.3.0",
|
|
20
20
|
"@commitlint/config-conventional": "^19.2.2",
|
|
21
|
-
"@lntvow/eslint-config": "^9.
|
|
21
|
+
"@lntvow/eslint-config": "^9.16.2",
|
|
22
22
|
"bumpp": "^9.4.1",
|
|
23
23
|
"commitizen": "^4.3.0",
|
|
24
24
|
"cz-conventional-changelog": "^3.3.0",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"simple-git-hooks": "^2.11.1"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
|
-
"
|
|
31
|
-
"
|
|
30
|
+
"postinstall": "node ./script/postinstall.js && npx simple-git-hooks",
|
|
31
|
+
"type-check": "tsc --noEmit",
|
|
32
32
|
"rimraf": "rimraf ./node_modules/",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
33
|
+
"commit": "git add . && git-cz && git push",
|
|
34
|
+
"release": "git add . && bumpp package.json --all --commit --no-tag --push"
|
|
35
35
|
}
|
|
36
36
|
}
|
package/script/postinstall.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import fs
|
|
1
|
+
import fs from 'node:fs'
|
|
2
2
|
import path from 'node:path'
|
|
3
3
|
import { fileURLToPath } from 'node:url'
|
|
4
|
-
import { exec } from 'node:child_process'
|
|
5
4
|
import dayjs from 'dayjs'
|
|
6
5
|
import utc from 'dayjs/plugin/utc.js'
|
|
7
6
|
import timezone from 'dayjs/plugin/timezone.js'
|
|
@@ -9,26 +8,11 @@ import timezone from 'dayjs/plugin/timezone.js'
|
|
|
9
8
|
dayjs.extend(timezone)
|
|
10
9
|
dayjs.extend(utc)
|
|
11
10
|
|
|
12
|
-
// eslint-disable-next-line id-length
|
|
13
|
-
const n = {
|
|
14
|
-
log: str => {
|
|
15
|
-
const time = dayjs().tz('Asia/Shanghai').format('YYYY-MM-DD HH:mm:ss')
|
|
16
|
-
|
|
17
|
-
// appendFileSync(examplePath, `${time}: ${str}\n`)
|
|
18
|
-
},
|
|
19
|
-
}
|
|
20
|
-
|
|
21
11
|
const __filename = fileURLToPath(import.meta.url)
|
|
22
12
|
const __dirname = path.dirname(__filename)
|
|
23
13
|
|
|
24
14
|
const [cwd] = process.cwd().split('node_modules')
|
|
25
15
|
|
|
26
|
-
const examplePath = path.resolve(cwd, `./lntvow.dev.log.${dayjs().tz('Asia/Shanghai').format('YYYY-MM-DD_HH-mm-ss')}`)
|
|
27
|
-
// 创建文件
|
|
28
|
-
// fs.writeFileSync(examplePath, '')
|
|
29
|
-
|
|
30
|
-
n.log('postinstall 开始执行')
|
|
31
|
-
|
|
32
16
|
function copyDirectorySync(source, target) {
|
|
33
17
|
// 创建目标目录(如果不存在)
|
|
34
18
|
if (!fs.existsSync(target)) {
|
|
@@ -57,20 +41,3 @@ function copyDirectorySync(source, target) {
|
|
|
57
41
|
|
|
58
42
|
// 复制模板文件
|
|
59
43
|
copyDirectorySync(path.resolve(__dirname, './tmp'), cwd)
|
|
60
|
-
|
|
61
|
-
n.log('postinstall 文件复制完毕')
|
|
62
|
-
|
|
63
|
-
n.log('开始执行 npx simple-git-hooks')
|
|
64
|
-
|
|
65
|
-
// 初始化
|
|
66
|
-
exec('npx simple-git-hooks', { cwd }, (err, str) => {
|
|
67
|
-
n.log('执行成功 npx simple-git-hooks')
|
|
68
|
-
|
|
69
|
-
if (err) {
|
|
70
|
-
n.log('npx simple-git-hooks 执行失败')
|
|
71
|
-
} else {
|
|
72
|
-
n.log('npx simple-git-hooks 执行成功')
|
|
73
|
-
n.log(str)
|
|
74
|
-
//
|
|
75
|
-
}
|
|
76
|
-
})
|