@corva/create-app 0.62.0-0 → 0.62.0-1

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.
@@ -6,6 +6,7 @@ import { promises as fs } from 'node:fs';
6
6
  import { resolve } from 'node:path';
7
7
  import { promisify } from 'node:util';
8
8
  import { getIncreasedVersion } from '../../helpers/cli-version.js';
9
+ import { generateRandomString } from '../../helpers/utils.js';
9
10
  import { loadJson } from '../lib/json.js';
10
11
  import { StepError } from '../lib/step-error.js';
11
12
 
@@ -92,8 +93,15 @@ const resolveDataToZipUiApp = async (itemsToZip = [], { options, pkg, dirName, m
92
93
  });
93
94
  }
94
95
 
96
+ /**
97
+ * Note: This random suffix is needed to not cause a conflict when
98
+ * we call 2 parallel commands at the same time.
99
+ * Example: CI simulteniously runs the release command to both QA and Prod envs
100
+ */
101
+ const tmpPackageForSourceName = `packageForSource_${generateRandomString()}.json`;
102
+
95
103
  itemsToSave.push({
96
- name: 'packageForSource.json',
104
+ name: tmpPackageForSourceName,
97
105
  content: _.set(
98
106
  'scripts',
99
107
  {
@@ -103,7 +111,7 @@ const resolveDataToZipUiApp = async (itemsToZip = [], { options, pkg, dirName, m
103
111
  ),
104
112
  });
105
113
 
106
- const itemsToRemove = ['packageForSource.json'];
114
+ const itemsToRemove = [tmpPackageForSourceName];
107
115
 
108
116
  itemsToZip.push(
109
117
  'manifest.json',
@@ -113,7 +121,7 @@ const resolveDataToZipUiApp = async (itemsToZip = [], { options, pkg, dirName, m
113
121
  '.nvmrc',
114
122
  'yarn.lock',
115
123
  {
116
- path: resolve(dirName, 'packageForSource.json'),
124
+ path: resolve(dirName, tmpPackageForSourceName),
117
125
  name: 'package.json',
118
126
  },
119
127
  ...(await transformPatternsIntoFileNames(dirName, ['src/**/*'], options.ignoredFiles)),
@@ -61,3 +61,5 @@ export const putVariablesInEnvFile = async (root, manifest) => {
61
61
  .replace(new RegExp('\\${APP_NAME}', 'g'), manifest.manifest.application.name),
62
62
  );
63
63
  };
64
+
65
+ export const generateRandomString = () => Math.floor(Math.random() * Date.now()).toString(36);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/create-app",
3
- "version": "0.62.0-0",
3
+ "version": "0.62.0-1",
4
4
  "private": false,
5
5
  "description": "Create an app to use it in CORVA.AI",
6
6
  "keywords": [