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
|
@@ -2,17 +2,13 @@ import { n as bumpVersion } from "./semver-EKJ8yK5U.js";
|
|
|
2
2
|
//#region src/graph.ts
|
|
3
3
|
/** Package discovered in the workspace. */
|
|
4
4
|
var WorkspacePackage = class {
|
|
5
|
+
/** note: this will only be available after package graph is resolved */
|
|
6
|
+
group;
|
|
7
|
+
/** note: this will only be available after package graph is resolved */
|
|
8
|
+
options = {};
|
|
5
9
|
get id() {
|
|
6
10
|
return `${this.manager}:${this.name}`;
|
|
7
11
|
}
|
|
8
|
-
opts = {};
|
|
9
|
-
/** note: this will only be available after package graph is resolved */
|
|
10
|
-
getPackageOptions() {
|
|
11
|
-
return this.opts;
|
|
12
|
-
}
|
|
13
|
-
setPackageOptions(options) {
|
|
14
|
-
this.opts = options;
|
|
15
|
-
}
|
|
16
12
|
/** create the initial draft. */
|
|
17
13
|
initDraft() {
|
|
18
14
|
return { bumpVersion(pkg) {
|
|
@@ -21,12 +17,17 @@ var WorkspacePackage = class {
|
|
|
21
17
|
} };
|
|
22
18
|
}
|
|
23
19
|
/** configure an initial draft to match script-level configs. */
|
|
24
|
-
configureDraft(draft
|
|
25
|
-
const { prerelease = group?.options?.prerelease } = this.
|
|
20
|
+
configureDraft({ draft }) {
|
|
21
|
+
const { prerelease = this.group?.options?.prerelease } = this.options;
|
|
26
22
|
if (prerelease !== void 0) draft.prerelease = prerelease;
|
|
27
23
|
}
|
|
28
24
|
};
|
|
29
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Unified graph for discovered workspace packages.
|
|
27
|
+
*
|
|
28
|
+
* This is only used as a storage for all indexed packages.
|
|
29
|
+
* For registry-specific relationships (e.g. virtual workspaces), they are stored in the provider plugin internally.
|
|
30
|
+
*/
|
|
30
31
|
var PackageGraph = class {
|
|
31
32
|
packages = /* @__PURE__ */ new Map();
|
|
32
33
|
groups = /* @__PURE__ */ new Map();
|
|
@@ -34,27 +35,25 @@ var PackageGraph = class {
|
|
|
34
35
|
for (const pkg of packages) this.add(pkg);
|
|
35
36
|
}
|
|
36
37
|
getPackages() {
|
|
37
|
-
|
|
38
|
-
for (const pkg of this.packages.values()) out.push(pkg.value);
|
|
39
|
-
return out;
|
|
38
|
+
return Array.from(this.packages.values());
|
|
40
39
|
}
|
|
41
40
|
/** Get a package by exact id. */
|
|
42
41
|
get(id) {
|
|
43
|
-
return this.packages.get(id)
|
|
42
|
+
return this.packages.get(id);
|
|
44
43
|
}
|
|
45
44
|
/** Get packages by id, `group:name`, or every package matching a name. */
|
|
46
45
|
getByName(nameOrId) {
|
|
47
46
|
const exact = this.packages.get(nameOrId);
|
|
48
|
-
if (exact) return [exact
|
|
47
|
+
if (exact) return [exact];
|
|
49
48
|
if (nameOrId.startsWith("group:")) return this.getGroup(nameOrId.slice(6))?.packages ?? [];
|
|
50
49
|
const out = [];
|
|
51
|
-
for (const
|
|
50
|
+
for (const value of this.packages.values()) if (value.name === nameOrId) out.push(value);
|
|
52
51
|
return out;
|
|
53
52
|
}
|
|
54
53
|
/** scan package into graph, if the package id already exists, replace the existing one in graph */
|
|
55
54
|
add(pkg) {
|
|
56
55
|
this.delete(pkg.id);
|
|
57
|
-
this.packages.set(pkg.id,
|
|
56
|
+
this.packages.set(pkg.id, pkg);
|
|
58
57
|
}
|
|
59
58
|
delete(id) {
|
|
60
59
|
this.packages.delete(id);
|
|
@@ -91,7 +90,7 @@ var PackageGraph = class {
|
|
|
91
90
|
const pkg = this.packages.get(id);
|
|
92
91
|
if (!group || !pkg || pkg.group) return;
|
|
93
92
|
pkg.group = group;
|
|
94
|
-
group.packages.push(pkg
|
|
93
|
+
group.packages.push(pkg);
|
|
95
94
|
}
|
|
96
95
|
removeGroupMember(group, id) {
|
|
97
96
|
const entry = this.groups.get(group);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as DraftPolicy, D as PackageGroup, E as PackageGraph, M as BumpType, O as WorkspacePackage, _ as PackagePublishResult, a as PublishPreflight, b as CommitChangelog, c as TegamiPluginOption, f as GenerateChangelogOptions, g as PackagePublishPlan, h as PublishLock, i as PackageOptions, j as PackageDraft, k as Draft, m as tegami, n as GroupOptions, o as TegamiOptions, p as Tegami, r as LogGenerator, s as TegamiPlugin, v as PublishOptions, x as TegamiContext, y as PublishPlan } from "./types-
|
|
1
|
+
import { A as DraftPolicy, D as PackageGroup, E as PackageGraph, M as BumpType, O as WorkspacePackage, _ as PackagePublishResult, a as PublishPreflight, b as CommitChangelog, c as TegamiPluginOption, f as GenerateChangelogOptions, g as PackagePublishPlan, h as PublishLock, i as PackageOptions, j as PackageDraft, k as Draft, m as tegami, n as GroupOptions, o as TegamiOptions, p as Tegami, r as LogGenerator, s as TegamiPlugin, v as PublishOptions, x as TegamiContext, y as PublishPlan } from "./types-VvvN6oyT.js";
|
|
2
2
|
export { type BumpType, type CommitChangelog, type Draft, type DraftPolicy, GenerateChangelogOptions, type GroupOptions, type LogGenerator, type PackageDraft, PackageGraph, type PackageGroup, type PackageOptions, type PackagePublishPlan, type PackagePublishResult, type PublishLock, type PublishOptions, type PublishPlan, type PublishPreflight, Tegami, type TegamiContext, type TegamiOptions, type TegamiPlugin, type TegamiPluginOption, WorkspacePackage, tegami };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as generateFromCommits } from "./generate-
|
|
1
|
+
import { n as generateFromCommits } from "./generate-Bg86OJP4.js";
|
|
2
2
|
import { r as handlePluginError } from "./error-BhMYq9iW.js";
|
|
3
|
-
import { a as runPreflights, i as publishPlanStatus, n as npm, o as runPublishPlan, r as initPublishPlan } from "./npm-
|
|
4
|
-
import { n as WorkspacePackage, t as PackageGraph } from "./graph-
|
|
5
|
-
import { a as parseChangelogFile,
|
|
3
|
+
import { a as runPreflights, i as publishPlanStatus, n as npm, o as runPublishPlan, r as initPublishPlan } from "./npm-BLkgWr-D.js";
|
|
4
|
+
import { n as WorkspacePackage, t as PackageGraph } from "./graph-BmXTJZxx.js";
|
|
5
|
+
import { a as parseChangelogFile, o as readChangelogEntries, t as createDraft } from "./draft-DsxZOCOb.js";
|
|
6
6
|
import { mkdir, rm, writeFile } from "node:fs/promises";
|
|
7
7
|
import path, { join } from "node:path";
|
|
8
8
|
//#region src/context.ts
|
|
@@ -41,7 +41,7 @@ async function resolveGraph(ctx) {
|
|
|
41
41
|
}
|
|
42
42
|
const packageOptions = getPackageOptions?.(pkg);
|
|
43
43
|
if (!packageOptions) continue;
|
|
44
|
-
pkg.
|
|
44
|
+
pkg.options = packageOptions;
|
|
45
45
|
if (packageOptions.group) graph.addGroupMember(packageOptions.group, pkg.id);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -1,35 +1,202 @@
|
|
|
1
1
|
import { c as somePromise, i as isNodeError, n as execFailure, r as handlePluginError, s as joinPath } from "./error-BhMYq9iW.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { t as _accessExpressionAsString } from "./_accessExpressionAsString-QhbUZzwv.js";
|
|
3
|
+
import { n as _validateReport, t as _createStandardSchema } from "./_createStandardSchema-BGQyz-uA.js";
|
|
4
|
+
import { t as _assertGuard } from "./_assertGuard-BBn2NbSz.js";
|
|
5
|
+
import { n as WorkspacePackage } from "./graph-BmXTJZxx.js";
|
|
6
|
+
import { a as parseChangelogFile, i as parsePublishLock, n as validateChangelogStore, r as validatePackageStore } from "./draft-DsxZOCOb.js";
|
|
4
7
|
import fs, { readFile, writeFile } from "node:fs/promises";
|
|
5
8
|
import path, { join } from "node:path";
|
|
6
9
|
import { x } from "tinyexec";
|
|
7
10
|
import * as semver$1 from "semver";
|
|
8
|
-
import
|
|
9
|
-
import { load } from "js-yaml";
|
|
11
|
+
import { parse as parse$1 } from "yaml";
|
|
10
12
|
import { glob } from "tinyglobby";
|
|
11
13
|
import { detect } from "package-manager-detector";
|
|
12
14
|
import { tmpdir } from "node:os";
|
|
13
15
|
import { intro, note, outro } from "@clack/prompts";
|
|
14
16
|
//#region src/providers/npm/schema.ts
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
17
|
+
const assertPnpmWorkspace = (() => {
|
|
18
|
+
const _io0 = (input) => void 0 === input.packages || Array.isArray(input.packages) && input.packages.every((elem) => "string" === typeof elem);
|
|
19
|
+
const _ao0 = (input, _path, _exceptionable = true) => void 0 === input.packages || (Array.isArray(input.packages) || _assertGuard(_exceptionable, {
|
|
20
|
+
method: "typia.createAssert",
|
|
21
|
+
path: _path + ".packages",
|
|
22
|
+
expected: "(Array<string> | undefined)",
|
|
23
|
+
value: input.packages
|
|
24
|
+
}, _errorFactory)) && input.packages.every((elem, _index2) => "string" === typeof elem || _assertGuard(_exceptionable, {
|
|
25
|
+
method: "typia.createAssert",
|
|
26
|
+
path: _path + ".packages[" + _index2 + "]",
|
|
27
|
+
expected: "string",
|
|
28
|
+
value: elem
|
|
29
|
+
}, _errorFactory)) || _assertGuard(_exceptionable, {
|
|
30
|
+
method: "typia.createAssert",
|
|
31
|
+
path: _path + ".packages",
|
|
32
|
+
expected: "(Array<string> | undefined)",
|
|
33
|
+
value: input.packages
|
|
34
|
+
}, _errorFactory);
|
|
35
|
+
const __is = (input) => "object" === typeof input && null !== input && false === Array.isArray(input) && _io0(input);
|
|
36
|
+
let _errorFactory;
|
|
37
|
+
return (input, errorFactory) => {
|
|
38
|
+
if (false === __is(input)) {
|
|
39
|
+
_errorFactory = errorFactory;
|
|
40
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || _assertGuard(true, {
|
|
41
|
+
method: "typia.createAssert",
|
|
42
|
+
path: _path + "",
|
|
43
|
+
expected: "PnpmWorkspace",
|
|
44
|
+
value: input
|
|
45
|
+
}, _errorFactory)) && _ao0(input, _path + "", true) || _assertGuard(true, {
|
|
46
|
+
method: "typia.createAssert",
|
|
47
|
+
path: _path + "",
|
|
48
|
+
expected: "PnpmWorkspace",
|
|
49
|
+
value: input
|
|
50
|
+
}, _errorFactory))(input, "$input", true);
|
|
51
|
+
}
|
|
52
|
+
return input;
|
|
53
|
+
};
|
|
54
|
+
})();
|
|
55
|
+
const assertPackageManifest = (() => {
|
|
56
|
+
const _io0 = (input) => "string" === typeof input.name && (void 0 === input.version || "string" === typeof input.version) && (void 0 === input["private"] || "boolean" === typeof input["private"]) && (void 0 === input.publishConfig || "object" === typeof input.publishConfig && null !== input.publishConfig && false === Array.isArray(input.publishConfig) && _io1(input.publishConfig)) && (void 0 === input.scripts || "object" === typeof input.scripts && null !== input.scripts && false === Array.isArray(input.scripts) && _io2(input.scripts)) && (void 0 === input.workspaces || Array.isArray(input.workspaces) && input.workspaces.every((elem) => "string" === typeof elem)) && (void 0 === input.dependencies || "object" === typeof input.dependencies && null !== input.dependencies && false === Array.isArray(input.dependencies) && _io2(input.dependencies)) && (void 0 === input.devDependencies || "object" === typeof input.devDependencies && null !== input.devDependencies && false === Array.isArray(input.devDependencies) && _io2(input.devDependencies)) && (void 0 === input.peerDependencies || "object" === typeof input.peerDependencies && null !== input.peerDependencies && false === Array.isArray(input.peerDependencies) && _io2(input.peerDependencies)) && (void 0 === input.optionalDependencies || "object" === typeof input.optionalDependencies && null !== input.optionalDependencies && false === Array.isArray(input.optionalDependencies) && _io2(input.optionalDependencies));
|
|
57
|
+
const _io1 = (input) => (void 0 === input.access || "public" === input.access || "restricted" === input.access) && (void 0 === input.registry || "string" === typeof input.registry) && (void 0 === input.tag || "string" === typeof input.tag);
|
|
58
|
+
const _io2 = (input) => Object.keys(input).every((key) => {
|
|
59
|
+
const value = input[key];
|
|
60
|
+
if (void 0 === value) return true;
|
|
61
|
+
return "string" === typeof value;
|
|
62
|
+
});
|
|
63
|
+
const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || _assertGuard(_exceptionable, {
|
|
64
|
+
method: "typia.createAssert",
|
|
65
|
+
path: _path + ".name",
|
|
66
|
+
expected: "string",
|
|
67
|
+
value: input.name
|
|
68
|
+
}, _errorFactory)) && (void 0 === input.version || "string" === typeof input.version || _assertGuard(_exceptionable, {
|
|
69
|
+
method: "typia.createAssert",
|
|
70
|
+
path: _path + ".version",
|
|
71
|
+
expected: "(string | undefined)",
|
|
72
|
+
value: input.version
|
|
73
|
+
}, _errorFactory)) && (void 0 === input["private"] || "boolean" === typeof input["private"] || _assertGuard(_exceptionable, {
|
|
74
|
+
method: "typia.createAssert",
|
|
75
|
+
path: _path + "[\"private\"]",
|
|
76
|
+
expected: "(boolean | undefined)",
|
|
77
|
+
value: input["private"]
|
|
78
|
+
}, _errorFactory)) && (void 0 === input.publishConfig || ("object" === typeof input.publishConfig && null !== input.publishConfig && false === Array.isArray(input.publishConfig) || _assertGuard(_exceptionable, {
|
|
79
|
+
method: "typia.createAssert",
|
|
80
|
+
path: _path + ".publishConfig",
|
|
81
|
+
expected: "(__type | undefined)",
|
|
82
|
+
value: input.publishConfig
|
|
83
|
+
}, _errorFactory)) && _ao1(input.publishConfig, _path + ".publishConfig", _exceptionable) || _assertGuard(_exceptionable, {
|
|
84
|
+
method: "typia.createAssert",
|
|
85
|
+
path: _path + ".publishConfig",
|
|
86
|
+
expected: "(__type | undefined)",
|
|
87
|
+
value: input.publishConfig
|
|
88
|
+
}, _errorFactory)) && (void 0 === input.scripts || ("object" === typeof input.scripts && null !== input.scripts && false === Array.isArray(input.scripts) || _assertGuard(_exceptionable, {
|
|
89
|
+
method: "typia.createAssert",
|
|
90
|
+
path: _path + ".scripts",
|
|
91
|
+
expected: "(Record<string, string> | undefined)",
|
|
92
|
+
value: input.scripts
|
|
93
|
+
}, _errorFactory)) && _ao2(input.scripts, _path + ".scripts", _exceptionable) || _assertGuard(_exceptionable, {
|
|
94
|
+
method: "typia.createAssert",
|
|
95
|
+
path: _path + ".scripts",
|
|
96
|
+
expected: "(Record<string, string> | undefined)",
|
|
97
|
+
value: input.scripts
|
|
98
|
+
}, _errorFactory)) && (void 0 === input.workspaces || (Array.isArray(input.workspaces) || _assertGuard(_exceptionable, {
|
|
99
|
+
method: "typia.createAssert",
|
|
100
|
+
path: _path + ".workspaces",
|
|
101
|
+
expected: "(Array<string> | undefined)",
|
|
102
|
+
value: input.workspaces
|
|
103
|
+
}, _errorFactory)) && input.workspaces.every((elem, _index2) => "string" === typeof elem || _assertGuard(_exceptionable, {
|
|
104
|
+
method: "typia.createAssert",
|
|
105
|
+
path: _path + ".workspaces[" + _index2 + "]",
|
|
106
|
+
expected: "string",
|
|
107
|
+
value: elem
|
|
108
|
+
}, _errorFactory)) || _assertGuard(_exceptionable, {
|
|
109
|
+
method: "typia.createAssert",
|
|
110
|
+
path: _path + ".workspaces",
|
|
111
|
+
expected: "(Array<string> | undefined)",
|
|
112
|
+
value: input.workspaces
|
|
113
|
+
}, _errorFactory)) && (void 0 === input.dependencies || ("object" === typeof input.dependencies && null !== input.dependencies && false === Array.isArray(input.dependencies) || _assertGuard(_exceptionable, {
|
|
114
|
+
method: "typia.createAssert",
|
|
115
|
+
path: _path + ".dependencies",
|
|
116
|
+
expected: "(Record<string, string> | undefined)",
|
|
117
|
+
value: input.dependencies
|
|
118
|
+
}, _errorFactory)) && _ao2(input.dependencies, _path + ".dependencies", _exceptionable) || _assertGuard(_exceptionable, {
|
|
119
|
+
method: "typia.createAssert",
|
|
120
|
+
path: _path + ".dependencies",
|
|
121
|
+
expected: "(Record<string, string> | undefined)",
|
|
122
|
+
value: input.dependencies
|
|
123
|
+
}, _errorFactory)) && (void 0 === input.devDependencies || ("object" === typeof input.devDependencies && null !== input.devDependencies && false === Array.isArray(input.devDependencies) || _assertGuard(_exceptionable, {
|
|
124
|
+
method: "typia.createAssert",
|
|
125
|
+
path: _path + ".devDependencies",
|
|
126
|
+
expected: "(Record<string, string> | undefined)",
|
|
127
|
+
value: input.devDependencies
|
|
128
|
+
}, _errorFactory)) && _ao2(input.devDependencies, _path + ".devDependencies", _exceptionable) || _assertGuard(_exceptionable, {
|
|
129
|
+
method: "typia.createAssert",
|
|
130
|
+
path: _path + ".devDependencies",
|
|
131
|
+
expected: "(Record<string, string> | undefined)",
|
|
132
|
+
value: input.devDependencies
|
|
133
|
+
}, _errorFactory)) && (void 0 === input.peerDependencies || ("object" === typeof input.peerDependencies && null !== input.peerDependencies && false === Array.isArray(input.peerDependencies) || _assertGuard(_exceptionable, {
|
|
134
|
+
method: "typia.createAssert",
|
|
135
|
+
path: _path + ".peerDependencies",
|
|
136
|
+
expected: "(Record<string, string> | undefined)",
|
|
137
|
+
value: input.peerDependencies
|
|
138
|
+
}, _errorFactory)) && _ao2(input.peerDependencies, _path + ".peerDependencies", _exceptionable) || _assertGuard(_exceptionable, {
|
|
139
|
+
method: "typia.createAssert",
|
|
140
|
+
path: _path + ".peerDependencies",
|
|
141
|
+
expected: "(Record<string, string> | undefined)",
|
|
142
|
+
value: input.peerDependencies
|
|
143
|
+
}, _errorFactory)) && (void 0 === input.optionalDependencies || ("object" === typeof input.optionalDependencies && null !== input.optionalDependencies && false === Array.isArray(input.optionalDependencies) || _assertGuard(_exceptionable, {
|
|
144
|
+
method: "typia.createAssert",
|
|
145
|
+
path: _path + ".optionalDependencies",
|
|
146
|
+
expected: "(Record<string, string> | undefined)",
|
|
147
|
+
value: input.optionalDependencies
|
|
148
|
+
}, _errorFactory)) && _ao2(input.optionalDependencies, _path + ".optionalDependencies", _exceptionable) || _assertGuard(_exceptionable, {
|
|
149
|
+
method: "typia.createAssert",
|
|
150
|
+
path: _path + ".optionalDependencies",
|
|
151
|
+
expected: "(Record<string, string> | undefined)",
|
|
152
|
+
value: input.optionalDependencies
|
|
153
|
+
}, _errorFactory));
|
|
154
|
+
const _ao1 = (input, _path, _exceptionable = true) => (void 0 === input.access || "public" === input.access || "restricted" === input.access || _assertGuard(_exceptionable, {
|
|
155
|
+
method: "typia.createAssert",
|
|
156
|
+
path: _path + ".access",
|
|
157
|
+
expected: "(\"public\" | \"restricted\" | undefined)",
|
|
158
|
+
value: input.access
|
|
159
|
+
}, _errorFactory)) && (void 0 === input.registry || "string" === typeof input.registry || _assertGuard(_exceptionable, {
|
|
160
|
+
method: "typia.createAssert",
|
|
161
|
+
path: _path + ".registry",
|
|
162
|
+
expected: "(string | undefined)",
|
|
163
|
+
value: input.registry
|
|
164
|
+
}, _errorFactory)) && (void 0 === input.tag || "string" === typeof input.tag || _assertGuard(_exceptionable, {
|
|
165
|
+
method: "typia.createAssert",
|
|
166
|
+
path: _path + ".tag",
|
|
167
|
+
expected: "(string | undefined)",
|
|
168
|
+
value: input.tag
|
|
169
|
+
}, _errorFactory));
|
|
170
|
+
const _ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every((key) => {
|
|
171
|
+
const value = input[key];
|
|
172
|
+
if (void 0 === value) return true;
|
|
173
|
+
return "string" === typeof value || _assertGuard(_exceptionable, {
|
|
174
|
+
method: "typia.createAssert",
|
|
175
|
+
path: _path + _accessExpressionAsString(key),
|
|
176
|
+
expected: "string",
|
|
177
|
+
value
|
|
178
|
+
}, _errorFactory);
|
|
179
|
+
});
|
|
180
|
+
const __is = (input) => "object" === typeof input && null !== input && _io0(input);
|
|
181
|
+
let _errorFactory;
|
|
182
|
+
return (input, errorFactory) => {
|
|
183
|
+
if (false === __is(input)) {
|
|
184
|
+
_errorFactory = errorFactory;
|
|
185
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _assertGuard(true, {
|
|
186
|
+
method: "typia.createAssert",
|
|
187
|
+
path: _path + "",
|
|
188
|
+
expected: "PackageManifest",
|
|
189
|
+
value: input
|
|
190
|
+
}, _errorFactory)) && _ao0(input, _path + "", true) || _assertGuard(true, {
|
|
191
|
+
method: "typia.createAssert",
|
|
192
|
+
path: _path + "",
|
|
193
|
+
expected: "PackageManifest",
|
|
194
|
+
value: input
|
|
195
|
+
}, _errorFactory))(input, "$input", true);
|
|
196
|
+
}
|
|
197
|
+
return input;
|
|
198
|
+
};
|
|
199
|
+
})();
|
|
33
200
|
//#endregion
|
|
34
201
|
//#region src/plans/publish.ts
|
|
35
202
|
async function initPublishPlan(context, options) {
|
|
@@ -43,15 +210,17 @@ async function initPublishPlan(context, options) {
|
|
|
43
210
|
const packages = /* @__PURE__ */ new Map();
|
|
44
211
|
const changelogs = /* @__PURE__ */ new Map();
|
|
45
212
|
while (data = lock.read("core:changelogs")) {
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
213
|
+
const validated = validateChangelogStore(data);
|
|
214
|
+
if (!validated.success) continue;
|
|
215
|
+
const entry = validated.data;
|
|
48
216
|
const parsed = parseChangelogFile(entry.filename, entry.content);
|
|
49
217
|
if (!parsed) continue;
|
|
50
218
|
changelogs.set(parsed.id, parsed);
|
|
51
219
|
}
|
|
52
220
|
while (data = lock.read("core:packages")) {
|
|
53
|
-
const
|
|
54
|
-
if (!
|
|
221
|
+
const validated = validatePackageStore(data);
|
|
222
|
+
if (!validated.success) continue;
|
|
223
|
+
const parsed = validated.data;
|
|
55
224
|
if (!context.graph.get(parsed.id)) continue;
|
|
56
225
|
const pkgChangelogs = [];
|
|
57
226
|
for (const id of parsed.changelogIds ?? []) {
|
|
@@ -327,9 +496,9 @@ var NpmPackage = class extends WorkspacePackage {
|
|
|
327
496
|
getRegistry() {
|
|
328
497
|
return this.manifest.publishConfig?.registry ?? "https://registry.npmjs.org";
|
|
329
498
|
}
|
|
330
|
-
configureDraft(draft
|
|
331
|
-
super.configureDraft(draft
|
|
332
|
-
const { distTag = group?.options?.npm?.distTag } = this.
|
|
499
|
+
configureDraft({ draft }) {
|
|
500
|
+
super.configureDraft({ draft });
|
|
501
|
+
const { distTag = this.group?.options?.npm?.distTag } = this.options.npm ?? {};
|
|
333
502
|
if (distTag) {
|
|
334
503
|
draft.npm ??= {};
|
|
335
504
|
draft.npm.distTag = distTag;
|
|
@@ -378,11 +547,88 @@ function formatDependencySpec(spec) {
|
|
|
378
547
|
if (spec.protocol === "npm") return `npm:${spec.alias}@${spec.range}`;
|
|
379
548
|
return spec.range;
|
|
380
549
|
}
|
|
381
|
-
const
|
|
382
|
-
id
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
550
|
+
const validateNpmPackageLock = (() => {
|
|
551
|
+
const _io0 = (input) => "string" === typeof input.id && (void 0 === input.distTag || "string" === typeof input.distTag);
|
|
552
|
+
const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.id || _report(_exceptionable, {
|
|
553
|
+
path: _path + ".id",
|
|
554
|
+
expected: "string",
|
|
555
|
+
value: input.id
|
|
556
|
+
}), void 0 === input.distTag || "string" === typeof input.distTag || _report(_exceptionable, {
|
|
557
|
+
path: _path + ".distTag",
|
|
558
|
+
expected: "(string | undefined)",
|
|
559
|
+
value: input.distTag
|
|
560
|
+
})].every((flag) => flag);
|
|
561
|
+
const __is = (input) => "object" === typeof input && null !== input && _io0(input);
|
|
562
|
+
let errors;
|
|
563
|
+
let _report;
|
|
564
|
+
return _createStandardSchema((input) => {
|
|
565
|
+
if (false === __is(input)) {
|
|
566
|
+
errors = [];
|
|
567
|
+
_report = _validateReport(errors);
|
|
568
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
569
|
+
path: _path + "",
|
|
570
|
+
expected: "NpmPackageLock",
|
|
571
|
+
value: input
|
|
572
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
573
|
+
path: _path + "",
|
|
574
|
+
expected: "NpmPackageLock",
|
|
575
|
+
value: input
|
|
576
|
+
}))(input, "$input", true);
|
|
577
|
+
const success = 0 === errors.length;
|
|
578
|
+
return success ? {
|
|
579
|
+
success,
|
|
580
|
+
data: input
|
|
581
|
+
} : {
|
|
582
|
+
success,
|
|
583
|
+
errors,
|
|
584
|
+
data: input
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
return {
|
|
588
|
+
success: true,
|
|
589
|
+
data: input
|
|
590
|
+
};
|
|
591
|
+
});
|
|
592
|
+
})();
|
|
593
|
+
const validateNpmMarkLatestLock = (() => {
|
|
594
|
+
const _io0 = (input) => "string" === typeof input.id;
|
|
595
|
+
const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.id || _report(_exceptionable, {
|
|
596
|
+
path: _path + ".id",
|
|
597
|
+
expected: "string",
|
|
598
|
+
value: input.id
|
|
599
|
+
})].every((flag) => flag);
|
|
600
|
+
const __is = (input) => "object" === typeof input && null !== input && _io0(input);
|
|
601
|
+
let errors;
|
|
602
|
+
let _report;
|
|
603
|
+
return _createStandardSchema((input) => {
|
|
604
|
+
if (false === __is(input)) {
|
|
605
|
+
errors = [];
|
|
606
|
+
_report = _validateReport(errors);
|
|
607
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
608
|
+
path: _path + "",
|
|
609
|
+
expected: "NpmMarkLatestLock",
|
|
610
|
+
value: input
|
|
611
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
612
|
+
path: _path + "",
|
|
613
|
+
expected: "NpmMarkLatestLock",
|
|
614
|
+
value: input
|
|
615
|
+
}))(input, "$input", true);
|
|
616
|
+
const success = 0 === errors.length;
|
|
617
|
+
return success ? {
|
|
618
|
+
success,
|
|
619
|
+
data: input
|
|
620
|
+
} : {
|
|
621
|
+
success,
|
|
622
|
+
errors,
|
|
623
|
+
data: input
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
return {
|
|
627
|
+
success: true,
|
|
628
|
+
data: input
|
|
629
|
+
};
|
|
630
|
+
});
|
|
631
|
+
})();
|
|
386
632
|
function npm({ client: defaultClient, onBreakPeerDep = "set", updateLockFile = true, trustedPublish, bumpDep: getBumpDepType = ({ kind }) => {
|
|
387
633
|
switch (kind) {
|
|
388
634
|
case "dependencies":
|
|
@@ -432,15 +678,17 @@ function npm({ client: defaultClient, onBreakPeerDep = "set", updateLockFile = t
|
|
|
432
678
|
initPublishPlan({ lock, plan }) {
|
|
433
679
|
let data;
|
|
434
680
|
while (data = lock.read("npm:packages")) {
|
|
435
|
-
const
|
|
436
|
-
if (!
|
|
681
|
+
const validated = validateNpmPackageLock(data);
|
|
682
|
+
if (!validated.success) continue;
|
|
683
|
+
const parsed = validated.data;
|
|
437
684
|
const packagePlan = plan.packages.get(parsed.id);
|
|
438
685
|
if (!packagePlan) continue;
|
|
439
686
|
packagePlan.npm = { distTag: parsed.distTag };
|
|
440
687
|
}
|
|
441
688
|
while (data = lock.read("npm:mark-latest")) {
|
|
442
|
-
const
|
|
443
|
-
if (!
|
|
689
|
+
const validated = validateNpmMarkLatestLock(data);
|
|
690
|
+
if (!validated.success) continue;
|
|
691
|
+
const parsed = validated.data;
|
|
444
692
|
const packagePlan = plan.packages.get(parsed.id);
|
|
445
693
|
if (!packagePlan) continue;
|
|
446
694
|
packagePlan.npm ??= {};
|
|
@@ -568,11 +816,10 @@ function depsPolicy(context, getBumpDepType) {
|
|
|
568
816
|
if (!(pkg instanceof NpmPackage)) return;
|
|
569
817
|
const deps = dependentMap.get(pkg.id);
|
|
570
818
|
if (!deps) return;
|
|
571
|
-
const group = graph.getPackageGroup(pkg.id);
|
|
572
819
|
const bumped = plan.bumpVersion(pkg);
|
|
573
820
|
if (!bumped) return;
|
|
574
821
|
for (const dep of deps) {
|
|
575
|
-
if (group?.options.syncBump &&
|
|
822
|
+
if (pkg.group?.options.syncBump && dep.dependent.group === pkg.group) continue;
|
|
576
823
|
if (!needsUpdate(dep.spec, bumped)) continue;
|
|
577
824
|
const bumpType = getBumpDepType(dep);
|
|
578
825
|
if (bumpType === false) continue;
|
|
@@ -643,7 +890,7 @@ async function isPackagePublished(name, version, registry) {
|
|
|
643
890
|
}
|
|
644
891
|
async function discoverNpmPackages(cwd, add) {
|
|
645
892
|
const rootManifest = await readManifest(cwd).catch(() => void 0);
|
|
646
|
-
const pnpmPatterns = await readFile(path.join(cwd, "pnpm-workspace.yaml"), "utf8").then((content) =>
|
|
893
|
+
const pnpmPatterns = await readFile(path.join(cwd, "pnpm-workspace.yaml"), "utf8").then((content) => assertPnpmWorkspace(parse$1(content))).catch((error) => {
|
|
647
894
|
if (isNodeError(error) && error.code === "ENOENT") return void 0;
|
|
648
895
|
throw error;
|
|
649
896
|
});
|
|
@@ -675,7 +922,7 @@ async function expandWorkspacePatterns(cwd, patterns) {
|
|
|
675
922
|
async function readManifest(packagePath) {
|
|
676
923
|
const content = await readFile(path.join(packagePath, "package.json"), "utf8");
|
|
677
924
|
const parsed = JSON.parse(content);
|
|
678
|
-
|
|
925
|
+
assertPackageManifest(parsed);
|
|
679
926
|
return parsed;
|
|
680
927
|
}
|
|
681
928
|
//#endregion
|
package/dist/plugins/cargo.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as CargoPackage, S as CargoGraph, T as cargo, w as CargoPluginOptions } from "../types-
|
|
1
|
+
import { C as CargoPackage, S as CargoGraph, T as cargo, w as CargoPluginOptions } from "../types-VvvN6oyT.js";
|
|
2
2
|
export { CargoGraph, CargoPackage, CargoPluginOptions, cargo };
|