tegami 1.2.1 → 1.2.3

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.
Files changed (30) hide show
  1. package/dist/{_accessExpressionAsString-QhbUZzwv.js → _accessExpressionAsString-DW_6Xqcp.js} +1 -1
  2. package/dist/{_assertGuard-BBn2NbSz.js → _assertGuard-CFFC1Up9.js} +2 -2
  3. package/dist/{_createStandardSchema-BGQyz-uA.js → _createStandardSchema-CrRqJgaE.js} +2 -2
  4. package/dist/cli/index.d.ts +1 -1
  5. package/dist/cli/index.js +2 -3
  6. package/dist/{generate-Cnd8RiKO.js → generate-Cgl2G5ea.js} +2 -2
  7. package/dist/generators/simple.d.ts +1 -1
  8. package/dist/generators/simple.js +1 -1
  9. package/dist/{graph-BmXTJZxx.js → graph-DaJ28Y4f.js} +1 -1
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.js +5 -4
  12. package/dist/{npm-4iA03RvC.js → npm-uJA8deYA.js} +253 -131
  13. package/dist/plugins/cargo.d.ts +1 -1
  14. package/dist/plugins/cargo.js +3 -3
  15. package/dist/plugins/git.d.ts +1 -1
  16. package/dist/plugins/github.d.ts +2 -2
  17. package/dist/plugins/github.js +8 -46
  18. package/dist/plugins/gitlab.d.ts +2 -2
  19. package/dist/plugins/gitlab.js +8 -45
  20. package/dist/plugins/go.d.ts +1 -1
  21. package/dist/plugins/go.js +2 -2
  22. package/dist/providers/npm.d.ts +1 -1
  23. package/dist/providers/npm.js +1 -1
  24. package/dist/{publish-Bt3e1RPs.js → publish-BEYIILK5.js} +6 -12
  25. package/dist/{semver-EKJ8yK5U.js → semver-DrtaCCZK.js} +15 -3
  26. package/dist/{shared-C_iSTp_s.js → shared-pTOZU5UZ.js} +11 -3
  27. package/dist/{types-BbwOrNZ2.d.ts → types-Kj7Nxbjz.d.ts} +27 -23
  28. package/dist/{version-request-BQwP7EWa.d.ts → version-request-C5vtakPE.d.ts} +1 -1
  29. package/dist/{version-request-DvWVAYj2.js → version-request-C89RO85i.js} +73 -27
  30. package/package.json +5 -4
@@ -1,4 +1,4 @@
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
1
+ //#region ../../node_modules/.pnpm/typia@12.1.1_@types+node@26.1.0_typescript@6.0.3/node_modules/typia/lib/internal/_accessExpressionAsString.mjs
2
2
  const _accessExpressionAsString = (str) => variable(str) ? `.${str}` : `[${JSON.stringify(str)}]`;
3
3
  const variable = (str) => reserved(str) === false && /^[a-zA-Z_$][a-zA-Z_$0-9]*$/g.test(str);
