@lntvow/dev 0.0.13 → 0.0.15

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,12 +1,13 @@
1
1
  {
2
2
  "name": "@lntvow/dev",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "description": "开发环境依赖包",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": "lntvow",
8
8
  "files": [
9
- "script"
9
+ "script",
10
+ "script/tmp/*"
10
11
  ],
11
12
  "dependencies": {
12
13
  "@commitlint/cli": "^19.1.0",
@@ -1,29 +1,23 @@
1
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'
4
5
 
5
6
  const __filename = fileURLToPath(import.meta.url)
6
7
  const __dirname = path.dirname(__filename)
7
8
 
8
- const cmd = process.cwd().split('node_modules')[0]
9
+ const cwd = process.cwd().split('node_modules')[0]
9
10
 
10
- const list = fs.readdirSync(path.resolve(__dirname, './tmp'), { withFileTypes: true })
11
+ fs.readdirSync(path.resolve(__dirname, './tmp'), { withFileTypes: true }).forEach(item => {
12
+ const sourcePath = path.resolve(item.path, item.name)
13
+ const filePath = path.resolve(cwd, item.name)
14
+ if (fs.existsSync(filePath)) return
11
15
 
12
- fs.writeFileSync(path.resolve(cmd, 'log.text'), `${JSON.stringify(list)}}\n`, {
13
- flag: 'a',
16
+ fs.createReadStream(sourcePath).pipe(fs.createWriteStream(filePath))
14
17
  })
15
18
 
16
- list.forEach(item => {
17
- const sourcePath = path.resolve(item.path, item.name)
18
- const filePath = path.resolve(cmd, item.name)
19
- if (fs.existsSync(filePath)) {
20
- console.log('🍏 ~ filePath: 存在', filePath, sourcePath)
21
- } else {
22
- console.log('🍏 ~ filePath: 不存在', filePath, sourcePath)
23
- fs.createReadStream(sourcePath).pipe(fs.createWriteStream(filePath))
24
- }
19
+ // fs.writeFileSync(path.resolve(cmd, 'log.text'), `${sourcePath}}\n`, {
20
+ // flag: 'a',
21
+ // })
25
22
 
26
- fs.writeFileSync(path.resolve(cmd, 'log.text'), `${sourcePath}}\n`, {
27
- flag: 'a',
28
- })
29
- })
23
+ exec('npx husky install', { cwd })
@@ -0,0 +1,34 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ .DS_Store
12
+ dist
13
+ dist-ssr
14
+ coverage
15
+ *.local
16
+
17
+ /cypress/videos/
18
+ /cypress/screenshots/
19
+
20
+ # Editor directories and files
21
+ *.suo
22
+ *.ntvs*
23
+ *.njsproj
24
+ *.sln
25
+ *.sw?
26
+ /test-results/
27
+ /playwright-report/
28
+ /playwright/.cache/
29
+ /test-results/
30
+ /playwright-report/
31
+ /playwright/.cache/
32
+ /test-results/
33
+ /playwright-report/
34
+ /playwright/.cache/
@@ -0,0 +1,3 @@
1
+ shamefully-hoist=true
2
+ auto-install-peers=true
3
+ # registry=https://registry.npmjs.org