dlw-machine-setup 0.12.0 → 0.13.0-canary.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.
Files changed (2) hide show
  1. package/bin/installer.js +19 -3
  2. package/package.json +1 -1
package/bin/installer.js CHANGED
@@ -4560,13 +4560,18 @@ function assertBundleRootExists(ctx) {
4560
4560
  // src/utils/channel.ts
4561
4561
  var import_fs9 = require("fs");
4562
4562
  var import_path9 = require("path");
4563
- function getChannel() {
4563
+ function getInstallerVersion() {
4564
4564
  try {
4565
4565
  const pkgPath = (0, import_path9.join)(__dirname, "..", "package.json");
4566
4566
  const { version } = JSON.parse((0, import_fs9.readFileSync)(pkgPath, "utf-8"));
4567
- if (typeof version === "string" && version.includes("-")) return "test";
4567
+ return typeof version === "string" ? version : null;
4568
4568
  } catch {
4569
+ return null;
4569
4570
  }
4571
+ }
4572
+ function getChannel() {
4573
+ const version = getInstallerVersion();
4574
+ if (version && version.includes("-")) return "test";
4570
4575
  return "prod";
4571
4576
  }
4572
4577
 
@@ -4601,6 +4606,7 @@ var fetch_factory_default = defineStep({
4601
4606
  execute: async (ctx) => {
4602
4607
  const result = await fetchFactory(ctx.token, ctx.factoryRepo, ctx.config.projectPath, ctx.config.agent, ctx.config.agentTeams);
4603
4608
  ctx.installed.factoryInstalled = result.success;
4609
+ ctx.installed.factoryReleaseVersion = result.releaseTag ?? null;
4604
4610
  if (result.instructionsSnippet) {
4605
4611
  ctx.installed.factoryInstructionsSnippet = result.instructionsSnippet;
4606
4612
  }
@@ -4672,6 +4678,7 @@ async function fetchFactory(token, repo, targetDir, agent, agentTeams) {
4672
4678
  result.failureReason = err instanceof Error ? err.message : String(err);
4673
4679
  return result;
4674
4680
  }
4681
+ result.releaseTag = release.tagName;
4675
4682
  const asset = release.assets.find((a) => a.name === FACTORY_ASSET_NAME);
4676
4683
  if (!asset) {
4677
4684
  result.failureReason = `${FACTORY_ASSET_NAME} not found in release`;
@@ -5536,8 +5543,17 @@ var write_state_default = defineStep({
5536
5543
  const target = getAgentTarget(ctx.config.agent);
5537
5544
  const state = {
5538
5545
  installedAt: (/* @__PURE__ */ new Date()).toISOString(),
5539
- installerVersion: package_default.version,
5546
+ /* The PUBLISHED wrapper version (e.g. 0.13.0-canary.1), read at runtime —
5547
+ * the bundled root package.json version is dev metadata and drifts.
5548
+ * The `-` rule on this field is how the factory-update-check hook
5549
+ * detects the install channel. */
5550
+ installerVersion: getInstallerVersion() ?? package_default.version,
5551
+ /* NOTE: releaseVersion is the wizard-options data release, NOT Factory.
5552
+ * Kept under its historical name for backward compatibility. */
5540
5553
  releaseVersion: ctx.config.releaseVersion,
5554
+ /* Factory release actually installed (e.g. v2.32.0-rc.1); null when
5555
+ * Factory wasn't selected. Read by the factory-update-check hook. */
5556
+ factoryReleaseVersion: ctx.installed.factoryReleaseVersion ?? null,
5541
5557
  contextReleaseVersion: ctx.installed.contextReleaseVersion ?? null,
5542
5558
  projectPath: ctx.config.projectPath,
5543
5559
  agent: ctx.config.agent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dlw-machine-setup",
3
- "version": "0.12.0",
3
+ "version": "0.13.0-canary.2",
4
4
  "description": "One-shot installer for The Machine toolchain",
5
5
  "bin": {
6
6
  "dlw-machine-setup": "bin/installer.js"