tegami 1.0.2 → 1.1.1

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.
@@ -0,0 +1,44 @@
1
+ //#region ../../node_modules/.pnpm/typia@12.1.1_@types+node@26.0.1_typescript@6.0.3/node_modules/typia/lib/internal/_accessExpressionAsString.mjs
2
+ const _accessExpressionAsString = (str) => variable(str) ? `.${str}` : `[${JSON.stringify(str)}]`;
3
+ const variable = (str) => reserved(str) === false && /^[a-zA-Z_$][a-zA-Z_$0-9]*$/g.test(str);
4
+ const reserved = (str) => RESERVED.has(str);
5
+ const RESERVED = /* @__PURE__ */ new Set([
6
+ "break",
7
+ "case",
8
+ "catch",
9
+ "class",
10
+ "const",
11
+ "continue",
12
+ "debugger",
13
+ "default",
14
+ "delete",
15
+ "do",
16
+ "else",
17
+ "enum",
18
+ "export",
19
+ "extends",
20
+ "false",
21
+ "finally",
22
+ "for",
23
+ "function",
24
+ "if",
25
+ "import",
26
+ "in",
27
+ "instanceof",
28
+ "new",
29
+ "null",
30
+ "return",
31
+ "super",
32
+ "switch",
33
+ "this",
34
+ "throw",
35
+ "true",
36
+ "try",
37
+ "typeof",
38
+ "var",
39
+ "void",
40
+ "while",
41
+ "with"
42
+ ]);
43
+ //#endregion
44
+ export { _accessExpressionAsString as t };
@@ -0,0 +1,91 @@
1
+ //#region ../../node_modules/.pnpm/typia@12.1.1_@types+node@26.0.1_typescript@6.0.3/node_modules/typia/lib/TypeGuardError.mjs
2
+ /**
3
+ * Error thrown when type assertion fails.
4
+ *
5
+ * Thrown by {@link assert}, {@link assertGuard}, and other assert-family
6
+ * functions when input doesn't match expected type `T`. Contains detailed
7
+ * information about the first assertion failure:
8
+ *
9
+ * - `method`: Which typia function threw (e.g., `"typia.assert"`)
10
+ * - `path`: Property path where error occurred (e.g., `"input.user.age"`)
11
+ * - `expected`: Expected type string (e.g., `"number & ExclusiveMinimum<19>"`)
12
+ * - `value`: Actual value that failed validation
13
+ *
14
+ * @template T Expected type (for type safety)
15
+ */
16
+ var TypeGuardError = class extends Error {
17
+ /**
18
+ * Name of the typia method that threw this error.
19
+ *
20
+ * E.g., `"typia.assert"`, `"typia.assertEquals"`, `"typia.assertGuard"`.
21
+ */
22
+ method;
23
+ /**
24
+ * Property path where assertion failed.
25
+ *
26
+ * Uses dot notation for nested properties. `undefined` if error occurred at
27
+ * root level.
28
+ *
29
+ * E.g., `"input.age"`, `"input.profile.email"`, `"input[0].name"`.
30
+ */
31
+ path;
32
+ /**
33
+ * String representation of expected type.
34
+ *
35
+ * E.g., `"string"`, `"number & ExclusiveMinimum<19>"`, `"{ name: string; age:
36
+ * number }"`.
37
+ */
38
+ expected;
39
+ /**
40
+ * Actual value that failed assertion.
41
+ *
42
+ * The raw value at the error path, useful for debugging.
43
+ */
44
+ value;
45
+ /**
46
+ * Optional human-readable error description.
47
+ *
48
+ * Primarily for AI agent libraries or custom validation scenarios needing
49
+ * additional context. Standard assertions rely on `path`, `expected`, and
50
+ * `value` for error reporting.
51
+ */
52
+ description;
53
+ /**
54
+ * Phantom property for TypeScript type safety.
55
+ *
56
+ * Not used at runtime—exists only to preserve generic type `T` in the type
57
+ * system. Always `undefined`.
58
+ *
59
+ * @internal
60
+ */
61
+ fake_expected_typed_value_;
62
+ /**
63
+ * Creates a new TypeGuardError instance.
64
+ *
65
+ * @param props Error properties
66
+ */
67
+ constructor(props) {
68
+ super(props.message || `Error on ${props.method}(): invalid type${props.path ? ` on ${props.path}` : ""}, expect to be ${props.expected}`);
69
+ const proto = new.target.prototype;
70
+ if (Object.setPrototypeOf) Object.setPrototypeOf(this, proto);
71
+ else this.__proto__ = proto;
72
+ this.method = props.method;
73
+ this.path = props.path;
74
+ this.expected = props.expected;
75
+ this.value = props.value;
76
+ if (props.description || props.value === void 0) this.description = props.description ?? [
77
+ "The value at this path is `undefined`.",
78
+ "",
79
+ `Please fill the \`${props.expected}\` typed value next time.`
80
+ ].join("\n");
81
+ }
82
+ };
83
+ //#endregion
84
+ //#region ../../node_modules/.pnpm/typia@12.1.1_@types+node@26.0.1_typescript@6.0.3/node_modules/typia/lib/internal/_assertGuard.mjs
85
+ const _assertGuard = (exceptionable, props, factory) => {
86
+ if (exceptionable === true) if (factory) throw factory(props);
87
+ else throw new TypeGuardError(props);
88
+ return false;
89
+ };
90
+ //#endregion
91
+ export { _assertGuard as t };
@@ -0,0 +1,89 @@
1
+ //#region ../../node_modules/.pnpm/typia@12.1.1_@types+node@26.0.1_typescript@6.0.3/node_modules/typia/lib/internal/_validateReport.mjs
2
+ const _validateReport = (array) => {
3
+ const reportable = (path) => {
4
+ if (array.length === 0) return true;
5
+ const last = array[array.length - 1].path;
6
+ return path.length > last.length || last.substring(0, path.length) !== path;
7
+ };
8
+ return (exceptable, error) => {
9
+ if (exceptable && reportable(error.path)) {
10
+ if (error.value === void 0) error.description ??= [
11
+ "The value at this path is `undefined`.",
12
+ "",
13
+ `Please fill the \`${error.expected}\` typed value next time.`
14
+ ].join("\n");
15
+ array.push(error);
16
+ }
17
+ return false;
18
+ };
19
+ };
20
+ //#endregion
21
+ //#region ../../node_modules/.pnpm/typia@12.1.1_@types+node@26.0.1_typescript@6.0.3/node_modules/typia/lib/internal/_createStandardSchema.mjs
22
+ const _createStandardSchema = (fn) => Object.assign(fn, { "~standard": {
23
+ version: 1,
24
+ vendor: "typia",
25
+ validate: (input) => {
26
+ const result = fn(input);
27
+ if (result.success) return { value: result.data };
28
+ else return { issues: result.errors.map((error) => ({
29
+ message: `expected ${error.expected}, got ${error.value}`,
30
+ path: typiaPathToStandardSchemaPath(error.path)
31
+ })) };
32
+ }
33
+ } });
34
+ var PathParserState;
35
+ (function(PathParserState) {
36
+ PathParserState[PathParserState["Start"] = 0] = "Start";
37
+ PathParserState[PathParserState["Property"] = 1] = "Property";
38
+ PathParserState[PathParserState["StringKey"] = 2] = "StringKey";
39
+ PathParserState[PathParserState["NumberKey"] = 3] = "NumberKey";
40
+ })(PathParserState || (PathParserState = {}));
41
+ const typiaPathToStandardSchemaPath = (path) => {
42
+ if (!path.startsWith("$input")) throw new Error(`Invalid path: ${JSON.stringify(path)}`);
43
+ const segments = [];
44
+ let currentSegment = "";
45
+ let state = PathParserState.Start;
46
+ let index = 5;
47
+ while (index < path.length - 1) {
48
+ index++;
49
+ const char = path[index];
50
+ if (state === PathParserState.Property) if (char === "." || char === "[") {
51
+ segments.push({ key: currentSegment });
52
+ state = PathParserState.Start;
53
+ } else if (index === path.length - 1) {
54
+ currentSegment += char;
55
+ segments.push({ key: currentSegment });
56
+ index++;
57
+ state = PathParserState.Start;
58
+ } else currentSegment += char;
59
+ else if (state === PathParserState.StringKey) if (char === "\"") {
60
+ segments.push({ key: JSON.parse(currentSegment + char) });
61
+ index += 2;
62
+ state = PathParserState.Start;
63
+ } else if (char === "\\") {
64
+ currentSegment += path[index];
65
+ index++;
66
+ currentSegment += path[index];
67
+ } else currentSegment += char;
68
+ else if (state === PathParserState.NumberKey) if (char === "]") {
69
+ segments.push({ key: Number.parseInt(currentSegment) });
70
+ index++;
71
+ state = PathParserState.Start;
72
+ } else currentSegment += char;
73
+ if (state === PathParserState.Start && index < path.length - 1) {
74
+ const newChar = path[index];
75
+ currentSegment = "";
76
+ if (newChar === "[") if (path[index + 1] === "\"") {
77
+ state = PathParserState.StringKey;
78
+ index++;
79
+ currentSegment = "\"";
80
+ } else state = PathParserState.NumberKey;
81
+ else if (newChar === ".") state = PathParserState.Property;
82
+ else throw new Error("Unreachable: pointer points invalid character");
83
+ }
84
+ }
85
+ if (state !== PathParserState.Start) throw new Error(`Failed to parse path: ${JSON.stringify(path)}`);
86
+ return segments;
87
+ };
88
+ //#endregion
89
+ export { _validateReport as n, _createStandardSchema as t };
@@ -1,4 +1,4 @@
1
- import { k as Draft, p as Tegami, t as Awaitable, y as PublishPlan } from "../types-DHddSAez.js";
1
+ import { k as Draft, p as Tegami, t as Awaitable, y as PublishPlan } from "../types-VvvN6oyT.js";
2
2
 
