Skip to content

Commit cf2d383

Browse files
authoredMar 25, 2025··
feat: hide 'no worries' notice when I am the owner (#2015)
## PR Checklist - [x] Addresses an existing open issue: fixes #2014 - [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 96f714f commit cf2d383

File tree

2 files changed

+41
-9
lines changed

2 files changed

+41
-9
lines changed
 

‎src/blocks/blockTemplatedWith.test.ts

+35-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ vi.mock("../utils/resolveBin.js", () => ({
99
}));
1010

1111
describe("blockTemplatedWith", () => {
12-
test("without addons", () => {
12+
test("production with unknown owner", () => {
1313
const creation = testBlock(blockTemplatedWith, {
1414
options: optionsBase,
1515
});
@@ -29,9 +29,41 @@ describe("blockTemplatedWith", () => {
2929
"addons": {
3030
"notices": [
3131
"
32-
<!-- You can remove this notice if you don't want it 🙂 no worries! -->
32+
<!-- You can remove this notice if you don't want it 🙂 no worries! -->",
33+
"> 💝 This package was templated with [\`create-typescript-app\`](https://github.com/JoshuaKGoldberg/create-typescript-app) using the [Bingo engine](https://create.bingo).
34+
",
35+
],
36+
},
37+
"block": [Function],
38+
},
39+
],
40+
}
41+
`);
42+
});
43+
44+
test("production with JoshuaKGoldberg as owner", () => {
45+
const creation = testBlock(blockTemplatedWith, {
46+
options: {
47+
...optionsBase,
48+
owner: "JoshuaKGoldberg",
49+
},
50+
});
3351

34-
> 💝 This package was templated with [\`create-typescript-app\`](https://github.com/JoshuaKGoldberg/create-typescript-app) using the [Bingo engine](https://create.bingo).
52+
expect(creation).toMatchInlineSnapshot(`
53+
{
54+
"addons": [
55+
{
56+
"addons": {
57+
"words": [
58+
"joshuakgoldberg",
59+
],
60+
},
61+
"block": [Function],
62+
},
63+
{
64+
"addons": {
65+
"notices": [
66+
"> 💝 This package was templated with [\`create-typescript-app\`](https://github.com/JoshuaKGoldberg/create-typescript-app) using the [Bingo engine](https://create.bingo).
3567
",
3668
],
3769
},

‎src/blocks/blockTemplatedWith.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ export const blockTemplatedWith = base.createBlock({
66
about: {
77
name: "Templated With",
88
},
9-
produce() {
9+
produce({ options }) {
1010
return {
1111
addons: [
1212
blockCSpell({
1313
words: ["joshuakgoldberg"],
1414
}),
1515
blockREADME({
1616
notices: [
17-
`
18-
<!-- You can remove this notice if you don't want it 🙂 no worries! -->
19-
20-
> 💝 This package was templated with [\`create-typescript-app\`](https://github.com/JoshuaKGoldberg/create-typescript-app) using the [Bingo engine](https://create.bingo).
17+
options.owner !== "JoshuaKGoldberg" &&
18+
`
19+
<!-- You can remove this notice if you don't want it 🙂 no worries! -->`,
20+
`> 💝 This package was templated with [\`create-typescript-app\`](https://github.com/JoshuaKGoldberg/create-typescript-app) using the [Bingo engine](https://create.bingo).
2121
`,
22-
],
22+
].filter((notice) => typeof notice === "string"),
2323
}),
2424
],
2525
};

0 commit comments

Comments
 (0)
Please sign in to comment.