tegami 1.1.0 → 1.1.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.
@@ -1,14 +1,13 @@
1
1
  import { i as formatPackageVersion, r as formatNpmDistTag } from "../semver-EKJ8yK5U.js";
2
- import { t as changelogFilename } from "../generate-Rvz4Lu98.js";
2
+ import { t as changelogFilename } from "../generate-Bg86OJP4.js";
3
3
  import { a as cached, n as execFailure, o as isCI } from "../error-BhMYq9iW.js";
4
- import { n as createDraft, o as readChangelogEntries } from "../draft-BLbt4bSG.js";
4
+ import { o as readChangelogEntries, t as createDraft } from "../draft-CzUiQasJ.js";
5
5
  import { git } from "./git.js";
6
6
  import { n as createVersionRequestBody, r as hasGitChanges, t as commitVersionBranchChanges } from "../version-request-oxy16TJ1.js";
7
7
  import { readFile, writeFile } from "node:fs/promises";
8
8
  import { basename, join, relative, resolve } from "node:path";
9
9
  import { x } from "tinyexec";
10
10
  import semver from "semver";
11
- import z from "zod";
12
11
  import { resolveCommand } from "package-manager-detector";
13
12
  import { note, outro } from "@clack/prompts";
14
13
  //#region src/plugins/github/api.ts
@@ -253,11 +252,39 @@ async function resolvePullRequest(context, options) {
253
252
  } catch {}
254
253
  throw new Error("A pull request event or --number is required.");
255
254
  }
