@lakutata/cli 1.0.5 → 1.0.9

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 (116) hide show
  1. package/.idea/codeStyles/Project.xml +18 -0
  2. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  3. package/build/CLI.js +1 -1
  4. package/build/CLI.js.map +1 -1
  5. package/build/constants/LicenseList.js.map +1 -1
  6. package/build/interfaces/IApplicationInfo.d.ts +1 -1
  7. package/build/interfaces/IComponentInfo.d.ts +1 -1
  8. package/build/interfaces/IModuleInfo.d.ts +1 -1
  9. package/build/interfaces/IPluginInfo.d.ts +1 -1
  10. package/build/interfaces/IProjectGeneratorOptions.d.ts +2 -2
  11. package/build/lib/generators/application/ApplicationGenerator.d.ts +2 -2
  12. package/build/lib/generators/application/ApplicationGenerator.js +2 -2
  13. package/build/lib/generators/application/ApplicationGenerator.js.map +1 -1
  14. package/build/lib/generators/application/files/AppFile.d.ts +2 -2
  15. package/build/lib/generators/application/files/AppFile.js.map +1 -1
  16. package/build/lib/generators/application/files/ConfigFile.d.ts +2 -2
  17. package/build/lib/generators/application/files/ConfigFile.js.map +1 -1
  18. package/build/lib/generators/component/ComponentGenerator.d.ts +2 -2
  19. package/build/lib/generators/component/ComponentGenerator.js.map +1 -1
  20. package/build/lib/generators/component/files/ComponentFile.d.ts +2 -2
  21. package/build/lib/generators/component/files/ComponentFile.js +1 -1
  22. package/build/lib/generators/component/files/ComponentFile.js.map +1 -1
  23. package/build/lib/generators/component/files/ComponentTestFile.d.ts +2 -2
  24. package/build/lib/generators/component/files/ComponentTestFile.js.map +1 -1
  25. package/build/lib/generators/module/ModuleGenerator.d.ts +2 -2
  26. package/build/lib/generators/module/ModuleGenerator.js +1 -1
  27. package/build/lib/generators/module/ModuleGenerator.js.map +1 -1
  28. package/build/lib/generators/module/files/ModuleFile.d.ts +2 -2
  29. package/build/lib/generators/module/files/ModuleFile.js +6 -6
  30. package/build/lib/generators/module/files/ModuleFile.js.map +1 -1
  31. package/build/lib/generators/module/files/ModuleTestFile.d.ts +2 -2
  32. package/build/lib/generators/module/files/ModuleTestFile.js.map +1 -1
  33. package/build/lib/generators/plugin/PluginGenerator.d.ts +2 -2
  34. package/build/lib/generators/plugin/PluginGenerator.js.map +1 -1
  35. package/build/lib/generators/plugin/files/PluginFile.d.ts +2 -2
  36. package/build/lib/generators/plugin/files/PluginFile.js.map +1 -1
  37. package/build/lib/generators/plugin/files/PluginTestFile.d.ts +2 -2
  38. package/build/lib/generators/plugin/files/PluginTestFile.js.map +1 -1
  39. package/build/lib/generators/project/ProjectGenerator.d.ts +2 -2
  40. package/build/lib/generators/project/ProjectGenerator.js +5 -5
  41. package/build/lib/generators/project/ProjectGenerator.js.map +1 -1
  42. package/build/lib/generators/project/ProjectSourceFile.d.ts +1 -1
  43. package/build/lib/generators/project/configs/ProjectEslintrcConfig.d.ts +13 -13
  44. package/build/lib/generators/project/configs/ProjectEslintrcConfig.js +24 -24
  45. package/build/lib/generators/project/configs/ProjectPackageConfig.js +19 -23
  46. package/build/lib/generators/project/configs/ProjectPackageConfig.js.map +1 -1
  47. package/build/lib/generators/project/configs/ProjectTypescriptConfig.js +12 -12
  48. package/build/lib/manipulators/CreateComponentManipulator.js +2 -2
  49. package/build/lib/manipulators/CreateComponentManipulator.js.map +1 -1
  50. package/build/lib/manipulators/CreateModuleManipulator.js +7 -7
  51. package/build/lib/manipulators/CreateModuleManipulator.js.map +1 -1
  52. package/build/lib/manipulators/CreatePluginManipulator.js +1 -1
  53. package/build/lib/manipulators/CreatePluginManipulator.js.map +1 -1
  54. package/build/lib/manipulators/CreateProcessManipulator.js +1 -1
  55. package/build/lib/manipulators/CreateProcessManipulator.js.map +1 -1
  56. package/build/lib/manipulators/CreateThreadManipulator.js +1 -1
  57. package/build/lib/manipulators/CreateThreadManipulator.js.map +1 -1
  58. package/build/lib/manipulators/application/ApplicationIndexManipulator.js +2 -2
  59. package/build/lib/manipulators/application/ApplicationIndexManipulator.js.map +1 -1
  60. package/build/lib/menus/MainMenu.js +17 -17
  61. package/build/lib/menus/MainMenu.js.map +1 -1
  62. package/build/lib/menus/initializeMenus/InitializeApplicationProject.js +10 -10
  63. package/build/lib/menus/initializeMenus/InitializeApplicationProject.js.map +1 -1
  64. package/build/lib/menus/initializeMenus/InitializeComponentProject.js +10 -10
  65. package/build/lib/menus/initializeMenus/InitializeComponentProject.js.map +1 -1
  66. package/build/lib/menus/initializeMenus/InitializeModuleProject.js +10 -10
  67. package/build/lib/menus/initializeMenus/InitializeModuleProject.js.map +1 -1
  68. package/build/lib/menus/initializeMenus/InitializePluginProject.js +10 -10
  69. package/build/lib/menus/initializeMenus/InitializePluginProject.js.map +1 -1
  70. package/build/lib/menus/manipulateMenus/ManipulateApplicationProject.js +8 -8
  71. package/build/lib/menus/manipulateMenus/ManipulateApplicationProject.js.map +1 -1
  72. package/build/lib/menus/manipulateMenus/ManipulateModuleProject.js +7 -7
  73. package/build/lib/menus/manipulateMenus/ManipulateModuleProject.js.map +1 -1
  74. package/package.json +16 -21
  75. package/src/CLI.ts +2 -2
  76. package/src/constants/LicenseList.ts +2 -2
  77. package/src/interfaces/IApplicationInfo.ts +2 -2
  78. package/src/interfaces/IComponentInfo.ts +2 -2
  79. package/src/interfaces/IModuleInfo.ts +2 -2
  80. package/src/interfaces/IPluginInfo.ts +2 -2
  81. package/src/interfaces/IProjectGeneratorOptions.ts +3 -3
  82. package/src/lib/generators/application/ApplicationGenerator.ts +8 -8
  83. package/src/lib/generators/application/files/AppFile.ts +3 -3
  84. package/src/lib/generators/application/files/ConfigFile.ts +3 -3
  85. package/src/lib/generators/component/ComponentGenerator.ts +6 -6
  86. package/src/lib/generators/component/files/ComponentFile.ts +4 -4
  87. package/src/lib/generators/component/files/ComponentTestFile.ts +3 -3
  88. package/src/lib/generators/module/ModuleGenerator.ts +7 -7
  89. package/src/lib/generators/module/files/ModuleFile.ts +9 -9
  90. package/src/lib/generators/module/files/ModuleTestFile.ts +3 -3
  91. package/src/lib/generators/plugin/PluginGenerator.ts +6 -6
  92. package/src/lib/generators/plugin/files/PluginFile.ts +4 -4
  93. package/src/lib/generators/plugin/files/PluginTestFile.ts +4 -4
  94. package/src/lib/generators/project/ProjectGenerator.ts +13 -13
  95. package/src/lib/generators/project/ProjectSourceFile.ts +2 -2
  96. package/src/lib/generators/project/configs/ProjectEslintrcConfig.ts +24 -24
  97. package/src/lib/generators/project/configs/ProjectPackageConfig.ts +19 -23
  98. package/src/lib/generators/project/configs/ProjectTypescriptConfig.ts +12 -12
  99. package/src/lib/manipulators/CreateComponentManipulator.ts +5 -5
  100. package/src/lib/manipulators/CreateModuleManipulator.ts +12 -12
  101. package/src/lib/manipulators/CreatePluginManipulator.ts +6 -6
  102. package/src/lib/manipulators/CreateProcessManipulator.ts +6 -6
  103. package/src/lib/manipulators/CreateThreadManipulator.ts +6 -6
  104. package/src/lib/manipulators/application/ApplicationIndexManipulator.ts +4 -4
  105. package/src/lib/menus/MainMenu.ts +18 -18
  106. package/src/lib/menus/initializeMenus/InitializeApplicationProject.ts +13 -12
  107. package/src/lib/menus/initializeMenus/InitializeComponentProject.ts +13 -12
  108. package/src/lib/menus/initializeMenus/InitializeModuleProject.ts +13 -12
  109. package/src/lib/menus/initializeMenus/InitializePluginProject.ts +13 -12
  110. package/src/lib/menus/manipulateMenus/ManipulateApplicationProject.ts +9 -9
  111. package/src/lib/menus/manipulateMenus/ManipulateModuleProject.ts +8 -8
  112. package/src/tests/generators/GenerateApplication.spec.ts +2 -2
  113. package/src/tests/generators/GenerateComponent.spec.ts +2 -2
  114. package/src/tests/generators/GenerateModule.spec.ts +2 -2
  115. package/src/tests/generators/GeneratePlugin.spec.ts +2 -2
  116. package/outputs/.gitkeep +0 -0
