@capgo/capacitor-pretty-toast 8.1.9 → 8.1.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/capacitor-pretty-toast",
3
- "version": "8.1.9",
3
+ "version": "8.1.10",
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",
@@ -8,16 +8,29 @@ const scriptDir = dirname(fileURLToPath(import.meta.url));
8
8
  const repoRoot = resolve(scriptDir, '..');
9
9
  const appDir = resolve(repoRoot, 'example-app');
10
10
  const distDir = resolve(appDir, 'dist');
11
- const packageJsonPath = resolve(appDir, 'package.json');
12
- const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
11
+ const rootPackageJsonPath = resolve(repoRoot, 'package.json');
12
+ const examplePackageJsonPath = resolve(appDir, 'package.json');
13
+ const rootPackageJson = JSON.parse(readFileSync(rootPackageJsonPath, 'utf8'));
14
+ const examplePackageJson = JSON.parse(readFileSync(examplePackageJsonPath, 'utf8'));
15
+
16
+ const toTitleCase = (value) =>
17
+ value
18
+ .split('-')
19
+ .filter(Boolean)
20
+ .map((part) => `${part.charAt(0).toUpperCase()}${part.slice(1)}`)
21
+ .join(' ');
22
+
23
+ const packageBaseName = rootPackageJson.name.split('/').pop() ?? examplePackageJson.name;
24
+ const exampleName = `${toTitleCase(packageBaseName.replace(/^capacitor-/, ''))} example`;
13
25
 
14
26
  const appId = process.env.CAPGO_APP_ID;
15
27
  const channel = process.env.CAPGO_CHANNEL || process.argv[2] || 'production';
28
+ const bundle = process.env.CAPGO_BUNDLE || rootPackageJson.version || examplePackageJson.version;
16
29
  const comment =
17
30
  process.env.CAPGO_COMMENT ||
18
31
  (process.env.GITHUB_RUN_NUMBER
19
- ? `Pretty Toast example run ${process.env.GITHUB_RUN_NUMBER}`
20
- : `Pretty Toast example ${packageJson.version}`);
32
+ ? `${exampleName} run ${process.env.GITHUB_RUN_NUMBER}`
33
+ : `${exampleName} ${bundle}`);
21
34
 
22
35
  if (!existsSync(distDir)) {
23
36
  console.error('Missing example-app/dist. Run bun run --cwd example-app build first.');
@@ -29,6 +42,8 @@ const args = [
29
42
  'bundle',
30
43
  'upload',
31
44
  ...(appId ? [appId] : []),
45
+ '--bundle',
46
+ bundle,
32
47
  '--path',
33
48
  'dist',
34
49
  '--channel',
@@ -45,7 +60,7 @@ const args = [
45
60
  comment,
46
61
  ];
47
62
 
48
- console.log(`Deploying ${appId ?? 'Pretty Toast example'} to Capgo channel "${channel}"`);
63
+ console.log(`Deploying ${appId ?? exampleName} to Capgo channel "${channel}"`);
49
64
 
50
65
  const result = spawnSync('bunx', args, {
51
66
  cwd: appDir,