tegami 1.2.1 → 1.2.2

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
- import { f as Tegami, j as Draft, t as Awaitable, v as PublishPlan } from "../types-BbwOrNZ2.js";
1
+ import { f as Tegami, j as Draft, t as Awaitable, v as PublishPlan } from "../types-C_vz41r2.js";
2
2
 
3
3
  //#region src/cli/index.d.ts
4
4
  interface TegamiCLIOptions {
@@ -1,4 +1,4 @@
1
- import { r as LogGenerator } from "../types-BbwOrNZ2.js";
1
+ import { r as LogGenerator } from "../types-C_vz41r2.js";
2
2
 
3
3
  //#region src/generators/simple.d.ts
4
4
  declare function simpleGenerator(): LogGenerator;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as WorkspacePackage, M as DraftPolicy, N as PackageDraft, O as PackageGraph, P as BumpType, _ as PublishOptions, a as PublishPreflight, b as TegamiContext, c as TegamiPluginOption, d as GenerateChangelogOptions, f as Tegami, g as PackagePublishResult, h as PackagePublishPlan, i as PackageOptions, j as Draft, k as PackageGroup, m as PublishLock, n as GroupOptions, o as TegamiOptions, p as tegami, r as LogGenerator, s as TegamiPlugin, v as PublishPlan, y as CommitChangelog } from "./types-BbwOrNZ2.js";
1
+ import { A as WorkspacePackage, M as DraftPolicy, N as PackageDraft, O as PackageGraph, P as BumpType, _ as PublishOptions, a as PublishPreflight, b as TegamiContext, c as TegamiPluginOption, d as GenerateChangelogOptions, f as Tegami, g as PackagePublishResult, h as PackagePublishPlan, i as PackageOptions, j as Draft, k as PackageGroup, m as PublishLock, n as GroupOptions, o as TegamiOptions, p as tegami, r as LogGenerator, s as TegamiPlugin, v as PublishPlan, y as CommitChangelog } from "./types-C_vz41r2.js";
2
2
  export { type BumpType, type CommitChangelog, type Draft, type DraftPolicy, GenerateChangelogOptions, type GroupOptions, type LogGenerator, type PackageDraft, PackageGraph, type PackageGroup, type PackageOptions, type PackagePublishPlan, type PackagePublishResult, type PublishLock, type PublishOptions, type PublishPlan, type PublishPreflight, Tegami, type TegamiContext, type TegamiOptions, type TegamiPlugin, type TegamiPluginOption, WorkspacePackage, tegami };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { n as generateFromCommits } from "./generate-Cnd8RiKO.js";
2
2
  import { i as handlePluginError } from "./error-CAsrGb6e.js";
3
3
  import { a as createDraft, c as parseChangelogFile, i as runPublishPlan, l as readChangelogEntries, n as publishPlanStatus, r as runPreflights, t as initPublishPlan } from "./publish-Bt3e1RPs.js";
4
- import { t as npm } from "./npm-4iA03RvC.js";
4
+ import { t as npm } from "./npm-cS-D2xGI.js";
5
5
  import { n as WorkspacePackage, t as PackageGraph } from "./graph-BmXTJZxx.js";
6
6
  import { mkdir, rm, writeFile } from "node:fs/promises";
7
7
  import path, { join } from "node:path";
