@savvy-web/silk 1.3.11 → 2.0.0

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.
@@ -4748,7 +4748,9 @@ declare class Categories {
4748
4748
  */
4749
4749
  static isValidHeading(heading: string): boolean;
4750
4750
  } //#endregion
4751
- //#region ../../node_modules/.pnpm/@changesets+types@6.1.0/node_modules/@changesets/types/dist/declarations/src/index.d.ts
4751
+ //#region ../../node_modules/.pnpm/@changesets+types@7.0.0-next.6/node_modules/@changesets/types/dist/index.d.mts
4752
+ //#region src/index.d.ts
4753
+ type MaybePromise<T> = T | Promise<T>;
4752
4754
  type VersionType$1 = "major" | "minor" | "patch" | "none";
4753
4755
  type AccessType = "public" | "restricted";
4754
4756
  type Release = {
@@ -4797,6 +4799,7 @@ type PackageJSON = {
4797
4799
  access?: AccessType;
4798
4800
  directory?: string;
4799
4801
  registry?: string;
4802
+ [registry: `${string}:registry`]: string;
4800
4803
  };
4801
4804
  };
4802
4805
  type PackageGroup = ReadonlyArray<string>;
@@ -4807,19 +4810,23 @@ interface PrivatePackages {
4807
4810
  tag: boolean;
4808
4811
  }
