@limno/core 0.1.6 → 0.1.7

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/dist/index.cjs CHANGED
@@ -561,6 +561,13 @@ function currentVersion() {
561
561
  return "0.0.0";
562
562
  }
563
563
  }
564
+ function installedVersion(fallback) {
565
+ try {
566
+ return JSON.parse((0, import_node_fs2.readFileSync)(require2.resolve("../package.json"), "utf8")).version;
567
+ } catch {
568
+ return fallback;
569
+ }
570
+ }
564
571
  var newer = (a, b) => {
565
572
  const pa = a.split(/[.-]/).map((n) => parseInt(n, 10) || 0);
566
573
  const pb = b.split(/[.-]/).map((n) => parseInt(n, 10) || 0);
@@ -618,12 +625,14 @@ function createUpdater(root) {
618
625
  let installing = null;
619
626
  async function info() {
620
627
  const current = currentVersion();
621
- if (process.env.LIMNO_NO_UPDATE_CHECK) return { current, latest: null, available: false, command: null };
628
+ const installed = installedVersion(current);
629
+ const restart = newer(installed, current);
630
+ if (process.env.LIMNO_NO_UPDATE_CHECK) return { current, installed, restart, latest: null, available: false, command: null };
622
631
  const latest = await latestVersion();
623
632
  const pkgs = listedPackages(root);
624
633
  const [cmd, args] = installArgs(packageManager(root), pkgs);
625
- const available = !!latest && newer(latest, current) && pkgs.length > 0;
626
- return { current, latest, available, command: available ? `${cmd} ${args.join(" ")}` : null };
634
+ const available = !!latest && newer(latest, installed) && pkgs.length > 0;
635
+ return { current, installed, restart, latest, available, command: available ? `${cmd} ${args.join(" ")}` : null };
627
636
  }
628
637
  function install() {
629
638
  if (installing) return installing;
package/dist/index.js CHANGED
@@ -512,6 +512,13 @@ function currentVersion() {
512
512
  return "0.0.0";
513
513
  }
514
514
  }
515
+ function installedVersion(fallback) {
516
+ try {
517
+ return JSON.parse(readFileSync2(require2.resolve("../package.json"), "utf8")).version;
518
+ } catch {
519
+ return fallback;
520
+ }
521
+ }
515
522
  var newer = (a, b) => {
516
523
  const pa = a.split(/[.-]/).map((n) => parseInt(n, 10) || 0);
517
524
  const pb = b.split(/[.-]/).map((n) => parseInt(n, 10) || 0);
@@ -569,12 +576,14 @@ function createUpdater(root) {
569
576
  let installing = null;
570
577
  async function info() {
571
578
  const current = currentVersion();
572
- if (process.env.LIMNO_NO_UPDATE_CHECK) return { current, latest: null, available: false, command: null };
579
+ const installed = installedVersion(current);
580
+ const restart = newer(installed, current);
581
+ if (process.env.LIMNO_NO_UPDATE_CHECK) return { current, installed, restart, latest: null, available: false, command: null };
573
582
  const latest = await latestVersion();
574
583
  const pkgs = listedPackages(root);
575
584
  const [cmd, args] = installArgs(packageManager(root), pkgs);
576
- const available = !!latest && newer(latest, current) && pkgs.length > 0;
577
- return { current, latest, available, command: available ? `${cmd} ${args.join(" ")}` : null };
585
+ const available = !!latest && newer(latest, installed) && pkgs.length > 0;
586
+ return { current, installed, restart, latest, available, command: available ? `${cmd} ${args.join(" ")}` : null };
578
587
  }
579
588
  function install() {
580
589
  if (installing) return installing;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limno/core",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Limno's framework-neutral dev tooling: JSX source stamping, the change-set store and the endpoints the editor talks to.",
5
5
  "license": "FSL-1.1-MIT",
6
6
  "type": "module",
@@ -43,7 +43,7 @@
43
43
  "@babel/parser": "^7.29.0",
44
44
  "@babel/traverse": "^7.29.0",
45
45
  "@limno/mcp": "0.1.2",
46
- "@limno/overlay": "0.1.6",
46
+ "@limno/overlay": "0.1.7",
47
47
  "@limno/spec": "0.1.2",
48
48
  "launch-editor": "^2.14.1",
49
49
  "magic-string": "^0.30.17"