@getmonoceros/workbench 1.16.2 → 1.17.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/README.md CHANGED
@@ -46,7 +46,7 @@ monoceros completion bash > ~/.bash_completion.d/monoceros # bash
46
46
  ```
47
47
 
48
48
  Full command reference at
49
- [docs/commands/](https://github.com/getmonoceros/workbench/tree/main/docs/commands).
49
+ [getmonoceros.build/docs](https://getmonoceros.build/docs/).
50
50
 
51
51
  ## License
52
52
 
package/dist/bin.js CHANGED
@@ -2191,6 +2191,12 @@ function normalizeOptions(opts) {
2191
2191
  function needsCompose(opts) {
2192
2192
  return opts.services.length > 0;
2193
2193
  }
2194
+ function featuresSourceRoot() {
2195
+ const override2 = process.env.MONOCEROS_FEATURES_DIR_OVERRIDE?.trim();
2196
+ if (override2 && override2.length > 0) return override2;
2197
+ const checkout = workbenchCheckoutRoot();
2198
+ return checkout ? path8.join(checkout, "images", "features") : null;
2199
+ }
2194
2200
  function resolveFeatures(opts) {
2195
2201
  const resolved = [];
2196
2202
  for (const langSpec of opts.languages) {
@@ -2223,8 +2229,8 @@ function resolveFeatures(opts) {
2223
2229
  const match = matchMonocerosFeature(rawRef);
2224
2230
  if (match) {
2225
2231
  const name = match.name;
2226
- const checkout = workbenchCheckoutRoot();
2227
- const localSourceDir = checkout ? path8.join(checkout, "images", "features", name) : null;
2232
+ const sourceRoot = featuresSourceRoot();
2233
+ const localSourceDir = sourceRoot ? path8.join(sourceRoot, name) : null;
2228
2234
  if (localSourceDir && existsSync5(localSourceDir)) {
2229
2235
  const { paths: paths2, files: files2 } = readPersistentHomeEntries(localSourceDir);
2230
2236
  resolved.push({
@@ -6287,7 +6293,7 @@ var CLI_VERSION;
6287
6293
  var init_version = __esm({
6288
6294
  "src/version.ts"() {
6289
6295
  "use strict";
6290
- CLI_VERSION = true ? "1.16.2" : "dev";
6296
+ CLI_VERSION = true ? "1.17.1" : "dev";
6291
6297
  }
6292
6298
  });
6293
6299
 
@@ -6449,8 +6455,8 @@ var init_completion = __esm({
6449
6455
  name: "completion",
6450
6456
  group: "tooling",
6451
6457
  // Hidden from `monoceros --help`: the install scripts wire up
6452
- // completion automatically; manual setup is documented in
6453
- // docs/commands/completion.md. Still runnable directly.
6458
+ // completion automatically; manual setup is documented at
6459
+ // getmonoceros.build/docs/reference/utilities/completion. Still runnable directly.
6454
6460
  hidden: true,
6455
6461
  description: "Print a shell completion script for bash, zsh or PowerShell to stdout. Pipe the output into a file your shell loads at startup. The install scripts (install.sh / install.ps1) call this automatically."
6456
6462
  },
@@ -6545,6 +6551,7 @@ function dispatchCommand(spec, argTokens, ctx) {
6545
6551
  if (inPostDash && spec.innerArgs) {
6546
6552
  return resolveValues(spec.innerArgs, ctx, ctx.current);
6547
6553
  }
6554
+ if (inPostDash) return [];
6548
6555
  return resolvePreDash(spec, preDash, ctx);
6549
6556
  }
6550
6557
  async function resolvePreDash(spec, preDash, ctx) {
@@ -6771,7 +6778,10 @@ var init_resolve = __esm({
6771
6778
  }
6772
6779
  },
6773
6780
  shell: { positionals: [containerName] },
6774
- run: { positionals: [containerName] },
6781
+ run: {
6782
+ positionals: [containerName],
6783
+ flags: { "--in": { type: "value" } }
6784
+ },
6775
6785
  logs: { positionals: [containerName] },
6776
6786
  start: { positionals: [containerName] },
6777
6787
  stop: { positionals: [containerName] },
@@ -8605,13 +8615,21 @@ async function runInContainer(opts) {
8605
8615
  { quiet: true }
8606
8616
  );
8607
8617
  if (upCode !== 0) return upCode;
8618
+ const innerExec = opts.cwd ? [
8619
+ "bash",
8620
+ "-lc",
8621
+ 'cd -- "$1" && shift && exec "$@"',
8622
+ "bash",
8623
+ opts.cwd,
8624
+ ...opts.command
8625
+ ] : opts.command;
8608
8626
  return spawnFn(
8609
8627
  [
8610
8628
  "exec",
8611
8629
  "--workspace-folder",
8612
8630
  opts.root,
8613
8631
  "--mount-workspace-git-root=false",
8614
- ...opts.command
8632
+ ...innerExec
8615
8633
  ],
8616
8634
  opts.root,
8617
8635
  { interactive: true }
@@ -8646,6 +8664,10 @@ var init_run2 = __esm({
8646
8664
  type: "positional",
8647
8665
  description: "Container name (yml in $MONOCEROS_HOME/container-configs/).",
8648
8666
  required: true
8667
+ },
8668
+ in: {
8669
+ type: "string",
8670
+ description: "Run the inner command in this directory inside the container (relative to the workspace folder, or absolute). The directory must already exist."
8649
8671
  }
8650
8672
  },
8651
8673
  async run({ args }) {
@@ -8659,7 +8681,8 @@ var init_run2 = __esm({
8659
8681
  try {
8660
8682
  const exitCode = await runInContainer({
8661
8683
  root: containerDir(args.name),
8662
- command
8684
+ command,
8685
+ ...args.in ? { cwd: args.in } : {}
8663
8686
  });
8664
8687
  process.exit(exitCode);
8665
8688
  } catch (err) {