@corva/create-app 0.11.0-0 → 0.12.0-2
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 +22 -0
- package/README.md +57 -0
- package/constants/manifest.js +91 -49
- package/constants/package.js +23 -24
- package/helpers/manifest.js +25 -12
- package/helpers/utils.js +2 -2
- package/helpers/versioning.js +14 -14
- package/index.js +158 -164
- package/package.json +62 -58
- package/scripts/ui/index.js +2 -2
- package/scripts/ui/zipAppSource.js +31 -41
- package/scripts/utils/version.js +9 -22
- package/template/scheduler/node/__test__/processor.test.js +12 -12
- package/template/scheduler/node/gitignore +21 -0
- package/template/scheduler/node/index.js +5 -6
- package/template/scheduler/node/package.json +3 -3
- package/template/scheduler/node/src/processor.js +9 -13
- package/template/scheduler/node-ts/README.md +25 -0
- package/template/scheduler/node-ts/__test__/processor.spec.ts +20 -0
- package/template/scheduler/node-ts/gitignore +25 -0
- package/template/scheduler/node-ts/index.ts +8 -0
- package/template/scheduler/node-ts/lib/processor.ts +13 -0
- package/template/scheduler/node-ts/package.json +37 -0
- package/template/scheduler/node-ts/tsconfig.build.json +11 -0
- package/template/scheduler/node-ts/tsconfig.json +33 -0
- package/template/stream/node/README.md +1 -1
- package/template/stream/node/__test__/processor.test.js +37 -40
- package/template/stream/node/gitignore +21 -0
- package/template/stream/node/index.js +5 -6
- package/template/stream/node/package.json +3 -3
- package/template/stream/node/src/processor.js +11 -14
- package/template/stream/node-ts/README.md +25 -0
- package/template/stream/node-ts/__test__/processor.spec.ts +43 -0
- package/template/stream/node-ts/gitignore +25 -0
- package/template/stream/node-ts/index.ts +8 -0
- package/template/stream/node-ts/lib/processor.ts +16 -0
- package/template/stream/node-ts/package.json +37 -0
- package/template/stream/node-ts/tsconfig.build.json +11 -0
- package/template/stream/node-ts/tsconfig.json +33 -0
- package/template/task/node/README.md +1 -1
- package/template/task/node/__test__/processor.test.js +18 -0
- package/template/task/node/gitignore +21 -0
- package/template/task/node/index.js +7 -8
- package/template/task/node/package.json +3 -3
- package/template/task/node/src/processor.js +9 -14
- package/template/task/node-ts/README.md +25 -0
- package/template/task/node-ts/__test__/processor.spec.ts +27 -0
- package/template/task/node-ts/gitignore +25 -0
- package/template/task/node-ts/index.ts +8 -0
- package/template/task/node-ts/package.json +37 -0
- package/template/task/node-ts/src/processor.ts +13 -0
- package/template/task/node-ts/tsconfig.build.json +11 -0
- package/template/task/node-ts/tsconfig.json +33 -0
- package/template/ui/README.md +1 -1
- package/template/ui/gitignore +1 -0
- package/template/ui/src/App.js +2 -1
- package/template/ui/src/AppSettings.js +1 -1
- package/template/ui/src/constants.js +1 -1
- package/template/ui/src/index.js +2 -2
- package/helpers/metadata.js +0 -29
package/index.js
CHANGED
|
@@ -1,29 +1,37 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const chalk = require(
|
|
6
|
-
const figlet = require(
|
|
7
|
-
const commander = require(
|
|
8
|
-
const fs = require(
|
|
9
|
-
const inquirer = require(
|
|
10
|
-
const os = require(
|
|
11
|
-
const path = require(
|
|
12
|
-
const semver = require(
|
|
13
|
-
|
|
14
|
-
const uiScripts = require(
|
|
15
|
-
const { ensureLatestVersion } = require(
|
|
16
|
-
const utils = require(
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
const chalk = require('chalk');
|
|
6
|
+
const figlet = require('figlet');
|
|
7
|
+
const commander = require('commander');
|
|
8
|
+
const fs = require('fs-extra');
|
|
9
|
+
const inquirer = require('inquirer');
|
|
10
|
+
const os = require('os');
|
|
11
|
+
const path = require('path');
|
|
12
|
+
const semver = require('semver');
|
|
13
|
+
|
|
14
|
+
const uiScripts = require('./scripts/ui');
|
|
15
|
+
const { ensureLatestVersion } = require('./scripts/utils/version');
|
|
16
|
+
const utils = require('./helpers/utils.js');
|
|
17
|
+
const manifestHelpers = require('./helpers/manifest.js');
|
|
18
|
+
const versioning = require('./helpers/versioning.js');
|
|
19
|
+
|
|
20
|
+
const packageConstants = require('./constants/package.js');
|
|
21
|
+
const manifestConstants = require('./constants/manifest.js');
|
|
22
|
+
|
|
23
|
+
const packageJson = require('./package.json');
|
|
24
|
+
const { clear } = require('console');
|
|
25
|
+
const spawn = require('cross-spawn');
|
|
26
|
+
|
|
27
|
+
const YARN_EXECUTABLE = 'yarn';
|
|
28
|
+
|
|
29
|
+
let packageManager = YARN_EXECUTABLE;
|
|
30
|
+
let useTypescript = false;
|
|
31
|
+
|
|
32
|
+
const shouldUseYarn = () => packageManager === YARN_EXECUTABLE;
|
|
33
|
+
const getLockFileName = (manager) =>
|
|
34
|
+
manager === YARN_EXECUTABLE ? 'yarn.lock' : 'package-lock.json';
|
|
27
35
|
|
|
28
36
|
clear();
|
|
29
37
|
|
|
@@ -31,20 +39,18 @@ let projectName;
|
|
|
31
39
|
let program;
|
|
32
40
|
|
|
33
41
|
const APP_TYPES = {
|
|
34
|
-
UI:
|
|
35
|
-
NODE:
|
|
42
|
+
UI: 'ui',
|
|
43
|
+
NODE: 'node',
|
|
36
44
|
};
|
|
37
45
|
|
|
38
46
|
function startingMessage() {
|
|
39
|
-
console.log(chalk.green(
|
|
40
|
-
console.log(
|
|
41
|
-
chalk.cyan(figlet.textSync("CORVA.AI", { horizontalLayout: "full" }))
|
|
42
|
-
);
|
|
47
|
+
console.log(chalk.green(' Welcome to apps generator for:'));
|
|
48
|
+
console.log(chalk.cyan(figlet.textSync('CORVA.AI', { horizontalLayout: 'full' })));
|
|
43
49
|
}
|
|
44
50
|
|
|
45
51
|
function checkNodeVersion() {
|
|
46
|
-
console.log(
|
|
47
|
-
const unsupportedNodeVersion = !semver.satisfies(process.version,
|
|
52
|
+
console.log('Checking node version...');
|
|
53
|
+
const unsupportedNodeVersion = !semver.satisfies(process.version, '>=10');
|
|
48
54
|
if (unsupportedNodeVersion) {
|
|
49
55
|
console.log(
|
|
50
56
|
chalk.red(
|
|
@@ -57,35 +63,43 @@ function checkNodeVersion() {
|
|
|
57
63
|
}
|
|
58
64
|
}
|
|
59
65
|
|
|
60
|
-
function
|
|
66
|
+
function checkOptions(opts) {
|
|
61
67
|
let isValid = true;
|
|
62
68
|
const values = {};
|
|
63
69
|
|
|
64
|
-
manifestConstants.MANIFEST_MANDATORY_KEYS.forEach(key => {
|
|
65
|
-
if (!
|
|
70
|
+
manifestConstants.MANIFEST_MANDATORY_KEYS.forEach((key) => {
|
|
71
|
+
if (!opts[key]) {
|
|
66
72
|
isValid = false;
|
|
67
73
|
}
|
|
68
|
-
|
|
74
|
+
|
|
75
|
+
values[key] = opts[key];
|
|
69
76
|
});
|
|
70
77
|
|
|
71
78
|
return {
|
|
72
79
|
isValid,
|
|
73
|
-
values
|
|
80
|
+
values,
|
|
74
81
|
};
|
|
75
82
|
}
|
|
76
83
|
|
|
77
84
|
async function initialChecks() {
|
|
78
|
-
|
|
85
|
+
startingMessage();
|
|
86
|
+
|
|
87
|
+
program = new commander.Command('corva-create-app')
|
|
79
88
|
.version(packageJson.version)
|
|
80
|
-
.
|
|
81
|
-
.usage(`${chalk.green(
|
|
82
|
-
.action(name => {
|
|
89
|
+
.argument('[project-directory]', 'project directory to work with')
|
|
90
|
+
.usage(`${chalk.green('<project-directory>')} [options]`)
|
|
91
|
+
.action((name) => {
|
|
83
92
|
projectName = name;
|
|
84
93
|
})
|
|
85
|
-
.
|
|
86
|
-
.option(
|
|
94
|
+
.option('-z, --zip <type>', 'zip app source')
|
|
95
|
+
.option('-t, --useTypescript', 'use typescript or javascript', false)
|
|
96
|
+
.addOption(
|
|
97
|
+
new commander.Option(`-p, --packageManager <value>`, 'package manager to use')
|
|
98
|
+
.default(YARN_EXECUTABLE)
|
|
99
|
+
.choices(['npm', YARN_EXECUTABLE])
|
|
100
|
+
);
|
|
87
101
|
|
|
88
|
-
manifestConstants.MANIFEST_MANDATORY_KEYS.forEach(key => {
|
|
102
|
+
manifestConstants.MANIFEST_MANDATORY_KEYS.forEach((key) => {
|
|
89
103
|
program.option(`--${key} [value]`);
|
|
90
104
|
});
|
|
91
105
|
|
|
@@ -93,31 +107,32 @@ async function initialChecks() {
|
|
|
93
107
|
|
|
94
108
|
checkNodeVersion();
|
|
95
109
|
|
|
96
|
-
|
|
97
|
-
|
|
110
|
+
const opts = program.opts();
|
|
111
|
+
|
|
112
|
+
packageManager = opts.packageManager || packageManager;
|
|
113
|
+
useTypescript = opts.useTypescript || useTypescript;
|
|
114
|
+
|
|
115
|
+
if (opts.zip) {
|
|
116
|
+
if (opts.zip === APP_TYPES.UI) {
|
|
117
|
+
return uiScripts.zipAppSource(shouldUseYarn());
|
|
118
|
+
}
|
|
98
119
|
|
|
99
120
|
process.exit(0);
|
|
100
121
|
}
|
|
101
122
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
if (typeof projectName === "undefined") {
|
|
106
|
-
console.error("Please specify the project directory:");
|
|
107
|
-
console.log(
|
|
108
|
-
` ${chalk.cyan(program.name())} ${chalk.green("<project-directory>")}`
|
|
109
|
-
);
|
|
123
|
+
if (!projectName) {
|
|
124
|
+
console.error('Please specify the project directory:');
|
|
125
|
+
console.log(` ${chalk.cyan(program.name())} ${chalk.green('<project-directory>')}`);
|
|
110
126
|
console.log();
|
|
111
|
-
console.log(
|
|
112
|
-
console.log(
|
|
113
|
-
` ${chalk.cyan(program.name())} ${chalk.green("my-react-app")}`
|
|
114
|
-
);
|
|
127
|
+
console.log('For example:');
|
|
128
|
+
console.log(` ${chalk.cyan(program.name())} ${chalk.green('my-react-app')}`);
|
|
115
129
|
console.log();
|
|
116
|
-
console.log(
|
|
117
|
-
`Run ${chalk.cyan(`${program.name()} --help`)} to see all options.`
|
|
118
|
-
);
|
|
130
|
+
console.log(`Run ${chalk.cyan(`${program.name()} --help`)} to see all options.`);
|
|
119
131
|
process.exit(1);
|
|
120
132
|
}
|
|
133
|
+
|
|
134
|
+
// NOTE: Default action
|
|
135
|
+
await createApp(opts);
|
|
121
136
|
}
|
|
122
137
|
|
|
123
138
|
async function initPackage(manifest) {
|
|
@@ -130,10 +145,7 @@ async function initPackage(manifest) {
|
|
|
130
145
|
|
|
131
146
|
fs.mkdirSync(root);
|
|
132
147
|
|
|
133
|
-
fs.writeFileSync(
|
|
134
|
-
path.join(root, "manifest.json"),
|
|
135
|
-
JSON.stringify(manifest, null, 2) + os.EOL
|
|
136
|
-
);
|
|
148
|
+
fs.writeFileSync(path.join(root, 'manifest.json'), JSON.stringify(manifest, null, 2) + os.EOL);
|
|
137
149
|
|
|
138
150
|
let runtime = manifest.settings.runtime;
|
|
139
151
|
|
|
@@ -141,10 +153,14 @@ async function initPackage(manifest) {
|
|
|
141
153
|
// config for every possible version at this point, so just consolidate all versions of a runtime into a single
|
|
142
154
|
// template directory.
|
|
143
155
|
if (appType !== APP_TYPES.UI) {
|
|
144
|
-
if (runtime.startsWith(
|
|
145
|
-
runtime =
|
|
146
|
-
} else if (runtime.startsWith(
|
|
147
|
-
runtime =
|
|
156
|
+
if (runtime.startsWith('python')) {
|
|
157
|
+
runtime = 'python';
|
|
158
|
+
} else if (runtime.startsWith('nodejs')) {
|
|
159
|
+
runtime = 'node';
|
|
160
|
+
|
|
161
|
+
if (useTypescript) {
|
|
162
|
+
runtime += '-ts';
|
|
163
|
+
}
|
|
148
164
|
}
|
|
149
165
|
}
|
|
150
166
|
|
|
@@ -153,181 +169,159 @@ async function initPackage(manifest) {
|
|
|
153
169
|
installApp(root, appType, runtime);
|
|
154
170
|
}
|
|
155
171
|
|
|
156
|
-
function fillAppMETA() {
|
|
157
|
-
console.log("Please fill your app Metadata");
|
|
158
|
-
|
|
159
|
-
const prompts = Object.keys(manifestConstants.manifestOptions).map(key => ({
|
|
160
|
-
type: metadata.getType(manifestConstants.manifestOptions[key]),
|
|
161
|
-
name: key,
|
|
162
|
-
message: `${
|
|
163
|
-
typeof manifestConstants.manifestOptions[key] === "string"
|
|
164
|
-
? "Enter"
|
|
165
|
-
: "Choose"
|
|
166
|
-
} ${key}`,
|
|
167
|
-
default: manifestConstants.manifestOptions[key],
|
|
168
|
-
choices: metadata.getChoices(manifestConstants.manifestOptions[key])
|
|
169
|
-
}));
|
|
170
|
-
|
|
171
|
-
inquirer.prompt(prompts).then(answers => {
|
|
172
|
-
const manifest = manifestHelpers.fillManifest(answers);
|
|
173
|
-
initPackage(manifest);
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
172
|
|
|
177
|
-
async function createApp() {
|
|
178
|
-
const { isValid, values } =
|
|
179
|
-
|
|
180
|
-
startingMessage();
|
|
173
|
+
async function createApp(opts) {
|
|
174
|
+
const { isValid, values } = checkOptions(opts);
|
|
181
175
|
|
|
182
176
|
if (isValid) {
|
|
183
|
-
Object.keys(values).forEach(key => {
|
|
177
|
+
Object.keys(values).forEach((key) => {
|
|
184
178
|
console.log(`${key} : ${values[key]}`);
|
|
185
179
|
});
|
|
180
|
+
|
|
186
181
|
const manifest = manifestHelpers.fillManifest(values);
|
|
182
|
+
|
|
187
183
|
await initPackage(manifest);
|
|
188
184
|
} else {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
fillAppMETA();
|
|
200
|
-
});
|
|
185
|
+
console.log('Please fill your app Metadata');
|
|
186
|
+
|
|
187
|
+
inquirer.prompt(manifestConstants.manifestOptions(projectName)).then((answers) => {
|
|
188
|
+
packageManager = answers.packageManager || packageManager;
|
|
189
|
+
useTypescript = answers.useTypescript || useTypescript;
|
|
190
|
+
|
|
191
|
+
const manifest = manifestHelpers.fillManifest(answers);
|
|
192
|
+
|
|
193
|
+
initPackage(manifest);
|
|
194
|
+
});
|
|
201
195
|
}
|
|
202
196
|
|
|
203
197
|
console.log();
|
|
204
198
|
}
|
|
205
199
|
|
|
206
200
|
function addTemplate(root, appType, runtime) {
|
|
207
|
-
console.log(chalk.green(
|
|
201
|
+
console.log(chalk.green('Copying app template...'));
|
|
208
202
|
console.log();
|
|
209
203
|
|
|
210
|
-
let templateFolder = path.resolve(__dirname,
|
|
204
|
+
let templateFolder = path.resolve(__dirname, 'template', appType);
|
|
211
205
|
let nameExclusion = appType;
|
|
206
|
+
|
|
212
207
|
if (appType !== APP_TYPES.UI) {
|
|
213
|
-
templateFolder = path.resolve(__dirname,
|
|
208
|
+
templateFolder = path.resolve(__dirname, 'template', appType, runtime);
|
|
209
|
+
|
|
214
210
|
nameExclusion = runtime;
|
|
215
211
|
}
|
|
216
|
-
|
|
212
|
+
|
|
217
213
|
utils.copyFolderRecursiveSync(templateFolder, root, nameExclusion);
|
|
218
214
|
|
|
219
|
-
|
|
215
|
+
const gitignore = path.join(root, 'gitignore');
|
|
216
|
+
|
|
217
|
+
if (fs.pathExistsSync(gitignore)) {
|
|
220
218
|
// We can't have .gitignore file in our templates.
|
|
221
219
|
// It's missing when @corva/create-app is installed.
|
|
222
220
|
// That's why we manually rename gitignore to .gitignore after copying template
|
|
223
221
|
|
|
224
|
-
fs.renameSync(
|
|
222
|
+
fs.renameSync(gitignore, path.join(root, '.gitignore'));
|
|
225
223
|
}
|
|
226
224
|
|
|
227
|
-
console.log(chalk.green(
|
|
225
|
+
console.log(chalk.green('Done: copying app template!'));
|
|
228
226
|
}
|
|
229
227
|
|
|
230
228
|
function configureApp(root, appType, runtime, manifest) {
|
|
231
229
|
if (appType === APP_TYPES.UI) {
|
|
232
230
|
addPackageJSON(root, manifest.application.name);
|
|
233
|
-
} else if (runtime
|
|
234
|
-
updatePackageJSON(root, manifest.application.
|
|
231
|
+
} else if (runtime.startsWith(APP_TYPES.NODE)) {
|
|
232
|
+
updatePackageJSON(root, manifest.application.description, appType, runtime);
|
|
235
233
|
}
|
|
236
234
|
}
|
|
237
235
|
|
|
238
236
|
function addPackageJSON(root, appName) {
|
|
239
237
|
const packageJson = {
|
|
240
|
-
name: appName.replace(/\W/g,
|
|
241
|
-
version:
|
|
242
|
-
main:
|
|
238
|
+
name: appName.replace(/\W/g, ''),
|
|
239
|
+
version: '0.0.1',
|
|
240
|
+
main: 'src/index.js',
|
|
243
241
|
scripts: packageConstants.scripts,
|
|
244
|
-
...packageConstants.dependencies
|
|
242
|
+
...packageConstants.dependencies,
|
|
245
243
|
};
|
|
246
244
|
|
|
247
|
-
fs.writeFileSync(
|
|
248
|
-
path.join(root, "package.json"),
|
|
249
|
-
JSON.stringify(packageJson, null, 2) + os.EOL
|
|
250
|
-
);
|
|
245
|
+
fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify(packageJson, null, 2) + os.EOL);
|
|
251
246
|
}
|
|
252
247
|
|
|
253
|
-
function updatePackageJSON(root,
|
|
254
|
-
const templateFolder = path.resolve(__dirname,
|
|
248
|
+
function updatePackageJSON(root, description, appType, runtime) {
|
|
249
|
+
const templateFolder = path.resolve(__dirname, 'template', appType, runtime);
|
|
255
250
|
|
|
256
|
-
let packageJson = JSON.parse(
|
|
257
|
-
fs.readFileSync(path.join(templateFolder, "package.json"), "utf-8")
|
|
258
|
-
);
|
|
251
|
+
let packageJson = JSON.parse(fs.readFileSync(path.join(templateFolder, 'package.json'), 'utf-8'));
|
|
259
252
|
|
|
260
|
-
packageJson.name =
|
|
253
|
+
packageJson.name = projectName.replace(/\W/g, '-').toLowerCase();
|
|
254
|
+
packageJson.description = description;
|
|
261
255
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
256
|
+
packageJson.scripts.bundle = packageJson.scripts.bundle.replace(
|
|
257
|
+
'$LOCKFILE',
|
|
258
|
+
getLockFileName(packageManager)
|
|
265
259
|
);
|
|
260
|
+
|
|
261
|
+
fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify(packageJson, null, 2) + os.EOL);
|
|
266
262
|
}
|
|
267
263
|
|
|
268
264
|
function installApp(appPath, appType, runtime) {
|
|
269
|
-
switch (
|
|
270
|
-
case
|
|
271
|
-
installUIApp(appPath);
|
|
265
|
+
switch (runtime) {
|
|
266
|
+
case 'python': {
|
|
272
267
|
break;
|
|
268
|
+
}
|
|
269
|
+
default: {
|
|
270
|
+
installJsApp(appPath, appType);
|
|
271
|
+
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
273
274
|
}
|
|
274
275
|
}
|
|
275
276
|
|
|
276
|
-
function
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
const useYarn = true;
|
|
277
|
+
function installJsApp(appPath, appType) {
|
|
278
|
+
const command = packageManager;
|
|
279
|
+
const args = ['install'];
|
|
280
280
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
command = "yarn";
|
|
284
|
-
args = ["install"];
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
console.log(chalk.yellow("Installing template dependencies using yarn..."));
|
|
288
|
-
const proc = spawn.sync(command, args, { stdio: "inherit", cwd: appPath });
|
|
281
|
+
console.log(chalk.yellow(`Installing template dependencies using ${command}...`));
|
|
282
|
+
const proc = spawn.sync(command, args, { stdio: 'inherit', cwd: appPath });
|
|
289
283
|
|
|
290
284
|
if (proc.status !== 0) {
|
|
291
|
-
console.error(`\`${command} ${args.join(
|
|
285
|
+
console.error(`\`${command} ${args.join(' ')}\` failed`);
|
|
292
286
|
return;
|
|
293
287
|
}
|
|
294
288
|
|
|
295
|
-
console.log(chalk.green(
|
|
289
|
+
console.log(chalk.green('Successfull project install'));
|
|
296
290
|
|
|
297
291
|
let initializedGit = false;
|
|
298
292
|
if (versioning.tryGitInit(appPath)) {
|
|
299
293
|
initializedGit = true;
|
|
300
294
|
console.log();
|
|
301
|
-
console.log(
|
|
295
|
+
console.log('Initialized a git repository.');
|
|
302
296
|
}
|
|
303
297
|
|
|
304
298
|
if (initializedGit && versioning.tryGitCommit(appPath)) {
|
|
305
299
|
console.log();
|
|
306
|
-
console.log(
|
|
300
|
+
console.log('Created git commit.');
|
|
307
301
|
}
|
|
308
302
|
|
|
309
303
|
console.log();
|
|
310
304
|
console.log(`Success! Created ${projectName} at ${appPath}`);
|
|
311
|
-
console.log("Inside that directory, you can run several commands:");
|
|
312
|
-
helpCommands();
|
|
313
|
-
}
|
|
314
305
|
|
|
315
|
-
|
|
316
|
-
|
|
306
|
+
if (appType === APP_TYPES.UI) {
|
|
307
|
+
console.log('Inside that directory, you can run several commands:');
|
|
308
|
+
helpCommands();
|
|
309
|
+
}
|
|
310
|
+
}
|
|
317
311
|
|
|
318
|
-
|
|
312
|
+
async function helpCommands() {
|
|
313
|
+
const displayedCommand = packageManager;
|
|
314
|
+
const useYarn = shouldUseYarn();
|
|
319
315
|
|
|
320
316
|
console.log();
|
|
321
317
|
console.log(chalk.cyan(` ${displayedCommand} start`));
|
|
322
|
-
console.log(
|
|
318
|
+
console.log(' Starts the development server.');
|
|
323
319
|
console.log();
|
|
324
|
-
console.log(
|
|
325
|
-
|
|
326
|
-
);
|
|
327
|
-
console.log(" Bundles the app into static files for production.");
|
|
320
|
+
console.log(chalk.cyan(` ${displayedCommand} ${useYarn ? '' : 'run '}build`));
|
|
321
|
+
console.log(' Bundles the app into static files for production.');
|
|
328
322
|
console.log();
|
|
329
|
-
console.log(chalk.cyan(` ${displayedCommand} ${useYarn ?
|
|
330
|
-
console.log(
|
|
323
|
+
console.log(chalk.cyan(` ${displayedCommand} ${useYarn ? '' : 'run '}zip`));
|
|
324
|
+
console.log(' Bundles the app into ZIP file in app root directory');
|
|
331
325
|
console.log();
|
|
332
326
|
}
|
|
333
327
|
|
package/package.json
CHANGED
|
@@ -1,61 +1,65 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
2
|
+
"name": "@corva/create-app",
|
|
3
|
+
"version": "0.12.0-2",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Create app to use it in CORVA.AI",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"react"
|
|
8
|
+
],
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/facebook/create-react-app/issues"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/corva-ai/create-corva-app",
|
|
15
|
+
"directory": "@corva/create-app"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"bin": {
|
|
19
|
+
"create-corva-app": "./index.js"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"index.js",
|
|
23
|
+
"constants",
|
|
24
|
+
"helpers",
|
|
25
|
+
"template",
|
|
26
|
+
"scripts"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"lint": "prettier . --write",
|
|
30
|
+
"build": "echo \"build is not configured for package \\\"×\\\", skipping.\"",
|
|
31
|
+
"get-changelog": "conventional-changelog -r 2 -p angular",
|
|
32
|
+
"release": "git add -A && standard-version -a"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"archiver": "^5.0.0",
|
|
36
|
+
"chalk": "4.1.0",
|
|
37
|
+
"commander": "^8.2.0",
|
|
38
|
+
"conventional-changelog-cli": "^2.1.0",
|
|
39
|
+
"cross-spawn": "7.0.3",
|
|
40
|
+
"envinfo": "7.5.1",
|
|
41
|
+
"figlet": "^1.5.0",
|
|
42
|
+
"fs-extra": "9.0.1",
|
|
43
|
+
"hyperquest": "2.1.3",
|
|
44
|
+
"inquirer": "7.3.2",
|
|
45
|
+
"npm-api": "^1.0.0",
|
|
46
|
+
"semver": "7.3.2",
|
|
47
|
+
"tar-pack": "3.4.1",
|
|
48
|
+
"tmp": "0.2.1",
|
|
49
|
+
"validate-npm-package-name": "3.0.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@corva/eslint-config-browser": "^0.0.4",
|
|
53
|
+
"@corva/eslint-config-node": "^4.2.0",
|
|
54
|
+
"prettier": "^2.4.1",
|
|
55
|
+
"standard-version": "^9.0.0"
|
|
56
|
+
},
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=10"
|
|
59
|
+
},
|
|
60
|
+
"standard-version": {
|
|
61
|
+
"skip": {
|
|
62
|
+
"tag": true
|
|
63
|
+
}
|
|
39
64
|
}
|
|
40
|
-
},
|
|
41
|
-
"dependencies": {
|
|
42
|
-
"archiver": "^5.0.0",
|
|
43
|
-
"chalk": "4.1.0",
|
|
44
|
-
"commander": "4.1.0",
|
|
45
|
-
"conventional-changelog-cli": "^2.1.0",
|
|
46
|
-
"cross-spawn": "7.0.3",
|
|
47
|
-
"envinfo": "7.5.1",
|
|
48
|
-
"figlet": "^1.5.0",
|
|
49
|
-
"fs-extra": "9.0.1",
|
|
50
|
-
"hyperquest": "2.1.3",
|
|
51
|
-
"inquirer": "7.3.2",
|
|
52
|
-
"npm-api": "^1.0.0",
|
|
53
|
-
"semver": "7.3.2",
|
|
54
|
-
"tar-pack": "3.4.1",
|
|
55
|
-
"tmp": "0.2.1",
|
|
56
|
-
"validate-npm-package-name": "3.0.0"
|
|
57
|
-
},
|
|
58
|
-
"devDependencies": {
|
|
59
|
-
"standard-version": "^9.0.0"
|
|
60
|
-
}
|
|
61
65
|
}
|
package/scripts/ui/index.js
CHANGED