@lynxship/cli 0.1.10 → 0.1.11

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.
@@ -0,0 +1,3 @@
1
+ export declare function extractDevServerUrl(line: string): string | undefined;
2
+ export declare function shouldPrintDevServerQr(line: string): boolean;
3
+ //# sourceMappingURL=dev-qr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-qr.d.ts","sourceRoot":"","sources":["../src/dev-qr.ts"],"names":[],"mappings":"AAMA,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMpE;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE5D"}
package/dist/dev-qr.js ADDED
@@ -0,0 +1,12 @@
1
+ const URL_PATTERN = /https?:\/\/[^\s<>"'`]+/g;
2
+ function cleanUrl(value) {
3
+ return value.replace(/[),.;!?]+$/u, "");
4
+ }
5
+ export function extractDevServerUrl(line) {
6
+ const urls = (line.match(URL_PATTERN) ?? []).map(cleanUrl);
7
+ return (urls.find((url) => url.includes("fullscreen=true")) ??
8
+ urls.find((url) => url.includes(".lynx.bundle")));
9
+ }
10
+ export function shouldPrintDevServerQr(line) {
11
+ return /(?:default:|fullscreen=true|\bready\b)/iu.test(line);
12
+ }
package/dist/index.js CHANGED
@@ -33,6 +33,7 @@ import { formatDevToolFailure, inspectLynxDevTool } from "./lynx-devtool.js";
33
33
  import { hasHarmonyHost, runRealHarmonyBuild } from "./harmony-build.js";
34
34
  import { hasWebConfiguration, runRealWebBuild } from "./web-build.js";
35
35
  import { hasDesktopHost, runRealDesktopBuild } from "./desktop-build.js";
36
+ import { extractDevServerUrl, shouldPrintDevServerQr } from "./dev-qr.js";
36
37
  import { inspectDesktopTarget, inspectHarmonyTarget, inspectWebTarget, } from "./target-toolchain.js";
37
38
  const rawArgs = process.argv.slice(2);
38
39
  const args = [...rawArgs];
@@ -618,10 +619,34 @@ async function runRspeedyCommand(subcommand, environment) {
618
619
  if (subcommand === "dev") {
619
620
  ui.info("Lynx Explorer mode: no Android or iOS native host is required. Scan the QR code printed by Rspeedy; source changes reload automatically.");
620
621
  }
622
+ let devUrl;
623
+ let devQrPrinted = false;
624
+ let devQrTimer;
625
+ const printDevQr = () => {
626
+ if (!devUrl || devQrPrinted || json || ui.options.quiet)
627
+ return;
628
+ devQrPrinted = true;
629
+ if (devQrTimer)
630
+ clearTimeout(devQrTimer);
631
+ ui.devServerQr(devUrl);
632
+ };
621
633
  await runRspeedy(root, subcommand, forwarded, {
622
634
  env: environment,
623
635
  quiet: json,
624
- onOutput: (line) => ui.info(`│ ${line}`),
636
+ onOutput: (line) => {
637
+ ui.info(`│ ${line}`);
638
+ if (subcommand !== "dev")
639
+ return;
640
+ const url = extractDevServerUrl(line);
641
+ if (url && (!devUrl || url.includes("fullscreen=true"))) {
642
+ devUrl = url;
643
+ if (devQrTimer)
644
+ clearTimeout(devQrTimer);
645
+ devQrTimer = setTimeout(printDevQr, 500);
646
+ }
647
+ if (devUrl && shouldPrintDevServerQr(line))
648
+ printDevQr();
649
+ },
625
650
  });
626
651
  printValue({ status: "success", command: `rspeedy ${subcommand}` }, {
627
652
  title: `Rspeedy ${subcommand}`,
@@ -35,4 +35,5 @@ export declare const pill: {
35
35
  export declare function finalLine(message: string, success?: boolean): void;
36
36
  export declare function nextSteps(commands: string[], note?: string): void;
37
37
  export declare function downloadArtifact(url: string, expiresAt?: string, enabled?: boolean): void;
38
+ export declare function devServerQr(url: string, enabled?: boolean): void;
38
39
  //# sourceMappingURL=components.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/ui/components.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAI7C,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UA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BAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,aAAa,CA2BlE;AAYD,eAAO,MAAM,IAAI;oBACC,MAAM;iBACT,MAAM;iBACN,MAAM;kBACL,MAAM;CACrB,CAAC;AAEF,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,UAAO,GAAG,IAAI,CAE/D;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAOjE;AAED,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,SAAS,CAAC,EAAE,MAAM,EAClB,OAAO,UAAO,GACb,IAAI,CAQN;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,UAAO,GAAG,IAAI,CAK7D"}
@@ -286,3 +286,10 @@ export function downloadArtifact(url, expiresAt, enabled = true) {
286
286
  if (expiresAt)
287
287
  console.log(` ${c.muted(`Link expires at ${expiresAt}`)}`);
288
288
  }
289
+ export function devServerQr(url, enabled = true) {
290
+ if (!enabled)
291
+ return;
292
+ console.log(`\n${c.brandBold("Lynx Explorer")}`);
293
+ qrcode.generate(url, { small: true }, (code) => console.log(code));
294
+ console.log(` ${c.teal("URL")} ${url}\n`);
295
+ }
@@ -19,6 +19,7 @@ export declare class CliUi {
19
19
  spinner(text: string): SpinnerHandle;
20
20
  done(message: string, success?: boolean): void;
21
21
  downloadArtifact(url: string, expiresAt?: string): void;
22
+ devServerQr(url: string): void;
22
23
  }
23
24
  export declare function createCliUi(args: string[]): CliUi;
24
25
  export { terminalOptions };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,MAAM,EACX,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAEL,eAAe,EACf,K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,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC"}
package/dist/ui/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { finalLine, log, sectionHeader, summaryBox, nextSteps, createProgress, spin, downloadArtifact, } from "./components.js";
1
+ import { finalLine, log, sectionHeader, summaryBox, nextSteps, createProgress, spin, downloadArtifact, devServerQr, } from "./components.js";
2
2
  import { printBanner } from "./logo.js";
3
3
  import { setColors } from "./state.js";
4
4
  import { isInteractive, terminalOptions, } from "./terminal.js";
@@ -66,6 +66,9 @@ export class CliUi {
66
66
  downloadArtifact(url, expiresAt) {
67
67
  downloadArtifact(url, expiresAt, this.interactive);
68
68
  }
69
+ devServerQr(url) {
70
+ devServerQr(url, this.interactive && !this.options.quiet);
71
+ }
69
72
  }
70
73
  export function createCliUi(args) {
71
74
  return new CliUi(args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynxship/cli",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Build, sign, store, submit and update LynxJS applications from the terminal.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -68,11 +68,11 @@
68
68
  "cli-progress": "3.12.0",
69
69
  "ora": "8.2.0",
70
70
  "qrcode-terminal": "0.12.0",
71
- "@lynxship/build-orchestrator": "0.1.0",
72
- "@lynxship/submit": "0.1.0",
71
+ "@lynxship/signing": "0.1.0",
73
72
  "@lynxship/db": "0.1.0",
73
+ "@lynxship/build-orchestrator": "0.1.0",
74
74
  "@lynxship/contracts": "0.1.0",
75
- "@lynxship/signing": "0.1.0"
75
+ "@lynxship/submit": "0.1.0"
76
76
  },
77
77
  "devDependencies": {
78
78
  "@types/cli-progress": "3.11.6",