create-typescript-app 1.29.51 → 1.30.0
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 +7 -5
- package/lib/create/createRerunSuggestion.js +8 -1
- package/lib/create/createRerunSuggestion.js.map +1 -1
- package/lib/shared/options/args.d.ts +6 -0
- package/lib/shared/options/args.js +2 -0
- package/lib/shared/options/args.js.map +1 -1
- package/lib/shared/options/getPrefillOrPromptedOption.js +1 -2
- package/lib/shared/options/getPrefillOrPromptedOption.js.map +1 -1
- package/lib/shared/options/{readGitAndNpmDefaults → readOptionDefaults}/index.d.ts +2 -1
- package/lib/shared/options/{readGitAndNpmDefaults → readOptionDefaults}/index.js +2 -2
- package/lib/shared/options/readOptionDefaults/index.js.map +1 -0
- package/lib/shared/options/readOptionDefaults/parsePackageAuthor.js.map +1 -0
- package/lib/shared/options/readOptionDefaults/readDefaultsFromReadme.d.ts +6 -0
- package/lib/shared/options/readOptionDefaults/readDefaultsFromReadme.js +16 -0
- package/lib/shared/options/readOptionDefaults/readDefaultsFromReadme.js.map +1 -0
- package/lib/shared/options/readOptions.js +15 -1
- package/lib/shared/options/readOptions.js.map +1 -1
- package/lib/shared/types.d.ts +6 -1
- package/lib/steps/finalizeDependencies.js +5 -1
- package/lib/steps/finalizeDependencies.js.map +1 -1
- package/lib/steps/writing/creation/rootFiles.js +9 -0
- package/lib/steps/writing/creation/rootFiles.js.map +1 -1
- package/package.json +3 -2
- package/lib/shared/options/readGitAndNpmDefaults/index.js.map +0 -1
- package/lib/shared/options/readGitAndNpmDefaults/parsePackageAuthor.js.map +0 -1
- package/lib/shared/options/readGitAndNpmDefaults/readTitleFromReadme.d.ts +0 -3
- package/lib/shared/options/readGitAndNpmDefaults/readTitleFromReadme.js +0 -8
- package/lib/shared/options/readGitAndNpmDefaults/readTitleFromReadme.js.map +0 -1
- /package/lib/shared/options/{readGitAndNpmDefaults → readOptionDefaults}/parsePackageAuthor.d.ts +0 -0
- /package/lib/shared/options/{readGitAndNpmDefaults → readOptionDefaults}/parsePackageAuthor.js +0 -0
package/README.md
CHANGED
|
@@ -26,11 +26,7 @@
|
|
|
26
26
|
<img alt="TypeScript: Strict 💪" src="https://img.shields.io/badge/typescript-strict_💪-21bb42.svg" />
|
|
27
27
|
</p>
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
It can be configured to set up a _lot_ of tooling out of the box.
|
|
31
|
-
Each of the included tools exists for a good reason and provides real value.
|
|
32
|
-
|
|
33
|
-
If you don't want to use any particular tool, you can always remove it manually.
|
|
29
|
+
<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">
|
|
34
30
|
|
|
35
31
|
## Getting Started
|
|
36
32
|
|
|
@@ -47,6 +43,12 @@ Use the corresponding docs page to get started:
|
|
|
47
43
|
- [Initializing from the template](./docs/Initialization.md): creating a new repository with the [_Use this template_](https://github.com/JoshuaKGoldberg/create-typescript-app/generate) button on GitHub
|
|
48
44
|
- [Migrating an existing repository](./docs/Migration.md): adding this template's tooling on top of an existing repository
|
|
49
45
|
|
|
46
|
+
Note that this template is early stage, opinionated, and not endorsed by the TypeScript team.
|
|
47
|
+
It can be configured to set up a _lot_ of tooling out of the box.
|
|
48
|
+
Each of the included tools exists for a good reason and provides real value.
|
|
49
|
+
|
|
50
|
+
If you don't want to use any particular tool, you can always remove it manually.
|
|
51
|
+
|
|
50
52
|
## Explainer
|
|
51
53
|
|
|
52
54
|
This template is available for anybody who wants to set up a Node application using TypeScript.
|
|
@@ -5,7 +5,14 @@ function getFirstMatchingArg(key) {
|
|
|
5
5
|
);
|
|
6
6
|
}
|
|
7
7
|
function createRerunSuggestion(mode, options) {
|
|
8
|
-
const
|
|
8
|
+
const optionsNormalized = {
|
|
9
|
+
...options,
|
|
10
|
+
...options.logo ? {
|
|
11
|
+
logo: options.logo.src,
|
|
12
|
+
logoAlt: options.logo.alt
|
|
13
|
+
} : { logo: void 0 }
|
|
14
|
+
};
|
|
15
|
+
const args = Object.entries(optionsNormalized).filter(([, value]) => !!value).map(([key, value]) => {
|
|
9
16
|
const valueStringified = `${value}`;
|
|
10
17
|
return `--${getFirstMatchingArg(key)} ${valueStringified.includes(" ") ? `"${value}"` : value}`;
|
|
11
18
|
}).join(" ");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/create/createRerunSuggestion.ts"],"sourcesContent":["import { Mode } from \"../bin/mode.js\";\nimport { allArgOptions } from \"../shared/options/args.js\";\nimport { Options } from \"../shared/types.js\";\n\nfunction getFirstMatchingArg(key: string) {\n\treturn Object.keys(allArgOptions).find(\n\t\t(arg) => arg.replaceAll(\"-\", \"\") === key.toLowerCase(),\n\t);\n}\n\nexport function createRerunSuggestion(\n\tmode: Mode,\n\toptions: Partial<Options>,\n): string {\n\tconst args = Object.entries(
|
|
1
|
+
{"version":3,"sources":["../../src/create/createRerunSuggestion.ts"],"sourcesContent":["import { Mode } from \"../bin/mode.js\";\nimport { allArgOptions } from \"../shared/options/args.js\";\nimport { Options } from \"../shared/types.js\";\n\nfunction getFirstMatchingArg(key: string) {\n\treturn Object.keys(allArgOptions).find(\n\t\t(arg) => arg.replaceAll(\"-\", \"\") === key.toLowerCase(),\n\t);\n}\n\nexport function createRerunSuggestion(\n\tmode: Mode,\n\toptions: Partial<Options>,\n): string {\n\tconst optionsNormalized = {\n\t\t...options,\n\t\t...(options.logo\n\t\t\t? {\n\t\t\t\t\tlogo: options.logo.src,\n\t\t\t\t\tlogoAlt: options.logo.alt,\n\t\t\t }\n\t\t\t: { logo: undefined }),\n\t};\n\n\tconst args = Object.entries(optionsNormalized)\n\t\t.filter(([, value]) => !!value)\n\t\t.map(([key, value]) => {\n\t\t\tconst valueStringified = `${value}`;\n\t\t\treturn `--${getFirstMatchingArg(key)} ${\n\t\t\t\tvalueStringified.includes(\" \") ? `\"${value}\"` : value\n\t\t\t}`;\n\t\t})\n\t\t.join(\" \");\n\n\treturn `npx create-typescript-app --mode ${mode} ${args}`;\n}\n"],"mappings":"AACA,SAAS,qBAAqB;AAG9B,SAAS,oBAAoB,KAAa;AACzC,SAAO,OAAO,KAAK,aAAa,EAAE;AAAA,IACjC,CAAC,QAAQ,IAAI,WAAW,KAAK,EAAE,MAAM,IAAI,YAAY;AAAA,EACtD;AACD;AAEO,SAAS,sBACf,MACA,SACS;AACT,QAAM,oBAAoB;AAAA,IACzB,GAAG;AAAA,IACH,GAAI,QAAQ,OACT;AAAA,MACA,MAAM,QAAQ,KAAK;AAAA,MACnB,SAAS,QAAQ,KAAK;AAAA,IACtB,IACA,EAAE,MAAM,OAAU;AAAA,EACtB;AAEA,QAAM,OAAO,OAAO,QAAQ,iBAAiB,EAC3C,OAAO,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC,KAAK,EAC7B,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AACtB,UAAM,mBAAmB,GAAG,KAAK;AACjC,WAAO,KAAK,oBAAoB,GAAG,CAAC,IACnC,iBAAiB,SAAS,GAAG,IAAI,IAAI,KAAK,MAAM,KACjD;AAAA,EACD,CAAC,EACA,KAAK,GAAG;AAEV,SAAO,oCAAoC,IAAI,IAAI,IAAI;AACxD;","names":[]}
|
|
@@ -56,6 +56,12 @@ declare const allArgOptions: {
|
|
|
56
56
|
readonly funding: {
|
|
57
57
|
readonly type: "string";
|
|
58
58
|
};
|
|
59
|
+
readonly logo: {
|
|
60
|
+
readonly type: "string";
|
|
61
|
+
};
|
|
62
|
+
readonly "logo-alt": {
|
|
63
|
+
readonly type: "string";
|
|
64
|
+
};
|
|
59
65
|
readonly owner: {
|
|
60
66
|
readonly type: "string";
|
|
61
67
|
};
|
|
@@ -18,6 +18,8 @@ const allArgOptions = {
|
|
|
18
18
|
"exclude-renovate": { type: "boolean" },
|
|
19
19
|
"exclude-tests": { type: "boolean" },
|
|
20
20
|
funding: { type: "string" },
|
|
21
|
+
logo: { type: "string" },
|
|
22
|
+
"logo-alt": { type: "string" },
|
|
21
23
|
owner: { type: "string" },
|
|
22
24
|
repository: { type: "string" },
|
|
23
25
|
"skip-github-api": { type: "boolean" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/shared/options/args.ts"],"sourcesContent":["export const allArgOptions = {\n\tauthor: { type: \"string\" },\n\tbase: { type: \"string\" },\n\t\"create-repository\": { type: \"boolean\" },\n\tdescription: { type: \"string\" },\n\temail: { type: \"string\" },\n\t\"exclude-compliance\": { type: \"boolean\" },\n\t\"exclude-contributors\": { type: \"boolean\" },\n\t\"exclude-lint-json\": { type: \"boolean\" },\n\t\"exclude-lint-knip\": { type: \"boolean\" },\n\t\"exclude-lint-md\": { type: \"boolean\" },\n\t\"exclude-lint-package-json\": { type: \"boolean\" },\n\t\"exclude-lint-packages\": { type: \"boolean\" },\n\t\"exclude-lint-perfectionist\": { type: \"boolean\" },\n\t\"exclude-lint-spelling\": { type: \"boolean\" },\n\t\"exclude-lint-yml\": { type: \"boolean\" },\n\t\"exclude-releases\": { type: \"boolean\" },\n\t\"exclude-renovate\": { type: \"boolean\" },\n\t\"exclude-tests\": { type: \"boolean\" },\n\tfunding: { type: \"string\" },\n\towner: { type: \"string\" },\n\trepository: { type: \"string\" },\n\t\"skip-github-api\": { type: \"boolean\" },\n\t\"skip-install\": { type: \"boolean\" },\n\t\"skip-removal\": { type: \"boolean\" },\n\t\"skip-restore\": { type: \"boolean\" },\n\t\"skip-uninstall\": { type: \"boolean\" },\n\ttitle: { type: \"string\" },\n} as const;\n"],"mappings":"AAAO,MAAM,gBAAgB;AAAA,EAC5B,QAAQ,EAAE,MAAM,SAAS;AAAA,EACzB,MAAM,EAAE,MAAM,SAAS;AAAA,EACvB,qBAAqB,EAAE,MAAM,UAAU;AAAA,EACvC,aAAa,EAAE,MAAM,SAAS;AAAA,EAC9B,OAAO,EAAE,MAAM,SAAS;AAAA,EACxB,sBAAsB,EAAE,MAAM,UAAU;AAAA,EACxC,wBAAwB,EAAE,MAAM,UAAU;AAAA,EAC1C,qBAAqB,EAAE,MAAM,UAAU;AAAA,EACvC,qBAAqB,EAAE,MAAM,UAAU;AAAA,EACvC,mBAAmB,EAAE,MAAM,UAAU;AAAA,EACrC,6BAA6B,EAAE,MAAM,UAAU;AAAA,EAC/C,yBAAyB,EAAE,MAAM,UAAU;AAAA,EAC3C,8BAA8B,EAAE,MAAM,UAAU;AAAA,EAChD,yBAAyB,EAAE,MAAM,UAAU;AAAA,EAC3C,oBAAoB,EAAE,MAAM,UAAU;AAAA,EACtC,oBAAoB,EAAE,MAAM,UAAU;AAAA,EACtC,oBAAoB,EAAE,MAAM,UAAU;AAAA,EACtC,iBAAiB,EAAE,MAAM,UAAU;AAAA,EACnC,SAAS,EAAE,MAAM,SAAS;AAAA,EAC1B,OAAO,EAAE,MAAM,SAAS;AAAA,EACxB,YAAY,EAAE,MAAM,SAAS;AAAA,EAC7B,mBAAmB,EAAE,MAAM,UAAU;AAAA,EACrC,gBAAgB,EAAE,MAAM,UAAU;AAAA,EAClC,gBAAgB,EAAE,MAAM,UAAU;AAAA,EAClC,gBAAgB,EAAE,MAAM,UAAU;AAAA,EAClC,kBAAkB,EAAE,MAAM,UAAU;AAAA,EACpC,OAAO,EAAE,MAAM,SAAS;AACzB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/shared/options/args.ts"],"sourcesContent":["export const allArgOptions = {\n\tauthor: { type: \"string\" },\n\tbase: { type: \"string\" },\n\t\"create-repository\": { type: \"boolean\" },\n\tdescription: { type: \"string\" },\n\temail: { type: \"string\" },\n\t\"exclude-compliance\": { type: \"boolean\" },\n\t\"exclude-contributors\": { type: \"boolean\" },\n\t\"exclude-lint-json\": { type: \"boolean\" },\n\t\"exclude-lint-knip\": { type: \"boolean\" },\n\t\"exclude-lint-md\": { type: \"boolean\" },\n\t\"exclude-lint-package-json\": { type: \"boolean\" },\n\t\"exclude-lint-packages\": { type: \"boolean\" },\n\t\"exclude-lint-perfectionist\": { type: \"boolean\" },\n\t\"exclude-lint-spelling\": { type: \"boolean\" },\n\t\"exclude-lint-yml\": { type: \"boolean\" },\n\t\"exclude-releases\": { type: \"boolean\" },\n\t\"exclude-renovate\": { type: \"boolean\" },\n\t\"exclude-tests\": { type: \"boolean\" },\n\tfunding: { type: \"string\" },\n\tlogo: { type: \"string\" },\n\t\"logo-alt\": { type: \"string\" },\n\towner: { type: \"string\" },\n\trepository: { type: \"string\" },\n\t\"skip-github-api\": { type: \"boolean\" },\n\t\"skip-install\": { type: \"boolean\" },\n\t\"skip-removal\": { type: \"boolean\" },\n\t\"skip-restore\": { type: \"boolean\" },\n\t\"skip-uninstall\": { type: \"boolean\" },\n\ttitle: { type: \"string\" },\n} as const;\n"],"mappings":"AAAO,MAAM,gBAAgB;AAAA,EAC5B,QAAQ,EAAE,MAAM,SAAS;AAAA,EACzB,MAAM,EAAE,MAAM,SAAS;AAAA,EACvB,qBAAqB,EAAE,MAAM,UAAU;AAAA,EACvC,aAAa,EAAE,MAAM,SAAS;AAAA,EAC9B,OAAO,EAAE,MAAM,SAAS;AAAA,EACxB,sBAAsB,EAAE,MAAM,UAAU;AAAA,EACxC,wBAAwB,EAAE,MAAM,UAAU;AAAA,EAC1C,qBAAqB,EAAE,MAAM,UAAU;AAAA,EACvC,qBAAqB,EAAE,MAAM,UAAU;AAAA,EACvC,mBAAmB,EAAE,MAAM,UAAU;AAAA,EACrC,6BAA6B,EAAE,MAAM,UAAU;AAAA,EAC/C,yBAAyB,EAAE,MAAM,UAAU;AAAA,EAC3C,8BAA8B,EAAE,MAAM,UAAU;AAAA,EAChD,yBAAyB,EAAE,MAAM,UAAU;AAAA,EAC3C,oBAAoB,EAAE,MAAM,UAAU;AAAA,EACtC,oBAAoB,EAAE,MAAM,UAAU;AAAA,EACtC,oBAAoB,EAAE,MAAM,UAAU;AAAA,EACtC,iBAAiB,EAAE,MAAM,UAAU;AAAA,EACnC,SAAS,EAAE,MAAM,SAAS;AAAA,EAC1B,MAAM,EAAE,MAAM,SAAS;AAAA,EACvB,YAAY,EAAE,MAAM,SAAS;AAAA,EAC7B,OAAO,EAAE,MAAM,SAAS;AAAA,EACxB,YAAY,EAAE,MAAM,SAAS;AAAA,EAC7B,mBAAmB,EAAE,MAAM,UAAU;AAAA,EACrC,gBAAgB,EAAE,MAAM,UAAU;AAAA,EAClC,gBAAgB,EAAE,MAAM,UAAU;AAAA,EAClC,gBAAgB,EAAE,MAAM,UAAU;AAAA,EAClC,kBAAkB,EAAE,MAAM,UAAU;AAAA,EACpC,OAAO,EAAE,MAAM,SAAS;AACzB;","names":[]}
|
|
@@ -4,7 +4,7 @@ async function getPrefillOrPromptedOption(existingValue, message, getPlaceholder
|
|
|
4
4
|
if (existingValue) {
|
|
5
5
|
return existingValue;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
return filterPromptCancel(
|
|
8
8
|
await prompts.text({
|
|
9
9
|
message,
|
|
10
10
|
placeholder: await getPlaceholder?.(),
|
|
@@ -15,7 +15,6 @@ async function getPrefillOrPromptedOption(existingValue, message, getPlaceholder
|
|
|
15
15
|
}
|
|
16
16
|
})
|
|
17
17
|
);
|
|
18
|
-
return value;
|
|
19
18
|
}
|
|
20
19
|
export {
|
|
21
20
|
getPrefillOrPromptedOption
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/shared/options/getPrefillOrPromptedOption.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\n\nimport { filterPromptCancel } from \"../prompts.js\";\n\nexport async function getPrefillOrPromptedOption(\n\texistingValue: string | undefined,\n\tmessage: string,\n\tgetPlaceholder?: () => Promise<string | undefined>,\n) {\n\tif (existingValue) {\n\t\treturn existingValue;\n\t}\n\n\
|
|
1
|
+
{"version":3,"sources":["../../../src/shared/options/getPrefillOrPromptedOption.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\n\nimport { filterPromptCancel } from \"../prompts.js\";\n\nexport async function getPrefillOrPromptedOption(\n\texistingValue: string | undefined,\n\tmessage: string,\n\tgetPlaceholder?: () => Promise<string | undefined>,\n) {\n\tif (existingValue) {\n\t\treturn existingValue;\n\t}\n\n\treturn filterPromptCancel(\n\t\tawait prompts.text({\n\t\t\tmessage,\n\t\t\tplaceholder: await getPlaceholder?.(),\n\t\t\tvalidate: (val) => {\n\t\t\t\tif (val.length === 0) {\n\t\t\t\t\treturn \"Please enter a value.\";\n\t\t\t\t}\n\t\t\t},\n\t\t}),\n\t);\n}\n"],"mappings":"AAAA,YAAY,aAAa;AAEzB,SAAS,0BAA0B;AAEnC,eAAsB,2BACrB,eACA,SACA,gBACC;AACD,MAAI,eAAe;AAClB,WAAO;AAAA,EACR;AAEA,SAAO;AAAA,IACN,MAAM,QAAQ,KAAK;AAAA,MAClB;AAAA,MACA,aAAa,MAAM,iBAAiB;AAAA,MACpC,UAAU,CAAC,QAAQ;AAClB,YAAI,IAAI,WAAW,GAAG;AACrB,iBAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AACD;","names":[]}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
declare function getGitAndNpmDefaults(): {
|
|
2
|
+
logo: () => Promise<string | undefined>;
|
|
3
|
+
title: () => Promise<string | undefined>;
|
|
2
4
|
author: () => Promise<string>;
|
|
3
5
|
description: () => Promise<string | undefined>;
|
|
4
6
|
email: () => Promise<string | undefined>;
|
|
5
7
|
funding: () => Promise<string | undefined>;
|
|
6
8
|
owner: () => Promise<string | undefined>;
|
|
7
9
|
repository: () => Promise<string | undefined>;
|
|
8
|
-
title: () => Promise<string | undefined>;
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
export { getGitAndNpmDefaults };
|
|
@@ -8,7 +8,7 @@ import { readPackageData } from "../../packages.js";
|
|
|
8
8
|
import { tryCatchAsync } from "../../tryCatchAsync.js";
|
|
9
9
|
import { tryCatchLazyValueAsync } from "../../tryCatchLazyValueAsync.js";
|
|
10
10
|
import { parsePackageAuthor } from "./parsePackageAuthor.js";
|
|
11
|
-
import {
|
|
11
|
+
import { readDefaultsFromReadme } from "./readDefaultsFromReadme.js";
|
|
12
12
|
function getGitAndNpmDefaults() {
|
|
13
13
|
const gitDefaults = tryCatchLazyValueAsync(
|
|
14
14
|
async () => gitUrlParse(await gitRemoteOriginUrl())
|
|
@@ -31,7 +31,7 @@ function getGitAndNpmDefaults() {
|
|
|
31
31
|
),
|
|
32
32
|
owner: async () => (await gitDefaults())?.organization ?? (await packageAuthor()).author,
|
|
33
33
|
repository: async () => (await gitDefaults())?.name ?? (await packageData()).name,
|
|
34
|
-
|
|
34
|
+
...readDefaultsFromReadme()
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
export {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/shared/options/readOptionDefaults/index.ts"],"sourcesContent":["import { $ } from \"execa\";\nimport gitRemoteOriginUrl from \"git-remote-origin-url\";\nimport gitUrlParse from \"git-url-parse\";\nimport lazyValue from \"lazy-value\";\nimport fs from \"node:fs/promises\";\nimport npmUser from \"npm-user\";\n\nimport { readPackageData } from \"../../packages.js\";\nimport { tryCatchAsync } from \"../../tryCatchAsync.js\";\nimport { tryCatchLazyValueAsync } from \"../../tryCatchLazyValueAsync.js\";\nimport { parsePackageAuthor } from \"./parsePackageAuthor.js\";\nimport { readDefaultsFromReadme } from \"./readDefaultsFromReadme.js\";\n\nexport function getGitAndNpmDefaults() {\n\tconst gitDefaults = tryCatchLazyValueAsync(async () =>\n\t\tgitUrlParse(await gitRemoteOriginUrl()),\n\t);\n\n\tconst npmDefaults = tryCatchLazyValueAsync(\n\t\tasync () => await npmUser((await $`npm whoami`).stdout),\n\t);\n\n\tconst packageData = lazyValue(readPackageData);\n\tconst packageAuthor = lazyValue(async () =>\n\t\tparsePackageAuthor(await packageData()),\n\t);\n\n\treturn {\n\t\tauthor: async () => (await packageAuthor()).author ?? npmDefaults.name,\n\t\tdescription: async () => (await packageData()).description,\n\t\temail: async () =>\n\t\t\t(await npmDefaults())?.email ??\n\t\t\t(await packageAuthor()).email ??\n\t\t\t(await tryCatchAsync(\n\t\t\t\tasync () => (await $`git config --get user.email`).stdout,\n\t\t\t)),\n\t\tfunding: async () =>\n\t\t\tawait tryCatchAsync(\n\t\t\t\tasync () =>\n\t\t\t\t\t(await fs.readFile(\".github/FUNDING.yml\"))\n\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t.split(\":\")[1]\n\t\t\t\t\t\t?.trim(),\n\t\t\t),\n\t\towner: async () =>\n\t\t\t(await gitDefaults())?.organization ?? (await packageAuthor()).author,\n\t\trepository: async () =>\n\t\t\t(await gitDefaults())?.name ?? (await packageData()).name,\n\t\t...readDefaultsFromReadme(),\n\t};\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAClB,OAAO,wBAAwB;AAC/B,OAAO,iBAAiB;AACxB,OAAO,eAAe;AACtB,OAAO,QAAQ;AACf,OAAO,aAAa;AAEpB,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,8BAA8B;AACvC,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;AAEhC,SAAS,uBAAuB;AACtC,QAAM,cAAc;AAAA,IAAuB,YAC1C,YAAY,MAAM,mBAAmB,CAAC;AAAA,EACvC;AAEA,QAAM,cAAc;AAAA,IACnB,YAAY,MAAM,SAAS,MAAM,eAAe,MAAM;AAAA,EACvD;AAEA,QAAM,cAAc,UAAU,eAAe;AAC7C,QAAM,gBAAgB;AAAA,IAAU,YAC/B,mBAAmB,MAAM,YAAY,CAAC;AAAA,EACvC;AAEA,SAAO;AAAA,IACN,QAAQ,aAAa,MAAM,cAAc,GAAG,UAAU,YAAY;AAAA,IAClE,aAAa,aAAa,MAAM,YAAY,GAAG;AAAA,IAC/C,OAAO,aACL,MAAM,YAAY,IAAI,UACtB,MAAM,cAAc,GAAG,SACvB,MAAM;AAAA,MACN,aAAa,MAAM,gCAAgC;AAAA,IACpD;AAAA,IACD,SAAS,YACR,MAAM;AAAA,MACL,aACE,MAAM,GAAG,SAAS,qBAAqB,GACtC,SAAS,EACT,MAAM,GAAG,EAAE,CAAC,GACX,KAAK;AAAA,IACV;AAAA,IACD,OAAO,aACL,MAAM,YAAY,IAAI,iBAAiB,MAAM,cAAc,GAAG;AAAA,IAChE,YAAY,aACV,MAAM,YAAY,IAAI,SAAS,MAAM,YAAY,GAAG;AAAA,IACtD,GAAG,uBAAuB;AAAA,EAC3B;AACD;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/shared/options/readOptionDefaults/parsePackageAuthor.ts"],"sourcesContent":["import { PartialPackageData } from \"../../types.js\";\n\nexport function parsePackageAuthor(packageData: PartialPackageData) {\n\tconst [packageAuthor, packageEmail] =\n\t\ttypeof packageData.author === \"string\"\n\t\t\t? [\n\t\t\t\t\tpackageData.author.split(\"<\")[0].trim(),\n\t\t\t\t\tpackageData.author.split(/<|>/)[1]?.trim(),\n\t\t\t ]\n\t\t\t: [packageData.author?.name, packageData.author?.email];\n\n\treturn {\n\t\tauthor: packageAuthor,\n\t\temail: packageEmail,\n\t};\n}\n"],"mappings":"AAEO,SAAS,mBAAmB,aAAiC;AACnE,QAAM,CAAC,eAAe,YAAY,IACjC,OAAO,YAAY,WAAW,WAC3B;AAAA,IACA,YAAY,OAAO,MAAM,GAAG,EAAE,CAAC,EAAE,KAAK;AAAA,IACtC,YAAY,OAAO,MAAM,KAAK,EAAE,CAAC,GAAG,KAAK;AAAA,EACzC,IACA,CAAC,YAAY,QAAQ,MAAM,YAAY,QAAQ,KAAK;AAExD,SAAO;AAAA,IACN,QAAQ;AAAA,IACR,OAAO;AAAA,EACR;AACD;","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import lazyValue from "lazy-value";
|
|
2
|
+
import { readFileSafe } from "../../readFileSafe.js";
|
|
3
|
+
function readDefaultsFromReadme() {
|
|
4
|
+
const readme = lazyValue(async () => await readFileSafe("README.md", ""));
|
|
5
|
+
const imageTag = lazyValue(
|
|
6
|
+
async () => (await readme()).match(/<img.+src.+\/>/)?.[0]
|
|
7
|
+
);
|
|
8
|
+
return {
|
|
9
|
+
logo: async () => (await imageTag())?.match(/src\s*=(.+)?\/>/)?.[1]?.replaceAll(/^['"]|['"]$/g, ""),
|
|
10
|
+
title: async () => (await readme()).match(/^(?:# |<h1\s+align="center">)(.*?)(?:<\/h1>)?$/i)?.[1]?.trim()?.replace(/<[^>]+(?:>|$)/g, "")
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
readDefaultsFromReadme
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=readDefaultsFromReadme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/shared/options/readOptionDefaults/readDefaultsFromReadme.ts"],"sourcesContent":["import lazyValue from \"lazy-value\";\n\nimport { readFileSafe } from \"../../readFileSafe.js\";\n\nexport function readDefaultsFromReadme() {\n\tconst readme = lazyValue(async () => await readFileSafe(\"README.md\", \"\"));\n\n\tconst imageTag = lazyValue(\n\t\tasync () => (await readme()).match(/<img.+src.+\\/>/)?.[0],\n\t);\n\n\treturn {\n\t\tlogo: async () =>\n\t\t\t(await imageTag())\n\t\t\t\t?.match(/src\\s*=(.+)?\\/>/)?.[1]\n\t\t\t\t?.replaceAll(/^['\"]|['\"]$/g, \"\"),\n\t\ttitle: async () =>\n\t\t\t(await readme())\n\t\t\t\t.match(/^(?:# |<h1\\s+align=\"center\">)(.*?)(?:<\\/h1>)?$/i)?.[1]\n\t\t\t\t?.trim()\n\t\t\t\t?.replace(/<[^>]+(?:>|$)/g, \"\"),\n\t};\n}\n"],"mappings":"AAAA,OAAO,eAAe;AAEtB,SAAS,oBAAoB;AAEtB,SAAS,yBAAyB;AACxC,QAAM,SAAS,UAAU,YAAY,MAAM,aAAa,aAAa,EAAE,CAAC;AAExE,QAAM,WAAW;AAAA,IAChB,aAAa,MAAM,OAAO,GAAG,MAAM,gBAAgB,IAAI,CAAC;AAAA,EACzD;AAEA,SAAO;AAAA,IACN,MAAM,aACJ,MAAM,SAAS,IACb,MAAM,iBAAiB,IAAI,CAAC,GAC5B,WAAW,gBAAgB,EAAE;AAAA,IACjC,OAAO,aACL,MAAM,OAAO,GACZ,MAAM,iDAAiD,IAAI,CAAC,GAC3D,KAAK,GACL,QAAQ,kBAAkB,EAAE;AAAA,EACjC;AACD;","names":[]}
|
|
@@ -7,7 +7,7 @@ import { augmentOptionsWithExcludes } from "./augmentOptionsWithExcludes.js";
|
|
|
7
7
|
import { ensureRepositoryExists } from "./ensureRepositoryExists.js";
|
|
8
8
|
import { getGitHub } from "./getGitHub.js";
|
|
9
9
|
import { getPrefillOrPromptedOption } from "./getPrefillOrPromptedOption.js";
|
|
10
|
-
import { getGitAndNpmDefaults } from "./
|
|
10
|
+
import { getGitAndNpmDefaults } from "./readOptionDefaults/index.js";
|
|
11
11
|
async function readOptions(args) {
|
|
12
12
|
const defaults = getGitAndNpmDefaults();
|
|
13
13
|
const { values } = parseArgs({
|
|
@@ -103,12 +103,24 @@ async function readOptions(args) {
|
|
|
103
103
|
if (!options.title) {
|
|
104
104
|
return { cancelled: true, options };
|
|
105
105
|
}
|
|
106
|
+
let logo;
|
|
107
|
+
if (options.logo) {
|
|
108
|
+
const alt = await getPrefillOrPromptedOption(
|
|
109
|
+
options.logoAlt,
|
|
110
|
+
"What is the alt text (non-visual description) of the logo?"
|
|
111
|
+
);
|
|
112
|
+
if (!alt) {
|
|
113
|
+
return { cancelled: true, options };
|
|
114
|
+
}
|
|
115
|
+
logo = { alt, src: options.logo };
|
|
116
|
+
}
|
|
106
117
|
const augmentedOptions = await augmentOptionsWithExcludes({
|
|
107
118
|
...options,
|
|
108
119
|
author: options.author ?? await defaults.owner(),
|
|
109
120
|
description: options.description,
|
|
110
121
|
email: options.email ?? await defaults.email(),
|
|
111
122
|
funding: options.funding ?? await defaults.funding(),
|
|
123
|
+
logo,
|
|
112
124
|
owner: options.owner,
|
|
113
125
|
repository,
|
|
114
126
|
title: options.title
|
|
@@ -150,6 +162,8 @@ const optionsSchema = z.object({
|
|
|
150
162
|
excludeRenovate: z.boolean().optional(),
|
|
151
163
|
excludeTests: z.boolean().optional(),
|
|
152
164
|
funding: z.string().optional(),
|
|
165
|
+
logo: z.string().optional(),
|
|
166
|
+
logoAlt: z.string().optional(),
|
|
153
167
|
owner: z.string().optional(),
|
|
154
168
|
repository: z.string().optional(),
|
|
155
169
|
skipGitHubApi: z.boolean(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/shared/options/readOptions.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport { titleCase } from \"title-case\";\nimport { z } from \"zod\";\n\nimport { withSpinner } from \"../cli/spinners.js\";\nimport { Options } from \"../types.js\";\nimport { allArgOptions } from \"./args.js\";\nimport { augmentOptionsWithExcludes } from \"./augmentOptionsWithExcludes.js\";\nimport { ensureRepositoryExists } from \"./ensureRepositoryExists.js\";\nimport { GitHub, getGitHub } from \"./getGitHub.js\";\nimport { getPrefillOrPromptedOption } from \"./getPrefillOrPromptedOption.js\";\nimport { getGitAndNpmDefaults } from \"./readGitAndNpmDefaults/index.js\";\n\nexport interface GitHubAndOptions {\n\tgithub: GitHub | undefined;\n\toptions: Options;\n}\n\nexport interface OptionsParseCancelled {\n\tcancelled: true;\n\toptions: object;\n\tzodError?: z.ZodError<object>;\n}\n\nexport interface OptionsParseSuccess extends GitHubAndOptions {\n\tcancelled: false;\n}\n\nexport type OptionsParseResult = OptionsParseCancelled | OptionsParseSuccess;\n\nexport async function readOptions(args: string[]): Promise<OptionsParseResult> {\n\tconst defaults = getGitAndNpmDefaults();\n\tconst { values } = parseArgs({\n\t\targs,\n\t\toptions: allArgOptions,\n\t\tstrict: false,\n\t\ttokens: true,\n\t});\n\n\tconst mappedOptions = {\n\t\tauthor: values.author,\n\t\tbase: values.base,\n\t\tcreateRepository: values[\"create-repository\"],\n\t\tdescription: values.description,\n\t\temail: values.email,\n\t\texcludeCompliance: values[\"exclude-compliance\"],\n\t\texcludeContributors: values[\"exclude-contributors\"],\n\t\texcludeLintJson: values[\"exclude-lint-json\"],\n\t\texcludeLintKnip: values[\"exclude-lint-knip\"],\n\t\texcludeLintMd: values[\"exclude-lint-md\"],\n\t\texcludeLintPackageJson: values[\"exclude-lint-package-json\"],\n\t\texcludeLintPackages: values[\"exclude-lint-packages\"],\n\t\texcludeLintPerfectionist: values[\"exclude-lint-perfectionist\"],\n\t\texcludeLintSpelling: values[\"exclude-lint-spelling\"],\n\t\texcludeLintYml: values[\"exclude-lint-yml\"],\n\t\texcludeReleases: values[\"exclude-releases\"],\n\t\texcludeRenovate: values[\"exclude-renovate\"],\n\t\texcludeTests: values[\"unit-tests\"],\n\t\tfunding: values.funding,\n\t\towner: values.owner,\n\t\trepository: values.repository,\n\t\tskipGitHubApi: !!values[\"skip-github-api\"],\n\t\tskipInstall: !!values[\"skip-install\"],\n\t\tskipRemoval: !!values[\"skip-removal\"],\n\t\tskipRestore: values[\"skip-restore\"],\n\t\tskipUninstall: !!values[\"skip-uninstall\"],\n\t\ttitle: values.title,\n\t};\n\n\tconst optionsParseResult = optionsSchema.safeParse(mappedOptions);\n\n\tif (!optionsParseResult.success) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions: mappedOptions,\n\t\t\tzodError: optionsParseResult.error,\n\t\t};\n\t}\n\n\tconst options = optionsParseResult.data;\n\n\toptions.owner ??= await getPrefillOrPromptedOption(\n\t\toptions.owner,\n\t\t\"What organization or user will the repository be under?\",\n\t\tdefaults.owner,\n\t);\n\tif (!options.owner) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\toptions.repository ??= await getPrefillOrPromptedOption(\n\t\toptions.repository,\n\t\t\"What will the kebab-case name of the repository be?\",\n\t\tdefaults.repository,\n\t);\n\tif (!options.repository) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tconst { github, repository } = await ensureRepositoryExists(\n\t\tvalues[\"skip-github-api\"]\n\t\t\t? undefined\n\t\t\t: await withSpinner(\"Checking GitHub authentication\", getGitHub),\n\t\t{\n\t\t\tcreateRepository: options.createRepository,\n\t\t\towner: options.owner,\n\t\t\trepository: options.repository,\n\t\t},\n\t);\n\tif (!repository) {\n\t\treturn { cancelled: true, options };\n\t}\n\n\toptions.description ??= await getPrefillOrPromptedOption(\n\t\toptions.description,\n\t\t\"How would you describe the new package?\",\n\t\tasync () =>\n\t\t\t(await defaults.description()) ?? \"A very lovely package. Hooray!\",\n\t);\n\tif (!options.description) {\n\t\treturn { cancelled: true, options };\n\t}\n\n\toptions.title ??= await getPrefillOrPromptedOption(\n\t\toptions.title,\n\t\t\"What will the Title Case title of the repository be?\",\n\t\tasync () =>\n\t\t\t(await defaults.title()) ?? titleCase(repository).replaceAll(\"-\", \" \"),\n\t);\n\tif (!options.title) {\n\t\treturn { cancelled: true, options };\n\t}\n\n\tconst augmentedOptions = await augmentOptionsWithExcludes({\n\t\t...options,\n\t\tauthor: options.author ?? (await defaults.owner()),\n\t\tdescription: options.description,\n\t\temail: options.email ?? (await defaults.email()),\n\t\tfunding: options.funding ?? (await defaults.funding()),\n\t\towner: options.owner,\n\t\trepository,\n\t\ttitle: options.title,\n\t});\n\n\tif (!augmentedOptions) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\treturn {\n\t\tcancelled: false,\n\t\tgithub,\n\t\toptions: augmentedOptions,\n\t};\n}\n\nconst optionsSchema = z.object({\n\tauthor: z.string().optional(),\n\tbase: z\n\t\t.union([\n\t\t\tz.literal(\"common\"),\n\t\t\tz.literal(\"everything\"),\n\t\t\tz.literal(\"minimum\"),\n\t\t\tz.literal(\"prompt\"),\n\t\t])\n\t\t.optional(),\n\tcreateRepository: z.boolean().optional(),\n\tdescription: z.string().optional(),\n\temail: z.string().email().optional(),\n\texcludeCompliance: z.boolean().optional(),\n\texcludeContributors: z.boolean().optional(),\n\texcludeLintJson: z.boolean().optional(),\n\texcludeLintKnip: z.boolean().optional(),\n\texcludeLintMd: z.boolean().optional(),\n\texcludeLintPackageJson: z.boolean().optional(),\n\texcludeLintPackages: z.boolean().optional(),\n\texcludeLintPerfectionist: z.boolean().optional(),\n\texcludeLintSpelling: z.boolean().optional(),\n\texcludeLintYml: z.boolean().optional(),\n\texcludeReleases: z.boolean().optional(),\n\texcludeRenovate: z.boolean().optional(),\n\texcludeTests: z.boolean().optional(),\n\tfunding: z.string().optional(),\n\towner: z.string().optional(),\n\trepository: z.string().optional(),\n\tskipGitHubApi: z.boolean(),\n\tskipInstall: z.boolean(),\n\tskipRemoval: z.boolean(),\n\tskipRestore: z.boolean().optional(),\n\tskipUninstall: z.boolean(),\n\ttitle: z.string().optional(),\n});\n"],"mappings":"AAAA,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAC1B,SAAS,SAAS;AAElB,SAAS,mBAAmB;AAE5B,SAAS,qBAAqB;AAC9B,SAAS,kCAAkC;AAC3C,SAAS,8BAA8B;AACvC,SAAiB,iBAAiB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AAmBrC,eAAsB,YAAY,MAA6C;AAC9E,QAAM,WAAW,qBAAqB;AACtC,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,EACT,CAAC;AAED,QAAM,gBAAgB;AAAA,IACrB,QAAQ,OAAO;AAAA,IACf,MAAM,OAAO;AAAA,IACb,kBAAkB,OAAO,mBAAmB;AAAA,IAC5C,aAAa,OAAO;AAAA,IACpB,OAAO,OAAO;AAAA,IACd,mBAAmB,OAAO,oBAAoB;AAAA,IAC9C,qBAAqB,OAAO,sBAAsB;AAAA,IAClD,iBAAiB,OAAO,mBAAmB;AAAA,IAC3C,iBAAiB,OAAO,mBAAmB;AAAA,IAC3C,eAAe,OAAO,iBAAiB;AAA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/readOptions.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport { titleCase } from \"title-case\";\nimport { z } from \"zod\";\n\nimport { withSpinner } from \"../cli/spinners.js\";\nimport { Options, OptionsLogo } from \"../types.js\";\nimport { allArgOptions } from \"./args.js\";\nimport { augmentOptionsWithExcludes } from \"./augmentOptionsWithExcludes.js\";\nimport { ensureRepositoryExists } from \"./ensureRepositoryExists.js\";\nimport { GitHub, getGitHub } from \"./getGitHub.js\";\nimport { getPrefillOrPromptedOption } from \"./getPrefillOrPromptedOption.js\";\nimport { getGitAndNpmDefaults } from \"./readOptionDefaults/index.js\";\n\nexport interface GitHubAndOptions {\n\tgithub: GitHub | undefined;\n\toptions: Options;\n}\n\nexport interface OptionsParseCancelled {\n\tcancelled: true;\n\toptions: object;\n\tzodError?: z.ZodError<object>;\n}\n\nexport interface OptionsParseSuccess extends GitHubAndOptions {\n\tcancelled: false;\n}\n\nexport type OptionsParseResult = OptionsParseCancelled | OptionsParseSuccess;\n\nexport async function readOptions(args: string[]): Promise<OptionsParseResult> {\n\tconst defaults = getGitAndNpmDefaults();\n\tconst { values } = parseArgs({\n\t\targs,\n\t\toptions: allArgOptions,\n\t\tstrict: false,\n\t\ttokens: true,\n\t});\n\n\tconst mappedOptions = {\n\t\tauthor: values.author,\n\t\tbase: values.base,\n\t\tcreateRepository: values[\"create-repository\"],\n\t\tdescription: values.description,\n\t\temail: values.email,\n\t\texcludeCompliance: values[\"exclude-compliance\"],\n\t\texcludeContributors: values[\"exclude-contributors\"],\n\t\texcludeLintJson: values[\"exclude-lint-json\"],\n\t\texcludeLintKnip: values[\"exclude-lint-knip\"],\n\t\texcludeLintMd: values[\"exclude-lint-md\"],\n\t\texcludeLintPackageJson: values[\"exclude-lint-package-json\"],\n\t\texcludeLintPackages: values[\"exclude-lint-packages\"],\n\t\texcludeLintPerfectionist: values[\"exclude-lint-perfectionist\"],\n\t\texcludeLintSpelling: values[\"exclude-lint-spelling\"],\n\t\texcludeLintYml: values[\"exclude-lint-yml\"],\n\t\texcludeReleases: values[\"exclude-releases\"],\n\t\texcludeRenovate: values[\"exclude-renovate\"],\n\t\texcludeTests: values[\"unit-tests\"],\n\t\tfunding: values.funding,\n\t\towner: values.owner,\n\t\trepository: values.repository,\n\t\tskipGitHubApi: !!values[\"skip-github-api\"],\n\t\tskipInstall: !!values[\"skip-install\"],\n\t\tskipRemoval: !!values[\"skip-removal\"],\n\t\tskipRestore: values[\"skip-restore\"],\n\t\tskipUninstall: !!values[\"skip-uninstall\"],\n\t\ttitle: values.title,\n\t};\n\n\tconst optionsParseResult = optionsSchema.safeParse(mappedOptions);\n\n\tif (!optionsParseResult.success) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions: mappedOptions,\n\t\t\tzodError: optionsParseResult.error,\n\t\t};\n\t}\n\n\tconst options = optionsParseResult.data;\n\n\toptions.owner ??= await getPrefillOrPromptedOption(\n\t\toptions.owner,\n\t\t\"What organization or user will the repository be under?\",\n\t\tdefaults.owner,\n\t);\n\tif (!options.owner) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\toptions.repository ??= await getPrefillOrPromptedOption(\n\t\toptions.repository,\n\t\t\"What will the kebab-case name of the repository be?\",\n\t\tdefaults.repository,\n\t);\n\tif (!options.repository) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tconst { github, repository } = await ensureRepositoryExists(\n\t\tvalues[\"skip-github-api\"]\n\t\t\t? undefined\n\t\t\t: await withSpinner(\"Checking GitHub authentication\", getGitHub),\n\t\t{\n\t\t\tcreateRepository: options.createRepository,\n\t\t\towner: options.owner,\n\t\t\trepository: options.repository,\n\t\t},\n\t);\n\tif (!repository) {\n\t\treturn { cancelled: true, options };\n\t}\n\n\toptions.description ??= await getPrefillOrPromptedOption(\n\t\toptions.description,\n\t\t\"How would you describe the new package?\",\n\t\tasync () =>\n\t\t\t(await defaults.description()) ?? \"A very lovely package. Hooray!\",\n\t);\n\tif (!options.description) {\n\t\treturn { cancelled: true, options };\n\t}\n\n\toptions.title ??= await getPrefillOrPromptedOption(\n\t\toptions.title,\n\t\t\"What will the Title Case title of the repository be?\",\n\t\tasync () =>\n\t\t\t(await defaults.title()) ?? titleCase(repository).replaceAll(\"-\", \" \"),\n\t);\n\tif (!options.title) {\n\t\treturn { cancelled: true, options };\n\t}\n\n\tlet logo: OptionsLogo | undefined;\n\n\tif (options.logo) {\n\t\tconst alt = await getPrefillOrPromptedOption(\n\t\t\toptions.logoAlt,\n\t\t\t\"What is the alt text (non-visual description) of the logo?\",\n\t\t);\n\t\tif (!alt) {\n\t\t\treturn { cancelled: true, options };\n\t\t}\n\n\t\tlogo = { alt, src: options.logo };\n\t}\n\n\tconst augmentedOptions = await augmentOptionsWithExcludes({\n\t\t...options,\n\t\tauthor: options.author ?? (await defaults.owner()),\n\t\tdescription: options.description,\n\t\temail: options.email ?? (await defaults.email()),\n\t\tfunding: options.funding ?? (await defaults.funding()),\n\t\tlogo,\n\t\towner: options.owner,\n\t\trepository,\n\t\ttitle: options.title,\n\t});\n\n\tif (!augmentedOptions) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\treturn {\n\t\tcancelled: false,\n\t\tgithub,\n\t\toptions: augmentedOptions,\n\t};\n}\n\nconst optionsSchema = z.object({\n\tauthor: z.string().optional(),\n\tbase: z\n\t\t.union([\n\t\t\tz.literal(\"common\"),\n\t\t\tz.literal(\"everything\"),\n\t\t\tz.literal(\"minimum\"),\n\t\t\tz.literal(\"prompt\"),\n\t\t])\n\t\t.optional(),\n\tcreateRepository: z.boolean().optional(),\n\tdescription: z.string().optional(),\n\temail: z.string().email().optional(),\n\texcludeCompliance: z.boolean().optional(),\n\texcludeContributors: z.boolean().optional(),\n\texcludeLintJson: z.boolean().optional(),\n\texcludeLintKnip: z.boolean().optional(),\n\texcludeLintMd: z.boolean().optional(),\n\texcludeLintPackageJson: z.boolean().optional(),\n\texcludeLintPackages: z.boolean().optional(),\n\texcludeLintPerfectionist: z.boolean().optional(),\n\texcludeLintSpelling: z.boolean().optional(),\n\texcludeLintYml: z.boolean().optional(),\n\texcludeReleases: z.boolean().optional(),\n\texcludeRenovate: z.boolean().optional(),\n\texcludeTests: z.boolean().optional(),\n\tfunding: z.string().optional(),\n\tlogo: z.string().optional(),\n\tlogoAlt: z.string().optional(),\n\towner: z.string().optional(),\n\trepository: z.string().optional(),\n\tskipGitHubApi: z.boolean(),\n\tskipInstall: z.boolean(),\n\tskipRemoval: z.boolean(),\n\tskipRestore: z.boolean().optional(),\n\tskipUninstall: z.boolean(),\n\ttitle: z.string().optional(),\n});\n"],"mappings":"AAAA,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAC1B,SAAS,SAAS;AAElB,SAAS,mBAAmB;AAE5B,SAAS,qBAAqB;AAC9B,SAAS,kCAAkC;AAC3C,SAAS,8BAA8B;AACvC,SAAiB,iBAAiB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AAmBrC,eAAsB,YAAY,MAA6C;AAC9E,QAAM,WAAW,qBAAqB;AACtC,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,EACT,CAAC;AAED,QAAM,gBAAgB;AAAA,IACrB,QAAQ,OAAO;AAAA,IACf,MAAM,OAAO;AAAA,IACb,kBAAkB,OAAO,mBAAmB;AAAA,IAC5C,aAAa,OAAO;AAAA,IACpB,OAAO,OAAO;AAAA,IACd,mBAAmB,OAAO,oBAAoB;AAAA,IAC9C,qBAAqB,OAAO,sBAAsB;AAAA,IAClD,iBAAiB,OAAO,mBAAmB;AAAA,IAC3C,iBAAiB,OAAO,mBAAmB;AAAA,IAC3C,eAAe,OAAO,iBAAiB;AAAA,IACvC,wBAAwB,OAAO,2BAA2B;AAAA,IAC1D,qBAAqB,OAAO,uBAAuB;AAAA,IAC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,EAAE,QAAQ;AAAA,EACzB,aAAa,EAAE,QAAQ;AAAA,EACvB,aAAa,EAAE,QAAQ;AAAA,EACvB,aAAa,EAAE,QAAQ,EAAE,SAAS;AAAA,EAClC,eAAe,EAAE,QAAQ;AAAA,EACzB,OAAO,EAAE,OAAO,EAAE,SAAS;AAC5B,CAAC;","names":[]}
|
package/lib/shared/types.d.ts
CHANGED
|
@@ -21,6 +21,10 @@ interface PartialPackageData {
|
|
|
21
21
|
} | string;
|
|
22
22
|
}
|
|
23
23
|
type InputBase = "common" | "everything" | "minimum" | "prompt";
|
|
24
|
+
interface OptionsLogo {
|
|
25
|
+
alt: string;
|
|
26
|
+
src: string;
|
|
27
|
+
}
|
|
24
28
|
interface Options {
|
|
25
29
|
author?: string;
|
|
26
30
|
base?: InputBase;
|
|
@@ -41,6 +45,7 @@ interface Options {
|
|
|
41
45
|
excludeRenovate?: boolean;
|
|
42
46
|
excludeTests?: boolean;
|
|
43
47
|
funding?: string;
|
|
48
|
+
logo: OptionsLogo | undefined;
|
|
44
49
|
owner: string;
|
|
45
50
|
repository: string;
|
|
46
51
|
skipGitHubApi: boolean;
|
|
@@ -51,4 +56,4 @@ interface Options {
|
|
|
51
56
|
title: string;
|
|
52
57
|
}
|
|
53
58
|
|
|
54
|
-
export { AllContributorContributor, AllContributorsData, InputBase, Options, PartialPackageData };
|
|
59
|
+
export { AllContributorContributor, AllContributorsData, InputBase, Options, OptionsLogo, PartialPackageData };
|
|
@@ -33,7 +33,11 @@ async function finalizeDependencies(options) {
|
|
|
33
33
|
...options.excludeLintPerfectionist ? [] : ["eslint-plugin-perfectionist"],
|
|
34
34
|
...options.excludeLintSpelling ? [] : ["cspell"],
|
|
35
35
|
...options.excludeLintYml ? [] : ["eslint-plugin-yml", "yaml-eslint-parser"],
|
|
36
|
-
...options.excludeReleases ? [] : [
|
|
36
|
+
...options.excludeReleases ? [] : [
|
|
37
|
+
"@release-it/conventional-changelog",
|
|
38
|
+
"release-it",
|
|
39
|
+
"should-semantic-release"
|
|
40
|
+
],
|
|
37
41
|
...options.excludeTests ? [] : [
|
|
38
42
|
"@vitest/coverage-v8",
|
|
39
43
|
"console-fail-test",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/finalizeDependencies.ts"],"sourcesContent":["import { execaCommand } from \"execa\";\n\nimport { readPackageData, removeDependencies } from \"../shared/packages.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport async function finalizeDependencies(options: Options) {\n\tconst devDependencies = [\n\t\t\"@types/eslint\",\n\t\t\"@typescript-eslint/eslint-plugin\",\n\t\t\"@typescript-eslint/parser\",\n\t\t\"eslint\",\n\t\t\"eslint-config-prettier\",\n\t\t\"eslint-plugin-deprecation\",\n\t\t\"eslint-plugin-eslint-comments\",\n\t\t\"eslint-plugin-import\",\n\t\t\"eslint-plugin-jsdoc\",\n\t\t\"eslint-plugin-n\",\n\t\t\"eslint-plugin-regexp\",\n\t\t\"husky\",\n\t\t\"lint-staged\",\n\t\t\"prettier\",\n\t\t\"prettier-plugin-curly\",\n\t\t\"prettier-plugin-packagejson\",\n\t\t\"tsup\",\n\t\t\"typescript\",\n\t\t...(options.excludeContributors ? [] : [\"all-contributors-cli\"]),\n\t\t...(options.excludeLintJson\n\t\t\t? []\n\t\t\t: [\"eslint-plugin-jsonc\", \"jsonc-eslint-parser\"]),\n\t\t...(options.excludeLintKnip ? [] : [\"knip\"]),\n\t\t...(options.excludeLintMd\n\t\t\t? []\n\t\t\t: [\n\t\t\t\t\t\"eslint-plugin-markdown\",\n\t\t\t\t\t\"markdownlint\",\n\t\t\t\t\t\"markdownlint-cli\",\n\t\t\t\t\t\"sentences-per-line\",\n\t\t\t ]),\n\t\t...(options.excludeLintPackageJson\n\t\t\t? []\n\t\t\t: [\"npm-package-json-lint\", \"npm-package-json-lint-config-default\"]),\n\t\t...(options.excludeLintPerfectionist\n\t\t\t? []\n\t\t\t: [\"eslint-plugin-perfectionist\"]),\n\t\t...(options.excludeLintSpelling ? [] : [\"cspell\"]),\n\t\t...(options.excludeLintYml\n\t\t\t? []\n\t\t\t: [\"eslint-plugin-yml\", \"yaml-eslint-parser\"]),\n\t\t...(options.excludeReleases\n\t\t\t? []\n\t\t\t: [\"release-it\"
|
|
1
|
+
{"version":3,"sources":["../../src/steps/finalizeDependencies.ts"],"sourcesContent":["import { execaCommand } from \"execa\";\n\nimport { readPackageData, removeDependencies } from \"../shared/packages.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport async function finalizeDependencies(options: Options) {\n\tconst devDependencies = [\n\t\t\"@types/eslint\",\n\t\t\"@typescript-eslint/eslint-plugin\",\n\t\t\"@typescript-eslint/parser\",\n\t\t\"eslint\",\n\t\t\"eslint-config-prettier\",\n\t\t\"eslint-plugin-deprecation\",\n\t\t\"eslint-plugin-eslint-comments\",\n\t\t\"eslint-plugin-import\",\n\t\t\"eslint-plugin-jsdoc\",\n\t\t\"eslint-plugin-n\",\n\t\t\"eslint-plugin-regexp\",\n\t\t\"husky\",\n\t\t\"lint-staged\",\n\t\t\"prettier\",\n\t\t\"prettier-plugin-curly\",\n\t\t\"prettier-plugin-packagejson\",\n\t\t\"tsup\",\n\t\t\"typescript\",\n\t\t...(options.excludeContributors ? [] : [\"all-contributors-cli\"]),\n\t\t...(options.excludeLintJson\n\t\t\t? []\n\t\t\t: [\"eslint-plugin-jsonc\", \"jsonc-eslint-parser\"]),\n\t\t...(options.excludeLintKnip ? [] : [\"knip\"]),\n\t\t...(options.excludeLintMd\n\t\t\t? []\n\t\t\t: [\n\t\t\t\t\t\"eslint-plugin-markdown\",\n\t\t\t\t\t\"markdownlint\",\n\t\t\t\t\t\"markdownlint-cli\",\n\t\t\t\t\t\"sentences-per-line\",\n\t\t\t ]),\n\t\t...(options.excludeLintPackageJson\n\t\t\t? []\n\t\t\t: [\"npm-package-json-lint\", \"npm-package-json-lint-config-default\"]),\n\t\t...(options.excludeLintPerfectionist\n\t\t\t? []\n\t\t\t: [\"eslint-plugin-perfectionist\"]),\n\t\t...(options.excludeLintSpelling ? [] : [\"cspell\"]),\n\t\t...(options.excludeLintYml\n\t\t\t? []\n\t\t\t: [\"eslint-plugin-yml\", \"yaml-eslint-parser\"]),\n\t\t...(options.excludeReleases\n\t\t\t? []\n\t\t\t: [\n\t\t\t\t\t\"@release-it/conventional-changelog\",\n\t\t\t\t\t\"release-it\",\n\t\t\t\t\t\"should-semantic-release\",\n\t\t\t ]),\n\t\t...(options.excludeTests\n\t\t\t? []\n\t\t\t: [\n\t\t\t\t\t\"@vitest/coverage-v8\",\n\t\t\t\t\t\"console-fail-test\",\n\t\t\t\t\t\"eslint-plugin-no-only-tests\",\n\t\t\t\t\t\"eslint-plugin-vitest\",\n\t\t\t\t\t\"vitest\",\n\t\t\t ]),\n\t]\n\t\t.filter(Boolean)\n\t\t.sort()\n\t\t.map((packageName) => `${packageName}@latest`)\n\t\t.join(\" \");\n\n\tawait execaCommand(`pnpm add ${devDependencies} -D`);\n\n\tif (!options.excludeContributors) {\n\t\tawait execaCommand(`npx all-contributors-cli generate`);\n\t\tawait removeDependencies(\n\t\t\t[\"all-contributors-cli\", \"all-contributors-for-repository\"],\n\t\t\t(await readPackageData()).devDependencies,\n\t\t\t\"-D\",\n\t\t);\n\t}\n\n\tawait execaCommand(\"pnpm run format:write\");\n}\n"],"mappings":"AAAA,SAAS,oBAAoB;AAE7B,SAAS,iBAAiB,0BAA0B;AAGpD,eAAsB,qBAAqB,SAAkB;AAC5D,QAAM,kBAAkB;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAI,QAAQ,sBAAsB,CAAC,IAAI,CAAC,sBAAsB;AAAA,IAC9D,GAAI,QAAQ,kBACT,CAAC,IACD,CAAC,uBAAuB,qBAAqB;AAAA,IAChD,GAAI,QAAQ,kBAAkB,CAAC,IAAI,CAAC,MAAM;AAAA,IAC1C,GAAI,QAAQ,gBACT,CAAC,IACD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACA;AAAA,IACH,GAAI,QAAQ,yBACT,CAAC,IACD,CAAC,yBAAyB,sCAAsC;AAAA,IACnE,GAAI,QAAQ,2BACT,CAAC,IACD,CAAC,6BAA6B;AAAA,IACjC,GAAI,QAAQ,sBAAsB,CAAC,IAAI,CAAC,QAAQ;AAAA,IAChD,GAAI,QAAQ,iBACT,CAAC,IACD,CAAC,qBAAqB,oBAAoB;AAAA,IAC7C,GAAI,QAAQ,kBACT,CAAC,IACD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACA;AAAA,IACH,GAAI,QAAQ,eACT,CAAC,IACD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACA;AAAA,EACJ,EACE,OAAO,OAAO,EACd,KAAK,EACL,IAAI,CAAC,gBAAgB,GAAG,WAAW,SAAS,EAC5C,KAAK,GAAG;AAEV,QAAM,aAAa,YAAY,eAAe,KAAK;AAEnD,MAAI,CAAC,QAAQ,qBAAqB;AACjC,UAAM,aAAa,mCAAmC;AACtD,UAAM;AAAA,MACL,CAAC,wBAAwB,iCAAiC;AAAA,OACzD,MAAM,gBAAgB,GAAG;AAAA,MAC1B;AAAA,IACD;AAAA,EACD;AAEA,QAAM,aAAa,uBAAuB;AAC3C;","names":[]}
|
|
@@ -77,6 +77,15 @@ async function createRootFiles(options) {
|
|
|
77
77
|
autoGenerate: true,
|
|
78
78
|
release: true,
|
|
79
79
|
releaseName: "v${version}"
|
|
80
|
+
},
|
|
81
|
+
npm: {
|
|
82
|
+
publishArgs: ["--provenance"]
|
|
83
|
+
},
|
|
84
|
+
plugins: {
|
|
85
|
+
"@release-it/conventional-changelog": {
|
|
86
|
+
infile: "CHANGELOG.md",
|
|
87
|
+
preset: "angular"
|
|
88
|
+
}
|
|
80
89
|
}
|
|
81
90
|
})
|
|
82
91
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/writing/creation/rootFiles.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { createESLintRC } from \"./createESLintRC.js\";\nimport { formatIgnoreFile } from \"./formatters/formatIgnoreFile.js\";\nimport { formatJson } from \"./formatters/formatJson.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\nimport { writeAllContributorsRC } from \"./writeAllContributorsRC.js\";\nimport { writePackageJson } from \"./writePackageJson.js\";\n\nexport async function createRootFiles(options: Options) {\n\treturn {\n\t\t\".all-contributorsrc\": await writeAllContributorsRC(options),\n\t\t\".eslintignore\": formatIgnoreFile(\n\t\t\t[\n\t\t\t\t\"!.*\",\n\t\t\t\t...(options.excludeTests ? [] : [\"coverage\"]),\n\t\t\t\t\"lib\",\n\t\t\t\t\"node_modules\",\n\t\t\t\t\"pnpm-lock.yaml\",\n\t\t\t].filter(Boolean),\n\t\t),\n\t\t\".eslintrc.cjs\": await createESLintRC(options),\n\t\t\".gitignore\": formatIgnoreFile([\n\t\t\t...(options.excludeTests ? [] : [\"coverage/\"]),\n\t\t\t\"lib/\",\n\t\t\t\"node_modules/\",\n\t\t]),\n\t\t...(!options.excludeLintMd && {\n\t\t\t\".markdownlint.json\": await formatJson({\n\t\t\t\textends: \"markdownlint/style/prettier\",\n\t\t\t\t\"first-line-h1\": false,\n\t\t\t\t\"no-inline-html\": false,\n\t\t\t}),\n\t\t\t\".markdownlintignore\": formatIgnoreFile([\n\t\t\t\t\".github/CODE_OF_CONDUCT.md\",\n\t\t\t\t\"CHANGELOG.md\",\n\t\t\t\t\"lib/\",\n\t\t\t\t\"node_modules/\",\n\t\t\t]),\n\t\t}),\n\t\t...(!options.excludeLintPackageJson && {\n\t\t\t\".npmpackagejsonlintrc.json\": await formatJson({\n\t\t\t\textends: \"npm-package-json-lint-config-default\",\n\t\t\t\trules: {\n\t\t\t\t\t\"require-description\": \"error\",\n\t\t\t\t\t\"require-license\": \"error\",\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\t\".nvmrc\": `18.17.1\\n`,\n\t\t\".prettierignore\": formatIgnoreFile([\n\t\t\t...(options.excludeContributors ? [] : [\".all-contributorsrc\"]),\n\t\t\t...(options.excludeTests ? [] : [\"coverage/\"]),\n\t\t\t\"lib/\",\n\t\t\t\"pnpm-lock.yaml\",\n\t\t]),\n\t\t\".prettierrc\": await formatJson({\n\t\t\t$schema: \"http://json.schemastore.org/prettierrc\",\n\t\t\toverrides: [\n\t\t\t\t{\n\t\t\t\t\tfiles: \".*rc\",\n\t\t\t\t\toptions: { parser: \"json\" },\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfiles: \".nvmrc\",\n\t\t\t\t\toptions: { parser: \"yaml\" },\n\t\t\t\t},\n\t\t\t],\n\t\t\tplugins: [\"prettier-plugin-curly\", \"prettier-plugin-packagejson\"],\n\t\t\tuseTabs: true,\n\t\t}),\n\t\t...(!options.excludeReleases && {\n\t\t\t\".release-it.json\": await formatJson({\n\t\t\t\tgit: {\n\t\t\t\t\tcommitMessage: \"chore: release v${version}\",\n\t\t\t\t\trequireCommits: true,\n\t\t\t\t},\n\t\t\t\tgithub: {\n\t\t\t\t\tautoGenerate: true,\n\t\t\t\t\trelease: true,\n\t\t\t\t\treleaseName: \"v${version}\",\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\t\"LICENSE.md\": `# MIT License\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n`,\n\t\t...(!options.excludeLintSpelling && {\n\t\t\t\"cspell.json\": await formatJson({\n\t\t\t\tdictionaries: [\"typescript\"],\n\t\t\t\tignorePaths: [\n\t\t\t\t\t\".github\",\n\t\t\t\t\t\"CHANGELOG.md\",\n\t\t\t\t\t...(options.excludeTests ? [] : [\"coverage\"]),\n\t\t\t\t\t\"lib\",\n\t\t\t\t\t\"node_modules\",\n\t\t\t\t\t\"pnpm-lock.yaml\",\n\t\t\t\t],\n\t\t\t\twords: [\n\t\t\t\t\t\"Codecov\",\n\t\t\t\t\t\"codespace\",\n\t\t\t\t\t\"commitlint\",\n\t\t\t\t\t\"contributorsrc\",\n\t\t\t\t\t\"conventionalcommits\",\n\t\t\t\t\t...(options.excludeLintKnip ? [] : [\"knip\"]),\n\t\t\t\t\t\"lcov\",\n\t\t\t\t\t\"markdownlintignore\",\n\t\t\t\t\t\"npmpackagejsonlintrc\",\n\t\t\t\t\t\"outro\",\n\t\t\t\t\t\"packagejson\",\n\t\t\t\t\t\"tsup\",\n\t\t\t\t\t\"quickstart\",\n\t\t\t\t\t\"wontfix\",\n\t\t\t\t].sort(),\n\t\t\t}),\n\t\t}),\n\t\t...(!options.excludeLintKnip && {\n\t\t\t\"knip.jsonc\": await formatJson({\n\t\t\t\t$schema: \"https://unpkg.com/knip@latest/schema.json\",\n\t\t\t\tentry: [\"src/index.ts!\"],\n\t\t\t\tignoreExportsUsedInFile: {\n\t\t\t\t\tinterface: true,\n\t\t\t\t\ttype: true,\n\t\t\t\t},\n\t\t\t\tproject: [\"src/**/*.ts!\"],\n\t\t\t}),\n\t\t}),\n\t\t\"package.json\": await writePackageJson(options),\n\t\t\"tsconfig.eslint.json\": await formatJson({\n\t\t\textends: \"./tsconfig.json\",\n\t\t\tinclude: [\".\"],\n\t\t}),\n\t\t\"tsconfig.json\": await formatJson({\n\t\t\tcompilerOptions: {\n\t\t\t\tdeclaration: true,\n\t\t\t\tdeclarationMap: true,\n\t\t\t\tesModuleInterop: true,\n\t\t\t\tmodule: \"NodeNext\",\n\t\t\t\tmoduleResolution: \"NodeNext\",\n\t\t\t\toutDir: \"lib\",\n\t\t\t\tresolveJsonModule: true,\n\t\t\t\tskipLibCheck: true,\n\t\t\t\tsourceMap: true,\n\t\t\t\tstrict: true,\n\t\t\t\ttarget: \"ES2022\",\n\t\t\t},\n\t\t\tinclude: [\"src\"],\n\t\t}),\n\t\t\"tsup.config.ts\":\n\t\t\tawait formatTypeScript(`import { defineConfig } from \"tsup\";\n\n\t\texport default defineConfig({\n\t\t\tbundle: false,\n\t\t\tclean: true,\n\t\t\tdts: true,\n\t\t\tentry: [\"src/**/*.ts\"${options.excludeTests ? \"\" : `, \"!src/**/*.test.*\"`}],\n\t\t\tformat: \"esm\",\n\t\t\toutDir: \"lib\",\n\t\t\tsourcemap: true,\n\t\t});\n\t\t`),\n\t\t...(!options.excludeTests && {\n\t\t\t\"vitest.config.ts\": `import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n\ttest: {\n\t\tclearMocks: true,\n\t\tcoverage: {\n\t\t\tall: true,\n\t\t\texclude: [\"lib\"],\n\t\t\tinclude: [\"src\"],\n\t\t\treporter: [\"html\", \"lcov\"],\n\t\t},\n\t\texclude: [\"lib\", \"node_modules\"],\n\t\tsetupFiles: [\"console-fail-test/setup\"],\n\t},\n});\n`,\n\t\t}),\n\t};\n}\n"],"mappings":"AACA,SAAS,sBAAsB;AAC/B,SAA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C,eAAe;AAAA,QACvB,yBAAyB;AAAA,UACxB,WAAW;AAAA,UACX,MAAM;AAAA,QACP;AAAA,QACA,SAAS,CAAC,cAAc;AAAA,MACzB,CAAC;AAAA,IACF;AAAA,IACA,gBAAgB,MAAM,iBAAiB,OAAO;AAAA,IAC9C,wBAAwB,MAAM,WAAW;AAAA,MACxC,SAAS;AAAA,MACT,SAAS,CAAC,GAAG;AAAA,IACd,CAAC;AAAA,IACD,iBAAiB,MAAM,WAAW;AAAA,MACjC,iBAAiB;AAAA,QAChB,aAAa;AAAA,QACb,gBAAgB;AAAA,QAChB,iBAAiB;AAAA,QACjB,QAAQ;AAAA,QACR,kBAAkB;AAAA,QAClB,QAAQ;AAAA,QACR,mBAAmB;AAAA,QACnB,cAAc;AAAA,QACd,WAAW;AAAA,QACX,QAAQ;AAAA,QACR,QAAQ;AAAA,MACT;AAAA,MACA,SAAS,CAAC,KAAK;AAAA,IAChB,CAAC;AAAA,IACD,kBACC,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAMA,QAAQ,eAAe,KAAK,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA,GAKzE;AAAA,IACD,GAAI,CAAC,QAAQ,gBAAgB;AAAA,MAC5B,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgBrB;AAAA,EACD;AACD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/writing/creation/rootFiles.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { createESLintRC } from \"./createESLintRC.js\";\nimport { formatIgnoreFile } from \"./formatters/formatIgnoreFile.js\";\nimport { formatJson } from \"./formatters/formatJson.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\nimport { writeAllContributorsRC } from \"./writeAllContributorsRC.js\";\nimport { writePackageJson } from \"./writePackageJson.js\";\n\nexport async function createRootFiles(options: Options) {\n\treturn {\n\t\t\".all-contributorsrc\": await writeAllContributorsRC(options),\n\t\t\".eslintignore\": formatIgnoreFile(\n\t\t\t[\n\t\t\t\t\"!.*\",\n\t\t\t\t...(options.excludeTests ? [] : [\"coverage\"]),\n\t\t\t\t\"lib\",\n\t\t\t\t\"node_modules\",\n\t\t\t\t\"pnpm-lock.yaml\",\n\t\t\t].filter(Boolean),\n\t\t),\n\t\t\".eslintrc.cjs\": await createESLintRC(options),\n\t\t\".gitignore\": formatIgnoreFile([\n\t\t\t...(options.excludeTests ? [] : [\"coverage/\"]),\n\t\t\t\"lib/\",\n\t\t\t\"node_modules/\",\n\t\t]),\n\t\t...(!options.excludeLintMd && {\n\t\t\t\".markdownlint.json\": await formatJson({\n\t\t\t\textends: \"markdownlint/style/prettier\",\n\t\t\t\t\"first-line-h1\": false,\n\t\t\t\t\"no-inline-html\": false,\n\t\t\t}),\n\t\t\t\".markdownlintignore\": formatIgnoreFile([\n\t\t\t\t\".github/CODE_OF_CONDUCT.md\",\n\t\t\t\t\"CHANGELOG.md\",\n\t\t\t\t\"lib/\",\n\t\t\t\t\"node_modules/\",\n\t\t\t]),\n\t\t}),\n\t\t...(!options.excludeLintPackageJson && {\n\t\t\t\".npmpackagejsonlintrc.json\": await formatJson({\n\t\t\t\textends: \"npm-package-json-lint-config-default\",\n\t\t\t\trules: {\n\t\t\t\t\t\"require-description\": \"error\",\n\t\t\t\t\t\"require-license\": \"error\",\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\t\".nvmrc\": `18.17.1\\n`,\n\t\t\".prettierignore\": formatIgnoreFile([\n\t\t\t...(options.excludeContributors ? [] : [\".all-contributorsrc\"]),\n\t\t\t...(options.excludeTests ? [] : [\"coverage/\"]),\n\t\t\t\"lib/\",\n\t\t\t\"pnpm-lock.yaml\",\n\t\t]),\n\t\t\".prettierrc\": await formatJson({\n\t\t\t$schema: \"http://json.schemastore.org/prettierrc\",\n\t\t\toverrides: [\n\t\t\t\t{\n\t\t\t\t\tfiles: \".*rc\",\n\t\t\t\t\toptions: { parser: \"json\" },\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfiles: \".nvmrc\",\n\t\t\t\t\toptions: { parser: \"yaml\" },\n\t\t\t\t},\n\t\t\t],\n\t\t\tplugins: [\"prettier-plugin-curly\", \"prettier-plugin-packagejson\"],\n\t\t\tuseTabs: true,\n\t\t}),\n\t\t...(!options.excludeReleases && {\n\t\t\t\".release-it.json\": await formatJson({\n\t\t\t\tgit: {\n\t\t\t\t\tcommitMessage: \"chore: release v${version}\",\n\t\t\t\t\trequireCommits: true,\n\t\t\t\t},\n\t\t\t\tgithub: {\n\t\t\t\t\tautoGenerate: true,\n\t\t\t\t\trelease: true,\n\t\t\t\t\treleaseName: \"v${version}\",\n\t\t\t\t},\n\t\t\t\tnpm: {\n\t\t\t\t\tpublishArgs: [\"--provenance\"],\n\t\t\t\t},\n\t\t\t\tplugins: {\n\t\t\t\t\t\"@release-it/conventional-changelog\": {\n\t\t\t\t\t\tinfile: \"CHANGELOG.md\",\n\t\t\t\t\t\tpreset: \"angular\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\t\"LICENSE.md\": `# MIT License\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n`,\n\t\t...(!options.excludeLintSpelling && {\n\t\t\t\"cspell.json\": await formatJson({\n\t\t\t\tdictionaries: [\"typescript\"],\n\t\t\t\tignorePaths: [\n\t\t\t\t\t\".github\",\n\t\t\t\t\t\"CHANGELOG.md\",\n\t\t\t\t\t...(options.excludeTests ? [] : [\"coverage\"]),\n\t\t\t\t\t\"lib\",\n\t\t\t\t\t\"node_modules\",\n\t\t\t\t\t\"pnpm-lock.yaml\",\n\t\t\t\t],\n\t\t\t\twords: [\n\t\t\t\t\t\"Codecov\",\n\t\t\t\t\t\"codespace\",\n\t\t\t\t\t\"commitlint\",\n\t\t\t\t\t\"contributorsrc\",\n\t\t\t\t\t\"conventionalcommits\",\n\t\t\t\t\t...(options.excludeLintKnip ? [] : [\"knip\"]),\n\t\t\t\t\t\"lcov\",\n\t\t\t\t\t\"markdownlintignore\",\n\t\t\t\t\t\"npmpackagejsonlintrc\",\n\t\t\t\t\t\"outro\",\n\t\t\t\t\t\"packagejson\",\n\t\t\t\t\t\"tsup\",\n\t\t\t\t\t\"quickstart\",\n\t\t\t\t\t\"wontfix\",\n\t\t\t\t].sort(),\n\t\t\t}),\n\t\t}),\n\t\t...(!options.excludeLintKnip && {\n\t\t\t\"knip.jsonc\": await formatJson({\n\t\t\t\t$schema: \"https://unpkg.com/knip@latest/schema.json\",\n\t\t\t\tentry: [\"src/index.ts!\"],\n\t\t\t\tignoreExportsUsedInFile: {\n\t\t\t\t\tinterface: true,\n\t\t\t\t\ttype: true,\n\t\t\t\t},\n\t\t\t\tproject: [\"src/**/*.ts!\"],\n\t\t\t}),\n\t\t}),\n\t\t\"package.json\": await writePackageJson(options),\n\t\t\"tsconfig.eslint.json\": await formatJson({\n\t\t\textends: \"./tsconfig.json\",\n\t\t\tinclude: [\".\"],\n\t\t}),\n\t\t\"tsconfig.json\": await formatJson({\n\t\t\tcompilerOptions: {\n\t\t\t\tdeclaration: true,\n\t\t\t\tdeclarationMap: true,\n\t\t\t\tesModuleInterop: true,\n\t\t\t\tmodule: \"NodeNext\",\n\t\t\t\tmoduleResolution: \"NodeNext\",\n\t\t\t\toutDir: \"lib\",\n\t\t\t\tresolveJsonModule: true,\n\t\t\t\tskipLibCheck: true,\n\t\t\t\tsourceMap: true,\n\t\t\t\tstrict: true,\n\t\t\t\ttarget: \"ES2022\",\n\t\t\t},\n\t\t\tinclude: [\"src\"],\n\t\t}),\n\t\t\"tsup.config.ts\":\n\t\t\tawait formatTypeScript(`import { defineConfig } from \"tsup\";\n\n\t\texport default defineConfig({\n\t\t\tbundle: false,\n\t\t\tclean: true,\n\t\t\tdts: true,\n\t\t\tentry: [\"src/**/*.ts\"${options.excludeTests ? \"\" : `, \"!src/**/*.test.*\"`}],\n\t\t\tformat: \"esm\",\n\t\t\toutDir: \"lib\",\n\t\t\tsourcemap: true,\n\t\t});\n\t\t`),\n\t\t...(!options.excludeTests && {\n\t\t\t\"vitest.config.ts\": `import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n\ttest: {\n\t\tclearMocks: true,\n\t\tcoverage: {\n\t\t\tall: true,\n\t\t\texclude: [\"lib\"],\n\t\t\tinclude: [\"src\"],\n\t\t\treporter: [\"html\", \"lcov\"],\n\t\t},\n\t\texclude: [\"lib\", \"node_modules\"],\n\t\tsetupFiles: [\"console-fail-test/setup\"],\n\t},\n});\n`,\n\t\t}),\n\t};\n}\n"],"mappings":"AACA,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC,SAAS,kBAAkB;AAC3B,SAAS,wBAAwB;AACjC,SAAS,8BAA8B;AACvC,SAAS,wBAAwB;AAEjC,eAAsB,gBAAgB,SAAkB;AACvD,SAAO;AAAA,IACN,uBAAuB,MAAM,uBAAuB,OAAO;AAAA,IAC3D,iBAA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B,WAAW;AAAA,UACX,MAAM;AAAA,QACP;AAAA,QACA,SAAS,CAAC,cAAc;AAAA,MACzB,CAAC;AAAA,IACF;AAAA,IACA,gBAAgB,MAAM,iBAAiB,OAAO;AAAA,IAC9C,wBAAwB,MAAM,WAAW;AAAA,MACxC,SAAS;AAAA,MACT,SAAS,CAAC,GAAG;AAAA,IACd,CAAC;AAAA,IACD,iBAAiB,MAAM,WAAW;AAAA,MACjC,iBAAiB;AAAA,QAChB,aAAa;AAAA,QACb,gBAAgB;AAAA,QAChB,iBAAiB;AAAA,QACjB,QAAQ;AAAA,QACR,kBAAkB;AAAA,QAClB,QAAQ;AAAA,QACR,mBAAmB;AAAA,QACnB,cAAc;AAAA,QACd,WAAW;AAAA,QACX,QAAQ;AAAA,QACR,QAAQ;AAAA,MACT;AAAA,MACA,SAAS,CAAC,KAAK;AAAA,IAChB,CAAC;AAAA,IACD,kBACC,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAMA,QAAQ,eAAe,KAAK,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA,GAKzE;AAAA,IACD,GAAI,CAAC,QAAQ,gBAAgB;AAAA,MAC5B,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgBrB;AAAA,EACD;AACD;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-typescript-app",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.30.0",
|
|
4
4
|
"description": "Quickstart-friendly TypeScript template with comprehensive formatting, linting, releases, testing, and other great tooling built-in. ✨",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@octokit/request-error": "^5.0.0",
|
|
65
|
+
"@release-it/conventional-changelog": "^7.0.1",
|
|
65
66
|
"@types/eslint": "^8.44.2",
|
|
66
67
|
"@types/git-url-parse": "^9.0.1",
|
|
67
68
|
"@types/js-yaml": "^4.0.5",
|
|
@@ -90,7 +91,7 @@
|
|
|
90
91
|
"globby": "^13.2.2",
|
|
91
92
|
"husky": "^8.0.3",
|
|
92
93
|
"jsonc-eslint-parser": "^2.3.0",
|
|
93
|
-
"knip": "2.
|
|
94
|
+
"knip": "2.25.1",
|
|
94
95
|
"lint-staged": "^14.0.1",
|
|
95
96
|
"markdownlint": "^0.31.0",
|
|
96
97
|
"markdownlint-cli": "^0.36.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/shared/options/readGitAndNpmDefaults/index.ts"],"sourcesContent":["import { $ } from \"execa\";\nimport gitRemoteOriginUrl from \"git-remote-origin-url\";\nimport gitUrlParse from \"git-url-parse\";\nimport lazyValue from \"lazy-value\";\nimport fs from \"node:fs/promises\";\nimport npmUser from \"npm-user\";\n\nimport { readPackageData } from \"../../packages.js\";\nimport { tryCatchAsync } from \"../../tryCatchAsync.js\";\nimport { tryCatchLazyValueAsync } from \"../../tryCatchLazyValueAsync.js\";\nimport { parsePackageAuthor } from \"./parsePackageAuthor.js\";\nimport { readTitleFromReadme } from \"./readTitleFromReadme.js\";\n\nexport function getGitAndNpmDefaults() {\n\tconst gitDefaults = tryCatchLazyValueAsync(async () =>\n\t\tgitUrlParse(await gitRemoteOriginUrl()),\n\t);\n\n\tconst npmDefaults = tryCatchLazyValueAsync(\n\t\tasync () => await npmUser((await $`npm whoami`).stdout),\n\t);\n\n\tconst packageData = lazyValue(readPackageData);\n\tconst packageAuthor = lazyValue(async () =>\n\t\tparsePackageAuthor(await packageData()),\n\t);\n\n\treturn {\n\t\tauthor: async () => (await packageAuthor()).author ?? npmDefaults.name,\n\t\tdescription: async () => (await packageData()).description,\n\t\temail: async () =>\n\t\t\t(await npmDefaults())?.email ??\n\t\t\t(await packageAuthor()).email ??\n\t\t\t(await tryCatchAsync(\n\t\t\t\tasync () => (await $`git config --get user.email`).stdout,\n\t\t\t)),\n\t\tfunding: async () =>\n\t\t\tawait tryCatchAsync(\n\t\t\t\tasync () =>\n\t\t\t\t\t(await fs.readFile(\".github/FUNDING.yml\"))\n\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t.split(\":\")[1]\n\t\t\t\t\t\t?.trim(),\n\t\t\t),\n\t\towner: async () =>\n\t\t\t(await gitDefaults())?.organization ?? (await packageAuthor()).author,\n\t\trepository: async () =>\n\t\t\t(await gitDefaults())?.name ?? (await packageData()).name,\n\t\ttitle: async () => await readTitleFromReadme(),\n\t};\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAClB,OAAO,wBAAwB;AAC/B,OAAO,iBAAiB;AACxB,OAAO,eAAe;AACtB,OAAO,QAAQ;AACf,OAAO,aAAa;AAEpB,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,8BAA8B;AACvC,SAAS,0BAA0B;AACnC,SAAS,2BAA2B;AAE7B,SAAS,uBAAuB;AACtC,QAAM,cAAc;AAAA,IAAuB,YAC1C,YAAY,MAAM,mBAAmB,CAAC;AAAA,EACvC;AAEA,QAAM,cAAc;AAAA,IACnB,YAAY,MAAM,SAAS,MAAM,eAAe,MAAM;AAAA,EACvD;AAEA,QAAM,cAAc,UAAU,eAAe;AAC7C,QAAM,gBAAgB;AAAA,IAAU,YAC/B,mBAAmB,MAAM,YAAY,CAAC;AAAA,EACvC;AAEA,SAAO;AAAA,IACN,QAAQ,aAAa,MAAM,cAAc,GAAG,UAAU,YAAY;AAAA,IAClE,aAAa,aAAa,MAAM,YAAY,GAAG;AAAA,IAC/C,OAAO,aACL,MAAM,YAAY,IAAI,UACtB,MAAM,cAAc,GAAG,SACvB,MAAM;AAAA,MACN,aAAa,MAAM,gCAAgC;AAAA,IACpD;AAAA,IACD,SAAS,YACR,MAAM;AAAA,MACL,aACE,MAAM,GAAG,SAAS,qBAAqB,GACtC,SAAS,EACT,MAAM,GAAG,EAAE,CAAC,GACX,KAAK;AAAA,IACV;AAAA,IACD,OAAO,aACL,MAAM,YAAY,IAAI,iBAAiB,MAAM,cAAc,GAAG;AAAA,IAChE,YAAY,aACV,MAAM,YAAY,IAAI,SAAS,MAAM,YAAY,GAAG;AAAA,IACtD,OAAO,YAAY,MAAM,oBAAoB;AAAA,EAC9C;AACD;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/shared/options/readGitAndNpmDefaults/parsePackageAuthor.ts"],"sourcesContent":["import { PartialPackageData } from \"../../types.js\";\n\nexport function parsePackageAuthor(packageData: PartialPackageData) {\n\tconst [packageAuthor, packageEmail] =\n\t\ttypeof packageData.author === \"string\"\n\t\t\t? [\n\t\t\t\t\tpackageData.author.split(\"<\")[0].trim(),\n\t\t\t\t\tpackageData.author.split(/<|>/)[1]?.trim(),\n\t\t\t ]\n\t\t\t: [packageData.author?.name, packageData.author?.email];\n\n\treturn {\n\t\tauthor: packageAuthor,\n\t\temail: packageEmail,\n\t};\n}\n"],"mappings":"AAEO,SAAS,mBAAmB,aAAiC;AACnE,QAAM,CAAC,eAAe,YAAY,IACjC,OAAO,YAAY,WAAW,WAC3B;AAAA,IACA,YAAY,OAAO,MAAM,GAAG,EAAE,CAAC,EAAE,KAAK;AAAA,IACtC,YAAY,OAAO,MAAM,KAAK,EAAE,CAAC,GAAG,KAAK;AAAA,EACzC,IACA,CAAC,YAAY,QAAQ,MAAM,YAAY,QAAQ,KAAK;AAExD,SAAO;AAAA,IACN,QAAQ;AAAA,IACR,OAAO;AAAA,EACR;AACD;","names":[]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { readFileSafe } from "../../readFileSafe.js";
|
|
2
|
-
async function readTitleFromReadme() {
|
|
3
|
-
return (await readFileSafe("./README.md", "")).match(/^(?:# |<h1\s+align="center">)(.*?)(?:<\/h1>)?$/i)?.[1]?.trim().replace(/<[^>]+(?:>|$)/g, "");
|
|
4
|
-
}
|
|
5
|
-
export {
|
|
6
|
-
readTitleFromReadme
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=readTitleFromReadme.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/shared/options/readGitAndNpmDefaults/readTitleFromReadme.ts"],"sourcesContent":["import { readFileSafe } from \"../../readFileSafe.js\";\n\nexport async function readTitleFromReadme() {\n\treturn (await readFileSafe(\"./README.md\", \"\"))\n\t\t.match(/^(?:# |<h1\\s+align=\"center\">)(.*?)(?:<\\/h1>)?$/i)?.[1]\n\t\t?.trim()\n\t\t.replace(/<[^>]+(?:>|$)/g, \"\");\n}\n"],"mappings":"AAAA,SAAS,oBAAoB;AAE7B,eAAsB,sBAAsB;AAC3C,UAAQ,MAAM,aAAa,eAAe,EAAE,GAC1C,MAAM,iDAAiD,IAAI,CAAC,GAC3D,KAAK,EACN,QAAQ,kBAAkB,EAAE;AAC/B;","names":[]}
|
/package/lib/shared/options/{readGitAndNpmDefaults → readOptionDefaults}/parsePackageAuthor.d.ts
RENAMED
|
File without changes
|
/package/lib/shared/options/{readGitAndNpmDefaults → readOptionDefaults}/parsePackageAuthor.js
RENAMED
|
File without changes
|