@zwa73/dev-utils 1.0.84 → 1.0.86

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.
Files changed (34) hide show
  1. package/bin/cli +1 -1
  2. package/data/template/base/package.json +4 -4
  3. package/data/template/base/scripts/expand-macro.ps1 +2 -0
  4. package/data/template/base/scripts/release.ps1 +1 -1
  5. package/data/template/base/tsconfig.cjs.json +2 -3
  6. package/data/template/base/tsconfig.compile.json +5 -0
  7. package/data/template/base/tsconfig.json +1 -0
  8. package/data/template/base/tsconfig.mjs.json +2 -3
  9. package/data/template/electron/eslint.config.js +33 -0
  10. package/data/template/electron/package-lock.json +44 -3432
  11. package/data/template/electron/package.json +1 -6
  12. package/data/template/electron/tsconfig.json +2 -1
  13. package/dist/cjs/Command/GenTemplate.js +10 -2
  14. package/dist/cjs/Command/Release.js +2 -2
  15. package/dist/cjs/Command/RouteInterface.d.ts +2 -0
  16. package/dist/cjs/Command/RouteInterface.js +5 -3
  17. package/dist/mjs/Command/GenTemplate.js +11 -3
  18. package/dist/mjs/Command/Release.js +3 -3
  19. package/dist/mjs/Command/RouteInterface.d.ts +2 -0
  20. package/dist/mjs/Command/RouteInterface.js +4 -2
  21. package/package.json +3 -2
  22. package/data/template/electron/.eslintrc.js +0 -41
  23. package/dist/cjs/Macro.macro.d.ts +0 -1
  24. package/dist/cjs/Macro.macro.js +0 -3
  25. package/dist/cjs/test/testRegex.macro.d.ts +0 -1
  26. package/dist/cjs/test/testRegex.macro.js +0 -11
  27. package/dist/cjs/test/testRegexa.macro.d.ts +0 -1
  28. package/dist/cjs/test/testRegexa.macro.js +0 -4
  29. package/dist/mjs/Macro.macro.d.ts +0 -1
  30. package/dist/mjs/Macro.macro.js +0 -2
  31. package/dist/mjs/test/testRegex.macro.d.ts +0 -1
  32. package/dist/mjs/test/testRegex.macro.js +0 -9
  33. package/dist/mjs/test/testRegexa.macro.d.ts +0 -1
  34. package/dist/mjs/test/testRegexa.macro.js +0 -2
package/bin/cli CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  const {cliRoute} = require('../dist/cjs/index.js');
4
4
 
@@ -2,14 +2,16 @@
2
2
  "name": "<%= projectName %>",
3
3
  "version": "1.0.0",
4
4
  "description": "<%= projectDescription %>",
5
- "type": "module",
6
5
  "exports": {
7
6
  ".": {
8
7
  "require": "./dist/cjs/index.js",
9
8
  "import": "./dist/mjs/index.js"
10
9
  }
11
10
  },
11
+ "types": "./dist/mjs/index.d.ts",
12
12
  "scripts": {
13
+ "test": "jest",
14
+ "expand-macro": "powershell scripts/expand-macro",
13
15
  "release": "powershell scripts/release",
14
16
  "compile": "powershell scripts/compile",
15
17
  "watch": "powershell scripts/watch"
@@ -18,8 +20,6 @@
18
20
  "license": "ISC",
19
21
  "files": [
20
22
  "data",
21
- "dist",
22
- "index.js",
23
- "index.d.ts"
23
+ "dist"
24
24
  ]
25
25
  }
@@ -0,0 +1,2 @@
1
+ Write-Output 开始展开宏
2
+ npx zcli Expand-Macro
@@ -1,4 +1,4 @@
1
1
  Write-Output 开始编译
2
2
  npm run compile
3
3
  Write-Output 开始发布
4
- node bin/cli release
4
+ npx zcli release
@@ -1,9 +1,8 @@
1
1
  {
2
- "extends": "./tsconfig.json",
2
+ "extends": "./tsconfig.compile.json",
3
3
  "compilerOptions": {
4
4
  "module": "commonjs",
5
5
  "outDir": "./dist/cjs",
6
6
  "target": "ES2022"
7
- },
8
- "include": ["./src/**/*.ts", "./src/**/*.js"]
7
+ }
9
8
  }
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "include": ["./src/**/*.ts", "./src/**/*.js"],
4
+ "exclude": ["./node_modules/**/*","./src/**/*.macro.ts"]
5
+ }
@@ -4,6 +4,7 @@
4
4
  "strict": true,
5
5
  "module": "commonjs",
6
6
  "moduleResolution": "node",
7
+ "target": "ES2022",
7
8
  "esModuleInterop": true,
8
9
  "outDir": "./dist",
9
10
  "declaration": true,
@@ -1,10 +1,9 @@
1
1
  {
2
- "extends": "./tsconfig.json",
2
+ "extends": "./tsconfig.compile.json",
3
3
  "compilerOptions": {
4
4
  "module": "ESNext",
5
5
  "outDir": "./dist/mjs",
6
6
  "target": "ESNext",
7
7
  "allowSyntheticDefaultImports": true
8
- },
9
- "include": ["./src/**/*.ts", "./src/**/*.js"]
8
+ }
10
9
  }
@@ -0,0 +1,33 @@
1
+ const {parser:tsparser,plugin:tsplugin} = require('typescript-eslint');
2
+ const globals = require("globals");
3
+
4
+ module.exports = [
5
+ {
6
+ ignores: ["webpack.*",".webpack/**","*.js", "dist/**", "backup/**", "scripts/**"],
7
+ plugins: {
8
+ "@typescript-eslint": tsplugin
9
+ },
10
+ languageOptions: {
11
+ ecmaVersion: 2022,
12
+ sourceType: 'module',
13
+ parser:tsparser,
14
+ parserOptions: {
15
+ project: "tsconfig.json",
16
+ tsconfigRootDir: __dirname
17
+ },
18
+ globals: {
19
+ ...globals.node,
20
+ ...globals.browser
21
+ },
22
+ },
23
+ },
24
+ {
25
+ files: ['src/**/*.ts','src/**/*.tsx'],
26
+ ignores: ['src/test/**'],
27
+ rules: {
28
+ semi: ['error', 'always'],
29
+ '@typescript-eslint/promise-function-async': 'error',
30
+ '@typescript-eslint/no-floating-promises': 'error',
31
+ },
32
+ }
33
+ ];