@penvhq/launcher 0.12.0 → 0.13.0

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 CHANGED
@@ -1254,27 +1254,39 @@ function chooseEnvironments(answer, offered) {
1254
1254
  }
1255
1255
  return { chosen, unknown };
1256
1256
  }
1257
+ function quoted(environments) {
1258
+ return environments.map((environment) => `\`${environment}\``).join(", ");
1259
+ }
1260
+ function configAdvice(name, pointing, unpointed) {
1261
+ const add2 = `Add \`type: ${JSON.stringify(name)}\``;
1262
+ if (pointing.length === 0) {
1263
+ return `${add2} to an environment in penv.config.ts.`;
1264
+ }
1265
+ return `${quoted(pointing)} already ${pointing.length === 1 ? "points" : "point"} at ${name}. ${add2} to ${quoted(unpointed)} in penv.config.ts if ${unpointed.length === 1 ? "it" : "they"} should too.`;
1266
+ }
1257
1267
  async function offerConfigEdit(options, name, ask) {
1258
1268
  const { io: io2, root } = options;
1259
1269
  const configFile = (0, import_core6.findConfigFile)(root);
1260
- const line = `Add \`type: ${JSON.stringify(name)}\` to an environment in penv.config.ts.`;
1270
+ const blind = `Add \`type: ${JSON.stringify(name)}\` to an environment in penv.config.ts.`;
1261
1271
  if (configFile === void 0) {
1262
- io2.out(line);
1272
+ io2.out(blind);
1263
1273
  return;
1264
1274
  }
1265
1275
  const shown = (0, import_node_path5.relative)(root, configFile).split(import_node_path5.sep).join("/");
1266
1276
  let current = (0, import_node_fs5.readFileSync)(configFile, "utf8");
1267
1277
  const entries = readProviderEntries(current);
1268
1278
  if (entries === void 0 || entries.length === 0) {
1269
- io2.out(line);
1279
+ io2.out(blind);
1270
1280
  return;
1271
1281
  }
1282
+ const pointing = entries.filter((entry) => entry.type === name).map((entry) => entry.environment);
1272
1283
  const offered = entries.filter((entry) => entry.type !== name).map((entry) => entry.environment);
1273
1284
  if (offered.length === 0) {
1274
1285
  return;
1275
1286
  }
1287
+ const advice = configAdvice(name, pointing, offered);
1276
1288
  if (!ask) {
1277
- io2.out(line);
1289
+ io2.out(advice);
1278
1290
  return;
1279
1291
  }
1280
1292
  const { chosen, unknown } = chooseEnvironments(
@@ -1283,7 +1295,7 @@ async function offerConfigEdit(options, name, ask) {
1283
1295
  );
1284
1296
  if (unknown.length > 0) {
1285
1297
  io2.out(`${shown} declares no ${unknown.join(", ")}, so nothing was repointed.`);
1286
- io2.out(line);
1298
+ io2.out(advice);
1287
1299
  return;
1288
1300
  }
1289
1301
  for (const environment of chosen) {
@@ -1507,8 +1519,8 @@ var DEV_PIN_INTEGRITY = "sha512-development-build-not-a-published-release";
1507
1519
  var DEV_PIN_VERSION = "0.0.0-dev";
1508
1520
  var BUNDLED_ENGINE_PIN = {
1509
1521
  package: import_core8.ENGINE_PACKAGE,
1510
- version: "0.12.0",
1511
- integrity: "sha512-9HUylEIbFq0BGTOW54Vxhkzv8AvuB7H3bImTFP5J+dfglkR7udP2KUsr8b0I2mf45YMTQO5xsYpI5+nhLERGtA=="
1522
+ version: "0.13.0",
1523
+ integrity: "sha512-gZ2AlzxmQ4c83OvWSRrBdVMAQdwcGqAoENSv4ZNyZuer0fpIEqiT/xUl2b1+t5JSW8EZto5JpilmBSfiNoWFWA=="
1512
1524
  };
1513
1525
  function assertReleasePin(pin) {
1514
1526
  if (pin.integrity === DEV_PIN_INTEGRITY || pin.version === DEV_PIN_VERSION) {
@@ -1638,7 +1650,10 @@ async function upgrade(options) {
1638
1650
  } catch {
1639
1651
  throw new UpgradeInstallFailedError(plan.manager, release.version);
1640
1652
  }
1641
- for (const step of plan.steps.filter((entry) => !entry.satisfied)) {
1653
+ const moved = plan.steps.filter(
1654
+ (entry) => !entry.satisfied && entry.packages.some((one) => one.name === import_install2.RUNTIME_PACKAGE)
1655
+ );
1656
+ for (const step of moved) {
1642
1657
  io2.out(`\u2713 ${step.manifest} depends on ${import_install2.RUNTIME_PACKAGE} ${release.version}`);
1643
1658
  }
1644
1659
  }