256
- const workflowRunEventSchema = z.object({ workflow_run: z.object({
257
- event: z.literal("pull_request", { error: "The preview workflow was not triggered by a pull request." }),
258
- conclusion: z.literal("success", { error: "The preview workflow did not complete successfully." }),
259
- pull_requests: z.array(z.object({ number: z.int() }), { error: "The preview workflow is not associated with a pull request." }).min(1)
260
- }, { error: "A workflow_run event is required." }) });
255
+ function parseWorkflowRunEvent(raw) {
256
+ if (typeof raw !== "object" || raw === null || !("workflow_run" in raw)) return {
257
+ ok: false,
258
+ reason: "A workflow_run event is required."
259
+ };
260
+ const workflowRun = raw.workflow_run;
261
+ if (typeof workflowRun !== "object" || workflowRun === null) return {
262
+ ok: false,
263
+ reason: "A workflow_run event is required."
264
+ };
265
+ if (workflowRun.event !== "pull_request") return {
266
+ ok: false,
267
+ reason: "The preview workflow was not triggered by a pull request."
268
+ };
269
+ if (workflowRun.conclusion !== "success") return {
270
+ ok: false,
271
+ reason: "The preview workflow did not complete successfully."
272
+ };
273
+ const pullRequests = workflowRun.pull_requests;
274
+ if (!Array.isArray(pullRequests) || pullRequests.length === 0) return {
275
+ ok: false,
276
+ reason: "The preview workflow is not associated with a pull request."
277
+ };
278
+ const number = pullRequests[0].number;
279
+ if (typeof number !== "number" || !Number.isInteger(number)) return {
280
+ ok: false,
281
+ reason: "The preview workflow is not associated with a pull request."
282
+ };
283
+ return {
284
+ ok: true,
285
+ number
286
+ };
287
+ }
261
288
  async function readPullRequestFromWorkflowRunEvent() {
262
289
  const eventPath = process.env.GITHUB_EVENT_PATH;
263
290
  if (!eventPath) return {
@@ -273,14 +300,14 @@ async function readPullRequestFromWorkflowRunEvent() {
273
300
  reason: "Failed to read workflow_run event."
274
301
  };
275
302
  }
276
- const { error, data } = workflowRunEventSchema.safeParse(raw);
277
- if (error) return {
303
+ const parsed = parseWorkflowRunEvent(raw);
304
+ if (!parsed.ok) return {
278
305
  found: false,
279
- reason: z.prettifyError(error)
306
+ reason: parsed.reason
280
307
  };
281
308
  return {
282
309
  found: true,
283
- number: data.workflow_run.pull_requests[0].number
310
+ number: parsed.number
284
311
  };
285
312
  }
286
313
  async function listPullRequestChangelogFiles(context, baseSha, headSha) {
@@ -1,4 +1,4 @@
1
- import { O as WorkspacePackage, k as Draft, s as TegamiPlugin, t as Awaitable, x as TegamiContext, y as PublishPlan } from "../types-BoQR7Hlg.js";
1
+ import { A as WorkspacePackage, b as TegamiContext, j as Draft, s as TegamiPlugin, t as Awaitable, v as PublishPlan } from "../types-B50RK1rR.js";
2
2
  import { GitPluginOptions } from "./git.js";
3
3
 
4
4
  //#region src/plugins/gitlab.d.ts
@@ -1,7 +1,7 @@
1
1
  import { i as formatPackageVersion, r as formatNpmDistTag } from "../semver-EKJ8yK5U.js";
2
- import { t as changelogFilename } from "../generate-Rvz4Lu98.js";
2
+ import { t as changelogFilename } from "../generate-Bg86OJP4.js";
3
3
  import { a as cached, n as execFailure, o as isCI, s as joinPath } from "../error-BhMYq9iW.js";
4
- import { n as createDraft, o as readChangelogEntries } from "../draft-BLbt4bSG.js";
4
+ import { o as readChangelogEntries, t as createDraft } from "../draft-CzUiQasJ.js";
5
5
  import { git } from "./git.js";
6
6
  import { n as createVersionRequestBody, r as hasGitChanges, t as commitVersionBranchChanges } from "../version-request-oxy16TJ1.js";
7
7
  import { readFile, writeFile } from "node:fs/promises";
@@ -1,4 +1,4 @@
1
- import { M as BumpType, O as WorkspacePackage, s as TegamiPlugin } from "../types-BoQR7Hlg.js";
1
+ import { A as WorkspacePackage, P as BumpType, s as TegamiPlugin } from "../types-B50RK1rR.js";
2
2
 
3
3
  //#region src/plugins/go.d.ts
4
4
  interface GoModFile {
@@ -1,31 +1,204 @@
1
1
  import { i as isNodeError, n as execFailure } from "../error-BhMYq9iW.js";
2
+ import { n as _validateReport, t as _createStandardSchema } from "../_createStandardSchema-BGQyz-uA.js";
2
3
  import { n as WorkspacePackage } from "../graph-BmXTJZxx.js";
3
4
  import { relative, resolve } from "node:path";
4
5
  import { x } from "tinyexec";
5
6
  import * as semver$1 from "semver";
6
- import z from "zod";
7
7
  //#region src/plugins/go.ts
8
- const goWorkJsonSchema = z.object({ Use: z.array(z.object({
9
- DiskPath: z.string(),
10
- ModulePath: z.string().optional()
11
- })).optional() });
12
- const goModJsonSchema = z.object({
13
- Module: z.object({ Path: z.string() }),
14
- Require: z.array(z.object({
15
- Path: z.string(),
16
- Version: z.string().optional()
17
- })).optional(),
18
- Replace: z.array(z.object({
19
- Old: z.object({
20
- Path: z.string(),
21
- Version: z.string().optional()
8
+ const validateGoWorkJson = (() => {
9
+ const _io0 = (input) => void 0 === input.Use || Array.isArray(input.Use) && input.Use.every((elem) => "object" === typeof elem && null !== elem && _io1(elem));
10
+ const _io1 = (input) => "string" === typeof input.DiskPath && (void 0 === input.ModulePath || "string" === typeof input.ModulePath);
11
+ const _vo0 = (input, _path, _exceptionable = true) => [void 0 === input.Use || (Array.isArray(input.Use) || _report(_exceptionable, {
12
+ path: _path + ".Use",
13
+ expected: "(Array<__type> | undefined)",
14
+ value: input.Use
15
+ })) && input.Use.map((elem, _index2) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
16
+ path: _path + ".Use[" + _index2 + "]",
17
+ expected: "__type",
18
+ value: elem
19
+ })) && _vo1(elem, _path + ".Use[" + _index2 + "]", _exceptionable) || _report(_exceptionable, {
20
+ path: _path + ".Use[" + _index2 + "]",
21
+ expected: "__type",
22
+ value: elem
23
+ })).every((flag) => flag) || _report(_exceptionable, {
24
+ path: _path + ".Use",
25
+ expected: "(Array<__type> | undefined)",
26
+ value: input.Use
27
+ })].every((flag) => flag);
28
+ const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.DiskPath || _report(_exceptionable, {
29
+ path: _path + ".DiskPath",
30
+ expected: "string",
31
+ value: input.DiskPath
32
+ }), void 0 === input.ModulePath || "string" === typeof input.ModulePath || _report(_exceptionable, {
33
+ path: _path + ".ModulePath",
34
+ expected: "(string | undefined)",
35
+ value: input.ModulePath
36
+ })].every((flag) => flag);
37
+ const __is = (input) => "object" === typeof input && null !== input && false === Array.isArray(input) && _io0(input);
38
+ let errors;
39
+ let _report;
40
+ return _createStandardSchema((input) => {
41
+ if (false === __is(input)) {
42
+ errors = [];
43
+ _report = _validateReport(errors);
44
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || _report(true, {
45
+ path: _path + "",
46
+ expected: "GoWorkJson",
47
+ value: input
48
+ })) && _vo0(input, _path + "", true) || _report(true, {
49
+ path: _path + "",
50
+ expected: "GoWorkJson",
51
+ value: input
52
+ }))(input, "$input", true);
53
+ const success = 0 === errors.length;
54
+ return success ? {
55
+ success,
56
+ data: input
57
+ } : {
58
+ success,
59
+ errors,
60
+ data: input
61
+ };
62
+ }
63
+ return {
64
+ success: true,
65
+ data: input
66
+ };
67
+ });
68
+ })();
69
+ const validateGoModJson = (() => {
70
+ const _io0 = (input) => "object" === typeof input.Module && null !== input.Module && _io1(input.Module) && (void 0 === input.Require || Array.isArray(input.Require) && input.Require.every((elem) => "object" === typeof elem && null !== elem && _io2(elem))) && (void 0 === input.Replace || Array.isArray(input.Replace) && input.Replace.every((elem) => "object" === typeof elem && null !== elem && _io3(elem)));
71
+ const _io1 = (input) => "string" === typeof input.Path;
72
+ const _io2 = (input) => "string" === typeof input.Path && (void 0 === input.Version || "string" === typeof input.Version);
73
+ const _io3 = (input) => "object" === typeof input.Old && null !== input.Old && _io4(input.Old) && "object" === typeof input.New && null !== input.New && _io5(input.New);
74
+ const _io4 = (input) => "string" === typeof input.Path && (void 0 === input.Version || "string" === typeof input.Version);
75
+ const _io5 = (input) => "string" === typeof input.Path && (void 0 === input.Version || "string" === typeof input.Version);
76
+ const _vo0 = (input, _path, _exceptionable = true) => [
77
+ ("object" === typeof input.Module && null !== input.Module || _report(_exceptionable, {
78
+ path: _path + ".Module",
79
+ expected: "__type",
80
+ value: input.Module
81
+ })) && _vo1(input.Module, _path + ".Module", _exceptionable) || _report(_exceptionable, {
82
+ path: _path + ".Module",
83
+ expected: "__type",
84
+ value: input.Module
22
85
  }),
23
- New: z.object({
24
- Path: z.string(),
25
- Version: z.string().optional()
86
+ void 0 === input.Require || (Array.isArray(input.Require) || _report(_exceptionable, {
87
+ path: _path + ".Require",
88
+ expected: "(Array<__type> | undefined)",
89
+ value: input.Require
90
+ })) && input.Require.map((elem, _index3) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
91
+ path: _path + ".Require[" + _index3 + "]",
92
+ expected: "__type.o1",
93
+ value: elem
94
+ })) && _vo2(elem, _path + ".Require[" + _index3 + "]", _exceptionable) || _report(_exceptionable, {
95
+ path: _path + ".Require[" + _index3 + "]",
96
+ expected: "__type.o1",
97
+ value: elem
98
+ })).every((flag) => flag) || _report(_exceptionable, {
99
+ path: _path + ".Require",
100
+ expected: "(Array<__type> | undefined)",
101
+ value: input.Require
102
+ }),
103
+ void 0 === input.Replace || (Array.isArray(input.Replace) || _report(_exceptionable, {
104
+ path: _path + ".Replace",
105
+ expected: "(Array<__type>.o1 | undefined)",
106
+ value: input.Replace
107
+ })) && input.Replace.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
108
+ path: _path + ".Replace[" + _index4 + "]",
109
+ expected: "__type.o2",
110
+ value: elem
111
+ })) && _vo3(elem, _path + ".Replace[" + _index4 + "]", _exceptionable) || _report(_exceptionable, {
112
+ path: _path + ".Replace[" + _index4 + "]",
113
+ expected: "__type.o2",
114
+ value: elem
115
+ })).every((flag) => flag) || _report(_exceptionable, {
116
+ path: _path + ".Replace",
117
+ expected: "(Array<__type>.o1 | undefined)",
118
+ value: input.Replace
26
119
  })
27
- })).optional()
28
- });
120
+ ].every((flag) => flag);
121
+ const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.Path || _report(_exceptionable, {
122
+ path: _path + ".Path",
123
+ expected: "string",
124
+ value: input.Path
125
+ })].every((flag) => flag);
126
+ const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.Path || _report(_exceptionable, {
127
+ path: _path + ".Path",
128
+ expected: "string",
129
+ value: input.Path
130
+ }), void 0 === input.Version || "string" === typeof input.Version || _report(_exceptionable, {
131
+ path: _path + ".Version",
132
+ expected: "(string | undefined)",
133
+ value: input.Version
134
+ })].every((flag) => flag);
135
+ const _vo3 = (input, _path, _exceptionable = true) => [("object" === typeof input.Old && null !== input.Old || _report(_exceptionable, {
136
+ path: _path + ".Old",
137
+ expected: "__type.o3",
138
+ value: input.Old
139
+ })) && _vo4(input.Old, _path + ".Old", _exceptionable) || _report(_exceptionable, {
140
+ path: _path + ".Old",
141
+ expected: "__type.o3",
142
+ value: input.Old
143
+ }), ("object" === typeof input.New && null !== input.New || _report(_exceptionable, {
144
+ path: _path + ".New",
145
+ expected: "__type.o4",
146
+ value: input.New
147
+ })) && _vo5(input.New, _path + ".New", _exceptionable) || _report(_exceptionable, {
148
+ path: _path + ".New",
149
+ expected: "__type.o4",
150
+ value: input.New
151
+ })].every((flag) => flag);
152
+ const _vo4 = (input, _path, _exceptionable = true) => ["string" === typeof input.Path || _report(_exceptionable, {
153
+ path: _path + ".Path",
154
+ expected: "string",
155
+ value: input.Path
156
+ }), void 0 === input.Version || "string" === typeof input.Version || _report(_exceptionable, {
157
+ path: _path + ".Version",
158
+ expected: "(string | undefined)",
159
+ value: input.Version
160
+ })].every((flag) => flag);
161
+ const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.Path || _report(_exceptionable, {
162
+ path: _path + ".Path",
163
+ expected: "string",
164
+ value: input.Path
165
+ }), void 0 === input.Version || "string" === typeof input.Version || _report(_exceptionable, {
166
+ path: _path + ".Version",
167
+ expected: "(string | undefined)",
168
+ value: input.Version
169
+ })].every((flag) => flag);
170
+ const __is = (input) => "object" === typeof input && null !== input && _io0(input);
171
+ let errors;
172
+ let _report;
173
+ return _createStandardSchema((input) => {
174
+ if (false === __is(input)) {
175
+ errors = [];
176
+ _report = _validateReport(errors);
177
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
178
+ path: _path + "",
179
+ expected: "GoModJson",
180
+ value: input
181
+ })) && _vo0(input, _path + "", true) || _report(true, {
182
+ path: _path + "",
183
+ expected: "GoModJson",
184
+ value: input
185
+ }))(input, "$input", true);
186
+ const success = 0 === errors.length;
187
+ return success ? {
188
+ success,
189
+ data: input
190
+ } : {
191
+ success,
192
+ errors,
193
+ data: input
194
+ };
195
+ }
196
+ return {
197
+ success: true,
198
+ data: input
199
+ };
200
+ });
201
+ })();
29
202
  var GoPackage = class extends WorkspacePackage {
30
203
  path;
31
204
  mod;
@@ -61,10 +234,49 @@ var GoPackage = class extends WorkspacePackage {
61
234
  this.pendingRequires.clear();
62
235
  }
63
236
  };
