Skip to content

Commit 4f718b5

Browse files
authored
Removed compatibility support for old Changesets v1 (#657)
1 parent 1bf7c27 commit 4f718b5

2 files changed

Lines changed: 6 additions & 24 deletions

File tree

.changeset/eighty-doors-swim.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@changesets/action": major
3+
---
4+
5+
Removed compatibility support for old Changesets v1.

src/run.ts

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { exec, getExecOutput } from "@actions/exec";
66
import * as github from "@actions/github";
77
import type { PreState } from "@changesets/types";
88
import { type Package, getPackages } from "@manypkg/get-packages";
9-
import semverLt from "semver/functions/lt.js";
109
import { Git } from "./git.ts";
1110
import type { Octokit } from "./octokit.ts";
1211
import readChangesetState from "./readChangesetState.ts";
@@ -165,24 +164,6 @@ export async function runPublish({
165164
return { published: false, exitCode: changesetPublishOutput.exitCode };
166165
}
167166

168-
const requireChangesetsCliPkgJson = (cwd: string) => {
169-
try {
170-
return require(
171-
require.resolve("@changesets/cli/package.json", {
172-
paths: [cwd],
173-
}),
174-
);
175-
} catch (err) {
176-
if (isErrorWithCode(err, "MODULE_NOT_FOUND")) {
177-
throw new Error(
178-
`Have you forgotten to install \`@changesets/cli\` in "${cwd}"?`,
179-
{ cause: err },
180-
);
181-
}
182-
throw err;
183-
}
184-
};
185-
186167
type GetMessageOptions = {
187168
hasPublishScript: boolean;
188169
branch: string;
@@ -296,17 +277,13 @@ export async function runVersion({
296277
if (script) {
297278
await exec(script, undefined, { cwd, env });
298279
} else {
299-
let changesetsCliPkgJson = requireChangesetsCliPkgJson(cwd);
300-
let cmd = semverLt(changesetsCliPkgJson.version, "2.0.0")
301-
? "bump"
302-
: "version";
303280
await exec(
304281
"node",
305282
[
306283
require.resolve("@changesets/cli/bin.js", {
307284
paths: [cwd],
308285
}),
309-
cmd,
286+
"version",
310287
],
311288
{
312289
cwd,

0 commit comments

Comments
 (0)