@@ -1,8 +1,8 @@
1
- import {IGenerator} from "../../../interfaces/IGenerator";
2
- import {IModuleInfo} from "../../../interfaces/IModuleInfo";
3
- import {ProjectGenerator} from "../project/ProjectGenerator";
4
- import {ModuleFile} from "./files/ModuleFile";
5
- import {ModuleTestFile} from "./files/ModuleTestFile";
1
+ import {IGenerator} from '../../../interfaces/IGenerator'
2
+ import {IModuleInfo} from '../../../interfaces/IModuleInfo'
3
+ import {ProjectGenerator} from '../project/ProjectGenerator'
4
+ import {ModuleFile} from './files/ModuleFile'
5
+ import {ModuleTestFile} from './files/ModuleTestFile'
6
6
 
7
7
  export class ModuleGenerator implements IGenerator {
8
8
  private readonly projectPath: string
@@ -67,7 +67,7 @@ export class ModuleGenerator implements IGenerator {
67
67
  'src/modules',
68
68
  'src/components',
69
69
  'src/plugins',
70
- 'src/tests',
70
+ 'src/tests'
71
71
  ],
72
72
  outputDir: this.outputDir,
73
73
  sourceDir: this.sourceDir,
@@ -92,4 +92,4 @@ export class ModuleGenerator implements IGenerator {
92
92
  })
