@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/bin.cjs
CHANGED
|
@@ -442,7 +442,7 @@ var UpgradeUnattendedError = class extends import_core.PenvError {
|
|
|
442
442
|
super(
|
|
443
443
|
"PENV_UPGRADE_UNATTENDED",
|
|
444
444
|
`Upgrading rewrites ${import_core.MANIFEST_PATH} and package.json, and this run has nobody to decide that`,
|
|
445
|
-
`Run \`${UPGRADE_COMMAND}
|
|
445
|
+
`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.`
|
|
446
446
|
);
|
|
447
447
|
}
|
|
448
448
|
};
|
|
@@ -1732,8 +1732,8 @@ var DEV_PIN_INTEGRITY = "sha512-development-build-not-a-published-release";
|
|
|
1732
1732
|
var DEV_PIN_VERSION = "0.0.0-dev";
|
|
1733
1733
|
var BUNDLED_ENGINE_PIN = {
|
|
1734
1734
|
package: import_core8.ENGINE_PACKAGE,
|
|
1735
|
-
version: "0.
|
|
1736
|
-
integrity: "sha512
|
|
1735
|
+
version: "0.16.1",
|
|
1736
|
+
integrity: "sha512-ME0JXN5q2DWDPicd/Fvi22PaX51PgS+zdY8mpVwlf9fM3gqLzSJsYJEAd3h4nOYph46kSuE6gH9w/UvwDVmmWw=="
|
|
1737
1737
|
};
|
|
1738
1738
|
function assertReleasePin(pin) {
|
|
1739
1739
|
if (pin.integrity === DEV_PIN_INTEGRITY || pin.version === DEV_PIN_VERSION) {
|
|
@@ -1831,7 +1831,7 @@ async function upgrade(options) {
|
|
|
1831
1831
|
if (options.noDownload === true) {
|
|
1832
1832
|
throw new UpgradeNoDownloadError();
|
|
1833
1833
|
}
|
|
1834
|
-
if ((options.ci === true || !io2.interactive) && !
|
|
1834
|
+
if ((options.ci === true || !io2.interactive) && !request.yes) {
|
|
1835
1835
|
throw new UpgradeUnattendedError();
|
|
1836
1836
|
}
|
|
1837
1837
|
const release = await fetchRelease({
|
|
@@ -1961,6 +1961,38 @@ async function runLauncher(options) {
|
|
|
1961
1961
|
return 1;
|
|
1962
1962
|
}
|
|
1963
1963
|
}
|
|
1964
|
+
function isBehind(own, pinned) {
|
|
1965
|
+
const parse = (text4) => {
|
|
1966
|
+
const parts = text4.split(".").map((part) => Number(part));
|
|
1967
|
+
return parts.length === 3 && parts.every((part) => Number.isInteger(part) && part >= 0) ? parts : void 0;
|
|
1968
|
+
};
|
|
1969
|
+
const a = parse(own);
|
|
1970
|
+
const b = parse(pinned);
|
|
1971
|
+
if (a === void 0 || b === void 0) {
|
|
1972
|
+
return void 0;
|
|
1973
|
+
}
|
|
1974
|
+
for (const [index, part] of a.entries()) {
|
|
1975
|
+
const other = b[index];
|
|
1976
|
+
if (part !== other) {
|
|
1977
|
+
return part < other;
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
return false;
|
|
1981
|
+
}
|
|
1982
|
+
function reportLauncherVersion(options, pinned) {
|
|
1983
|
+
let own;
|
|
1984
|
+
try {
|
|
1985
|
+
own = options.bundledEngine().version;
|
|
1986
|
+
} catch {
|
|
1987
|
+
return;
|
|
1988
|
+
}
|
|
1989
|
+
if (isBehind(own, pinned) !== true) {
|
|
1990
|
+
return;
|
|
1991
|
+
}
|
|
1992
|
+
options.io.out(
|
|
1993
|
+
`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}\`.`
|
|
1994
|
+
);
|
|
1995
|
+
}
|
|
1964
1996
|
async function launch(options) {
|
|
1965
1997
|
const { argv, cwd, env, io: io2 } = options;
|
|
1966
1998
|
const { noDownload, forwarded } = splitLauncherFlags(argv);
|
|
@@ -2004,6 +2036,7 @@ async function launch(options) {
|
|
|
2004
2036
|
const manifest = readManifest(project.manifestFile, home, argv);
|
|
2005
2037
|
if (first !== void 0 && VERSION_FLAGS.has(first)) {
|
|
2006
2038
|
io2.out(`penv ${manifest.engine.version}`);
|
|
2039
|
+
reportLauncherVersion(options, manifest.engine.version);
|
|
2007
2040
|
return 0;
|
|
2008
2041
|
}
|
|
2009
2042
|
if (first === UPGRADE) {
|