Skip to content

Commit 4bbfbca

Browse files
fix: detect legacy 'based on' notices in README.md (#2125)
## PR Checklist - [x] Addresses an existing open issue: fixes #2124 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md) were taken ## Overview 🎁
1 parent 5a03263 commit 4bbfbca

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/options/readReadmeAdditional.test.ts

+19-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,25 @@ After.
7272
expect(result).toBe("After.");
7373
});
7474

75-
it("returns all content after contributors when there is a quote template notice", async () => {
75+
it("returns all content after contributors when there is a legacy quote template notice", async () => {
76+
const getReadme = () =>
77+
Promise.resolve(`# My Package
78+
79+
Usage.
80+
81+
<!-- spellchecker:enable -->
82+
83+
After.
84+
85+
> 💙 This package is based on ...
86+
`);
87+
88+
const result = await readReadmeAdditional(getReadme);
89+
90+
expect(result).toBe("After.");
91+
});
92+
93+
it("returns all content after contributors when there is a current quote template notice", async () => {
7694
const getReadme = () =>
7795
Promise.resolve(`# My Package
7896

src/options/readReadmeAdditional.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const indicatorAfterAllContributorsSpellCheck =
33
/<!--\s*spellchecker:\s*enable\s*-->/;
44

55
const indicatorBeforeTemplatedBy =
6-
/> .* This package was templated with |<!-- You can remove this notice/;
6+
/> .* This package (?:is|was) (?:based|build|templated) (?:on|with) |<!-- You can remove this notice/;
77

88
export async function readReadmeAdditional(getReadme: () => Promise<string>) {
99
const readme = await getReadme();

0 commit comments

Comments
 (0)