@penvhq/launcher 0.16.0 → 0.16.1

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
@@ -1832,8 +1832,8 @@ var DEV_PIN_INTEGRITY = "sha512-development-build-not-a-published-release";
1832
1832
  var DEV_PIN_VERSION = "0.0.0-dev";
1833
1833
  var BUNDLED_ENGINE_PIN = {
1834
1834
  package: import_core8.ENGINE_PACKAGE,
1835
- version: "0.16.0",
1836
- integrity: "sha512-DSA07wrSown70tU/9ix9yozJihsQjHFPN3/iXLiH6sS6LYT+/PWBFmVI6C2tH/qaUL2GGh4mgRHL8LGM749C8Q=="
1835
+ version: "0.16.1",
1836
+ integrity: "sha512-ME0JXN5q2DWDPicd/Fvi22PaX51PgS+zdY8mpVwlf9fM3gqLzSJsYJEAd3h4nOYph46kSuE6gH9w/UvwDVmmWw=="
1837
1837
  };
1838
1838
  function assertReleasePin(pin) {
1839
1839
  if (pin.integrity === DEV_PIN_INTEGRITY || pin.version === DEV_PIN_VERSION) {
@@ -2061,6 +2061,38 @@ async function runLauncher(options) {
2061
2061
  return 1;
2062
2062
  }
2063
2063
  }
2064
+ function isBehind(own, pinned) {
2065
+ const parse = (text4) => {
2066
+ const parts = text4.split(".").map((part) => Number(part));
2067
+ return parts.length === 3 && parts.every((part) => Number.isInteger(part) && part >= 0) ? parts : void 0;
2068
+ };
2069
+ const a = parse(own);
2070
+ const b = parse(pinned);
2071
+ if (a === void 0 || b === void 0) {
2072
+ return void 0;
2073
+ }
2074
+ for (const [index, part] of a.entries()) {
2075
+ const other = b[index];
2076
+ if (part !== other) {
2077
+ return part < other;
2078
+ }
2079
+ }
2080
+ return false;
2081
+ }
2082
+ function reportLauncherVersion(options, pinned) {
2083
+ let own;
2084
+ try {
2085
+ own = options.bundledEngine().version;
2086
+ } catch {
2087
+ return;
2088
+ }
2089
+ if (isBehind(own, pinned) !== true) {
2090
+ return;
2091
+ }
2092
+ options.io.out(
2093
+ `launcher ${own} \u2014 \`penv add\` and \`penv upgrade\` run from the launcher, not the pinned engine. Move it with \`npm install -g @penvhq/launcher@${pinned}\`.`
2094
+ );
2095
+ }
2064
2096
  async function launch(options) {
2065
2097
  const { argv, cwd, env, io } = options;
2066
2098
  const { noDownload, forwarded } = splitLauncherFlags(argv);
@@ -2104,6 +2136,7 @@ async function launch(options) {
2104
2136
  const manifest = readManifest(project.manifestFile, home, argv);
2105
2137
  if (first !== void 0 && VERSION_FLAGS.has(first)) {
2106
2138
  io.out(`penv ${manifest.engine.version}`);
2139
+ reportLauncherVersion(options, manifest.engine.version);
2107
2140
  return 0;
2108
2141
  }
2109
2142
  if (first === UPGRADE) {