4809
4812
  type Config = {
4810
- changelog: false | readonly [string, any];
4811
- commit: false | readonly [string, any];
4813
+ changelog: false | readonly [string, null | Record<string, unknown>];
4814
+ commit: false | readonly [string, null | Record<string, unknown>];
4812
4815
  fixed: Fixed;
4813
4816
  linked: Linked;
4814
4817
  access: AccessType;
4815
4818
  baseBranch: string;
4816
- changedFilePatterns: readonly string[]; /** When false, Changesets won't format with Prettier */
4817
- prettier: boolean; /** Features enabled for Private packages */
4819
+ changedFilePatterns: readonly string[];
4820
+ /**
4821
+ * The formatter to use to format changesets and changelogs. Set `false` to disable formatting.
4822
+ * The default value of `"auto"` will auto-detect the formatter based on the project's configuration files.
4823
+ */
4824
+ format: "auto" | "prettier" | "oxfmt" | "deno" | "dprint" | false; /** Features enabled for Private packages */
4818
4825
  privatePackages: PrivatePackages; /** The minimum bump type to trigger automatic update of internal dependencies that are part of the same release */
4819
4826
  updateInternalDependencies: "patch" | "minor";
4820
4827
  ignore: ReadonlyArray<string>; /** This is supposed to be used with pnpm's `link-workspace-packages: false` and Berry's `enableTransparentWorkspaces: false` */
4821
4828
  bumpVersionsWithWorkspaceProtocolOnly?: boolean;
4822
- ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: Omit<Required<ExperimentalOptions>, "useCalculatedVersionForSnapshots">;
4829
+ ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: Required<ExperimentalOptions>;
4823
4830
  snapshot: {
4824
4831
  useCalculatedVersion: boolean;
4825
4832
  prereleaseTemplate: string | null;
@@ -4827,8 +4834,7 @@ type Config = {
4827
4834
  };
4828
4835
  type ExperimentalOptions = {
4829
4836
  onlyUpdatePeerDependentsWhenOutOfRange?: boolean;
4830
- updateInternalDependents?: "always" | "out-of-range"; /** @deprecated Since snapshot feature is now stable, you should migrate to use "snapshot.useCalculatedVersion". */
4831
- useCalculatedVersionForSnapshots?: boolean;
4837
+ updateInternalDependents?: "always" | "out-of-range";
4832
4838
  };
4833
4839
  type NewChangesetWithCommit = NewChangeset & {
4834
4840
  commit?: string;
@@ -4837,8 +4843,8 @@ type ModCompWithPackage = ComprehensiveRelease & {
4837
4843
  packageJson: PackageJSON;
4838
4844
  dir: string;
4839
4845
  };
4840
- type GetReleaseLine = (changeset: NewChangesetWithCommit, type: VersionType$1, changelogOpts: null | Record<string, any>) => Promise<string>;
4841
- type GetDependencyReleaseLine = (changesets: NewChangesetWithCommit[], dependenciesUpdated: ModCompWithPackage[], changelogOpts: any) => Promise<string>;
4846
+ type GetReleaseLine = (changeset: NewChangesetWithCommit, type: VersionType$1, changelogOpts: null | Record<string, unknown>) => MaybePromise<string>;
4847
+ type GetDependencyReleaseLine = (changesets: NewChangesetWithCommit[], dependenciesUpdated: ModCompWithPackage[], changelogOpts: null | Record<string, unknown>) => MaybePromise<string>;
4842
4848
  type ChangelogFunctions = {
4843
4849
  getReleaseLine: GetReleaseLine;
4844
4850
  getDependencyReleaseLine: GetDependencyReleaseLine;
@@ -4846,9 +4852,6 @@ type ChangelogFunctions = {
4846
4852
  type PreState = {
4847
4853
  mode: "pre" | "exit";
4848
4854
  tag: string;
4849
- initialVersions: {
4850
- [pkgName: string]: string;
4851
- };
4852
4855
  changesets: string[];
4853
4856
  }; //#endregion
4854
4857
  //#region src/changesets/api/changelog.d.ts
@@ -7143,7 +7146,7 @@ declare class ChangesetConfigError extends ChangesetConfigError_base<{
7143
7146
  } //#endregion
7144
7147
  //#region src/schemas/VersioningSchemas.d.ts
7145
7148
  /**
7146
- * Standard changesets configuration matching the `@changesets/config@3.1.1` spec.
7149
+ * Standard changesets configuration matching the `@changesets/config@4.0.0-next.6` spec.
7147
7150
  *
7148
7151
  * @remarks
7149
7152
  * Represents the parsed `.changeset/config.json` file. All fields are optional
@@ -8369,6 +8372,13 @@ interface ReleasePlannerShape {
8369
8372
  /** Natively apply the release (destructive unless `dryRun`). */
8370
8373
  readonly apply: (root: string, options?: {
8371
8374
  readonly dryRun?: boolean;
8375
+ /**
8376
+ * Map configured changelog ids to absolute module paths. When set,
8377
+ * `config.changelog[0]` must be a key of this map (rewritten before the
8378
+ * engine call; unmapped ids fail) and the engine's `format` integration
8379
+ * is disabled — callers in no-`node_modules` contexts own formatting.
8380
+ */
8381
+ readonly changelogModules?: Readonly<Record<string, string>>;
8372
8382
  }) => Effect.Effect<AppliedRelease, ReleasePlanError>;
8373
8383
  }
8374
8384
  /**
@@ -4748,7 +4748,9 @@ declare class Categories {
4748
4748
  */
4749
4749
  static isValidHeading(heading: string): boolean;
4750
4750
  } //#endregion
4751
- //#region ../../node_modules/.pnpm/@changesets+types@6.1.0/node_modules/@changesets/types/dist/declarations/src/index.d.ts
4751
+ //#region ../../node_modules/.pnpm/@changesets+types@7.0.0-next.6/node_modules/@changesets/types/dist/index.d.mts
4752
+ //#region src/index.d.ts
4753
+ type MaybePromise<T> = T | Promise<T>;
4752
4754
  type VersionType$1 = "major" | "minor" | "patch" | "none";
4753
4755
  type AccessType = "public" | "restricted";
4754
4756
  type Release = {
@@ -4797,6 +4799,7 @@ type PackageJSON = {
4797
4799
  access?: AccessType;
4798
4800
  directory?: string;
4799
4801
  registry?: string;
4802
+ [registry: `${string}:registry`]: string;
4800
4803
  };
4801
4804
  };
4802
4805
  type PackageGroup = ReadonlyArray<string>;
@@ -4807,19 +4810,23 @@ interface PrivatePackages {
4807
4810
  tag: boolean;
4808
4811
  }
4809
4812
  type Config = {
4810
- changelog: false | readonly [string, any];
4811
- commit: false | readonly [string, any];
4813
+ changelog: false | readonly [string, null | Record<string, unknown>];
4814
+ commit: false | readonly [string, null | Record<string, unknown>];
4812
4815
  fixed: Fixed;
4813
4816
  linked: Linked;
4814
4817
  access: AccessType;
4815
4818
  baseBranch: string;
4816
- changedFilePatterns: readonly string[]; /** When false, Changesets won't format with Prettier */
4817
- prettier: boolean; /** Features enabled for Private packages */
4819
+ changedFilePatterns: readonly string[];
4820
+ /**
4821
+ * The formatter to use to format changesets and changelogs. Set `false` to disable formatting.
4822
+ * The default value of `"auto"` will auto-detect the formatter based on the project's configuration files.
4823
+ */
4824
+ format: "auto" | "prettier" | "oxfmt" | "deno" | "dprint" | false; /** Features enabled for Private packages */
4818
4825
  privatePackages: PrivatePackages; /** The minimum bump type to trigger automatic update of internal dependencies that are part of the same release */
4819
4826
  updateInternalDependencies: "patch" | "minor";
4820
4827
  ignore: ReadonlyArray<string>; /** This is supposed to be used with pnpm's `link-workspace-packages: false` and Berry's `enableTransparentWorkspaces: false` */
4821
4828
  bumpVersionsWithWorkspaceProtocolOnly?: boolean;
4822
- ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: Omit<Required<ExperimentalOptions>, "useCalculatedVersionForSnapshots">;
4829
+ ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: Required<ExperimentalOptions>;
4823
4830
  snapshot: {
4824
4831
  useCalculatedVersion: boolean;
4825
4832
  prereleaseTemplate: string | null;
@@ -4827,8 +4834,7 @@ type Config = {
4827
4834
  };
4828
4835
  type ExperimentalOptions = {
4829
4836
  onlyUpdatePeerDependentsWhenOutOfRange?: boolean;
4830
- updateInternalDependents?: "always" | "out-of-range"; /** @deprecated Since snapshot feature is now stable, you should migrate to use "snapshot.useCalculatedVersion". */
4831
- useCalculatedVersionForSnapshots?: boolean;
4837
+ updateInternalDependents?: "always" | "out-of-range";
4832
4838
  };
4833
4839
  type NewChangesetWithCommit = NewChangeset & {
4834
4840
  commit?: string;
@@ -4837,8 +4843,8 @@ type ModCompWithPackage = ComprehensiveRelease & {
4837
4843
  packageJson: PackageJSON;
4838
4844
  dir: string;
4839
4845
  };
4840
- type GetReleaseLine = (changeset: NewChangesetWithCommit, type: VersionType$1, changelogOpts: null | Record<string, any>) => Promise<string>;
4841
- type GetDependencyReleaseLine = (changesets: NewChangesetWithCommit[], dependenciesUpdated: ModCompWithPackage[], changelogOpts: any) => Promise<string>;
4846
+ type GetReleaseLine = (changeset: NewChangesetWithCommit, type: VersionType$1, changelogOpts: null | Record<string, unknown>) => MaybePromise<string>;
4847
+ type GetDependencyReleaseLine = (changesets: NewChangesetWithCommit[], dependenciesUpdated: ModCompWithPackage[], changelogOpts: null | Record<string, unknown>) => MaybePromise<string>;
4842
4848
  type ChangelogFunctions = {
4843
4849
  getReleaseLine: GetReleaseLine;
4844
4850
  getDependencyReleaseLine: GetDependencyReleaseLine;
@@ -4846,9 +4852,6 @@ type ChangelogFunctions = {
4846
4852
  type PreState = {
4847
4853
  mode: "pre" | "exit";
4848
4854
  tag: string;
4849
- initialVersions: {
4850
- [pkgName: string]: string;
4851
- };
4852
4855
  changesets: string[];
4853
4856
  }; //#endregion
4854
4857
  //#region src/changesets/api/changelog.d.ts
@@ -7143,7 +7146,7 @@ declare class ChangesetConfigError extends ChangesetConfigError_base<{
7143
7146
  } //#endregion
7144
7147
  //#region src/schemas/VersioningSchemas.d.ts
7145
7148
  /**
7146
- * Standard changesets configuration matching the `@changesets/config@3.1.1` spec.
7149
+ * Standard changesets configuration matching the `@changesets/config@4.0.0-next.6` spec.
7147
7150
  *
7148
7151
  * @remarks
7149
7152
  * Represents the parsed `.changeset/config.json` file. All fields are optional
@@ -8369,6 +8372,13 @@ interface ReleasePlannerShape {
8369
8372
  /** Natively apply the release (destructive unless `dryRun`). */
8370
8373
  readonly apply: (root: string, options?: {
8371
8374
  readonly dryRun?: boolean;
8375
+ /**
8376
+ * Map configured changelog ids to absolute module paths. When set,
8377
+ * `config.changelog[0]` must be a key of this map (rewritten before the
8378
+ * engine call; unmapped ids fail) and the engine's `format` integration
8379
+ * is disabled — callers in no-`node_modules` contexts own formatting.
8380
+ */
8381
+ readonly changelogModules?: Readonly<Record<string, string>>;
8372
8382
  }) => Effect.Effect<AppliedRelease, ReleasePlanError>;
8373
8383
  }
8374
8384
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@savvy-web/silk",
3
- "version": "1.3.11",
3
+ "version": "2.0.0",
4
4
  "private": false,
5
5
  "description": "The single Silk Suite dev-tooling package — changeset, commitlint, lint, and biome conventions",
6
6
  "homepage": "https://github.com/savvy-web/systems/tree/main/packages/silk",
@@ -66,17 +66,17 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@effect/platform": "^0.96.2",
69
- "@savvy-web/silk-effects": "2.1.0",
69
+ "@savvy-web/silk-effects": "3.0.0",
70
70
  "effect": "^3.21.4",
71
71
  "semver": "^7.8.5"
72
72
  },
73
73
  "peerDependencies": {
74
74
  "@biomejs/biome": "~2.5.0",
75
- "@changesets/cli": "^2.31.0",
75
+ "@changesets/cli": "^3.0.0-next.8",
76
76
  "@commitlint/cli": "^21.2.0",
77
77
  "@commitlint/config-conventional": "^21.2.0",
78
- "@savvy-web/cli": "1.4.3",
79
- "@savvy-web/mcp": "1.6.3",
78
+ "@savvy-web/cli": "1.4.4",
79
+ "@savvy-web/mcp": "1.6.4",
80
80
  "@types/node": "^26.1.0",
81
81
  "@typescript/native-preview": "^7.0.0-dev.20260612.1",
82
82
  "commitizen": "^4.3.2",
@@ -106,7 +106,7 @@ var Changelog = class {
106
106
  * Pass `null` to use defaults (no GitHub link resolution).
107
107
  * @returns A promise resolving to the formatted markdown string
108
108
  */
109
- static formatReleaseLine(changeset, versionType, options) {
109
+ static async formatReleaseLine(changeset, versionType, options) {
110
110
  return require_index.default.getReleaseLine(changeset, versionType, options);
111
111
  }
112
112
  /**
@@ -125,7 +125,7 @@ var Changelog = class {
125
125
  * @returns A promise resolving to the formatted markdown string containing
126
126
  * the dependency update table
127
127
  */
128
- static formatDependencyReleaseLine(changesets, dependenciesUpdated, options) {
128
+ static async formatDependencyReleaseLine(changesets, dependenciesUpdated, options) {
129
129
  return require_index.default.getDependencyReleaseLine(changesets, dependenciesUpdated, options);
130
130
  }
131
131
  };
@@ -106,7 +106,7 @@ var Changelog = class {
106
106
  * Pass `null` to use defaults (no GitHub link resolution).
107
107
  * @returns A promise resolving to the formatted markdown string
108
108
  */
109
- static formatReleaseLine(changeset, versionType, options) {
109
+ static async formatReleaseLine(changeset, versionType, options) {
110
110
  return changelogFunctions.getReleaseLine(changeset, versionType, options);
111
111
  }
112
112
  /**
@@ -125,7 +125,7 @@ var Changelog = class {
125
125
  * @returns A promise resolving to the formatted markdown string containing
126
126
  * the dependency update table
127
127
  */
128
- static formatDependencyReleaseLine(changesets, dependenciesUpdated, options) {
128
+ static async formatDependencyReleaseLine(changesets, dependenciesUpdated, options) {
129
129
  return changelogFunctions.getDependencyReleaseLine(changesets, dependenciesUpdated, options);
130
130
  }
131
131
  };
@@ -3,10 +3,10 @@ const require_transformer = require('../api/transformer.cjs');
3
3
  const require_config_inspector = require('./config-inspector.cjs');
4
4
  const require_maintenance_reason = require('./maintenance-reason.cjs');
5
5
  const require_version_files = require('../utils/version-files.cjs');
6
- const require_changesets_config_esm = require('../../../../../../../node_modules/.pnpm/@changesets_config@3.1.4/node_modules/@changesets/config/dist/changesets-config.esm.cjs');
7
- const require_changesets_apply_release_plan_esm = require('../../../../../../../node_modules/.pnpm/@changesets_apply-release-plan@7.1.1/node_modules/@changesets/apply-release-plan/dist/changesets-apply-release-plan.esm.cjs');
8
- const require_changesets_get_release_plan_esm = require('../../../../../../../node_modules/.pnpm/@changesets_get-release-plan@4.0.16/node_modules/@changesets/get-release-plan/dist/changesets-get-release-plan.esm.cjs');
9
6
  const require_manypkg_get_packages = require('../../../../../../../node_modules/.pnpm/@manypkg_get-packages@3.1.0/node_modules/@manypkg/get-packages/dist/manypkg-get-packages.cjs');
7
+ const require_index = require('../../../../../../../node_modules/.pnpm/@changesets_config@4.0.0-next.6/node_modules/@changesets/config/dist/index.cjs');
8
+ const require_index$1 = require('../../../../../../../node_modules/.pnpm/@changesets_apply-release-plan@8.0.0-next.7/node_modules/@changesets/apply-release-plan/dist/index.cjs');
9
+ const require_index$2 = require('../../../../../../../node_modules/.pnpm/@changesets_get-release-plan@5.0.0-next.7/node_modules/@changesets/get-release-plan/dist/index.cjs');
10
10
  let effect = require("effect");
11
11
  let _effect_platform = require("@effect/platform");
12
12
  let node_path = require("node:path");
@@ -24,37 +24,21 @@ let node_path = require("node:path");
24
24
  * (e.g. `getChangelogEntry`) is re-implemented.
25
25
  *
26
26
  */
27
- const V1_TOOLS = /* @__PURE__ */ new Set([
28
- "yarn",
29
- "bolt",
30
- "pnpm",
31
- "lerna",
32
- "root"
33
- ]);
27
+ const errMsg = (e) => e instanceof Error ? e.message : String(e);
34
28
  /**
35
- * Single workspace-discovery seam; swap to an Effect-native stack later here.
36
- *
37
- * Discovers with `@manypkg/get-packages@3.x` and adapts to the v1 shape:
38
- * `tool` collapses to its type string (tools unknown to v1 map to `"root"` —
39
- * the engine never reads `tool` at runtime, only `root.dir`), and
40
- * `rootDir`/`rootPackage` fold back into `root`.
29
+ * Read the changesets config, surfacing non-throwing `readConfig` errors as a
30
+ * thrown `Error` so callers inside `Effect.tryPromise` land on the existing
31
+ * `ReleasePlanError` mapping. Warnings are returned alongside the config so
32
+ * the caller can log them via the Effect runtime rather than console output.
41
33
  */
42
- const buildPackages = async (root) => {
43
- const { tool, rootDir, rootPackage, packages } = await require_manypkg_get_packages.getPackages(root);
44
- if (!rootPackage) throw new Error(`Workspace root has no package.json: ${rootDir}`);
34
+ async function loadConfig(root, packages) {
35
+ const configResult = await require_index.readConfig(root, packages);
36
+ if (configResult.config === void 0) throw new Error(`Invalid changeset config:\n${configResult.errors.join("\n")}`);
45
37
  return {
46
- tool: V1_TOOLS.has(tool.type) ? tool.type : "root",
47
- root: {
48
- dir: rootPackage.dir,
49
- packageJson: rootPackage.packageJson
50
- },
51
- packages: packages.map((p) => ({
52
- dir: p.dir,
53
- packageJson: p.packageJson
54
- }))
38
+ config: configResult.config,
39
+ warnings: configResult.warnings
55
40
  };
56
- };
57
- const errMsg = (e) => e instanceof Error ? e.message : String(e);
41
+ }
58
42
  /**
59
43
  * Base class for {@link ReleasePlanner}.
60
44
  *
@@ -67,14 +51,14 @@ var ReleasePlanner = class extends ReleasePlannerBase {};
67
51
  /** Build the service shape over a resolved {@link ConfigInspector} and {@link FileSystem.FileSystem}. */
68
52
  function makeShape(inspector, fs) {
69
53
  const plan = (root) => effect.Effect.tryPromise({
70
- try: () => require_changesets_get_release_plan_esm.default(root),
54
+ try: () => require_index$2.getReleasePlan(root),
71
55
  catch: (e) => new require_errors.ReleasePlanError({
72
56
  phase: "plan",
73
57
  reason: errMsg(e)
74
58
  })
75
59
  });
76
60
  const preview = (root) => previewEffect(root, fs);
77
- const apply = (root, options) => applyEffect(root, options?.dryRun ?? false, inspector, fs);
61
+ const apply = (root, options) => applyEffect(root, options?.dryRun ?? false, options?.changelogModules, inspector, fs);
78
62
  return {
79
63
  plan,
80
64
  preview,
@@ -132,19 +116,25 @@ function maintenanceReasons(plan, config) {
132
116
  function previewEffect(root, fs) {
133
117
  const program = effect.Effect.gen(function* () {
134
118
  const [plan, packages] = yield* effect.Effect.tryPromise({
135
- try: () => Promise.all([require_changesets_get_release_plan_esm.default(root), buildPackages(root)]),
119
+ try: () => Promise.all([require_index$2.getReleasePlan(root), require_manypkg_get_packages.getPackages(root)]),
136
120
  catch: (e) => new require_errors.ReleasePlanError({
137
121
  phase: "preview",
138
122
  reason: errMsg(e)
139
123
  })
140
124
  });
141
- const config = yield* effect.Effect.tryPromise({
142
- try: () => require_changesets_config_esm.read(root, packages),
125
+ if (!packages.rootPackage) return yield* effect.Effect.fail(new require_errors.ReleasePlanError({
126
+ phase: "preview",
127
+ reason: `Workspace root has no package.json: ${root}`
128
+ }));
129
+ const rootPackage = packages.rootPackage;
130
+ const { config, warnings } = yield* effect.Effect.tryPromise({
131
+ try: () => loadConfig(root, packages),
143
132
  catch: (e) => new require_errors.ReleasePlanError({
144
133
  phase: "preview",
145
134
  reason: errMsg(e)
146
135
  })
147
136
  });
137
+ yield* effect.Effect.forEach(warnings, (w) => effect.Effect.logWarning(w));
148
138
  const reasonByName = maintenanceReasons(plan, config);
149
139
  const preMode = plan.preState ? plan.preState.mode : null;
150
140
  const changesets = plan.changesets.map((cs) => ({
@@ -163,7 +153,7 @@ function previewEffect(root, fs) {
163
153
  };
164
154
  const tempRoot = yield* fs.makeTempDirectoryScoped({ prefix: "silk-preview-" });
165
155
  const mapDir = (dir) => {
166
- const rel = (0, node_path.relative)(packages.root.dir, dir);
156
+ const rel = (0, node_path.relative)(packages.rootDir, dir);
167
157
  if (rel.startsWith("..") || (0, node_path.isAbsolute)(rel)) return effect.Effect.fail(new require_errors.ReleasePlanError({
168
158
  phase: "preview",
169
159
  reason: `Package directory is outside the workspace root: ${dir}`
@@ -173,13 +163,12 @@ function previewEffect(root, fs) {
173
163
  const tempDirs = yield* effect.Effect.forEach(packages.packages, (p) => mapDir(p.dir));
174
164
  const tempPackages = {
175
165
  tool: packages.tool,
176
- root: {
177
- ...packages.root,
166
+ rootDir: tempRoot,
167
+ rootPackage: {
178
168
  dir: tempRoot,
179
- packageJson: structuredClone(packages.root.packageJson)
169
+ packageJson: structuredClone(rootPackage.packageJson)
180
170
  },
181
171
  packages: packages.packages.map((p, i) => ({
182
- ...p,
183
172
  dir: tempDirs[i],
184
173
  packageJson: structuredClone(p.packageJson)
185
174
  }))
@@ -196,10 +185,10 @@ function previewEffect(root, fs) {
196
185
  const realCl = (0, node_path.join)(p.dir, "CHANGELOG.md");
197
186
  if (yield* fs.exists(realCl)) yield* fs.copyFile(realCl, (0, node_path.join)(tDir, "CHANGELOG.md"));
198
187
  }
199
- const rootCl = (0, node_path.join)(packages.root.dir, "CHANGELOG.md");
188
+ const rootCl = (0, node_path.join)(packages.rootDir, "CHANGELOG.md");
200
189
  if (yield* fs.exists(rootCl)) yield* fs.copyFile(rootCl, (0, node_path.join)(tempRoot, "CHANGELOG.md"));
201
190
  yield* effect.Effect.tryPromise({
202
- try: () => require_changesets_apply_release_plan_esm.default(plan, tempPackages, config, void 0, root),
191
+ try: () => require_index$1.applyReleasePlan(plan, tempPackages, config, void 0, root),
203
192
  catch: (e) => new require_errors.ReleasePlanError({
204
193
  phase: "preview",
205
194
  reason: errMsg(e)
@@ -207,7 +196,7 @@ function previewEffect(root, fs) {
207
196
  });
208
197
  const dirByName = /* @__PURE__ */ new Map();
209
198
  for (const p of tempPackages.packages) dirByName.set(p.packageJson.name, p.dir);
210
- if (tempPackages.root.packageJson.name) dirByName.set(tempPackages.root.packageJson.name, tempRoot);
199
+ if (tempPackages.rootPackage?.packageJson.name) dirByName.set(tempPackages.rootPackage.packageJson.name, tempRoot);
211
200
  const releases = [];
212
201
  for (const r of releasesToRender) {
213
202
  const dir = dirByName.get(r.name);
@@ -250,15 +239,17 @@ function previewEffect(root, fs) {
250
239
  function diskVersion(workspaceDir, fallback, fs) {
251
240
  return fs.readFileString((0, node_path.join)(workspaceDir, "package.json")).pipe(effect.Effect.flatMap((raw) => effect.Effect.try(() => JSON.parse(raw).version ?? fallback)), effect.Effect.orElseSucceed(() => fallback));
252
241
  }
253
- function applyEffect(root, dryRun, inspector, fs) {
242
+ function applyEffect(root, dryRun, changelogModules, inspector, fs) {
254
243
  return effect.Effect.gen(function* () {
255
- const { plan, packages, config } = yield* effect.Effect.tryPromise({
244
+ const { plan, packages, config, warnings } = yield* effect.Effect.tryPromise({
256
245
  try: async () => {
257
- const [plan, packages] = await Promise.all([require_changesets_get_release_plan_esm.default(root), buildPackages(root)]);
246
+ const [plan, packages] = await Promise.all([require_index$2.getReleasePlan(root), require_manypkg_get_packages.getPackages(root)]);
247
+ const { config, warnings } = await loadConfig(root, packages);
258
248
  return {
259
249
  plan,
260
250
  packages,
261
- config: await require_changesets_config_esm.read(root, packages)
251
+ config,
252
+ warnings
262
253
  };
263
254
  },
264
255
  catch: (e) => new require_errors.ReleasePlanError({
@@ -266,6 +257,29 @@ function applyEffect(root, dryRun, inspector, fs) {
266
257
  reason: errMsg(e)
267
258
  })
268
259
  });
260
+ yield* effect.Effect.forEach(warnings, (w) => effect.Effect.logWarning(w));
261
+ let engineConfig = config;
262
+ if (changelogModules) {
263
+ engineConfig = {
264
+ ...config,
265
+ format: false
266
+ };
267
+ if (Array.isArray(config.changelog)) {
268
+ const configuredId = config.changelog[0];
269
+ const mapped = changelogModules[configuredId];
270
+ if (mapped === void 0) {
271
+ const supported = Object.keys(changelogModules).join(", ");
272
+ return yield* effect.Effect.fail(new require_errors.ReleasePlanError({
273
+ phase: "apply",
274
+ reason: `changelog id "${configuredId}" is not in changelogModules (supported: ${supported})`
275
+ }));
276
+ }
277
+ engineConfig = {
278
+ ...engineConfig,
279
+ changelog: [mapped, config.changelog[1]]
280
+ };
281
+ }
282
+ }
269
283
  const releases = plan.releases.filter((r) => r.type !== "none").map((r) => ({
270
284
  name: r.name,
271
285
  type: r.type,
@@ -278,10 +292,10 @@ function applyEffect(root, dryRun, inspector, fs) {
278
292
  const versionByPkgName = new Map(plan.releases.map((r) => [r.name, r.newVersion]));
279
293
  const nameByDir = /* @__PURE__ */ new Map();
280
294
  for (const p of packages.packages) nameByDir.set(p.dir, p.packageJson.name);
281
- if (packages.root.packageJson.name) nameByDir.set(packages.root.dir, packages.root.packageJson.name);
295
+ if (packages.rootPackage?.packageJson.name) nameByDir.set(packages.rootDir, packages.rootPackage.packageJson.name);
282
296
  touchedFiles = yield* effect.Effect.tryPromise({
283
297
  try: async () => {
284
- const touched = await require_changesets_apply_release_plan_esm.default(plan, packages, config);
298
+ const touched = await require_index$1.applyReleasePlan(plan, packages, engineConfig);
285
299
  for (const f of touched) {
286
300
  if (!f.endsWith("CHANGELOG.md")) continue;
287
301
  const pkgName = nameByDir.get((0, node_path.dirname)(f));