tegami 1.0.1 → 1.1.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.
@@ -1,40 +1,76 @@
1
1
  import { n as execFailure } from "../error-BhMYq9iW.js";
2
- import { n as WorkspacePackage } from "../graph-gThXu8Cz.js";
2
+ import { n as WorkspacePackage } from "../graph-BmXTJZxx.js";
3
3
  import { readFile, writeFile } from "node:fs/promises";
4
- import { join, normalize } from "node:path";
4
+ import path from "node:path";
5
5
  import { x } from "tinyexec";
6
6
  import * as semver$1 from "semver";
7
7
  import z from "zod";
8
8
  import { glob } from "tinyglobby";
9
9
  import initToml, { edit, parse as parse$1 } from "@rainbowatcher/toml-edit-js";
10
10
  //#region src/plugins/cargo/schema.ts
11
- const cargoDependencySchema = z.union([z.string(), z.object({
12
- version: z.string(),
11
+ const baseDepSchema = z.object({
13
12
  package: z.string().optional(),
14
- path: z.string().optional()
15
- })]);
16
- const cargoTargetConfigSchema = z.object({
17
- dependencies: z.record(z.string(), cargoDependencySchema).optional(),
18
- "dev-dependencies": z.record(z.string(), cargoDependencySchema).optional(),
19
- "build-dependencies": z.record(z.string(), cargoDependencySchema).optional()
13
+ features: z.array(z.string()).optional(),
14
+ optional: z.boolean().optional(),
15
+ "default-features": z.boolean().optional()
20
16
  });
21
- const cargoPackageSchema = z.object({
22
- name: z.string(),
23
- version: z.string().optional(),
24
- publish: z.boolean().optional()
17
+ /** `{ workspace = true }` — inherit from `[workspace.dependencies]` */
18
+ const workspaceDependencySchema = baseDepSchema.extend({ workspace: z.literal(true) });
19
+ /** `{ path = "../lib" }` — optional `version` for publishing */
20
+ const pathDependencySchema = baseDepSchema.extend({
21
+ path: z.string(),
22
+ version: z.string().optional()
25
23
  });
26
- const cargoWorkspaceSchema = z.object({
24
+ /** `{ git = "…" }` — exactly one of `branch`, `tag`, or `rev` in practice */
25
+ const gitDependencySchema = baseDepSchema.extend({
26
+ git: z.string(),
27
+ branch: z.string().optional(),
28
+ tag: z.string().optional(),
29
+ rev: z.string().optional(),
30
+ version: z.string().optional()
31
+ });
32
+ /** `{ version = "1.0" }` — crates.io or `[registries]` */
33
+ const registryDependencySchema = baseDepSchema.extend({
34
+ version: z.string(),
35
+ registry: z.string().optional()
36
+ });
37
+ /**
38
+ * @see https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html
39
+ */
40
+ const cargoDependencySchema = z.union([
41
+ z.string(),
42
+ workspaceDependencySchema,
43
+ pathDependencySchema,
44
+ gitDependencySchema,
45
+ registryDependencySchema
46
+ ]);
47
+ const cargoInheritSchema = z.looseObject({ workspace: z.literal(true) });
48
+ const cargoWorkspaceSchema = z.looseObject({
27
49
  members: z.array(z.string()).optional(),
28
50
  exclude: z.array(z.string()).optional(),
29
- package: z.object({ version: z.string().optional() }).optional()
51
+ package: z.looseObject({
52
+ version: z.string().optional(),
53
+ publish: z.boolean().optional()
54
+ }).optional(),
55
+ dependencies: z.record(z.string(), cargoDependencySchema).optional(),
56
+ "dev-dependencies": z.record(z.string(), cargoDependencySchema).optional(),
57
+ "build-dependencies": z.record(z.string(), cargoDependencySchema).optional()
30
58
  });
31
- const cargoManifestSchema = z.object({
32
- package: cargoPackageSchema,
59
+ const cargoManifestSchema = z.looseObject({
60
+ package: z.looseObject({
61
+ name: z.string(),
62
+ version: z.string().or(cargoInheritSchema),
63
+ publish: z.boolean().or(cargoInheritSchema).optional()
64
+ }).optional(),
33
65
  workspace: cargoWorkspaceSchema.optional(),
34
66
  dependencies: z.record(z.string(), cargoDependencySchema).optional(),
35
67
  "dev-dependencies": z.record(z.string(), cargoDependencySchema).optional(),
36
68
  "build-dependencies": z.record(z.string(), cargoDependencySchema).optional(),
37
- target: z.record(z.string(), cargoTargetConfigSchema).optional()
69
+ target: z.record(z.string(), z.looseObject({
70
+ dependencies: z.record(z.string(), cargoDependencySchema).optional(),
71
+ "dev-dependencies": z.record(z.string(), cargoDependencySchema).optional(),
72
+ "build-dependencies": z.record(z.string(), cargoDependencySchema).optional()
73
+ })).optional()
38
74
  });
39
75
  //#endregion
40
76
  //#region src/plugins/cargo.ts
@@ -43,44 +79,61 @@ const DEP_FIELDS = [
43
79
  "dev-dependencies",
44
80
  "build-dependencies"
45
81
  ];
46
- var CargoPackage = class extends WorkspacePackage {
82
+ var CargoToml = class {
47
83
  path;
48
- manifest;
49
84
  content;
50
- workspaceManifest;
85
+ data;
86
+ dependencies;
87
+ workspace;
88
+ constructor(path, content, data) {
89
+ this.path = path;
90
+ this.content = content;
91
+ this.data = data;
92
+ }
93
+ listDependencies(graph) {
94
+ return this.dependencies ??= listDependencies(graph, this);
95
+ }
96
+ patch(path, value) {
97
+ this.content = edit(this.content, path, value);
98
+ }
99
+ };
100
+ var CargoPackage = class extends WorkspacePackage {
101
+ path;
102
+ file;
51
103
  manager = "cargo";
52
- constructor(path, manifest, content, workspaceManifest) {
104
+ manifest;
105
+ constructor(path, file) {
53
106
  super();
54
107
  this.path = path;
55
- this.manifest = manifest;
56
- this.content = content;
57
- this.workspaceManifest = workspaceManifest;
108
+ this.file = file;
109
+ this.manifest = file.data;
58
110
  }
59
111
  get name() {
60
- return this.packageInfo.name;
112
+ return this.manifest.package.name;
61
113
  }
62
114
  get version() {
63
- return this.packageInfo.version ?? this.workspaceVersion;
115
+ const packageVersion = this.manifest.package.version;
116
+ if (typeof packageVersion === "string") return packageVersion;
117
+ const inherited = this.file.workspace?.data.workspace.package;
118
+ if (packageVersion.workspace && inherited?.version) return inherited.version;
119
+ throw new Error(`Invalid Cargo.toml in "${this.path}".`);
64
120
  }
65
121
  setVersion(version) {
66
- this.packageInfo.version = version;
67
- this.patch("package.version", version);
68
- }
69
- async write() {
70
- await writeFile(join(this.path, "Cargo.toml"), this.content + "\n");
71
- }
72
- patch(path, value) {
73
- this.content = edit(this.content, path, value);
74
- }
75
- get packageInfo() {
76
- return this.manifest.package;
77
- }
78
- get workspaceVersion() {
79
- return this.workspaceManifest?.workspace?.package?.version;
122
+ const packageInfo = this.manifest.package;
123
+ if (typeof packageInfo.version === "string") {
124
+ packageInfo.version = version;
125
+ this.file.patch("package.version", version);
126
+ return;
127
+ }
128
+ if (packageInfo.version.workspace && this.file.workspace?.data.workspace.package) {
129
+ this.file.workspace.data.workspace.package.version = version;
130
+ this.file.workspace.patch("workspace.package.version", version);
131
+ return;
132
+ }
133
+ throw new Error(`Invalid Cargo.toml in "${this.path}".`);
80
134
  }
81
135
  };
82
136
  function cargo({ updateLockFile = true, bumpDep: getBumpDepType } = {}) {
83
- let active = false;
84
137
  return {
85
138
  name: "cargo",
86
139
  enforce: "pre",
@@ -88,34 +141,33 @@ function cargo({ updateLockFile = true, bumpDep: getBumpDepType } = {}) {
88
141
  await initToml();
89
142
  },
90
143
  async resolve() {
91
- await discoverCargoPackages(this.cwd, (pkg) => this.graph.add(pkg));
92
- active = this.graph.getPackages().some((pkg) => pkg instanceof CargoPackage);
144
+ const graph = await resolveCargoGraph(this.cwd);
145
+ if (graph.packages.size === 0) return;
146
+ this.cargo = { graph };
147
+ for (const pkg of graph.packages.values()) this.graph.add(pkg);
93
148
  },
94
149
  initDraft(plan) {
95
- if (!active) return;
150
+ if (!this.cargo) return;
96
151
  plan.addPolicy(depsPolicy(this, getBumpDepType));
97
152
  },
98
153
  async publishPreflight({ pkg }) {
99
- if (!(pkg instanceof CargoPackage)) return;
154
+ if (!(pkg instanceof CargoPackage) || !this.cargo) return;
155
+ let shouldPublish = true;
156
+ if (typeof pkg.manifest.package.publish === "boolean") shouldPublish = pkg.manifest.package.publish;
157
+ else if (pkg.manifest.package.publish?.workspace) shouldPublish = pkg.file.workspace?.data.workspace?.package?.publish ?? shouldPublish;
100
158
  const wait = [];
101
- for (const { table } of dependencyTables(pkg.manifest, "")) for (const [rawName, dep] of Object.entries(table)) {
102
- if (!dep || typeof dep === "string" || !dep.path) continue;
103
- const id = `cargo:${dep.package ?? rawName}`;
104
- const linked = this.graph.get(id);
105
- if (!linked || !(linked instanceof CargoPackage)) continue;
106
- wait.push(id);
107
- }
159
+ for (const { resolved } of pkg.file.listDependencies(this.cargo.graph)) if (resolved) wait.push(resolved.id);
108
160
  return {
109
- shouldPublish: pkg.version !== void 0 && pkg.packageInfo.publish !== false,
161
+ shouldPublish,
110
162
  wait
111
163
  };
112
164
  },
113
165
  resolvePlanStatus({ plan }) {
114
- if (!active) return;
166
+ if (!this.cargo) return;
115
167
  return Array.from(plan.packages, async ([id, { preflight }]) => {
116
168
  if (!preflight.shouldPublish) return;
117
169
  const pkg = this.graph.get(id);
118
- if (!(pkg instanceof CargoPackage) || !pkg.version) return;
170
+ if (!(pkg instanceof CargoPackage)) return;
119
171
  if (!await isPackagePublished(pkg.name, pkg.version)) return "pending";
120
172
  });
121
173
  },
@@ -132,70 +184,57 @@ function cargo({ updateLockFile = true, bumpDep: getBumpDepType } = {}) {
132
184
  return { type: "published" };
133
185
  },
134
186
  async applyDraft(draft) {
135
- if (!active) return;
136
- const { graph } = this;
137
- const writes = [];
138
- for (const pkg of graph.getPackages()) {
139
- if (!(pkg instanceof CargoPackage)) continue;
187
+ if (!this.cargo) return;
188
+ const graph = this.cargo.graph;
189
+ for (const pkg of graph.packages.values()) {
140
190
  const bumped = draft.getPackageDraft(pkg.id)?.bumpVersion(pkg);
141
191
  if (bumped) pkg.setVersion(bumped);
142
192
  }
143
- for (const pkg of graph.getPackages()) {
144
- if (!(pkg instanceof CargoPackage)) continue;
145
- for (const { table, path: tablePath } of dependencyTables(pkg.manifest, "")) for (const [rawName, rawSpec] of Object.entries(table)) {
146
- const spec = parseSpec(rawSpec);
147
- if (!spec || !semver$1.validRange(spec.version)) continue;
148
- const packageName = spec.package ?? rawName;
149
- const linked = graph.get(`cargo:${packageName}`);
150
- if (!linked || !(linked instanceof CargoPackage)) continue;
151
- if (!linked.version || semver$1.satisfies(linked.version, spec.version)) continue;
152
- let updatedRange;
153
- if (spec.version.startsWith("^")) updatedRange = `^${linked.version}`;
154
- else if (spec.version.startsWith("~")) updatedRange = `~${linked.version}`;
155
- else updatedRange = linked.version;
156
- table[rawName] = spec.setVersion(updatedRange);
157
- pkg.patch(typeof rawSpec === "string" ? `${tablePath}.${rawName}` : `${tablePath}.${rawName}.version`, updatedRange);
158
- }
159
- writes.push(pkg.write());
193
+ for (const file of graph.files.values()) for (const { range, resolved, setRange } of file.listDependencies(graph)) {
194
+ if (!resolved || !range || !setRange || semver$1.satisfies(resolved.version, range)) continue;
195
+ let updatedRange;
196
+ if (range.startsWith("^")) updatedRange = `^${resolved.version}`;
197
+ else if (range.startsWith("~")) updatedRange = `~${resolved.version}`;
198
+ else updatedRange = resolved.version;
199
+ setRange(updatedRange);
160
200
  }
161
- await Promise.all(writes);
201
+ await Promise.all(Array.from(graph.files.values(), (file) => writeFile(file.path, file.content + "\n")));
162
202
  },
163
203
  async applyCliDraft() {
164
- if (!active || !updateLockFile) return;
204
+ if (!this.cargo || !updateLockFile) return;
165
205
  const result = await x("cargo", ["update", "--workspace"], { nodeOptions: { cwd: this.cwd } });
166
206
  if (result.exitCode !== 0) throw execFailure("Failed to update Cargo lock file", result);
167
207
  }
168
208
  };
169
209
  }
170
- function depsPolicy({ graph }, getBumpDepType = ({ kind }) => {
210
+ function depsPolicy({ cargo }, getBumpDepType = ({ kind }) => {
171
211
  switch (kind) {
172
212
  case "dependencies": return "patch";
173
213
  case "build-dependencies":
174
214
  case "dev-dependencies": return false;
175
215
  }
176
216
  }) {
217
+ const cargoGraph = cargo.graph;
177
218
  const dependentMap = /* @__PURE__ */ new Map();
178
- for (const pkg of graph.getPackages()) {
179
- if (!(pkg instanceof CargoPackage)) continue;
180
- for (const { table, kind } of dependencyTables(pkg.manifest, "")) for (const [rawName, rawSpec] of Object.entries(table)) {
181
- const spec = parseSpec(rawSpec);
182
- if (!spec || !semver$1.validRange(spec.version)) continue;
183
- const name = spec.package ?? rawName;
184
- const id = `cargo:${name}`;
185
- const refs = dependentMap.get(id);
186
- if (refs) refs.push({
187
- dependent: pkg,
188
- kind,
189
- name,
190
- version: spec.version
191
- });
192
- else dependentMap.set(id, [{
193
- dependent: pkg,
194
- kind,
195
- name,
196
- version: spec.version
197
- }]);
198
- }
219
+ for (const pkg of cargoGraph.packages.values()) for (const { resolved, path, spec, range } of pkg.file.listDependencies(cargoGraph)) {
220
+ if (!resolved) continue;
221
+ const refs = dependentMap.get(resolved.id);
222
+ const kind = path[path.length - 2];
223
+ const name = path[path.length - 1];
224
+ if (refs) refs.push({
225
+ dependent: pkg,
226
+ kind,
227
+ name,
228
+ spec,
229
+ version: range
230
+ });
231
+ else dependentMap.set(resolved.id, [{
232
+ dependent: pkg,
233
+ kind,
234
+ name,
235
+ spec,
236
+ version: range
237
+ }]);
199
238
  }
200
239
  return {
201
240
  id: "cargo:deps",
@@ -203,17 +242,16 @@ function depsPolicy({ graph }, getBumpDepType = ({ kind }) => {
203
242
  if (!(pkg instanceof CargoPackage)) return;
204
243
  const deps = dependentMap.get(pkg.id);
205
244
  if (!deps) return;
206
- const group = graph.getPackageGroup(pkg.id);
207
245
  const bumped = plan.bumpVersion(pkg);
208
246
  if (!bumped) return;
209
247
  for (const dep of deps) {
210
- if (group?.options.syncBump && graph.getPackageGroup(dep.dependent.id) === group) continue;
211
- if (semver$1.satisfies(bumped, dep.version)) continue;
248
+ if (pkg.group?.options.syncBump && dep.dependent.group === pkg.group) continue;
249
+ if (dep.version && semver$1.satisfies(bumped, dep.version)) continue;
212
250
  const bumpType = getBumpDepType(dep);
213
251
  if (bumpType === false) continue;
214
252
  this.bumpPackage(dep.dependent, {
215
253
  type: bumpType,
216
- reason: `update dependency "${dep.name}"`
254
+ reason: `update dependency "${pkg.name}"`
217
255
  });
218
256
  }
219
257
  }
@@ -225,81 +263,139 @@ async function isPackagePublished(name, version) {
225
263
  if (response.status === 404) return false;
226
264
  throw new Error(`Unable to validate ${name}@${version} against crates.io: ${await response.text()}`);
227
265
  }
228
- async function buildEntry(path) {
266
+ async function buildEntry(dir) {
229
267
  try {
230
- const content = await readFile(join(path, "Cargo.toml"), "utf8");
231
- return {
232
- manifest: cargoManifestSchema.parse(parse$1(content)),
233
- content,
234
- path
235
- };
268
+ const filePath = path.join(dir, "Cargo.toml");
269
+ const content = await readFile(filePath, "utf8");
270
+ return new CargoToml(filePath, content, cargoManifestSchema.parse(parse$1(content)));
236
271
  } catch {
237
272
  return;
238
273
  }
239
274
  }
240
- async function discoverCargoPackages(cwd, add) {
275
+ async function resolveCargoGraph(cwd) {
276
+ const out = {
277
+ packages: /* @__PURE__ */ new Map(),
278
+ files: /* @__PURE__ */ new Map()
279
+ };
241
280
  const root = await buildEntry(cwd);
242
- if (!root) return;
243
- if (root.manifest.package?.name) add(new CargoPackage(cwd, root.manifest, root.content, root.manifest));
244
- const workspace = root.manifest.workspace;
245
- if (!workspace?.members) return;
246
- const paths = await expandWorkspaceMembers(cwd, workspace.members, workspace.exclude);
247
- const manifests = await Promise.all(paths.map(buildEntry));
248
- for (const entry of manifests) if (entry?.manifest.package?.name) add(new CargoPackage(entry.path, entry.manifest, entry.content, root.manifest));
281
+ if (!root) return out;
282
+ out.files.set(root.path, root);
283
+ if (root.data.package) {
284
+ const pkg = new CargoPackage(cwd, root);
285
+ out.packages.set(pkg.name, pkg);
286
+ }
287
+ if (root.data.workspace?.members) {
288
+ root.workspace = root;
289
+ const dirs = await expandWorkspaceMembers(cwd, root.data.workspace.members, root.data.workspace.exclude);
290
+ await Promise.all(dirs.map(async (dir) => {
291
+ const entry = await buildEntry(dir);
292
+ if (!entry || !entry.data.package) return;
293
+ entry.workspace = root;
294
+ const pkg = new CargoPackage(dir, entry);
295
+ out.files.set(entry.path, entry);
296
+ out.packages.set(pkg.name, pkg);
297
+ }));
298
+ }
299
+ return out;
249
300
  }
250
301
  async function expandWorkspaceMembers(cwd, members, exclude = []) {
251
- const paths = members.includes(".") ? [cwd] : [];
252
302
  const patterns = members.filter((member) => member !== ".");
253
- if (patterns.length > 0) paths.push(...await glob(patterns, {
303
+ if (patterns.length === 0) return [];
304
+ return (await glob(patterns, {
254
305
  absolute: true,
255
306
  cwd,
256
307
  ignore: ["**/target/**", ...exclude],
257
308
  onlyDirectories: true,
258
309
  onlyFiles: false
259
- }));
260
- return paths.map(normalize);
310
+ })).map((item) => {
311
+ return item.endsWith(path.sep) ? item.slice(0, -1) : item;
312
+ });
261
313
  }
262
- function dependencyTables(manifest, prefix) {
263
- const tables = [];
264
- for (const field of DEP_FIELDS) {
265
- const table = manifest[field];
266
- if (table) {
267
- const path = prefix ? `${prefix}.${field}` : field;
268
- tables.push({
269
- kind: field,
270
- table,
271
- path
272
- });
273
- }
274
- }
275
- const target = manifest.target;
276
- if (target) for (const [targetKey, targetConfig] of Object.entries(target)) {
277
- const targetPath = prefix ? `${prefix}.target.${targetKey}` : `target.${targetKey}`;
314
+ function listDependencies(graph, file) {
315
+ const out = [];
316
+ function scan(obj, prefix = []) {
278
317
  for (const field of DEP_FIELDS) {
279
- const table = targetConfig[field];
280
- if (table) tables.push({
281
- kind: field,
282
- table,
283
- path: `${targetPath}.${field}`
284
- });
318
+ const table = obj[field];
319
+ if (!table) continue;
320
+ const tablePath = [...prefix, field];
321
+ for (const [key, spec] of Object.entries(table)) {
322
+ const { linked, range, setRange } = resolveLinkedDep(file, graph, tablePath, key, spec) ?? {};
323
+ out.push({
324
+ path: [...tablePath, key],
325
+ spec,
326
+ resolved: linked,
327
+ range,
328
+ setRange: setRange && ((v) => {
329
+ table[key] = setRange(v);
330
+ })
331
+ });
332
+ }
285
333
  }
286
334
  }
287
- return tables;
335
+ scan(file.data);
336
+ if (file.data.target) for (const [key, config] of Object.entries(file.data.target)) scan(config, ["target", key]);
337
+ if (file.data.workspace) scan(file.data.workspace);
338
+ return out;
288
339
  }
289
- function parseSpec(v) {
290
- if (typeof v === "string") return {
291
- version: v,
292
- setVersion(version) {
293
- return version;
340
+ function resolveLinkedDep(file, graph, tablePath, key, spec) {
341
+ if (typeof spec === "string") {
342
+ const linked = graph.packages.get(key);
343
+ if (!linked) return;
344
+ return {
345
+ linked,
346
+ range: spec,
347
+ setRange(v) {
348
+ file.patch([...tablePath, key].join("."), v);
349
+ return v;
350
+ }
351
+ };
352
+ }
353
+ if ("git" in spec) return;
354
+ if ("workspace" in spec) {
355
+ const kind = tablePath[tablePath.length - 1];
356
+ const entry = file.workspace?.data.workspace?.[kind]?.[key];
357
+ if (!entry) return;
358
+ const resolved = resolveLinkedDep(file.workspace, graph, ["workspace", kind], key, entry);
359
+ if (!resolved) return;
360
+ delete resolved.setRange;
361
+ return resolved;
362
+ }
363
+ if ("path" in spec) {
364
+ const pkgPath = path.resolve(path.dirname(file.path), spec.path);
365
+ for (const pkg of graph.packages.values()) {
366
+ if (pkg.path !== pkgPath) continue;
367
+ return {
368
+ linked: pkg,
369
+ range: spec.version,
370
+ setRange(v) {
371
+ file.patch([
372
+ ...tablePath,
373
+ key,
374
+ "version"
375
+ ].join("."), v);
376
+ return {
377
+ ...spec,
378
+ version: v
379
+ };
380
+ }
381
+ };
294
382
  }
295
- };
383
+ return;
384
+ }
385
+ const linked = graph.packages.get(spec.package ?? key);
386
+ if (!linked) return;
296
387
  return {
297
- package: v.package,
298
- version: v.version,
299
- setVersion(version) {
388
+ linked,
389
+ range: spec.version,
390
+ setRange(v) {
391
+ file.patch([
392
+ ...tablePath,
393
+ key,
394
+ "version"
395
+ ].join("."), v);
300
396
  return {
301
- ...v,
302
- version
397
+ ...spec,
398
+ version: v
303
399
  };
304
400
  }
305
401
  };
@@ -1,4 +1,4 @@
1
- import { s as TegamiPlugin } from "../types-DItu_YCc.js";
1
+ import { s as TegamiPlugin } from "../types-BoQR7Hlg.js";
2
2
 
3
3
  //#region src/plugins/git.d.ts
4
4
  interface GitPluginOptions {
@@ -43,9 +43,8 @@ function git(options = {}) {
43
43
  const { graph } = this;
44
44
  for (const [id, packagePlan] of plan.packages) {
45
45
  const pkg = graph.get(id);
46
- const group = graph.getPackageGroup(pkg.id);
47
46
  packagePlan.git ??= {};
48
- if (group?.options.syncGitTag && pkg.version) packagePlan.git.tag = `${group.name}@${pkg.version}`;
47
+ if (pkg.group?.options.syncGitTag && pkg.version) packagePlan.git.tag = `${pkg.group.name}@${pkg.version}`;
49
48
  else if (pkg.version) packagePlan.git.tag = `${pkg.name}@${pkg.version}`;
50
49
  }
51
50
  },
@@ -1,4 +1,4 @@
1
- import { T as Draft, s as TegamiPlugin, t as Awaitable, w as WorkspacePackage, x as TegamiContext, y as PublishPlan } from "../types-DItu_YCc.js";
1
+ import { O as WorkspacePackage, k as Draft, s as TegamiPlugin, t as Awaitable, x as TegamiContext, y as PublishPlan } from "../types-BoQR7Hlg.js";
2
2
  import { GitPluginOptions } from "./git.js";
3
3
 
4
4
  //#region src/plugins/github.d.ts
@@ -1,7 +1,7 @@
1
1
  import { i as formatPackageVersion, r as formatNpmDistTag } from "../semver-EKJ8yK5U.js";
2
2
  import { t as changelogFilename } from "../generate-Rvz4Lu98.js";
3
3
  import { a as cached, n as execFailure, o as isCI } from "../error-BhMYq9iW.js";
4
- import { n as createDraft, o as readChangelogEntries } from "../draft-BqHcSCeX.js";
4
+ import { n as createDraft, o as readChangelogEntries } from "../draft-BLbt4bSG.js";
5
5
  import { git } from "./git.js";
6
6
  import { n as createVersionRequestBody, r as hasGitChanges, t as commitVersionBranchChanges } from "../version-request-oxy16TJ1.js";
7
7
  import { readFile, writeFile } from "node:fs/promises";
@@ -1,4 +1,4 @@
1
- import { T as Draft, s as TegamiPlugin, t as Awaitable, w as WorkspacePackage, x as TegamiContext, y as PublishPlan } from "../types-DItu_YCc.js";
1
+ import { O as WorkspacePackage, k as Draft, s as TegamiPlugin, t as Awaitable, x as TegamiContext, y as PublishPlan } from "../types-BoQR7Hlg.js";
2
2
  import { GitPluginOptions } from "./git.js";
3
3
 
4
4
  //#region src/plugins/gitlab.d.ts
@@ -1,7 +1,7 @@
1
1
  import { i as formatPackageVersion, r as formatNpmDistTag } from "../semver-EKJ8yK5U.js";
2
2
  import { t as changelogFilename } from "../generate-Rvz4Lu98.js";
3
3
  import { a as cached, n as execFailure, o as isCI, s as joinPath } from "../error-BhMYq9iW.js";
4
- import { n as createDraft, o as readChangelogEntries } from "../draft-BqHcSCeX.js";
4
+ import { n as createDraft, o as readChangelogEntries } from "../draft-BLbt4bSG.js";
5
5
  import { git } from "./git.js";
6
6
  import { n as createVersionRequestBody, r as hasGitChanges, t as commitVersionBranchChanges } from "../version-request-oxy16TJ1.js";
7
7
  import { readFile, writeFile } from "node:fs/promises";
@@ -1,4 +1,4 @@
1
- import { O as BumpType, s as TegamiPlugin, w as WorkspacePackage } from "../types-DItu_YCc.js";
1
+ import { M as BumpType, O as WorkspacePackage, s as TegamiPlugin } from "../types-BoQR7Hlg.js";
2
2
 
3
3
  //#region src/plugins/go.d.ts
4
4
  interface GoModFile {
@@ -1,5 +1,5 @@
1
1
  import { i as isNodeError, n as execFailure } from "../error-BhMYq9iW.js";
2
- import { n as WorkspacePackage } from "../graph-gThXu8Cz.js";
2
+ import { n as WorkspacePackage } from "../graph-BmXTJZxx.js";
3
3
  import { relative, resolve } from "node:path";
4
4
  import { x } from "tinyexec";
5
5
  import * as semver$1 from "semver";
@@ -135,7 +135,7 @@ function go({ updateLockFile = true, bumpDep: getBumpDepType } = {}) {
135
135
  },
136
136
  async publishPreflight({ pkg }) {
137
137
  if (!(pkg instanceof GoPackage)) return;
138
- const shouldPublish = pkg.getPackageOptions().go?.publish ?? this.graph.getPackageGroup(pkg.id)?.options?.go?.publish ?? true;
138
+ const shouldPublish = pkg.options.go?.publish ?? pkg.group?.options?.go?.publish ?? true;
139
139
  const wait = [];
140
140
  for (const [moduleName] of pkg.mod.requires) {
141
141
  const linked = this.graph.get(`go:${moduleName}`);
@@ -205,11 +205,10 @@ function depsPolicy({ graph }, getBumpDepType = () => "patch") {
205
205
  if (!(pkg instanceof GoPackage)) return;
206
206
  const deps = dependentMap.get(pkg.id);
207
207
  if (!deps) return;
208
- const group = graph.getPackageGroup(pkg.id);
209
208
  const bumped = plan.bumpVersion(pkg);
210
209
  if (!bumped) return;
211
210
  for (const dep of deps) {
212
- if (group?.options.syncBump && graph.getPackageGroup(dep.dependent.id) === group) continue;
211
+ if (pkg.group?.options.syncBump && dep.dependent.group === pkg.group) continue;
213
212
  if (semver$1.satisfies(bumped, stripGoVersion(dep.version))) continue;
214
213
  const bumpType = getBumpDepType?.(dep);
215
214
  if (bumpType === false) continue;
@@ -1,2 +1,2 @@
1
- import { d as npm, l as NpmPackage, u as NpmPluginOptions } from "../types-DItu_YCc.js";
1
+ import { d as npm, l as NpmPackage, u as NpmPluginOptions } from "../types-BoQR7Hlg.js";
2
2
  export { NpmPackage, NpmPluginOptions, npm };
@@ -1,2 +1,2 @@
1
- import { n as npm, t as NpmPackage } from "../npm-1iEegfHg.js";
1
+ import { n as npm, t as NpmPackage } from "../npm-Cj685Ddn.js";
2
2
  export { NpmPackage, npm };