64
- const packageLockSchema = z.object({
65
- id: z.string(),
66
- version: z.string()
67
- });
237
+ const validateGoPackageLock = (() => {
238
+ const _io0 = (input) => "string" === typeof input.id && "string" === typeof input.version;
239
+ const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.id || _report(_exceptionable, {
240
+ path: _path + ".id",
241
+ expected: "string",
242
+ value: input.id
243
+ }), "string" === typeof input.version || _report(_exceptionable, {
244
+ path: _path + ".version",
245
+ expected: "string",
246
+ value: input.version
247
+ })].every((flag) => flag);
248
+ const __is = (input) => "object" === typeof input && null !== input && _io0(input);
249
+ let errors;
250
+ let _report;
251
+ return _createStandardSchema((input) => {
252
+ if (false === __is(input)) {
253
+ errors = [];
254
+ _report = _validateReport(errors);
255
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
256
+ path: _path + "",
257
+ expected: "GoPackageLock",
258
+ value: input
259
+ })) && _vo0(input, _path + "", true) || _report(true, {
260
+ path: _path + "",
261
+ expected: "GoPackageLock",
262
+ value: input
263
+ }))(input, "$input", true);
264
+ const success = 0 === errors.length;
265
+ return success ? {
266
+ success,
267
+ data: input
268
+ } : {
269
+ success,
270
+ errors,
271
+ data: input
272
+ };
273
+ }
274
+ return {
275
+ success: true,
276
+ data: input
277
+ };
278
+ });
279
+ })();
68
280
  /**
69
281
  * Plugin for Golang, the release flow of Golang is pretty special, there's some exceptions for it:
70
282
  *
@@ -121,8 +333,9 @@ function go({ updateLockFile = true, bumpDep: getBumpDepType } = {}) {
121
333
  if (!active) return;
122
334
  let data;
123
335
  while (data = lock.read("go:packages")) {
124
- const parsed = packageLockSchema.safeParse(data).data;
125
- if (!parsed) continue;
336
+ const validated = validateGoPackageLock(data);
337
+ if (!validated.success) continue;
338
+ const parsed = validated.data;
126
339
  const pkg = this.graph.get(parsed.id);
127
340
  if (pkg instanceof GoPackage) pkg.setVersion(parsed.version);
128
341
  }
@@ -244,7 +457,8 @@ async function listGoWorkUsePaths(cwd) {
244
457
  "-json"
245
458
  ], { nodeOptions: { cwd } });
246
459
  if (result.exitCode !== 0) return void 0;
247
- const data = goWorkJsonSchema.safeParse(JSON.parse(result.stdout)).data;
460
+ const validated = validateGoWorkJson(JSON.parse(result.stdout));
461
+ const data = validated.success ? validated.data : void 0;
248
462
  if (!data?.Use?.length) return [cwd];
249
463
  return data.Use.map((use) => resolve(cwd, use.DiskPath));
250
464
  }
@@ -255,7 +469,8 @@ async function readGoMod(path) {
255
469
  "-json"
256
470
  ], { nodeOptions: { cwd: path } });
257
471
  if (result.exitCode !== 0) return;
258
- const data = goModJsonSchema.safeParse(JSON.parse(result.stdout)).data;
472
+ const validated = validateGoModJson(JSON.parse(result.stdout));
473
+ const data = validated.success ? validated.data : void 0;
259
474
  if (!data) return;
260
475
  const requires = /* @__PURE__ */ new Map();
