@capgo/capacitor-pretty-toast 8.1.13 → 8.1.14

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/capacitor-pretty-toast",
3
- "version": "8.1.13",
3
+ "version": "8.1.14",
4
4
  "description": "Native-first pretty toast notifications for Capacitor and the web",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -55,8 +55,7 @@
55
55
  "prepublishOnly": "bun run build",
56
56
  "check:wiring": "node scripts/check-capacitor-plugin-wiring.mjs",
57
57
  "example:install": "cd example-app && bun install --frozen-lockfile",
58
- "example:build": "bun run build && cd example-app && bun install --frozen-lockfile && bun run build",
59
- "example:capgo:deploy": "bun run example:build && bun scripts/deploy-example-capgo.mjs"
58
+ "example:build": "bun run build && cd example-app && bun install --frozen-lockfile && bun run build"
60
59
  },
61
60
  "devDependencies": {
62
61
  "@capacitor/android": "^8.0.0",
@@ -1,96 +0,0 @@
1
- #!/usr/bin/env node
2
- import { existsSync, readFileSync } from 'node:fs';
3
- import { dirname, resolve } from 'node:path';
4
- import { fileURLToPath } from 'node:url';
5
- import { spawnSync } from 'node:child_process';
6
-
7
- const __dirname = dirname(fileURLToPath(import.meta.url));
8
- const repoRoot = resolve(__dirname, '..');
9
- const appDir = resolve(repoRoot, 'example-app');
10
- const rootPackageJson = JSON.parse(readFileSync(resolve(repoRoot, 'package.json'), 'utf8'));
11
- const examplePackageJson = JSON.parse(readFileSync(resolve(appDir, 'package.json'), 'utf8'));
12
- const configText = readFileSync(
13
- existsSync(resolve(appDir, 'capacitor.config.ts'))
14
- ? resolve(appDir, 'capacitor.config.ts')
15
- : resolve(appDir, 'capacitor.config.json'),
16
- 'utf8',
17
- );
18
-
19
- function readConfigString(key, fallback) {
20
- const match = configText.match(new RegExp(`['"]?${key}['"]?\\s*[:=]\\s*['"]([^'"]+)['"]`));
21
- return match?.[1] ?? fallback;
22
- }
23
-
24
- function runCapgo(args, allowFailure = false) {
25
- const token = process.env.CAPGO_TOKEN;
26
- const fullArgs = ['@capgo/cli@latest', ...args];
27
- if (token) {
28
- fullArgs.push('--apikey', token);
29
- }
30
- const result = spawnSync('bunx', fullArgs, {
31
- cwd: repoRoot,
32
- stdio: 'inherit',
33
- env: process.env,
34
- });
35
- if (!allowFailure && result.status !== 0) {
36
- process.exit(result.status ?? 1);
37
- }
38
- return result.status ?? 1;
39
- }
40
-
41
- const appId = process.env.CAPGO_APP_ID || readConfigString('appId');
42
- const appName = process.env.CAPGO_APP_NAME || readConfigString('appName', rootPackageJson.name);
43
- const webDir = process.env.CAPGO_WEB_DIR || readConfigString('webDir', 'dist');
44
- const distDir = resolve(appDir, webDir);
45
- const channel = process.env.CAPGO_CHANNEL || process.argv[2] || 'production';
46
- const bundle = process.env.CAPGO_BUNDLE || rootPackageJson.version || examplePackageJson.version;
47
- const comment =
48
- process.env.CAPGO_COMMENT ||
49
- (process.env.GITHUB_RUN_NUMBER
50
- ? `${appName} run ${process.env.GITHUB_RUN_NUMBER}`
51
- : `${appName} ${bundle}`);
52
- const iconPath = process.env.CAPGO_ICON || resolve(appDir, 'assets', 'capgo-icon.png');
53
-
54
- if (!appId) {
55
- console.error('Missing Capgo app id. Set CAPGO_APP_ID or example-app/capacitor.config.* appId.');
56
- process.exit(1);
57
- }
58
-
59
- if (!existsSync(distDir)) {
60
- console.error(`Missing example app bundle at ${distDir}. Run bun run example:build first.`);
61
- process.exit(1);
62
- }
63
-
64
- const appArgs = [appId, '--name', appName];
65
- if (existsSync(iconPath)) {
66
- appArgs.push('--icon', iconPath);
67
- }
68
-
69
- const setStatus = runCapgo(['app', 'set', ...appArgs], true);
70
- if (setStatus !== 0) {
71
- runCapgo(['app', 'add', ...appArgs]);
72
- }
73
-
74
- console.log(`Deploying ${appId} to Capgo channel "${channel}"`);
75
-
76
- runCapgo([
77
- 'bundle',
78
- 'upload',
79
- appId,
80
- '--bundle',
81
- bundle,
82
- '--path',
83
- distDir,
84
- '--channel',
85
- channel,
86
- '--package-json',
87
- 'example-app/package.json,package.json',
88
- '--node-modules',
89
- 'node_modules,example-app/node_modules',
90
- '--delta',
91
- '--no-key',
92
- '--ignore-checksum-check',
93
- '--version-exists-ok',
94
- '--comment',
95
- comment,
96
- ]);