4
4
  const reserved = (str) => RESERVED.has(str);
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/typia@12.1.1_@types+node@26.0.1_typescript@6.0.3/node_modules/typia/lib/TypeGuardError.mjs
1
+ //#region ../../node_modules/.pnpm/typia@12.1.1_@types+node@26.1.0_typescript@6.0.3/node_modules/typia/lib/TypeGuardError.mjs
2
2
  /**
3
3
  * Error thrown when type assertion fails.
4
4
  *
@@ -81,7 +81,7 @@ var TypeGuardError = class extends Error {
81
81
  }
82
82
  };
83
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
84
+ //#region ../../node_modules/.pnpm/typia@12.1.1_@types+node@26.1.0_typescript@6.0.3/node_modules/typia/lib/internal/_assertGuard.mjs
85
85
  const _assertGuard = (exceptionable, props, factory) => {
86
86
  if (exceptionable === true) if (factory) throw factory(props);
87
87
  else throw new TypeGuardError(props);
@@ -1,4 +1,4 @@
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
1
+ //#region ../../node_modules/.pnpm/typia@12.1.1_@types+node@26.1.0_typescript@6.0.3/node_modules/typia/lib/internal/_validateReport.mjs
2
2
  const _validateReport = (array) => {
3
3
  const reportable = (path) => {
4
4
  if (array.length === 0) return true;
@@ -18,7 +18,7 @@ const _validateReport = (array) => {
18
18
  };
19
19
  };
20
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
21
+ //#region ../../node_modules/.pnpm/typia@12.1.1_@types+node@26.1.0_typescript@6.0.3/node_modules/typia/lib/internal/_createStandardSchema.mjs
22
22
  const _createStandardSchema = (fn) => Object.assign(fn, { "~standard": {
23
23
  version: 1,
24
24
  vendor: "typia",
@@ -1,4 +1,4 @@
1
- import { f as Tegami, j as Draft, t as Awaitable, v as PublishPlan } from "../types-BbwOrNZ2.js";
1
+ import { M as Draft, f as Tegami, t as Awaitable, y as PublishPlan } from "../types-Kj7Nxbjz.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-Cnd8RiKO.js";
1
+ import { n as generateFromCommits, t as changelogFilename } from "../generate-Cgl2G5ea.js";
2
2
  import { i as handlePluginError, s as isCI, t as CancelledError } from "../error-CAsrGb6e.js";
3
- import { t as renderChangelog } from "../shared-C_iSTp_s.js";
3
+ import { n as renderChangelog } from "../shared-pTOZU5UZ.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";
@@ -42,7 +42,6 @@ function resolveChangedPackages(graph, files, cwd) {
42
42
  //#region src/cli/changelog.ts
43
43
  async function runChangelogTui(tegami) {
44
44
  const context = await tegami._internal.context();
45
- if (await tegami.publishStatus() === "pending") throw new Error(`Publish lock at ${context.lockPath} is still pending. Publish it before applying a new draft.`);
46
45
  intro("Create changelogs");
47
46
  let selectedPackages = [];
48
47
  if (!isCI()) selectedPackages = await promptPackageSelection(context.graph, context.cwd);
@@ -1,6 +1,6 @@
1
- import { a as maxBump, t as bumpDepth } from "./semver-EKJ8yK5U.js";
1
+ import { o as maxBump, t as bumpDepth } from "./semver-DrtaCCZK.js";
2
2
  import { n as execFailure } from "./error-CAsrGb6e.js";
3
- import { t as renderChangelog } from "./shared-C_iSTp_s.js";
3
+ import { n as renderChangelog } from "./shared-pTOZU5UZ.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-BbwOrNZ2.js";
1
+ import { r as LogGenerator } from "../types-Kj7Nxbjz.js";
2
2
 
3
3
  //#region src/generators/simple.d.ts
4
4
  declare function simpleGenerator(): LogGenerator;
@@ -1,4 +1,4 @@
1
- import { i as formatPackageVersion } from "../semver-EKJ8yK5U.js";
1
+ import { a as formatPackageVersion } from "../semver-DrtaCCZK.js";
2
2
  //#region src/generators/simple.ts
3
3
  function simpleGenerator() {
4
4
  return { generate({ pkg, packageDraft }) {
@@ -1,4 +1,4 @@
1
- import { n as bumpVersion } from "./semver-EKJ8yK5U.js";
1
+ import { n as bumpVersion } from "./semver-DrtaCCZK.js";
2
2
  //#region src/graph.ts
3
3
  /** Package discovered in the workspace. */
4
4
  var WorkspacePackage = class {
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as WorkspacePackage, M as DraftPolicy, N as PackageDraft, O as PackageGraph, P as BumpType, _ as PublishOptions, a as PublishPreflight, b as TegamiContext, c as TegamiPluginOption, d as GenerateChangelogOptions, f as Tegami, g as PackagePublishResult, h as PackagePublishPlan, i as PackageOptions, j as Draft, k as PackageGroup, m as PublishLock, n as GroupOptions, o as TegamiOptions, p as tegami, r as LogGenerator, s as TegamiPlugin, v as PublishPlan, y as CommitChangelog } from "./types-BbwOrNZ2.js";
1
+ import { A as PackageGroup, F as BumpType, M as Draft, N as DraftPolicy, P as PackageDraft, _ as PackagePublishResult, a as PublishPreflight, b as CommitChangelog, c as TegamiPluginOption, d as GenerateChangelogOptions, f as Tegami, g as PackagePublishPlan, h as PublishLock, i as PackageOptions, k as PackageGraph, m as tegami, n as GroupOptions, o as TegamiOptions, p as WorkspacePackage, r as LogGenerator, s as TegamiPlugin, v as PublishOptions, x as TegamiContext, y as PublishPlan } from "./types-Kj7Nxbjz.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-Cnd8RiKO.js";
1
+ import { n as generateFromCommits } from "./generate-Cgl2G5ea.js";
2
2
  import { i as handlePluginError } from "./error-CAsrGb6e.js";
