tegami 1.1.1 → 1.1.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.
@@ -1,2 +1,2 @@
1
- import { C as CargoPackage, S as CargoGraph, T as cargo, w as CargoPluginOptions } from "../types-VvvN6oyT.js";
1
+ import { D as cargo, E as CargoPluginOptions, T as CargoPackage, w as CargoGraph } from "../types-DEyZ2r-2.js";
2
2
  export { CargoGraph, CargoPackage, CargoPluginOptions, cargo };
@@ -1,4 +1,4 @@
1
- import { s as TegamiPlugin } from "../types-VvvN6oyT.js";
1
+ import { s as TegamiPlugin } from "../types-DEyZ2r-2.js";
2
2
 
3
3
  //#region src/plugins/git.d.ts
4
4
  interface GitPluginOptions {
@@ -1,4 +1,4 @@
1
- import { O as WorkspacePackage, k as Draft, s as TegamiPlugin, t as Awaitable, x as TegamiContext, y as PublishPlan } from "../types-VvvN6oyT.js";
1
+ import { A as WorkspacePackage, b as TegamiContext, j as Draft, s as TegamiPlugin, t as Awaitable, v as PublishPlan } from "../types-DEyZ2r-2.js";
2
2
  import { GitPluginOptions } from "./git.js";
3
3
 
4
4
  //#region src/plugins/github.d.ts
@@ -24,7 +24,7 @@ interface VersionPullRequestOptions {
24
24
  */
25
25
  forceCreate?: boolean;
26
26
  /**
27
- * Pull request branch.
27
+ * Pull request branch. Publish group PRs are created under `<branch>/`.
28
28
  *
29
29
  * @default "tegami/version-packages"
30
30
  */
@@ -35,9 +35,24 @@ interface VersionPullRequestOptions {
35
35
  * @default "main"
36
36
  */
37
37
  base?: string;
38
- /** Override details for "Version Packages" PR. */
38
+ /**
39
+ * Publish groups to split into separate version PRs, each entry is a package (or a list of
40
+ * packages) to version & publish together. Packages not covered by any group are collected
41
+ * into an extra "unlisted packages" PR.
42
+ *
43
+ * Merging a group PR publishes only its members, the remaining PRs are re-synced on every
44
+ * publish run until all of them are merged & published.
45
+ */
46
+ groups?: (string | string[])[];
47
+ /**
48
+ * Override details for a version PR.
49
+ *
50
+ * Only called at version-time: publish group PRs re-synced at publish-time keep the stored
51
+ * title and use a default body.
52
+ */
39
53
  create?: (this: TegamiContext, opts: {
40
54
  draft: Draft;
55
+ publishGroup?: string[];
41
56
  }) => Awaitable<VersionPullRequest>;
42
57
  }
43
58
  /** Options for creating GitHub releases after a successful publish. */
@@ -1,9 +1,9 @@
1
1
  import { i as formatPackageVersion, r as formatNpmDistTag } from "../semver-EKJ8yK5U.js";
2
2
  import { t as changelogFilename } from "../generate-Bg86OJP4.js";
3
3
  import { a as cached, n as execFailure, o as isCI } from "../error-BhMYq9iW.js";
4
- import { o as readChangelogEntries, t as createDraft } from "../draft-DsxZOCOb.js";
4
+ import { o as readChangelogEntries, t as createDraft } from "../draft-CzUiQasJ.js";
5
5
  import { git } from "./git.js";
6
- import { n as createVersionRequestBody, r as hasGitChanges, t as commitVersionBranchChanges } from "../version-request-oxy16TJ1.js";
6
+ import { t as onVersionRequest } from "../version-request-DlLpLLK3.js";
7
7
  import { readFile, writeFile } from "node:fs/promises";
8
8
  import { basename, join, relative, resolve } from "node:path";
9
9
  import { x } from "tinyexec";
@@ -346,7 +346,37 @@ function github(options = {}) {
346
346
  function getRenderer(context) {
347
347
  return renderer ??= createChangelogRenderer(context);
348
348
  }
349
- const cliSnapshots = /* @__PURE__ */ new Map();
349
+ const versionRequests = onVersionRequest({
350
+ name: "github",
351
+ summary: "Merge this PR to publish the versioned packages.",
352
+ options: options.versionPr,
353
+ enabled(context) {
354
+ const { repo, token } = context.github ?? {};
355
+ return Boolean(repo && token);
356
+ },
357
+ find(context, { head }) {
358
+ const { repo, token } = context.github;
359
+ return findOpenPullRequest(repo, head, token);
360
+ },
361
+ create(context, request) {
362
+ const { repo, token } = context.github;
363
+ return createPullRequest(repo, {
364
+ title: request.title,
365
+ body: request.body,
366
+ head: request.head,
367
+ base: request.base,
368
+ token
369
+ });
370
+ },
371
+ update(context, number, request) {
372
+ const { repo, token } = context.github;
373
+ return updatePullRequest(repo, number, {
374
+ title: request.title,
375
+ body: request.body,
376
+ token
377
+ });
378
+ }
379
+ });
350
380
  return [git(options), {
351
381
  name: "github",
352
382
  init() {
@@ -356,6 +386,7 @@ function github(options = {}) {
356
386
  };
357
387
  },
358
388
  async resolvePlanStatus({ plan }) {
389
+ if (versionRequests.resolvePlanStatus() === "pending") return "pending";
359
390
  const { repo, token } = this.github;
360
391
  if (!repo || !token || releaseOptions === false) return;
361
392
  const requiredTags = /* @__PURE__ */ new Set();
@@ -430,37 +461,16 @@ function github(options = {}) {
430
461
  if (result.exitCode !== 0) throw execFailure("Failed to configure git remote for GitHub Actions.", result);
431
462
  },
432
463
  initCliDraft() {
433
- for (const pkg of this.graph.getPackages()) cliSnapshots.set(pkg.id, pkg.version);
464
+ versionRequests.initCliDraft.call(this);
434
465
  },
435
- async applyCliDraft(draft) {
436
- const config = options.versionPr ?? {};
437
- if (config === false || !(config.forceCreate || isCI()) || !await hasGitChanges(this.cwd)) return;
438
- const repo = this.github?.repo;
439
- const { branch = "tegami/version-packages", base = "main" } = config;
440
- const basePR = await config.create?.call(this, { draft });
441
- const pr = {
442
- title: basePR?.title ?? "Version Packages",
443
- body: basePR?.body ?? createVersionRequestBody(draft, this, cliSnapshots, "Merge this PR to publish the versioned packages.")
444
- };
445
- await commitVersionBranchChanges(this.cwd, branch, pr.title);
446
- const token = this.github?.token;
447
- if (!repo) return;
448
- const openPr = await findOpenPullRequest(repo, branch, token);
449
- if (openPr !== void 0) {
450
- await updatePullRequest(repo, openPr, {
451
- title: pr.title,
452
- body: pr.body,
453
- token
454
- });
455
- return;
456
- }
457
- await createPullRequest(repo, {
458
- title: pr.title,
459
- body: pr.body,
460
- head: branch,
461
- base,
462
- token
463
- });
466
+ applyCliDraft(draft) {
467
+ return versionRequests.applyCliDraft.call(this, draft);
468
+ },
469
+ initPublishPlan(opts) {
470
+ versionRequests.initPublishPlan.call(this, opts);
471
+ },
472
+ beforePublishAll(opts) {
473
+ return versionRequests.beforePublishAll.call(this, opts);
464
474
  }
465
475
  }];
466
476
  }
@@ -1,4 +1,4 @@
1
- import { O as WorkspacePackage, k as Draft, s as TegamiPlugin, t as Awaitable, x as TegamiContext, y as PublishPlan } from "../types-VvvN6oyT.js";
1
+ import { A as WorkspacePackage, b as TegamiContext, j as Draft, s as TegamiPlugin, t as Awaitable, v as PublishPlan } from "../types-DEyZ2r-2.js";
2
2
  import { GitPluginOptions } from "./git.js";
3
3
 
4
4
  //#region src/plugins/gitlab.d.ts
@@ -22,7 +22,7 @@ interface VersionMergeRequestOptions {
22
22
  */
23
23
  forceCreate?: boolean;
24
24
  /**
25
- * Merge request branch.
25
+ * Merge request branch. Publish group MRs are created under `<branch>/`.
26
26
  *
27
27
  * @default "tegami/version-packages"
28
28
  */
@@ -33,9 +33,24 @@ interface VersionMergeRequestOptions {
33
33
  * @default "main"
34
34
  */
35
35
  base?: string;
36
- /** Override details for "Version Packages" MR. */
36
+ /**
37
+ * Publish groups to split into separate version MRs, each entry is a package (or a list of
38
+ * packages) to version & publish together. Packages not covered by any group are collected
39
+ * into an extra "unlisted packages" MR.
40
+ *
41
+ * Merging a group MR publishes only its members, the remaining MRs are re-synced on every
42
+ * publish run until all of them are merged & published.
43
+ */
44
+ groups?: (string | string[])[];
45
+ /**
46
+ * Override details for a version MR.
47
+ *
48
+ * Only called at version-time: publish group MRs re-synced at publish-time keep the stored
49
+ * title and use a default body.
50
+ */
37
51
  create?: (this: TegamiContext, opts: {
38
52
  draft: Draft;
53
+ publishGroup?: string[];
39
54
  }) => Awaitable<VersionMergeRequest>;
40
55
  }
41
56
  /** Options for creating GitLab releases after a successful publish. */
@@ -1,9 +1,9 @@
1
1
  import { i as formatPackageVersion, r as formatNpmDistTag } from "../semver-EKJ8yK5U.js";
2
2
  import { t as changelogFilename } from "../generate-Bg86OJP4.js";
3
3
  import { a as cached, n as execFailure, o as isCI, s as joinPath } from "../error-BhMYq9iW.js";
4
- import { o as readChangelogEntries, t as createDraft } from "../draft-DsxZOCOb.js";
4
+ import { o as readChangelogEntries, t as createDraft } from "../draft-CzUiQasJ.js";
5
5
  import { git } from "./git.js";
6
- import { n as createVersionRequestBody, r as hasGitChanges, t as commitVersionBranchChanges } from "../version-request-oxy16TJ1.js";
6
+ import { t as onVersionRequest } from "../version-request-DlLpLLK3.js";
7
7
  import { readFile, writeFile } from "node:fs/promises";
8
8
  import { basename, join, relative, resolve } from "node:path";
9
9
  import { x } from "tinyexec";
@@ -309,7 +309,39 @@ function gitlab(options = {}) {
309
309
  function getRenderer(context) {
310
310
  return renderer ??= createChangelogRenderer(context);
311
311
  }
312
- const cliOriginalPackageVersions = /* @__PURE__ */ new Map();
312
+ const versionRequests = onVersionRequest({
313
+ name: "gitlab",
314
+ summary: "Merge this MR to publish the versioned packages.",
315
+ options: options.versionMr,
316
+ enabled(context) {
317
+ const { repo, token } = context.gitlab ?? {};
318
+ return Boolean(repo && token);
319
+ },
320
+ find(context, { head, base }) {
321
+ return findOpenMergeRequest(context.gitlab.repo, {
322
+ head,
323
+ base,
324
+ ...gitLabApiOptions(context.gitlab)
325
+ });
326
+ },
327
+ create(context, request) {
328
+ return createMergeRequest(context.gitlab.repo, {
329
+ title: request.title,
330
+ body: request.body,
331
+ head: request.head,
332
+ base: request.base,
333
+ ...gitLabApiOptions(context.gitlab)
334
+ });
335
+ },
336
+ update(context, number, request) {
337
+ return updateMergeRequest(context.gitlab.repo, number, {
338
+ title: request.title,
339
+ body: request.body,
340
+ base: request.base,
341
+ ...gitLabApiOptions(context.gitlab)
342
+ });
343
+ }
344
+ });
313
345
  return [git(options), {
314
346
  name: "gitlab",
315
347
  init() {
@@ -321,6 +353,7 @@ function gitlab(options = {}) {
321
353
  };
322
354
  },
323
355
  async resolvePlanStatus({ plan }) {
356
+ if (versionRequests.resolvePlanStatus() === "pending") return "pending";
324
357
  const { repo, token } = this.gitlab;
325
358
  if (!repo || !token || releaseOptions === false) return;
326
359
  const requiredTags = /* @__PURE__ */ new Set();
@@ -394,42 +427,16 @@ function gitlab(options = {}) {
394
427
  if (result.exitCode !== 0) throw execFailure("Failed to configure git remote for GitLab CI.", result);
395
428
  },
396
429
  initCliDraft() {
397
- for (const pkg of this.graph.getPackages()) cliOriginalPackageVersions.set(pkg.id, pkg.version);
430
+ versionRequests.initCliDraft.call(this);
398
431
  },
399
- async applyCliDraft(draft) {
400
- const config = options.versionMr ?? {};
401
- if (config === false || !(config.forceCreate || isCI()) || !await hasGitChanges(this.cwd)) return;
402
- const repo = this.gitlab?.repo;
403
- const { branch = "tegami/version-packages", base = "main" } = config;
404
- const baseMR = await config.create?.call(this, { draft });
405
- const mr = {
406
- title: baseMR?.title ?? "Version Packages",
407
- body: baseMR?.body ?? createVersionRequestBody(draft, this, cliOriginalPackageVersions, "Merge this MR to publish the versioned packages.")
408
- };
409
- await commitVersionBranchChanges(this.cwd, branch, mr.title);
410
- const api = gitLabApiOptions(this.gitlab);
411
- if (!repo) return;
412
- const openMr = await findOpenMergeRequest(repo, {
413
- head: branch,
414
- base,
415
- ...api
416
- });
417
- if (openMr !== void 0) {
418
- await updateMergeRequest(repo, openMr, {
419
- title: mr.title,
420
- body: mr.body,
421
- base,
422
- ...api
423
- });
424
- return;
425
- }
426
- await createMergeRequest(repo, {
427
- title: mr.title,
428
- body: mr.body,
429
- head: branch,
430
- base,
431
- ...api
432
- });
432
+ applyCliDraft(draft) {
433
+ return versionRequests.applyCliDraft.call(this, draft);
434
+ },
435
+ initPublishPlan(opts) {
436
+ versionRequests.initPublishPlan.call(this, opts);
437
+ },
438
+ beforePublishAll(opts) {
439
+ return versionRequests.beforePublishAll.call(this, opts);
433
440
  }
434
441
  }];
435
442
  }
@@ -1,4 +1,4 @@
1
- import { M as BumpType, O as WorkspacePackage, s as TegamiPlugin } from "../types-VvvN6oyT.js";
1
+ import { A as WorkspacePackage, P as BumpType, s as TegamiPlugin } from "../types-DEyZ2r-2.js";
2
2
 
3
3
  //#region src/plugins/go.d.ts
4
4
  interface GoModFile {
@@ -1,2 +1,2 @@
1
- import { d as npm, l as NpmPackage, u as NpmPluginOptions } from "../types-VvvN6oyT.js";
2
- export { NpmPackage, NpmPluginOptions, npm };
1
+ import { C as NpmPackage, S as NpmGraph, l as NpmPluginOptions, u as npm, x as DependencySpec } from "../types-DEyZ2r-2.js";
2
+ export { type DependencySpec, type NpmGraph, NpmPackage, NpmPluginOptions, npm };
@@ -1,2 +1,2 @@
1
- import { n as npm, t as NpmPackage } from "../npm-BLkgWr-D.js";
1
+ import { n as NpmPackage, t as npm } from "../npm-CaBYeOeV.js";
2
2
  export { NpmPackage, npm };
@@ -414,6 +414,90 @@ interface CargoGraph {
414
414
  packages: Map<string, CargoPackage>;
415
415
  }
416
416
  //#endregion
417
+ //#region src/providers/npm/graph.d.ts
418
+ declare class NpmPackage extends WorkspacePackage {
419
+ readonly path: string;
420
+ readonly manifest: PackageManifest;
421
+ readonly manager = "npm";
422
+ private dependencies;
423
+ constructor(path: string, manifest: PackageManifest);
424
+ get name(): string;
425
+ get version(): string | undefined;
426
+ write(): Promise<void>;
427
+ initDraft(): PackageDraft;
428
+ getRegistry(): string;
429
+ configureDraft({
430
+ draft
431
+ }: {
432
+ draft: PackageDraft;
433
+ }): void;
434
+ listDependencies(graph: NpmGraph): ResolvedNpmDependency[];
435
+ }
436
+ interface BunWorkspaces {
437
+ packages?: string[];
438
+ catalog?: Record<string, string>;
439
+ catalogs?: Record<string, Record<string, string>>;
440
+ }
441
+ interface PackageManifest {
442
+ name: string;
443
+ version?: string;
444
+ private?: boolean;
445
+ publishConfig?: {
446
+ access?: "public" | "restricted";
447
+ registry?: string;
448
+ tag?: string;
449
+ };
450
+ scripts?: Record<string, string>;
451
+ workspaces?: string[] | BunWorkspaces;
452
+ catalog?: Record<string, string>;
453
+ catalogs?: Record<string, Record<string, string>>;
454
+ dependencies?: Record<string, string>;
455
+ devDependencies?: Record<string, string>;
456
+ peerDependencies?: Record<string, string>;
457
+ optionalDependencies?: Record<string, string>;
458
+ }
459
+ declare const DEP_FIELDS: readonly ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"];
460
+ type DepField = (typeof DEP_FIELDS)[number];
461
+ type DependencySpec = {
462
+ protocol: "workspace";
463
+ range: string;
464
+ packageName?: string;
465
+ path?: string;
466
+ } | {
467
+ protocol: "file" | "portal";
468
+ path: string;
469
+ } | {
470
+ protocol: "catalog";
471
+ catalogName: string;
472
+ } | {
473
+ protocol: "npm";
474
+ alias: string;
475
+ range: string;
476
+ } | {
477
+ range: string;
478
+ protocol?: undefined;
479
+ };
480
+ interface ResolvedNpmDependency {
481
+ field: DepField;
482
+ name: string;
483
+ spec: DependencySpec;
484
+ linked?: NpmPackage;
485
+ range?: string;
486
+ setRange?: (range: string) => void;
487
+ }
488
+ interface NpmGraph {
489
+ root: string;
490
+ /** package name -> package */
491
+ packages: Map<string, NpmPackage>;
492
+ packagesByPath: Map<string, NpmPackage>;
493
+ catalogs: CatalogSource[];
494
+ }
495
+ interface CatalogSource {
496
+ resolve(name: string, catalogName: string): string | undefined;
497
+ setRange(name: string, catalogName: string, range: string): void;
498
+ write?: () => Promise<void>;
499
+ }
500
+ //#endregion
417
501
  //#region src/context.d.ts
418
502
  interface TegamiContext {
419
503
  /** absolute path */
@@ -439,31 +523,14 @@ interface TegamiContext {
439
523
  };
440
524
  /** additional context when npm plugin is configured */
441
525
  npm?: {
442
- client: AgentName;
526
+ client: AgentName; /** available after resolve */
527
+ graph?: NpmGraph;
443
528
  };
444
529
  cargo?: {
445
530
  graph: CargoGraph;
446
531
  };
447
532
  }
448
533
  //#endregion
449
- //#region src/providers/npm/schema.d.ts
450
- interface PackageManifest {
451
- name: string;
452
- version?: string;
453
- private?: boolean;
454
- publishConfig?: {
455
- access?: "public" | "restricted";
456
- registry?: string;
457
- tag?: string;
458
- };
459
- scripts?: Record<string, string>;
460
- workspaces?: string[];
461
- dependencies?: Record<string, string>;
462
- devDependencies?: Record<string, string>;
463
- peerDependencies?: Record<string, string>;
464
- optionalDependencies?: Record<string, string>;
465
- }
466
- //#endregion
467
534
  //#region src/changelog/generate.d.ts
468
535
  interface GenerateFromCommitsOptions {
469
536
  /** Start revision. Defaults to the latest reachable git tag, or all history if none exists. */
@@ -515,6 +582,18 @@ interface PackagePublishPlan {
515
582
  interface PublishOptions {
516
583
  /** Validate the publish plan without publishing packages, creating tags, or running release plugins. */
517
584
  dryRun?: boolean;
585
+ /**
586
+ * Publish only the given packages and their dependencies.
587
+ *
588
+ * Each entry can be a package id, package name, or `group:name`.
589
+ */
590
+ packages?: string[];
591
+ /**
592
+ * The max amount of concurrent publishes (unstable, can change in anytime).
593
+ *
594
+ * @default 5
595
+ */
596
+ unstable_maxChunk?: number;
518
597
  }
519
598
  type PackagePublishResult = {
520
599
  type: "published" | "skipped";
@@ -561,9 +640,9 @@ interface Tegami {
561
640
  *
562
641
  * Prefer `publish()` over this if you are publishing packages, it will also check the publish status.
563
642
  */
564
- publishStatus(): Promise<"pending" | "success" | "idle">;
643
+ publishStatus(options?: PublishOptions): Promise<"pending" | "success" | "idle">;
565
644
  /** Remove the publish lock file after publishing has finished successfully. */
566
- cleanup(): Promise<{
645
+ cleanup(options?: PublishOptions): Promise<{
567
646
  state: "removed";
568
647
  } | {
569
648
  state: "skipped";
@@ -580,13 +659,17 @@ interface Tegami {
580
659
  declare function tegami<const Groups extends string = string>(options?: TegamiOptions<Groups>): Tegami;
581
660
  //#endregion
582
661
  //#region src/cli/core.d.ts
583
- interface TegamiCliCommand<Values extends Record<string, boolean | string | undefined>, Positionals extends Record<string, string | undefined>> {
584
- option<const Name extends string, const T extends "string" | "boolean">(name: Name, opts: {
662
+ type ArgValue = boolean | string | string[] | boolean[];
663
+ type PositionalValue = string | string[];
664
+ interface TegamiCliCommand<Values extends Record<string, ArgValue | undefined>, Positionals extends Record<string, PositionalValue | undefined>> {
665
+ option<const Name extends string, const T extends "string" | "boolean", const Multiple extends boolean = false>(name: Name, opts: {
585
666
  type: T;
586
667
  short?: string;
587
668
  description?: string;
588
- }): TegamiCliCommand<Values & { [k in Name]?: T extends "string" ? string : boolean }, Positionals>;
669
+ multiple?: Multiple;
670
+ }): TegamiCliCommand<Values & { [k in Name]?: Multiple extends true ? T extends "string" ? string[] : boolean[] : T extends "string" ? string : boolean }, Positionals>;
589
671
  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 }>;
672
+ positionals<const Name extends string>(name: Name): TegamiCliCommand<Values, Positionals & { [K in Name]: string[] }>;
590
673
  action(fn: (options: {
591
674
  context: TegamiContext;
592
675
  values: Values;
@@ -617,46 +700,12 @@ type TrustedPublishOptions = {
617
700
  };
618
701
  //#endregion
619
702
  //#region src/providers/npm.d.ts
620
- declare const DEP_FIELDS: readonly ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"];
621
- declare class NpmPackage extends WorkspacePackage {
622
- readonly path: string;
623
- readonly manifest: PackageManifest;
624
- readonly manager = "npm";
625
- constructor(path: string, manifest: PackageManifest);
626
- get name(): string;
627
- get version(): string | undefined;
628
- write(): Promise<void>;
629
- initDraft(): PackageDraft;
630
- getRegistry(): string;
631
- configureDraft({
632
- draft
633
- }: {
634
- draft: PackageDraft;
635
- }): void;
636
- }
637
- type DependencySpec = {
638
- protocol: "npm";
639
- alias: string;
640
- range: string;
641
- linked?: WorkspacePackage;
642
- } | {
643
- protocol: "workspace";
644
- range: string;
645
- linked?: WorkspacePackage;
646
- } | {
647
- protocol: "file";
648
- raw: string;
649
- linked?: WorkspacePackage;
650
- } | {
651
- range: string;
652
- linked?: WorkspacePackage;
653
- protocol?: undefined;
654
- };
655
703
  interface DependentRef {
656
704
  dependent: NpmPackage;
657
- kind: (typeof DEP_FIELDS)[number];
705
+ kind: DepField;
658
706
  name: string;
659
707
  spec: DependencySpec;
708
+ resolved: ResolvedNpmDependency;
660
709
  }
661
710
  interface NpmPluginOptions {
662
711
  /** Package manager command used for npm registry operations. */
@@ -806,6 +855,10 @@ interface TegamiPlugin {
806
855
  resolvePlanStatus?(this: TegamiContext, opts: {
807
856
  plan: PublishPlan;
808
857
  }): Awaitable<"success" | "pending" | undefined | void | Awaitable<"success" | "pending" | undefined>[]>;
858
+ /** Called after preflights, before Tegami starts publishing the packages of a plan. */
859
+ beforePublishAll?(this: TegamiContext, opts: {
860
+ plan: PublishPlan;
861
+ }): Awaitable<void>;
809
862
  /** Called before a package will be published, return `false` to prevent from publishing. */
810
863
  willPublish?(this: TegamiContext, opts: {
811
864
  pkg: WorkspacePackage;
@@ -828,17 +881,23 @@ type Awaitable<T> = T | Promise<T>;
828
881
  type RequireFields<Obj, K extends keyof Obj> = Obj & { [R in K]-?: NonNullable<Obj[R]> };
829
882
  interface PublishPreflight {
830
883
  /**
831
- * Whether the package should be published, the state **must not** be changed across different runs.
884
+ * Whether the package should be published, the state **must only depend on local inputs** (e.g. local `package.json` or `publish-lock.yaml`).
832
885
  *
833
886
  * To note if the package is already published, hook `resolvePlanStatus` on plugins, or skip at publish-time.
834
887
  */
835
888
  shouldPublish: boolean;
836
889
  /**
837
- * Package ids that must be published before this one, this will automatically disallow circular dependency.
890
+ * Package ids that **must be** published before this one, this disallows circular dependency.
838
891
  *
839
- * It is okay to add unpublished packages to `wait`, they will be ignored.
892
+ * It is okay to add unpublished packages, they will be ignored.
840
893
  */
841
894
  wait?: string[];
895
+ /**
896
+ * Package ids that **are preferred** to publish before this one, this allows circular dependency.
897
+ *
898
+ * It is okay to add unpublished packages, they will be ignored.
899
+ */
900
+ optionalWait?: string[];
842
901
  }
843
902
  //#endregion
844
- export { DraftPolicy as A, CargoPackage as C, PackageGroup as D, PackageGraph as E, BumpType as M, WorkspacePackage as O, CargoGraph as S, cargo as T, PackagePublishResult as _, PublishPreflight as a, CommitChangelog as b, TegamiPluginOption as c, npm as d, GenerateChangelogOptions as f, PackagePublishPlan as g, PublishLock as h, PackageOptions as i, PackageDraft as j, Draft as k, NpmPackage as l, tegami as m, GroupOptions as n, TegamiOptions as o, Tegami as p, LogGenerator as r, TegamiPlugin as s, Awaitable as t, NpmPluginOptions as u, PublishOptions as v, CargoPluginOptions as w, TegamiContext as x, PublishPlan as y };
903
+ export { WorkspacePackage as A, NpmPackage as C, cargo as D, CargoPluginOptions as E, DraftPolicy as M, PackageDraft as N, PackageGraph as O, BumpType as P, NpmGraph as S, CargoPackage as T, PublishOptions as _, PublishPreflight as a, TegamiContext as b, TegamiPluginOption as c, GenerateChangelogOptions as d, Tegami as f, PackagePublishResult as g, PackagePublishPlan as h, PackageOptions as i, Draft as j, PackageGroup 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, CargoGraph as w, DependencySpec as x, CommitChangelog as y };