@lakutata/cli 1.0.36 → 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.
Files changed (214) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/README.md +6 -26
  3. package/package.json +28 -56
  4. package/src/CLIApp.ts +86 -0
  5. package/src/controllers/CommandLineController.ts +34 -0
  6. package/src/lib/ProjectTypeConfig.ts +20 -0
  7. package/src/lib/SpecialChar.ts +8 -0
  8. package/src/lib/components/DeGitPuller.ts +41 -0
  9. package/src/lib/components/Spinner.ts +48 -0
  10. package/src/lib/providers/Creator.ts +125 -0
  11. package/src/lib/providers/Information.ts +221 -0
  12. package/src/options/CreateProjectOptions.ts +82 -0
  13. package/src/options/LakutataInfoOptions.ts +4 -0
  14. package/tsconfig.json +3 -33
  15. package/.eslintrc.json +0 -47
  16. package/.idea/codeStyles/Project.xml +0 -18
  17. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  18. package/.idea/dbnavigator.xml +0 -457
  19. package/.idea/inspectionProfiles/Project_Default.xml +0 -10
  20. package/.idea/lakutata-cli.iml +0 -14
  21. package/.idea/modules.xml +0 -8
  22. package/.idea/vcs.xml +0 -6
  23. package/LICENSE +0 -21
  24. package/assets/lakutata-banner.png +0 -0
  25. package/assets/lakutata_logo.jpg +0 -0
  26. package/build/CLI.d.ts +0 -2
  27. package/build/CLI.js +0 -13
  28. package/build/CLI.js.map +0 -1
  29. package/build/Deploy.d.ts +0 -1
  30. package/build/Deploy.js +0 -133
  31. package/build/Deploy.js.map +0 -1
  32. package/build/constants/GitIgnore.d.ts +0 -1
  33. package/build/constants/GitIgnore.js +0 -157
  34. package/build/constants/GitIgnore.js.map +0 -1
  35. package/build/constants/LicenseList.d.ts +0 -4
  36. package/build/constants/LicenseList.js +0 -68
  37. package/build/constants/LicenseList.js.map +0 -1
  38. package/build/interfaces/IApplicationInfo.d.ts +0 -4
  39. package/build/interfaces/IApplicationInfo.js +0 -3
  40. package/build/interfaces/IApplicationInfo.js.map +0 -1
  41. package/build/interfaces/IComponentInfo.d.ts +0 -4
  42. package/build/interfaces/IComponentInfo.js +0 -3
  43. package/build/interfaces/IComponentInfo.js.map +0 -1
  44. package/build/interfaces/IGenerator.d.ts +0 -3
  45. package/build/interfaces/IGenerator.js +0 -3
  46. package/build/interfaces/IGenerator.js.map +0 -1
  47. package/build/interfaces/IModuleInfo.d.ts +0 -4
  48. package/build/interfaces/IModuleInfo.js +0 -3
  49. package/build/interfaces/IModuleInfo.js.map +0 -1
  50. package/build/interfaces/IPluginInfo.d.ts +0 -4
  51. package/build/interfaces/IPluginInfo.js +0 -3
  52. package/build/interfaces/IPluginInfo.js.map +0 -1
  53. package/build/interfaces/IPreparePackageConfigOptions.d.ts +0 -19
  54. package/build/interfaces/IPreparePackageConfigOptions.js +0 -3
  55. package/build/interfaces/IPreparePackageConfigOptions.js.map +0 -1
  56. package/build/interfaces/IProjectGeneratorOptions.d.ts +0 -16
  57. package/build/interfaces/IProjectGeneratorOptions.js +0 -3
  58. package/build/interfaces/IProjectGeneratorOptions.js.map +0 -1
  59. package/build/interfaces/IProjectInfo.d.ts +0 -14
  60. package/build/interfaces/IProjectInfo.js +0 -3
  61. package/build/interfaces/IProjectInfo.js.map +0 -1
  62. package/build/lib/LatestVersion.d.ts +0 -1
  63. package/build/lib/LatestVersion.js +0 -13
  64. package/build/lib/LatestVersion.js.map +0 -1
  65. package/build/lib/generators/application/ApplicationGenerator.d.ts +0 -18
  66. package/build/lib/generators/application/ApplicationGenerator.js +0 -84
  67. package/build/lib/generators/application/ApplicationGenerator.js.map +0 -1
  68. package/build/lib/generators/application/files/AppFile.d.ts +0 -8
  69. package/build/lib/generators/application/files/AppFile.js +0 -36
  70. package/build/lib/generators/application/files/AppFile.js.map +0 -1
  71. package/build/lib/generators/application/files/ConfigFile.d.ts +0 -9
  72. package/build/lib/generators/application/files/ConfigFile.js +0 -81
  73. package/build/lib/generators/application/files/ConfigFile.js.map +0 -1
  74. package/build/lib/generators/component/ComponentGenerator.d.ts +0 -17
  75. package/build/lib/generators/component/ComponentGenerator.js +0 -75
  76. package/build/lib/generators/component/ComponentGenerator.js.map +0 -1
  77. package/build/lib/generators/component/files/ComponentFile.d.ts +0 -8
  78. package/build/lib/generators/component/files/ComponentFile.js +0 -45
  79. package/build/lib/generators/component/files/ComponentFile.js.map +0 -1
  80. package/build/lib/generators/component/files/ComponentTestFile.d.ts +0 -8
  81. package/build/lib/generators/component/files/ComponentTestFile.js +0 -35
  82. package/build/lib/generators/component/files/ComponentTestFile.js.map +0 -1
  83. package/build/lib/generators/module/ModuleGenerator.d.ts +0 -17
  84. package/build/lib/generators/module/ModuleGenerator.js +0 -85
  85. package/build/lib/generators/module/ModuleGenerator.js.map +0 -1
  86. package/build/lib/generators/module/files/ModuleFile.d.ts +0 -8
  87. package/build/lib/generators/module/files/ModuleFile.js +0 -116
  88. package/build/lib/generators/module/files/ModuleFile.js.map +0 -1
  89. package/build/lib/generators/module/files/ModuleTestFile.d.ts +0 -8
  90. package/build/lib/generators/module/files/ModuleTestFile.js +0 -35
  91. package/build/lib/generators/module/files/ModuleTestFile.js.map +0 -1
  92. package/build/lib/generators/plugin/PluginGenerator.d.ts +0 -17
  93. package/build/lib/generators/plugin/PluginGenerator.js +0 -75
  94. package/build/lib/generators/plugin/PluginGenerator.js.map +0 -1
  95. package/build/lib/generators/plugin/files/PluginFile.d.ts +0 -8
  96. package/build/lib/generators/plugin/files/PluginFile.js +0 -50
  97. package/build/lib/generators/plugin/files/PluginFile.js.map +0 -1
  98. package/build/lib/generators/plugin/files/PluginTestFile.d.ts +0 -8
  99. package/build/lib/generators/plugin/files/PluginTestFile.js +0 -35
  100. package/build/lib/generators/plugin/files/PluginTestFile.js.map +0 -1
  101. package/build/lib/generators/project/ProjectGenerator.d.ts +0 -27
  102. package/build/lib/generators/project/ProjectGenerator.js +0 -157
  103. package/build/lib/generators/project/ProjectGenerator.js.map +0 -1
  104. package/build/lib/generators/project/ProjectSourceFile.d.ts +0 -5
  105. package/build/lib/generators/project/ProjectSourceFile.js +0 -7
  106. package/build/lib/generators/project/ProjectSourceFile.js.map +0 -1
  107. package/build/lib/generators/project/configs/ProjectEslintrcConfig.d.ts +0 -37
  108. package/build/lib/generators/project/configs/ProjectEslintrcConfig.js +0 -51
  109. package/build/lib/generators/project/configs/ProjectEslintrcConfig.js.map +0 -1
  110. package/build/lib/generators/project/configs/ProjectPackageConfig.d.ts +0 -1
  111. package/build/lib/generators/project/configs/ProjectPackageConfig.js +0 -32
  112. package/build/lib/generators/project/configs/ProjectPackageConfig.js.map +0 -1
  113. package/build/lib/generators/project/configs/ProjectTypescriptConfig.d.ts +0 -25
  114. package/build/lib/generators/project/configs/ProjectTypescriptConfig.js +0 -39
  115. package/build/lib/generators/project/configs/ProjectTypescriptConfig.js.map +0 -1
  116. package/build/lib/manipulators/CreateComponentManipulator.d.ts +0 -3
  117. package/build/lib/manipulators/CreateComponentManipulator.js +0 -71
  118. package/build/lib/manipulators/CreateComponentManipulator.js.map +0 -1
  119. package/build/lib/manipulators/CreateDockerFileManipulator.d.ts +0 -3
  120. package/build/lib/manipulators/CreateDockerFileManipulator.js +0 -124
  121. package/build/lib/manipulators/CreateDockerFileManipulator.js.map +0 -1
  122. package/build/lib/manipulators/CreateModuleManipulator.d.ts +0 -3
  123. package/build/lib/manipulators/CreateModuleManipulator.js +0 -142
  124. package/build/lib/manipulators/CreateModuleManipulator.js.map +0 -1
  125. package/build/lib/manipulators/CreatePluginManipulator.d.ts +0 -3
  126. package/build/lib/manipulators/CreatePluginManipulator.js +0 -76
  127. package/build/lib/manipulators/CreatePluginManipulator.js.map +0 -1
  128. package/build/lib/manipulators/CreateProcessManipulator.d.ts +0 -3
  129. package/build/lib/manipulators/CreateProcessManipulator.js +0 -61
  130. package/build/lib/manipulators/CreateProcessManipulator.js.map +0 -1
  131. package/build/lib/manipulators/CreateThreadManipulator.d.ts +0 -3
  132. package/build/lib/manipulators/CreateThreadManipulator.js +0 -61
  133. package/build/lib/manipulators/CreateThreadManipulator.js.map +0 -1
  134. package/build/lib/manipulators/application/ApplicationIndexManipulator.d.ts +0 -1
  135. package/build/lib/manipulators/application/ApplicationIndexManipulator.js +0 -162
  136. package/build/lib/manipulators/application/ApplicationIndexManipulator.js.map +0 -1
  137. package/build/lib/menus/MainMenu.d.ts +0 -1
  138. package/build/lib/menus/MainMenu.js +0 -160
  139. package/build/lib/menus/MainMenu.js.map +0 -1
  140. package/build/lib/menus/initializeMenus/InitializeApplicationProject.d.ts +0 -1
  141. package/build/lib/menus/initializeMenus/InitializeApplicationProject.js +0 -93
  142. package/build/lib/menus/initializeMenus/InitializeApplicationProject.js.map +0 -1
  143. package/build/lib/menus/initializeMenus/InitializeComponentProject.d.ts +0 -1
  144. package/build/lib/menus/initializeMenus/InitializeComponentProject.js +0 -93
  145. package/build/lib/menus/initializeMenus/InitializeComponentProject.js.map +0 -1
  146. package/build/lib/menus/initializeMenus/InitializeModuleProject.d.ts +0 -1
  147. package/build/lib/menus/initializeMenus/InitializeModuleProject.js +0 -93
  148. package/build/lib/menus/initializeMenus/InitializeModuleProject.js.map +0 -1
  149. package/build/lib/menus/initializeMenus/InitializePluginProject.d.ts +0 -1
  150. package/build/lib/menus/initializeMenus/InitializePluginProject.js +0 -93
  151. package/build/lib/menus/initializeMenus/InitializePluginProject.js.map +0 -1
  152. package/build/lib/menus/manipulateMenus/ManipulateApplicationProject.d.ts +0 -1
  153. package/build/lib/menus/manipulateMenus/ManipulateApplicationProject.js +0 -60
  154. package/build/lib/menus/manipulateMenus/ManipulateApplicationProject.js.map +0 -1
  155. package/build/lib/menus/manipulateMenus/ManipulateComponentProject.d.ts +0 -1
  156. package/build/lib/menus/manipulateMenus/ManipulateComponentProject.js +0 -9
  157. package/build/lib/menus/manipulateMenus/ManipulateComponentProject.js.map +0 -1
  158. package/build/lib/menus/manipulateMenus/ManipulateModuleProject.d.ts +0 -1
  159. package/build/lib/menus/manipulateMenus/ManipulateModuleProject.js +0 -49
  160. package/build/lib/menus/manipulateMenus/ManipulateModuleProject.js.map +0 -1
  161. package/build/lib/menus/manipulateMenus/ManipulatePluginProject.d.ts +0 -1
  162. package/build/lib/menus/manipulateMenus/ManipulatePluginProject.js +0 -9
  163. package/build/lib/menus/manipulateMenus/ManipulatePluginProject.js.map +0 -1
  164. package/src/CLI.ts +0 -7
  165. package/src/Deploy.ts +0 -128
  166. package/src/constants/GitIgnore.ts +0 -153
  167. package/src/constants/LicenseList.ts +0 -64
  168. package/src/interfaces/IApplicationInfo.ts +0 -5
  169. package/src/interfaces/IComponentInfo.ts +0 -5
  170. package/src/interfaces/IGenerator.ts +0 -3
  171. package/src/interfaces/IModuleInfo.ts +0 -5
  172. package/src/interfaces/IPluginInfo.ts +0 -5
  173. package/src/interfaces/IPreparePackageConfigOptions.ts +0 -11
  174. package/src/interfaces/IProjectGeneratorOptions.ts +0 -15
  175. package/src/interfaces/IProjectInfo.ts +0 -10
  176. package/src/lib/LatestVersion.ts +0 -6
  177. package/src/lib/generators/application/ApplicationGenerator.ts +0 -97
  178. package/src/lib/generators/application/files/AppFile.ts +0 -35
  179. package/src/lib/generators/application/files/ConfigFile.ts +0 -82
  180. package/src/lib/generators/component/ComponentGenerator.ts +0 -87
  181. package/src/lib/generators/component/files/ComponentFile.ts +0 -45
  182. package/src/lib/generators/component/files/ComponentTestFile.ts +0 -36
  183. package/src/lib/generators/module/ModuleGenerator.ts +0 -97
  184. package/src/lib/generators/module/files/ModuleFile.ts +0 -116
  185. package/src/lib/generators/module/files/ModuleTestFile.ts +0 -36
  186. package/src/lib/generators/plugin/PluginGenerator.ts +0 -87
  187. package/src/lib/generators/plugin/files/PluginFile.ts +0 -50
  188. package/src/lib/generators/plugin/files/PluginTestFile.ts +0 -36
  189. package/src/lib/generators/project/ProjectGenerator.ts +0 -205
  190. package/src/lib/generators/project/ProjectSourceFile.ts +0 -7
  191. package/src/lib/generators/project/configs/ProjectEslintrcConfig.ts +0 -47
  192. package/src/lib/generators/project/configs/ProjectPackageConfig.ts +0 -28
  193. package/src/lib/generators/project/configs/ProjectTypescriptConfig.ts +0 -35
  194. package/src/lib/manipulators/CreateComponentManipulator.ts +0 -66
  195. package/src/lib/manipulators/CreateDockerFileManipulator.ts +0 -121
  196. package/src/lib/manipulators/CreateModuleManipulator.ts +0 -137
  197. package/src/lib/manipulators/CreatePluginManipulator.ts +0 -71
  198. package/src/lib/manipulators/CreateProcessManipulator.ts +0 -56
  199. package/src/lib/manipulators/CreateThreadManipulator.ts +0 -56
  200. package/src/lib/manipulators/application/ApplicationIndexManipulator.ts +0 -169
  201. package/src/lib/menus/MainMenu.ts +0 -148
  202. package/src/lib/menus/initializeMenus/InitializeApplicationProject.ts +0 -84
  203. package/src/lib/menus/initializeMenus/InitializeComponentProject.ts +0 -84
  204. package/src/lib/menus/initializeMenus/InitializeModuleProject.ts +0 -84
  205. package/src/lib/menus/initializeMenus/InitializePluginProject.ts +0 -84
  206. package/src/lib/menus/manipulateMenus/ManipulateApplicationProject.ts +0 -60
  207. package/src/lib/menus/manipulateMenus/ManipulateComponentProject.ts +0 -13
  208. package/src/lib/menus/manipulateMenus/ManipulateModuleProject.ts +0 -49
  209. package/src/lib/menus/manipulateMenus/ManipulatePluginProject.ts +0 -13
  210. package/src/tests/generators/GenerateApplication.spec.ts +0 -16
  211. package/src/tests/generators/GenerateComponent.spec.ts +0 -16
  212. package/src/tests/generators/GenerateModule.spec.ts +0 -16
  213. package/src/tests/generators/GeneratePlugin.spec.ts +0 -16
  214. package/typings.d.ts +0 -4