3
- import { a as createDraft, c as parseChangelogFile, i as runPublishPlan, l as readChangelogEntries, n as publishPlanStatus, r as runPreflights, t as initPublishPlan } from "./publish-Bt3e1RPs.js";
4
- import { t as npm } from "./npm-4iA03RvC.js";
5
- import { n as WorkspacePackage, t as PackageGraph } from "./graph-BmXTJZxx.js";
3
+ import { t as npm } from "./npm-uJA8deYA.js";
4
+ import { a as createDraft, c as parseChangelogFile, i as runPublishPlan, l as readChangelogEntries, n as publishPlanStatus, r as runPreflights, t as initPublishPlan } from "./publish-BEYIILK5.js";
5
+ import { n as WorkspacePackage$1, t as PackageGraph } from "./graph-DaJ28Y4f.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
@@ -55,6 +55,7 @@ function resolvePlugins(plugins = []) {
55
55
  }
56
56
  //#endregion
57
57
  //#region src/index.ts
58
+ const WorkspacePackage = WorkspacePackage$1;
58
59
  /** Create a Tegami project handle. */
59
60
  function tegami(options = {}) {
60
61
  let $context;
@@ -1,18 +1,178 @@
1
1
  import { a as isNodeError, c as joinPath, n as execFailure, r as fetchFailure } from "./error-CAsrGb6e.js";
2
- import { t as _accessExpressionAsString } from "./_accessExpressionAsString-QhbUZzwv.js";
3
- import { n as _validateReport, t as _createStandardSchema } from "./_createStandardSchema-BGQyz-uA.js";
4
- import { r as runPreflights, s as parsePublishLock, t as initPublishPlan } from "./publish-Bt3e1RPs.js";
5
- import { t as _assertGuard } from "./_assertGuard-BBn2NbSz.js";
6
- import { n as WorkspacePackage } from "./graph-BmXTJZxx.js";
2
+ import { t as _accessExpressionAsString } from "./_accessExpressionAsString-DW_6Xqcp.js";
3
+ import { n as _validateReport, t as _createStandardSchema } from "./_createStandardSchema-CrRqJgaE.js";
4
+ import { r as runPreflights, s as parsePublishLock, t as initPublishPlan } from "./publish-BEYIILK5.js";
5
+ import { t as _assertGuard } from "./_assertGuard-CFFC1Up9.js";
6
+ import { n as WorkspacePackage } from "./graph-DaJ28Y4f.js";
7
7
  import fs, { readFile, writeFile } from "node:fs/promises";
8
8
  import path, { join } from "node:path";
9
9
  import { x } from "tinyexec";
10
10
  import * as semver$1 from "semver";
11
- import { parseDocument } from "yaml";
12
- import { detect } from "package-manager-detector";
11
+ import { isSeq, parseDocument } from "yaml";
12
+ import process from "node:process";
13
13
  import { tmpdir } from "node:os";
14
14
  import { intro, note, outro } from "@clack/prompts";
15
15
  import { glob } from "tinyglobby";
16
+ //#region ../../node_modules/.pnpm/package-manager-detector@1.7.0/node_modules/package-manager-detector/dist/constants.mjs
17
+ const AGENTS = [
18
+ "npm",
19
+ "yarn",
20
+ "yarn@berry",
21
+ "pnpm",
22
+ "pnpm@6",
23
+ "bun",
24
+ "deno",
25
+ "nub",
26
+ "aube"
27
+ ];
28
+ const LOCKS = {
29
+ "aube-lock.yaml": "aube",
30
+ "aube-workspace.yaml": "aube",
31
+ "bun.lock": "bun",
32
+ "bun.lockb": "bun",
33
+ "deno.lock": "deno",
34
+ "pnpm-lock.yaml": "pnpm",
35
+ "pnpm-workspace.yaml": "pnpm",
36
+ "yarn.lock": "yarn",
37
+ "package-lock.json": "npm",
38
+ "npm-shrinkwrap.json": "npm"
39
+ };
40
+ const INSTALL_METADATA = {
41
+ "node_modules/.aube/": "aube",
42
+ "node_modules/.deno/": "deno",
43
+ "node_modules/.pnpm/": "pnpm",
44
+ "node_modules/.yarn-state.yml": "yarn",
45
+ "node_modules/.yarn_integrity": "yarn",
46
+ "node_modules/.package-lock.json": "npm",
47
+ ".pnp.cjs": "yarn",
48
+ ".pnp.js": "yarn",
49
+ "bun.lock": "bun",
50
+ "bun.lockb": "bun"
51
+ };
52
+ //#endregion
53
+ //#region ../../node_modules/.pnpm/package-manager-detector@1.7.0/node_modules/package-manager-detector/dist/detect.mjs
54
+ async function pathExists(path2, type) {
55
+ try {
56
+ const stat = await fs.stat(path2);
57
+ return type === "file" ? stat.isFile() : stat.isDirectory();
58
+ } catch {
59
+ return false;
60
+ }
61
+ }
62
+ function* lookup(cwd = process.cwd()) {
63
+ let directory = path.resolve(cwd);
64
+ const { root } = path.parse(directory);
65
+ while (directory && directory !== root) {
66
+ yield directory;
67
+ directory = path.dirname(directory);
68
+ }
69
+ }
70
+ async function parsePackageJson(filepath, options) {
71
+ if (!filepath || !await pathExists(filepath, "file")) return null;
72
+ return await handlePackageManager(filepath, options);
73
+ }
74
+ async function detect(options = {}) {
75
+ const { cwd, strategies = [
76
+ "lockfile",
77
+ "packageManager-field",
78
+ "devEngines-field"
79
+ ] } = options;
80
+ let stopDir;
81
+ if (typeof options.stopDir === "string") {
82
+ const resolved = path.resolve(options.stopDir);
83
+ stopDir = (dir) => dir === resolved;
84
+ } else stopDir = options.stopDir;
85
+ for (const directory of lookup(cwd)) {
86
+ for (const strategy of strategies) switch (strategy) {
87
+ case "lockfile":
88
+ for (const lock of Object.keys(LOCKS)) if (await pathExists(path.join(directory, lock), "file")) {
89
+ const name = LOCKS[lock];
90
+ const result = await parsePackageJson(path.join(directory, "package.json"), options);
91
+ if (result) return result;
92
+ else return {
93
+ name,
94
+ agent: name
95
+ };
96
+ }
97
+ break;
98
+ case "packageManager-field":
99
+ case "devEngines-field": {
100
+ const result = await parsePackageJson(path.join(directory, "package.json"), options);
101
+ if (result) return result;
102
+ break;
103
+ }
104
+ case "install-metadata":
105
+ for (const metadata of Object.keys(INSTALL_METADATA)) {
106
+ const fileOrDir = metadata.endsWith("/") ? "dir" : "file";
107
+ if (await pathExists(path.join(directory, metadata), fileOrDir)) {
108
+ const name = INSTALL_METADATA[metadata];
109
+ return {
110
+ name,
111
+ agent: name === "yarn" ? isMetadataYarnClassic(metadata) ? "yarn" : "yarn@berry" : name
112
+ };
113
+ }
114
+ }
115
+ break;
116
+ }
117
+ if (stopDir?.(directory)) break;
118
+ }
119
+ return null;
120
+ }
121
+ function getNameAndVer(pkg) {
122
+ const handelVer = (version) => version?.match(/\d+(\.\d+){0,2}/)?.[0] ?? version;
123
+ if (typeof pkg.packageManager === "string") {
124
+ const [name, ver] = pkg.packageManager.replace(/^\^/, "").split("@");
125
+ return {
126
+ name,
127
+ ver: handelVer(ver)
128
+ };
129
+ }
130
+ if (typeof pkg.devEngines?.packageManager?.name === "string") return {
131
+ name: pkg.devEngines.packageManager.name,
132
+ ver: handelVer(pkg.devEngines.packageManager.version)
133
+ };
134
+ }
135
+ async function handlePackageManager(filepath, options) {
136
+ try {
137
+ const content = await fs.readFile(filepath, "utf8");
138
+ const pkg = options.packageJsonParser ? await options.packageJsonParser(content, filepath) : JSON.parse(content);
139
+ let agent;
140
+ const nameAndVer = getNameAndVer(pkg);
141
+ if (nameAndVer) {
142
+ const name = nameAndVer.name;
143
+ const ver = nameAndVer.ver;
144
+ let version = ver;
145
+ if (name === "yarn" && ver && Number.parseInt(ver) > 1) {
146
+ agent = "yarn@berry";
147
+ version = "berry";
148
+ return {
149
+ name,
150
+ agent,
151
+ version
152
+ };
153
+ } else if (name === "pnpm" && ver && Number.parseInt(ver) < 7) {
154
+ agent = "pnpm@6";
155
+ return {
156
+ name,
157
+ agent,
158
+ version
159
+ };
160
+ } else if (AGENTS.includes(name)) {
161
+ agent = name;
162
+ return {
163
+ name,
164
+ agent,
165
+ version
166
+ };
167
+ } else return options.onUnknown?.(pkg.packageManager) ?? null;
168
+ }
169
+ } catch {}
170
+ return null;
171
+ }
172
+ function isMetadataYarnClassic(metadataPath) {
173
+ return metadataPath.endsWith(".yarn_integrity");
174
+ }
175
+ //#endregion
16
176
  //#region src/providers/npm/cli.ts
17
177
  const PLACEHOLDER_VERSION = "0.0.0-tegami-trusted-publish-setup";
18
178
  const PLACEHOLDER_DIST_TAG = "temp";
@@ -188,99 +348,6 @@ var NpmPackage = class extends WorkspacePackage {
188
348
  return this.dependencies ??= listDependencies(graph, this);
189
349
  }
190
350
  };
