@corva/create-app 0.48.0-3 → 0.48.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.
@@ -124,6 +124,8 @@ const nodeNpmPackage = {
124
124
  jest: {
125
125
  setupFiles: ['dotenv/config'],
126
126
  },
127
+ prettier: '@corva/eslint-config-node/prettier',
128
+ eslintConfig: { extends: '@corva/eslint-config-node' },
127
129
  };
128
130
 
129
131
  const nodeYarnPackage = {
@@ -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
  })),
package/lib/main.js CHANGED
@@ -438,7 +438,13 @@ async function addTemplate(root, manifest, runtime) {
438
438
  // We can't have .gitignore file in our templates.
439
439
  // It's missing when @corva/create-app is installed.
440
440
  // That's why we manually rename gitignore to .gitignore after copying template
441
- fs.renameSync(path.join(root, 'gitignore'), path.join(root, '.gitignore'));
441
+ const targetGitignore = path.join(root, '.gitignore');
442
+
443
+ fs.renameSync(path.join(root, 'gitignore'), targetGitignore);
444
+
445
+ if (runtime.language === 'typescript' && manifest.isNode()) {
446
+ await fs.appendFile(targetGitignore, '\n**/*.js\n');
447
+ }
442
448
 
443
449
  logger.log(chalk.green('Done: copying app template!'));
444
450
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/create-app",
3
- "version": "0.48.0-3",
3
+ "version": "0.48.0-5",
4
4
  "private": false,
5
5
  "description": "Create an app to use it in CORVA.AI",
6
6
  "keywords": [
@@ -1 +0,0 @@
1
- module.exports = { extends: '@corva/eslint-config-node' };
@@ -1 +0,0 @@
1
- "@corva/eslint-config-node/prettier"