93
93
  await projectGenerator.generate()
94
94
  }
95
- }
95
+ }
@@ -1,5 +1,5 @@
1
- import {ProjectSourceFile} from "../../project/ProjectSourceFile";
2
- import {Scope, SourceFile, StructureKind} from "ts-morph";
1
+ import {ProjectSourceFile} from '../../project/ProjectSourceFile'
2
+ import {Scope, SourceFile, StructureKind} from 'ts-morph'
3
3
 
4
4
  export class ModuleFile extends ProjectSourceFile {
5
5
  readonly filePath: string
@@ -25,7 +25,7 @@ export class ModuleFile extends ProjectSourceFile {
25
25
  {
26
26
  docs: [{
27
27
  kind: StructureKind.JSDoc,
28
- description: "Module plugins"
28
+ description: 'Module plugins'
29
29
  }],
30
30
  kind: StructureKind.Property,
31
31
  name: 'plugins',
@@ -38,7 +38,7 @@ export class ModuleFile extends ProjectSourceFile {
38
38
  {
39
39
  docs: [{
40
40
  kind: StructureKind.JSDoc,
41
- description: "Module components"
41
+ description: 'Module components'
42
42
  }],
43
43
  kind: StructureKind.Property,
44
44
  name: 'components',
@@ -51,7 +51,7 @@ export class ModuleFile extends ProjectSourceFile {
51
51
  {
52
52
  docs: [{
53
53
  kind: StructureKind.JSDoc,
54
- description: "Subset modules"
54
+ description: 'Subset modules'
55
55
  }],
56
56
  kind: StructureKind.Property,
57
57
  name: 'modules',
@@ -64,7 +64,7 @@ export class ModuleFile extends ProjectSourceFile {
64
64
  {
65
65
  docs: [{
66
66
  kind: StructureKind.JSDoc,
67
- description: "Module threads"
67
+ description: 'Module threads'
68
68
  }],
69
69
  kind: StructureKind.Property,
70
70
  name: 'threads',
@@ -77,7 +77,7 @@ export class ModuleFile extends ProjectSourceFile {
77
77
  {
78
78
  docs: [{
79
79
  kind: StructureKind.JSDoc,
80
- description: "Module processes"
80
+ description: 'Module processes'
81
81
  }],
82
82
  kind: StructureKind.Property,
83
83
  name: 'processes',
@@ -90,7 +90,7 @@ export class ModuleFile extends ProjectSourceFile {
90
90
  {
91
91
  docs: [{
92
92
  kind: StructureKind.JSDoc,
93
- description: "Module workflows"
93
+ description: 'Module workflows'
94
94
  }],
95
95
  kind: StructureKind.Property,
96
96
  name: 'workflows',
@@ -113,4 +113,4 @@ export class ModuleFile extends ProjectSourceFile {
113
113
  })
114
114
  return file
115
115
  }
116
- }
116
+ }
@@ -1,5 +1,5 @@
1
- import {ProjectSourceFile} from "../../project/ProjectSourceFile";
2
- import {SourceFile} from "ts-morph";
1
+ import {ProjectSourceFile} from '../../project/ProjectSourceFile'
2
+ import {SourceFile} from 'ts-morph'
3
3
 
4
4
  export class ModuleTestFile extends ProjectSourceFile {
5
5
  readonly filePath: string
@@ -33,4 +33,4 @@ export class ModuleTestFile extends ProjectSourceFile {
33
33
  })
34
34
  return file
35
35
  }
36
- }
36
+ }
@@ -1,8 +1,8 @@
1
- import {IGenerator} from "../../../interfaces/IGenerator";
2
- import {IPluginInfo} from "../../../interfaces/IPluginInfo";
3
- import {ProjectGenerator} from "../project/ProjectGenerator";
4
- import {PluginFile} from "./files/PluginFile";
5
- import {PluginTestFile} from "./files/PluginTestFile";
1
+ import {IGenerator} from '../../../interfaces/IGenerator'
2
+ import {IPluginInfo} from '../../../interfaces/IPluginInfo'
3
+ import {ProjectGenerator} from '../project/ProjectGenerator'
4
+ import {PluginFile} from './files/PluginFile'
5
+ import {PluginTestFile} from './files/PluginTestFile'
6
6
 
7
7
  export class PluginGenerator implements IGenerator {
8
8
  private readonly projectPath: string
@@ -82,4 +82,4 @@ export class PluginGenerator implements IGenerator {
82
82
  })
83
83
  await projectGenerator.generate()
84
84
  }
85
- }
85
+ }
@@ -1,5 +1,5 @@
1
- import {ProjectSourceFile} from "../../project/ProjectSourceFile";
2
- import {ModuleDeclarationKind, Scope, SourceFile, StructureKind} from "ts-morph";
1
+ import {ProjectSourceFile} from '../../project/ProjectSourceFile'
2
+ import {ModuleDeclarationKind, Scope, SourceFile, StructureKind} from 'ts-morph'
3
3
 
4
4
  export class PluginFile extends ProjectSourceFile {
5
5
  readonly filePath: string
@@ -45,6 +45,6 @@ export class PluginFile extends ProjectSourceFile {
45
45
  writer.writeLine('//Codes in here will be executed on plugin activation')
46
46
  writer.writeLine('//Plugin is always executed in transient mode')
47
47
  })
48
- return file;
48
+ return file
49
49
  }
50
- }
50
+ }
@@ -1,8 +1,8 @@
1
- import {ProjectSourceFile} from "../../project/ProjectSourceFile";
2
- import {SourceFile} from "ts-morph";
1
+ import {ProjectSourceFile} from '../../project/ProjectSourceFile'
2
+ import {SourceFile} from 'ts-morph'
3
3
 
