@penvhq/launcher 0.15.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/bin.cjs +37 -4
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +1 -1
- package/dist/{chunk-PO6FWAPJ.js → chunk-JBOUWGKF.js} +38 -5
- package/dist/chunk-JBOUWGKF.js.map +1 -0
- package/dist/index.cjs +37 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-PO6FWAPJ.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -703,7 +703,7 @@ var UpgradeUnattendedError = class extends import_core.PenvError {
|
|
|
703
703
|
super(
|
|
704
704
|
"PENV_UPGRADE_UNATTENDED",
|
|
705
705
|
`Upgrading rewrites ${import_core.MANIFEST_PATH} and package.json, and this run has nobody to decide that`,
|
|
706
|
-
`Run \`${UPGRADE_COMMAND}
|
|
706
|
+
`Run \`${UPGRADE_COMMAND} ${YES_FLAG}\` to take what \`latest\` points at, or \`${UPGRADE_COMMAND} <version> ${YES_FLAG}\` to name one. In CI, run \`${INSTALL_COMMAND}\`: it installs what the committed manifest already pins.`
|
|
707
707
|
);
|
|
708
708
|
}
|
|
709
709
|
};
|
|
@@ -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.
|
|
1836
|
-
integrity: "sha512
|
|
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) {
|
|
@@ -1931,7 +1931,7 @@ async function upgrade(options) {
|
|
|
1931
1931
|
if (options.noDownload === true) {
|
|
1932
1932
|
throw new UpgradeNoDownloadError();
|
|
1933
1933
|
}
|
|
1934
|
-
if ((options.ci === true || !io.interactive) && !
|
|
1934
|
+
if ((options.ci === true || !io.interactive) && !request.yes) {
|
|
1935
1935
|
throw new UpgradeUnattendedError();
|
|
1936
1936
|
}
|
|
1937
1937
|
const release = await fetchRelease({
|
|
@@ -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) {
|