@getmonoceros/workbench 1.16.0 → 1.16.2

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
@@ -1831,6 +1831,8 @@ var init_port_check = __esm({
1831
1831
  });
1832
1832
 
1833
1833
  // src/create/catalog.ts
1834
+ import "fs";
1835
+ import "url";
1834
1836
  function resolveRuntimeImage(version) {
1835
1837
  const ov = process.env.MONOCEROS_BASE_IMAGE_OVERRIDE?.trim();
1836
1838
  if (ov && ov.length > 0) return ov;
@@ -1914,7 +1916,12 @@ var init_catalog = __esm({
1914
1916
  override = process.env.MONOCEROS_BASE_IMAGE_OVERRIDE?.trim();
1915
1917
  BASE_IMAGE = override && override.length > 0 ? override : DEFAULT_BASE_IMAGE;
1916
1918
  RUNTIME_IMAGE_REPO = "ghcr.io/getmonoceros/monoceros-runtime";
1917
- DEFAULT_RUNTIME_VERSION = "1.1.0";
1919
+ DEFAULT_RUNTIME_VERSION = true ? "1.1.0" : readFileSync3(
1920
+ fileURLToPath2(
1921
+ new URL("../../../../images/runtime/VERSION", import.meta.url)
1922
+ ),
1923
+ "utf8"
1924
+ ).trim();
1918
1925
  MIN_RUNTIME_FOR_IDE_VOLUMES = "1.1.0";
1919
1926
  BUILTIN_LANGUAGES = /* @__PURE__ */ new Set(["node"]);
1920
1927
  LANGUAGE_CATALOG = {
@@ -2057,7 +2064,7 @@ var init_service_doc = __esm({
2057
2064
  });
2058
2065
 
2059
2066
  // src/create/scaffold.ts
2060
- import { existsSync as existsSync5, readFileSync as readFileSync3, promises as fs7 } from "fs";
2067
+ import { existsSync as existsSync5, readFileSync as readFileSync4, promises as fs7 } from "fs";
2061
2068
  import path8 from "path";
2062
2069
  function deriveRepoName(url) {
2063
2070
  const lastSep = Math.max(url.lastIndexOf("/"), url.lastIndexOf(":"));
@@ -2219,17 +2226,25 @@ function resolveFeatures(opts) {
2219
2226
  const checkout = workbenchCheckoutRoot();
2220
2227
  const localSourceDir = checkout ? path8.join(checkout, "images", "features", name) : null;
2221
2228
  if (localSourceDir && existsSync5(localSourceDir)) {
2222
- const { paths, files } = readPersistentHomeEntries(localSourceDir);
2229
+ const { paths: paths2, files: files2 } = readPersistentHomeEntries(localSourceDir);
2223
2230
  resolved.push({
2224
2231
  devcontainerKey: `./features/${name}`,
2225
2232
  options,
2226
2233
  localSourceDir,
2227
2234
  localName: name,
2228
- persistentHomePaths: paths,
2229
- persistentHomeFiles: files
2235
+ persistentHomePaths: paths2,
2236
+ persistentHomeFiles: files2
2230
2237
  });
2231
2238
  continue;
2232
2239
  }
2240
+ const { paths, files } = readBundledPersistentHomeEntries(name);
2241
+ resolved.push({
2242
+ devcontainerKey: rawRef,
2243
+ options,
2244
+ persistentHomePaths: paths,
2245
+ persistentHomeFiles: files
2246
+ });
2247
+ continue;
2233
2248
  }
2234
2249
  resolved.push({
2235
2250
  devcontainerKey: rawRef,
@@ -2244,7 +2259,7 @@ function resolveFeatures(opts) {
2244
2259
  function readPersistentHomeEntries(localSourceDir) {
2245
2260
  const manifestPath = path8.join(localSourceDir, "devcontainer-feature.json");
2246
2261
  try {
2247
- const text = readFileSync3(manifestPath, "utf8");
2262
+ const text = readFileSync4(manifestPath, "utf8");
2248
2263
  const parsed = JSON.parse(text);
2249
2264
  return {
2250
2265
  paths: filterSubpaths(parsed["x-monoceros"]?.persistentHomePaths),
@@ -2254,6 +2269,13 @@ function readPersistentHomeEntries(localSourceDir) {
2254
2269
  return { paths: [], files: [] };
2255
2270
  }
2256
2271
  }
2272
+ function readBundledPersistentHomeEntries(name) {
2273
+ try {
2274
+ return readPersistentHomeEntries(path8.join(bundledFeaturesDir(), name));
2275
+ } catch {
2276
+ return { paths: [], files: [] };
2277
+ }
2278
+ }
2257
2279
  function filterSubpaths(raw) {
2258
2280
  if (!Array.isArray(raw)) return [];
2259
2281
  return raw.filter(
@@ -4598,12 +4620,22 @@ var init_apply_progress = __esm({
4598
4620
  FRAME_INTERVAL_MS = 80;
4599
4621
  TAIL_LINES = 15;
4600
4622
  PHASE_TRIGGERS = [
4601
- // Compose mode triggers a feature/layer build before the container
4602
- // is created distinct phase, often the longest single step.
4603
- { pattern: /Start: Run: docker build/i, label: "building feature layers\u2026" },
4604
- // Image mode jumps straight from "preparing…" into the docker run
4605
- // that pulls (if needed) + creates + starts the container.
4606
- { pattern: /Start: Run: docker run/i, label: "starting container\u2026" },
4623
+ // Feature/layer build distinct phase, often the longest single
4624
+ // step. Image mode runs `docker build`; compose mode runs
4625
+ // `docker compose build <services>`. We match the build *subcommand*
4626
+ // (a space-delimited ` build`), NOT the substring the compose `up`
4627
+ // line below carries `-f …devcontainer.build-<n>.yml` and would
4628
+ // otherwise false-match here and swallow the "starting" phase.
4629
+ {
4630
+ pattern: /Start: Run: docker (?:build\b|compose\b.* build\b)/i,
4631
+ label: "building feature layers\u2026"
4632
+ },
4633
+ // Container create/start. Image mode: `docker run` (pulls if needed,
4634
+ // creates, starts). Compose mode: `docker compose … up -d <services>`.
4635
+ {
4636
+ pattern: /Start: Run: docker (?:run\b|compose\b.* up\b)/i,
4637
+ label: "starting container\u2026"
4638
+ },
4607
4639
  { pattern: /Running the postCreateCommand/i, label: "running postCreate\u2026" }
4608
4640
  ];
4609
4641
  }
@@ -5311,13 +5343,13 @@ var init_runtime_pull_hint = __esm({
5311
5343
 
5312
5344
  // src/devcontainer/cli.ts
5313
5345
  import { spawn as spawn4 } from "child_process";
5314
- import { readFileSync as readFileSync4 } from "fs";
5346
+ import { readFileSync as readFileSync5 } from "fs";
5315
5347
  import { createRequire } from "module";
5316
5348
  import path13 from "path";
5317
5349
  function devcontainerCliPath() {
5318
5350
  if (cachedBinaryPath) return cachedBinaryPath;
5319
5351
  const pkgJsonPath = require_.resolve("@devcontainers/cli/package.json");
5320
- const pkg = JSON.parse(readFileSync4(pkgJsonPath, "utf8"));
5352
+ const pkg = JSON.parse(readFileSync5(pkgJsonPath, "utf8"));
5321
5353
  const binEntry = typeof pkg.bin === "string" ? pkg.bin : pkg.bin?.devcontainer ?? "";
5322
5354
  if (!binEntry) {
5323
5355
  throw new Error("Could not resolve @devcontainers/cli bin entry.");
@@ -6255,7 +6287,7 @@ var CLI_VERSION;
6255
6287
  var init_version = __esm({
6256
6288
  "src/version.ts"() {
6257
6289
  "use strict";
6258
- CLI_VERSION = true ? "1.16.0" : "dev";
6290
+ CLI_VERSION = true ? "1.16.2" : "dev";
6259
6291
  }
6260
6292
  });
6261
6293