create-typescript-app 1.51.2 โ 1.52.1
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 +6 -8
- package/lib/steps/writeReadme/findExistingBadges.js +2 -5
- package/lib/steps/writeReadme/findExistingBadges.js.map +1 -1
- package/lib/steps/writeReadme/generateTopContent.js +19 -30
- package/lib/steps/writeReadme/generateTopContent.js.map +1 -1
- package/lib/steps/writing/creation/writeAllContributorsRC.js +1 -1
- package/lib/steps/writing/creation/writeAllContributorsRC.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,16 +5,14 @@
|
|
|
5
5
|
<p align="center">
|
|
6
6
|
<!-- prettier-ignore-start -->
|
|
7
7
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
8
|
-
|
|
8
|
+
<a href="#contributors" target="_blank"><img alt="๐ช All Contributors: 40" src="https://img.shields.io/badge/%F0%9F%91%AA_all_contributors-40-21bb42.svg" /></a>
|
|
9
9
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
10
10
|
<!-- prettier-ignore-end -->
|
|
11
|
-
<a href="https://
|
|
12
|
-
<a href="https://
|
|
13
|
-
<a href="https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/LICENSE.md" target="_blank"><img alt="License: MIT
|
|
14
|
-
<a href="
|
|
15
|
-
<img alt="
|
|
16
|
-
<img alt="TypeScript: Strict ๐ช" src="https://img.shields.io/badge/typescript-strict_๐ช-21bb42.svg" />
|
|
17
|
-
<img alt="npm package version" src="https://img.shields.io/npm/v/create-typescript-app?color=21bb42" />
|
|
11
|
+
<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>
|
|
12
|
+
<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>
|
|
13
|
+
<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>
|
|
14
|
+
<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>
|
|
15
|
+
<img alt="๐ช TypeScript: Strict" src="https://img.shields.io/badge/%F0%9F%92%AA_typescript-strict-21bb42.svg" />
|
|
18
16
|
</p>
|
|
19
17
|
|
|
20
18
|
<img align="right" alt="Project logo: the TypeScript blue square with rounded corners, but a plus sign instead of 'TS'" src="./create-typescript-app.png">
|
|
@@ -8,18 +8,15 @@ function findExistingBadges(contents) {
|
|
|
8
8
|
const badges = [];
|
|
9
9
|
let remaining = contents.split(/<\s*h2.*>|##/)[0];
|
|
10
10
|
for (const createMatcher of existingBadgeMatcherCreators) {
|
|
11
|
-
const matcher = createMatcher();
|
|
12
11
|
while (true) {
|
|
12
|
+
const matcher = createMatcher();
|
|
13
13
|
const matched = matcher.exec(remaining);
|
|
14
14
|
if (!matched) {
|
|
15
15
|
break;
|
|
16
16
|
}
|
|
17
17
|
const [badge] = matched;
|
|
18
18
|
badges.push(badge.trim());
|
|
19
|
-
remaining =
|
|
20
|
-
remaining.slice(0, matched.index),
|
|
21
|
-
remaining.slice(matched.index + badge.length)
|
|
22
|
-
].join("");
|
|
19
|
+
remaining = remaining.replace(badge, "");
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
22
|
return badges;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/steps/writeReadme/findExistingBadges.ts"],"sourcesContent":["export const existingBadgeMatcherCreators = [\n\t() => /\\[!\\[.+\\]\\(.+\\)\\]\\(.+\\)/g,\n\t() => /!\\[.+\\]\\(.+\\)/g,\n\t() => /^\\s*<a[ \\tA-Za-z_\\-=#&;?./:'\"]*>[\\s\\S]+?<\\/a>/gm,\n\t() => /<img.+src.+\\/>/g,\n];\n\nexport function findExistingBadges(contents: string): string[] {\n\tconst badges: string[] = [];\n\tlet remaining = contents.split(/<\\s*h2.*>|##/)[0];\n\n\tfor (const createMatcher of existingBadgeMatcherCreators) {\n\t\
|
|
1
|
+
{"version":3,"sources":["../../../src/steps/writeReadme/findExistingBadges.ts"],"sourcesContent":["export const existingBadgeMatcherCreators = [\n\t() => /\\[!\\[.+\\]\\(.+\\)\\]\\(.+\\)/g,\n\t() => /!\\[.+\\]\\(.+\\)/g,\n\t() => /^\\s*<a[ \\tA-Za-z_\\-=#&;?./:'\"]*>[\\s\\S]+?<\\/a>/gm,\n\t() => /<img.+src.+\\/>/g,\n];\n\nexport function findExistingBadges(contents: string): string[] {\n\tconst badges: string[] = [];\n\tlet remaining = contents.split(/<\\s*h2.*>|##/)[0];\n\n\tfor (const createMatcher of existingBadgeMatcherCreators) {\n\t\twhile (true) {\n\t\t\tconst matcher = createMatcher();\n\t\t\tconst matched = matcher.exec(remaining);\n\n\t\t\tif (!matched) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst [badge] = matched;\n\n\t\t\tbadges.push(badge.trim());\n\n\t\t\tremaining = remaining.replace(badge, \"\");\n\t\t}\n\t}\n\n\treturn badges;\n}\n"],"mappings":"AAAO,MAAM,+BAA+B;AAAA,EAC3C,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACP;AAEO,SAAS,mBAAmB,UAA4B;AAC9D,QAAM,SAAmB,CAAC;AAC1B,MAAI,YAAY,SAAS,MAAM,cAAc,EAAE,CAAC;AAEhD,aAAW,iBAAiB,8BAA8B;AACzD,WAAO,MAAM;AACZ,YAAM,UAAU,cAAc;AAC9B,YAAM,UAAU,QAAQ,KAAK,SAAS;AAEtC,UAAI,CAAC,SAAS;AACb;AAAA,MACD;AAEA,YAAM,CAAC,KAAK,IAAI;AAEhB,aAAO,KAAK,MAAM,KAAK,CAAC;AAExB,kBAAY,UAAU,QAAQ,OAAO,EAAE;AAAA,IACxC;AAAA,EACD;AAEA,SAAO;AACR;","names":[]}
|
|
@@ -1,56 +1,45 @@
|
|
|
1
1
|
function generateTopContent(options, existingBadges) {
|
|
2
2
|
const remainingExistingBadges = new Set(existingBadges);
|
|
3
3
|
const badges = [];
|
|
4
|
-
function spliceBadge(badgeLine, existingMatcher) {
|
|
5
|
-
const existingMatch = existingBadges.find(
|
|
6
|
-
(existingLine) => existingMatcher.test(existingLine)
|
|
7
|
-
);
|
|
8
|
-
if (existingMatch) {
|
|
9
|
-
remainingExistingBadges.delete(existingMatch);
|
|
10
|
-
}
|
|
11
|
-
if (badgeLine) {
|
|
12
|
-
badges.push(badgeLine);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
4
|
for (const [badgeLine, existingMatcher] of [
|
|
16
5
|
[
|
|
17
6
|
!options.excludeAllContributors && `<!-- prettier-ignore-start -->
|
|
18
7
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
19
|
-
<a href="#contributors" target="_blank"><img alt="All Contributors:
|
|
8
|
+
<a href="#contributors" target="_blank"><img alt="\u{1F46A} All Contributors: 1" src="https://img.shields.io/badge/\u{1F46A}_all_contributors-1-21bb42.svg" /></a>
|
|
20
9
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
21
10
|
<!-- prettier-ignore-end -->`,
|
|
22
|
-
/
|
|
11
|
+
/<a\s+href.*contributors.*All\s+Contributors/
|
|
23
12
|
],
|
|
24
13
|
[
|
|
25
|
-
|
|
26
|
-
/https:\/\/codecov\.io\/gh/
|
|
27
|
-
],
|
|
28
|
-
[
|
|
29
|
-
`<a href="https://github.com/${options.owner}/${options.repository}/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank"><img alt="Contributor Covenant" src="https://img.shields.io/badge/code_of_conduct-enforced-21bb42" /></a>`,
|
|
14
|
+
`<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>`,
|
|
30
15
|
/CODE_OF_CONDUCT\.md/
|
|
31
16
|
],
|
|
32
17
|
[
|
|
33
|
-
`<a href="https://
|
|
34
|
-
/
|
|
18
|
+
!options.excludeTests && `<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>`,
|
|
19
|
+
/https:\/\/codecov\.io\/gh/
|
|
35
20
|
],
|
|
36
21
|
[
|
|
37
|
-
|
|
38
|
-
/
|
|
22
|
+
`<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>`,
|
|
23
|
+
/LICENSE\.(md|txt)/
|
|
39
24
|
],
|
|
40
25
|
[
|
|
41
|
-
`<img alt="
|
|
42
|
-
/
|
|
26
|
+
`<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>`,
|
|
27
|
+
/npm.*v/i
|
|
43
28
|
],
|
|
44
29
|
[
|
|
45
|
-
`<img alt="TypeScript: Strict" src="https://img.shields.io/badge
|
|
30
|
+
`<img alt="\u{1F4AA} TypeScript: Strict" src="https://img.shields.io/badge/%F0%9F%92%AA_typescript-strict-21bb42.svg" />`,
|
|
46
31
|
/typescript.*strict/i
|
|
47
|
-
],
|
|
48
|
-
[
|
|
49
|
-
`<img alt="npm package version" src="https://img.shields.io/npm/v/${options.repository}?color=21bb42" />`,
|
|
50
|
-
/npm.*v/i
|
|
51
32
|
]
|
|
52
33
|
]) {
|
|
53
|
-
|
|
34
|
+
const existingMatch = existingBadges.find(
|
|
35
|
+
(existingLine) => existingMatcher.test(existingLine)
|
|
36
|
+
);
|
|
37
|
+
if (existingMatch) {
|
|
38
|
+
remainingExistingBadges.delete(existingMatch);
|
|
39
|
+
}
|
|
40
|
+
if (badgeLine) {
|
|
41
|
+
badges.push(badgeLine);
|
|
42
|
+
}
|
|
54
43
|
}
|
|
55
44
|
return `<h1 align="center">${options.title}</h1>
|
|
56
45
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/steps/writeReadme/generateTopContent.ts"],"sourcesContent":["import { Options } from \"../../shared/types.js\";\n\nexport function generateTopContent(options: Options, existingBadges: string[]) {\n\tconst remainingExistingBadges = new Set(existingBadges);\n\tconst badges: string[] = [];\n\n\
|
|
1
|
+
{"version":3,"sources":["../../../src/steps/writeReadme/generateTopContent.ts"],"sourcesContent":["import { Options } from \"../../shared/types.js\";\n\nexport function generateTopContent(options: Options, existingBadges: string[]) {\n\tconst remainingExistingBadges = new Set(existingBadges);\n\tconst badges: string[] = [];\n\n\tfor (const [badgeLine, existingMatcher] of [\n\t\t[\n\t\t\t!options.excludeAllContributors &&\n\t\t\t\t`<!-- prettier-ignore-start -->\n\t<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->\n\t<a href=\"#contributors\" target=\"_blank\"><img alt=\"๐ช All Contributors: 1\" src=\"https://img.shields.io/badge/๐ช_all_contributors-1-21bb42.svg\" /></a>\n\t<!-- ALL-CONTRIBUTORS-BADGE:END -->\n\t<!-- prettier-ignore-end -->`,\n\t\t\t/<a\\s+href.*contributors.*All\\s+Contributors/,\n\t\t],\n\t\t[\n\t\t\t`<a href=\"https://github.com/${options.owner}/${options.repository}/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>`,\n\t\t\t/CODE_OF_CONDUCT\\.md/,\n\t\t],\n\t\t[\n\t\t\t!options.excludeTests &&\n\t\t\t\t`<a href=\"https://codecov.io/gh/${options.owner}/${options.repository}\" target=\"_blank\"><img alt=\"๐งช Coverage\" src=\"https://img.shields.io/codecov/c/github/${options.owner}/${options.repository}?label=%F0%9F%A7%AA%20coverage\" /></a>`,\n\t\t\t/https:\\/\\/codecov\\.io\\/gh/,\n\t\t],\n\t\t[\n\t\t\t`<a href=\"https://github.com/${options.owner}/${options.repository}/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>`,\n\t\t\t/LICENSE\\.(md|txt)/,\n\t\t],\n\t\t[\n\t\t\t`<a href=\"http://npmjs.com/package/${options.repository}\"><img alt=\"๐ฆ npm version\" src=\"https://img.shields.io/npm/v/${options.repository}?color=21bb42&label=%F0%9F%93%A6%20npm\" /></a>`,\n\t\t\t/npm.*v/i,\n\t\t],\n\t\t[\n\t\t\t`<img alt=\"๐ช TypeScript: Strict\" src=\"https://img.shields.io/badge/%F0%9F%92%AA_typescript-strict-21bb42.svg\" />`,\n\t\t\t/typescript.*strict/i,\n\t\t],\n\t] as const) {\n\t\tconst existingMatch = existingBadges.find((existingLine) =>\n\t\t\texistingMatcher.test(existingLine),\n\t\t);\n\n\t\tif (existingMatch) {\n\t\t\tremainingExistingBadges.delete(existingMatch);\n\t\t}\n\n\t\tif (badgeLine) {\n\t\t\tbadges.push(badgeLine);\n\t\t}\n\t}\n\n\treturn `<h1 align=\"center\">${options.title}</h1>\n\n<p align=\"center\">${options.description}</p>\n\n<p align=\"center\">\n${[...badges, ...remainingExistingBadges]\n\t.map((badge) => `\\t${badge}`)\n\t.join(\"\\n\")}\n</p>${\n\t\toptions.mode === \"migrate\"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AU,IAAK,KAAK,EAAE,EAC3B,KAAK,IAAI,CAAC;AAAA,MAEV,QAAQ,SAAS,YACd,KACA;AAAA;AAAA;AAAA;AAAA;AAAA,QAKG,QAAQ,UAAU;AAAA;AAAA;AAAA,yBAGD,QAAQ,UAAU;AAAA;AAAA;AAAA,OAI1C;AACD;","names":[]}
|
|
@@ -5,7 +5,7 @@ async function writeAllContributorsRC(options) {
|
|
|
5
5
|
".all-contributorsrc"
|
|
6
6
|
);
|
|
7
7
|
return await formatJson({
|
|
8
|
-
badgeTemplate: ' <a href="#contributors" target="_blank"><img alt="All Contributors: <%= contributors.length %>
|
|
8
|
+
badgeTemplate: ' <a href="#contributors" target="_blank"><img alt="\u{1F46A} All Contributors: <%= contributors.length %>" src="https://img.shields.io/badge/%F0%9F%91%AA_all_contributors-<%= contributors.length %>-21bb42.svg" /></a>',
|
|
9
9
|
commit: false,
|
|
10
10
|
commitConvention: "angular",
|
|
11
11
|
commitType: "docs",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/writing/creation/writeAllContributorsRC.ts"],"sourcesContent":["import { readFileSafeAsJson } from \"../../../shared/readFileSafeAsJson.js\";\nimport { AllContributorsData, Options } from \"../../../shared/types.js\";\nimport { formatJson } from \"./formatters/formatJson.js\";\n\nexport async function writeAllContributorsRC(options: Options) {\n\tconst existing = (await readFileSafeAsJson(\n\t\t\".all-contributorsrc\",\n\t)) as AllContributorsData | null;\n\n\treturn await formatJson({\n\t\tbadgeTemplate:\n\t\t\t'\t<a href=\"#contributors\" target=\"_blank\"><img alt=\"All Contributors: <%= contributors.length
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/writing/creation/writeAllContributorsRC.ts"],"sourcesContent":["import { readFileSafeAsJson } from \"../../../shared/readFileSafeAsJson.js\";\nimport { AllContributorsData, Options } from \"../../../shared/types.js\";\nimport { formatJson } from \"./formatters/formatJson.js\";\n\nexport async function writeAllContributorsRC(options: Options) {\n\tconst existing = (await readFileSafeAsJson(\n\t\t\".all-contributorsrc\",\n\t)) as AllContributorsData | null;\n\n\treturn await formatJson({\n\t\tbadgeTemplate:\n\t\t\t'\t<a href=\"#contributors\" target=\"_blank\"><img alt=\"๐ช All Contributors: <%= contributors.length %>\" src=\"https://img.shields.io/badge/%F0%9F%91%AA_all_contributors-<%= contributors.length %>-21bb42.svg\" /></a>',\n\t\tcommit: false,\n\t\tcommitConvention: \"angular\",\n\t\tcommitType: \"docs\",\n\t\tcontributors: existing?.contributors ?? [],\n\t\tcontributorsPerLine: 7,\n\t\tcontributorsSortAlphabetically: true,\n\t\tfiles: [\"README.md\"],\n\t\timageSize: 100,\n\t\tprojectName: options.repository,\n\t\tprojectOwner: options.owner,\n\t\trepoHost: \"https://github.com\",\n\t\trepoType: \"github\",\n\t});\n}\n"],"mappings":"AAAA,SAAS,0BAA0B;AAEnC,SAAS,kBAAkB;AAE3B,eAAsB,uBAAuB,SAAkB;AAC9D,QAAM,WAAY,MAAM;AAAA,IACvB;AAAA,EACD;AAEA,SAAO,MAAM,WAAW;AAAA,IACvB,eACC;AAAA,IACD,QAAQ;AAAA,IACR,kBAAkB;AAAA,IAClB,YAAY;AAAA,IACZ,cAAc,UAAU,gBAAgB,CAAC;AAAA,IACzC,qBAAqB;AAAA,IACrB,gCAAgC;AAAA,IAChC,OAAO,CAAC,WAAW;AAAA,IACnB,WAAW;AAAA,IACX,aAAa,QAAQ;AAAA,IACrB,cAAc,QAAQ;AAAA,IACtB,UAAU;AAAA,IACV,UAAU;AAAA,EACX,CAAC;AACF;","names":[]}
|