261
476
  for (const req of data.Require ?? []) if (req.Version) requires.set(req.Path, req.Version);
@@ -1,2 +1,2 @@
1
- import { d as npm, l as NpmPackage, u as NpmPluginOptions } from "../types-BoQR7Hlg.js";
2
- export { NpmPackage, NpmPluginOptions, npm };
1
+ import { C as NpmPackage, S as NpmGraph, l as NpmPluginOptions, u as npm, x as DependencySpec } from "../types-B50RK1rR.js";
2
+ export { type DependencySpec, type NpmGraph, NpmPackage, NpmPluginOptions, npm };
@@ -1,2 +1,2 @@
1
- import { n as npm, t as NpmPackage } from "../npm-Cj685Ddn.js";
1
+ import { n as NpmPackage, t as npm } from "../npm-DoPhFKji.js";
2
2
  export { NpmPackage, npm };
@@ -0,0 +1,115 @@
1
+ import { t as _accessExpressionAsString } from "./_accessExpressionAsString-QhbUZzwv.js";
2
+ import { n as _validateReport, t as _createStandardSchema } from "./_createStandardSchema-BGQyz-uA.js";
3
+ import { stringify } from "yaml";
4
+ //#region src/changelog/shared.ts
5
+ const validateChangelogFrontmatter = (() => {
6
+ const _io0 = (input) => (void 0 === input.subject || "string" === typeof input.subject) && null !== input.packages && (void 0 === input.packages || Array.isArray(input.packages) && input.packages.every((elem) => "string" === typeof elem) || "object" === typeof input.packages && null !== input.packages && false === Array.isArray(input.packages) && _io1(input.packages));
7
+ const _io1 = (input) => Object.keys(input).every((key) => {
8
+ const value = input[key];
9
+ if (void 0 === value) return true;
10
+ return void 0 !== value && (null === value || "major" === value || "minor" === value || "patch" === value || "object" === typeof value && null !== value && false === Array.isArray(value) && _io2(value));
11
+ });
12
+ const _io2 = (input) => (void 0 === input.type || "major" === input.type || "minor" === input.type || "patch" === input.type) && (void 0 === input.replay || Array.isArray(input.replay) && input.replay.every((elem) => "string" === typeof elem && 1 <= elem.length));
13
+ const _vo0 = (input, _path, _exceptionable = true) => [void 0 === input.subject || "string" === typeof input.subject || _report(_exceptionable, {
14
+ path: _path + ".subject",
15
+ expected: "(string | undefined)",
16
+ value: input.subject
17
+ }), (null !== input.packages || _report(_exceptionable, {
18
+ path: _path + ".packages",
19
+ expected: "(Array<string> | Record<string, BumpType | ChangelogPackageConfig | null> | undefined)",
20
+ value: input.packages
21
+ })) && (void 0 === input.packages || Array.isArray(input.packages) && input.packages.map((elem, _index3) => "string" === typeof elem || _report(_exceptionable, {
22
+ path: _path + ".packages[" + _index3 + "]",
23
+ expected: "string",
24
+ value: elem
25
+ })).every((flag) => flag) || "object" === typeof input.packages && null !== input.packages && false === Array.isArray(input.packages) && _vo1(input.packages, _path + ".packages", _exceptionable) || _report(_exceptionable, {
26
+ path: _path + ".packages",
27
+ expected: "(Array<string> | Record<string, BumpType | ChangelogPackageConfig | null> | undefined)",
28
+ value: input.packages
29
+ }) || _report(_exceptionable, {
30
+ path: _path + ".packages",
31
+ expected: "(Array<string> | Record<string, BumpType | ChangelogPackageConfig | null> | undefined)",
32
+ value: input.packages
33
+ }))].every((flag) => flag);
34
+ const _vo1 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map((key) => {
35
+ const value = input[key];
36
+ if (void 0 === value) return true;
37
+ return (void 0 !== value || _report(_exceptionable, {
38
+ path: _path + _accessExpressionAsString(key),
39
+ expected: "(\"major\" | \"minor\" | \"patch\" | ChangelogPackageConfig | null)",
40
+ value
41
+ })) && (null === value || "major" === value || "minor" === value || "patch" === value || ("object" === typeof value && null !== value && false === Array.isArray(value) || _report(_exceptionable, {
42
+ path: _path + _accessExpressionAsString(key),
43
+ expected: "(\"major\" | \"minor\" | \"patch\" | ChangelogPackageConfig | null)",
44
+ value
45
+ })) && _vo2(value, _path + _accessExpressionAsString(key), _exceptionable) || _report(_exceptionable, {
46
+ path: _path + _accessExpressionAsString(key),
47
+ expected: "(\"major\" | \"minor\" | \"patch\" | ChangelogPackageConfig | null)",
48
+ value
49
+ }));
50
+ }).every((flag) => flag)].every((flag) => flag);
51
+ const _vo2 = (input, _path, _exceptionable = true) => [void 0 === input.type || "major" === input.type || "minor" === input.type || "patch" === input.type || _report(_exceptionable, {
52
+ path: _path + ".type",
53
+ expected: "(\"major\" | \"minor\" | \"patch\" | undefined)",
54
+ value: input.type
55
+ }), void 0 === input.replay || (Array.isArray(input.replay) || _report(_exceptionable, {
56
+ path: _path + ".replay",
57
+ expected: "(Array<string & MinLength<1>> | undefined)",
58
+ value: input.replay
59
+ })) && input.replay.map((elem, _index4) => "string" === typeof elem && (1 <= elem.length || _report(_exceptionable, {
60
+ path: _path + ".replay[" + _index4 + "]",
61
+ expected: "string & MinLength<1>",
62
+ value: elem
63
+ })) || _report(_exceptionable, {
64
+ path: _path + ".replay[" + _index4 + "]",
65
+ expected: "(string & MinLength<1>)",
66
+ value: elem
67
+ })).every((flag) => flag) || _report(_exceptionable, {
68
+ path: _path + ".replay",
69
+ expected: "(Array<string & MinLength<1>> | undefined)",
70
+ value: input.replay
71
+ })].every((flag) => flag);
72
+ const __is = (input) => "object" === typeof input && null !== input && false === Array.isArray(input) && _io0(input);
73
+ let errors;
74
+ let _report;
75
+ return _createStandardSchema((input) => {
76
+ if (false === __is(input)) {
77
+ errors = [];
78
+ _report = _validateReport(errors);
79
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || _report(true, {
80
+ path: _path + "",
81
+ expected: "ChangelogFrontmatter",
82
+ value: input
83
+ })) && _vo0(input, _path + "", true) || _report(true, {
84
+ path: _path + "",
85
+ expected: "ChangelogFrontmatter",
86
+ value: input
87
+ }))(input, "$input", true);
88
+ const success = 0 === errors.length;
89
+ return success ? {
90
+ success,
91
+ data: input
92
+ } : {
93
+ success,
94
+ errors,
95
+ data: input
96
+ };
97
+ }
98
+ return {
99
+ success: true,
100
+ data: input
101
+ };
102
+ });
103
+ })();
104
+ function renderChangelog(frontmatter, body) {
105
+ return [
106
+ "---",
107
+ stringify(frontmatter, { lineWidth: 0 }).trim(),
108
+ "---",
109
+ "",
110
+ body.trim(),
111
+ ""
112
+ ].join("\n");
113
+ }
114
+ //#endregion
115
+ export { validateChangelogFrontmatter as n, renderChangelog as t };