@lakutata/cli 1.0.5 → 1.0.6
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/.idea/codeStyles/Project.xml +18 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/build/CLI.js +1 -1
- package/build/CLI.js.map +1 -1
- package/build/constants/LicenseList.js.map +1 -1
- package/build/interfaces/IApplicationInfo.d.ts +1 -1
- package/build/interfaces/IComponentInfo.d.ts +1 -1
- package/build/interfaces/IModuleInfo.d.ts +1 -1
- package/build/interfaces/IPluginInfo.d.ts +1 -1
- package/build/interfaces/IProjectGeneratorOptions.d.ts +2 -2
- package/build/lib/generators/application/ApplicationGenerator.d.ts +2 -2
- package/build/lib/generators/application/ApplicationGenerator.js +2 -2
- package/build/lib/generators/application/ApplicationGenerator.js.map +1 -1
- package/build/lib/generators/application/files/AppFile.d.ts +2 -2
- package/build/lib/generators/application/files/AppFile.js.map +1 -1
- package/build/lib/generators/application/files/ConfigFile.d.ts +2 -2
- package/build/lib/generators/application/files/ConfigFile.js.map +1 -1
- package/build/lib/generators/component/ComponentGenerator.d.ts +2 -2
- package/build/lib/generators/component/ComponentGenerator.js.map +1 -1
- package/build/lib/generators/component/files/ComponentFile.d.ts +2 -2
- package/build/lib/generators/component/files/ComponentFile.js +1 -1
- package/build/lib/generators/component/files/ComponentFile.js.map +1 -1
- package/build/lib/generators/component/files/ComponentTestFile.d.ts +2 -2
- package/build/lib/generators/component/files/ComponentTestFile.js.map +1 -1
- package/build/lib/generators/module/ModuleGenerator.d.ts +2 -2
- package/build/lib/generators/module/ModuleGenerator.js +1 -1
- package/build/lib/generators/module/ModuleGenerator.js.map +1 -1
- package/build/lib/generators/module/files/ModuleFile.d.ts +2 -2
- package/build/lib/generators/module/files/ModuleFile.js +6 -6
- package/build/lib/generators/module/files/ModuleFile.js.map +1 -1
- package/build/lib/generators/module/files/ModuleTestFile.d.ts +2 -2
- package/build/lib/generators/module/files/ModuleTestFile.js.map +1 -1
- package/build/lib/generators/plugin/PluginGenerator.d.ts +2 -2
- package/build/lib/generators/plugin/PluginGenerator.js.map +1 -1
- package/build/lib/generators/plugin/files/PluginFile.d.ts +2 -2
- package/build/lib/generators/plugin/files/PluginFile.js.map +1 -1
- package/build/lib/generators/plugin/files/PluginTestFile.d.ts +2 -2
- package/build/lib/generators/plugin/files/PluginTestFile.js.map +1 -1
- package/build/lib/generators/project/ProjectGenerator.d.ts +2 -2
- package/build/lib/generators/project/ProjectGenerator.js +5 -5
- package/build/lib/generators/project/ProjectGenerator.js.map +1 -1
- package/build/lib/generators/project/ProjectSourceFile.d.ts +1 -1
- package/build/lib/generators/project/configs/ProjectEslintrcConfig.d.ts +13 -13
- package/build/lib/generators/project/configs/ProjectEslintrcConfig.js +24 -24
- package/build/lib/generators/project/configs/ProjectPackageConfig.js +19 -23
- package/build/lib/generators/project/configs/ProjectPackageConfig.js.map +1 -1
- package/build/lib/generators/project/configs/ProjectTypescriptConfig.js +12 -12
- package/build/lib/manipulators/CreateComponentManipulator.js +2 -2
- package/build/lib/manipulators/CreateComponentManipulator.js.map +1 -1
- package/build/lib/manipulators/CreateModuleManipulator.js +7 -7
- package/build/lib/manipulators/CreateModuleManipulator.js.map +1 -1
- package/build/lib/manipulators/CreatePluginManipulator.js +1 -1
- package/build/lib/manipulators/CreatePluginManipulator.js.map +1 -1
- package/build/lib/manipulators/CreateProcessManipulator.js +1 -1
- package/build/lib/manipulators/CreateProcessManipulator.js.map +1 -1
- package/build/lib/manipulators/CreateThreadManipulator.js +1 -1
- package/build/lib/manipulators/CreateThreadManipulator.js.map +1 -1
- package/build/lib/manipulators/application/ApplicationIndexManipulator.js +2 -2
- package/build/lib/manipulators/application/ApplicationIndexManipulator.js.map +1 -1
- package/build/lib/menus/MainMenu.js +17 -17
- package/build/lib/menus/MainMenu.js.map +1 -1
- package/build/lib/menus/initializeMenus/InitializeApplicationProject.js +7 -7
- package/build/lib/menus/initializeMenus/InitializeApplicationProject.js.map +1 -1
- package/build/lib/menus/initializeMenus/InitializeComponentProject.js +7 -7
- package/build/lib/menus/initializeMenus/InitializeComponentProject.js.map +1 -1
- package/build/lib/menus/initializeMenus/InitializeModuleProject.js +7 -7
- package/build/lib/menus/initializeMenus/InitializeModuleProject.js.map +1 -1
- package/build/lib/menus/initializeMenus/InitializePluginProject.js +7 -7
- package/build/lib/menus/initializeMenus/InitializePluginProject.js.map +1 -1
- package/build/lib/menus/manipulateMenus/ManipulateApplicationProject.js +8 -8
- package/build/lib/menus/manipulateMenus/ManipulateApplicationProject.js.map +1 -1
- package/build/lib/menus/manipulateMenus/ManipulateModuleProject.js +7 -7
- package/build/lib/menus/manipulateMenus/ManipulateModuleProject.js.map +1 -1
- package/package.json +17 -20
- package/src/CLI.ts +2 -2
- package/src/constants/LicenseList.ts +2 -2
- package/src/interfaces/IApplicationInfo.ts +2 -2
- package/src/interfaces/IComponentInfo.ts +2 -2
- package/src/interfaces/IModuleInfo.ts +2 -2
- package/src/interfaces/IPluginInfo.ts +2 -2
- package/src/interfaces/IProjectGeneratorOptions.ts +3 -3
- package/src/lib/generators/application/ApplicationGenerator.ts +8 -8
- package/src/lib/generators/application/files/AppFile.ts +3 -3
- package/src/lib/generators/application/files/ConfigFile.ts +3 -3
- package/src/lib/generators/component/ComponentGenerator.ts +6 -6
- package/src/lib/generators/component/files/ComponentFile.ts +4 -4
- package/src/lib/generators/component/files/ComponentTestFile.ts +3 -3
- package/src/lib/generators/module/ModuleGenerator.ts +7 -7
- package/src/lib/generators/module/files/ModuleFile.ts +9 -9
- package/src/lib/generators/module/files/ModuleTestFile.ts +3 -3
- package/src/lib/generators/plugin/PluginGenerator.ts +6 -6
- package/src/lib/generators/plugin/files/PluginFile.ts +4 -4
- package/src/lib/generators/plugin/files/PluginTestFile.ts +4 -4
- package/src/lib/generators/project/ProjectGenerator.ts +13 -13
- package/src/lib/generators/project/ProjectSourceFile.ts +2 -2
- package/src/lib/generators/project/configs/ProjectEslintrcConfig.ts +24 -24
- package/src/lib/generators/project/configs/ProjectPackageConfig.ts +19 -23
- package/src/lib/generators/project/configs/ProjectTypescriptConfig.ts +12 -12
- package/src/lib/manipulators/CreateComponentManipulator.ts +5 -5
- package/src/lib/manipulators/CreateModuleManipulator.ts +12 -12
- package/src/lib/manipulators/CreatePluginManipulator.ts +6 -6
- package/src/lib/manipulators/CreateProcessManipulator.ts +6 -6
- package/src/lib/manipulators/CreateThreadManipulator.ts +6 -6
- package/src/lib/manipulators/application/ApplicationIndexManipulator.ts +4 -4
- package/src/lib/menus/MainMenu.ts +18 -18
- package/src/lib/menus/initializeMenus/InitializeApplicationProject.ts +11 -11
- package/src/lib/menus/initializeMenus/InitializeComponentProject.ts +12 -12
- package/src/lib/menus/initializeMenus/InitializeModuleProject.ts +12 -12
- package/src/lib/menus/initializeMenus/InitializePluginProject.ts +12 -12
- package/src/lib/menus/manipulateMenus/ManipulateApplicationProject.ts +9 -9
- package/src/lib/menus/manipulateMenus/ManipulateModuleProject.ts +8 -8
- package/src/tests/generators/GenerateApplication.spec.ts +2 -2
- package/src/tests/generators/GenerateComponent.spec.ts +2 -2
- package/src/tests/generators/GenerateModule.spec.ts +2 -2
- package/src/tests/generators/GeneratePlugin.spec.ts +2 -2
- package/outputs/.gitkeep +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {ProjectSourceFile} from
|
|
2
|
-
import {Scope, SourceFile, StructureKind} from
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
|
2
|
-
import {SourceFile} from
|
|
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
|
|
2
|
-
import {IPluginInfo} from
|
|
3
|
-
import {ProjectGenerator} from
|
|
4
|
-
import {PluginFile} from
|
|
5
|
-
import {PluginTestFile} from
|
|
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
|
|
2
|
-
import {ModuleDeclarationKind, Scope, SourceFile, StructureKind} from
|
|
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
|
|
2
|
-
import {SourceFile} from
|
|
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
|
|
1
|
+
import {Project, ts} from 'ts-morph'
|
|
2
2
|
import path from 'path'
|
|
3
|
-
import {ProjectTypescriptConfig} from
|
|
4
|
-
import {ProjectPackageConfig} from
|
|
5
|
-
import {IPreparePackageConfigOptions} from
|
|
6
|
-
import {ProjectEslintrcConfig} from
|
|
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
|
|
9
|
-
import {IProjectGeneratorOptions} from
|
|
10
|
-
import {IGenerator} from
|
|
11
|
-
import {GitIgnore} from
|
|
12
|
-
import {ProjectSourceFile} from
|
|
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:
|
|
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
|
+
}
|
|
@@ -6,42 +6,42 @@ export const ProjectEslintrcConfig = {
|
|
|
6
6
|
mocha: true
|
|
7
7
|
},
|
|
8
8
|
extends: [
|
|
9
|
-
|
|
9
|
+
'plugin:@typescript-eslint/recommended'
|
|
10
10
|
],
|
|
11
11
|
globals: {
|
|
12
|
-
Atomics:
|
|
13
|
-
SharedArrayBuffer:
|
|
12
|
+
Atomics: 'readonly',
|
|
13
|
+
SharedArrayBuffer: 'readonly'
|
|
14
14
|
},
|
|
15
|
-
parser:
|
|
15
|
+
parser: '@typescript-eslint/parser',
|
|
16
16
|
parserOptions: {
|
|
17
17
|
ecmaVersion: 2018,
|
|
18
|
-
sourceType:
|
|
18
|
+
sourceType: 'module'
|
|
19
19
|
},
|
|
20
20
|
plugins: [
|
|
21
|
-
|
|
21
|
+
'@typescript-eslint'
|
|
22
22
|
],
|
|
23
23
|
rules: {
|
|
24
24
|
quotes: [
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
'error',
|
|
26
|
+
'single'
|
|
27
27
|
],
|
|
28
28
|
semi: [
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
'error',
|
|
30
|
+
'never'
|
|
31
31
|
],
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
strict:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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:
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
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:
|
|
5
|
-
target:
|
|
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:
|
|
16
|
+
outDir: '',
|
|
17
|
+
rootDir: '',
|
|
18
|
+
moduleResolution: 'Node',
|
|
19
19
|
esModuleInterop: true,
|
|
20
20
|
strictPropertyInitialization: false,
|
|
21
21
|
types: [
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
'reflect-metadata',
|
|
23
|
+
'node'
|
|
24
24
|
],
|
|
25
25
|
lib: [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
'ESNext',
|
|
27
|
+
'ES2017',
|
|
28
|
+
'dom'
|
|
29
29
|
]
|
|
30
30
|
},
|
|
31
31
|
exclude: [
|
|
32
|
-
|
|
33
|
-
|
|
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:
|
|
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:
|
|
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
|
|
2
|
-
import inquirer from
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
|
2
|
-
import inquirer from
|
|
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:
|
|
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
|
|
2
|
-
import inquirer from
|
|
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:
|
|
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
|
|
2
|
-
import inquirer from
|
|
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:
|
|
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
|
+
}
|
|
@@ -66,7 +66,7 @@ export async function ApplicationIndexManipulator(projectPath: string, tsConfigF
|
|
|
66
66
|
const keyName = (componentConfigItem.getSymbol() as Symbol).getName()
|
|
67
67
|
if (keyName === 'class') {
|
|
68
68
|
const initializer = componentConfigItem.getStructure().initializer
|
|
69
|
-
if (typeof initializer ===
|
|
69
|
+
if (typeof initializer === 'string') {
|
|
70
70
|
componentClassName = initializer
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -105,7 +105,7 @@ export async function ApplicationIndexManipulator(projectPath: string, tsConfigF
|
|
|
105
105
|
const keyName = (moduleConfigItem.getSymbol() as Symbol).getName()
|
|
106
106
|
if (keyName === 'class') {
|
|
107
107
|
const initializer = moduleConfigItem.getStructure().initializer
|
|
108
|
-
if (typeof initializer ===
|
|
108
|
+
if (typeof initializer === 'string') {
|
|
109
109
|
moduleClassName = initializer
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -164,6 +164,6 @@ export async function ApplicationIndexManipulator(projectPath: string, tsConfigF
|
|
|
164
164
|
await project.save()
|
|
165
165
|
console.info('索引更新成功')
|
|
166
166
|
} catch (e) {
|
|
167
|
-
console.error(`索引更新出错: ${e.message}`)
|
|
167
|
+
console.error(`索引更新出错: ${(e as Error).message}`)
|
|
168
168
|
}
|
|
169
|
-
}
|
|
169
|
+
}
|