tegami 1.2.4 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
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
1
+ //#region ../../node_modules/.pnpm/typia@12.1.1_@types+node@26.1.1_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.1.0_typescript@6.0.3/node_modules/typia/lib/TypeGuardError.mjs
1
+ //#region ../../node_modules/.pnpm/typia@12.1.1_@types+node@26.1.1_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.1.0_typescript@6.0.3/node_modules/typia/lib/internal/_assertGuard.mjs
84
+ //#region ../../node_modules/.pnpm/typia@12.1.1_@types+node@26.1.1_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.1.0_typescript@6.0.3/node_modules/typia/lib/internal/_validateReport.mjs
1
+ //#region ../../node_modules/.pnpm/typia@12.1.1_@types+node@26.1.1_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.1.0_typescript@6.0.3/node_modules/typia/lib/internal/_createStandardSchema.mjs
21
+ //#region ../../node_modules/.pnpm/typia@12.1.1_@types+node@26.1.1_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,5 +1,4 @@
1
- import { M as Draft, f as Tegami, t as Awaitable, y as PublishPlan } from "../types-BMYzG4dR.js";
2
-
1
+ import { M as Draft, f as Tegami, t as Awaitable, v as PublishPlan } from "../types-Cn0Au3Kk.js";
3
2
  //#region src/cli/index.d.ts
4
3
  interface TegamiCLIOptions {
5
4
  /** create a custom draft, it must not be applied */
package/dist/cli/index.js CHANGED
@@ -1,14 +1,24 @@
1
- import { n as generateFromCommits, t as changelogFilename } from "../generate-Cgl2G5ea.js";
1
+ import { n as generateFromCommits, t as changelogFilename } from "../generate-Cip5o2xy.js";
2
2
  import { i as handlePluginError, s as isCI, t as CancelledError } from "../error-CAsrGb6e.js";
3
- import { n as renderChangelog } from "../shared-pTOZU5UZ.js";
3
+ import { n as renderChangelog } from "../shared-BraxbVVG.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";
7
7
  import { autocompleteMultiselect, confirm, intro, isCancel, multiline, note, outro, select, spinner } from "@clack/prompts";
8
8
  import { parseArgs } from "node:util";
9
9
  //#region src/utils/git-changes.ts
10
- async function getChangedPackages(graph, cwd) {
11
- return resolveChangedPackages(graph, await getChangedFilePaths(cwd), cwd);
10
+ async function getChangedPackages(packages, cwd) {
11
+ const files = await getChangedFilePaths(cwd);
12
+ const sortedPackages = packages.toSorted((a, b) => b.path.length - a.path.length);
13
+ const matched = /* @__PURE__ */ new Set();
14
+ for (const file of files) {
15
+ const fullPath = join(cwd, file);
16
+ for (const pkg of sortedPackages) if (!relative(pkg.path, fullPath).startsWith("..")) {
17
+ matched.add(pkg);
18
+ break;
19
+ }
20
+ }
21
+ return matched;
12
22
  }
13
23
  async function getChangedFilePaths(cwd) {
14
24
  const files = /* @__PURE__ */ new Set();
@@ -26,18 +36,6 @@ async function getChangedFilePaths(cwd) {
26
36
  }));
27
37
  return Array.from(files);
28
38
  }
29
- function resolveChangedPackages(graph, files, cwd) {
30
- const packages = [...graph.getPackages()].sort((a, b) => b.path.length - a.path.length);
31
- const matched = /* @__PURE__ */ new Map();
32
- for (const file of files) {
33
- const fullPath = join(cwd, file);
34
- for (const pkg of packages) if (!relative(pkg.path, fullPath).startsWith("..")) {
35
- matched.set(pkg.id, pkg);
36
- break;
37
- }
38
- }
39
- return [...matched.values()];
40
- }
41
39
  //#endregion
42
40
  //#region src/cli/changelog.ts
43
41
  async function runChangelogTui(tegami) {
@@ -109,13 +107,13 @@ async function persistChangelogs(context, entries, emptyMessage = "No changelogs
109
107
  }
110
108
  async function promptPackageSelection(graph, cwd) {
111
109
  const useShortname = /* @__PURE__ */ new Map();
112
- for (const pkg of graph.getPackages()) if (useShortname.has(pkg.name)) useShortname.set(pkg.name, false);
110
+ const versionablePackages = graph.getPackages().filter((pkg) => pkg.version !== void 0);
111
+ for (const pkg of versionablePackages) if (useShortname.has(pkg.name)) useShortname.set(pkg.name, false);
113
112
  else useShortname.set(pkg.name, true);
114
113
  const getPackageLabel = (pkg) => {
115
114
  return useShortname.get(pkg.name) ? pkg.name : pkg.id;
116
115
  };
117
- const changedPackages = new Set(await getChangedPackages(graph, cwd));
118
- const initialValues = /* @__PURE__ */ new Set();
116
+ const changedPackages = await getChangedPackages(versionablePackages, cwd);
119
117
  const selectOptions = [];
120
118
  const groups = [];
121
119
  for (const group of graph.getGroups()) {
@@ -128,20 +126,15 @@ async function promptPackageSelection(graph, cwd) {
128
126
  value: `group:${group.name}`,
129
127
  hint: group.packages.map(getPackageLabel).join(", ")
130
128
  });
131
- const packages = graph.getPackages().toSorted((a, b) => (changedPackages.has(a) ? 0 : 1) - (changedPackages.has(b) ? 0 : 1));
132
- for (const pkg of packages) {
133
- const changed = changedPackages.has(pkg);
134
- if (changed) initialValues.add(pkg.id);
135
- selectOptions.push({
136
- label: getPackageLabel(pkg) + (changed ? "*" : ""),
137
- value: pkg.id
138
- });
139
- }
129
+ for (const pkg of versionablePackages.sort((a, b) => (changedPackages.has(a) ? 0 : 1) - (changedPackages.has(b) ? 0 : 1))) selectOptions.push({
130
+ label: getPackageLabel(pkg) + (changedPackages.has(pkg) ? "*" : ""),
131
+ value: pkg.id
132
+ });
140
133
  const selected = await autocompleteMultiselect({
141
134
  message: "Select packages (leave empty to auto-generate from commits)",
142
135
  required: false,
143
136
  options: selectOptions,
144
- initialValues: Array.from(initialValues)
137
+ initialValues: Array.from(changedPackages, (pkg) => pkg.id)
145
138
  });
146
139
  if (isCancel(selected)) throw new CancelledError();
147
140
  return selected;
@@ -480,7 +473,10 @@ function registerCoreCommands(cli, tegami, options) {
480
473
  });
481
474
  });