@@ -887,14 +887,21 @@ function npm({ client: defaultClient, onBreakPeerDep = "set", updateLockFile = t
887
887
  }
888
888
  } } = {}) {
889
889
  let active = false;
890
- let client;
891
890
  return {
892
891
  name: "npm",
893
892
  enforce: "pre",
894
893
  async init() {
895
- if (defaultClient) client = defaultClient;
896
- else client = (await detect({ cwd: this.cwd }))?.name ?? "npm";
897
- this.npm = { client };
894
+ if (defaultClient) this.npm = {
895
+ client: defaultClient,
896
+ agent: defaultClient
897
+ };
898
+ else {
899
+ const result = await detect({ cwd: this.cwd });
900
+ this.npm = {
901
+ client: result?.name ?? "npm",
902
+ agent: result?.agent ?? "npm"
903
+ };
904
+ }
898
905
  },
899
906
  async resolve() {
900
907
  if (!this.npm) return;
@@ -952,9 +959,9 @@ function npm({ client: defaultClient, onBreakPeerDep = "set", updateLockFile = t
952
959
  }
953
960
  },
954
961
  async publish({ pkg, plan }) {
955
- if (!(pkg instanceof NpmPackage)) return;
962
+ if (!(pkg instanceof NpmPackage) || !this.npm) return;
956
963
  const { distTag, markLatest } = plan.packages.get(pkg.id)?.npm ?? {};
957
- const result = await publish(client, pkg, distTag);
964
+ const result = await publish(this.npm.client, pkg, distTag);
958
965
  if (result.type === "published" && markLatest) {
959
966
  const tagResult = await x("npm", [
960
967
  "dist-tag",
@@ -1003,8 +1010,33 @@ function npm({ client: defaultClient, onBreakPeerDep = "set", updateLockFile = t
1003
1010
  await Promise.all(writes);
1004
1011
  },
1005
1012
  async applyCliDraft() {
1006
- if (!active || !updateLockFile) return;
1007
- const result = await x(client, ["install"], { nodeOptions: { cwd: this.cwd } });
1013
+ if (!this.npm || !active || !updateLockFile) return;
1014
+ let args;
1015
+ switch (this.npm.agent) {
1016
+ case "pnpm":
1017
+ case "pnpm@6":
1018
+ args = [
1019
+ "install",
1020
+ "--lockfile-only",
1021
+ "--no-frozen-lockfile"
1022
+ ];
1023
+ break;
1024
+ case "npm":
1025
+ args = ["install", "--package-lock-only"];
1026
+ break;
1027
+ case "bun":
1028
+ args = ["install", "--lockfile-only"];
1029
+ break;
1030
+ case "yarn@berry":
1031
+ args = [
1032
+ "install",
1033
+ "--mode=update-lockfile",
1034
+ "--no-immutable"
1035
+ ];
1036
+ break;
1037
+ default: args = ["install"];
1038
+ }
1039
+ const result = await x(this.npm.client, args, { nodeOptions: { cwd: this.cwd } });
1008
1040
  if (result.exitCode !== 0) throw execFailure("Failed to update lockfile.", result);
1009
1041
  },
1010
1042
  initCli(cli) {
@@ -1,2 +1,2 @@
1
- import { D as cargo, E as CargoPluginOptions, T as CargoPackage, w as CargoGraph } from "../types-BbwOrNZ2.js";
1
+ import { D as cargo, E as CargoPluginOptions, T as CargoPackage, w as CargoGraph } from "../types-C_vz41r2.js";
2
2
  export { CargoGraph, CargoPackage, CargoPluginOptions, cargo };
@@ -1,4 +1,4 @@
1
- import { s as TegamiPlugin } from "../types-BbwOrNZ2.js";
1
+ import { s as TegamiPlugin } from "../types-C_vz41r2.js";
2
2
 
3
3
  //#region src/plugins/git.d.ts
4
4
  interface GitPluginOptions {
@@ -1,6 +1,6 @@
1
- import { A as WorkspacePackage, b as TegamiContext, s as TegamiPlugin, t as Awaitable, v as PublishPlan } from "../types-BbwOrNZ2.js";
1
+ import { A as WorkspacePackage, b as TegamiContext, s as TegamiPlugin, t as Awaitable, v as PublishPlan } from "../types-C_vz41r2.js";
2
2
  import { GitPluginOptions } from "./git.js";
3
- import { t as VersionRequestOptions } from "../version-request-BQwP7EWa.js";
3
+ import { t as VersionRequestOptions } from "../version-request-DXk_B7O_.js";
4
4
 
5
5
  //#region src/plugins/github.d.ts
6
6
  interface GithubRelease {
@@ -1,6 +1,6 @@
1
- import { A as WorkspacePackage, b as TegamiContext, s as TegamiPlugin, t as Awaitable, v as PublishPlan } from "../types-BbwOrNZ2.js";
1
+ import { A as WorkspacePackage, b as TegamiContext, s as TegamiPlugin, t as Awaitable, v as PublishPlan } from "../types-C_vz41r2.js";
2
2
  import { GitPluginOptions } from "./git.js";
3
- import { t as VersionRequestOptions } from "../version-request-BQwP7EWa.js";
3
+ import { t as VersionRequestOptions } from "../version-request-DXk_B7O_.js";
4
4
 
5
5
  //#region src/plugins/gitlab.d.ts
6
6
  interface GitlabRelease {
@@ -1,4 +1,4 @@
1
- import { A as WorkspacePackage, P as BumpType, s as TegamiPlugin } from "../types-BbwOrNZ2.js";
1
+ import { A as WorkspacePackage, P as BumpType, s as TegamiPlugin } from "../types-C_vz41r2.js";
2
2
 
3
3
  //#region src/plugins/go.d.ts
4
4
  interface GoModFile {
@@ -1,2 +1,2 @@
1
- import { C as NpmPackage, S as NpmGraph, l as NpmPluginOptions, u as npm, x as DependencySpec } from "../types-BbwOrNZ2.js";
1
+ import { C as NpmPackage, S as NpmGraph, l as NpmPluginOptions, u as npm, x as DependencySpec } from "../types-C_vz41r2.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-4iA03RvC.js";
1
+ import { n as NpmPackage, t as npm } from "../npm-cS-D2xGI.js";
2
2
  export { NpmPackage, npm };
@@ -1,4 +1,4 @@
1
- import { AgentName } from "package-manager-detector";
1
+ import { Agent, AgentName } from "package-manager-detector";
2
2
 
3
3
  //#region src/utils/semver.d.ts
4
4
  type BumpType = "major" | "minor" | "patch";
@@ -523,6 +523,7 @@ interface TegamiContext {
523
523
  };
524
524
  /** additional context when npm plugin is configured */
525
525
  npm?: {
526
+ agent: Agent;
526
527
  client: AgentName; /** available after resolve */
527
528
  graph?: NpmGraph;
528
529
  };
@@ -1,4 +1,4 @@
1
- import { b as TegamiContext, j as Draft, m as PublishLock, t as Awaitable, v as PublishPlan } from "./types-BbwOrNZ2.js";
1
+ import { b as TegamiContext, j as Draft, m as PublishLock, t as Awaitable, v as PublishPlan } from "./types-C_vz41r2.js";
2
2
 
3
3
  //#region src/utils/version-request.d.ts
4
4
  interface VersionRequestOptions {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tegami",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "A tool to manage changelogs, versioning, and publishing in monorepo",
5
5
  "license": "MIT",
6
6
  "author": "Fuma Nama",