@calo-design/cli 0.12.1 → 0.12.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/bin/mirror-push.js +24 -3
- package/package.json +1 -1
package/bin/mirror-push.js
CHANGED
|
@@ -505,17 +505,38 @@ export function handleLauncherPath(path: string): string | null {
|
|
|
505
505
|
return launcherSlug(path) === null ? null : "/";
|
|
506
506
|
}
|
|
507
507
|
|
|
508
|
+
// A launcher URL can carry a VERSION ref (calo-design checkpoints):
|
|
509
|
+
// "<slug>@g<group8>" — a pinned version; its EAS channel (slug--g<group8>) is
|
|
510
|
+
// derivable right here, no registry needed.
|
|
511
|
+
// "<slug>@<n>" — needs the checkpoints registry to resolve; this bundle can't
|
|
512
|
+
// do that, so bounce to the launcher WITHOUT clearing the URL store — the
|
|
513
|
+
// launcher's own sweep re-reads the ref and resolves it properly.
|
|
514
|
+
function channelForRef(ref: string): { channel: string; viaLauncher: boolean } {
|
|
515
|
+
const g = ref.match(/^([a-z0-9][a-z0-9-]{0,63})@g([0-9a-fA-F]{8})$/);
|
|
516
|
+
if (g) return { channel: g[1] + "--g" + g[2].toLowerCase(), viaLauncher: false };
|
|
517
|
+
if (/^[a-z0-9][a-z0-9-]{0,63}@\\d{1,6}$/.test(ref)) return { channel: "mirror", viaLauncher: true };
|
|
518
|
+
return { channel: ref, viaLauncher: false }; // plain slug — raw channel switch as before
|
|
519
|
+
}
|
|
520
|
+
|
|
508
521
|
// The launcher-URL store is handle-once: after acting on a URL, clear it so a
|
|
509
522
|
// context created later (e.g. by a feed tap, which carries no URL) can't
|
|
510
|
-
// replay it as a phantom switch.
|
|
523
|
+
// replay it as a phantom switch. Exception: a ref we bounce to the launcher
|
|
524
|
+
// stays in the store on purpose — the launcher consumes (and clears) it.
|
|
511
525
|
function sweepLinkingURL(): void {
|
|
512
526
|
let url: string | null = null;
|
|
513
527
|
try { url = ExpoLinking.getLinkingURL() ?? null; } catch { return; }
|
|
514
528
|
if (!url) return;
|
|
515
529
|
const slug = launcherSlug(url);
|
|
516
530
|
if (slug === null) return; // the prototype's own deep link — not ours to touch
|
|
517
|
-
|
|
518
|
-
|
|
531
|
+
if (!slug || slug === PROTOTYPE) {
|
|
532
|
+
try { ExpoLinking.clearInitialURL(); } catch {}
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
const target = channelForRef(slug);
|
|
536
|
+
if (!target.viaLauncher) {
|
|
537
|
+
try { ExpoLinking.clearInitialURL(); } catch {}
|
|
538
|
+
}
|
|
539
|
+
switchToChannel(target.channel);
|
|
519
540
|
}
|
|
520
541
|
|
|
521
542
|
export function subscribeLauncherLinks(): { remove: () => void } {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@calo-design/cli",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"description": "One-line setup for Calo design tooling: logs in with your Calo email and installs the calo-design skill + design-system packages. No GitHub account needed.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"calo-design": "bin/cli.js"
|