@@ -1,153 +0,0 @@
1
- export const GitIgnore: string[] = [
2
- '.vscode/*',
3
- '!.vscode/settings.json',
4
- '!.vscode/tasks.json',
5
- '!.vscode/launch.json',
6
- '!.vscode/extensions.json',
7
- '*.code-workspace',
8
- '.history/',
9
- 'logs',
10
- '*.log',
11
- 'npm-debug.log*',
12
- 'yarn-debug.log*',
13
- 'yarn-error.log*',
14
- 'lerna-debug.log*',
15
- 'report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json',
16
- 'pids',
17
- '*.pid',
18
- '*.seed',
19
- '*.pid.lock',
20
- 'lib-cov',
21
- 'coverage',
22
- '*.lcov',
23
- '.nyc_output',
24
- '.grunt',
25
- 'bower_components',
26
- '.lock-wscript',
27
- 'build/Release',
28
- 'node_modules/',
29
- 'jspm_packages/',
30
- 'web_modules/',
31
- '*.tsbuildinfo',
32
- '.npm',
33
- '.eslintcache',
34
- '.rpt2_cache/',
35
- '.rts2_cache_cjs/',
36
- '.rts2_cache_es/',
37
- '.rts2_cache_umd/',
38
- '.node_repl_history',
39
- '*.tgz',
40
- '.yarn-integrity',
41
- '.env',
42
- '.env.test',
43
- '.cache',
44
- '.parcel-cache',
45
- '.next',
46
- 'out',
47
- '.nuxt',
48
- 'dist',
49
- '.cache/',
50
- '.vuepress/dist',
51
- '.serverless/',
52
- '.fusebox/',
53
- '.dynamodb/',
54
- '.tern-port',
55
- '.vscode-test',
56
- '.yarn/cache',
57
- '.yarn/unplugged',
58
- '.yarn/build-state.yml',
59
- '.yarn/install-state.gz',
60
- '.pnp.*',
61
- '.metadata',
62
- 'bin/',
63
- 'tmp/',
64
- '*.tmp',
65
- '*.bak',
66
- '*.swp',
67
- '*~.nib',
68
- 'local.properties',
69
- '.settings/',
70
- '.loadpath',
71
- '.recommenders',
72
- '.externalToolBuilders/',
73
- '*.launch',
74
- '*.pydevproject',
75
- '.cproject',
76
- '.autotools',
77
- '.factorypath',
78
- '.buildpath',
79
- '.target',
80
- '.tern-project',
81
- '.texlipse',
82
- '.springBeans',
83
- '.recommenders/',
84
- '.apt_generated/',
85
- '.apt_generated_test/',
86
- '.cache-main',
87
- '.scala_dependencies',
88
- '.worksheet',
89
- 'Thumbs.db',
90
- 'Thumbs.db:encryptable',
91
- 'ehthumbs.db',
92
- 'ehthumbs_vista.db',
93
- '*.stackdump',
94
- '[Dd]esktop.ini',
95
- '$RECYCLE.BIN/',
96
- '*.cab',
97
- '*.msi',
98
- '*.msix',
99
- '*.msm',
100
- '*.msp',
101
- '*.lnk',
102
- '*~',
103
- '.fuse_hidden*',
104
- '.directory',
105
- '.Trash-*',
106
- '.nfs*',
107
- '.idea/**/workspace.xml',
108
- '.idea/**/tasks.xml',
109
- '.idea/**/usage.statistics.xml',
110
- '.idea/**/dictionaries',
111
- '.idea/**/shelf',
112
- '.idea/**/contentModel.xml',
113
- '.idea/**/dataSources/',
114
- '.idea/**/dataSources.ids',
115
- '.idea/**/dataSources.local.xml',
116
- '.idea/**/sqlDataSources.xml',
117
- '.idea/**/dynamic.xml',
118
- '.idea/**/uiDesigner.xml',
119
- '.idea/**/dbnavigator.xml',
120
- '.idea/**/gradle.xml',
121
- '.idea/**/libraries',
122
- 'cmake-build-*/',
123
- '.idea/**/mongoSettings.xml',
124
- '*.iws',
125
- 'out/',
126
- '.idea_modules/',
127
- 'atlassian-ide-plugin.xml',
128
- '.idea/replstate.xml',
129
- 'com_crashlytics_export_strings.xml',
130
- 'crashlytics.properties',
131
- 'crashlytics-build.properties',
132
- 'fabric.properties',
133
- '.idea/httpRequests',
134
- '.idea/caches/build_file_checksums.ser',
135
- '.DS_Store',
136
- '.AppleDouble',
137
- '.LSOverride',
138
- 'Icon',
139
- '._*',
140
- '.DocumentRevisions-V100',
141
- '.fseventsd',
142
- '.Spotlight-V100',
143
- '.TemporaryItems',
144
- '.Trashes',
145
- '.VolumeIcon.icns',
146
- '.com.apple.timemachine.donotpresent',
147
- '.AppleDB',
148
- '.AppleDesktop',
149
- 'Network Trash Folder',
150
- 'Temporary Items',
151
- '.apdisk',
152
- '!.gitkeep'
153
- ]
@@ -1,64 +0,0 @@
1
- export const LicenseList = [
2
- {name: '无开源许可', value: 'UNLICENSED'},
3
- {name: 'ISC许可', value: 'ISC'},
4
- {name: 'MIT许可', value: 'MIT'},
5
- {name: 'Apache-2.0许可', value: 'Apache-2.0'},
6
- {name: 'BSD-3-Clause许可', value: 'BSD-3-Clause'},
7
- {name: 'MPL-1.1许可', value: 'MPL-1.1'},
8
- {name: 'AFL-1.1许可', value: 'AFL-1.1'},
9
- {name: 'AFL-1.2许可', value: 'AFL-1.2'},
10
- {name: 'AFL-2.0许可', value: 'AFL-2.0'},
11
- {name: 'AFL-2.1许可', value: 'AFL-2.1'},
12
- {name: 'AFL-3.0许可', value: 'AFL-3.0'},
13
- {name: 'AGPL-3.0-only许可', value: 'AGPL-3.0-only'},
14
- {name: 'AGPL-3.0-or-later许可', value: 'AGPL-3.0-or-later'},
15
- {name: 'Apache-1.0许可', value: 'Apache-1.0'},
16
- {name: 'Apache-1.1许可', value: 'Apache-1.1'},
17
- {name: 'APSL-2.0许可', value: 'APSL-2.0'},
18
- {name: 'Artistic-2.0许可', value: 'Artistic-2.0'},
19
- {name: 'BSL-1.0许可', value: 'BSL-1.0'},
20
- {name: 'CDDL-1.0许可', value: 'CDDL-1.0'},
21
- {name: 'CPAL-1.0许可', value: 'CPAL-1.0'},
22
- {name: 'CPL-1.0许可', value: 'CPL-1.0'},
23
- {name: 'ECL-2.0许可', value: 'ECL-2.0'},
24
- {name: 'EFL-2.0许可', value: 'EFL-2.0'},
25
- {name: 'EPL-1.0许可', value: 'EPL-1.0'},
26
- {name: 'EUDatagrid许可', value: 'EUDatagrid'},
27
- {name: 'EUPL-1.1许可', value: 'EUPL-1.1'},
28
- {name: 'GPL-2.0-only许可', value: 'GPL-2.0-only'},
29
- {name: 'GPL-2.0-or-later许可', value: 'GPL-2.0-or-later'},
30
- {name: 'GPL-3.0-only许可', value: 'GPL-3.0-only'},
31
- {name: 'GPL-3.0-or-later许可', value: 'GPL-3.0-or-later'},
32
- {name: 'HPND许可', value: 'HPND'},
33
- {name: 'Intel许可', value: 'Intel'},
34
- {name: 'IPA许可', value: 'IPA'},
35
- {name: 'IPL-1.0许可', value: 'IPL-1.0'},
36
- {name: 'LGPL-2.1-only许可', value: 'LGPL-2.1-only'},
37
- {name: 'LGPL-2.1-or-later许可', value: 'LGPL-2.1-or-later'},
38
- {name: 'LGPL-3.0-only许可', value: 'LGPL-3.0-only'},
39
- {name: 'LGPL-3.0-or-later许可', value: 'LGPL-3.0-or-later'},
40
- {name: 'LPL-1.02许可', value: 'LPL-1.02'},
41
- {name: 'LPPL-1.2许可', value: 'LPPL-1.2'},
42
- {name: 'MPL-1.1许可', value: 'MPL-1.1'},
43
- {name: '许MPL-2.0可', value: 'MPL-2.0'},
44
- {name: 'MS-PL许可', value: 'MS-PL'},
45
- {name: 'MS-RL许可', value: 'MS-RL'},
46
- {name: 'NCSA许可', value: 'NCSA'},
47
- {name: 'Nokia许可', value: 'Nokia'},
48
- {name: 'OFL-1.1许可', value: 'OFL-1.1'},
49
- {name: 'OSL-1.0许可', value: 'OSL-1.0'},
50
- {name: 'OSL-2.0许可', value: 'OSL-2.0'},
51
- {name: 'OSL-2.1许可', value: 'OSL-2.1'},
52
- {name: 'OSL-3.0许可', value: 'OSL-3.0'},
53
- {name: 'PHP-3.01许可', value: 'PHP-3.01'},
54
- {name: 'Python-2.0许可', value: 'Python-2.0'},
55
- {name: 'QPL-1.0许可', value: 'QPL-1.0'},
56
- {name: 'RPSL-1.0许可', value: 'RPSL-1.0'},
57
- {name: 'SISSL许可', value: 'SISSL'},
58
- {name: 'Sleepycat许可', value: 'Sleepycat'},
59
- {name: 'SPL-1.0许可', value: 'SPL-1.0'},
60
- {name: 'UPL-1.0许可', value: 'UPL-1.0'},
61
- {name: 'W3C许可', value: 'W3C'},
62
- {name: 'Zlib许可', value: 'Zlib'},
63
- {name: 'ZPL-2.0许可', value: 'ZPL-2.0'}
64
- ]
@@ -1,5 +0,0 @@
1
- import {IProjectInfo} from './IProjectInfo'
2
-
3
- export interface IApplicationInfo extends IProjectInfo {
4
- id: string
5
- }
@@ -1,5 +0,0 @@
1
- import {IProjectInfo} from './IProjectInfo'
2
-
3
- export interface IComponentInfo extends IProjectInfo {
4
- className: string
5
- }
@@ -1,3 +0,0 @@
1
- export interface IGenerator {
2
- generate(): Promise<void>
3
- }
@@ -1,5 +0,0 @@
1
- import {IProjectInfo} from './IProjectInfo'
2
-
3
- export interface IModuleInfo extends IProjectInfo {
4
- className: string
5
- }
@@ -1,5 +0,0 @@
1
- import {IProjectInfo} from './IProjectInfo'
2
-
3
- export interface IPluginInfo extends IProjectInfo {
4
- className: string
5
- }
@@ -1,11 +0,0 @@
1
- export interface IPreparePackageConfigOptions {
2
- name: string
3
- author: string
4
- description?: string
5
- keywords?: string | string[]
6
- license?: string
7
- scripts?: { [scriptName: string]: string }
8
- dependencies?: { [name: string]: string }
9
- devDependencies?: { [name: string]: string }
10
- addition?: { [key: string]: any }
11
- }
@@ -1,15 +0,0 @@
1
- import {IPreparePackageConfigOptions} from './IPreparePackageConfigOptions'
2
- import {ProjectSourceFile} from '../lib/generators/project/ProjectSourceFile'
3
-
4
- export interface IProjectGeneratorOptions {
5
- projectDirectory: string
6
- entry: string
7
- packageOptions: IPreparePackageConfigOptions
8
- files: ProjectSourceFile[]
9
- testFile: string
10
- directories?: string[]
11
- sourceDir?: string
12
- outputDir?: string
13
- importLakutataCoreInDev?: boolean
14
- ignores?: { [ignoreName: string]: string[] }
15
- }
@@ -1,10 +0,0 @@
1
- export interface IProjectInfo {
2
- path: string
3
- name: string
4
- author: string
5
- description?: string
6
- keywords?: string | string[]
7
- license?: string
8
- dependencies?: { [name: string]: string }
9
- devDependencies?: { [name: string]: string }
10
- }
@@ -1,6 +0,0 @@
1
- import packageJson from 'package-json'
2
-
3
- export async function LatestVersion(packageName, options?):Promise<string> {
4
- const {version} = await packageJson(packageName.toLowerCase(), options)
5
- return version as string
6
- }
@@ -1,97 +0,0 @@
1
- import {IGenerator} from '../../../interfaces/IGenerator'
2
- import {ProjectGenerator} from '../project/ProjectGenerator'
3
- import {AppFile} from './files/AppFile'
4
- import {ConfigFile} from './files/ConfigFile'
5
- import {IApplicationInfo} from '../../../interfaces/IApplicationInfo'
6
-
7
- export class ApplicationGenerator implements IGenerator {
8
- private readonly projectPath: string
9
- private readonly author: string
10
- private readonly name: string
11
- private readonly id: string
12
- private readonly description: string
13
- private readonly keywords: string | string[]
14
- private readonly outputDir: string = 'build'
15
- private readonly sourceDir: string = 'src'
16
- private readonly entryName: string = 'App'
17
- private readonly license: string
18
- private readonly dependencies: { [name: string]: string }
19
- private readonly devDependencies: { [name: string]: string }
20
-
21
- constructor(options: IApplicationInfo) {
22
- this.projectPath = options.path
23
- this.author = options.author
24
- this.name = options.name
25
- this.id = options.id
26
- this.description = options.description ? options.description : 'No application description'
27
- this.keywords = options.keywords ? options.keywords : []
28
- this.license = options.license ? options.license : 'UNLICENSED'
29
- this.dependencies = options.dependencies ? options.dependencies : {}
30
- this.devDependencies = options.devDependencies ? options.devDependencies : {}
31
- }
32
-
33
- /**
34
- * 生成应用项目
35
- */
36
- public async generate(): Promise<void> {
37
- const projectGenerator = new ProjectGenerator({
38
- entry: this.entryName,
39
- projectDirectory: this.projectPath,
40
- packageOptions: {
41
- name: this.name,
42
- author: this.author,
43
- description: this.description,
44
- keywords: this.keywords,
45
- scripts: {},
46
- license: this.license,
47
- dependencies: this.dependencies,
48
- devDependencies: this.dependencies,
49
- addition: {
50
- lakutata: {
51
- type: 'application',
52
- directories: {
53
- config: 'src/config',
54
- threads: 'src/threads',
55
- processes: 'src/processes',
56
- modules: 'src/modules',
57
- components: 'src/components',
58
- plugins: 'src/plugins',
59
- exceptions: 'src/exceptions'
60
- },
61
- configuration: 'src/config/Config.ts'
62
- }
63
- }
64
- },
65
- directories: [
66
- 'src/lib',
67
- 'src/exceptions',
68
- 'src/config',
69
- 'src/tests',
70
- 'src/threads',
71
- 'src/processes',
72
- 'src/modules',
73
- 'src/components',
74
- 'src/plugins'
75
- ],
76
- outputDir: this.outputDir,
77
- sourceDir: this.sourceDir,
78
- files: [
79
- new AppFile(false),
80
- new AppFile(true),
81
- new ConfigFile(this.id, this.name)
82
- ],
83
- testFile: 'src/tests/App.spec.ts',
84
- ignores: {
85
- '.gitignore': [
86
- `${this.outputDir}`,
87
- ` ${this.outputDir}/*`,
88
- `./${this.outputDir}`,
89
- `/${this.outputDir}/`,
90
- `!${this.sourceDir}`
91
-
92
- ]
93
- }
94
- })
95
- await projectGenerator.generate()
96
- }
97
- }
@@ -1,35 +0,0 @@
1
- import {ProjectSourceFile} from '../../project/ProjectSourceFile'
2
- import {SourceFile} from 'ts-morph'
3
-
4
- export class AppFile extends ProjectSourceFile {
5
- private readonly isTest: boolean
6
- readonly filePath: string
7
-
8
- constructor(isTest: boolean = false) {
9
- super()
10
- this.isTest = isTest
11
- this.filePath = isTest ? 'src/tests/App.spec.ts' : 'src/App.ts'
12
- }
13
-
14
- initSourceFile(file: SourceFile): SourceFile {
15
- file.addImportDeclaration({namedImports: ['createApp'], moduleSpecifier: '@lakutata/core'})
16
- if (this.isTest) {
17
- file.addImportDeclaration({namedImports: ['Config'], moduleSpecifier: '../config/Config'})
18
- } else {
19
- file.addImportDeclaration({namedImports: ['Config'], moduleSpecifier: './config/Config'})
20
- }
21
- file.addStatements(writer => {
22
- writer.writeLine(`createApp(Config(${this.isTest ? 'false' : 'true'})).then(app=>{`)
23
- if (this.isTest) {
24
- writer.writeLine('app.Logger.info(`[${app.getName()}] is running in development mode`)')
25
- } else {
26
- writer.writeLine('app.Logger.info(`[${app.getName()}] is running`)')
27
- }
28
- writer.writeLine('}).catch(e=>{')
29
- writer.writeLine('console.error(e)')
30
- writer.writeLine('process.exit(1)')
31
- writer.writeLine('})')
32
- })
33
- return file
34
- }
35
- }
@@ -1,82 +0,0 @@
1
- import {ProjectSourceFile} from '../../project/ProjectSourceFile'
2
- import {ModuleDeclarationKind, SourceFile, StructureKind} from 'ts-morph'
3
-
4
- export class ConfigFile extends ProjectSourceFile {
5
- private readonly name: string
6
- private readonly id: string
7
- readonly filePath: string
8
-
9
- constructor(id: string, name: string) {
10
- super()
11
- this.id = id
12
- this.name = name
13
- this.filePath = 'src/config/Config.ts'
14
- }
15
-
16
- initSourceFile(file: SourceFile): SourceFile {
17
- file.addImportDeclaration({
18
- namedImports: ['IApplicationConfig', 'Module', 'Component'],
19
- moduleSpecifier: '@lakutata/core'
20
- })
21
- file.addStatements([{
22
- kind: StructureKind.Module,
23
- declarationKind: ModuleDeclarationKind.Module,
24
- hasDeclareKeyword: true,
25
- name: `'@lakutata/core'`,
26
- statements: [{
27
- kind: StructureKind.Interface,
28
- name: 'Application',
29
- properties: [
30
- {
31
- name: 'Components()',
32
- kind: StructureKind.PropertySignature,
33
- leadingTrivia: 'get ',
34
- type: writer => {
35
- writer.block(() => {
36
- writer.writeLine('get:<T extends Component = Component>(name: string) => T')
37
- writer.writeLine('has:(name:string)=>boolean')
38
- })
39
- }
40
- },
41
- {
42
- name: 'Modules()',
43
- kind: StructureKind.PropertySignature,
44
- leadingTrivia: 'get ',
45
- type: writer => {
46
- writer.block(() => {
47
- writer.writeLine('get:<T extends Module = Module>(name: string) => T')
48
- writer.writeLine('has:(name:string)=>boolean')
49
- })
50
- }
51
- }
52
- ]
53
- }]
54
- }])
55
- file.addFunction({
56
- kind: StructureKind.Function,
57
- isExported: true,
58
- name: 'Config',
59
- returnType: 'IApplicationConfig',
60
- parameters: [{kind: StructureKind.Parameter, name: 'isProd', type: 'boolean'}],
61
- statements: writer => {
62
- writer.writeLine('return {')
63
- writer.writeLine(`id:'${this.id}',`)
64
- writer.writeLine(`name:'${this.name}',`)
65
- writer.writeLine('plugins:[],')
66
- writer.writeLine('components:{},')
67
- writer.writeLine('modules:{},')
68
- writer.writeLine('processes:[],')
69
- writer.writeLine('threads:[],')
70
- writer.writeLine('workflows:[],')
71
- writer.writeLine('onModulesLoaded: async (app) => {')
72
- writer.writeLine('//onModulesLoadedCallback')
73
- writer.writeLine('},')
74
- writer.writeLine('onComponentsLoaded: async (app) => {')
75
- writer.writeLine('//onComponentsLoadedCallback')
76
- writer.writeLine('}')
77
- writer.writeLine('}')
78
- }
79
- })
80
- return file
81
- }
82
- }
@@ -1,87 +0,0 @@
1
- import {IGenerator} from '../../../interfaces/IGenerator'
2
- import {ProjectGenerator} from '../project/ProjectGenerator'
3
- import {IComponentInfo} from '../../../interfaces/IComponentInfo'
4
- import {ComponentFile} from './files/ComponentFile'
5
- import {ComponentTestFile} from './files/ComponentTestFile'
6
-
7
- export class ComponentGenerator implements IGenerator {
8
- private readonly projectPath: string
9
- private readonly author: string
10
- private readonly name: string
11
- private readonly description: string
12
- private readonly keywords: string | string[]
13
- private readonly outputDir: string = 'distro'
14
- private readonly sourceDir: string = 'src'
15
- private readonly entryName: string
16
- private readonly license: string
17
- private readonly dependencies: { [name: string]: string }
18
- private readonly devDependencies: { [name: string]: string }
19
-
20
- constructor(options: IComponentInfo) {
21
- this.projectPath = options.path
22
- this.author = options.author
23
- this.name = options.name
24
- this.entryName = options.className
25
- this.description = options.description ? options.description : 'No component description'
26
- this.keywords = options.keywords ? options.keywords : []
27
- this.license = options.license ? options.license : 'UNLICENSED'
28
- this.dependencies = options.dependencies ? options.dependencies : {}
29
- this.devDependencies = options.devDependencies ? options.devDependencies : {}
30
- }
31
-
32
- /**
33
- * 生成组件项目
34
- */
35
- public async generate(): Promise<void> {
36
- const testFile = new ComponentTestFile(this.entryName)
37
- const projectGenerator = new ProjectGenerator({
38
- entry: this.entryName,
39
- projectDirectory: this.projectPath,
40
- packageOptions: {
41
- name: this.name,
42
- author: this.author,
43
- description: this.description,
44
- keywords: this.keywords,
45
- scripts: {},
46
- license: this.license,
47
- dependencies: this.dependencies,
48
- devDependencies: this.dependencies,
49
- addition: {
50
- lakutata: {
51
- type: 'component',
52
- directories: {
53
- exceptions: 'src/exceptions'
54
- }
55
- }
56
- }
57
- },
58
- directories: [
59
- 'src/lib',
60
- 'src/exceptions',
61
- 'src/tests'
62
- ],
63
- outputDir: this.outputDir,
64
- sourceDir: this.sourceDir,
65
- importLakutataCoreInDev: true,
66
- files: [
67
- new ComponentFile(this.entryName),
68
- testFile
69
- ],
70
- testFile: testFile.filePath,
71
- ignores: {
72
- '.gitignore': [
73
- `${this.outputDir}`,
74
- ` ${this.outputDir}/*`,
75
- `./${this.outputDir}`,
76
- `/${this.outputDir}/`,
77
- `!${this.sourceDir}`
78
- ],
79
- '.npmignore': [
80
- `!./${this.outputDir}`,
81
- `./${this.sourceDir}`
82
- ]
83
- }
84
- })
85
- await projectGenerator.generate()
86
- }
87
- }
@@ -1,45 +0,0 @@
1
- import {ProjectSourceFile} from '../../project/ProjectSourceFile'
2
- import {Scope, SourceFile, StructureKind} from 'ts-morph'
3
-
4
- export class ComponentFile extends ProjectSourceFile {
5
- readonly filePath: string
6
- private readonly className: string
7
-
8
- constructor(className: string) {
9
- super()
10
- this.className = className
11
- this.filePath = `src/${className}.ts`
12
- }
13
-
14
- initSourceFile(file: SourceFile): SourceFile {
15
- file.addImportDeclaration({namedImports: ['Component', 'Configurable'], moduleSpecifier: '@lakutata/core'})
16
- const componentClass = file.addClass({
17
- name: this.className,
18
- extends: 'Component',
19
- isExported: true
20
- })
21
- componentClass.addMember({
22
- kind: StructureKind.Property,
23
- scope: Scope.Protected,
24
- name: 'configureItem',
25
- type: 'string',
26
- docs: [{
27
- kind: StructureKind.JSDoc,
28
- description: 'Configurable item example, do not forget add decorator [Configurable()]'
29
- }],
30
- isReadonly: true,
31
- decorators: [{kind: StructureKind.Decorator, name: 'Configurable()'}]
32
- })
33
- const initMethod = componentClass.addMethod({
34
- name: 'initialize',
35
- isAsync: true,
36
- returnType: 'Promise<void>',
37
- scope: Scope.Protected
38
- })
39
- initMethod.addStatements(writer => {
40
- writer.writeLine(`//Initializer for ${this.className}`)
41
- writer.writeLine(`//Write your codes here`)
42
- })
43
- return file
44
- }
45
- }