Skip to content

Commit

Permalink
Remove outdent dependency (changesets#1462)
Browse files Browse the repository at this point in the history
* chore: remove outdent dependency

* avoid prettier-ignore comments

* Update .changeset/tiny-tomatoes-allow.md

---------

Co-authored-by: Mateusz Burzyński <[email protected]>
  • Loading branch information
benmccann and Andarist authored Sep 17, 2024
1 parent 4f172a2 commit 689e541
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .changeset/tiny-tomatoes-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@changesets/cli": patch
---

remove `outdent` dependency
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
"external-editor": "^3.1.0",
"fs-extra": "^7.0.1",
"mri": "^1.2.0",
"outdent": "^0.5.0",
"p-limit": "^2.2.0",
"package-manager-detector": "^0.2.0",
"picocolors": "^1.1.0",
Expand All @@ -101,6 +100,7 @@
"@changesets/test-utils": "*",
"@types/semver": "^7.5.0",
"human-id": "^4.1.1",
"outdent": "^0.5.0",
"strip-ansi": "^5.2.0"
}
}
11 changes: 4 additions & 7 deletions packages/cli/src/commands/add/messages.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import outdent from "outdent";
import pc from "picocolors";
import { log } from "@changesets/logger";
import { Release, VersionType } from "@changesets/types";
Expand Down Expand Up @@ -30,12 +29,10 @@ export default function printConfirmationMessage(
log("");

if (repoHasMultiplePackages) {
const message = outdent`
Note: All dependents of these packages that will be incompatible with
the new version will be ${pc.redBright(
"patch bumped"
)} when this changeset is applied.
`;
const message =
"Note: All dependents of these packages that will be incompatible with the new version will be " +
pc.redBright("patch bumped") +
" when this changeset is applied.";

log(message + "\n");
}
Expand Down
16 changes: 6 additions & 10 deletions packages/cli/src/commit/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Changeset, CommitFunctions, ReleasePlan } from "@changesets/types";
import outdent from "outdent";

type SkipCI = boolean | "add" | "version";

Expand All @@ -8,9 +7,8 @@ const getAddMessage: CommitFunctions["getAddMessage"] = async (
options: { skipCI?: SkipCI } | null
) => {
const skipCI = options?.skipCI === "add" || options?.skipCI === true;
return outdent`docs(changeset): ${changeset.summary}${
skipCI ? `\n\n[skip ci]\n` : ""
}`;
const skipMsg = skipCI ? `\n\n[skip ci]\n` : "";
return `docs(changeset): ${changeset.summary}${skipMsg}`;
};

const getVersionMessage: CommitFunctions["getVersionMessage"] = async (
Expand All @@ -27,13 +25,11 @@ const getVersionMessage: CommitFunctions["getVersionMessage"] = async (
.map((release) => ` ${release.name}@${release.newVersion}`)
.join("\n");

return outdent`
RELEASING: Releasing ${numPackagesReleased} package(s)
return `RELEASING: Releasing ${numPackagesReleased} package(s)
Releases:
${releasesLines}
${skipCI ? `\n[skip ci]\n` : ""}
`;
Releases:
${releasesLines}
${skipCI ? `\n[skip ci]\n` : ""}`;
};

const defaultCommitFunctions: Required<CommitFunctions> = {
Expand Down

0 comments on commit 689e541

Please sign in to comment.