@capgo/cli 4.10.8 → 4.10.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/cli",
3
- "version": "4.10.8",
3
+ "version": "4.10.10",
4
4
  "description": "A CLI to upload to capgo servers",
5
5
  "author": "github.com/riderx",
6
6
  "license": "Apache 2.0",
@@ -43,20 +43,20 @@
43
43
  "lint": "eslint \"src/**/*.ts\" --fix"
44
44
  },
45
45
  "dependencies": {
46
- "@aws-sdk/client-s3": "^3.574.0",
46
+ "@aws-sdk/client-s3": "^3.588.0",
47
47
  "@capacitor/cli": "6.0.0",
48
48
  "@capgo/find-package-manager": "^0.0.17",
49
49
  "@clack/prompts": "^0.7.0",
50
50
  "@manypkg/find-root": "^2.2.1",
51
- "@supabase/supabase-js": "^2.43.1",
51
+ "@supabase/supabase-js": "^2.43.4",
52
52
  "@tomasklaen/checksum": "^1.1.0",
53
53
  "@trufflesuite/spinnies": "^0.1.1",
54
- "adm-zip": "^0.5.12",
54
+ "adm-zip": "^0.5.13",
55
55
  "ci-info": "^4.0.0",
56
- "commander": "12.0.0",
56
+ "commander": "12.1.0",
57
57
  "console-table-printer": "^2.12.0",
58
58
  "get-latest-version": "^5.1.0",
59
- "ky": "^1.2.4",
59
+ "ky": "^1.3.0",
60
60
  "logsnag": "1.0.0",
61
61
  "mime": "^4.0.3",
62
62
  "node-dir": "^0.1.17",
@@ -66,19 +66,19 @@
66
66
  "semver": "^7.6.2"
67
67
  },
68
68
  "devDependencies": {
69
- "@antfu/eslint-config": "^2.17.0",
69
+ "@antfu/eslint-config": "^2.20.0",
70
70
  "@types/adm-zip": "0.5.5",
71
71
  "@types/mime": "^4.0.0",
72
- "@types/node": "^20.12.7",
72
+ "@types/node": "^20.14.0",
73
73
  "@types/node-dir": "^0.0.37",
74
74
  "@types/npmcli__ci-detect": "^2.0.3",
75
75
  "@types/prettyjson": "^0.0.33",
76
76
  "@types/prompt-sync": "^4.2.3",
77
77
  "@types/semver": "^7.5.8",
78
- "@typescript-eslint/eslint-plugin": "^7.8.0",
79
- "@typescript-eslint/parser": "^7.8.0",
80
- "esbuild": "^0.21.2",
81
- "eslint": "9.1.1",
78
+ "@typescript-eslint/eslint-plugin": "^7.12.0",
79
+ "@typescript-eslint/parser": "^7.12.0",
80
+ "esbuild": "^0.21.4",
81
+ "eslint": "9.4.0",
82
82
  "git-format-staged": "3.1.1",
83
83
  "husky": "^9.0.11",
84
84
  "pkg": "5.8.1",
@@ -8,7 +8,7 @@ import { program } from 'commander'
8
8
  import * as p from '@clack/prompts'
9
9
  import { checksum as getChecksum } from '@tomasklaen/checksum'
10
10
  import ciDetect from 'ci-info'
11
- import ky from 'ky'
11
+ import ky, { HTTPError } from 'ky'
12
12
  import {
13
13
  PutObjectCommand,
14
14
  S3Client,
@@ -395,7 +395,6 @@ It will be also visible in your dashboard\n`)
395
395
  p.log.error(`Cannot get upload url`)
396
396
  program.error('')
397
397
  }
398
-
399
398
  await ky.put(url, {
400
399
  timeout: options.timeout || UPLOAD_TIMEOUT,
401
400
  retry: 5,
@@ -415,6 +414,11 @@ It will be also visible in your dashboard\n`)
415
414
  const uploadTime = ((endTime - startTime) / 1000).toFixed(2)
416
415
  spinner.stop(`Failed to upload bundle ( after ${uploadTime} seconds)`)
417
416
  p.log.error(`Cannot upload bundle ${formatError(errorUpload)}`)
417
+ if (errorUpload instanceof HTTPError) {
418
+ const body = await errorUpload.response.text()
419
+ p.log.error(`Response: ${formatError(body)}`)
420
+ program.error('')
421
+ }
418
422
  // call delete version on path /delete_failed_version to delete the version
419
423
  await deletedFailedVersion(supabase, appid, bundle)
420
424
  program.error('')
package/src/utils.ts CHANGED
@@ -27,7 +27,7 @@ export type ArrayElement<ArrayType extends readonly unknown[]> =
27
27
  ArrayType extends readonly (infer ElementType)[] ? ElementType : never
28
28
  export type Organization = ArrayElement<Database['public']['Functions']['get_orgs_v5']['Returns']>
29
29
 
30
- export const regexSemver = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/
30
+ export const regexSemver = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*))*))?(?:\+([0-9a-z-]+(?:\.[0-9a-z-]+)*))?$/i
31
31
  export const formatError = (error: any) => error ? `\n${prettyjson.render(error)}` : ''
32
32
 
33
33
  export interface OptionsBase {
@@ -74,7 +74,7 @@ export async function getLocalConfig() {
74
74
  }
75
75
  }
76
76
  }
77
-
77
+ // eslint-disable-next-line regexp/no-unused-capturing-group
78
78
  const nativeFileRegex = /([A-Za-z0-9]+)\.(java|swift|kt|scala)$/
79
79
 
80
80
  interface CapgoConfig {
@@ -319,10 +319,13 @@ async function* getFiles(dir: string): AsyncGenerator<string> {
319
319
  if (dirent.isDirectory()
320
320
  && !dirent.name.startsWith('.')
321
321
  && !dirent.name.startsWith('node_modules')
322
- && !dirent.name.startsWith('dist'))
322
+ && !dirent.name.startsWith('dist')) {
323
323
  yield * getFiles(res)
324
- else
324
+ }
325
+
326
+ else {
325
327
  yield res
328
+ }
326
329
  }
327
330
  }
328
331
 
@@ -411,6 +414,7 @@ export async function findBuildCommandForProjectType(projectType: string) {
411
414
  }
412
415
 
413
416
  export async function findMainFile() {
417
+ // eslint-disable-next-line regexp/no-unused-capturing-group
414
418
  const mainRegex = /(main|index)\.(ts|tsx|js|jsx)$/
415
419
  // search for main.ts or main.js in local dir and subdirs
416
420
  let mainFile = ''