@getmonoceros/workbench 1.37.2 → 1.37.3

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.js CHANGED
@@ -5439,7 +5439,6 @@ var init_yml = __esm({
5439
5439
  // src/modify/index.ts
5440
5440
  import { promises as fs11 } from "fs";
5441
5441
  import { consola as consola2 } from "consola";
5442
- import { createPatch } from "diff";
5443
5442
  import path13 from "path";
5444
5443
  function runAddLanguage(input) {
5445
5444
  const spec = parseLanguageSpec(input.language);
@@ -5672,22 +5671,20 @@ async function tryCloneInRunningContainer(input, entry2) {
5672
5671
  );
5673
5672
  return;
5674
5673
  }
5674
+ let noToken;
5675
5675
  try {
5676
- const { hostTokens } = await resolveContainerRepoTokens(
5676
+ const { hostTokens, missing } = await resolveContainerRepoTokens(
5677
5677
  input.name,
5678
5678
  home,
5679
5679
  await loadComponentCatalog()
5680
5680
  );
5681
- if (hostTokens.get(urlHost)) {
5681
+ noToken = missing.find((m) => m.host === urlHost);
5682
+ if (!noToken) {
5682
5683
  await collectGitCredentials(root, [{ host: urlHost, provider }], {
5683
5684
  patByHost: hostTokens,
5684
5685
  logger: { info: () => {
5685
5686
  }, warn: (m) => logger.warn(m) }
5686
5687
  });
5687
- } else {
5688
- logger.warn(
5689
- `No access token set for ${urlHost} \u2014 cloning will fail if this repo is private. Set one (see ${REPO_DOCS_URL}) and re-run.`
5690
- );
5691
5688
  }
5692
5689
  } catch (err) {
5693
5690
  logger.warn(
@@ -5727,14 +5724,27 @@ async function tryCloneInRunningContainer(input, entry2) {
5727
5724
  return;
5728
5725
  }
5729
5726
  if (exit.exitCode !== 0) {
5730
- logger.warn(
5731
- `In-container clone for ${entry2.url} exited ${exit.exitCode}. The yml is updated; \`monoceros apply ${input.name}\` retries.`
5732
- );
5727
+ if (noToken) {
5728
+ process.stderr.write(
5729
+ `
5730
+ ${formatUnauthenticatedRepos([noToken], input.name)}
5731
+ `
5732
+ );
5733
+ } else {
5734
+ logger.warn(
5735
+ `In-container clone for ${entry2.url} exited ${exit.exitCode}. The yml is updated; \`monoceros apply ${input.name}\` retries.`
5736
+ );
5737
+ }
5733
5738
  return;
5734
5739
  }
5735
5740
  logger.info(
5736
5741
  `Cloned ${entry2.url} into /workspaces/${containerName2}/${targetRel} inside the running container.`
5737
5742
  );
5743
+ if (noToken) {
5744
+ logger.warn(
5745
+ `No token set for ${urlHost}: the clone worked (public), but gh/glab aren't logged in and pushing needs a token. See ${REPO_DOCS_URL}.`
5746
+ );
5747
+ }
5738
5748
  void path13;
5739
5749
  }
5740
5750
  function shquote(value) {
@@ -5970,16 +5980,6 @@ async function mutate(opts, apply) {
5970
5980
  relocateLeakedSectionComments(parsed.doc);
5971
5981
  const newText = stringifyConfig(parsed.doc);
5972
5982
  parseConfig(newText, ymlPath);
5973
- const out = opts.output ?? ((line) => process.stdout.write(line + "\n"));
5974
- out(createPatch(ymlPath, oldText, newText, "before", "after"));
5975
- if (!opts.yes) {
5976
- const confirm = opts.confirm ?? defaultConfirm;
5977
- const ok = await confirm("Apply these changes to the yml?");
5978
- if (!ok) {
5979
- logger.warn("Aborted by user. The yml was not modified.");
5980
- return { status: "aborted" };
5981
- }
5982
- }
5983
5983
  await fs11.writeFile(ymlPath, newText, "utf8");
5984
5984
  logger.success(`Updated ${ymlPath}.`);
5985
5985
  logger.info(
@@ -6049,7 +6049,6 @@ ${lines.join("\n")}`);
6049
6049
  );
6050
6050
  }
6051
6051
  }
6052
- var defaultConfirm;
6053
6052
  var init_modify = __esm({
6054
6053
  "src/modify/index.ts"() {
6055
6054
  "use strict";
@@ -6074,13 +6073,6 @@ var init_modify = __esm({
6074
6073
  init_transform();
6075
6074
  init_briefing();
6076
6075
  init_yml();
6077
- defaultConfirm = async (message) => {
6078
- const result = await consola2.prompt(message, {
6079
- type: "confirm",
6080
- initial: false
6081
- });
6082
- return result === true;
6083
- };
6084
6076
  }
6085
6077
  });
6086
6078
 
@@ -8853,7 +8845,7 @@ var CLI_VERSION;
8853
8845
  var init_version = __esm({
8854
8846
  "src/version.ts"() {
8855
8847
  "use strict";
8856
- CLI_VERSION = true ? "1.37.2" : "dev";
8848
+ CLI_VERSION = true ? "1.37.3" : "dev";
8857
8849
  }
8858
8850
  });
8859
8851