@capgo/cli 4.12.10 → 4.12.12-beta.0

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.12.10",
3
+ "version": "4.12.12-beta.0",
4
4
  "description": "A CLI to upload to capgo servers",
5
5
  "author": "github.com/riderx",
6
6
  "license": "Apache 2.0",
@@ -32,11 +32,11 @@
32
32
  "node": ">=18.0.0"
33
33
  },
34
34
  "scripts": {
35
- "build": "node build.mjs",
36
- "dev": "NODE_ENV=development node build.mjs",
35
+ "build": "ncc build",
36
+ "dev": "NODE_ENV=development ncc build",
37
37
  "no-debug": "node dist/index.js",
38
38
  "test": "npx --yes ts-node -T src/index.ts",
39
- "dev-build": "SUPA_DB=development node build.mjs",
39
+ "dev-build": "SUPA_DB=development ncc build",
40
40
  "pack": "pkg",
41
41
  "types": "npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",
42
42
  "test_rls": "ts-node ./test/test_headers_rls.ts",
@@ -51,6 +51,7 @@
51
51
  "@manypkg/find-root": "^2.2.1",
52
52
  "@supabase/supabase-js": "^2.43.5",
53
53
  "@tomasklaen/checksum": "^1.1.0",
54
+ "@vercel/ncc": "^0.38.1",
54
55
  "adm-zip": "^0.5.14",
55
56
  "ci-info": "^4.0.0",
56
57
  "commander": "12.1.0",
@@ -79,7 +80,7 @@
79
80
  "@typescript-eslint/eslint-plugin": "^7.13.0",
80
81
  "@typescript-eslint/parser": "^7.13.1",
81
82
  "esbuild": "^0.21.5",
82
- "eslint": "9.6.0",
83
+ "eslint": "9.7.0",
83
84
  "git-format-staged": "3.1.1",
84
85
  "husky": "^9.0.11",
85
86
  "pkg": "5.8.1",
@@ -211,6 +211,7 @@ async function checkTrial(supabase: SupabaseType, orgId: string, localConfig: lo
211
211
  async function checkVersionExists(supabase: SupabaseType, appid: string, bundle: string) {
212
212
  // check if app already exist
213
213
  // apikey is sooo legacy code, current prod does not use it
214
+ // TODO: remove apikey and create a new function who not need it
214
215
  const { data: appVersion, error: appVersionError } = await supabase
215
216
  .rpc('exist_app_versions', { appid, apikey: '', name_version: bundle })
216
217
  .single()
@@ -471,6 +472,19 @@ export async function uploadBundle(preAppid: string, options: Options, shouldExi
471
472
  await checkChecksum(supabase, appid, channel, checksum)
472
473
  }
473
474
  }
475
+ else {
476
+ await snag.track({
477
+ channel: 'app',
478
+ event: 'App external',
479
+ icon: '📤',
480
+ user_id: orgId,
481
+ tags: {
482
+ 'app-id': appid,
483
+ },
484
+ notify: false,
485
+ }).catch()
486
+ versionData.session_key = options.ivSessionKey
487
+ }
474
488
 
475
489
  const { error: dbError } = await updateOrCreateVersion(supabase, versionData)
476
490
  if (dbError) {
package/tsconfig.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "esModuleInterop": true,
7
7
  "skipLibCheck": true,
8
8
  "resolveJsonModule": true,
9
- "target": "es6",
9
+ "target": "es2015",
10
10
  "moduleResolution": "node",
11
11
  "sourceMap": true,
12
12
  "outDir": "dist",
package/vercel-ncc.js ADDED
@@ -0,0 +1,18 @@
1
+ require('@vercel/ncc')('/src/index.ts', {
2
+ cache: false,
3
+ externals: ["externalpackage"],
4
+ filterAssetBase: process.cwd(),
5
+ minify: false,
6
+ sourceMap: false,
7
+ assetBuilds: false,
8
+ sourceMapRegister: true,
9
+ watch: false,
10
+ license: '',
11
+ target: 'es2015',
12
+ v8cache: false,
13
+ quiet: false,
14
+ debugLog: false
15
+ }).then(({ code }) => {
16
+ console.log(code);
17
+
18
+ })