482
475
  cli.command("ci", { description: "version and publish packages" }).action(async () => {
483
- if (await versionPackages(tegami, { cli: options })) return;
476
+ if (await versionPackages(tegami, {
477
+ cli: options,
478
+ noChecks: true
479
+ })) return;
484
480
  await publishPackages(tegami, { cli: options });
485
481
  });
486
482
  cli.command("check-publish", { description: "exit with code 1 if no publishing needed, otherwise 0" }).action(async () => {
@@ -1,6 +1,6 @@
1
1
  import { o as maxBump, t as bumpDepth } from "./semver-DrtaCCZK.js";
2
2
  import { n as execFailure } from "./error-CAsrGb6e.js";
3
- import { n as renderChangelog } from "./shared-pTOZU5UZ.js";
3
+ import { n as renderChangelog } from "./shared-BraxbVVG.js";
4
4
  import { x } from "tinyexec";
5
5
  //#region src/utils/conventional-commit.ts
6
6
  /**
@@ -1,5 +1,4 @@
1
- import { r as LogGenerator } from "../types-BMYzG4dR.js";
2
-
1
+ import { r as LogGenerator } from "../types-Cn0Au3Kk.js";
3
2
  //#region src/generators/simple.d.ts
4
3
  declare function simpleGenerator(): LogGenerator;
5
4
  //#endregion
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
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-BMYzG4dR.js";
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 };
1
+ import { A as PackageGroup, F as ChangelogEntry, I as ReplayCondition, L as BumpType, M as Draft, N as DraftPolicy, P as PackageDraft, _ as PublishOptions, a as PublishPreflight, b as GenerateFromCommitsOptions, c as TegamiPluginOption, d as GenerateChangelogOptions, f as Tegami, g as PackagePublishResult, h as PackagePublishPlan, i as PackageOptions, j as WorkspacePackage, k as PackageGraph, m as PublishLock, n as GroupOptions, o as TegamiOptions, p as tegami, r as LogGenerator, s as TegamiPlugin, v as PublishPlan, x as TegamiContext, y as CommitChangelog } from "./types-Cn0Au3Kk.js";
2
+ export { type BumpType, type ChangelogEntry, type CommitChangelog, type Draft, type DraftPolicy, GenerateChangelogOptions, type GenerateFromCommitsOptions, type GroupOptions, type LogGenerator, type PackageDraft, PackageGraph, type PackageGroup, type PackageOptions, type PackagePublishPlan, type PackagePublishResult, type PublishLock, type PublishOptions, type PublishPlan, type PublishPreflight, type ReplayCondition, 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-Cgl2G5ea.js";
1
+ import { n as generateFromCommits } from "./generate-Cip5o2xy.js";
2
2
  import { i as handlePluginError } from "./error-CAsrGb6e.js";
3
- import { t as npm } from "./npm-CyC2Rk11.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-DAMkayLs.js";
5
- import { n as WorkspacePackage$1, t as PackageGraph } from "./graph-DaJ28Y4f.js";
3
+ import { t as npm } from "./npm-BHUzBLSi.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-CQifflae.js";
5
+ import { n as WorkspacePackage, 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,7 +55,6 @@ function resolvePlugins(plugins = []) {
55
55
  }
56
56
  //#endregion
57
57
  //#region src/index.ts
58
- const WorkspacePackage = WorkspacePackage$1;
59
58
  /** Create a Tegami project handle. */
60
59
  function tegami(options = {}) {
61
60
  let $context;
@@ -1,8 +1,8 @@
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-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-DAMkayLs.js";
5
- import { t as _assertGuard } from "./_assertGuard-CFFC1Up9.js";
2
+ import { t as _accessExpressionAsString } from "./_accessExpressionAsString-DAz6bHI_.js";
3
+ import { n as _validateReport, t as _createStandardSchema } from "./_createStandardSchema-DFfVlh8x.js";
4
+ import { r as runPreflights, s as parsePublishLock, t as initPublishPlan } from "./publish-CQifflae.js";
5
+ import { t as _assertGuard } from "./_assertGuard-cQ6dIdMj.js";
6
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";
@@ -1,2 +1,2 @@
1
- import { D as CargoPluginOptions, E as CargoPackage, O as cargo, T as CargoGraph } from "../types-BMYzG4dR.js";
1
+ import { D as CargoPluginOptions, E as CargoPackage, O as cargo, T as CargoGraph } from "../types-Cn0Au3Kk.js";
2
2
  export { CargoGraph, CargoPackage, CargoPluginOptions, cargo };
@@ -1,6 +1,6 @@
1
1
  import { n as execFailure, r as fetchFailure } from "../error-CAsrGb6e.js";
2
- import { t as _accessExpressionAsString } from "../_accessExpressionAsString-DW_6Xqcp.js";
3
- import { t as _assertGuard } from "../_assertGuard-CFFC1Up9.js";
2
+ import { t as _accessExpressionAsString } from "../_accessExpressionAsString-DAz6bHI_.js";
3
+ import { t as _assertGuard } from "../_assertGuard-cQ6dIdMj.js";
4
4
  import { n as WorkspacePackage } from "../graph-DaJ28Y4f.js";
5
5
  import fs from "node:fs/promises";
6
6
  import path from "node:path";
@@ -1,5 +1,4 @@
1
- import { s as TegamiPlugin } from "../types-BMYzG4dR.js";
2
-
1
+ import { s as TegamiPlugin } from "../types-Cn0Au3Kk.js";
3
2
  //#region src/plugins/git.d.ts
4
3
  interface GitPluginOptions {
5
4
  /** Set to false to skip creating git tags after all packages publish successfully. */
@@ -1,7 +1,6 @@
1
- import { j as WorkspacePackage, s as TegamiPlugin, t as Awaitable, x as TegamiContext, y as PublishPlan } from "../types-BMYzG4dR.js";
1
+ import { j as WorkspacePackage, s as TegamiPlugin, t as Awaitable, v as PublishPlan, x as TegamiContext } from "../types-Cn0Au3Kk.js";
2
2
  import { GitPluginOptions } from "./git.js";
3
- import { t as VersionRequestOptions } from "../version-request-BorZZ98V.js";
4
-
3
+ import { t as VersionRequestOptions } from "../version-request-DHxFYvna.js";
5
4
  //#region src/plugins/github.d.ts
6
5
  interface GithubRelease {
7
6
  /** Release title */
@@ -28,12 +27,14 @@ interface GitHubPluginOptions extends GitPluginOptions {
28
27
  *
29
28
  * @default false
30
29
  */
31
- eager?: boolean; /** Override release details for a single package. */
30
+ eager?: boolean;
31
+ /** Override release details for a single package. */
32
32
  create?: (this: TegamiContext, opts: {
33
33
  tag: string;
34
34
  pkg: WorkspacePackage;
35
35
  plan: PublishPlan;
36
- }) => Awaitable<Partial<GithubRelease>>; /** Override release details when multiple packages share a git tag. */
36
+ }) => Awaitable<Partial<GithubRelease>>;
37
+ /** Override release details when multiple packages share a git tag. */
37
38
  createGrouped?: (this: TegamiContext, opts: {
38
39
  tag: string;
39
40
  packages: WorkspacePackage[];
@@ -1,8 +1,8 @@
1
- import { t as changelogFilename } from "../generate-Cgl2G5ea.js";
1
+ import { t as changelogFilename } from "../generate-Cip5o2xy.js";
2
2
  import { n as execFailure, o as cached, r as fetchFailure, s as isCI } from "../error-CAsrGb6e.js";
3
- import { a as createDraft, l as readChangelogEntries } from "../publish-DAMkayLs.js";
3
+ import { a as createDraft, l as readChangelogEntries } from "../publish-CQifflae.js";
4
4
  import { git } from "./git.js";
5
- import { i as versionRequestPlugin, n as formatPreview, r as resolveFileCommit, t as createAutoRelease } from "../version-request-CQ4cJHtP.js";
5
+ import { i as versionRequestPlugin, n as formatPreview, r as resolveFileCommit, t as createAutoRelease } from "../version-request-CLEmlVnL.js";
6
6
  import { readFile, writeFile } from "node:fs/promises";
7
7
  import { basename, join, relative, resolve } from "node:path";
8
8
  import { x } from "tinyexec";
@@ -1,7 +1,6 @@
1
- import { j as WorkspacePackage, s as TegamiPlugin, t as Awaitable, x as TegamiContext, y as PublishPlan } from "../types-BMYzG4dR.js";
1
+ import { j as WorkspacePackage, s as TegamiPlugin, t as Awaitable, v as PublishPlan, x as TegamiContext } from "../types-Cn0Au3Kk.js";
2
2
  import { GitPluginOptions } from "./git.js";
3
- import { t as VersionRequestOptions } from "../version-request-BorZZ98V.js";
4
-
3
+ import { t as VersionRequestOptions } from "../version-request-DHxFYvna.js";
5
4
  //#region src/plugins/gitlab.d.ts
6
5
  interface GitlabRelease {
7
6
  /** Release title */
@@ -30,12 +29,14 @@ interface GitLabPluginOptions extends GitPluginOptions {
30
29
  *
31
30
  * @default false
32
31
  */
33
- eager?: boolean; /** Override release details for a single package. */
32
+ eager?: boolean;
33
+ /** Override release details for a single package. */
34
34
  create?: (this: TegamiContext, opts: {
35
35
  tag: string;
36
36
  pkg: WorkspacePackage;
37
37
  plan: PublishPlan;
38
- }) => Awaitable<Partial<GitlabRelease>>; /** Override release details when multiple packages share a git tag. */
38
+ }) => Awaitable<Partial<GitlabRelease>>;
39
+ /** Override release details when multiple packages share a git tag. */
39
40
  createGrouped?: (this: TegamiContext, opts: {
40
41
  tag: string;
41
42
  packages: WorkspacePackage[];
@@ -1,8 +1,8 @@
1
- import { t as changelogFilename } from "../generate-Cgl2G5ea.js";
1
+ import { t as changelogFilename } from "../generate-Cip5o2xy.js";
2
2
  import { c as joinPath, n as execFailure, o as cached, r as fetchFailure, s as isCI } from "../error-CAsrGb6e.js";
3
- import { a as createDraft, l as readChangelogEntries } from "../publish-DAMkayLs.js";
3
+ import { a as createDraft, l as readChangelogEntries } from "../publish-CQifflae.js";
4
4
  import { git } from "./git.js";
5
- import { i as versionRequestPlugin, n as formatPreview, r as resolveFileCommit, t as createAutoRelease } from "../version-request-CQ4cJHtP.js";
5
+ import { i as versionRequestPlugin, n as formatPreview, r as resolveFileCommit, t as createAutoRelease } from "../version-request-CLEmlVnL.js";
6
6
  import { readFile, writeFile } from "node:fs/promises";
7
7
  import { basename, join, relative, resolve } from "node:path";
8
8
  import { x } from "tinyexec";
@@ -1,5 +1,4 @@
1
- import { F as BumpType, j as WorkspacePackage, s as TegamiPlugin } from "../types-BMYzG4dR.js";
2
-
1
+ import { L as BumpType, j as WorkspacePackage, s as TegamiPlugin } from "../types-Cn0Au3Kk.js";
3
2
  //#region src/plugins/go.d.ts
4
3
  interface GoModFile {
5
4
  module: string;
@@ -44,9 +43,6 @@ interface GoPluginOptions {
44
43
  * - Version is stored in lock file, normally, it should prefer to store versions in a file like `package.json` & `Cargo.toml`, but for Golang, there is no such file.
45
44
  * - Publishing is handed to Git plugin, because Golang uses Git tag for publishing.
46
45
  */
47
- declare function go({
48
- updateLockFile,
49
- bumpDep: getBumpDepType
50
- }?: GoPluginOptions): TegamiPlugin;
46
+ declare function go({ updateLockFile, bumpDep: getBumpDepType }?: GoPluginOptions): TegamiPlugin;
51
47
  //#endregion
52
48
  export { GoPackage, GoPluginOptions, go };
@@ -1,5 +1,5 @@
1
1
  import { a as isNodeError, n as execFailure, r as fetchFailure } from "../error-CAsrGb6e.js";
2
- import { n as _validateReport, t as _createStandardSchema } from "../_createStandardSchema-CrRqJgaE.js";
2
+ import { n as _validateReport, t as _createStandardSchema } from "../_createStandardSchema-DFfVlh8x.js";
3
3
  import { n as WorkspacePackage } from "../graph-DaJ28Y4f.js";
4
4
  import { relative, resolve } from "node:path";
5
5
  import { x } from "tinyexec";
@@ -1,2 +1,2 @@
1
- import { C as NpmGraph, S as DependencySpec, l as NpmPluginOptions, u as npm, w as NpmPackage } from "../types-BMYzG4dR.js";
1
+ import { C as NpmGraph, S as DependencySpec, l as NpmPluginOptions, u as npm, w as NpmPackage } from "../types-Cn0Au3Kk.js";
2
2
  export { type DependencySpec, type NpmGraph, NpmPackage, NpmPluginOptions, npm };
@@ -1,2 +1,2 @@
1
- import { n as NpmPackage, t as npm } from "../npm-CyC2Rk11.js";
1
+ import { n as NpmPackage, t as npm } from "../npm-BHUzBLSi.js";
2
2
  export { NpmPackage, npm };
@@ -1,10 +1,10 @@
1
1
  import { o as maxBump } from "./semver-DrtaCCZK.js";
2
2
  import { i as handlePluginError, l as somePromise } from "./error-CAsrGb6e.js";
3
- import { t as _accessExpressionAsString } from "./_accessExpressionAsString-DW_6Xqcp.js";
4
- import { n as _validateReport, t as _createStandardSchema } from "./_createStandardSchema-CrRqJgaE.js";
5
- import { n as renderChangelog, r as validateChangelogFrontmatter, t as getPackageBumps } from "./shared-pTOZU5UZ.js";
3
+ import { t as _accessExpressionAsString } from "./_accessExpressionAsString-DAz6bHI_.js";
4
+ import { n as _validateReport, t as _createStandardSchema } from "./_createStandardSchema-DFfVlh8x.js";
5
+ import { n as renderChangelog, r as validateChangelogFrontmatter, t as getPackageBumps } from "./shared-BraxbVVG.js";
6
6
  import { simpleGenerator } from "./generators/simple.js";
7
- import { t as _assertGuard } from "./_assertGuard-CFFC1Up9.js";
7
+ import { t as _assertGuard } from "./_assertGuard-cQ6dIdMj.js";
8
8
  import fs, { mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises";
9
9
  import path, { basename, dirname, join } from "node:path";
10
10
  import * as semver$1 from "semver";
@@ -1,5 +1,5 @@
1
- import { t as _accessExpressionAsString } from "./_accessExpressionAsString-DW_6Xqcp.js";
2
- import { n as _validateReport, t as _createStandardSchema } from "./_createStandardSchema-CrRqJgaE.js";
1
+ import { t as _accessExpressionAsString } from "./_accessExpressionAsString-DAz6bHI_.js";
2
+ import { n as _validateReport, t as _createStandardSchema } from "./_createStandardSchema-DFfVlh8x.js";
3
3
  import { stringify } from "yaml";
4
4
  //#region src/changelog/shared.ts
5
5
  const validateChangelogFrontmatter = (() => {
@@ -44,7 +44,7 @@ declare namespace TagBase {
44
44
  * @template Exclusive Whether this tag conflicts with others
45
45
  * @template Schema Additional JSON Schema properties to output
46
46
  */
47
- interface IProps<Target extends "boolean" | "bigint" | "number" | "string" | "array" | "object", Kind extends string, Value extends boolean | bigint | number | string | undefined, Validate extends string | { [key in Target]?: string }, Exclusive extends boolean | string[], Schema extends object | undefined> {
47
+ interface IProps<Target extends "boolean" | "bigint" | "number" | "string" | "array" | "object", Kind extends string, Value extends boolean | bigint | number | string | undefined, Validate extends string | { [key in Target]?: string; }, Exclusive extends boolean | string[], Schema extends object | undefined> {
48
48
  /**
49
49
  * Target primitive type(s) this tag applies to.
50
50
  *
@@ -170,6 +170,17 @@ interface ChangelogEntry {
170
170
  virtual?: boolean;
171
171
  getRawContent: () => string;
172
172
  }
173
+ type ReplayCondition = {
174
+ on: "version";
175
+ name: string;
176
+ version: string;
177
+ } | {
178
+ on: "exit-prerelease";
179
+ name: string;
180
+ } | {
181
+ on: "enter-prerelease";
182
+ name: string;
183
+ };
173
184
  //#endregion
174
185
  //#region src/plans/draft.d.ts
175
186
  interface PackageDraft {
@@ -178,10 +189,11 @@ interface PackageDraft {
178
189
  bumpReasons?: Set<string>;
179
190
  changelogs?: ChangelogEntry[];
180
191
  npm?: {
181
- /** npm dist-tag used when publishing. */distTag?: string;
192
+ /** npm dist-tag used when publishing. */
193
+ distTag?: string;
182
194
  };
183
195
  /** get the bumped version of a package, return `undefined` if the package doesn't have a `version` field */
184
- bumpVersion: (pkg: WorkspacePackage$1) => string | undefined;
196
+ bumpVersion: (pkg: WorkspacePackage) => string | undefined;
185
197
  }
186
198
  /** a draft describes all operations to perform before the actual publishing, such as version bumps. */
187
199
  declare class Draft {
@@ -195,15 +207,12 @@ declare class Draft {
195
207
  constructor(context: TegamiContext);
196
208
  getPackageDrafts(): Map<string, PackageDraft>;
197
209
  getPackageDraft(id: string): PackageDraft | undefined;
198
- bumpPackage(pkg: WorkspacePackage$1, {
199
- type,
200
- reason
201
- }: {
210
+ bumpPackage(pkg: WorkspacePackage, { type, reason }: {
202
211
  type: BumpType;
203
212
  reason?: string;
204
213
  }): PackageDraft;
205
- dispatchPackage(pkg: WorkspacePackage$1, dispatch: (draft: PackageDraft) => void, onUpdate?: (draft: PackageDraft) => void): PackageDraft;
206
- getOrInitPackage(pkg: WorkspacePackage$1): PackageDraft;
214
+ dispatchPackage(pkg: WorkspacePackage, dispatch: (draft: PackageDraft) => void, onUpdate?: (draft: PackageDraft) => void): PackageDraft;
215
+ getOrInitPackage(pkg: WorkspacePackage): PackageDraft;
207
216
  hasPending(): boolean;
208
217
  /** get all changelogs, note that this includes replay-only changelogs, as long as they are in the `.tegami` folder. */
209
218
  getChangelogs(): ChangelogEntry[];
@@ -227,13 +236,13 @@ interface DraftPolicy {
227
236
  id: string;
228
237
  onUpdate?: (this: Draft, opts: {
229
238
  packageDraft: PackageDraft;
230
- pkg: WorkspacePackage$1;
239
+ pkg: WorkspacePackage;
231
240
  }) => void;
232
241
  }
233
242
  //#endregion
234
243
  //#region src/graph.d.ts
235
244
  /** Package discovered in the workspace. */
236
- declare abstract class WorkspacePackage$1 {
245
+ declare abstract class WorkspacePackage {
237
246
  abstract readonly name: string;
238
247
  /** absolute path */
239
248
  abstract readonly path: string;
@@ -247,16 +256,14 @@ declare abstract class WorkspacePackage$1 {
247
256
  /** create the initial draft. */
248
257
  initDraft(): PackageDraft;
249
258
  /** configure an initial draft to match script-level configs. */
250
- configureDraft({
251
- draft
252
- }: {
259
+ configureDraft({ draft }: {
253
260
  draft: PackageDraft;
254
261
  }): void;
255
262
  }
256
263
  interface PackageGroup {
257
264
  name: string;
258
265
  options: GroupOptions;
259
- packages: WorkspacePackage$1[];
266
+ packages: WorkspacePackage[];
260
267
  }
261
268
  /**
262
269
  * Unified graph for discovered workspace packages.
@@ -267,14 +274,14 @@ interface PackageGroup {
267
274
  declare class PackageGraph {
268
275
  private readonly packages;
269
276
  private readonly groups;
270
- constructor(packages?: WorkspacePackage$1[]);
271
- getPackages(): WorkspacePackage$1[];
277
+ constructor(packages?: WorkspacePackage[]);
278
+ getPackages(): WorkspacePackage[];
272
279
  /** Get a package by exact id. */
273
- get(id: string): WorkspacePackage$1 | undefined;
280
+ get(id: string): WorkspacePackage | undefined;
274
281
  /** Get packages by id, `group:name`, or every package matching a name. */
275
- getByName(nameOrId: string): WorkspacePackage$1[];
282
+ getByName(nameOrId: string): WorkspacePackage[];
276
283
  /** scan package into graph, if the package id already exists, replace the existing one in graph */
277
- add(pkg: WorkspacePackage$1): void;
284
+ add(pkg: WorkspacePackage): void;
278
285
  delete(id: string): void;
279
286
  getPackageGroup(pkgId: string): PackageGroup | undefined;
280
287
  getGroups(): PackageGroup[];
@@ -375,14 +382,14 @@ interface ResolvedDependency {
375
382
  range?: string;
376
383
  setRange?: (v: string) => void;
377
384
  }
378
- declare class CargoPackage extends WorkspacePackage$1 {
385
+ declare class CargoPackage extends WorkspacePackage {
379
386
  readonly path: string;
380
387
  /** a crate must have `package` field defined, otherwise it is merely a virutal workspace file, and Tegami should not include it. */
381
388
  readonly file: CargoToml<RequireFields<CargoManifest, "package">>;
382
389
  readonly manager = "cargo";
383
390
  readonly manifest: RequireFields<CargoManifest, "package">;
384
- constructor(path: string, /** a crate must have `package` field defined, otherwise it is merely a virutal workspace file, and Tegami should not include it. */
385
-
391
+ constructor(path: string,
392
+ /** a crate must have `package` field defined, otherwise it is merely a virutal workspace file, and Tegami should not include it. */
386
393
  file: CargoToml<RequireFields<CargoManifest, "package">>);
387
394
  get name(): string;
388
395
  get version(): string;
@@ -407,10 +414,7 @@ interface CargoPluginOptions {
407
414
  */
408
415
  bumpDep?: (opts: DependentRef$1) => BumpType | false;
409
416
  }
410
- declare function cargo({
411
- updateLockFile,
412
- bumpDep: getBumpDepType
413
- }?: CargoPluginOptions): TegamiPlugin;
417
+ declare function cargo({ updateLockFile, bumpDep: getBumpDepType }?: CargoPluginOptions): TegamiPlugin;
414
418
  interface CargoGraph {
415
419
  /** path -> Cargo.toml */
416
420
  files: Map<string, CargoToml>;
@@ -419,7 +423,7 @@ interface CargoGraph {
419
423
  }
420
424
  //#endregion
421
425
  //#region src/providers/npm/graph.d.ts
422
- declare class NpmPackage extends WorkspacePackage$1 {
426
+ declare class NpmPackage extends WorkspacePackage {
423
427
  readonly path: string;
424
428
  readonly manifest: PackageManifest;
425
429
  readonly manager = "npm";
@@ -430,9 +434,7 @@ declare class NpmPackage extends WorkspacePackage$1 {
430
434
  write(): Promise<void>;
431
435
  initDraft(): PackageDraft;
432
436
  getRegistry(): string;
433
- configureDraft({
434
- draft
435
- }: {
437
+ configureDraft({ draft }: {
436
438
  draft: PackageDraft;
437
439
  }): void;
438
440
  listDependencies(graph: NpmGraph): ResolvedNpmDependency[];
@@ -528,7 +530,8 @@ interface TegamiContext {
528
530
  /** additional context when npm plugin is configured */
529
531
  npm?: {
530
532
  agent: Agent;
531
- client: AgentName; /** available after resolve */
533
+ client: AgentName;
534
+ /** available after resolve */
532
535
  graph?: NpmGraph;
533
536
  };
534
537
  cargo?: {
@@ -576,11 +579,14 @@ interface PackagePublishPlan {
576
579
  updated: boolean;
577
580
  /** generated by Git plugin */
578
581
  git?: {
579
- /** the associated Git tag of package */tag?: string;
582
+ /** the associated Git tag of package */
583
+ tag?: string;
580
584
  };
581
585
  /** generated by npm plugin */
582
586
  npm?: {
583
- /** dist tag to use if published */distTag?: string; /** point latest tag to it if published */
587
+ /** dist tag to use if published */
588
+ distTag?: string;
589
+ /** point latest tag to it if published */
584
590
  markLatest?: boolean;
585
591
  };
586
592
  /** publish result, generated for all packages in publish plan after publishing */
@@ -638,7 +644,6 @@ interface GenerateChangelogOptions extends GenerateFromCommitsOptions {
638
644
  */
639
645
  write?: boolean;
640
646
  }
641
- declare const WorkspacePackage: typeof WorkspacePackage$1;
642
647
  interface Tegami {
643
648
  /** Create pending changelog files from git commit history. */
644
649
  generateChangelog(options?: GenerateChangelogOptions): Promise<CommitChangelog[]>;
@@ -672,7 +677,8 @@ interface Tegami {
672
677
  }>;
673
678
  /** Internal APIs, do not use it unless you know what you are doing */
674
679
  _internal: {
675
- context(): Promise<TegamiContext>; /** access context without requiring graph resolution */
680
+ context(): Promise<TegamiContext>;
681
+ /** access context without requiring graph resolution */
676
682
  contextUnresolved(): Promise<TegamiContext>;
677
683
  options: TegamiOptions;
678
684
  };
@@ -689,9 +695,9 @@ interface TegamiCliCommand<Values extends Record<string, ArgValue | undefined>,
689
695
  short?: string;
690
696
  description?: string;
691
697
  multiple?: Multiple;
692
- }): TegamiCliCommand<Values & { [k in Name]?: Multiple extends true ? T extends "string" ? string[] : boolean[] : T extends "string" ? string : boolean }, Positionals>;
693
- positional<const Name extends string, const Required extends boolean = true>(name: Name, required?: Required): TegamiCliCommand<Values, Positionals & { [K in Name]: Required extends true ? string : string | undefined }>;
694
- positionals<const Name extends string>(name: Name): TegamiCliCommand<Values, Positionals & { [K in Name]: string[] }>;
698
+ }): TegamiCliCommand<Values & { [k in Name]?: Multiple extends true ? T extends "string" ? string[] : boolean[] : T extends "string" ? string : boolean; }, Positionals>;
699
+ positional<const Name extends string, const Required extends boolean = true>(name: Name, required?: Required): TegamiCliCommand<Values, Positionals & { [K in Name]: Required extends true ? string : string | undefined; }>;
700
+ positionals<const Name extends string>(name: Name): TegamiCliCommand<Values, Positionals & { [K in Name]: string[]; }>;
695
701
  action(fn: (options: {
696
702
  context: TegamiContext;
697
703
  values: Values;
@@ -714,10 +720,12 @@ interface TegamiCliRegistry {
714
720
  //#endregion
715
721
  //#region src/providers/npm/cli.d.ts
716
722
  type TrustedPublishOptions = {
717
- provider: "github"; /** CI workflow filename for publishing. */
723
+ provider: "github";
724
+ /** CI workflow filename for publishing. */
718
725
  workflow: string;
719
726
  } | {
720
- provider: "gitlab"; /** CI pipeline filename for publishing. */
727
+ provider: "gitlab";
728
+ /** CI pipeline filename for publishing. */
721
729
  workflow: string;
722
730
  };
723
731
  //#endregion
@@ -751,19 +759,13 @@ interface NpmPluginOptions {
751
759
  /** Configure `tegami npm pretrust`, disabled by default. */
752
760
  trustedPublish?: TrustedPublishOptions;
753
761
  }
754
- declare function npm({
755
- client: defaultClient,
756
- onBreakPeerDep,
757
- updateLockFile,
758
- trustedPublish,
759
- bumpDep: getBumpDepType
760
- }?: NpmPluginOptions): TegamiPlugin;
762
+ declare function npm({ client: defaultClient, onBreakPeerDep, updateLockFile, trustedPublish, bumpDep: getBumpDepType }?: NpmPluginOptions): TegamiPlugin;
761
763
  //#endregion
762
764
  //#region src/types.d.ts
763
765
  /** Generates changelog content for a package release. */
764
766
  interface LogGenerator {
765
767
  generate(this: TegamiContext, opts: {
766
- pkg: WorkspacePackage$1;
768
+ pkg: WorkspacePackage;
767
769
  packageDraft: PackageDraft;
768
770
  draft: Draft;
769
771
  }): string | Promise<string>;
@@ -778,7 +780,7 @@ interface TegamiOptions<Groups extends string = string> {
778
780
  /** Changelog generator used when applying a draft. */
779
781
  generator?: LogGenerator;
780
782
  /** Per-package options keyed by package name or a function. */
781
- packages?: Record<string, PackageOptions<NoInfer<Groups>>> | ((pkg: WorkspacePackage$1) => PackageOptions<NoInfer<Groups>> | undefined);
783
+ packages?: Record<string, PackageOptions<NoInfer<Groups>>> | ((pkg: WorkspacePackage) => PackageOptions<NoInfer<Groups>> | undefined);
782
784
  plugins?: TegamiPluginOption[];
783
785
  groups?: Record<Groups, GroupOptions>;
784
786
  /** Package names, ids, or regex patterns to exclude from the dependency graph. */
@@ -857,7 +859,7 @@ interface TegamiPlugin {
857
859
  * If multiple plugins return preflight data for the same package, only the first plugin will be considered.
858
860
  */
859
861
  publishPreflight?(this: TegamiContext, opts: {
860
- pkg: WorkspacePackage$1;
862
+ pkg: WorkspacePackage;
861
863
  plan: PublishPlan;
862
864
  }): Awaitable<PublishPreflight | void | undefined>;
863
865
  /** Called when all preflights finished */
@@ -866,7 +868,7 @@ interface TegamiPlugin {
866
868
  }): Awaitable<void>;
867
869
  /** Publish package, return a result object indicating if the package is published, skipped, or failed. Return `undefined` if the package is not handled by this plugin. */
868
870
  publish?(this: TegamiContext, opts: {
869
- pkg: WorkspacePackage$1;
871
+ pkg: WorkspacePackage;
870
872
  plan: PublishPlan;
871
873
  }): Promise<PackagePublishResult | undefined | void>;
872
874
  /**
@@ -883,11 +885,11 @@ interface TegamiPlugin {
883
885
  }): Awaitable<void>;
884
886
  /** Called before a package will be published, return `false` to prevent from publishing. */
885
887
  willPublish?(this: TegamiContext, opts: {
886
- pkg: WorkspacePackage$1;
888
+ pkg: WorkspacePackage;
887
889
  }): Awaitable<false | void | undefined>;
888
890
  /** Called after a package is published successfully, or failed. */
889
891
  afterPublish?(this: TegamiContext, opts: {
890
- pkg: WorkspacePackage$1;
892
+ pkg: WorkspacePackage;
891
893
  plan: PublishPlan;
892
894
  }): Awaitable<void>;
893
895
  /** Called after all publishing finishes. */
@@ -900,7 +902,7 @@ interface TegamiPlugin {
900
902
  applyCliDraft?(this: TegamiContext, draft: Draft): Awaitable<void>;
901
903
  }
902
904
  type Awaitable<T> = T | Promise<T>;
903
- type RequireFields<Obj, K extends keyof Obj> = Obj & { [R in K]-?: NonNullable<Obj[R]> };
905
+ type RequireFields<Obj, K extends keyof Obj> = Obj & { [R in K]-?: NonNullable<Obj[R]>; };
904
906
  interface PublishPreflight {
905
907
  /**
906
908
  * Whether the package should be published, the state **must only depend on local inputs** (e.g. local `package.json` or `publish-lock.yaml`).
@@ -922,4 +924,4 @@ interface PublishPreflight {
922
924
  optionalWait?: string[];
923
925
  }
924
926
  //#endregion
925
- export { type PackageGroup as A, type NpmGraph as C, type CargoPluginOptions as D, CargoPackage as E, BumpType as F, Draft as M, DraftPolicy as N, cargo as O, PackageDraft as P, DependencySpec as S, CargoGraph as T, PackagePublishResult as _, type PublishPreflight as a, type CommitChangelog as b, type TegamiPluginOption as c, type GenerateChangelogOptions as d, Tegami as f, PackagePublishPlan as g, PublishLock as h, PackageOptions as i, WorkspacePackage$1 as j, PackageGraph as k, NpmPluginOptions as l, tegami as m, GroupOptions as n, TegamiOptions as o, WorkspacePackage as p, LogGenerator as r, TegamiPlugin as s, Awaitable as t, npm as u, PublishOptions as v, NpmPackage as w, TegamiContext as x, PublishPlan as y };
927
+ export { type PackageGroup as A, type NpmGraph as C, type CargoPluginOptions as D, CargoPackage as E, ChangelogEntry as F, ReplayCondition as I, BumpType as L, Draft as M, DraftPolicy as N, cargo as O, PackageDraft as P, DependencySpec as S, CargoGraph as T, PublishOptions as _, type PublishPreflight as a, type GenerateFromCommitsOptions as b, type TegamiPluginOption as c, type GenerateChangelogOptions as d, Tegami as f, PackagePublishResult as g, PackagePublishPlan as h, PackageOptions as i, WorkspacePackage as j, PackageGraph as k, NpmPluginOptions as l, PublishLock as m, GroupOptions as n, TegamiOptions as o, tegami as p, LogGenerator as r, TegamiPlugin as s, Awaitable as t, npm as u, PublishPlan as v, NpmPackage as w, TegamiContext as x, CommitChangelog as y };
@@ -1,5 +1,4 @@
1
1
  import { Result } from "tinyexec";
2
-
3
2
  //#region src/utils/error.d.ts
4
3
  declare function execFailure(context: string, result: Awaited<Result>): Error;
5
4
  declare function fetchFailure(context: string, response: Response): Promise<Error>;
@@ -1,9 +1,9 @@
1
1
  import { a as formatPackageVersion, i as formatNpmDistTag, r as diffWeight } from "./semver-DrtaCCZK.js";
2
2
  import { l as somePromise, n as execFailure, s as isCI } from "./error-CAsrGb6e.js";
3
- import { t as _accessExpressionAsString } from "./_accessExpressionAsString-DW_6Xqcp.js";
4
- import { n as _validateReport, t as _createStandardSchema } from "./_createStandardSchema-CrRqJgaE.js";
5
- import { t as getPackageBumps } from "./shared-pTOZU5UZ.js";
6
- import { o as PublishLock, r as runPreflights, s as parsePublishLock, t as initPublishPlan } from "./publish-DAMkayLs.js";
3
+ import { t as _accessExpressionAsString } from "./_accessExpressionAsString-DAz6bHI_.js";
4
+ import { n as _validateReport, t as _createStandardSchema } from "./_createStandardSchema-DFfVlh8x.js";
5
+ import { t as getPackageBumps } from "./shared-BraxbVVG.js";
6
+ import { o as PublishLock, r as runPreflights, s as parsePublishLock, t as initPublishPlan } from "./publish-CQifflae.js";
7
7
  import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
8
8
  import { join, relative } from "node:path";
9
9
  import { x } from "tinyexec";
@@ -1,5 +1,4 @@
1
- import { M as Draft, h as PublishLock, t as Awaitable, x as TegamiContext, y as PublishPlan } from "./types-BMYzG4dR.js";
2
-
1
+ import { M as Draft, m as PublishLock, t as Awaitable, v as PublishPlan, x as TegamiContext } from "./types-Cn0Au3Kk.js";
3
2
  //#region src/utils/version-request.d.ts
4
3
  interface VersionRequestOptions {
5
4
  /**
@@ -45,7 +44,6 @@ interface VersionRequestContext {
45
44
  plan: PublishPlan | undefined;
46
45
  getPreviousVersion(packageId: string): string | undefined;
47
46
  }
48
- /** adapter over the version request API of a git provider */
49
47
  interface PublishGroupStore {
50
48
  /**
51
49
  * - active: groups whose version request was merged, they stay listed until the lock is removed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tegami",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "A tool to manage changelogs, versioning, and publishing in monorepo",
5
5
  "license": "MIT",
6
6
  "author": "Fuma Nama",
@@ -37,10 +37,10 @@
37
37
  "yaml": "^2.9.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@types/node": "^26.1.0",
40
+ "@types/node": "^26.1.1",
41
41
  "@types/semver": "^7.7.1",
42
42
  "package-manager-detector": "^1.7.0",
43
- "tsdown": "^0.22.3",
43
+ "tsdown": "^0.22.4",
44
44
  "typescript": "6.0.3",
45
45
  "typia": "^12.1.1",
46
46
  "@repo/typescript-config": "0.0.0"