4
4
  export class PluginTestFile extends ProjectSourceFile {
5
- readonly filePath: string;
5
+ readonly filePath: string
6
6
  private readonly className: string
7
7
 
8
8
  constructor(className: string) {
@@ -33,4 +33,4 @@ export class PluginTestFile extends ProjectSourceFile {
33
33
  })
34
34
  return file
35
35
  }
36
- }
36
+ }
@@ -1,15 +1,15 @@
1
- import {Project, ts} from "ts-morph"
1
+ import {Project, ts} from 'ts-morph'
2
2
  import path from 'path'
3
- import {ProjectTypescriptConfig} from "./configs/ProjectTypescriptConfig";
4
- import {ProjectPackageConfig} from "./configs/ProjectPackageConfig";
5
- import {IPreparePackageConfigOptions} from "../../../interfaces/IPreparePackageConfigOptions";
6
- import {ProjectEslintrcConfig} from "./configs/ProjectEslintrcConfig";
3
+ import {ProjectTypescriptConfig} from './configs/ProjectTypescriptConfig'
4
+ import {ProjectPackageConfig} from './configs/ProjectPackageConfig'
5
+ import {IPreparePackageConfigOptions} from '../../../interfaces/IPreparePackageConfigOptions'
6
+ import {ProjectEslintrcConfig} from './configs/ProjectEslintrcConfig'
7
7
  import simpleGit, {RemoteWithRefs, SimpleGit, SimpleGitTaskCallback} from 'simple-git'
8
- import {GitError} from "simple-git/src/lib/errors/git-error";
9
- import {IProjectGeneratorOptions} from "../../../interfaces/IProjectGeneratorOptions";
10
- import {IGenerator} from "../../../interfaces/IGenerator";
11
- import {GitIgnore} from "../../../constants/GitIgnore";
12
- import {ProjectSourceFile} from "./ProjectSourceFile";
8
+ import {GitError} from 'simple-git/src/lib/errors/git-error'
9
+ import {IProjectGeneratorOptions} from '../../../interfaces/IProjectGeneratorOptions'
10
+ import {IGenerator} from '../../../interfaces/IGenerator'
11
+ import {GitIgnore} from '../../../constants/GitIgnore'
12
+ import {ProjectSourceFile} from './ProjectSourceFile'
13
13
  import latestVersion from 'latest-version'
14
14
 
