@getmonoceros/workbench 1.9.3 → 1.9.4
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 +16 -11
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -2453,8 +2453,9 @@ function addInstallUrlToDoc(doc, url) {
|
|
|
2453
2453
|
seq.add(url);
|
|
2454
2454
|
return true;
|
|
2455
2455
|
}
|
|
2456
|
-
function addFeatureToDoc(doc, ref, options = {}) {
|
|
2456
|
+
function addFeatureToDoc(doc, ref, options = {}, displayName) {
|
|
2457
2457
|
const seq = ensureSeq(doc, "features");
|
|
2458
|
+
const label = displayName ?? ref;
|
|
2458
2459
|
for (const item of seq.items) {
|
|
2459
2460
|
if (!isMap2(item)) continue;
|
|
2460
2461
|
const itemRef = item.get("ref");
|
|
@@ -2465,7 +2466,7 @@ function addFeatureToDoc(doc, ref, options = {}) {
|
|
|
2465
2466
|
return false;
|
|
2466
2467
|
}
|
|
2467
2468
|
throw new Error(
|
|
2468
|
-
`Feature ${
|
|
2469
|
+
`Feature ${label} is already configured with different options. Remove it first (\`monoceros remove-feature ${label}\`) before re-adding.`
|
|
2469
2470
|
);
|
|
2470
2471
|
}
|
|
2471
2472
|
const entry2 = new YAMLMap2();
|
|
@@ -2855,7 +2856,10 @@ async function runAddFeature(input) {
|
|
|
2855
2856
|
...resolved.defaultOptions,
|
|
2856
2857
|
...input.options ?? {}
|
|
2857
2858
|
};
|
|
2858
|
-
return mutate(
|
|
2859
|
+
return mutate(
|
|
2860
|
+
input,
|
|
2861
|
+
(doc) => addFeatureToDoc(doc, resolved.ref, merged, raw)
|
|
2862
|
+
);
|
|
2859
2863
|
}
|
|
2860
2864
|
async function resolveFeatureRefOrShortname(input) {
|
|
2861
2865
|
if (REGEX.featureRef.test(input)) {
|
|
@@ -2908,14 +2912,15 @@ function runRemoveAptPackages(input) {
|
|
|
2908
2912
|
}
|
|
2909
2913
|
return mutate(input, (doc) => removeAptPackagesFromDoc(doc, input.packages));
|
|
2910
2914
|
}
|
|
2911
|
-
function runRemoveFeature(input) {
|
|
2912
|
-
const
|
|
2913
|
-
if (
|
|
2915
|
+
async function runRemoveFeature(input) {
|
|
2916
|
+
const raw = input.ref.trim();
|
|
2917
|
+
if (raw.length === 0) {
|
|
2914
2918
|
throw new Error(
|
|
2915
|
-
"Missing feature ref. Usage: monoceros remove-feature <containername> <
|
|
2919
|
+
"Missing feature ref. Usage: monoceros remove-feature <containername> <feature>."
|
|
2916
2920
|
);
|
|
2917
2921
|
}
|
|
2918
|
-
|
|
2922
|
+
const resolved = await resolveFeatureRefOrShortname(raw);
|
|
2923
|
+
return mutate(input, (doc) => removeFeatureFromDoc(doc, resolved.ref));
|
|
2919
2924
|
}
|
|
2920
2925
|
function runRemoveFromUrl(input) {
|
|
2921
2926
|
const url = input.url.trim();
|
|
@@ -4428,7 +4433,7 @@ async function persistPromptedIdentity(prompted, ymlPath, home, logger) {
|
|
|
4428
4433
|
}
|
|
4429
4434
|
|
|
4430
4435
|
// src/version.ts
|
|
4431
|
-
var CLI_VERSION = true ? "1.9.
|
|
4436
|
+
var CLI_VERSION = true ? "1.9.4" : "dev";
|
|
4432
4437
|
|
|
4433
4438
|
// src/commands/_dispatch.ts
|
|
4434
4439
|
import { consola as consola12 } from "consola";
|
|
@@ -5947,7 +5952,7 @@ var removeFeatureCommand = defineCommand16({
|
|
|
5947
5952
|
meta: {
|
|
5948
5953
|
name: "remove-feature",
|
|
5949
5954
|
group: "edit",
|
|
5950
|
-
description: "Remove a devcontainer feature from the container config (
|
|
5955
|
+
description: "Remove a devcontainer feature from the container config. Accepts either a Monoceros catalog short-name (e.g. `atlassian`, `claude`) or a full OCI ref. Idempotent, prints a diff before writing."
|
|
5951
5956
|
},
|
|
5952
5957
|
args: {
|
|
5953
5958
|
name: {
|
|
@@ -5957,7 +5962,7 @@ var removeFeatureCommand = defineCommand16({
|
|
|
5957
5962
|
},
|
|
5958
5963
|
ref: {
|
|
5959
5964
|
type: "positional",
|
|
5960
|
-
description: "Feature ref (e.g. ghcr.io/devcontainers/features/docker-in-docker:2).",
|
|
5965
|
+
description: "Feature to remove. Either a Monoceros catalog short-name (e.g. `atlassian`, `atlassian/twg`, `claude` \u2014 see `monoceros list-components`) or a full OCI feature ref (e.g. `ghcr.io/devcontainers/features/docker-in-docker:2`).",
|
|
5961
5966
|
required: true
|
|
5962
5967
|
},
|
|
5963
5968
|
yes: {
|