@lakutata/cli 1.0.37 → 2.1.0-alpha.4
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/CHANGELOG.md +52 -0
- package/README.md +6 -26
- package/package.json +28 -56
- package/src/CLIApp.ts +86 -0
- package/src/controllers/CommandLineController.ts +34 -0
- package/src/lib/ProjectTypeConfig.ts +20 -0
- package/src/lib/SpecialChar.ts +8 -0
- package/src/lib/components/DeGitPuller.ts +41 -0
- package/src/lib/components/Spinner.ts +48 -0
- package/src/lib/providers/Creator.ts +125 -0
- package/src/lib/providers/Information.ts +221 -0
- package/src/options/CreateProjectOptions.ts +82 -0
- package/src/options/LakutataInfoOptions.ts +4 -0
- package/tsconfig.json +3 -33
- package/.eslintrc.json +0 -47
- package/.idea/codeStyles/Project.xml +0 -18
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/dbnavigator.xml +0 -457
- package/.idea/inspectionProfiles/Project_Default.xml +0 -10
- package/.idea/lakutata-cli.iml +0 -14
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/LICENSE +0 -21
- package/assets/lakutata-banner.png +0 -0
- package/assets/lakutata_logo.jpg +0 -0
- package/build/CLI.d.ts +0 -2
- package/build/CLI.js +0 -13
- package/build/CLI.js.map +0 -1
- package/build/Deploy.d.ts +0 -1
- package/build/Deploy.js +0 -129
- package/build/Deploy.js.map +0 -1
- package/build/constants/GitIgnore.d.ts +0 -1
- package/build/constants/GitIgnore.js +0 -157
- package/build/constants/GitIgnore.js.map +0 -1
- package/build/constants/LicenseList.d.ts +0 -4
- package/build/constants/LicenseList.js +0 -68
- package/build/constants/LicenseList.js.map +0 -1
- package/build/interfaces/IApplicationInfo.d.ts +0 -4
- package/build/interfaces/IApplicationInfo.js +0 -3
- package/build/interfaces/IApplicationInfo.js.map +0 -1
- package/build/interfaces/IComponentInfo.d.ts +0 -4
- package/build/interfaces/IComponentInfo.js +0 -3
- package/build/interfaces/IComponentInfo.js.map +0 -1
- package/build/interfaces/IGenerator.d.ts +0 -3
- package/build/interfaces/IGenerator.js +0 -3
- package/build/interfaces/IGenerator.js.map +0 -1
- package/build/interfaces/IModuleInfo.d.ts +0 -4
- package/build/interfaces/IModuleInfo.js +0 -3
- package/build/interfaces/IModuleInfo.js.map +0 -1
- package/build/interfaces/IPluginInfo.d.ts +0 -4
- package/build/interfaces/IPluginInfo.js +0 -3
- package/build/interfaces/IPluginInfo.js.map +0 -1
- package/build/interfaces/IPreparePackageConfigOptions.d.ts +0 -19
- package/build/interfaces/IPreparePackageConfigOptions.js +0 -3
- package/build/interfaces/IPreparePackageConfigOptions.js.map +0 -1
- package/build/interfaces/IProjectGeneratorOptions.d.ts +0 -16
- package/build/interfaces/IProjectGeneratorOptions.js +0 -3
- package/build/interfaces/IProjectGeneratorOptions.js.map +0 -1
- package/build/interfaces/IProjectInfo.d.ts +0 -14
- package/build/interfaces/IProjectInfo.js +0 -3
- package/build/interfaces/IProjectInfo.js.map +0 -1
- package/build/lib/LatestVersion.d.ts +0 -1
- package/build/lib/LatestVersion.js +0 -13
- package/build/lib/LatestVersion.js.map +0 -1
- package/build/lib/generators/application/ApplicationGenerator.d.ts +0 -18
- package/build/lib/generators/application/ApplicationGenerator.js +0 -84
- package/build/lib/generators/application/ApplicationGenerator.js.map +0 -1
- package/build/lib/generators/application/files/AppFile.d.ts +0 -8
- package/build/lib/generators/application/files/AppFile.js +0 -36
- package/build/lib/generators/application/files/AppFile.js.map +0 -1
- package/build/lib/generators/application/files/ConfigFile.d.ts +0 -9
- package/build/lib/generators/application/files/ConfigFile.js +0 -81
- package/build/lib/generators/application/files/ConfigFile.js.map +0 -1
- package/build/lib/generators/component/ComponentGenerator.d.ts +0 -17
- package/build/lib/generators/component/ComponentGenerator.js +0 -75
- package/build/lib/generators/component/ComponentGenerator.js.map +0 -1
- package/build/lib/generators/component/files/ComponentFile.d.ts +0 -8
- package/build/lib/generators/component/files/ComponentFile.js +0 -45
- package/build/lib/generators/component/files/ComponentFile.js.map +0 -1
- package/build/lib/generators/component/files/ComponentTestFile.d.ts +0 -8
- package/build/lib/generators/component/files/ComponentTestFile.js +0 -35
- package/build/lib/generators/component/files/ComponentTestFile.js.map +0 -1
- package/build/lib/generators/module/ModuleGenerator.d.ts +0 -17
- package/build/lib/generators/module/ModuleGenerator.js +0 -85
- package/build/lib/generators/module/ModuleGenerator.js.map +0 -1
- package/build/lib/generators/module/files/ModuleFile.d.ts +0 -8
- package/build/lib/generators/module/files/ModuleFile.js +0 -116
- package/build/lib/generators/module/files/ModuleFile.js.map +0 -1
- package/build/lib/generators/module/files/ModuleTestFile.d.ts +0 -8
- package/build/lib/generators/module/files/ModuleTestFile.js +0 -35
- package/build/lib/generators/module/files/ModuleTestFile.js.map +0 -1
- package/build/lib/generators/plugin/PluginGenerator.d.ts +0 -17
- package/build/lib/generators/plugin/PluginGenerator.js +0 -75
- package/build/lib/generators/plugin/PluginGenerator.js.map +0 -1
- package/build/lib/generators/plugin/files/PluginFile.d.ts +0 -8
- package/build/lib/generators/plugin/files/PluginFile.js +0 -50
- package/build/lib/generators/plugin/files/PluginFile.js.map +0 -1
- package/build/lib/generators/plugin/files/PluginTestFile.d.ts +0 -8
- package/build/lib/generators/plugin/files/PluginTestFile.js +0 -35
- package/build/lib/generators/plugin/files/PluginTestFile.js.map +0 -1
- package/build/lib/generators/project/ProjectGenerator.d.ts +0 -27
- package/build/lib/generators/project/ProjectGenerator.js +0 -157
- package/build/lib/generators/project/ProjectGenerator.js.map +0 -1
- package/build/lib/generators/project/ProjectSourceFile.d.ts +0 -5
- package/build/lib/generators/project/ProjectSourceFile.js +0 -7
- package/build/lib/generators/project/ProjectSourceFile.js.map +0 -1
- package/build/lib/generators/project/configs/ProjectEslintrcConfig.d.ts +0 -37
- package/build/lib/generators/project/configs/ProjectEslintrcConfig.js +0 -51
- package/build/lib/generators/project/configs/ProjectEslintrcConfig.js.map +0 -1
- package/build/lib/generators/project/configs/ProjectPackageConfig.d.ts +0 -1
- package/build/lib/generators/project/configs/ProjectPackageConfig.js +0 -32
- package/build/lib/generators/project/configs/ProjectPackageConfig.js.map +0 -1
- package/build/lib/generators/project/configs/ProjectTypescriptConfig.d.ts +0 -25
- package/build/lib/generators/project/configs/ProjectTypescriptConfig.js +0 -39
- package/build/lib/generators/project/configs/ProjectTypescriptConfig.js.map +0 -1
- package/build/lib/manipulators/CreateComponentManipulator.d.ts +0 -3
- package/build/lib/manipulators/CreateComponentManipulator.js +0 -71
- package/build/lib/manipulators/CreateComponentManipulator.js.map +0 -1
- package/build/lib/manipulators/CreateDockerFileManipulator.d.ts +0 -3
- package/build/lib/manipulators/CreateDockerFileManipulator.js +0 -124
- package/build/lib/manipulators/CreateDockerFileManipulator.js.map +0 -1
- package/build/lib/manipulators/CreateModuleManipulator.d.ts +0 -3
- package/build/lib/manipulators/CreateModuleManipulator.js +0 -142
- package/build/lib/manipulators/CreateModuleManipulator.js.map +0 -1
- package/build/lib/manipulators/CreatePluginManipulator.d.ts +0 -3
- package/build/lib/manipulators/CreatePluginManipulator.js +0 -76
- package/build/lib/manipulators/CreatePluginManipulator.js.map +0 -1
- package/build/lib/manipulators/CreateProcessManipulator.d.ts +0 -3
- package/build/lib/manipulators/CreateProcessManipulator.js +0 -61
- package/build/lib/manipulators/CreateProcessManipulator.js.map +0 -1
- package/build/lib/manipulators/CreateThreadManipulator.d.ts +0 -3
- package/build/lib/manipulators/CreateThreadManipulator.js +0 -61
- package/build/lib/manipulators/CreateThreadManipulator.js.map +0 -1
- package/build/lib/manipulators/application/ApplicationIndexManipulator.d.ts +0 -1
- package/build/lib/manipulators/application/ApplicationIndexManipulator.js +0 -162
- package/build/lib/manipulators/application/ApplicationIndexManipulator.js.map +0 -1
- package/build/lib/menus/MainMenu.d.ts +0 -1
- package/build/lib/menus/MainMenu.js +0 -160
- package/build/lib/menus/MainMenu.js.map +0 -1
- package/build/lib/menus/initializeMenus/InitializeApplicationProject.d.ts +0 -1
- package/build/lib/menus/initializeMenus/InitializeApplicationProject.js +0 -93
- package/build/lib/menus/initializeMenus/InitializeApplicationProject.js.map +0 -1
- package/build/lib/menus/initializeMenus/InitializeComponentProject.d.ts +0 -1
- package/build/lib/menus/initializeMenus/InitializeComponentProject.js +0 -93
- package/build/lib/menus/initializeMenus/InitializeComponentProject.js.map +0 -1
- package/build/lib/menus/initializeMenus/InitializeModuleProject.d.ts +0 -1
- package/build/lib/menus/initializeMenus/InitializeModuleProject.js +0 -93
- package/build/lib/menus/initializeMenus/InitializeModuleProject.js.map +0 -1
- package/build/lib/menus/initializeMenus/InitializePluginProject.d.ts +0 -1
- package/build/lib/menus/initializeMenus/InitializePluginProject.js +0 -93
- package/build/lib/menus/initializeMenus/InitializePluginProject.js.map +0 -1
- package/build/lib/menus/manipulateMenus/ManipulateApplicationProject.d.ts +0 -1
- package/build/lib/menus/manipulateMenus/ManipulateApplicationProject.js +0 -60
- package/build/lib/menus/manipulateMenus/ManipulateApplicationProject.js.map +0 -1
- package/build/lib/menus/manipulateMenus/ManipulateComponentProject.d.ts +0 -1
- package/build/lib/menus/manipulateMenus/ManipulateComponentProject.js +0 -9
- package/build/lib/menus/manipulateMenus/ManipulateComponentProject.js.map +0 -1
- package/build/lib/menus/manipulateMenus/ManipulateModuleProject.d.ts +0 -1
- package/build/lib/menus/manipulateMenus/ManipulateModuleProject.js +0 -49
- package/build/lib/menus/manipulateMenus/ManipulateModuleProject.js.map +0 -1
- package/build/lib/menus/manipulateMenus/ManipulatePluginProject.d.ts +0 -1
- package/build/lib/menus/manipulateMenus/ManipulatePluginProject.js +0 -9
- package/build/lib/menus/manipulateMenus/ManipulatePluginProject.js.map +0 -1
- package/src/CLI.ts +0 -7
- package/src/Deploy.ts +0 -124
- package/src/constants/GitIgnore.ts +0 -153
- package/src/constants/LicenseList.ts +0 -64
- package/src/interfaces/IApplicationInfo.ts +0 -5
- package/src/interfaces/IComponentInfo.ts +0 -5
- package/src/interfaces/IGenerator.ts +0 -3
- package/src/interfaces/IModuleInfo.ts +0 -5
- package/src/interfaces/IPluginInfo.ts +0 -5
- package/src/interfaces/IPreparePackageConfigOptions.ts +0 -11
- package/src/interfaces/IProjectGeneratorOptions.ts +0 -15
- package/src/interfaces/IProjectInfo.ts +0 -10
- package/src/lib/LatestVersion.ts +0 -6
- package/src/lib/generators/application/ApplicationGenerator.ts +0 -97
- package/src/lib/generators/application/files/AppFile.ts +0 -35
- package/src/lib/generators/application/files/ConfigFile.ts +0 -82
- package/src/lib/generators/component/ComponentGenerator.ts +0 -87
- package/src/lib/generators/component/files/ComponentFile.ts +0 -45
- package/src/lib/generators/component/files/ComponentTestFile.ts +0 -36
- package/src/lib/generators/module/ModuleGenerator.ts +0 -97
- package/src/lib/generators/module/files/ModuleFile.ts +0 -116
- package/src/lib/generators/module/files/ModuleTestFile.ts +0 -36
- package/src/lib/generators/plugin/PluginGenerator.ts +0 -87
- package/src/lib/generators/plugin/files/PluginFile.ts +0 -50
- package/src/lib/generators/plugin/files/PluginTestFile.ts +0 -36
- package/src/lib/generators/project/ProjectGenerator.ts +0 -205
- package/src/lib/generators/project/ProjectSourceFile.ts +0 -7
- package/src/lib/generators/project/configs/ProjectEslintrcConfig.ts +0 -47
- package/src/lib/generators/project/configs/ProjectPackageConfig.ts +0 -28
- package/src/lib/generators/project/configs/ProjectTypescriptConfig.ts +0 -35
- package/src/lib/manipulators/CreateComponentManipulator.ts +0 -66
- package/src/lib/manipulators/CreateDockerFileManipulator.ts +0 -121
- package/src/lib/manipulators/CreateModuleManipulator.ts +0 -137
- package/src/lib/manipulators/CreatePluginManipulator.ts +0 -71
- package/src/lib/manipulators/CreateProcessManipulator.ts +0 -56
- package/src/lib/manipulators/CreateThreadManipulator.ts +0 -56
- package/src/lib/manipulators/application/ApplicationIndexManipulator.ts +0 -169
- package/src/lib/menus/MainMenu.ts +0 -148
- package/src/lib/menus/initializeMenus/InitializeApplicationProject.ts +0 -84
- package/src/lib/menus/initializeMenus/InitializeComponentProject.ts +0 -84
- package/src/lib/menus/initializeMenus/InitializeModuleProject.ts +0 -84
- package/src/lib/menus/initializeMenus/InitializePluginProject.ts +0 -84
- package/src/lib/menus/manipulateMenus/ManipulateApplicationProject.ts +0 -60
- package/src/lib/menus/manipulateMenus/ManipulateComponentProject.ts +0 -13
- package/src/lib/menus/manipulateMenus/ManipulateModuleProject.ts +0 -49
- package/src/lib/menus/manipulateMenus/ManipulatePluginProject.ts +0 -13
- package/src/tests/generators/GenerateApplication.spec.ts +0 -16
- package/src/tests/generators/GenerateComponent.spec.ts +0 -16
- package/src/tests/generators/GenerateModule.spec.ts +0 -16
- package/src/tests/generators/GeneratePlugin.spec.ts +0 -16
- package/typings.d.ts +0 -4
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Identifier,
|
|
3
|
-
ObjectLiteralExpression,
|
|
4
|
-
Project,
|
|
5
|
-
PropertyAssignment,
|
|
6
|
-
SourceFile, StructureKind,
|
|
7
|
-
Symbol
|
|
8
|
-
} from 'ts-morph'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* 更新项目索引
|
|
12
|
-
* @param projectPath
|
|
13
|
-
* @param tsConfigFilePath
|
|
14
|
-
* @param configuration
|
|
15
|
-
* @constructor
|
|
16
|
-
*/
|
|
17
|
-
export async function ApplicationIndexManipulator(projectPath: string, tsConfigFilePath: string, configuration: string) {
|
|
18
|
-
const project = new Project({
|
|
19
|
-
tsConfigFilePath: tsConfigFilePath
|
|
20
|
-
})
|
|
21
|
-
project.addSourceFilesAtPaths(projectPath)
|
|
22
|
-
if (!project.getSourceFile(configuration)) return console.error('项目读取错误: 项目配置文件未找到')
|
|
23
|
-
const configFile: SourceFile = project.getSourceFile(configuration) as SourceFile
|
|
24
|
-
const moduleDeclaration = configFile.getModule(`'@lakutata/core'`)
|
|
25
|
-
if (!moduleDeclaration) return console.error('项目读取错误: 模块声明未找到')
|
|
26
|
-
const configFunction = configFile.getFunction('Config')
|
|
27
|
-
if (!configFunction) return console.error('项目读取错误: 配置方法未找到')
|
|
28
|
-
const applicationInterface = moduleDeclaration.getInterface('Application')
|
|
29
|
-
if (!applicationInterface) return console.error('项目读取错误: 程序声明未找到')
|
|
30
|
-
moduleDeclaration.removeBody()
|
|
31
|
-
const componentMap: Map<string, string> = new Map()
|
|
32
|
-
const moduleMap: Map<string, string> = new Map()
|
|
33
|
-
configFunction.getChildren().forEach(node => {
|
|
34
|
-
if (node.getKindName() === 'Block') {
|
|
35
|
-
node.getDescendantStatements().forEach(statement => {
|
|
36
|
-
if (statement.getKindName() === 'ReturnStatement') {
|
|
37
|
-
statement.forEachChild(childNode => {
|
|
38
|
-
if (childNode.getKindName() === 'ObjectLiteralExpression') {
|
|
39
|
-
const OLE: ObjectLiteralExpression = childNode as ObjectLiteralExpression
|
|
40
|
-
if (OLE.getProperty('components')) {
|
|
41
|
-
const components: PropertyAssignment = OLE.getProperty('components') as PropertyAssignment
|
|
42
|
-
components.forEachChild(componentNode => {
|
|
43
|
-
if (componentNode.getKindName() === 'ObjectLiteralExpression') {
|
|
44
|
-
const COLE: ObjectLiteralExpression = componentNode as ObjectLiteralExpression
|
|
45
|
-
COLE.forEachChild(COLENode => {
|
|
46
|
-
const COLENodePropertyAssignment: PropertyAssignment = COLENode as PropertyAssignment
|
|
47
|
-
//组件名称
|
|
48
|
-
let componentName: string | null = null
|
|
49
|
-
let componentClassName: string | null = null
|
|
50
|
-
COLENodePropertyAssignment.forEachChild(COLENodePropertyAssignmentNode => {
|
|
51
|
-
if (COLENodePropertyAssignmentNode.getKindName() === 'Identifier') {
|
|
52
|
-
const identifier: Identifier = COLENodePropertyAssignmentNode as Identifier
|
|
53
|
-
const symbol = identifier.getSymbol() as Symbol
|
|
54
|
-
if (!componentName) {
|
|
55
|
-
//获取组件名称
|
|
56
|
-
componentName = symbol.getName()
|
|
57
|
-
} else {
|
|
58
|
-
//获取组件类名
|
|
59
|
-
componentClassName = symbol.getName()
|
|
60
|
-
}
|
|
61
|
-
} else if (COLENodePropertyAssignmentNode.getKindName() === 'ObjectLiteralExpression') {
|
|
62
|
-
const componentObjectLiteralExpression: ObjectLiteralExpression = COLENodePropertyAssignmentNode as ObjectLiteralExpression
|
|
63
|
-
componentObjectLiteralExpression.forEachChild(item => {
|
|
64
|
-
if (item.getKindName() === 'PropertyAssignment') {
|
|
65
|
-
const componentConfigItem: PropertyAssignment = item as PropertyAssignment
|
|
66
|
-
const keyName = (componentConfigItem.getSymbol() as Symbol).getName()
|
|
67
|
-
if (keyName === 'class') {
|
|
68
|
-
const initializer = componentConfigItem.getStructure().initializer
|
|
69
|
-
if (typeof initializer === 'string') {
|
|
70
|
-
componentClassName = initializer
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
})
|
|
75
|
-
}
|
|
76
|
-
})
|
|
77
|
-
if (componentName && componentClassName) {
|
|
78
|
-
componentMap.set(componentName, componentClassName)
|
|
79
|
-
}
|
|
80
|
-
})
|
|
81
|
-
}
|
|
82
|
-
})
|
|
83
|
-
}
|
|
84
|
-
if (OLE.getProperty('modules')) {
|
|
85
|
-
const modules: PropertyAssignment = OLE.getProperty('modules') as PropertyAssignment
|
|
86
|
-
modules.forEachChild(moduleNode => {
|
|
87
|
-
if (moduleNode.getKindName() === 'ObjectLiteralExpression') {
|
|
88
|
-
const MOLE: ObjectLiteralExpression = moduleNode as ObjectLiteralExpression
|
|
89
|
-
MOLE.forEachChild(MOLENode => {
|
|
90
|
-
const MOLENodePropertyAssignment: PropertyAssignment = MOLENode as PropertyAssignment
|
|
91
|
-
//模块名称
|
|
92
|
-
let moduleName: string | null = null
|
|
93
|
-
let moduleClassName: string | null = null
|
|
94
|
-
MOLENodePropertyAssignment.forEachChild(MOLENodePropertyAssignmentNode => {
|
|
95
|
-
if (MOLENodePropertyAssignmentNode.getKindName() === 'Identifier') {
|
|
96
|
-
//获取模块名称
|
|
97
|
-
const identifier: Identifier = MOLENodePropertyAssignmentNode as Identifier
|
|
98
|
-
const symbol = identifier.getSymbol() as Symbol
|
|
99
|
-
moduleName = symbol.getName()
|
|
100
|
-
} else if (MOLENodePropertyAssignmentNode.getKindName() === 'ObjectLiteralExpression') {
|
|
101
|
-
const moduleObjectLiteralExpression: ObjectLiteralExpression = MOLENodePropertyAssignmentNode as ObjectLiteralExpression
|
|
102
|
-
moduleObjectLiteralExpression.forEachChild(item => {
|
|
103
|
-
if (item.getKindName() === 'PropertyAssignment') {
|
|
104
|
-
const moduleConfigItem: PropertyAssignment = item as PropertyAssignment
|
|
105
|
-
const keyName = (moduleConfigItem.getSymbol() as Symbol).getName()
|
|
106
|
-
if (keyName === 'class') {
|
|
107
|
-
const initializer = moduleConfigItem.getStructure().initializer
|
|
108
|
-
if (typeof initializer === 'string') {
|
|
109
|
-
moduleClassName = initializer
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
})
|
|
114
|
-
}
|
|
115
|
-
})
|
|
116
|
-
if (moduleName && moduleClassName) {
|
|
117
|
-
moduleMap.set(moduleName, moduleClassName)
|
|
118
|
-
}
|
|
119
|
-
})
|
|
120
|
-
}
|
|
121
|
-
})
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
})
|
|
125
|
-
}
|
|
126
|
-
})
|
|
127
|
-
}
|
|
128
|
-
})
|
|
129
|
-
moduleDeclaration.addStatements([{
|
|
130
|
-
kind: StructureKind.Interface,
|
|
131
|
-
name: 'Application',
|
|
132
|
-
properties: [
|
|
133
|
-
{
|
|
134
|
-
name: 'Components()',
|
|
135
|
-
kind: StructureKind.PropertySignature,
|
|
136
|
-
leadingTrivia: 'get ',
|
|
137
|
-
type: writer => {
|
|
138
|
-
writer.block(() => {
|
|
139
|
-
writer.writeLine('get:<T extends Component = Component>(name: string) => T')
|
|
140
|
-
writer.writeLine('has:(name:string)=>boolean')
|
|
141
|
-
componentMap.forEach((componentClassName, componentName) => {
|
|
142
|
-
writer.writeLine(`${componentName}:${componentClassName}`)
|
|
143
|
-
})
|
|
144
|
-
})
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
name: 'Modules()',
|
|
149
|
-
kind: StructureKind.PropertySignature,
|
|
150
|
-
leadingTrivia: 'get ',
|
|
151
|
-
type: writer => {
|
|
152
|
-
writer.block(() => {
|
|
153
|
-
writer.writeLine('get:<T extends Module = Module>(name: string) => T')
|
|
154
|
-
writer.writeLine('has:(name:string)=>boolean')
|
|
155
|
-
moduleMap.forEach((moduleClassName, moduleName) => {
|
|
156
|
-
writer.writeLine(`${moduleName}:${moduleClassName}`)
|
|
157
|
-
})
|
|
158
|
-
})
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
]
|
|
162
|
-
}])
|
|
163
|
-
try {
|
|
164
|
-
await project.save()
|
|
165
|
-
console.info('索引更新成功')
|
|
166
|
-
} catch (e) {
|
|
167
|
-
console.error(`索引更新出错: ${(e as Error).message}`)
|
|
168
|
-
}
|
|
169
|
-
}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import inquirer from 'inquirer'
|
|
2
|
-
import {InitializeApplicationProject} from './initializeMenus/InitializeApplicationProject'
|
|
3
|
-
import {InitializeModuleProject} from './initializeMenus/InitializeModuleProject'
|
|
4
|
-
import {InitializeComponentProject} from './initializeMenus/InitializeComponentProject'
|
|
5
|
-
import {InitializePluginProject} from './initializeMenus/InitializePluginProject'
|
|
6
|
-
import {gt} from 'semver'
|
|
7
|
-
import path from 'path'
|
|
8
|
-
import fs from 'fs'
|
|
9
|
-
import {ManipulateApplicationProject} from './manipulateMenus/ManipulateApplicationProject'
|
|
10
|
-
import {ManipulateModuleProject} from './manipulateMenus/ManipulateModuleProject'
|
|
11
|
-
import {ManipulateComponentProject} from './manipulateMenus/ManipulateComponentProject'
|
|
12
|
-
import {ManipulatePluginProject} from './manipulateMenus/ManipulatePluginProject'
|
|
13
|
-
import { LatestVersion } from '../LatestVersion'
|
|
14
|
-
|
|
15
|
-
export async function MainMenu(packageJson: any) {
|
|
16
|
-
const mainMenuOpt = await inquirer.prompt([{
|
|
17
|
-
name: 'opr',
|
|
18
|
-
message: `请选择需要进行的操作 (Lakutata CLI ${packageJson.version})`,
|
|
19
|
-
type: 'list',
|
|
20
|
-
choices: [
|
|
21
|
-
{
|
|
22
|
-
name: '创建Lakutata项目',
|
|
23
|
-
value: 'initialize'
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
name: '编辑Lakutata项目',
|
|
27
|
-
value: 'manipulate'
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: '关于Lakutata CLI',
|
|
31
|
-
value: 'about'
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
name: '检查更新',
|
|
35
|
-
value: 'check-update'
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
}])
|
|
39
|
-
switch (mainMenuOpt.opr) {
|
|
40
|
-
case 'initialize': {
|
|
41
|
-
const initializeProjectOption = await inquirer.prompt([
|
|
42
|
-
{
|
|
43
|
-
name: 'type',
|
|
44
|
-
message: '请选择生成的项目类型',
|
|
45
|
-
type: 'list',
|
|
46
|
-
choices: [
|
|
47
|
-
{
|
|
48
|
-
name: '应用程序',
|
|
49
|
-
value: 'application'
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
name: '模块',
|
|
53
|
-
value: 'module'
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: '组件',
|
|
57
|
-
value: 'component'
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
name: '插件',
|
|
61
|
-
value: 'plugin'
|
|
62
|
-
}
|
|
63
|
-
]
|
|
64
|
-
}, {
|
|
65
|
-
name: 'path',
|
|
66
|
-
message: '项目生成地址',
|
|
67
|
-
type: 'input',
|
|
68
|
-
default: process.cwd()
|
|
69
|
-
}
|
|
70
|
-
])
|
|
71
|
-
const projectPath: string = initializeProjectOption.path
|
|
72
|
-
switch (initializeProjectOption.type) {
|
|
73
|
-
case 'application': {
|
|
74
|
-
return await InitializeApplicationProject(projectPath)
|
|
75
|
-
}
|
|
76
|
-
case 'module': {
|
|
77
|
-
return await InitializeModuleProject(projectPath)
|
|
78
|
-
}
|
|
79
|
-
case 'component': {
|
|
80
|
-
return await InitializeComponentProject(projectPath)
|
|
81
|
-
}
|
|
82
|
-
case 'plugin': {
|
|
83
|
-
return await InitializePluginProject(projectPath)
|
|
84
|
-
}
|
|
85
|
-
default: {
|
|
86
|
-
console.warn('不正确的项目类型:', initializeProjectOption.type)
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
break
|
|
91
|
-
case 'manipulate': {
|
|
92
|
-
const projectPath: string = process.cwd()
|
|
93
|
-
const packageJsonPath: string = path.resolve(projectPath, './package.json')
|
|
94
|
-
const tsconfigJsonPath: string = path.resolve(projectPath, './tsconfig.json')
|
|
95
|
-
if (!fs.existsSync(packageJsonPath)) {
|
|
96
|
-
return console.error('项目信息读取错误: 请在项目根目录执行该指令')
|
|
97
|
-
}
|
|
98
|
-
try {
|
|
99
|
-
const projectPackageJson = JSON.parse(fs.readFileSync(packageJsonPath, {encoding: 'utf-8'}))
|
|
100
|
-
if (projectPackageJson.lakutata && projectPackageJson.lakutata.type) {
|
|
101
|
-
const projectType: 'application' | 'module' | 'component' | 'plugin' = projectPackageJson.lakutata.type
|
|
102
|
-
switch (projectType) {
|
|
103
|
-
case 'application': {
|
|
104
|
-
return await ManipulateApplicationProject(projectPath, tsconfigJsonPath, projectPackageJson.lakutata)
|
|
105
|
-
}
|
|
106
|
-
case 'module': {
|
|
107
|
-
return await ManipulateModuleProject(projectPath, tsconfigJsonPath, projectPackageJson.lakutata)
|
|
108
|
-
}
|
|
109
|
-
case 'component': {
|
|
110
|
-
return await ManipulateComponentProject(projectPath, tsconfigJsonPath, projectPackageJson.lakutata)
|
|
111
|
-
}
|
|
112
|
-
case 'plugin': {
|
|
113
|
-
return ManipulatePluginProject(projectPath, tsconfigJsonPath, projectPackageJson.lakutata)
|
|
114
|
-
}
|
|
115
|
-
default: {
|
|
116
|
-
return console.error(`项目信息读取错误: 无效的项目类型[${projectType}]`)
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
} else {
|
|
120
|
-
return console.error('项目信息读取错误: 无法操作非Lakutata框架的项目')
|
|
121
|
-
}
|
|
122
|
-
} catch (e) {
|
|
123
|
-
return console.error(`项目信息读取错误: ${(e as Error).message}`)
|
|
124
|
-
}
|
|
125
|
-
return
|
|
126
|
-
}
|
|
127
|
-
case 'about': {
|
|
128
|
-
console.log('Lakutata CLI - Lakutata框架辅助工具')
|
|
129
|
-
console.log('Version:', packageJson.version)
|
|
130
|
-
console.log('Powered by Lakutata')
|
|
131
|
-
return
|
|
132
|
-
}
|
|
133
|
-
case 'check-update': {
|
|
134
|
-
try {
|
|
135
|
-
const localVersion: string = packageJson.version
|
|
136
|
-
const npmVersion: string = await LatestVersion(packageJson.name.toString())
|
|
137
|
-
if (gt(npmVersion, localVersion)) {
|
|
138
|
-
console.info('有可用更新:', localVersion, '➡', npmVersion)
|
|
139
|
-
console.info('执行', `npm install -g ${packageJson.name}`, '进行更新')
|
|
140
|
-
} else {
|
|
141
|
-
console.info('无可用更新')
|
|
142
|
-
}
|
|
143
|
-
} catch (e) {
|
|
144
|
-
console.error(`检查更新失败: ${(e as Error).message}`)
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import inquirer from 'inquirer'
|
|
2
|
-
import {ApplicationGenerator} from '../../generators/application/ApplicationGenerator'
|
|
3
|
-
import {LicenseList} from '../../../constants/LicenseList'
|
|
4
|
-
import shell from 'shelljs'
|
|
5
|
-
|
|
6
|
-
export async function InitializeApplicationProject(projectPath: string) {
|
|
7
|
-
const options = await inquirer.prompt([
|
|
8
|
-
{
|
|
9
|
-
name: 'id',
|
|
10
|
-
message: '请输入应用的ID[例如:identifier.scope.app]',
|
|
11
|
-
type: 'input'
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: 'name',
|
|
15
|
-
message: '请输入应用名称',
|
|
16
|
-
type: 'input'
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
name: 'author',
|
|
20
|
-
message: '请输入作者名称',
|
|
21
|
-
type: 'input'
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: 'description',
|
|
25
|
-
message: '请输入应用说明',
|
|
26
|
-
type: 'input'
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: 'keywords',
|
|
30
|
-
message: '请输入应用关键词(使用逗号分隔)',
|
|
31
|
-
type: 'input'
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
name: 'license',
|
|
35
|
-
message: '请选择应用开源许可协议',
|
|
36
|
-
type: 'list',
|
|
37
|
-
default: 'UNLICENSED',
|
|
38
|
-
choices: LicenseList
|
|
39
|
-
}
|
|
40
|
-
])
|
|
41
|
-
console.info('==================================================')
|
|
42
|
-
console.info('项目目录:', projectPath)
|
|
43
|
-
console.info('应用的ID:', options.id)
|
|
44
|
-
console.info('应用名称:', options.name)
|
|
45
|
-
console.info('作者名称:', options.author)
|
|
46
|
-
console.info('应用说明:', options.description)
|
|
47
|
-
console.info('关键词:', options.keywords)
|
|
48
|
-
console.info('开源许可协议:', options.license)
|
|
49
|
-
console.info('==================================================')
|
|
50
|
-
const confirmResult = await inquirer.prompt([
|
|
51
|
-
{
|
|
52
|
-
name: 'confirm',
|
|
53
|
-
message: '请确认信息是否填写正确',
|
|
54
|
-
type: 'confirm',
|
|
55
|
-
default: 'Y'
|
|
56
|
-
}
|
|
57
|
-
])
|
|
58
|
-
if (confirmResult.confirm) {
|
|
59
|
-
const applicationProject = new ApplicationGenerator({
|
|
60
|
-
id: options.id,
|
|
61
|
-
name: options.name,
|
|
62
|
-
author: options.author,
|
|
63
|
-
license: options.license,
|
|
64
|
-
description: options.description,
|
|
65
|
-
keywords: (() => {
|
|
66
|
-
if (options.keywords) {
|
|
67
|
-
return options.keywords.toString().split(',')
|
|
68
|
-
} else {
|
|
69
|
-
return []
|
|
70
|
-
}
|
|
71
|
-
})(),
|
|
72
|
-
path: projectPath
|
|
73
|
-
})
|
|
74
|
-
try {
|
|
75
|
-
console.info('正在生成项目文件')
|
|
76
|
-
await applicationProject.generate()
|
|
77
|
-
console.info('项目文件生成成功')
|
|
78
|
-
shell.cd(projectPath).exec('npm install --build-from-source --unsafe-perm', {silent: true, async: false})
|
|
79
|
-
console.info('应用初始化完成!')
|
|
80
|
-
} catch (e) {
|
|
81
|
-
console.error(`项目生成错误: ${(e as Error).message}`)
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import inquirer from 'inquirer'
|
|
2
|
-
import {ComponentGenerator} from '../../generators/component/ComponentGenerator'
|
|
3
|
-
import {LicenseList} from '../../../constants/LicenseList'
|
|
4
|
-
import shell from 'shelljs'
|
|
5
|
-
|
|
6
|
-
export async function InitializeComponentProject(projectPath: string) {
|
|
7
|
-
const options = await inquirer.prompt([
|
|
8
|
-
{
|
|
9
|
-
name: 'className',
|
|
10
|
-
message: '请输入组件名称',
|
|
11
|
-
type: 'input'
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: 'name',
|
|
15
|
-
message: '请输入项目名称',
|
|
16
|
-
type: 'input'
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
name: 'author',
|
|
20
|
-
message: '请输入作者名称',
|
|
21
|
-
type: 'input'
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: 'description',
|
|
25
|
-
message: '请输入项目说明',
|
|
26
|
-
type: 'input'
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: 'keywords',
|
|
30
|
-
message: '请输入项目关键词(使用逗号分隔)',
|
|
31
|
-
type: 'input'
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
name: 'license',
|
|
35
|
-
message: '请选择项目开源许可协议',
|
|
36
|
-
type: 'list',
|
|
37
|
-
default: 'UNLICENSED',
|
|
38
|
-
choices: LicenseList
|
|
39
|
-
}
|
|
40
|
-
])
|
|
41
|
-
console.info('==================================================')
|
|
42
|
-
console.info('项目目录:', projectPath)
|
|
43
|
-
console.info('组件名称:', options.className)
|
|
44
|
-
console.info('项目名称:', options.name)
|
|
45
|
-
console.info('作者名称:', options.author)
|
|
46
|
-
console.info('项目说明:', options.description)
|
|
47
|
-
console.info('关键词:', options.keywords)
|
|
48
|
-
console.info('开源许可协议:', options.license)
|
|
49
|
-
console.info('==================================================')
|
|
50
|
-
const confirmResult = await inquirer.prompt([
|
|
51
|
-
{
|
|
52
|
-
name: 'confirm',
|
|
53
|
-
message: '请确认信息是否填写正确',
|
|
54
|
-
type: 'confirm',
|
|
55
|
-
default: 'Y'
|
|
56
|
-
}
|
|
57
|
-
])
|
|
58
|
-
if (confirmResult.confirm) {
|
|
59
|
-
const componentGenerator = new ComponentGenerator({
|
|
60
|
-
className: options.className,
|
|
61
|
-
name: options.name,
|
|
62
|
-
author: options.author,
|
|
63
|
-
license: options.license,
|
|
64
|
-
description: options.description,
|
|
65
|
-
keywords: (() => {
|
|
66
|
-
if (options.keywords) {
|
|
67
|
-
return options.keywords.toString().split(',')
|
|
68
|
-
} else {
|
|
69
|
-
return []
|
|
70
|
-
}
|
|
71
|
-
})(),
|
|
72
|
-
path: projectPath
|
|
73
|
-
})
|
|
74
|
-
try {
|
|
75
|
-
console.info('正在生成项目文件')
|
|
76
|
-
await componentGenerator.generate()
|
|
77
|
-
console.info('项目文件生成成功')
|
|
78
|
-
shell.cd(projectPath).exec('npm install --build-from-source --unsafe-perm', {silent: true, async: false})
|
|
79
|
-
console.info('应用初始化完成!')
|
|
80
|
-
} catch (e) {
|
|
81
|
-
console.error(`项目生成错误: ${(e as Error).message}`)
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import inquirer from 'inquirer'
|
|
2
|
-
import {LicenseList} from '../../../constants/LicenseList'
|
|
3
|
-
import {ModuleGenerator} from '../../generators/module/ModuleGenerator'
|
|
4
|
-
import shell from 'shelljs'
|
|
5
|
-
|
|
6
|
-
export async function InitializeModuleProject(projectPath: string) {
|
|
7
|
-
const options = await inquirer.prompt([
|
|
8
|
-
{
|
|
9
|
-
name: 'className',
|
|
10
|
-
message: '请输入模块名称',
|
|
11
|
-
type: 'input'
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: 'name',
|
|
15
|
-
message: '请输入项目名称',
|
|
16
|
-
type: 'input'
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
name: 'author',
|
|
20
|
-
message: '请输入作者名称',
|
|
21
|
-
type: 'input'
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: 'description',
|
|
25
|
-
message: '请输入项目说明',
|
|
26
|
-
type: 'input'
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: 'keywords',
|
|
30
|
-
message: '请输入项目关键词(使用逗号分隔)',
|
|
31
|
-
type: 'input'
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
name: 'license',
|
|
35
|
-
message: '请选择项目开源许可协议',
|
|
36
|
-
type: 'list',
|
|
37
|
-
default: 'UNLICENSED',
|
|
38
|
-
choices: LicenseList
|
|
39
|
-
}
|
|
40
|
-
])
|
|
41
|
-
console.info('==================================================')
|
|
42
|
-
console.info('项目目录:', projectPath)
|
|
43
|
-
console.info('模块名称:', options.className)
|
|
44
|
-
console.info('项目名称:', options.name)
|
|
45
|
-
console.info('作者名称:', options.author)
|
|
46
|
-
console.info('项目说明:', options.description)
|
|
47
|
-
console.info('关键词:', options.keywords)
|
|
48
|
-
console.info('开源许可协议:', options.license)
|
|
49
|
-
console.info('==================================================')
|
|
50
|
-
const confirmResult = await inquirer.prompt([
|
|
51
|
-
{
|
|
52
|
-
name: 'confirm',
|
|
53
|
-
message: '请确认信息是否填写正确',
|
|
54
|
-
type: 'confirm',
|
|
55
|
-
default: 'Y'
|
|
56
|
-
}
|
|
57
|
-
])
|
|
58
|
-
if (confirmResult.confirm) {
|
|
59
|
-
const moduleGenerator = new ModuleGenerator({
|
|
60
|
-
className: options.className,
|
|
61
|
-
name: options.name,
|
|
62
|
-
author: options.author,
|
|
63
|
-
license: options.license,
|
|
64
|
-
description: options.description,
|
|
65
|
-
keywords: (() => {
|
|
66
|
-
if (options.keywords) {
|
|
67
|
-
return options.keywords.toString().split(',')
|
|
68
|
-
} else {
|
|
69
|
-
return []
|
|
70
|
-
}
|
|
71
|
-
})(),
|
|
72
|
-
path: projectPath
|
|
73
|
-
})
|
|
74
|
-
try {
|
|
75
|
-
console.info('正在生成项目文件')
|
|
76
|
-
await moduleGenerator.generate()
|
|
77
|
-
console.info('项目文件生成成功')
|
|
78
|
-
shell.cd(projectPath).exec('npm install --build-from-source --unsafe-perm', {silent: true, async: false})
|
|
79
|
-
console.info('应用初始化完成!')
|
|
80
|
-
} catch (e) {
|
|
81
|
-
console.error(`项目生成错误: ${(e as Error).message}`)
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import inquirer from 'inquirer'
|
|
2
|
-
import {LicenseList} from '../../../constants/LicenseList'
|
|
3
|
-
import {PluginGenerator} from '../../generators/plugin/PluginGenerator'
|
|
4
|
-
import shell from 'shelljs'
|
|
5
|
-
|
|
6
|
-
export async function InitializePluginProject(projectPath: string) {
|
|
7
|
-
const options = await inquirer.prompt([
|
|
8
|
-
{
|
|
9
|
-
name: 'className',
|
|
10
|
-
message: '请输入插件名称',
|
|
11
|
-
type: 'input'
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: 'name',
|
|
15
|
-
message: '请输入项目名称',
|
|
16
|
-
type: 'input'
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
name: 'author',
|
|
20
|
-
message: '请输入作者名称',
|
|
21
|
-
type: 'input'
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: 'description',
|
|
25
|
-
message: '请输入项目说明',
|
|
26
|
-
type: 'input'
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: 'keywords',
|
|
30
|
-
message: '请输入项目关键词(使用逗号分隔)',
|
|
31
|
-
type: 'input'
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
name: 'license',
|
|
35
|
-
message: '请选择项目开源许可协议',
|
|
36
|
-
type: 'list',
|
|
37
|
-
default: 'UNLICENSED',
|
|
38
|
-
choices: LicenseList
|
|
39
|
-
}
|
|
40
|
-
])
|
|
41
|
-
console.info('==================================================')
|
|
42
|
-
console.info('项目目录:', projectPath)
|
|
43
|
-
console.info('插件名称:', options.className)
|
|
44
|
-
console.info('项目名称:', options.name)
|
|
45
|
-
console.info('作者名称:', options.author)
|
|
46
|
-
console.info('项目说明:', options.description)
|
|
47
|
-
console.info('关键词:', options.keywords)
|
|
48
|
-
console.info('开源许可协议:', options.license)
|
|
49
|
-
console.info('==================================================')
|
|
50
|
-
const confirmResult = await inquirer.prompt([
|
|
51
|
-
{
|
|
52
|
-
name: 'confirm',
|
|
53
|
-
message: '请确认信息是否填写正确',
|
|
54
|
-
type: 'confirm',
|
|
55
|
-
default: 'Y'
|
|
56
|
-
}
|
|
57
|
-
])
|
|
58
|
-
if (confirmResult.confirm) {
|
|
59
|
-
const pluginGenerator = new PluginGenerator({
|
|
60
|
-
className: options.className,
|
|
61
|
-
name: options.name,
|
|
62
|
-
author: options.author,
|
|
63
|
-
license: options.license,
|
|
64
|
-
description: options.description,
|
|
65
|
-
keywords: (() => {
|
|
66
|
-
if (options.keywords) {
|
|
67
|
-
return options.keywords.toString().split(',')
|
|
68
|
-
} else {
|
|
69
|
-
return []
|
|
70
|
-
}
|
|
71
|
-
})(),
|
|
72
|
-
path: projectPath
|
|
73
|
-
})
|
|
74
|
-
try {
|
|
75
|
-
console.info('正在生成项目文件')
|
|
76
|
-
await pluginGenerator.generate()
|
|
77
|
-
console.info('项目文件生成成功')
|
|
78
|
-
shell.cd(projectPath).exec('npm install --build-from-source --unsafe-perm', {silent: true, async: false})
|
|
79
|
-
console.info('应用初始化完成!')
|
|
80
|
-
} catch (e) {
|
|
81
|
-
console.error(`项目生成错误: ${(e as Error).message}`)
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|