@corva/create-app 0.42.0-1 → 0.42.0-2

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
@@ -177,6 +177,7 @@ Options:
177
177
  --label [string] Put a label on the release (choices: "BETA", "STABLE")
178
178
  --remove-on-fail [boolean] Remove release if it fails during deployment (default: false)
179
179
  --silent [boolean] Only log result of the operation (default: false)
180
+ --remove-on-success App package (.zip) will not be deleted after upload (default: true)
180
181
  ```
181
182
 
182
183
  ### Examples
@@ -1,7 +1,6 @@
1
1
  import got from 'got';
2
2
  import Debug from 'debug';
3
3
  import { StepError } from './step-error.js';
4
- import _ from 'lodash/fp.js';
5
4
 
6
5
  const debug = Debug('cca:api');
7
6
 
@@ -283,7 +282,7 @@ export class Api {
283
282
  * @returns { Promise<void>}
284
283
  */
285
284
  deleteAppUpload(appId, uploadId) {
286
- return this.#api.del(`v2/apps/${appId}/packages/${uploadId}`).json();
285
+ return this.#api.delete(`v2/apps/${appId}/packages/${uploadId}`).json();
287
286
  }
288
287
 
289
288
  /**
@@ -3,9 +3,18 @@ import { unlink } from 'node:fs/promises';
3
3
 
4
4
  export const REMOVE_FAILED_UPLOAD_STEP = {
5
5
  message: 'Cleaning up...',
6
- async fn({ api, appId, packageId, removeOnFail, uploadStatus, dirName, zipFileName }) {
6
+ async fn({
7
+ api,
8
+ appId,
9
+ packageId,
10
+ removeOnFail,
11
+ uploadStatus,
12
+ dirName,
13
+ zipFileName,
14
+ removeOnSuccess,
15
+ }) {
7
16
  if (uploadStatus === 'draft') {
8
- await unlink(resolve(dirName, zipFileName));
17
+ removeOnSuccess && (await unlink(resolve(dirName, zipFileName)));
9
18
 
10
19
  return;
11
20
  }
package/lib/main.js CHANGED
@@ -199,6 +199,12 @@ export async function run() {
199
199
  'Remove release if it fails during deployment'
200
200
  ).default(false)
201
201
  )
202
+ .addOption(
203
+ new Option(
204
+ '--remove-on-success [boolean]',
205
+ 'App package (.zip) will not be deleted after upload'
206
+ ).default(true)
207
+ )
202
208
  // .addOption(new Option('--zip-file-name [string]', 'Prebuilt zip file name in dir'))
203
209
  .action(async (dirName, patterns, options) => {
204
210
  options.bumpVersion = await ensureBumpVersion(options.bumpVersion);
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@corva/create-app",
3
- "version": "0.42.0-1",
3
+ "version": "0.42.0-2",
4
4
  "private": false,
5
- "description": "Create app to use it in CORVA.AI",
5
+ "description": "Create an app to use it in CORVA.AI",
6
6
  "keywords": [
7
7
  "react"
8
8
  ],