@lakutata/cli 1.0.3 → 1.0.8
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 +14 -13
- package/build/lib/generators/project/configs/ProjectEslintrcConfig.js +24 -24
- package/build/lib/generators/project/configs/ProjectEslintrcConfig.js.map +1 -1
- 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 +8 -8
- package/build/lib/menus/initializeMenus/InitializeApplicationProject.js.map +1 -1
- package/build/lib/menus/initializeMenus/InitializeComponentProject.js +8 -8
- package/build/lib/menus/initializeMenus/InitializeComponentProject.js.map +1 -1
- package/build/lib/menus/initializeMenus/InitializeModuleProject.js +8 -8
- package/build/lib/menus/initializeMenus/InitializeModuleProject.js.map +1 -1
- package/build/lib/menus/initializeMenus/InitializePluginProject.js +8 -8
- 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 +18 -21
- 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 +12 -12
- 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,16 +1,16 @@
|
|
|
1
1
|
import inquirer from 'inquirer'
|
|
2
2
|
import latestVersion from 'latest-version'
|
|
3
|
-
import {InitializeApplicationProject} from
|
|
4
|
-
import {InitializeModuleProject} from
|
|
5
|
-
import {InitializeComponentProject} from
|
|
6
|
-
import {InitializePluginProject} from
|
|
3
|
+
import {InitializeApplicationProject} from './initializeMenus/InitializeApplicationProject'
|
|
4
|
+
import {InitializeModuleProject} from './initializeMenus/InitializeModuleProject'
|
|
5
|
+
import {InitializeComponentProject} from './initializeMenus/InitializeComponentProject'
|
|
6
|
+
import {InitializePluginProject} from './initializeMenus/InitializePluginProject'
|
|
7
7
|
import {gt} from 'semver'
|
|
8
8
|
import path from 'path'
|
|
9
9
|
import fs from 'fs'
|
|
10
|
-
import {ManipulateApplicationProject} from
|
|
11
|
-
import {ManipulateModuleProject} from
|
|
12
|
-
import {ManipulateComponentProject} from
|
|
13
|
-
import {ManipulatePluginProject} from
|
|
10
|
+
import {ManipulateApplicationProject} from './manipulateMenus/ManipulateApplicationProject'
|
|
11
|
+
import {ManipulateModuleProject} from './manipulateMenus/ManipulateModuleProject'
|
|
12
|
+
import {ManipulateComponentProject} from './manipulateMenus/ManipulateComponentProject'
|
|
13
|
+
import {ManipulatePluginProject} from './manipulateMenus/ManipulatePluginProject'
|
|
14
14
|
|
|
15
15
|
export async function MainMenu(packageJson: any) {
|
|
16
16
|
const mainMenuOpt = await inquirer.prompt([{
|
|
@@ -64,8 +64,8 @@ export async function MainMenu(packageJson: any) {
|
|
|
64
64
|
}, {
|
|
65
65
|
name: 'path',
|
|
66
66
|
message: '项目生成地址',
|
|
67
|
-
type:
|
|
68
|
-
default: process.cwd()
|
|
67
|
+
type: 'input',
|
|
68
|
+
default: process.cwd()
|
|
69
69
|
}
|
|
70
70
|
])
|
|
71
71
|
const projectPath: string = initializeProjectOption.path
|
|
@@ -96,20 +96,20 @@ export async function MainMenu(packageJson: any) {
|
|
|
96
96
|
return console.error('项目信息读取错误: 请在项目根目录执行该指令')
|
|
97
97
|
}
|
|
98
98
|
try {
|
|
99
|
-
const projectPackageJson = JSON.parse(fs.readFileSync(packageJsonPath, {encoding:
|
|
99
|
+
const projectPackageJson = JSON.parse(fs.readFileSync(packageJsonPath, {encoding: 'utf-8'}))
|
|
100
100
|
if (projectPackageJson.lakutata && projectPackageJson.lakutata.type) {
|
|
101
101
|
const projectType: 'application' | 'module' | 'component' | 'plugin' = projectPackageJson.lakutata.type
|
|
102
102
|
switch (projectType) {
|
|
103
|
-
case
|
|
103
|
+
case 'application': {
|
|
104
104
|
return await ManipulateApplicationProject(projectPath, tsconfigJsonPath, projectPackageJson.lakutata)
|
|
105
105
|
}
|
|
106
|
-
case
|
|
106
|
+
case 'module': {
|
|
107
107
|
return await ManipulateModuleProject(projectPath, tsconfigJsonPath, projectPackageJson.lakutata)
|
|
108
108
|
}
|
|
109
|
-
case
|
|
109
|
+
case 'component': {
|
|
110
110
|
return await ManipulateComponentProject(projectPath, tsconfigJsonPath, projectPackageJson.lakutata)
|
|
111
111
|
}
|
|
112
|
-
case
|
|
112
|
+
case 'plugin': {
|
|
113
113
|
return ManipulatePluginProject(projectPath, tsconfigJsonPath, projectPackageJson.lakutata)
|
|
114
114
|
}
|
|
115
115
|
default: {
|
|
@@ -120,7 +120,7 @@ export async function MainMenu(packageJson: any) {
|
|
|
120
120
|
return console.error('项目信息读取错误: 无法操作非Lakutata框架的项目')
|
|
121
121
|
}
|
|
122
122
|
} catch (e) {
|
|
123
|
-
return console.error(`项目信息读取错误: ${e.message}`)
|
|
123
|
+
return console.error(`项目信息读取错误: ${(e as Error).message}`)
|
|
124
124
|
}
|
|
125
125
|
return
|
|
126
126
|
}
|
|
@@ -141,8 +141,8 @@ export async function MainMenu(packageJson: any) {
|
|
|
141
141
|
console.info('无可用更新')
|
|
142
142
|
}
|
|
143
143
|
} catch (e) {
|
|
144
|
-
console.error(`检查更新失败: ${e.message}`)
|
|
144
|
+
console.error(`检查更新失败: ${(e as Error).message}`)
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
}
|
|
148
|
+
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import inquirer from 'inquirer'
|
|
2
|
-
import {ApplicationGenerator} from
|
|
3
|
-
import {LicenseList} from
|
|
4
|
-
import npm from 'npm'
|
|
2
|
+
import {ApplicationGenerator} from '../../generators/application/ApplicationGenerator'
|
|
3
|
+
import {LicenseList} from '../../../constants/LicenseList'
|
|
4
|
+
import npm from 'npm/lib/npm'
|
|
5
5
|
|
|
6
6
|
export async function InitializeApplicationProject(projectPath: string) {
|
|
7
7
|
const options = await inquirer.prompt([
|
|
8
8
|
{
|
|
9
9
|
name: 'id',
|
|
10
10
|
message: '请输入应用的ID[例如:identifier.scope.app]',
|
|
11
|
-
type:
|
|
11
|
+
type: 'input'
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
name: 'name',
|
|
15
15
|
message: '请输入应用名称',
|
|
16
|
-
type:
|
|
16
|
+
type: 'input'
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
name: 'author',
|
|
20
20
|
message: '请输入作者名称',
|
|
21
|
-
type:
|
|
21
|
+
type: 'input'
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
name: 'description',
|
|
25
25
|
message: '请输入应用说明',
|
|
26
|
-
type:
|
|
26
|
+
type: 'input'
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
name: 'keywords',
|
|
30
30
|
message: '请输入应用关键词(使用逗号分隔)',
|
|
31
|
-
type:
|
|
31
|
+
type: 'input'
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
name: 'license',
|
|
35
35
|
message: '请选择应用开源许可协议',
|
|
36
|
-
type:
|
|
36
|
+
type: 'list',
|
|
37
37
|
default: 'UNLICENSED',
|
|
38
38
|
choices: LicenseList
|
|
39
39
|
}
|
|
@@ -51,7 +51,7 @@ export async function InitializeApplicationProject(projectPath: string) {
|
|
|
51
51
|
{
|
|
52
52
|
name: 'confirm',
|
|
53
53
|
message: '请确认信息是否填写正确',
|
|
54
|
-
type:
|
|
54
|
+
type: 'confirm',
|
|
55
55
|
default: 'Y'
|
|
56
56
|
}
|
|
57
57
|
])
|
|
@@ -81,7 +81,7 @@ export async function InitializeApplicationProject(projectPath: string) {
|
|
|
81
81
|
})
|
|
82
82
|
})
|
|
83
83
|
} catch (e) {
|
|
84
|
-
console.error(`项目生成错误: ${e.message}`)
|
|
84
|
+
console.error(`项目生成错误: ${(e as Error).message}`)
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
}
|
|
87
|
+
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import inquirer from 'inquirer'
|
|
2
|
-
import {ComponentGenerator} from
|
|
3
|
-
import npm from
|
|
4
|
-
import {LicenseList} from
|
|
2
|
+
import {ComponentGenerator} from '../../generators/component/ComponentGenerator'
|
|
3
|
+
import npm from 'npm/lib/npm'
|
|
4
|
+
import {LicenseList} from '../../../constants/LicenseList'
|
|
5
5
|
|
|
6
6
|
export async function InitializeComponentProject(projectPath: string) {
|
|
7
7
|
const options = await inquirer.prompt([
|
|
8
8
|
{
|
|
9
9
|
name: 'className',
|
|
10
10
|
message: '请输入组件名称',
|
|
11
|
-
type:
|
|
11
|
+
type: 'input'
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
name: 'name',
|
|
15
15
|
message: '请输入项目名称',
|
|
16
|
-
type:
|
|
16
|
+
type: 'input'
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
name: 'author',
|
|
20
20
|
message: '请输入作者名称',
|
|
21
|
-
type:
|
|
21
|
+
type: 'input'
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
name: 'description',
|
|
25
25
|
message: '请输入项目说明',
|
|
26
|
-
type:
|
|
26
|
+
type: 'input'
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
name: 'keywords',
|
|
30
30
|
message: '请输入项目关键词(使用逗号分隔)',
|
|
31
|
-
type:
|
|
31
|
+
type: 'input'
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
name: 'license',
|
|
35
35
|
message: '请选择项目开源许可协议',
|
|
36
|
-
type:
|
|
36
|
+
type: 'list',
|
|
37
37
|
default: 'UNLICENSED',
|
|
38
38
|
choices: LicenseList
|
|
39
39
|
}
|
|
@@ -51,7 +51,7 @@ export async function InitializeComponentProject(projectPath: string) {
|
|
|
51
51
|
{
|
|
52
52
|
name: 'confirm',
|
|
53
53
|
message: '请确认信息是否填写正确',
|
|
54
|
-
type:
|
|
54
|
+
type: 'confirm',
|
|
55
55
|
default: 'Y'
|
|
56
56
|
}
|
|
57
57
|
])
|
|
@@ -81,7 +81,7 @@ export async function InitializeComponentProject(projectPath: string) {
|
|
|
81
81
|
})
|
|
82
82
|
})
|
|
83
83
|
} catch (e) {
|
|
84
|
-
console.error(`项目生成错误: ${e.message}`)
|
|
84
|
+
console.error(`项目生成错误: ${(e as Error).message}`)
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
}
|
|
87
|
+
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import inquirer from 'inquirer'
|
|
2
|
-
import {LicenseList} from
|
|
3
|
-
import npm from
|
|
4
|
-
import {ModuleGenerator} from
|
|
2
|
+
import {LicenseList} from '../../../constants/LicenseList'
|
|
3
|
+
import npm from 'npm/lib/npm'
|
|
4
|
+
import {ModuleGenerator} from '../../generators/module/ModuleGenerator'
|
|
5
5
|
|
|
6
6
|
export async function InitializeModuleProject(projectPath: string) {
|
|
7
7
|
const options = await inquirer.prompt([
|
|
8
8
|
{
|
|
9
9
|
name: 'className',
|
|
10
10
|
message: '请输入模块名称',
|
|
11
|
-
type:
|
|
11
|
+
type: 'input'
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
name: 'name',
|
|
15
15
|
message: '请输入项目名称',
|
|
16
|
-
type:
|
|
16
|
+
type: 'input'
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
name: 'author',
|
|
20
20
|
message: '请输入作者名称',
|
|
21
|
-
type:
|
|
21
|
+
type: 'input'
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
name: 'description',
|
|
25
25
|
message: '请输入项目说明',
|
|
26
|
-
type:
|
|
26
|
+
type: 'input'
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
name: 'keywords',
|
|
30
30
|
message: '请输入项目关键词(使用逗号分隔)',
|
|
31
|
-
type:
|
|
31
|
+
type: 'input'
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
name: 'license',
|
|
35
35
|
message: '请选择项目开源许可协议',
|
|
36
|
-
type:
|
|
36
|
+
type: 'list',
|
|
37
37
|
default: 'UNLICENSED',
|
|
38
38
|
choices: LicenseList
|
|
39
39
|
}
|
|
@@ -51,7 +51,7 @@ export async function InitializeModuleProject(projectPath: string) {
|
|
|
51
51
|
{
|
|
52
52
|
name: 'confirm',
|
|
53
53
|
message: '请确认信息是否填写正确',
|
|
54
|
-
type:
|
|
54
|
+
type: 'confirm',
|
|
55
55
|
default: 'Y'
|
|
56
56
|
}
|
|
57
57
|
])
|
|
@@ -81,7 +81,7 @@ export async function InitializeModuleProject(projectPath: string) {
|
|
|
81
81
|
})
|
|
82
82
|
})
|
|
83
83
|
} catch (e) {
|
|
84
|
-
console.error(`项目生成错误: ${e.message}`)
|
|
84
|
+
console.error(`项目生成错误: ${(e as Error).message}`)
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
}
|
|
87
|
+
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import inquirer from 'inquirer'
|
|
2
|
-
import {LicenseList} from
|
|
3
|
-
import npm from
|
|
4
|
-
import {PluginGenerator} from
|
|
2
|
+
import {LicenseList} from '../../../constants/LicenseList'
|
|
3
|
+
import npm from 'npm/lib/npm'
|
|
4
|
+
import {PluginGenerator} from '../../generators/plugin/PluginGenerator'
|
|
5
5
|
|
|
6
6
|
export async function InitializePluginProject(projectPath: string) {
|
|
7
7
|
const options = await inquirer.prompt([
|
|
8
8
|
{
|
|
9
9
|
name: 'className',
|
|
10
10
|
message: '请输入插件名称',
|
|
11
|
-
type:
|
|
11
|
+
type: 'input'
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
name: 'name',
|
|
15
15
|
message: '请输入项目名称',
|
|
16
|
-
type:
|
|
16
|
+
type: 'input'
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
name: 'author',
|
|
20
20
|
message: '请输入作者名称',
|
|
21
|
-
type:
|
|
21
|
+
type: 'input'
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
name: 'description',
|
|
25
25
|
message: '请输入项目说明',
|
|
26
|
-
type:
|
|
26
|
+
type: 'input'
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
name: 'keywords',
|
|
30
30
|
message: '请输入项目关键词(使用逗号分隔)',
|
|
31
|
-
type:
|
|
31
|
+
type: 'input'
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
name: 'license',
|
|
35
35
|
message: '请选择项目开源许可协议',
|
|
36
|
-
type:
|
|
36
|
+
type: 'list',
|
|
37
37
|
default: 'UNLICENSED',
|
|
38
38
|
choices: LicenseList
|
|
39
39
|
}
|
|
@@ -51,7 +51,7 @@ export async function InitializePluginProject(projectPath: string) {
|
|
|
51
51
|
{
|
|
52
52
|
name: 'confirm',
|
|
53
53
|
message: '请确认信息是否填写正确',
|
|
54
|
-
type:
|
|
54
|
+
type: 'confirm',
|
|
55
55
|
default: 'Y'
|
|
56
56
|
}
|
|
57
57
|
])
|
|
@@ -81,7 +81,7 @@ export async function InitializePluginProject(projectPath: string) {
|
|
|
81
81
|
})
|
|
82
82
|
})
|
|
83
83
|
} catch (e) {
|
|
84
|
-
console.error(`项目生成错误: ${e.message}`)
|
|
84
|
+
console.error(`项目生成错误: ${(e as Error).message}`)
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
}
|
|
87
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import inquirer from 'inquirer'
|
|
2
|
-
import {ApplicationIndexManipulator} from
|
|
3
|
-
import {CreateComponentManipulator} from
|
|
4
|
-
import {CreateModuleManipulator} from
|
|
5
|
-
import {CreatePluginManipulator} from
|
|
6
|
-
import {CreateThreadManipulator} from
|
|
7
|
-
import {CreateProcessManipulator} from
|
|
2
|
+
import {ApplicationIndexManipulator} from '../../manipulators/application/ApplicationIndexManipulator'
|
|
3
|
+
import {CreateComponentManipulator} from '../../manipulators/CreateComponentManipulator'
|
|
4
|
+
import {CreateModuleManipulator} from '../../manipulators/CreateModuleManipulator'
|
|
5
|
+
import {CreatePluginManipulator} from '../../manipulators/CreatePluginManipulator'
|
|
6
|
+
import {CreateThreadManipulator} from '../../manipulators/CreateThreadManipulator'
|
|
7
|
+
import {CreateProcessManipulator} from '../../manipulators/CreateProcessManipulator'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* 操作应用程序项目
|
|
@@ -17,7 +17,7 @@ export async function ManipulateApplicationProject(projectPath: string, tsConfig
|
|
|
17
17
|
const projectDirectories: { [name: string]: string } = lakutataProjectInfo.directories
|
|
18
18
|
const configuration: string = lakutataProjectInfo.configuration
|
|
19
19
|
const opt = await inquirer.prompt([{
|
|
20
|
-
type:
|
|
20
|
+
type: 'list',
|
|
21
21
|
name: 'opr',
|
|
22
22
|
message: '请选择需要进行的操作',
|
|
23
23
|
choices: [
|
|
@@ -26,7 +26,7 @@ export async function ManipulateApplicationProject(projectPath: string, tsConfig
|
|
|
26
26
|
{name: '创建项目模块', value: 'createModule'},
|
|
27
27
|
{name: '创建项目插件', value: 'createPlugin'},
|
|
28
28
|
{name: '创建项目线程', value: 'createThread'},
|
|
29
|
-
{name: '创建项目进程', value: 'createProcess'}
|
|
29
|
+
{name: '创建项目进程', value: 'createProcess'}
|
|
30
30
|
]
|
|
31
31
|
}])
|
|
32
32
|
switch (opt.opr) {
|
|
@@ -52,4 +52,4 @@ export async function ManipulateApplicationProject(projectPath: string, tsConfig
|
|
|
52
52
|
return console.error('无效的操作选项')
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
}
|
|
55
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import inquirer from 'inquirer'
|
|
2
|
-
import {CreateComponentManipulator} from
|
|
3
|
-
import {CreateModuleManipulator} from
|
|
4
|
-
import {CreatePluginManipulator} from
|
|
5
|
-
import {CreateThreadManipulator} from
|
|
6
|
-
import {CreateProcessManipulator} from
|
|
2
|
+
import {CreateComponentManipulator} from '../../manipulators/CreateComponentManipulator'
|
|
3
|
+
import {CreateModuleManipulator} from '../../manipulators/CreateModuleManipulator'
|
|
4
|
+
import {CreatePluginManipulator} from '../../manipulators/CreatePluginManipulator'
|
|
5
|
+
import {CreateThreadManipulator} from '../../manipulators/CreateThreadManipulator'
|
|
6
|
+
import {CreateProcessManipulator} from '../../manipulators/CreateProcessManipulator'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* 操作模块项目
|
|
@@ -15,7 +15,7 @@ import {CreateProcessManipulator} from "../../manipulators/CreateProcessManipula
|
|
|
15
15
|
export async function ManipulateModuleProject(projectPath: string, tsConfigFilePath: string, lakutataProjectInfo: any) {
|
|
16
16
|
const projectDirectories: { [name: string]: string } = lakutataProjectInfo.directories
|
|
17
17
|
const opt = await inquirer.prompt([{
|
|
18
|
-
type:
|
|
18
|
+
type: 'list',
|
|
19
19
|
name: 'opr',
|
|
20
20
|
message: '请选择需要进行的操作',
|
|
21
21
|
choices: [
|
|
@@ -23,7 +23,7 @@ export async function ManipulateModuleProject(projectPath: string, tsConfigFileP
|
|
|
23
23
|
{name: '创建项目模块', value: 'createModule'},
|
|
24
24
|
{name: '创建项目插件', value: 'createPlugin'},
|
|
25
25
|
{name: '创建项目线程', value: 'createThread'},
|
|
26
|
-
{name: '创建项目进程', value: 'createProcess'}
|
|
26
|
+
{name: '创建项目进程', value: 'createProcess'}
|
|
27
27
|
]
|
|
28
28
|
}])
|
|
29
29
|
switch (opt.opr) {
|
|
@@ -46,4 +46,4 @@ export async function ManipulateModuleProject(projectPath: string, tsConfigFileP
|
|
|
46
46
|
return console.error('无效的操作选项')
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
}
|
|
49
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from 'path'
|
|
2
|
-
import {ApplicationGenerator} from
|
|
2
|
+
import {ApplicationGenerator} from '../../lib/generators/application/ApplicationGenerator'
|
|
3
3
|
|
|
4
4
|
(async () => {
|
|
5
5
|
const applicationProject = new ApplicationGenerator({
|
|
@@ -13,4 +13,4 @@ import {ApplicationGenerator} from "../../lib/generators/application/Application
|
|
|
13
13
|
} catch (e) {
|
|
14
14
|
console.error(e)
|
|
15
15
|
}
|
|
16
|
-
})()
|
|
16
|
+
})()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from 'path'
|
|
2
|
-
import {ComponentGenerator} from
|
|
2
|
+
import {ComponentGenerator} from '../../lib/generators/component/ComponentGenerator'
|
|
3
3
|
|
|
4
4
|
(async () => {
|
|
5
5
|
const applicationProject = new ComponentGenerator({
|
|
@@ -13,4 +13,4 @@ import {ComponentGenerator} from "../../lib/generators/component/ComponentGenera
|
|
|
13
13
|
} catch (e) {
|
|
14
14
|
console.error(e)
|
|
15
15
|
}
|
|
16
|
-
})()
|
|
16
|
+
})()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from 'path'
|
|
2
|
-
import {ModuleGenerator} from
|
|
2
|
+
import {ModuleGenerator} from '../../lib/generators/module/ModuleGenerator'
|
|
3
3
|
|
|
4
4
|
(async () => {
|
|
5
5
|
const applicationProject = new ModuleGenerator({
|
|
@@ -13,4 +13,4 @@ import {ModuleGenerator} from "../../lib/generators/module/ModuleGenerator";
|
|
|
13
13
|
} catch (e) {
|
|
14
14
|
console.error(e)
|
|
15
15
|
}
|
|
16
|
-
})()
|
|
16
|
+
})()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from 'path'
|
|
2
|
-
import {PluginGenerator} from
|
|
2
|
+
import {PluginGenerator} from '../../lib/generators/plugin/PluginGenerator'
|
|
3
3
|
|
|
4
4
|
(async () => {
|
|
5
5
|
const applicationProject = new PluginGenerator({
|
|
@@ -13,4 +13,4 @@ import {PluginGenerator} from "../../lib/generators/plugin/PluginGenerator";
|
|
|
13
13
|
} catch (e) {
|
|
14
14
|
console.error(e)
|
|
15
15
|
}
|
|
16
|
-
})()
|
|
16
|
+
})()
|
package/outputs/.gitkeep
DELETED
|
File without changes
|