@devrouter/cli 0.0.41 → 0.0.42

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/devrouter.js CHANGED
@@ -2504,7 +2504,7 @@ function loadRepoConfig(repoPath) {
2504
2504
  const config = parseConfig(parsed ?? {}, configPath);
2505
2505
  const requiredVersion = config.devrouter?.version;
2506
2506
  if (requiredVersion && !hasWarnedVersionMismatch) {
2507
- const cliVersion = true ? "0.0.41" : "0.0.0-dev";
2507
+ const cliVersion = true ? "0.0.42" : "0.0.0-dev";
2508
2508
  if (cliVersion !== "0.0.0-dev" && compareSemver(requiredVersion, cliVersion) > 0) {
2509
2509
  hasWarnedVersionMismatch = true;
2510
2510
  process.stderr.write(
@@ -5195,7 +5195,7 @@ function hasExactComposeIdentity(container, options) {
5195
5195
  const actualFiles = (container.labels["com.docker.compose.project.config_files"] ?? "").split(",").map((file) => file.trim()).filter(Boolean);
5196
5196
  const providerGeneratedFiles = actualFiles.filter((file) => {
5197
5197
  const normalized = file.replaceAll("\\", "/");
5198
- return /\/.devpod\/agent\/contexts\/[^/]+\/workspaces\/[^/]+\/.docker-compose\/docker-compose\.devcontainer\.containerFeatures-[^/]+\.yml$/.test(
5198
+ return /\/(?:\.devpod\/agent\/contexts\/[^/]+\/workspaces\/[^/]+|\.devsy\/contexts\/[^/]+\/workspaces\/[^/]+\/agent)\/\.docker-compose\/docker-compose\.devcontainer\.containerFeatures-[^/]+\.yml$/.test(
5199
5199
  normalized
5200
5200
  );
5201
5201
  });
@@ -6758,6 +6758,16 @@ var init_devpod_workspaces = __esm({
6758
6758
  });
6759
6759
 
6760
6760
  // src/core/devsy-mutation.ts
6761
+ function failedStartMayHaveAttached(devsyId, repoPath) {
6762
+ try {
6763
+ const attached = listDevsyWorkspaces();
6764
+ const attachedId = devsyId ?? selectDevsyWorkspace(attached, repoPath)?.id;
6765
+ if (!attachedId) return false;
6766
+ return inspectDevsyWorkspaceOwnership(attached, attachedId, repoPath).status !== "absent";
6767
+ } catch {
6768
+ return true;
6769
+ }
6770
+ }
6761
6771
  function withMutationLock(activity, target, operation) {
6762
6772
  import_node_fs18.default.mkdirSync(DEVROUTER_HOME, { recursive: true });
6763
6773
  return withFileLockSync(
@@ -6878,7 +6888,11 @@ function startDevsyWorkspace(options) {
6878
6888
  env
6879
6889
  });
6880
6890
  if (result.status !== 0) {
6881
- throw new Error(`devsy workspace up failed for '${devsyId ?? options.repoPath}'.`);
6891
+ const message = `devsy workspace up failed for '${devsyId ?? options.repoPath}'.`;
6892
+ if (failedStartMayHaveAttached(devsyId, options.repoPath)) {
6893
+ throw new DevsyStartPostconditionError(message);
6894
+ }
6895
+ throw new Error(message);
6882
6896
  }
6883
6897
  try {
6884
6898
  const attached = listDevsyWorkspaces();
@@ -6999,17 +7013,25 @@ function deleteOwnedDevpodWorkspace(devpodId, worktreePath) {
6999
7013
  }
7000
7014
  function startDevpodWorkspace(options) {
7001
7015
  if (resolveWorkspaceRuntimeOrDefault(options.repoPath) === "devsy") {
7002
- const result = startDevsyWorkspace({
7003
- repoPath: options.repoPath,
7004
- devsyId: options.devpodId,
7005
- devcontainerPath: options.devcontainerPath,
7006
- recreate: options.recreate,
7007
- quiet: options.quiet,
7008
- workspace: options.workspace,
7009
- inactivityTimeout: readWorkspaceRuntimeConfig().devsyInactivityTimeout
7010
- });
7011
- resetWorkspaceRuntimeCaches();
7012
- return result;
7016
+ try {
7017
+ const result = startDevsyWorkspace({
7018
+ repoPath: options.repoPath,
7019
+ devsyId: options.devpodId,
7020
+ devcontainerPath: options.devcontainerPath,
7021
+ recreate: options.recreate,
7022
+ quiet: options.quiet,
7023
+ workspace: options.workspace,
7024
+ inactivityTimeout: readWorkspaceRuntimeConfig().devsyInactivityTimeout
7025
+ });
7026
+ resetWorkspaceRuntimeCaches();
7027
+ return result;
7028
+ } catch (error) {
7029
+ if (error instanceof DevsyStartPostconditionError) {
7030
+ resetWorkspaceRuntimeCaches();
7031
+ throw new DevpodStartPostconditionError(error.message);
7032
+ }
7033
+ throw error;
7034
+ }
7013
7035
  }
7014
7036
  const activity = options.recreate ? "DevPod recreate" : "DevPod start";
7015
7037
  return withMutationLock2(activity, options.repoPath, () => {
@@ -8005,7 +8027,7 @@ async function buildDoctorReport(options = {}) {
8005
8027
  const config = runtimeConfig.config;
8006
8028
  loadedConfig = config;
8007
8029
  loadedWorkspace = runtimeConfig.workspace;
8008
- const cliVersion = true ? "0.0.41" : "0.0.0-dev";
8030
+ const cliVersion = true ? "0.0.42" : "0.0.0-dev";
8009
8031
  const configVersion = config.devrouter?.version;
8010
8032
  if (configVersion && cliVersion !== "0.0.0-dev" && compareSemver(configVersion, cliVersion) > 0) {
8011
8033
  addCheck(checks, {
@@ -14210,7 +14232,7 @@ var init_version = __esm({
14210
14232
 
14211
14233
  // src/cli.ts
14212
14234
  var import_commander = require("commander");
14213
- var CLI_VERSION = true ? "0.0.41" : "0.0.0-dev";
14235
+ var CLI_VERSION = true ? "0.0.42" : "0.0.0-dev";
14214
14236
  var VERSION_FLAGS = /* @__PURE__ */ new Set(["-V", "--version"]);
14215
14237
  function withErrorHandling(action2) {
14216
14238
  return async (...args) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devrouter/cli",
3
- "version": "0.0.41",
3
+ "version": "0.0.42",
4
4
  "description": "Local dev routing CLI with shared Traefik reverse proxy",
5
5
  "author": "Roland Schlaefli",
6
6
  "homepage": "https://github.com/rschlaefli/devrouter#readme",
@@ -0,0 +1,39 @@
1
+ # Upgrade to devrouter 0.0.42
2
+
3
+ Devrouter now keeps partially started Devsy workspaces recoverable through the
4
+ canonical lifecycle when the provider returns an error after registering or
5
+ starting the exact checkout.
6
+
7
+ 1. Install `@devrouter/cli@0.0.42` on the host and bump `.devrouter.yml` to
8
+ `devrouter.version: 0.0.42`.
9
+ 2. Keep using `devrouter ensure`, `devrouter exec`, and `devrouter stop` for
10
+ managed lifecycle operations. No repository schema, Dev Container, runtime,
11
+ route, data, or volume migration is required.
12
+ 3. If a cold Devsy start fails after provider mutation, do not remove the
13
+ ignored `.devcontainer/devcontainer.devrouter.json`. Run
14
+ `devrouter stop <checkout>`; devrouter now preserves the generated file when
15
+ exact Devsy absence cannot be proved.
16
+ 4. Resolve the reported provider failure, then retry `devrouter ensure` through
17
+ the same canonical lifecycle. Do not switch providers or delete the runtime
18
+ merely to repair a partial start.
19
+
20
+ Verification:
21
+
22
+ - Run `devrouter -V --repo <checkout>` and confirm both the installed CLI and
23
+ local repository report `0.0.42`.
24
+ - Run `devrouter doctor --repo <checkout> --json` and confirm the effective
25
+ workspace runtime and selection source are expected.
26
+ - Run `devrouter ensure <checkout> --json`, then
27
+ `devrouter exec <checkout> -- <representative-command>`.
28
+ - Run `devrouter stop <checkout> --json`, confirm the same exact workspace is
29
+ stopped, and confirm `devrouter ls --json` contains no route for the exact
30
+ checkout.
31
+
32
+ Report template:
33
+
34
+ - CLI/config version: `0.0.42`
35
+ - Effective runtime and source:
36
+ `<devsy/devpod and override/env/path-owner/machine-config/auto-detect/default>`
37
+ - Ensure/exec/route proof: `<passed or details>`
38
+ - Exact non-destructive stop: `<passed or details>`
39
+ - Remaining blockers: `<none or details>`