@corva/create-app 0.34.0-2 → 0.34.0-5

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.
@@ -2,13 +2,14 @@
2
2
  .DEFAULT_GOAL := default
3
3
 
4
4
  default: install
5
- install: venv
5
+ install: prepare-venv
6
6
  @. venv/bin/activate && pip install -r requirements.txt
7
- venv:
8
- @test -d venv || python -m venv venv
7
+ prepare-venv:
8
+ @which python3 > /dev/null || (echo "python3 not found, please install it first" && exit 1;)
9
+ @test -d venv || python3 -m venv venv
9
10
  bundle:
10
11
  @create-corva-app zip . --bump-version=skip
11
12
  release:
12
13
  @create-corva-app release . --bump-version=skip
13
- test: venv
14
+ test: prepare-venv
14
15
  @. venv/bin/activate && pytest
@@ -158,3 +158,4 @@ cython_debug/
158
158
  # and can be added to the global gitignore or merged into this file. For a more nuclear
159
159
  # option (not recommended) you can uncomment the following to ignore the entire idea folder.
160
160
  #.idea/
161
+ venv
@@ -55,6 +55,7 @@ const transformPatternsIntoFileNames = async (dirName, patterns, ignoredFiles =
55
55
  const files = await glob(pattern, {
56
56
  cwd: dirName,
57
57
  ignore: ['**/node_modules', ...ignoredFiles],
58
+ nodir: true,
58
59
  });
59
60
 
60
61
  filesFromPatterns.push(...files);
@@ -179,7 +180,7 @@ const resolveDataForZipPythonApp = async (itemsToZip = [], { manifest, dirName,
179
180
  const zipFileName = `${manifest.manifest.application.name}.zip`;
180
181
 
181
182
  if (!itemsToZip.length) {
182
- itemsToZip.push(...(await glob('**/*.py', { cwd: dirName, ignore: options.ignoredFiles })));
183
+ itemsToZip.push(...(await glob('**/*.py', { cwd: dirName, ignore: [...(options.ignoredFiles || []), 'venv/**/*'] })));
183
184
  }
184
185
 
185
186
  itemsToZip.push('manifest.json', 'requirements.txt');
package/lib/index.js CHANGED
@@ -34,6 +34,7 @@ const { ZIP_FLOW } = require('./flows/zip');
34
34
  const { bumpVersionOptionDeprecated, bumpVersionOption } = require('./bump-version.option');
35
35
  const { Manifest } = require('./flows/lib/manifest');
36
36
  const { resolveAppRuntime } = require('./helpers/resolve-app-runtime');
37
+ const { existsSync } = require('fs');
37
38
 
38
39
  const writejsonOptions = {
39
40
  spaces: 2,
@@ -54,7 +55,7 @@ function checkNodeVersion() {
54
55
  console.log(
55
56
  chalk.red(
56
57
  `\nYou are using Node ${process.version}.\n\n` +
57
- `Please update to Node 16 or higher for a better, fully supported experience.\n`
58
+ `Please update to Node 16 or higher for a better, fully supported experience.\n`
58
59
  )
59
60
  );
60
61
  // Fall back to latest supported react-scripts on Node 4
@@ -84,7 +85,7 @@ function checkOptions(opts) {
84
85
  const printDeprecationNotice = (param) =>
85
86
  console.warn(
86
87
  chalk.bgYellowBright`DEPRECATED OPTION: ${param}` +
87
- ` Use ${chalk.cyan(`create-corva-app ${param} .`)} instead`
88
+ ` Use ${chalk.cyan(`create-corva-app ${param} .`)} instead`
88
89
  );
89
90
 
90
91
  async function initialChecks() {
@@ -106,8 +107,7 @@ async function initialChecks() {
106
107
  manifestConstants.manifestOptions().forEach((value) => {
107
108
  const type = typeof value.default;
108
109
  const option = new Option(
109
- `${value.alias ? `-${value.alias}, ` : ''}--${value.name} [${
110
- (type !== 'undefined' && type) || 'string'
110
+ `${value.alias ? `-${value.alias}, ` : ''}--${value.name} [${(type !== 'undefined' && type) || 'string'
111
111
  }]`,
112
112
  value.message
113
113
  );
@@ -302,7 +302,7 @@ async function createApp(dirName, opts) {
302
302
 
303
303
  console.log('Please fill your app Metadata');
304
304
 
305
- const answers = inquirer.prompt(manifestConstants.manifestOptions(dirName), opts);
305
+ const answers = await inquirer.prompt(manifestConstants.manifestOptions(dirName), opts);
306
306
 
307
307
  return initPackage(dirName, answers);
308
308
  }
@@ -454,9 +454,12 @@ function addPackageJSON(root, manifest, runtime) {
454
454
  async function installApp(root, manifest, runtime) {
455
455
  const command = manifest.isJs() ? runtime.packageManager : 'make';
456
456
  const args = ['install'];
457
+ const opts = { stdio: ['inherit', 'inherit', 'pipe'], cwd: root }
457
458
 
458
459
  console.log(chalk.yellow(`Installing template dependencies using ${runtime.packageManager}...`));
459
- const proc = spawn.sync(command, args, { stdio: ['inherit', 'inherit', 'pipe'], cwd: root });
460
+ const proc = manifest.isJs() && existsSync(`${os.homedir()}/.nvm/nvm.sh`) ?
461
+ spawn.sync(`\\. ${os.homedir()}/.nvm/nvm.sh && nvm i && ${command} ${args.join(' ')}`, { shell: true, ...opts }) :
462
+ spawn.sync(command, args, opts);
460
463
 
461
464
  if (proc.stderr) {
462
465
  const error = proc.stderr
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/create-app",
3
- "version": "0.34.0-2",
3
+ "version": "0.34.0-5",
4
4
  "private": false,
5
5
  "description": "Create app to use it in CORVA.AI",
6
6
  "keywords": [