@corva/create-app 0.65.0-2 → 0.65.0-3
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.
package/README.md
CHANGED
|
@@ -175,6 +175,7 @@ Options:
|
|
|
175
175
|
--ignored-files [string...] Patterns to skip zip (default: [])
|
|
176
176
|
--env [string] Environment to use (choices: "qa", "staging", "production", default: "qa")
|
|
177
177
|
--api-key [string] Pre generated API key for authorization during app upload
|
|
178
|
+
--app-key [string] Explicitly set appKey that CLI is going to use. Otherwise it will be taken from manifest.json file.
|
|
178
179
|
--notes [string] Add custom notes to published app
|
|
179
180
|
--label [string] Put a label on the release (choices: "DEV", "BETA", "PROD")
|
|
180
181
|
--remove-on-fail [boolean] Remove release if it fails during deployment (default: false)
|
package/lib/commands/release.js
CHANGED
|
@@ -10,6 +10,7 @@ import { originalCwdOption } from '../options/original-cwd.js';
|
|
|
10
10
|
import { silentOption } from '../options/silent.js';
|
|
11
11
|
import { ensureBumpVersion } from '../helpers/cli-version.js';
|
|
12
12
|
import { ERROR_ICON } from '../constants/messages.js';
|
|
13
|
+
import { appKeyOption } from '../options/app-key.js';
|
|
13
14
|
|
|
14
15
|
export const releaseCommand = new Command('release')
|
|
15
16
|
.description('Release app')
|
|
@@ -20,6 +21,7 @@ export const releaseCommand = new Command('release')
|
|
|
20
21
|
.addOption(silentOption)
|
|
21
22
|
.addOption(envOption)
|
|
22
23
|
.addOption(apiKeyOption)
|
|
24
|
+
.addOption(appKeyOption)
|
|
23
25
|
.addOption(originalCwdOption)
|
|
24
26
|
.addOption(new Option('--notes [string]', 'Add custom notes to published app'))
|
|
25
27
|
.addOption(new Option('--label [string]', 'Put a label on the release').choices(['DEV', 'BETA', 'PROD']))
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export const RELEASE_PREPARE_DATA_STEP = {
|
|
2
2
|
message: 'Preparing data...',
|
|
3
|
-
async fn({ api, manifest }) {
|
|
4
|
-
const
|
|
3
|
+
async fn({ api, manifest, options }) {
|
|
4
|
+
const appKey = options.appKey || manifest.manifest.application.key;
|
|
5
|
+
const app = await api.getAppByKey(appKey);
|
|
5
6
|
|
|
6
7
|
return {
|
|
7
8
|
appId: app.id,
|
|
9
|
+
appKey,
|
|
8
10
|
};
|
|
9
11
|
},
|
|
10
12
|
};
|
|
@@ -27,15 +27,14 @@ export const UPLOAD_ZIP_TO_CORVA_STEP = {
|
|
|
27
27
|
*
|
|
28
28
|
* @param {object} param0
|
|
29
29
|
* @param {import('../../lib/api').Api} param0.api
|
|
30
|
-
* @param {import('../../lib/manifest').Manifest} param0.manifest
|
|
31
30
|
*/
|
|
32
|
-
fn: async ({ zipFileName,
|
|
31
|
+
fn: async ({ zipFileName, api, appId, appKey, dirName, options, pkg }) => {
|
|
33
32
|
async function uploadAppPackage() {
|
|
34
33
|
const form = new FormData();
|
|
35
34
|
|
|
36
35
|
form.append('package', createReadStream(resolve(dirName, zipFileName)), 'package.zip');
|
|
37
36
|
|
|
38
|
-
const { id: packageId } = await api.uploadPackages(
|
|
37
|
+
const { id: packageId } = await api.uploadPackages(appKey, form);
|
|
39
38
|
|
|
40
39
|
return { packageId };
|
|
41
40
|
}
|
|
@@ -75,7 +75,7 @@ const transformPatternsIntoFileNames = async (dirName, patterns, ignoredFiles =
|
|
|
75
75
|
* @param {import('../lib/manifest').Manifest} param1.manifest
|
|
76
76
|
* @returns
|
|
77
77
|
*/
|
|
78
|
-
const resolveDataToZipUiApp = async (itemsToZip = [], { options, pkg, dirName, manifest }) => {
|
|
78
|
+
const resolveDataToZipUiApp = async (itemsToZip = [], { options, pkg, dirName, manifest, appKey }) => {
|
|
79
79
|
const version = await getIncreasedVersion(pkg.version, options);
|
|
80
80
|
const randomSuffix = generateRandomString(); // Random suffix is needed to not cause a conflict when we call 2 parallel commands at the same time.
|
|
81
81
|
const zipFileName = `${manifest.unix_name}-${version}-${randomSuffix}.zip`;
|
|
@@ -123,6 +123,28 @@ const resolveDataToZipUiApp = async (itemsToZip = [], { options, pkg, dirName, m
|
|
|
123
123
|
...(await transformPatternsIntoFileNames(dirName, ['src/**/*'], options.ignoredFiles)),
|
|
124
124
|
);
|
|
125
125
|
|
|
126
|
+
if (options.appKey) {
|
|
127
|
+
/**
|
|
128
|
+
* Both manifest.json appKey in zip and the provided
|
|
129
|
+
* appKey param should match. That's why we set it for cases when appKey option
|
|
130
|
+
* is specified to override the one from manifest.json
|
|
131
|
+
*/
|
|
132
|
+
|
|
133
|
+
const tmpManifestForSourceName = `manifestForSource_${randomSuffix}.json`;
|
|
134
|
+
|
|
135
|
+
itemsToSave.push({
|
|
136
|
+
name: tmpManifestForSourceName,
|
|
137
|
+
content: _.set('application.key', appKey, manifest.manifest),
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
itemsToRemove.push(tmpManifestForSourceName);
|
|
141
|
+
|
|
142
|
+
itemsToZip.push({
|
|
143
|
+
path: resolve(dirName, tmpManifestForSourceName),
|
|
144
|
+
name: 'manifest.json',
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
126
148
|
return {
|
|
127
149
|
zipFileName,
|
|
128
150
|
itemsToZip,
|