15
15
  export class ProjectGenerator implements IGenerator {
@@ -64,7 +64,7 @@ export class ProjectGenerator implements IGenerator {
64
64
  try {
65
65
  const git: SimpleGit = simpleGit({
66
66
  baseDir: this.projectDir,
67
- binary: 'git',
67
+ binary: 'git'
68
68
  })
69
69
  return new Promise<string | null>(resolve => {
70
70
  const callback: SimpleGitTaskCallback & any = function <E extends GitError = GitError>(err: E, data: RemoteWithRefs[]) {
@@ -117,7 +117,7 @@ export class ProjectGenerator implements IGenerator {
117
117
  rebuild: `npm run clean && npm run build`,
118
118
  prepare: `npm run compile`,
119
119
  compile: `npm run rebuild && shx rm -rf ./${this.outputDir}/tests/*`,
120
- test: `./node_modules/.bin/mocha -r ./node_modules/ts-node/register src/tests/**/*.spec.ts`
120
+ test: `node -r ./node_modules/ts-node/register src/tests/**/*.spec.ts`
121
121
  }
122
122
  packageConfig.scripts = options.scripts ? Object.assign(packageConfig.scripts, options.scripts) : packageConfig.scripts
123
123
  packageConfig.dependencies = options.dependencies ? Object.assign(packageConfig.dependencies, options.dependencies) : packageConfig.dependencies
@@ -201,4 +201,4 @@ export class ProjectGenerator implements IGenerator {
201
201
  this.prepareIgnores()
202
202
  await this.project.save()
203
203
  }
204
- }
204
+ }
@@ -1,7 +1,7 @@
1
- import {SourceFile} from "ts-morph";
1
+ import {SourceFile} from 'ts-morph'
2
2
 
3
3
  export abstract class ProjectSourceFile {
4
4
  public abstract readonly filePath: string
5
5
 
6
6
  public abstract initSourceFile(file: SourceFile): SourceFile
7
- }
7
+ }
@@ -6,42 +6,42 @@ export const ProjectEslintrcConfig = {
6
6
  mocha: true
7
7
  },
8
8
  extends: [
9
- "plugin:@typescript-eslint/recommended"
9
+ 'plugin:@typescript-eslint/recommended'
10
10
  ],
11
11
  globals: {
12
- Atomics: "readonly",
13
- SharedArrayBuffer: "readonly"
12
+ Atomics: 'readonly',
13
+ SharedArrayBuffer: 'readonly'
14
14
  },
15
- parser: "@typescript-eslint/parser",
15
+ parser: '@typescript-eslint/parser',
16
16
  parserOptions: {
17
17
  ecmaVersion: 2018,
18
- sourceType: "module"
18
+ sourceType: 'module'
19
19
  },
20
20
  plugins: [
21
- "@typescript-eslint"
21
+ '@typescript-eslint'
22
22
  ],
23
23
  rules: {
24
24
  quotes: [
25
- "error",
26
- "single"
25
+ 'error',
26
+ 'single'
27
27
  ],
28
28
  semi: [
29
- "error",
30
- "never"
29
+ 'error',
30
+ 'never'
31
31
  ],
32
- "comma-dangle": "error",
33
- "prefer-spread": "off",
34
- strict: "off",
35
- "prefer-rest-params": "off",
36
- "no-duplicate-imports": "error",
37
- "@typescript-eslint/no-explicit-any": "off",
38
- "@typescript-eslint/explicit-function-return-type": "off",
39
- "@typescript-eslint/no-namespace": "off",
40
- "@typescript-eslint/no-empty-interface": "off",
41
- "@typescript-eslint/no-unused-vars": "off",
42
- "@typescript-eslint/no-inferrable-types": "off",
43
- "@typescript-eslint/no-empty-function": "off",
44
- "@typescript-eslint/ban-types": "off",
45
- "@typescript-eslint/ban-ts-ignore": "off"
32
+ 'comma-dangle': 'error',
33
+ 'prefer-spread': 'off',
34
+ strict: 'off',
35
+ 'prefer-rest-params': 'off',
36
+ 'no-duplicate-imports': 'error',
37
+ '@typescript-eslint/no-explicit-any': 'off',
38
+ '@typescript-eslint/explicit-function-return-type': 'off',
39
+ '@typescript-eslint/no-namespace': 'off',
40
+ '@typescript-eslint/no-empty-interface': 'off',
41
+ '@typescript-eslint/no-unused-vars': 'off',
42
+ '@typescript-eslint/no-inferrable-types': 'off',
43
+ '@typescript-eslint/no-empty-function': 'off',
44
+ '@typescript-eslint/ban-types': 'off',
45
+ '@typescript-eslint/ban-ts-ignore': 'off'
46
46
  }
47
47
  }
@@ -1,32 +1,28 @@
1
1
  export const ProjectPackageConfig: any = {
2
- name: "",
3
- version: "0.0.1",
4
- description: "",
5
- main: "",
6
- types: "",
2
+ name: '',
3
+ version: '0.0.1',
4
+ description: '',
5
+ main: '',
6
+ types: '',
7
7
  scripts: {},
8
8
  keywords: ['lakutata'],
9
- author: "",
10
- license: "",
9
+ author: '',
10
+ license: '',
11
11
  dependencies: {},
12
12
  devDependencies: {
13
- "@types/chai": "^4.2.14",
14
- "@types/mocha": "^8.2.2",
15
- "@types/node": "^15.12.2",
16
- "@typescript-eslint/eslint-plugin": "^4.27.0",
17
- "@typescript-eslint/parser": "^4.27.0",
18
- "chai": "^4.3.4",
19
- "eslint": "^7.28.0",
20
- "eslint-config-standard": "^16.0.3",
21
- "eslint-plugin-import": "^2.23.4",
22
- "eslint-plugin-node": "^11.1.0",
23
- "eslint-plugin-promise": "^5.1.0",
24
- "mocha": "^8.4.0",
25
- "shx": "^0.3.3",
26
- "ts-node": "^9.1.1",
27
- "typescript": "^4.3.3"
13
+ '@types/node': '^16.11.7',
14
+ '@typescript-eslint/eslint-plugin': '^4.27.0',
15
+ '@typescript-eslint/parser': '^4.27.0',
16
+ 'eslint': '^7.32.0',
17
+ 'eslint-config-standard': '^16.0.3',
18
+ 'eslint-plugin-import': '^2.25.3',
19
+ 'eslint-plugin-node': '^11.1.0',
20
+ 'eslint-plugin-promise': '^5.2.0',
21
+ 'shx': '^0.3.3',
22
+ 'ts-node': '^10.4.0',
23
+ 'typescript': '^4.5.4'
28
24
  },
29
25
  engines: {
30
- "node": ">=12.22.1"
26
+ 'node': '>=12.22.1'
31
27
  }
32
28
  }
@@ -1,8 +1,8 @@
1
1
  export const ProjectTypescriptConfig = {
2
2
  compilerOptions: {
3
3
  strict: true,
4
- module: "CommonJS",
5
- target: "ES2017",
4
+ module: 'CommonJS',
5
+ target: 'ES2017',
6
6
  declaration: true,
7
7
  sourceMap: true,
8
8
  emitDecoratorMetadata: true,
@@ -13,23 +13,23 @@ export const ProjectTypescriptConfig = {
13
13
  noUnusedLocals: false,
14
14
  noImplicitAny: false,
15
15
  noUnusedParameters: false,
16
- outDir: "",
17
- rootDir: "",
18
- moduleResolution: "Node",
16
+ outDir: '',
17
+ rootDir: '',
18
+ moduleResolution: 'Node',
19
19
  esModuleInterop: true,
20
20
  strictPropertyInitialization: false,
21
21
  types: [
22
- "reflect-metadata",
23
- "node"
22
+ 'reflect-metadata',
23
+ 'node'
24
24
  ],
25
25
  lib: [
26
- "ESNext",
27
- "ES2017",
28
- "dom"
26
+ 'ESNext',
27
+ 'ES2017',
28
+ 'dom'
29
29
  ]
30
30
  },
31
31
  exclude: [
32
- "node_modules",
33
- "build"
32
+ 'node_modules',
33
+ 'build'
34
34
  ]
35
35
  }
@@ -14,7 +14,7 @@ export async function CreateComponentManipulator(projectPath: string, tsConfigFi
14
14
  if (!directories.components) return console.error('项目读取错误: 组件文件夹未找到')
15
15
  const componentDir: string = directories.components.toString()
16
16
  const createOptions = await inquirer.prompt([{
17
- type: "input",
17
+ type: 'input',
18
18
  name: 'className',
19
19
  message: '请输入创建的组件类名'
20
20
  }])
@@ -23,7 +23,7 @@ export async function CreateComponentManipulator(projectPath: string, tsConfigFi
23
23
  const componentPath: string = `${componentDir}/${className}.ts`
24
24
  let fileExist: boolean
25
25
  try {
26
- fileExist = !!project.getSourceFile(componentPath);
26
+ fileExist = !!project.getSourceFile(componentPath)
27
27
  } catch (e) {
28
28
  fileExist = false
29
29
  }
@@ -42,7 +42,7 @@ export async function CreateComponentManipulator(projectPath: string, tsConfigFi
42
42
  type: 'string',
43
43
  docs: [{
44
44
  kind: StructureKind.JSDoc,
45
- description: "Configurable item example, do not forget add decorator [Configurable()]"
45
+ description: 'Configurable item example, do not forget add decorator [Configurable()]'
46
46
  }],
47
47
  isReadonly: true,
48
48
  decorators: [{kind: StructureKind.Decorator, name: 'Configurable()'}]
@@ -61,6 +61,6 @@ export async function CreateComponentManipulator(projectPath: string, tsConfigFi
61
61
  await project.save()
62
62
  console.info(`组件 ${className} 创建成功`)
63
63
  } catch (e) {
64
- console.error(`组件创建错误: ${e.message}`)
64
+ console.error(`组件创建错误: ${(e as Error).message}`)
65
65
  }
66
- }
66
+ }
@@ -1,5 +1,5 @@
1
- import {Project, Scope, StructureKind} from "ts-morph";
2
- import inquirer from "inquirer";
1
+ import {Project, Scope, StructureKind} from 'ts-morph'
2
+ import inquirer from 'inquirer'
3
3
 
4
4
  /**
5
5
  * 创建应用项目模块
@@ -14,7 +14,7 @@ export async function CreateModuleManipulator(projectPath: string, tsConfigFileP
14
14
  if (!directories.modules) return console.error('项目读取错误: 模块文件夹未找到')
15
15
  const moduleDir: string = directories.modules.toString()
16
16
  const createOptions = await inquirer.prompt([{
17
- type: "input",
17
+ type: 'input',
18
18
  name: 'className',
19
19
  message: '请输入创建的模块类名'
20
20
  }])
@@ -23,7 +23,7 @@ export async function CreateModuleManipulator(projectPath: string, tsConfigFileP
23
23
  const modulePath: string = `${moduleDir}/${className}.ts`
24
24
  let fileExist: boolean
25
25
  try {
26
- fileExist = !!project.getSourceFile(modulePath);
26
+ fileExist = !!project.getSourceFile(modulePath)
27
27
  } catch (e) {
28
28
  fileExist = false
29
29
  }
@@ -42,7 +42,7 @@ export async function CreateModuleManipulator(projectPath: string, tsConfigFileP
42
42
  {
43
43
  docs: [{
44
44
  kind: StructureKind.JSDoc,
45
- description: "Module plugins"
45
+ description: 'Module plugins'
46
46
  }],
47
47
  kind: StructureKind.Property,
48
48
  name: 'plugins',
@@ -55,7 +55,7 @@ export async function CreateModuleManipulator(projectPath: string, tsConfigFileP
55
55
  {
56
56
  docs: [{
57
57
  kind: StructureKind.JSDoc,
58
- description: "Module components"
58
+ description: 'Module components'
59
59
  }],
60
60
  kind: StructureKind.Property,
61
61
  name: 'components',
@@ -68,7 +68,7 @@ export async function CreateModuleManipulator(projectPath: string, tsConfigFileP
68
68
  {
69
69
  docs: [{
70
70
  kind: StructureKind.JSDoc,
71
- description: "Subset modules"
71
+ description: 'Subset modules'
72
72
  }],
73
73
  kind: StructureKind.Property,
74
74
  name: 'modules',
@@ -81,7 +81,7 @@ export async function CreateModuleManipulator(projectPath: string, tsConfigFileP
81
81
  {
82
82
  docs: [{
83
83
  kind: StructureKind.JSDoc,
84
- description: "Module threads"
84
+ description: 'Module threads'
85
85
  }],
86
86
  kind: StructureKind.Property,
87
87
  name: 'threads',
@@ -94,7 +94,7 @@ export async function CreateModuleManipulator(projectPath: string, tsConfigFileP
94
94
  {
95
95
  docs: [{
96
96
  kind: StructureKind.JSDoc,
97
- description: "Module processes"
97
+ description: 'Module processes'
98
98
  }],
99
99
  kind: StructureKind.Property,
100
100
  name: 'processes',
@@ -107,7 +107,7 @@ export async function CreateModuleManipulator(projectPath: string, tsConfigFileP
107
107
  {
108
108
  docs: [{
109
109
  kind: StructureKind.JSDoc,
110
- description: "Module workflows"
110
+ description: 'Module workflows'
111
111
  }],
112
112
  kind: StructureKind.Property,
113
113
  name: 'workflows',
@@ -132,6 +132,6 @@ export async function CreateModuleManipulator(projectPath: string, tsConfigFileP
132
132
  await project.save()
133
133
  console.info(`模块 ${className} 创建成功`)
134
134
  } catch (e) {
135
- console.error(`模块创建错误: ${e.message}`)
135
+ console.error(`模块创建错误: ${(e as Error).message}`)
136
136
  }
137
- }
137
+ }
@@ -1,5 +1,5 @@
1
- import {ModuleDeclarationKind, Project, Scope, StructureKind} from "ts-morph";
2
- import inquirer from "inquirer";
1
+ import {ModuleDeclarationKind, Project, Scope, StructureKind} from 'ts-morph'
2
+ import inquirer from 'inquirer'
3
3
 
4
4
  /**
5
5
  * 创建应用项目插件
@@ -14,7 +14,7 @@ export async function CreatePluginManipulator(projectPath: string, tsConfigFileP
14
14
  if (!directories.plugins) return console.error('项目读取错误: 插件文件夹未找到')
15
15
  const pluginDir: string = directories.plugins.toString()
16
16
  const createOptions = await inquirer.prompt([{
17
- type: "input",
17
+ type: 'input',
18
18
  name: 'className',
19
19
  message: '请输入创建的插件类名'
20
20
  }])
@@ -23,7 +23,7 @@ export async function CreatePluginManipulator(projectPath: string, tsConfigFileP
23
23
  const pluginPath: string = `${pluginDir}/${className}.ts`
24
24
  let fileExist: boolean
25
25
  try {
26
- fileExist = !!project.getSourceFile(pluginPath);
26
+ fileExist = !!project.getSourceFile(pluginPath)
27
27
  } catch (e) {
28
28
  fileExist = false
29
29
  }
@@ -66,6 +66,6 @@ export async function CreatePluginManipulator(projectPath: string, tsConfigFileP
66
66
  await project.save()
67
67
  console.info(`插件 ${className} 创建成功`)
68
68
  } catch (e) {
69
- console.error(`插件创建错误: ${e.message}`)
69
+ console.error(`插件创建错误: ${(e as Error).message}`)
70
70
  }
71
- }
71
+ }
@@ -1,5 +1,5 @@
1
- import {Project, Scope} from "ts-morph";
2
- import inquirer from "inquirer";
1
+ import {Project, Scope} from 'ts-morph'
2
+ import inquirer from 'inquirer'
3
3
 
4
4
  /**
5
5
  * 创建应用项目进程
@@ -14,7 +14,7 @@ export async function CreateProcessManipulator(projectPath: string, tsConfigFile
14
14
  if (!directories.processes) return console.error('项目读取错误: 进程文件夹未找到')
15
15
  const processDir: string = directories.processes.toString()
16
16
  const createOptions = await inquirer.prompt([{
17
- type: "input",
17
+ type: 'input',
18
18
  name: 'className',
19
19
  message: '请输入创建的进程类名'
20
20
  }])
@@ -23,7 +23,7 @@ export async function CreateProcessManipulator(projectPath: string, tsConfigFile
23
23
  const processPath: string = `${processDir}/${className}.ts`
24
24
  let fileExist: boolean
25
25
  try {
26
- fileExist = !!project.getSourceFile(processPath);
26
+ fileExist = !!project.getSourceFile(processPath)
27
27
  } catch (e) {
28
28
  fileExist = false
29
29
  }
@@ -51,6 +51,6 @@ export async function CreateProcessManipulator(projectPath: string, tsConfigFile
51
51
  await project.save()
52
52
  console.info(`进程 ${className} 创建成功`)
53
53
  } catch (e) {
54
- console.error(`进程创建错误: ${e.message}`)
54
+ console.error(`进程创建错误: ${(e as Error).message}`)
55
55
  }
56
- }
56
+ }
@@ -1,5 +1,5 @@
1
- import {Project, Scope} from "ts-morph";
2
- import inquirer from "inquirer";
1
+ import {Project, Scope} from 'ts-morph'
2
+ import inquirer from 'inquirer'
3
3
 
4
4
  /**
5
5
  * 创建应用项目线程
@@ -14,7 +14,7 @@ export async function CreateThreadManipulator(projectPath: string, tsConfigFileP
14
14
  if (!directories.threads) return console.error('项目读取错误: 线程文件夹未找到')
15
15
  const threadDir: string = directories.threads.toString()
16
16
  const createOptions = await inquirer.prompt([{
17
- type: "input",
17
+ type: 'input',
18
18
  name: 'className',
19
19
  message: '请输入创建的线程类名'
20
20
  }])
@@ -23,7 +23,7 @@ export async function CreateThreadManipulator(projectPath: string, tsConfigFileP
23
23
  const threadPath: string = `${threadDir}/${className}.ts`
24
24
  let fileExist: boolean
25
25
  try {
26
- fileExist = !!project.getSourceFile(threadPath);
26
+ fileExist = !!project.getSourceFile(threadPath)
27
27
  } catch (e) {
28
28
  fileExist = false
29
29
  }
@@ -51,6 +51,6 @@ export async function CreateThreadManipulator(projectPath: string, tsConfigFileP
51
51
  await project.save()
52
52
  console.info(`线程 ${className} 创建成功`)
53
53
  } catch (e) {
54
- console.error(`线程创建错误: ${e.message}`)
54
+ console.error(`线程创建错误: ${(e as Error).message}`)
55
55
  }
56
- }
56
+ }