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.
- package/dist/_accessExpressionAsString-QhbUZzwv.js +44 -0
- package/dist/_assertGuard-BBn2NbSz.js +91 -0
- package/dist/_createStandardSchema-BGQyz-uA.js +89 -0
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +2 -2
- package/dist/{draft-BqHcSCeX.js → draft-DsxZOCOb.js} +212 -55
- package/dist/{generate-Rvz4Lu98.js → generate-Bg86OJP4.js} +1 -1
- package/dist/generators/simple.d.ts +1 -1
- package/dist/{graph-gThXu8Cz.js → graph-BmXTJZxx.js} +18 -19
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/{npm-5cG02krT.js → npm-BLkgWr-D.js} +289 -42
- package/dist/plugins/cargo.d.ts +1 -1
- package/dist/plugins/cargo.js +583 -159
- package/dist/plugins/git.d.ts +1 -1
- package/dist/plugins/git.js +1 -2
- package/dist/plugins/github.d.ts +1 -1
- package/dist/plugins/github.js +39 -12
- package/dist/plugins/gitlab.d.ts +1 -1
- package/dist/plugins/gitlab.js +2 -2
- package/dist/plugins/go.d.ts +1 -1
- package/dist/plugins/go.js +246 -32
- package/dist/providers/npm.d.ts +1 -1
- package/dist/providers/npm.js +1 -1
- package/dist/shared-C_iSTp_s.js +115 -0
- package/dist/{types-DHddSAez.d.ts → types-VvvN6oyT.d.ts} +258 -377
- package/dist/utils/index.d.ts +5 -1
- package/dist/utils/index.js +2 -2
- package/package.json +7 -3
- package/dist/shared-C92toqVI.js +0 -32
package/dist/plugins/git.d.ts
CHANGED
package/dist/plugins/git.js
CHANGED
|
@@ -43,9 +43,8 @@ function git(options = {}) {
|
|
|
43
43
|
const { graph } = this;
|
|
44
44
|
for (const [id, packagePlan] of plan.packages) {
|
|
45
45
|
const pkg = graph.get(id);
|
|
46
|
-
const group = graph.getPackageGroup(pkg.id);
|
|
47
46
|
packagePlan.git ??= {};
|
|
48
|
-
if (group?.options.syncGitTag && pkg.version) packagePlan.git.tag = `${group.name}@${pkg.version}`;
|
|
47
|
+
if (pkg.group?.options.syncGitTag && pkg.version) packagePlan.git.tag = `${pkg.group.name}@${pkg.version}`;
|
|
49
48
|
else if (pkg.version) packagePlan.git.tag = `${pkg.name}@${pkg.version}`;
|
|
50
49
|
}
|
|
51
50
|
},
|
package/dist/plugins/github.d.ts
CHANGED
|
@@ -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-
|
|
1
|
+
import { O as WorkspacePackage, k as Draft, s as TegamiPlugin, t as Awaitable, x as TegamiContext, y as PublishPlan } from "../types-VvvN6oyT.js";
|
|
2
2
|
import { GitPluginOptions } from "./git.js";
|
|
3
3
|
|
|
4
4
|
//#region src/plugins/github.d.ts
|
package/dist/plugins/github.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { i as formatPackageVersion, r as formatNpmDistTag } from "../semver-EKJ8yK5U.js";
|
|
2
|
-
import { t as changelogFilename } from "../generate-
|
|
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 {
|
|
4
|
+
import { o as readChangelogEntries, t as createDraft } from "../draft-DsxZOCOb.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
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
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
|
|
277
|
-
if (
|
|
303
|
+
const parsed = parseWorkflowRunEvent(raw);
|
|
304
|
+
if (!parsed.ok) return {
|
|
278
305
|
found: false,
|
|
279
|
-
reason:
|
|
306
|
+
reason: parsed.reason
|
|
280
307
|
};
|
|
281
308
|
return {
|
|
282
309
|
found: true,
|
|
283
|
-
number:
|
|
310
|
+
number: parsed.number
|
|
284
311
|
};
|
|
285
312
|
}
|
|
286
313
|
async function listPullRequestChangelogFiles(context, baseSha, headSha) {
|
package/dist/plugins/gitlab.d.ts
CHANGED
|
@@ -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-
|
|
1
|
+
import { O as WorkspacePackage, k as Draft, s as TegamiPlugin, t as Awaitable, x as TegamiContext, y as PublishPlan } from "../types-VvvN6oyT.js";
|
|
2
2
|
import { GitPluginOptions } from "./git.js";
|
|
3
3
|
|
|
4
4
|
//#region src/plugins/gitlab.d.ts
|
package/dist/plugins/gitlab.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as formatPackageVersion, r as formatNpmDistTag } from "../semver-EKJ8yK5U.js";
|
|
2
|
-
import { t as changelogFilename } from "../generate-
|
|
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 {
|
|
4
|
+
import { o as readChangelogEntries, t as createDraft } from "../draft-DsxZOCOb.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";
|
package/dist/plugins/go.d.ts
CHANGED
package/dist/plugins/go.js
CHANGED
|
@@ -1,31 +1,204 @@
|
|
|
1
1
|
import { i as isNodeError, n as execFailure } from "../error-BhMYq9iW.js";
|
|
2
|
-
import { n as
|
|
2
|
+
import { n as _validateReport, t as _createStandardSchema } from "../_createStandardSchema-BGQyz-uA.js";
|
|
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
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
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
|
|
65
|
-
id
|
|
66
|
-
|
|
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
|
|
125
|
-
if (!
|
|
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
|
}
|
|
@@ -135,7 +348,7 @@ function go({ updateLockFile = true, bumpDep: getBumpDepType } = {}) {
|
|
|
135
348
|
},
|
|
136
349
|
async publishPreflight({ pkg }) {
|
|
137
350
|
if (!(pkg instanceof GoPackage)) return;
|
|
138
|
-
const shouldPublish = pkg.
|
|
351
|
+
const shouldPublish = pkg.options.go?.publish ?? pkg.group?.options?.go?.publish ?? true;
|
|
139
352
|
const wait = [];
|
|
140
353
|
for (const [moduleName] of pkg.mod.requires) {
|
|
141
354
|
const linked = this.graph.get(`go:${moduleName}`);
|
|
@@ -205,11 +418,10 @@ function depsPolicy({ graph }, getBumpDepType = () => "patch") {
|
|
|
205
418
|
if (!(pkg instanceof GoPackage)) return;
|
|
206
419
|
const deps = dependentMap.get(pkg.id);
|
|
207
420
|
if (!deps) return;
|
|
208
|
-
const group = graph.getPackageGroup(pkg.id);
|
|
209
421
|
const bumped = plan.bumpVersion(pkg);
|
|
210
422
|
if (!bumped) return;
|
|
211
423
|
for (const dep of deps) {
|
|
212
|
-
if (group?.options.syncBump &&
|
|
424
|
+
if (pkg.group?.options.syncBump && dep.dependent.group === pkg.group) continue;
|
|
213
425
|
if (semver$1.satisfies(bumped, stripGoVersion(dep.version))) continue;
|
|
214
426
|
const bumpType = getBumpDepType?.(dep);
|
|
215
427
|
if (bumpType === false) continue;
|
|
@@ -245,7 +457,8 @@ async function listGoWorkUsePaths(cwd) {
|
|
|
245
457
|
"-json"
|
|
246
458
|
], { nodeOptions: { cwd } });
|
|
247
459
|
if (result.exitCode !== 0) return void 0;
|
|
248
|
-
const
|
|
460
|
+
const validated = validateGoWorkJson(JSON.parse(result.stdout));
|
|
461
|
+
const data = validated.success ? validated.data : void 0;
|
|
249
462
|
if (!data?.Use?.length) return [cwd];
|
|
250
463
|
return data.Use.map((use) => resolve(cwd, use.DiskPath));
|
|
251
464
|
}
|
|
@@ -256,7 +469,8 @@ async function readGoMod(path) {
|
|
|
256
469
|
"-json"
|
|
257
470
|
], { nodeOptions: { cwd: path } });
|
|
258
471
|
if (result.exitCode !== 0) return;
|
|
259
|
-
const
|
|
472
|
+
const validated = validateGoModJson(JSON.parse(result.stdout));
|
|
473
|
+
const data = validated.success ? validated.data : void 0;
|
|
260
474
|
if (!data) return;
|
|
261
475
|
const requires = /* @__PURE__ */ new Map();
|
|
262
476
|
for (const req of data.Require ?? []) if (req.Version) requires.set(req.Path, req.Version);
|
package/dist/providers/npm.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { d as npm, l as NpmPackage, u as NpmPluginOptions } from "../types-
|
|
1
|
+
import { d as npm, l as NpmPackage, u as NpmPluginOptions } from "../types-VvvN6oyT.js";
|
|
2
2
|
export { NpmPackage, NpmPluginOptions, npm };
|
package/dist/providers/npm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as npm, t as NpmPackage } from "../npm-
|
|
1
|
+
import { n as npm, t as NpmPackage } from "../npm-BLkgWr-D.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 };
|