create-typescript-app 2.15.1 โ 2.15.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.
- package/README.md +2 -2
- package/lib/blocks/blockAllContributors.js +12 -4
- package/lib/blocks/blockCodecov.js +10 -0
- package/lib/blocks/blockContributorCovenant.js +12 -0
- package/lib/blocks/blockMITLicense.js +11 -1
- package/lib/blocks/blockREADME.d.ts +9 -1
- package/lib/blocks/blockREADME.js +36 -11
- package/lib/blocks/blockReleaseIt.js +10 -0
- package/lib/blocks/index.d.ts +9 -1
- package/lib/data/packageData.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
<!-- prettier-ignore-end -->
|
|
14
14
|
<a href="https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank"><img alt="๐ค Code of Conduct: Kept" src="https://img.shields.io/badge/%F0%9F%A4%9D_code_of_conduct-kept-21bb42" /></a>
|
|
15
15
|
<a href="https://codecov.io/gh/JoshuaKGoldberg/create-typescript-app" target="_blank"><img alt="๐งช Coverage" src="https://img.shields.io/codecov/c/github/JoshuaKGoldberg/create-typescript-app?label=%F0%9F%A7%AA%20coverage" /></a>
|
|
16
|
-
<a href="https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/LICENSE.md" target="_blank"><img alt="๐ License: MIT" src="https://img.shields.io/badge/%F0%9F%93%9D_license-MIT-21bb42.svg"
|
|
17
|
-
<a href="http://npmjs.com/package/create-typescript-app"><img alt="๐ฆ npm version" src="https://img.shields.io/npm/v/create-typescript-app?color=21bb42&label=%F0%9F%93%A6%20npm" /></a>
|
|
16
|
+
<a href="https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/LICENSE.md" target="_blank"><img alt="๐ License: MIT" src="https://img.shields.io/badge/%F0%9F%93%9D_license-MIT-21bb42.svg" /></a>
|
|
17
|
+
<a href="http://npmjs.com/package/create-typescript-app" target="_blank"><img alt="๐ฆ npm version" src="https://img.shields.io/npm/v/create-typescript-app?color=21bb42&label=%F0%9F%93%A6%20npm" /></a>
|
|
18
18
|
<img alt="๐ช TypeScript: Strict" src="https://img.shields.io/badge/%F0%9F%92%AA_typescript-strict-21bb42.svg" />
|
|
19
19
|
</p>
|
|
20
20
|
|
|
@@ -20,11 +20,19 @@ const blockAllContributors = base.createBlock({
|
|
|
20
20
|
}),
|
|
21
21
|
blockREADME({
|
|
22
22
|
badges: [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
{
|
|
24
|
+
alt: `\u{1F46A} All Contributors: ${contributions}`,
|
|
25
|
+
comments: {
|
|
26
|
+
after: `
|
|
26
27
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
27
|
-
<!-- prettier-ignore-end
|
|
28
|
+
<!-- prettier-ignore-end -->`,
|
|
29
|
+
before: `<!-- prettier-ignore-start -->
|
|
30
|
+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
31
|
+
`
|
|
32
|
+
},
|
|
33
|
+
href: "#contributors",
|
|
34
|
+
src: `https://img.shields.io/badge/%F0%9F%91%AA_all_contributors-${contributions}-21bb42.svg`
|
|
35
|
+
}
|
|
28
36
|
],
|
|
29
37
|
sections: options.contributors ? [printAllContributorsTable(options.contributors)] : void 0
|
|
30
38
|
}),
|
|
@@ -2,6 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { base } from "../base.js";
|
|
3
3
|
import { resolveUses } from "./actions/resolveUses.js";
|
|
4
4
|
import { blockGitHubApps } from "./blockGitHubApps.js";
|
|
5
|
+
import { blockREADME } from "./blockREADME.js";
|
|
5
6
|
import { blockRemoveFiles } from "./blockRemoveFiles.js";
|
|
6
7
|
import { blockVitest } from "./blockVitest.js";
|
|
7
8
|
const blockCodecov = base.createBlock({
|
|
@@ -21,6 +22,15 @@ const blockCodecov = base.createBlock({
|
|
|
21
22
|
}
|
|
22
23
|
]
|
|
23
24
|
}),
|
|
25
|
+
blockREADME({
|
|
26
|
+
badges: [
|
|
27
|
+
{
|
|
28
|
+
alt: "\u{1F9EA} Coverage",
|
|
29
|
+
href: `https://codecov.io/gh/${options.owner}/${options.repository}`,
|
|
30
|
+
src: `https://img.shields.io/codecov/c/github/${options.owner}/${options.repository}?label=%F0%9F%A7%AA%20coverage`
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}),
|
|
24
34
|
blockVitest({
|
|
25
35
|
actionSteps: [
|
|
26
36
|
{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { base } from "../base.js";
|
|
2
|
+
import { blockREADME } from "./blockREADME.js";
|
|
2
3
|
import { blockRemoveFiles } from "./blockRemoveFiles.js";
|
|
3
4
|
const blockContributorCovenant = base.createBlock({
|
|
4
5
|
about: {
|
|
@@ -6,6 +7,17 @@ const blockContributorCovenant = base.createBlock({
|
|
|
6
7
|
},
|
|
7
8
|
produce({ options }) {
|
|
8
9
|
return {
|
|
10
|
+
addons: [
|
|
11
|
+
blockREADME({
|
|
12
|
+
badges: [
|
|
13
|
+
{
|
|
14
|
+
alt: "\u{1F91D} Code of Conduct: Kept",
|
|
15
|
+
href: `https://github.com/${options.owner}/${options.repository}/blob/main/.github/CODE_OF_CONDUCT.md`,
|
|
16
|
+
src: "https://img.shields.io/badge/%F0%9F%A4%9D_code_of_conduct-kept-21bb42"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
})
|
|
20
|
+
],
|
|
9
21
|
files: {
|
|
10
22
|
".github": {
|
|
11
23
|
"CODE_OF_CONDUCT.md": `# Contributor Covenant Code of Conduct
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { base } from "../base.js";
|
|
2
2
|
import { blockPackageJson } from "./blockPackageJson.js";
|
|
3
|
+
import { blockREADME } from "./blockREADME.js";
|
|
3
4
|
const blockMITLicense = base.createBlock({
|
|
4
5
|
about: {
|
|
5
6
|
name: "MIT License"
|
|
6
7
|
},
|
|
7
|
-
produce() {
|
|
8
|
+
produce({ options }) {
|
|
8
9
|
return {
|
|
9
10
|
addons: [
|
|
11
|
+
blockREADME({
|
|
12
|
+
badges: [
|
|
13
|
+
{
|
|
14
|
+
alt: "\u{1F4DD} License: MIT",
|
|
15
|
+
href: `https://github.com/${options.owner}/${options.repository}/blob/main/LICENSE.md`,
|
|
16
|
+
src: "https://img.shields.io/badge/%F0%9F%93%9D_license-MIT-21bb42.svg"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}),
|
|
10
20
|
blockPackageJson({
|
|
11
21
|
properties: {
|
|
12
22
|
files: ["LICENSE.md"],
|
|
@@ -2,7 +2,15 @@ import * as bingo_stratum from 'bingo-stratum';
|
|
|
2
2
|
|
|
3
3
|
declare const blockREADME: bingo_stratum.BlockWithAddons<{
|
|
4
4
|
sections: string[];
|
|
5
|
-
badges:
|
|
5
|
+
badges: {
|
|
6
|
+
alt: string;
|
|
7
|
+
src: string;
|
|
8
|
+
href?: string | undefined;
|
|
9
|
+
comments?: {
|
|
10
|
+
before: string;
|
|
11
|
+
after: string;
|
|
12
|
+
} | undefined;
|
|
13
|
+
}[];
|
|
6
14
|
notices: string[];
|
|
7
15
|
}, {
|
|
8
16
|
access: "public" | "restricted";
|
|
@@ -3,22 +3,31 @@ import { base } from "../base.js";
|
|
|
3
3
|
function printAttributes(attributes) {
|
|
4
4
|
return Object.entries(attributes).map(([key, value]) => `${key}="${value}"`).sort().join(" ");
|
|
5
5
|
}
|
|
6
|
+
const zBadge = z.object({
|
|
7
|
+
alt: z.string(),
|
|
8
|
+
comments: z.object({
|
|
9
|
+
after: z.string(),
|
|
10
|
+
before: z.string()
|
|
11
|
+
}).optional(),
|
|
12
|
+
href: z.string().optional(),
|
|
13
|
+
src: z.string()
|
|
14
|
+
});
|
|
6
15
|
const blockREADME = base.createBlock({
|
|
7
16
|
about: {
|
|
8
17
|
name: "README.md"
|
|
9
18
|
},
|
|
10
19
|
addons: {
|
|
11
|
-
badges: z.array(
|
|
20
|
+
badges: z.array(zBadge).default([]),
|
|
12
21
|
notices: z.array(z.string()).default([]),
|
|
13
22
|
sections: z.array(z.string()).default([])
|
|
14
23
|
},
|
|
15
24
|
produce({ addons, options }) {
|
|
16
25
|
const { badges, notices, sections } = addons;
|
|
17
|
-
const logo = options.logo && `
|
|
18
|
-
<img ${printAttributes({ align: "right", ...options.logo })}>
|
|
19
|
-
`;
|
|
20
26
|
const explainer = options.explainer && `
|
|
21
27
|
${options.explainer.join("\n")}
|
|
28
|
+
`;
|
|
29
|
+
const logo = options.logo && `
|
|
30
|
+
<img ${printAttributes({ align: "right", ...options.logo })}>
|
|
22
31
|
`;
|
|
23
32
|
return {
|
|
24
33
|
files: {
|
|
@@ -26,13 +35,8 @@ ${options.explainer.join("\n")}
|
|
|
26
35
|
|
|
27
36
|
<p align="center">${formatDescription(options.description)}</p>
|
|
28
37
|
|
|
29
|
-
<p align="center"
|
|
30
|
-
|
|
31
|
-
<a href="https://github.com/${options.owner}/${options.repository}/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank"><img alt="\u{1F91D} Code of Conduct: Kept" src="https://img.shields.io/badge/%F0%9F%A4%9D_code_of_conduct-kept-21bb42" /></a>
|
|
32
|
-
<a href="https://codecov.io/gh/${options.owner}/${options.repository}" target="_blank"><img alt="\u{1F9EA} Coverage" src="https://img.shields.io/codecov/c/github/${options.owner}/${options.repository}?label=%F0%9F%A7%AA%20coverage" /></a>
|
|
33
|
-
<a href="https://github.com/${options.owner}/${options.repository}/blob/main/LICENSE.md" target="_blank"><img alt="\u{1F4DD} License: MIT" src="https://img.shields.io/badge/%F0%9F%93%9D_license-MIT-21bb42.svg"></a>
|
|
34
|
-
<a href="http://npmjs.com/package/${options.repository}"><img alt="\u{1F4E6} npm version" src="https://img.shields.io/npm/v/${options.repository}?color=21bb42&label=%F0%9F%93%A6%20npm" /></a>
|
|
35
|
-
<img alt="\u{1F4AA} TypeScript: Strict" src="https://img.shields.io/badge/%F0%9F%92%AA_typescript-strict-21bb42.svg" />
|
|
38
|
+
<p align="center">
|
|
39
|
+
${formatBadges(badges)}
|
|
36
40
|
</p>
|
|
37
41
|
${[logo, explainer].filter(Boolean).join("")}
|
|
38
42
|
## Usage
|
|
@@ -51,12 +55,33 @@ ${notices.map((notice) => notice.trim()).join("\n\n")}` : ""}`
|
|
|
51
55
|
};
|
|
52
56
|
}
|
|
53
57
|
});
|
|
58
|
+
function badgeSorter(a, b) {
|
|
59
|
+
return removeEmojis(a.alt).localeCompare(removeEmojis(b.alt));
|
|
60
|
+
}
|
|
61
|
+
function formatBadge(badge) {
|
|
62
|
+
const image = `<img alt="${badge.alt}" src="${badge.src}" />`;
|
|
63
|
+
const tagged = badge.href ? `<a href="${badge.href}" target="_blank">${image}</a>` : image;
|
|
64
|
+
const commented = badge.comments ? `${badge.comments.before}${tagged}${badge.comments.after}` : tagged;
|
|
65
|
+
return ` ${commented}`;
|
|
66
|
+
}
|
|
67
|
+
function formatBadges(badges) {
|
|
68
|
+
return [
|
|
69
|
+
...badges,
|
|
70
|
+
{
|
|
71
|
+
alt: "\u{1F4AA} TypeScript: Strict",
|
|
72
|
+
src: "https://img.shields.io/badge/%F0%9F%92%AA_typescript-strict-21bb42.svg"
|
|
73
|
+
}
|
|
74
|
+
].sort(badgeSorter).map(formatBadge).join("\n");
|
|
75
|
+
}
|
|
54
76
|
function formatDescription(description) {
|
|
55
77
|
if (!description.includes(". ")) {
|
|
56
78
|
return description;
|
|
57
79
|
}
|
|
58
80
|
return "\n " + description.replaceAll(". ", ".\n ") + "\n";
|
|
59
81
|
}
|
|
82
|
+
function removeEmojis(text) {
|
|
83
|
+
return text.replaceAll(/\p{Emoji}/gu, "").trim();
|
|
84
|
+
}
|
|
60
85
|
export {
|
|
61
86
|
blockREADME
|
|
62
87
|
};
|
|
@@ -3,6 +3,7 @@ import { getPackageDependencies } from "../data/packageData.js";
|
|
|
3
3
|
import { resolveUses } from "./actions/resolveUses.js";
|
|
4
4
|
import { blockCSpell } from "./blockCSpell.js";
|
|
5
5
|
import { blockPackageJson } from "./blockPackageJson.js";
|
|
6
|
+
import { blockREADME } from "./blockREADME.js";
|
|
6
7
|
import { blockRemoveDependencies } from "./blockRemoveDependencies.js";
|
|
7
8
|
import { blockRepositorySecrets } from "./blockRepositorySecrets.js";
|
|
8
9
|
import { createSoloWorkflowFile } from "./files/createSoloWorkflowFile.js";
|
|
@@ -30,6 +31,15 @@ const blockReleaseIt = base.createBlock({
|
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
}),
|
|
34
|
+
blockREADME({
|
|
35
|
+
badges: [
|
|
36
|
+
{
|
|
37
|
+
alt: "\u{1F4E6} npm version",
|
|
38
|
+
href: `http://npmjs.com/package/${options.repository}`,
|
|
39
|
+
src: `https://img.shields.io/npm/v/${options.repository}?color=21bb42&label=%F0%9F%93%A6%20npm`
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}),
|
|
33
43
|
blockRemoveDependencies({
|
|
34
44
|
dependencies: ["should-semantic-release"]
|
|
35
45
|
}),
|
package/lib/blocks/index.d.ts
CHANGED
|
@@ -2266,7 +2266,15 @@ declare const blocks: {
|
|
|
2266
2266
|
}>;
|
|
2267
2267
|
blockREADME: bingo_stratum.BlockWithAddons<{
|
|
2268
2268
|
sections: string[];
|
|
2269
|
-
badges:
|
|
2269
|
+
badges: {
|
|
2270
|
+
alt: string;
|
|
2271
|
+
src: string;
|
|
2272
|
+
href?: string | undefined;
|
|
2273
|
+
comments?: {
|
|
2274
|
+
before: string;
|
|
2275
|
+
after: string;
|
|
2276
|
+
} | undefined;
|
|
2277
|
+
}[];
|
|
2270
2278
|
notices: string[];
|
|
2271
2279
|
}, {
|
|
2272
2280
|
access: "public" | "restricted";
|