3
3
  //#region src/cli/index.d.ts
4
4
  interface TegamiCLIOptions {
package/dist/cli/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { n as generateFromCommits, t as changelogFilename } from "../generate-Rvz4Lu98.js";
1
+ import { n as generateFromCommits, t as changelogFilename } from "../generate-Bg86OJP4.js";
2
2
  import { o as isCI, r as handlePluginError, t as CancelledError } from "../error-BhMYq9iW.js";
3
- import { n as renderChangelog } from "../shared-C92toqVI.js";
3
+ import { t as renderChangelog } from "../shared-C_iSTp_s.js";
4
4
  import { mkdir, readFile, writeFile } from "node:fs/promises";
5
5
  import path, { join, relative } from "node:path";
6
6
  import { x } from "tinyexec";
@@ -1,12 +1,14 @@
1
1
  import { a as maxBump } from "./semver-EKJ8yK5U.js";
2
2
  import { r as handlePluginError } from "./error-BhMYq9iW.js";
3
- import { n as renderChangelog, t as changelogFrontmatterSchema } from "./shared-C92toqVI.js";
3
+ import { t as _accessExpressionAsString } from "./_accessExpressionAsString-QhbUZzwv.js";
4
+ import { n as _validateReport, t as _createStandardSchema } from "./_createStandardSchema-BGQyz-uA.js";
5
+ import { n as validateChangelogFrontmatter, t as renderChangelog } from "./shared-C_iSTp_s.js";
6
+ import { t as _assertGuard } from "./_assertGuard-BBn2NbSz.js";
4
7
  import { simpleGenerator } from "./generators/simple.js";
5
8
  import { mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises";
6
9
  import path, { basename, dirname, join } from "node:path";
7
10
  import * as semver$1 from "semver";
8
- import z from "zod";
9
- import { dump, load, visit } from "js-yaml";
11
+ import { parse as parse$1, stringify } from "yaml";
10
12
  //#region src/utils/frontmatter.ts
11
13
  /**
12
14
  * Inspired by https://github.com/jonschlinkert/gray-matter
@@ -25,7 +27,7 @@ function frontmatter(input) {
25
27
  if (!match) return output;
26
28
  output.matter = match[0];
27
29
  output.content = input.slice(match[0].length);
28
- output.data = load(match[1]) ?? {};
30
+ output.data = parse$1(match[1]) ?? {};
29
31
  return output;
30
32
  }
31
33
  //#endregion
@@ -45,8 +47,11 @@ async function readChangelogEntries(context) {
45
47
  /** Parse one changelog markdown file into release entries. */
46
48
  function parseChangelogFile(filename, content) {
47
49
  const parsed = frontmatter(content);
48
- const { success, data } = changelogFrontmatterSchema.safeParse(parsed.data);
49
- if (!success || !data.packages) return;
50
+ const validated = validateChangelogFrontmatter(parsed.data);
51
+ if (!validated.success) return;
52
+ const { packages: packagesConfig } = validated.data;
53
+ if (!packagesConfig) return;
54
+ const data = validated.data;
50
55
  let headingBump;
51
56
  const packages = /* @__PURE__ */ new Map();
52
57
  const sections = [];
@@ -60,10 +65,10 @@ function parseChangelogFile(filename, content) {
60
65
  });
61
66
  }
62
67
  if (sections.length === 0) return;
63
- if (Array.isArray(data.packages)) {
68
+ if (Array.isArray(packagesConfig)) {
64
69
  if (!headingBump) return;
65
- for (const pkg of data.packages) packages.set(pkg, { type: headingBump });
66
- } else for (const [k, v] of Object.entries(data.packages)) {
70
+ for (const pkg of packagesConfig) packages.set(pkg, { type: headingBump });
71
+ } else for (const [k, v] of Object.entries(packagesConfig)) {
67
72
  let config;
68
73
  if (typeof v === "string") config = { type: v };
69
74
  else if (v === null) config = { type: headingBump };
@@ -87,18 +92,33 @@ function parseChangelogFile(filename, content) {
87
92
  };
88
93
  return entry;
89
94
  }
95
+ function formatReplayCondition(condition) {
96
+ switch (condition.on) {
97
+ case "exit-prerelease": return `exit-prerelease(${condition.name})`;
98
+ case "enter-prerelease": return `prerelease(${condition.name})`;
99
+ case "version": return `${condition.name}@${condition.version}`;
100
+ }
101
+ }
90
102
  function parseReplayCondition(condition) {
91
- if (condition.startsWith("exit prerelease:")) return {
92
- type: "on-exit-prerelease",
93
- name: condition.slice(16).trimStart()
103
+ let match;
104
+ if (match = /^exit-prerelease\((.+)\)$/.exec(condition)) return {
105
+ on: "exit-prerelease",
106
+ name: match[1]
94
107
  };
95
- const idx = condition.lastIndexOf("@");
96
- if (idx <= 0) return null;
97
- return {
98
- type: "on-version",
99
- name: condition.slice(0, idx),
100
- version: condition.slice(idx + 1)
108
+ if (match = /^prerelease\((.+)\)$/.exec(condition)) return {
109
+ on: "enter-prerelease",
110
+ name: match[1]
101
111
  };
112
+ if (match = /^exit prerelease:\s*(.+)$/.exec(condition)) return {
113
+ on: "exit-prerelease",
114
+ name: match[1]
115
+ };
116
+ if (match = /^(.+)@([^@]+)$/.exec(condition)) return {
117
+ on: "version",
118
+ name: match[1],
119
+ version: match[2]
120
+ };
121
+ return null;
102
122
  }
103
123
  function parseMarkdownSections(markdown) {
104
124
  const sections = [];
@@ -155,20 +175,6 @@ function headingToBump(depth) {
155
175
  }
156
176
  //#endregion
157
177
  //#region src/plans/lock.ts
158
- function inlineMultilineScalars(documents) {
159
- visit(documents, (node) => {
160
- if (node.kind !== "scalar" || !node.value.includes("\n")) return;
161
- node.style.doubleQuoted = true;
162
- node.style.literal = false;
163
- node.style.folded = false;
164
- node.style.singleQuoted = false;
165
- });
166
- }
167
- const lockDumpOptions = {
168
- sortKeys: true,
169
- lineWidth: -1,
170
- transform: inlineMultilineScalars
171
- };
172
178
  /**
173
179
  * the data structure of `publish-lock.yaml` file.
174
180
  */
@@ -193,24 +199,64 @@ var PublishLock = class {
193
199
  return this.data.get(namespace)?.length ?? 0;
194
200
  }
195
201
  serialize() {
196
- let res = dump(Object.fromEntries(this.data.entries()), lockDumpOptions);
202
+ let res = stringify(this.data, {
203
+ sortMapEntries: true,
204
+ lineWidth: 0,
205
+ blockQuote: false,
206
+ doubleQuotedAsJSON: true
207
+ });
197
208
  if (!res.endsWith("\n")) res += "\n";
198
209
  return res;
199
210
  }
200
211
  };
201
- const baseSchema = z.record(z.string(), z.array(z.unknown()));
212
+ const assertPublishLockData = (() => {
213
+ const _io0 = (input) => Object.keys(input).every((key) => {
214
+ const value = input[key];
215
+ if (void 0 === value) return true;
216
+ return Array.isArray(value);
217
+ });
218
+ const _ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every((key) => {
219
+ const value = input[key];
220
+ if (void 0 === value) return true;
221
+ return Array.isArray(value) || _assertGuard(_exceptionable, {
222
+ method: "typia.createAssert",
223
+ path: _path + _accessExpressionAsString(key),
224
+ expected: "Array<unknown>",
225
+ value
226
+ }, _errorFactory);
227
+ });
228
+ const __is = (input) => "object" === typeof input && null !== input && false === Array.isArray(input) && _io0(input);
229
+ let _errorFactory;
230
+ return (input, errorFactory) => {
231
+ if (false === __is(input)) {
232
+ _errorFactory = errorFactory;
233
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || _assertGuard(true, {
234
+ method: "typia.createAssert",
235
+ path: _path + "",
236
+ expected: "Record<string, Array<unknown>>",
237
+ value: input
238
+ }, _errorFactory)) && _ao0(input, _path + "", true) || _assertGuard(true, {
239
+ method: "typia.createAssert",
240
+ path: _path + "",
241
+ expected: "Record<string, Array<unknown>>",
242
+ value: input
243
+ }, _errorFactory))(input, "$input", true);
244
+ }
245
+ return input;
246
+ };
247
+ })();
202
248
  function parsePublishLock(content) {
203
- const data = baseSchema.parse(load(content));
249
+ const data = assertPublishLockData(parse$1(content));
204
250
  return new PublishLock(new Map(Object.entries(data)));
205
251
  }
206
252
  //#endregion
207
253
  //#region src/plans/policy.ts
208
- function groupPolicy({ graph }) {
254
+ function groupPolicy(_ctx) {
209
255
  return {
210
256
  id: "group",
211
257
  onUpdate({ pkg, packageDraft }) {
212
258
  if (!packageDraft.type) return;
213
- const group = graph.getPackageGroup(pkg.id);
259
+ const group = pkg.group;
214
260
  if (!group || !group.options.syncBump) return;
215
261
  for (const member of group.packages) {
216
262
  if (member === pkg) continue;
@@ -224,16 +270,116 @@ function groupPolicy({ graph }) {
224
270
  }
225
271
  //#endregion
226
272
  //#region src/plans/draft.ts
227
- const changelogStoreSchema = z.object({
228
- v: z.literal("0.0.0"),
229
- filename: z.string(),
230
- content: z.string()
231
- });
232
- const packageStoreSchema = z.object({
233
- id: z.string(),
234
- updated: z.boolean(),
235
- changelogIds: z.array(z.string()).optional()
236
- });
273
+ const validateChangelogStore = (() => {
274
+ const _io0 = (input) => "0.0.0" === input.v && "string" === typeof input.filename && "string" === typeof input.content;
275
+ const _vo0 = (input, _path, _exceptionable = true) => [
276
+ "0.0.0" === input.v || _report(_exceptionable, {
277
+ path: _path + ".v",
278
+ expected: "\"0.0.0\"",
279
+ value: input.v
280
+ }),
281
+ "string" === typeof input.filename || _report(_exceptionable, {
282
+ path: _path + ".filename",
283
+ expected: "string",
284
+ value: input.filename
285
+ }),
286
+ "string" === typeof input.content || _report(_exceptionable, {
287
+ path: _path + ".content",
288
+ expected: "string",
289
+ value: input.content
290
+ })
291
+ ].every((flag) => flag);
292
+ const __is = (input) => "object" === typeof input && null !== input && _io0(input);
293
+ let errors;
294
+ let _report;
295
+ return _createStandardSchema((input) => {
296
+ if (false === __is(input)) {
297
+ errors = [];
298
+ _report = _validateReport(errors);
299
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
300
+ path: _path + "",
301
+ expected: "ChangelogStore",
302
+ value: input
303
+ })) && _vo0(input, _path + "", true) || _report(true, {
304
+ path: _path + "",
305
+ expected: "ChangelogStore",
306
+ value: input
307
+ }))(input, "$input", true);
308
+ const success = 0 === errors.length;
309
+ return success ? {
310
+ success,
311
+ data: input
312
+ } : {
313
+ success,
314
+ errors,
315
+ data: input
316
+ };
317
+ }
318
+ return {
319
+ success: true,
320
+ data: input
321
+ };
322
+ });
323
+ })();
324
+ const validatePackageStore = (() => {
325
+ const _io0 = (input) => "string" === typeof input.id && "boolean" === typeof input.updated && (void 0 === input.changelogIds || Array.isArray(input.changelogIds) && input.changelogIds.every((elem) => "string" === typeof elem));
326
+ const _vo0 = (input, _path, _exceptionable = true) => [
327
+ "string" === typeof input.id || _report(_exceptionable, {
328
+ path: _path + ".id",
329
+ expected: "string",
330
+ value: input.id
331
+ }),
332
+ "boolean" === typeof input.updated || _report(_exceptionable, {
333
+ path: _path + ".updated",
334
+ expected: "boolean",
335
+ value: input.updated
336
+ }),
337
+ void 0 === input.changelogIds || (Array.isArray(input.changelogIds) || _report(_exceptionable, {
338
+ path: _path + ".changelogIds",
339
+ expected: "(Array<string> | undefined)",
340
+ value: input.changelogIds
341
+ })) && input.changelogIds.map((elem, _index2) => "string" === typeof elem || _report(_exceptionable, {
342
+ path: _path + ".changelogIds[" + _index2 + "]",
343
+ expected: "string",
344
+ value: elem
345
+ })).every((flag) => flag) || _report(_exceptionable, {
346
+ path: _path + ".changelogIds",
347
+ expected: "(Array<string> | undefined)",
348
+ value: input.changelogIds
349
+ })
350
+ ].every((flag) => flag);
351
+ const __is = (input) => "object" === typeof input && null !== input && _io0(input);
352
+ let errors;
353
+ let _report;
354
+ return _createStandardSchema((input) => {
355
+ if (false === __is(input)) {
356
+ errors = [];
357
+ _report = _validateReport(errors);
358
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
359
+ path: _path + "",
360
+ expected: "PackageStore",
361
+ value: input
362
+ })) && _vo0(input, _path + "", true) || _report(true, {
363
+ path: _path + "",
364
+ expected: "PackageStore",
365
+ value: input
366
+ }))(input, "$input", true);
367
+ const success = 0 === errors.length;
368
+ return success ? {
369
+ success,
370
+ data: input
371
+ } : {
372
+ success,
373
+ errors,
374
+ data: input
375
+ };
376
+ }
377
+ return {
378
+ success: true,
379
+ data: input
380
+ };
381
+ });
382
+ })();
237
383
  /** a draft describes all operations to perform before the actual publishing, such as version bumps. */
