@corva/create-app 0.30.0-rc.0 → 0.31.0-rc.0

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.
@@ -96,6 +96,7 @@ const resolveDataToZipUiApp = async (itemsToZip = [], { options, pkg, dirName })
96
96
  'config-overrides.js',
97
97
  'tsconfig.json',
98
98
  '.npmrc',
99
+ '.nvmrc',
99
100
  'yarn.lock',
100
101
  { path: resolve(dirName, 'packageForSource.json'), name: 'package.json' },
101
102
  'src'
package/lib/index.js CHANGED
@@ -37,7 +37,7 @@ const { resolveAppRuntime } = require('./helpers/resolve-app-runtime');
37
37
 
38
38
  const writejsonOptions = {
39
39
  spaces: 2,
40
- EOL: os.EOL
40
+ EOL: os.EOL,
41
41
  };
42
42
 
43
43
  function startingMessage() {
@@ -49,12 +49,12 @@ function startingMessage() {
49
49
  function checkNodeVersion() {
50
50
  process.stdout.write('Checking node version...');
51
51
 
52
- const unsupportedNodeVersion = !semver.satisfies(process.version, '>=10');
52
+ const unsupportedNodeVersion = !semver.satisfies(process.version, '>=16');
53
53
  if (unsupportedNodeVersion) {
54
54
  console.log(
55
55
  chalk.red(
56
56
  `\nYou are using Node ${process.version}.\n\n` +
57
- `Please update to Node 10 or higher for a better, fully supported experience.\n`
57
+ `Please update to Node 16 or higher for a better, fully supported experience.\n`
58
58
  )
59
59
  );
60
60
  // Fall back to latest supported react-scripts on Node 4
@@ -84,7 +84,7 @@ function checkOptions(opts) {
84
84
  const printDeprecationNotice = (param) =>
85
85
  console.warn(
86
86
  chalk.bgYellowBright`DEPRECATED OPTION: ${param}` +
87
- ` Use ${chalk.cyan(`create-corva-app ${param} .`)} instead`
87
+ ` Use ${chalk.cyan(`create-corva-app ${param} .`)} instead`
88
88
  );
89
89
 
90
90
  async function initialChecks() {
@@ -106,7 +106,8 @@ async function initialChecks() {
106
106
  manifestConstants.manifestOptions().forEach((value) => {
107
107
  const type = typeof value.default;
108
108
  const option = new Option(
109
- `${value.alias ? `-${value.alias}, ` : ''}--${value.name} [${(type !== 'undefined' && type) || 'string'
109
+ `${value.alias ? `-${value.alias}, ` : ''}--${value.name} [${
110
+ (type !== 'undefined' && type) || 'string'
110
111
  }]`,
111
112
  value.message
112
113
  );
@@ -299,22 +300,28 @@ async function createApp(dirName, opts) {
299
300
 
300
301
  console.log('Please fill your app Metadata');
301
302
 
302
- const answers = inquirer.prompt(manifestConstants.manifestOptions(dirName), opts)
303
+ const answers = inquirer.prompt(manifestConstants.manifestOptions(dirName), opts);
303
304
 
304
305
  return initPackage(dirName, answers);
305
306
  }
306
307
 
307
308
  /**
308
- *
309
- * @param {string} root
310
- * @param {import('./flows/lib/manifest').Manifest} manifest
311
- * @param {*} runtime
309
+ *
310
+ * @param {string} root
311
+ * @param {import('./flows/lib/manifest').Manifest} manifest
312
+ * @param {*} runtime
312
313
  */
313
314
  async function addTemplate(root, manifest, runtime) {
314
315
  console.log(chalk.green('Copying app template...'));
315
316
  console.log();
316
317
 
317
- const templateFolder = path.resolve(__dirname, '..', 'templates', runtime.language, manifest.type);
318
+ const templateFolder = path.resolve(
319
+ __dirname,
320
+ '..',
321
+ 'templates',
322
+ runtime.language,
323
+ manifest.type
324
+ );
318
325
 
319
326
  utils.copyFolderRecursiveSync(templateFolder, root);
320
327
 
@@ -335,10 +342,10 @@ async function addTemplate(root, manifest, runtime) {
335
342
  }
336
343
 
337
344
  /**
338
- *
339
- * @param {string} root
340
- * @param {import('./flows/lib/manifest').Manifest} manifest
341
- * @param {*} runtime
345
+ *
346
+ * @param {string} root
347
+ * @param {import('./flows/lib/manifest').Manifest} manifest
348
+ * @param {*} runtime
342
349
  */
343
350
  async function configureApp(root, manifest, runtime) {
344
351
  if (manifest.isJs()) {
@@ -360,31 +367,27 @@ const addTsConfigs = (root, manifest, runtime) => {
360
367
  }
361
368
 
362
369
  return Promise.all([
363
- fs.writeJson(path.resolve(root, 'tsconfig.json'),
370
+ fs.writeJson(
371
+ path.resolve(root, 'tsconfig.json'),
364
372
  {
365
373
  extends: `@tsconfig/node${runtime.version}/tsconfig.json`,
366
374
  compilerOptions: {
367
- inlineSourceMap: true
368
- }
375
+ inlineSourceMap: true,
376
+ },
369
377
  },
370
378
  writejsonOptions
371
379
  ),
372
- fs.writeJson(path.resolve(root, 'tsconfig.build.json'),
380
+ fs.writeJson(
381
+ path.resolve(root, 'tsconfig.build.json'),
373
382
  {
374
- "extends": "./tsconfig.json",
375
- "include": [
376
- "lib/**/*.ts",
377
- "index.ts"
378
- ],
379
- "exclude": [
380
- "node_modules",
381
- "**/*.spec.ts"
382
- ]
383
+ extends: './tsconfig.json',
384
+ include: ['lib/**/*.ts', 'index.ts'],
385
+ exclude: ['node_modules', '**/*.spec.ts'],
383
386
  },
384
387
  writejsonOptions
385
388
  ),
386
- ])
387
- }
389
+ ]);
390
+ };
388
391
 
389
392
  function patchSchedulerForPython(root, manifest, runtime) {
390
393
  const schedulerType = manifest.manifest.settings.app.scheduler_type;
@@ -393,7 +396,13 @@ function patchSchedulerForPython(root, manifest, runtime) {
393
396
  return;
394
397
  }
395
398
 
396
- const templateFolder = path.resolve(__dirname, '..', 'templates', runtime.language, manifest.type);
399
+ const templateFolder = path.resolve(
400
+ __dirname,
401
+ '..',
402
+ 'templates',
403
+ runtime.language,
404
+ manifest.type
405
+ );
397
406
  const originalType = 'ScheduledDataTimeEvent';
398
407
  const replacementType =
399
408
  schedulerType === manifestConstants.SCHEDULER_TYPE_DEPTH.value
@@ -407,9 +416,9 @@ function patchSchedulerForPython(root, manifest, runtime) {
407
416
  }
408
417
 
409
418
  /**
410
- *
411
- * @param {string} root
412
- * @param {import('./flows/lib/manifest').Manifest} manifest
419
+ *
420
+ * @param {string} root
421
+ * @param {import('./flows/lib/manifest').Manifest} manifest
413
422
  */
414
423
  function addPackageJSON(root, manifest, runtime) {
415
424
  const defaults = getDefaultsForPackageJson(manifest, runtime);
@@ -419,9 +428,9 @@ function addPackageJSON(root, manifest, runtime) {
419
428
  version: defaults.version,
420
429
  description: manifest.description || defaults.description,
421
430
  engines: {
422
- node: `>=12.22.12`,
431
+ node: '>=16',
423
432
  // node: `>=${runtime.version}`,
424
- [runtime.packageManager]: '*'
433
+ [runtime.packageManager]: '*',
425
434
  },
426
435
  scripts: defaults.scripts,
427
436
  dependencies: defaults.dependencies,
@@ -432,9 +441,9 @@ function addPackageJSON(root, manifest, runtime) {
432
441
  }
433
442
 
434
443
  /**
435
- *
436
- * @param {string} root
437
- * @param {import('./flows/lib/manifest').Manifest} manifest
444
+ *
445
+ * @param {string} root
446
+ * @param {import('./flows/lib/manifest').Manifest} manifest
438
447
  */
439
448
  async function installApp(root, manifest, runtime) {
440
449
  const command = manifest.isJs() ? runtime.packageManager : 'make';
@@ -478,7 +487,7 @@ async function installApp(root, manifest, runtime) {
478
487
 
479
488
  async function helpCommands(manifest, { packageManager: displayedCommand }) {
480
489
  if (!manifest.isUi()) {
481
- return
490
+ return;
482
491
  }
483
492
 
484
493
  const useYarn = displayedCommand === 'yarn';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/create-app",
3
- "version": "0.30.0-rc.0",
3
+ "version": "0.31.0-rc.0",
4
4
  "private": false,
5
5
  "description": "Create app to use it in CORVA.AI",
6
6
  "keywords": [
@@ -62,7 +62,7 @@
62
62
  "standard-version": "^9.0.0"
63
63
  },
64
64
  "engines": {
65
- "node": "^12.20.0 || >=14"
65
+ "node": ">=16"
66
66
  },
67
67
  "standard-version": {
68
68
  "skip": {
@@ -0,0 +1 @@
1
+ 16.*
@@ -0,0 +1 @@
1
+ 16.*