tegami 0.1.6 → 0.2.0

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.
@@ -13,21 +13,20 @@ var WorkspacePackage = class {
13
13
  setPackageOptions(options) {
14
14
  this.opts = options;
15
15
  }
16
- /** create the initial draft plan. */
17
- initPlan() {
16
+ /** create the initial draft. */
17
+ initDraft() {
18
18
  return { bumpVersion(pkg) {
19
19
  return bumpVersion(pkg.version, this.type, this.prerelease);
20
20
  } };
21
21
  }
22
- /** configure an initial draft plan to match script-level configs. */
23
- configurePlan(plan, group) {
22
+ /** configure an initial draft to match script-level configs. */
23
+ configureDraft(draft, group) {
24
24
  const groupOptions = group?.options;
25
- const { publish, prerelease = groupOptions?.prerelease, npm: { distTag = groupOptions?.npm?.distTag } = {} } = this.opts;
26
- if (publish !== void 0) plan.publish = publish;
27
- if (prerelease !== void 0) plan.prerelease = prerelease;
25
+ const { prerelease = groupOptions?.prerelease, npm: { distTag = groupOptions?.npm?.distTag } = {} } = this.opts;
26
+ if (prerelease !== void 0) draft.prerelease = prerelease;
28
27
  if (distTag) {
29
- plan.npm ??= {};
30
- plan.npm.distTag = distTag;
28
+ draft.npm ??= {};
29
+ draft.npm.distTag = distTag;
31
30
  }
32
31
  }
33
32
  };
@@ -100,11 +99,19 @@ var PackageGraph = class {
100
99
  }
101
100
  removeGroupMember(group, id) {
102
101
  const entry = this.groups.get(group);
103
- if (!entry) return;
102
+ const pkg = this.packages.get(id);
103
+ if (!entry || !pkg || pkg.group !== entry) return;
104
104
  const index = entry.packages.findIndex((pkg) => pkg.id === id);
105
105
  if (index >= 0) entry.packages.splice(index, 1);
106
+ pkg.group = void 0;
106
107
  }
107
108
  unregisterGroup(name) {
109
+ const group = this.groups.get(name);
110
+ if (!group) return;
111
+ for (const pkg of group.packages) {
112
+ const entry = this.packages.get(pkg.id);
113
+ if (entry?.group === group) entry.group = void 0;
114
+ }
108
115
  this.groups.delete(name);
109
116
  }
110
117
  };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as PackagePlan, C as PublishOptions, D as PackageGroup, E as PackageGraph, O as WorkspacePackage, S as PackagePublishResult, a as PublishPreflight, b as GenerateChangelogOptions, c as TegamiPlugin, i as PackageOptions, k as DraftPlan, l as TegamiPluginOption, n as GroupOptions, o as RegistryClient, r as LogGenerator, s as TegamiOptions, v as Tegami, w as PublishResult, x as GeneratedChangelog, y as tegami } from "./types-DexeJdl7.js";
2
- export { type DraftPlan, type GenerateChangelogOptions, type GeneratedChangelog, type GroupOptions, type LogGenerator, type PackageGraph, type PackageGroup, type PackageOptions, type PackagePlan, type PackagePublishResult, type PublishOptions, type PublishPreflight, type PublishResult, type RegistryClient, Tegami, type TegamiOptions, type TegamiPlugin, type TegamiPluginOption, type WorkspacePackage, tegami };
1
+ import { A as PackageDraft, C as CommitChangelog, D as WorkspacePackage, E as PackageGroup, O as Draft, S as PublishPlan, T as PackageGraph, _ as tegami, a as PublishPreflight, b as PackagePublishResult, c as TegamiPluginOption, g as Tegami, h as GenerateChangelogOptions, i as PackageOptions, k as DraftPolicy, n as GroupOptions, o as TegamiOptions, r as LogGenerator, s as TegamiPlugin, v as PublishLock, x as PublishOptions, y as PackagePublishPlan } from "./types-CurHqnWl.js";
2
+ export { type CommitChangelog, type Draft, type DraftPolicy, GenerateChangelogOptions, type GroupOptions, type LogGenerator, type PackageDraft, type PackageGraph, type PackageGroup, type PackageOptions, type PackagePublishPlan, type PackagePublishResult, type PublishLock, type PublishOptions, type PublishPlan, type PublishPreflight, Tegami, type TegamiOptions, type TegamiPlugin, type TegamiPluginOption, type WorkspacePackage, tegami };