238
384
  var Draft = class {
239
385
  context;
@@ -279,7 +425,7 @@ var Draft = class {
279
425
  const existing = this.packages.get(pkg.id);
280
426
  if (existing) return existing;
281
427
  this.packages.set(pkg.id, pkg.initDraft());
282
- return this.dispatchPackage(pkg, (draft) => pkg.configureDraft(draft, this.context.graph.getPackageGroup(pkg.id)), (draft) => {
428
+ return this.dispatchPackage(pkg, (draft) => pkg.configureDraft({ draft }), (draft) => {
283
429
  (draft.bumpReasons ??= /* @__PURE__ */ new Set()).add("align with script-level configs");
284
430
  });
285
431
  }
@@ -387,15 +533,26 @@ var Draft = class {
387
533
  const { graph } = this.context;
388
534
  const defaultReplays = (name) => {
389
535
  const replay = [];
390
- for (const pkg of graph.getByName(name)) if (this.packages.get(pkg.id)?.prerelease) replay.push(`exit prerelease: ${pkg.id}`);
536
+ for (const pkg of graph.getByName(name)) if (this.packages.get(pkg.id)?.prerelease) replay.push(formatReplayCondition({
537
+ on: "exit-prerelease",
538
+ name: pkg.id
539
+ }));
391
540
  return replay;
392
541
  };
393
542
  const isMatch = (condition) => {
394
- if (condition.type === "on-exit-prerelease") return graph.getByName(condition.name).some((pkg) => {
395
- const previous = snapshots.get(pkg.id);
396
- return previous?.version && semver$1.inc(previous.version, "release") === pkg.version;
397
- });
398
- return graph.getByName(condition.name).some((pkg) => pkg.version === condition.version);
543
+ switch (condition.on) {
544
+ case "enter-prerelease": return graph.getByName(condition.name).some((pkg) => {
545
+ const previous = snapshots.get(pkg.id);
546
+ if (!pkg.version || !previous?.version) return false;
547
+ return !semver$1.prerelease(previous.version) && semver$1.prerelease(pkg.version);
548
+ });
549
+ case "exit-prerelease": return graph.getByName(condition.name).some((pkg) => {
550
+ const previous = snapshots.get(pkg.id);
551
+ if (!pkg.version || !previous?.version) return false;
552
+ return semver$1.inc(previous.version, "release") === pkg.version;
553
+ });
554
+ case "version": return graph.getByName(condition.name).some((pkg) => pkg.version === condition.version);
555
+ }
399
556
  };
400
557
  for (const entry of this.changelogs.values()) {
401
558
  const updatedPackages = /* @__PURE__ */ new Map();
@@ -461,4 +618,4 @@ function attachChangelog(draft, entry) {
461
618
  draft.changelogs.push(entry);
462
619
  }
463
620
  //#endregion
464
- export { parseChangelogFile as a, parsePublishLock as i, createDraft as n, readChangelogEntries as o, packageStoreSchema as r, changelogStoreSchema as t };
621
+ export { parseChangelogFile as a, parsePublishLock as i, validateChangelogStore as n, readChangelogEntries as o, validatePackageStore as r, createDraft as t };
@@ -1,6 +1,6 @@
1
1
  import { a as maxBump, t as bumpDepth } from "./semver-EKJ8yK5U.js";
2
2
  import { n as execFailure } from "./error-BhMYq9iW.js";
3
- import { n as renderChangelog } from "./shared-C92toqVI.js";
3
+ import { t as renderChangelog } from "./shared-C_iSTp_s.js";
4
4
  import { x } from "tinyexec";
5
5
  //#region src/utils/conventional-commit.ts
6
6
  /**
@@ -1,4 +1,4 @@
1
- import { r as LogGenerator } from "../types-DHddSAez.js";
1
+ import { r as LogGenerator } from "../types-VvvN6oyT.js";
2
2
 
3
3
  //#region src/generators/simple.d.ts
4
4
  declare function simpleGenerator(): LogGenerator;