@lynxship/cli 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/dist/index.js +46 -14
  2. package/package.json +13 -4
package/dist/index.js CHANGED
@@ -490,27 +490,39 @@ async function main() {
490
490
  const autolinkForPlatform = autolink[doctorPlatform];
491
491
  const lockfile = await findLockfile(root);
492
492
  const nodeMajor = Number(process.versions.node.split(".")[0]);
493
+ const nodeSupported = nodeMajor >= 22;
494
+ const nodeRecommended = nodeMajor % 2 === 0;
493
495
  const checks = [
494
496
  {
495
497
  name: "node",
496
- ok: nodeMajor >= 22 && nodeMajor % 2 === 0,
497
- value: nodeMajor >= 22 && nodeMajor % 2 === 0
498
- ? process.version
499
- : `${process.version} · use an even Active/Current LTS line (22, 24 or 26)`,
498
+ ok: nodeSupported,
499
+ status: !nodeSupported
500
+ ? "fail"
501
+ : nodeRecommended
502
+ ? "pass"
503
+ : "warn",
504
+ value: !nodeSupported
505
+ ? `${process.version} · fix: use Node 24 LTS`
506
+ : nodeRecommended
507
+ ? process.version
508
+ : `${process.version} · recommended: Node 24 LTS`,
500
509
  },
501
510
  {
502
511
  name: "package-manager-lockfile",
503
512
  ok: Boolean(lockfile),
504
- value: lockfile ?? "missing",
513
+ status: lockfile ? "pass" : "fail",
514
+ value: lockfile ?? "missing · fix: npm install or pnpm install",
505
515
  },
506
516
  {
507
517
  name: "lynxship.json",
508
- ok: await exists(join(root, "lynxship.json")),
509
- value: config.projectId ? "found" : "missing",
518
+ ok: config.projectId !== undefined,
519
+ status: config.projectId ? "pass" : "fail",
520
+ value: config.projectId ? "found" : "missing · fix: lynxship init",
510
521
  },
511
522
  {
512
523
  name: "cloudflare-r2",
513
524
  ok: configuration.r2,
525
+ status: configuration.r2 ? "pass" : "fail",
514
526
  value: configuration.r2
515
527
  ? "configured"
516
528
  : "run lynxship storage configure",
@@ -520,32 +532,52 @@ async function main() {
520
532
  ok: doctorPlatform === "android"
521
533
  ? configuration.android
522
534
  : process.platform === "darwin" && hasIosHost(root),
535
+ status: (doctorPlatform === "android"
536
+ ? configuration.android
537
+ : process.platform === "darwin" && hasIosHost(root))
538
+ ? "pass"
539
+ : "fail",
523
540
  value: doctorPlatform === "android"
524
541
  ? configuration.android
525
542
  ? "configured"
526
543
  : "run lynxship android configure"
527
544
  : process.platform === "darwin" && hasIosHost(root)
528
545
  ? "Xcode host found"
529
- : "macOS/Xcode host required",
546
+ : "missing · fix: use macOS with Xcode",
530
547
  },
531
548
  {
532
549
  name: `lynx-autolink-${doctorPlatform}`,
533
550
  ok: autolinkForPlatform.ready,
534
- value: autolinkForPlatform.reason,
551
+ status: autolinkForPlatform.ready ? "pass" : "fail",
552
+ value: autolinkForPlatform.ready
553
+ ? autolinkForPlatform.reason
554
+ : `${autolinkForPlatform.reason} · fix: install the native plugin, then run autolink codegen`,
535
555
  },
536
556
  ];
537
- const result = { ok: checks.every((check) => check.ok), checks };
557
+ const result = {
558
+ ok: checks.every((check) => check.status !== "fail"),
559
+ checks,
560
+ };
561
+ const hasWarnings = checks.some((check) => check.status === "warn");
538
562
  if (!result.ok)
539
- ui.warn("One or more environment checks need attention");
563
+ ui.warn("One or more environment checks failed");
564
+ else if (hasWarnings)
565
+ ui.warn("Environment is usable, but one recommendation needs attention");
540
566
  printValue(result, {
541
567
  title: "Doctor result",
542
568
  rows: checks.map((check) => ({
543
569
  label: check.name,
544
- value: `${check.ok ? "pass" : "fail"} · ${check.value}`,
545
- valueColor: check.ok ? "green" : "red",
570
+ value: `${check.status} · ${check.value}`,
571
+ valueColor: check.status === "pass"
572
+ ? "green"
573
+ : check.status === "warn"
574
+ ? "yellow"
575
+ : "red",
546
576
  })),
547
577
  done: result.ok
548
- ? "Environment looks ready."
578
+ ? hasWarnings
579
+ ? "Environment is usable; review the recommendation when convenient."
580
+ : "Environment looks ready."
549
581
  : "Fix the failed checks before building.",
550
582
  });
551
583
  return;
package/package.json CHANGED
@@ -1,9 +1,18 @@
1
1
  {
2
2
  "name": "@lynxship/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Build, sign, store, submit and update LynxJS applications from the terminal.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/p0ulsh3n/lynx-ship.git",
10
+ "directory": "packages/cli"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/p0ulsh3n/lynx-ship/issues"
14
+ },
15
+ "homepage": "https://github.com/p0ulsh3n/lynx-ship/tree/main/packages/cli#readme",
7
16
  "keywords": [
8
17
  "lynxjs",
9
18
  "lynx",
@@ -58,11 +67,11 @@
58
67
  "cli-progress": "3.12.0",
59
68
  "ora": "8.2.0",
60
69
  "qrcode-terminal": "0.12.0",
61
- "@lynxship/signing": "0.1.0",
62
70
  "@lynxship/contracts": "0.1.0",
63
- "@lynxship/db": "0.1.0",
64
71
  "@lynxship/build-orchestrator": "0.1.0",
65
- "@lynxship/submit": "0.1.0"
72
+ "@lynxship/signing": "0.1.0",
73
+ "@lynxship/submit": "0.1.0",
74
+ "@lynxship/db": "0.1.0"
66
75
  },
67
76
  "devDependencies": {
68
77
  "@types/cli-progress": "3.11.6",