@zwa73/dev-utils 1.0.62 → 1.0.64

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.
@@ -49,8 +49,6 @@
49
49
  },
50
50
  "license": "MIT",
51
51
  "dependencies": {
52
- "@zwa73/react-utils": "*",
53
- "@zwa73/utils": "*",
54
52
  "electron-squirrel-startup": "^1.0.1",
55
53
  "react": "^18.3.1",
56
54
  "react-dom": "^18.3.1",
@@ -0,0 +1,31 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES6",
4
+ "allowJs": true,
5
+ "module": "commonjs",
6
+ "skipLibCheck": true,
7
+ "esModuleInterop": true,
8
+ "noImplicitAny": true,
9
+ "sourceMap": true,
10
+ "baseUrl": ".",
11
+ "outDir": "dist",
12
+ "moduleResolution": "node",
13
+ "resolveJsonModule": true,
14
+ "strict": true,
15
+ "jsx": "react-jsx",
16
+ "paths": {
17
+ "*": ["node_modules/*"],
18
+ "@/src/*": ["./src/*"],
19
+ "@/*": ["./*"],
20
+ "@": ["./src/index"],
21
+ "Static": ["./src/Static"],
22
+ "Component": ["./src/Component"]
23
+ }
24
+ },
25
+ "include": [
26
+ "./src/**/*.ts",
27
+ "./src/**/*.tsx",
28
+ "webpack.plugins.ts"
29
+ ],
30
+ "exclude": ["./node_modules/**/*"]
31
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "include": ["./src/**/*.ts", "./src/**/*.js"]
4
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "allowJs": true,
4
+ "strict": true,
5
+ "target": "ES2022",
6
+ "module": "CommonJS",
7
+ "moduleResolution": "node",
8
+ "esModuleInterop": true,
9
+ "outDir": "./dist",
10
+ "declaration": true,
11
+ "baseUrl": ".",
12
+ "emitDecoratorMetadata": true,
13
+ "experimentalDecorators": true,
14
+ "paths": {
15
+ "@src/*": ["./src/*"],
16
+ "@/*": ["./*"],
17
+ "@": ["./src/index"]
18
+ }
19
+ },
20
+ "include": ["./src/**/*.ts", "./src/**/*.js", "./jest/**/*.ts"],
21
+ "exclude": ["./node_modules/**/*"]
22
+ }
@@ -69,7 +69,7 @@ async function installPackage() {
69
69
  /**对项目进行初始化 */
70
70
  const CmdInit = (program) => program
71
71
  .command('Init')
72
- .command('init')
72
+ .alias('init')
73
73
  .description('对当前目录进行项目初始化')
74
74
  .action(async (opt) => {
75
75
  (0, RouteInterface_1.checkProject)();
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ /**对项目进行初始化 */
3
+ export declare const CmdInitElectron: (program: Command) => Command;
@@ -26,12 +26,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.CmdCreateElectronFrame = void 0;
29
+ exports.CmdInitElectron = void 0;
30
30
  const fs = __importStar(require("fs"));
31
31
  const pathe_1 = __importDefault(require("pathe"));
32
32
  const utils_1 = require("@zwa73/utils");
33
33
  const RouteInterface_1 = require("./RouteInterface");
34
34
  const InitDataPath = pathe_1.default.join(RouteInterface_1.DATA_PATH, 'CreateElectronFrame');
35
+ (async () => {
36
+ const filelist = await fs.promises.readdir(InitDataPath);
37
+ console.log(filelist);
38
+ })();
35
39
  /**复制基础文件 */
36
40
  async function copyData() {
37
41
  const filelist = await fs.promises.readdir(InitDataPath);
@@ -48,16 +52,16 @@ async function copyData() {
48
52
  await Promise.all(plist);
49
53
  }
50
54
  /**对项目进行初始化 */
51
- const CmdCreateElectronFrame = (program) => program
52
- .command('CreateElectronFrame')
53
- .command('createelectronframe')
55
+ const CmdInitElectron = (program) => program
56
+ .command('Init-Electron')
57
+ .alias('initelectron')
54
58
  .description('对当前目录进行项目初始化,创建Electron基础环境')
55
59
  .action(async (opt) => {
56
- (0, RouteInterface_1.checkProject)();
60
+ //checkProject();
57
61
  utils_1.SLogger.info(`开始初始化设置当前目录 ${RouteInterface_1.PROJECT_PATH}`);
58
62
  await Promise.all([
59
63
  copyData(),
60
64
  utils_1.UtilFunc.exec(`npm install --registry ${RouteInterface_1.MIRROR_SOURCE}`)
61
65
  ]);
62
66
  });
63
- exports.CmdCreateElectronFrame = CmdCreateElectronFrame;
67
+ exports.CmdInitElectron = CmdInitElectron;
@@ -10,9 +10,10 @@ const ScanDups_1 = require("./ScanDups");
10
10
  const GenSchema_1 = require("./GenSchema");
11
11
  const ExpandMacro_1 = require("./ExpandMacro");
12
12
  const GenI18n_1 = require("./GenI18n");
13
- const CreateElectronFrame_1 = require("./CreateElectronFrame");
13
+ const InitElectron_1 = require("./InitElectron");
14
14
  async function cliRoute() {
15
15
  (0, Init_1.CmdInit)(commander_1.program);
16
+ (0, InitElectron_1.CmdInitElectron)(commander_1.program);
16
17
  (0, Node_1.CmdNode)(commander_1.program);
17
18
  (0, Release_1.CmdRelease)(commander_1.program);
18
19
  (0, MapPath_1.CmdMapPath)(commander_1.program);
@@ -20,6 +21,5 @@ async function cliRoute() {
20
21
  (0, GenSchema_1.CmdGenSchema)(commander_1.program);
21
22
  (0, ExpandMacro_1.CmdExpandMacro)(commander_1.program);
22
23
  (0, GenI18n_1.CmdGenI18n)(commander_1.program);
23
- (0, CreateElectronFrame_1.CmdCreateElectronFrame)(commander_1.program);
24
24
  commander_1.program.parse(process.argv);
25
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zwa73/dev-utils",
3
- "version": "1.0.62",
3
+ "version": "1.0.64",
4
4
  "description": "编译与调试工具",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -53,7 +53,7 @@ async function installPackage() {
53
53
  /**对项目进行初始化 */
54
54
  export const CmdInit = (program:Command)=>program
55
55
  .command('Init')
56
- .command('init')
56
+ .alias('init')
57
57
  .description('对当前目录进行项目初始化')
58
58
  .action(async (opt) => {
59
59
  checkProject();
@@ -9,6 +9,13 @@ import { checkProject, DATA_PATH, MIRROR_SOURCE, PROJECT_PATH } from './RouteInt
9
9
 
10
10
  const InitDataPath = path.join(DATA_PATH,'CreateElectronFrame');
11
11
 
12
+ (async ()=>{
13
+
14
+
15
+ const filelist = await fs.promises.readdir(InitDataPath);
16
+ console.log(filelist);
17
+ })();
18
+
12
19
  /**复制基础文件 */
13
20
  async function copyData() {
14
21
  const filelist = await fs.promises.readdir(InitDataPath);
@@ -26,12 +33,12 @@ async function copyData() {
26
33
  }
27
34
 
28
35
  /**对项目进行初始化 */
29
- export const CmdCreateElectronFrame = (program:Command)=>program
30
- .command('CreateElectronFrame')
31
- .command('createelectronframe')
36
+ export const CmdInitElectron = (program:Command)=>program
37
+ .command('Init-Electron')
38
+ .alias('initelectron')
32
39
  .description('对当前目录进行项目初始化,创建Electron基础环境')
33
40
  .action(async (opt) => {
34
- checkProject();
41
+ //checkProject();
35
42
  SLogger.info(`开始初始化设置当前目录 ${PROJECT_PATH}`);
36
43
  await Promise.all([
37
44
  copyData(),
@@ -8,10 +8,11 @@ import { CmdScanDups } from './ScanDups';
8
8
  import { CmdGenSchema } from './GenSchema';
9
9
  import { CmdExpandMacro } from './ExpandMacro';
10
10
  import { CmdGenI18n } from './GenI18n';
11
- import { CmdCreateElectronFrame } from './CreateElectronFrame';
11
+ import { CmdInitElectron } from './InitElectron';
12
12
 
13
13
  export async function cliRoute(){
14
14
  CmdInit(program);
15
+ CmdInitElectron(program);
15
16
  CmdNode(program);
16
17
  CmdRelease(program);
17
18
  CmdMapPath(program);
@@ -19,6 +20,5 @@ export async function cliRoute(){
19
20
  CmdGenSchema(program);
20
21
  CmdExpandMacro(program);
21
22
  CmdGenI18n(program);
22
- CmdCreateElectronFrame(program);
23
23
  program.parse(process.argv);
24
24
  }
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "include": ["./src/**/*.ts", "./src/**/*.js"]
4
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "allowJs": true,
4
+ "strict": true,
5
+ "target": "ES2022",
6
+ "module": "commonjs",
7
+ "moduleResolution": "node",
8
+ "esModuleInterop": true,
9
+ "outDir": "./dist",
10
+ "declaration": true,
11
+ "baseUrl": ".",
12
+ "emitDecoratorMetadata": true,
13
+ "experimentalDecorators": true,
14
+ "paths": {
15
+ "@src/*": ["./src/*"],
16
+ "@/*" : ["./*"],
17
+ "@" : ["./src/index"]
18
+ }
19
+ },
20
+ "include": ["./src/**/*.ts", "./src/**/*.js","./jest/**/*.ts"],
21
+ "exclude": ["./node_modules/**/*"]
22
+ }
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- /**对项目进行初始化 */
3
- export declare const CmdCreateElectronFrame: (program: Command) => Command;