191
- const assertPnpmWorkspace = (() => {
192
- const _io0 = (input) => (void 0 === input.packages || Array.isArray(input.packages) && input.packages.every((elem) => "string" === typeof elem)) && (void 0 === input.catalog || "object" === typeof input.catalog && null !== input.catalog && false === Array.isArray(input.catalog) && _io1(input.catalog)) && (void 0 === input.catalogs || "object" === typeof input.catalogs && null !== input.catalogs && false === Array.isArray(input.catalogs) && _io2(input.catalogs));
193
- const _io1 = (input) => Object.keys(input).every((key) => {
194
- const value = input[key];
195
- if (void 0 === value) return true;
196
- return "string" === typeof value;
197
- });
198
- const _io2 = (input) => Object.keys(input).every((key) => {
199
- const value = input[key];
200
- if (void 0 === value) return true;
201
- return "object" === typeof value && null !== value && false === Array.isArray(value) && _io1(value);
202
- });
203
- const _ao0 = (input, _path, _exceptionable = true) => (void 0 === input.packages || (Array.isArray(input.packages) || _assertGuard(_exceptionable, {
204
- method: "typia.createAssert",
205
- path: _path + ".packages",
206
- expected: "(Array<string> | undefined)",
207
- value: input.packages
208
- }, _errorFactory)) && input.packages.every((elem, _index2) => "string" === typeof elem || _assertGuard(_exceptionable, {
209
- method: "typia.createAssert",
210
- path: _path + ".packages[" + _index2 + "]",
211
- expected: "string",
212
- value: elem
213
- }, _errorFactory)) || _assertGuard(_exceptionable, {
214
- method: "typia.createAssert",
215
- path: _path + ".packages",
216
- expected: "(Array<string> | undefined)",
217
- value: input.packages
218
- }, _errorFactory)) && (void 0 === input.catalog || ("object" === typeof input.catalog && null !== input.catalog && false === Array.isArray(input.catalog) || _assertGuard(_exceptionable, {
219
- method: "typia.createAssert",
220
- path: _path + ".catalog",
221
- expected: "(Record<string, string> | undefined)",
222
- value: input.catalog
223
- }, _errorFactory)) && _ao1(input.catalog, _path + ".catalog", _exceptionable) || _assertGuard(_exceptionable, {
224
- method: "typia.createAssert",
225
- path: _path + ".catalog",
226
- expected: "(Record<string, string> | undefined)",
227
- value: input.catalog
228
- }, _errorFactory)) && (void 0 === input.catalogs || ("object" === typeof input.catalogs && null !== input.catalogs && false === Array.isArray(input.catalogs) || _assertGuard(_exceptionable, {
229
- method: "typia.createAssert",
230
- path: _path + ".catalogs",
231
- expected: "(Record<string, Record<string, string>> | undefined)",
232
- value: input.catalogs
233
- }, _errorFactory)) && _ao2(input.catalogs, _path + ".catalogs", _exceptionable) || _assertGuard(_exceptionable, {
234
- method: "typia.createAssert",
235
- path: _path + ".catalogs",
236
- expected: "(Record<string, Record<string, string>> | undefined)",
237
- value: input.catalogs
238
- }, _errorFactory));
239
- const _ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every((key) => {
240
- const value = input[key];
241
- if (void 0 === value) return true;
242
- return "string" === typeof value || _assertGuard(_exceptionable, {
243
- method: "typia.createAssert",
244
- path: _path + _accessExpressionAsString(key),
245
- expected: "string",
246
- value
247
- }, _errorFactory);
248
- });
249
- const _ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every((key) => {
250
- const value = input[key];
251
- if (void 0 === value) return true;
252
- return ("object" === typeof value && null !== value && false === Array.isArray(value) || _assertGuard(_exceptionable, {
253
- method: "typia.createAssert",
254
- path: _path + _accessExpressionAsString(key),
255
- expected: "Record<string, string>",
256
- value
257
- }, _errorFactory)) && _ao1(value, _path + _accessExpressionAsString(key), _exceptionable) || _assertGuard(_exceptionable, {
258
- method: "typia.createAssert",
259
- path: _path + _accessExpressionAsString(key),
260
- expected: "Record<string, string>",
261
- value
262
- }, _errorFactory);
263
- });
264
- const __is = (input) => "object" === typeof input && null !== input && false === Array.isArray(input) && _io0(input);
265
- let _errorFactory;
266
- return (input, errorFactory) => {
267
- if (false === __is(input)) {
268
- _errorFactory = errorFactory;
269
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || _assertGuard(true, {
270
- method: "typia.createAssert",
271
- path: _path + "",
272
- expected: "PnpmWorkspace",
273
- value: input
274
- }, _errorFactory)) && _ao0(input, _path + "", true) || _assertGuard(true, {
275
- method: "typia.createAssert",
276
- path: _path + "",
277
- expected: "PnpmWorkspace",
278
- value: input
279
- }, _errorFactory))(input, "$input", true);
280
- }
281
- return input;
282
- };
283
- })();
284
351
  const assertPackageManifest = (() => {
285
352
  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)) && null !== input.workspaces && (void 0 === input.workspaces || Array.isArray(input.workspaces) && input.workspaces.every((elem) => "string" === typeof elem) || "object" === typeof input.workspaces && null !== input.workspaces && false === Array.isArray(input.workspaces) && _io3(input.workspaces)) && (void 0 === input.catalog || "object" === typeof input.catalog && null !== input.catalog && false === Array.isArray(input.catalog) && _io2(input.catalog)) && (void 0 === input.catalogs || "object" === typeof input.catalogs && null !== input.catalogs && false === Array.isArray(input.catalogs) && _io4(input.catalogs)) && (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));
