@corva/create-app 0.48.0-4 → 0.48.0-6

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.
@@ -172,13 +172,15 @@ const resolveDataForZipNodeJsApp = async (itemsToZip = [], { options, pkg, dirNa
172
172
  throw new StepError(`No lock file found in ${dirName}`);
173
173
  }
174
174
 
175
+ const defaultSrcWithoutExtensions = '+(__tests__|src|lib)/**/*.';
176
+
175
177
  if (packageDirContent.includes('tsconfig.json')) {
176
178
  itemsToZip.push('tsconfig.json', 'tsconfig.build.json');
177
179
 
178
180
  if (shouldPushDefaultSrc) {
179
181
  itemsToZip.push(
180
182
  'index.ts',
181
- ...(await glob('+(src|lib)/**/*.ts', {
183
+ ...(await glob(`${defaultSrcWithoutExtensions}ts`, {
182
184
  cwd: dirName,
183
185
  ignore: options.ignoredFiles,
184
186
  })),
@@ -187,7 +189,7 @@ const resolveDataForZipNodeJsApp = async (itemsToZip = [], { options, pkg, dirNa
187
189
  } else if (shouldPushDefaultSrc) {
188
190
  itemsToZip.push(
189
191
  'index.js',
190
- ...(await glob('+(src|lib)/**/*.js', {
192
+ ...(await glob(`${defaultSrcWithoutExtensions}js`, {
191
193
  cwd: dirName,
192
194
  ignore: options.ignoredFiles,
193
195
  })),
@@ -2,9 +2,11 @@ import NpmApi from 'npm-api';
2
2
  import chalk from 'chalk';
3
3
  import semver from 'semver';
4
4
  import inquirer from 'inquirer';
5
+ import { join } from 'path';
6
+ import * as url from 'url';
5
7
 
6
- import packageJson from '../../../package.json' assert { type: 'json' };
7
8
  import { logger } from '../../helpers/logger.js';
9
+ import fs from 'fs-extra';
8
10
 
9
11
  const npm = new NpmApi();
10
12
 
@@ -13,12 +15,13 @@ const warning = chalk.hex('#FFA500'); // Orange
13
15
  const code = chalk.cyan;
14
16
  const asterisks = '****************************************************************';
15
17
 
16
- const getCurrentVersion = () => packageJson.version;
18
+ const getCurrentVersion = async () =>
19
+ (await fs.readJSON(join(url.fileURLToPath(new URL('.', import.meta.url)), '../../../package.json'))).version;
17
20
  const getLatestVersion = async () => npm.repo('@corva/create-app').prop('version');
18
21
 
19
22
  // NOTE: Stop process and show error if version is outdated
20
23
  export async function ensureLatestVersion() {
21
- const currentVersion = getCurrentVersion();
24
+ const currentVersion = await getCurrentVersion();
22
25
  const latestVersion = await getLatestVersion();
23
26
 
24
27
  const isCurrentVersionOutdated = semver.gt(latestVersion, currentVersion);
@@ -42,7 +45,7 @@ export async function ensureLatestVersion() {
42
45
  export async function warnIfOutdated() {
43
46
  logger.write('Checking for updates...\n');
44
47
 
45
- const currentVersion = getCurrentVersion();
48
+ const currentVersion = await getCurrentVersion();
46
49
  const latestVersion = await getLatestVersion();
47
50
 
48
51
  const isCurrentVersionOutdated = semver.gt(latestVersion, currentVersion);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/create-app",
3
- "version": "0.48.0-4",
3
+ "version": "0.48.0-6",
4
4
  "private": false,
5
5
  "description": "Create an app to use it in CORVA.AI",
6
6
  "keywords": [