286
353
  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);
@@ -613,22 +680,36 @@ async function resolveNpmGraph(cwd, client) {
613
680
  if (Array.isArray(rootManifest.workspaces)) patterns.push(...rootManifest.workspaces);
614
681
  else if (rootManifest.workspaces?.packages) patterns.push(...rootManifest.workspaces.packages);
615
682
  }
616
- if (client === "pnpm") {
617
- const pnpmWorkspacePath = path.join(cwd, "pnpm-workspace.yaml");
618
- const content = await readFile(pnpmWorkspacePath, "utf8").catch((error) => {
683
+ let workspaceFiles;
684
+ switch (client) {
685
+ case "pnpm":
686
+ workspaceFiles = ["pnpm-workspace.yaml"];
687
+ break;
688
+ case "nub":
689
+ workspaceFiles = ["pnpm-workspace.yaml"];
690
+ break;
691
+ case "aube":
692
+ workspaceFiles = ["pnpm-workspace.yaml", "aube-workspace.yaml"];
693
+ break;
694
+ case "yarn":
695
+ const yarnCatalog = await readYarnCatalog(cwd);
696
+ if (yarnCatalog) catalogSources.push(yarnCatalog);
697
+ break;
698
+ }
699
+ if (workspaceFiles) await Promise.all(workspaceFiles.map(async (name) => {
700
+ const filePath = path.join(cwd, name);
701
+ const content = await readFile(filePath, "utf8").catch((error) => {
619
702
  if (isNodeError(error) && error.code === "ENOENT") return void 0;
620
703
  throw error;
621
704
  });
622
- if (content) {
623
- const doc = parseDocument(content);
624
- const data = assertPnpmWorkspace(doc.toJSON());
625
- catalogSources.push(createPnpmCatalogSource(pnpmWorkspacePath, doc));
626
- patterns.push(...data.packages ?? []);
705
+ if (!content) return;
706
+ const doc = parseDocument(content);
707
+ const packages = doc.get("packages");
708
+ catalogSources.push(createWorkspaceCatalogSource(filePath, doc));
709
+ if (isSeq(packages)) {
710
+ for (const pkg of packages.toJSON()) if (typeof pkg === "string") patterns.push(pkg);
627
711
  }
628
- } else if (client === "yarn") {
629
- const yarnCatalog = await readYarnCatalog(cwd);
630
- if (yarnCatalog) catalogSources.push(yarnCatalog);
631
- }
712
+ }));
632
713
  if (patterns?.length) {
633
714
  const candidatePaths = await expandWorkspacePatterns(cwd, patterns);
634
715
  await Promise.all(candidatePaths.map(async (packagePath) => {
@@ -714,7 +795,7 @@ async function readManifest(packagePath) {
714
795
  assertPackageManifest(parsed);
715
796
  return parsed;
716
797
  }
717
- function createPnpmCatalogSource(filePath, doc) {
798
+ function createWorkspaceCatalogSource(filePath, doc) {
718
799
  return {
719
800
  resolve(name, catalogName) {
720
801
  const value = doc.getIn(catalogName === "default" ? ["catalog", name] : [
@@ -886,15 +967,21 @@ function npm({ client: defaultClient, onBreakPeerDep = "set", updateLockFile = t
886
967
  return "major";
887
968
  }
888
969
  } } = {}) {
889
- let active = false;
890
- let client;
891
970
  return {
892
971
  name: "npm",
893
972
  enforce: "pre",
894
973
  async init() {
895
- if (defaultClient) client = defaultClient;
896
- else client = (await detect({ cwd: this.cwd }))?.name ?? "npm";
897
- this.npm = { client };
974
+ if (defaultClient) this.npm = {
975
+ client: defaultClient,
976
+ agent: defaultClient
977
+ };
978
+ else {
979
+ const result = await detect({ cwd: this.cwd });
980
+ this.npm = {
981
+ client: result?.name ?? "npm",
982
+ agent: result?.agent ?? "npm"
983
+ };
984
+ }
898
985
  },
899
986
  async resolve() {
900
987
  if (!this.npm) return;
@@ -902,7 +989,6 @@ function npm({ client: defaultClient, onBreakPeerDep = "set", updateLockFile = t
902
989
  if (graph.packages.size === 0) return;
903
990
  this.npm.graph = graph;
904
991
  for (const pkg of graph.packages.values()) this.graph.add(pkg);
905
- active = true;
906
992
  },
907
993
  async publishPreflight({ pkg }) {
908
994
  if (!(pkg instanceof NpmPackage) || !this.npm?.graph) return;
@@ -914,7 +1000,7 @@ function npm({ client: defaultClient, onBreakPeerDep = "set", updateLockFile = t
914
1000
  };
915
1001
  },
916
1002
  resolvePlanStatus({ plan }) {
917
- if (!active) return;
1003
+ if (!this.npm?.graph) return;
918
1004
  return Array.from(plan.packages, async ([id, { preflight }]) => {
919
1005
  if (!preflight.shouldPublish) return;
920
1006
  const pkg = this.graph.get(id);
@@ -952,9 +1038,9 @@ function npm({ client: defaultClient, onBreakPeerDep = "set", updateLockFile = t
952
1038
  }
953
1039
  },
954
1040
  async publish({ pkg, plan }) {
955
- if (!(pkg instanceof NpmPackage)) return;
1041
+ if (!(pkg instanceof NpmPackage) || !this.npm) return;
956
1042
  const { distTag, markLatest } = plan.packages.get(pkg.id)?.npm ?? {};
957
- const result = await publish(client, pkg, distTag);
1043
+ const result = await publish(this.npm.client, pkg, distTag);
958
1044
  if (result.type === "published" && markLatest) {
959
1045
  const tagResult = await x("npm", [
960
1046
  "dist-tag",
@@ -972,11 +1058,11 @@ function npm({ client: defaultClient, onBreakPeerDep = "set", updateLockFile = t
972
1058
  return result;
973
1059
  },
974
1060
  initDraft(plan) {
975
- if (!active) return;
1061
+ if (!this.npm?.graph) return;
976
1062
  plan.addPolicy(depsPolicy(this, getBumpDepType));
977
1063
  },
978
1064
  async applyDraft(draft) {
979
- if (!active || !this.npm?.graph) return;
1065
+ if (!this.npm?.graph) return;
980
1066
  const npmGraph = this.npm.graph;
981
1067
  const writes = [];
982
1068
  for (const pkg of npmGraph.packages.values()) {
@@ -1003,8 +1089,35 @@ function npm({ client: defaultClient, onBreakPeerDep = "set", updateLockFile = t
1003
1089
  await Promise.all(writes);
1004
1090
  },
1005
1091
  async applyCliDraft() {
1006
- if (!active || !updateLockFile) return;
1007
- const result = await x(client, ["install"], { nodeOptions: { cwd: this.cwd } });
1092
+ if (!this.npm?.graph || !updateLockFile) return;
1093
+ let args;
1094
+ switch (this.npm.agent) {
1095
+ case "pnpm":
1096
+ case "pnpm@6":
1097
+ case "aube":
1098
+ case "nub":
1099
+ args = [
1100
+ "install",
1101
+ "--lockfile-only",
1102
+ "--no-frozen-lockfile"
1103
+ ];
1104
+ break;
1105
+ case "npm":
1106
+ args = ["install", "--package-lock-only"];
1107
+ break;
1108
+ case "bun":
1109
+ args = ["install", "--lockfile-only"];
1110
+ break;
1111
+ case "yarn@berry":
1112
+ args = [
1113
+ "install",
1114
+ "--mode=update-lockfile",
1115
+ "--no-immutable"
1116
+ ];
1117
+ break;
1118
+ default: args = ["install"];
1119
+ }
1120
+ const result = await x(this.npm.client, args, { nodeOptions: { cwd: this.cwd } });
1008
1121
  if (result.exitCode !== 0) throw execFailure("Failed to update lockfile.", result);
1009
1122
  },
1010
1123
  initCli(cli) {
@@ -1105,11 +1218,20 @@ async function publish(client, pkg, distTag) {
1105
1218
  let command;
1106
1219
  const args = ["publish"];
1107
1220
  if (distTag) args.push("--tag", distTag);
1108
- if (client === "pnpm") {
1109
- command = "pnpm";
1110
- args.push("--no-git-checks");
1111
- } else if (client === "yarn") command = "yarn";
1112
- else command = "npm";
1221
+ switch (client) {
1222
+ case "pnpm":
1223
+ command = "pnpm";
1224
+ args.push("--no-git-checks");
1225
+ break;
1226
+ case "aube":
1227
+ case "nub":
1228
+ case "yarn":
1229
+ command = client;
1230
+ break;
1231
+ default:
1232
+ command = "npm";
1233
+ break;
1234
+ }
1113
1235
  const result = await x(command, args, { nodeOptions: { cwd: pkg.path } });
1114
1236
  if (result.exitCode !== 0) return {
1115
1237
  type: "failed",
@@ -1,2 +1,2 @@
1
- import { D as cargo, E as CargoPluginOptions, T as CargoPackage, w as CargoGraph } from "../types-BbwOrNZ2.js";
1
+ import { D as CargoPluginOptions, E as CargoPackage, O as cargo, T as CargoGraph } from "../types-Kj7Nxbjz.js";
2
2
  export { CargoGraph, CargoPackage, CargoPluginOptions, cargo };
@@ -1,7 +1,7 @@
1
1
  import { n as execFailure, r as fetchFailure } from "../error-CAsrGb6e.js";
2
- import { t as _accessExpressionAsString } from "../_accessExpressionAsString-QhbUZzwv.js";
3
- import { t as _assertGuard } from "../_assertGuard-BBn2NbSz.js";
4
- import { n as WorkspacePackage } from "../graph-BmXTJZxx.js";
2
+ import { t as _accessExpressionAsString } from "../_accessExpressionAsString-DW_6Xqcp.js";
3
+ import { t as _assertGuard } from "../_assertGuard-CFFC1Up9.js";
4
+ import { n as WorkspacePackage } from "../graph-DaJ28Y4f.js";
5
5
  import { readFile, writeFile } from "node:fs/promises";
6
6
  import path from "node:path";
7
7
  import { x } from "tinyexec";
@@ -1,4 +1,4 @@
1
- import { s as TegamiPlugin } from "../types-BbwOrNZ2.js";
1
+ import { s as TegamiPlugin } from "../types-Kj7Nxbjz.js";
2
2
 
3
3
  //#region src/plugins/git.d.ts
4
4
  interface GitPluginOptions {
@@ -1,6 +1,6 @@
1
- import { A as WorkspacePackage, b as TegamiContext, s as TegamiPlugin, t as Awaitable, v as PublishPlan } from "../types-BbwOrNZ2.js";
1
+ import { j as WorkspacePackage, s as TegamiPlugin, t as Awaitable, x as TegamiContext, y as PublishPlan } from "../types-Kj7Nxbjz.js";
2
2
  import { GitPluginOptions } from "./git.js";
3
- import { t as VersionRequestOptions } from "../version-request-BQwP7EWa.js";
3
+ import { t as VersionRequestOptions } from "../version-request-C5vtakPE.js";
4
4
 
5
5
  //#region src/plugins/github.d.ts
6
6
  interface GithubRelease {