create-typescript-app 1.31.0 → 1.33.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 +35 -32
- package/lib/bin/index.js +4 -4
- package/lib/bin/index.js.map +1 -1
- package/lib/bin/promptForMode.d.ts +11 -0
- package/lib/bin/promptForMode.js +102 -0
- package/lib/bin/promptForMode.js.map +1 -0
- package/lib/create/createAndEnterGitDirectory.d.ts +3 -0
- package/lib/create/createAndEnterGitDirectory.js +19 -0
- package/lib/create/createAndEnterGitDirectory.js.map +1 -0
- package/lib/create/createRerunSuggestion.d.ts +1 -2
- package/lib/create/createRerunSuggestion.js +10 -4
- package/lib/create/createRerunSuggestion.js.map +1 -1
- package/lib/create/createWithOptions.d.ts +1 -0
- package/lib/create/createWithOptions.js +6 -9
- package/lib/create/createWithOptions.js.map +1 -1
- package/lib/create/index.d.ts +2 -3
- package/lib/create/index.js +14 -17
- package/lib/create/index.js.map +1 -1
- package/lib/initialize/index.d.ts +1 -2
- package/lib/initialize/index.js +5 -5
- package/lib/initialize/index.js.map +1 -1
- package/lib/initialize/initializeWithOptions.d.ts +1 -0
- package/lib/initialize/initializeWithOptions.js +4 -4
- package/lib/initialize/initializeWithOptions.js.map +1 -1
- package/lib/migrate/index.d.ts +1 -2
- package/lib/migrate/index.js +6 -3
- package/lib/migrate/index.js.map +1 -1
- package/lib/migrate/migrateWithOptions.d.ts +1 -0
- package/lib/migrate/migrateWithOptions.js +3 -3
- package/lib/migrate/migrateWithOptions.js.map +1 -1
- package/lib/shared/cli/outro.d.ts +4 -3
- package/lib/shared/cli/outro.js +2 -2
- package/lib/shared/cli/outro.js.map +1 -1
- package/lib/shared/generateNextSteps.d.ts +8 -0
- package/lib/shared/generateNextSteps.js +60 -0
- package/lib/shared/generateNextSteps.js.map +1 -0
- package/lib/shared/getGitHubUserAsAllContributor.d.ts +5 -1
- package/lib/shared/getGitHubUserAsAllContributor.js +11 -3
- package/lib/shared/getGitHubUserAsAllContributor.js.map +1 -1
- package/lib/shared/options/args.d.ts +21 -5
- package/lib/shared/options/args.js +7 -2
- package/lib/shared/options/args.js.map +1 -1
- package/lib/shared/options/augmentOptionsWithExcludes.d.ts +2 -0
- package/lib/shared/options/augmentOptionsWithExcludes.js +4 -4
- package/lib/shared/options/augmentOptionsWithExcludes.js.map +1 -1
- package/lib/shared/options/{readOptionDefaults → createOptionDefaults}/index.d.ts +6 -2
- package/lib/shared/options/{readOptionDefaults → createOptionDefaults}/index.js +3 -3
- package/lib/shared/options/createOptionDefaults/index.js.map +1 -0
- package/lib/shared/options/{readOptionDefaults → createOptionDefaults}/parsePackageAuthor.d.ts +2 -0
- package/lib/shared/options/createOptionDefaults/parsePackageAuthor.js.map +1 -0
- package/lib/shared/options/createOptionDefaults/readDefaultsFromReadme.js.map +1 -0
- package/lib/shared/options/ensureRepositoryExists.d.ts +3 -1
- package/lib/shared/options/ensureRepositoryExists.js +2 -1
- package/lib/shared/options/ensureRepositoryExists.js.map +1 -1
- package/lib/shared/options/getPrefillOrPromptedOption.d.ts +1 -1
- package/lib/shared/options/getPrefillOrPromptedOption.js +1 -4
- package/lib/shared/options/getPrefillOrPromptedOption.js.map +1 -1
- package/lib/shared/options/optionsSchema.d.ts +28 -8
- package/lib/shared/options/optionsSchema.js +7 -2
- package/lib/shared/options/optionsSchema.js.map +1 -1
- package/lib/shared/options/readOptions.d.ts +3 -2
- package/lib/shared/options/readOptions.js +15 -15
- package/lib/shared/options/readOptions.js.map +1 -1
- package/lib/shared/packages.d.ts +2 -0
- package/lib/shared/types.d.ts +41 -9
- package/lib/steps/addOwnerAsAllContributor.d.ts +5 -1
- package/lib/steps/addOwnerAsAllContributor.js +8 -3
- package/lib/steps/addOwnerAsAllContributor.js.map +1 -1
- package/lib/steps/addToolAllContributors.d.ts +5 -1
- package/lib/steps/addToolAllContributors.js +2 -2
- package/lib/steps/addToolAllContributors.js.map +1 -1
- package/lib/steps/detectExistingContributors.d.ts +2 -0
- package/lib/steps/finalizeDependencies.d.ts +2 -0
- package/lib/steps/finalizeDependencies.js +8 -4
- package/lib/steps/finalizeDependencies.js.map +1 -1
- package/lib/steps/initializeGitHubRepository/index.d.ts +2 -0
- package/lib/steps/initializeGitHubRepository/initializeBranchProtectionSettings.d.ts +2 -0
- package/lib/steps/initializeGitHubRepository/labels/outcomeLabels.js +5 -0
- package/lib/steps/initializeGitHubRepository/labels/outcomeLabels.js.map +1 -1
- package/lib/steps/initializeGitRemote.d.ts +2 -0
- package/lib/steps/initializeRepositorySettings.d.ts +2 -0
- package/lib/steps/uninstallPackages.d.ts +1 -1
- package/lib/steps/uninstallPackages.js +2 -2
- package/lib/steps/uninstallPackages.js.map +1 -1
- package/lib/steps/updateAllContributorsTable.d.ts +2 -0
- package/lib/steps/updateLocalFiles.d.ts +1 -2
- package/lib/steps/updateLocalFiles.js +3 -3
- package/lib/steps/updateLocalFiles.js.map +1 -1
- package/lib/steps/writeReadme/findIntroSectionClose.js +1 -1
- package/lib/steps/writeReadme/findIntroSectionClose.js.map +1 -1
- package/lib/steps/writeReadme/generateTopContent.d.ts +2 -0
- package/lib/steps/writeReadme/generateTopContent.js +17 -2
- package/lib/steps/writeReadme/generateTopContent.js.map +1 -1
- package/lib/steps/writeReadme/index.d.ts +2 -0
- package/lib/steps/writeReadme/index.js +1 -1
- package/lib/steps/writeReadme/index.js.map +1 -1
- package/lib/steps/writing/creation/createESLintRC.d.ts +2 -0
- package/lib/steps/writing/creation/createESLintRC.js +10 -1
- package/lib/steps/writing/creation/createESLintRC.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/createDevelopment.d.ts +2 -0
- package/lib/steps/writing/creation/dotGitHub/createDevelopment.js +1 -1
- package/lib/steps/writing/creation/dotGitHub/createDevelopment.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.d.ts +2 -0
- package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.js +7 -7
- package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/{workflows.d.ts → createWorkflows.d.ts} +2 -0
- package/lib/steps/writing/creation/dotGitHub/{workflows.js → createWorkflows.js} +9 -86
- package/lib/steps/writing/creation/dotGitHub/createWorkflows.js.map +1 -0
- package/lib/steps/writing/creation/dotGitHub/index.d.ts +2 -0
- package/lib/steps/writing/creation/dotGitHub/index.js +1 -1
- package/lib/steps/writing/creation/dotGitHub/index.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/issueTemplate.d.ts +2 -0
- package/lib/steps/writing/creation/dotVSCode.d.ts +2 -0
- package/lib/steps/writing/creation/index.d.ts +1 -2
- package/lib/steps/writing/creation/index.js +2 -2
- package/lib/steps/writing/creation/index.js.map +1 -1
- package/lib/steps/writing/creation/rootFiles.d.ts +2 -0
- package/lib/steps/writing/creation/rootFiles.js +3 -2
- package/lib/steps/writing/creation/rootFiles.js.map +1 -1
- package/lib/steps/writing/creation/src.d.ts +2 -0
- package/lib/steps/writing/creation/writeAllContributorsRC.d.ts +2 -0
- package/lib/steps/writing/creation/writeAllContributorsRC.js +1 -1
- package/lib/steps/writing/creation/writeAllContributorsRC.js.map +1 -1
- package/lib/steps/writing/creation/writePackageJson.d.ts +2 -0
- package/lib/steps/writing/creation/writePackageJson.js +2 -1
- package/lib/steps/writing/creation/writePackageJson.js.map +1 -1
- package/lib/steps/writing/writeStructure.d.ts +1 -2
- package/lib/steps/writing/writeStructure.js +2 -2
- package/lib/steps/writing/writeStructure.js.map +1 -1
- package/package.json +5 -6
- package/lib/bin/mode.d.ts +0 -14
- package/lib/bin/mode.js +0 -50
- package/lib/bin/mode.js.map +0 -1
- package/lib/create/createAndEnterRepository.d.ts +0 -3
- package/lib/create/createAndEnterRepository.js +0 -15
- package/lib/create/createAndEnterRepository.js.map +0 -1
- package/lib/shared/options/readOptionDefaults/index.js.map +0 -1
- package/lib/shared/options/readOptionDefaults/parsePackageAuthor.js.map +0 -1
- package/lib/shared/options/readOptionDefaults/readDefaultsFromReadme.js.map +0 -1
- package/lib/steps/writing/creation/dotGitHub/workflows.js.map +0 -1
- /package/lib/shared/options/{readOptionDefaults → createOptionDefaults}/parsePackageAuthor.js +0 -0
- /package/lib/shared/options/{readOptionDefaults → createOptionDefaults}/readDefaultsFromReadme.d.ts +0 -0
- /package/lib/shared/options/{readOptionDefaults → createOptionDefaults}/readDefaultsFromReadme.js +0 -0
|
@@ -2,8 +2,8 @@ import fs from "node:fs/promises";
|
|
|
2
2
|
import prettier from "prettier";
|
|
3
3
|
import { getGitHubUserAsAllContributor } from "../shared/getGitHubUserAsAllContributor.js";
|
|
4
4
|
import { readFileAsJson } from "../shared/readFileAsJson.js";
|
|
5
|
-
async function addOwnerAsAllContributor(
|
|
6
|
-
const user = await getGitHubUserAsAllContributor(
|
|
5
|
+
async function addOwnerAsAllContributor(options) {
|
|
6
|
+
const user = await getGitHubUserAsAllContributor(options);
|
|
7
7
|
const existingContributors = await readFileAsJson(
|
|
8
8
|
"./.all-contributorsrc"
|
|
9
9
|
);
|
|
@@ -13,7 +13,12 @@ async function addOwnerAsAllContributor(owner) {
|
|
|
13
13
|
);
|
|
14
14
|
}
|
|
15
15
|
const contributors = existingContributors.contributors.filter(({ login }) => ["JoshuaKGoldberg", user].includes(login)).map(
|
|
16
|
-
(contributor) => contributor.login === "JoshuaKGoldberg" ? { ...contributor, contributions: ["tool"] } :
|
|
16
|
+
(contributor) => contributor.login === "JoshuaKGoldberg" ? { ...contributor, contributions: ["tool"] } : {
|
|
17
|
+
...contributor,
|
|
18
|
+
contributions: Array.from(
|
|
19
|
+
/* @__PURE__ */ new Set([...contributor.contributions, "tool"])
|
|
20
|
+
)
|
|
21
|
+
}
|
|
17
22
|
);
|
|
18
23
|
if (!contributors.some((contributor) => contributor.login === user)) {
|
|
19
24
|
contributors.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/addOwnerAsAllContributor.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport prettier from \"prettier\";\n\nimport { getGitHubUserAsAllContributor } from \"../shared/getGitHubUserAsAllContributor.js\";\nimport { readFileAsJson } from \"../shared/readFileAsJson.js\";\nimport { AllContributorsData } from \"../shared/types.js\";\n\nexport async function addOwnerAsAllContributor(
|
|
1
|
+
{"version":3,"sources":["../../src/steps/addOwnerAsAllContributor.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport prettier from \"prettier\";\n\nimport { getGitHubUserAsAllContributor } from \"../shared/getGitHubUserAsAllContributor.js\";\nimport { readFileAsJson } from \"../shared/readFileAsJson.js\";\nimport { AllContributorsData, Options } from \"../shared/types.js\";\n\nexport async function addOwnerAsAllContributor(\n\toptions: Pick<Options, \"offline\" | \"owner\">,\n) {\n\tconst user = await getGitHubUserAsAllContributor(options);\n\n\tconst existingContributors = (await readFileAsJson(\n\t\t\"./.all-contributorsrc\",\n\t)) as AllContributorsData;\n\tif (!isValidAllContributorsData(existingContributors)) {\n\t\tthrow new Error(\n\t\t\t`Invalid .all-contributorsrc: ${JSON.stringify(existingContributors)}`,\n\t\t);\n\t}\n\n\tconst contributors = existingContributors.contributors\n\t\t.filter(({ login }) => [\"JoshuaKGoldberg\", user].includes(login))\n\t\t.map((contributor) =>\n\t\t\tcontributor.login === \"JoshuaKGoldberg\"\n\t\t\t\t? { ...contributor, contributions: [\"tool\"] }\n\t\t\t\t: {\n\t\t\t\t\t\t...contributor,\n\t\t\t\t\t\tcontributions: Array.from(\n\t\t\t\t\t\t\tnew Set([...contributor.contributions, \"tool\"]),\n\t\t\t\t\t\t),\n\t\t\t\t },\n\t\t);\n\n\tif (!contributors.some((contributor) => contributor.login === user)) {\n\t\tcontributors.push({\n\t\t\tcontributions: [\"tool\"],\n\t\t\tlogin: user,\n\t\t});\n\t}\n\n\tawait fs.writeFile(\n\t\t\"./.all-contributorsrc\",\n\t\tawait prettier.format(\n\t\t\tJSON.stringify({\n\t\t\t\t...existingContributors,\n\t\t\t\tcontributors,\n\t\t\t}),\n\t\t\t{ parser: \"json\" },\n\t\t),\n\t);\n}\n\nfunction isValidAllContributorsData(\n\tvalue: unknown,\n): value is AllContributorsData {\n\treturn !!value && typeof value === \"object\" && \"contributors\" in value;\n}\n"],"mappings":"AAAA,OAAO,QAAQ;AACf,OAAO,cAAc;AAErB,SAAS,qCAAqC;AAC9C,SAAS,sBAAsB;AAG/B,eAAsB,yBACrB,SACC;AACD,QAAM,OAAO,MAAM,8BAA8B,OAAO;AAExD,QAAM,uBAAwB,MAAM;AAAA,IACnC;AAAA,EACD;AACA,MAAI,CAAC,2BAA2B,oBAAoB,GAAG;AACtD,UAAM,IAAI;AAAA,MACT,gCAAgC,KAAK,UAAU,oBAAoB,CAAC;AAAA,IACrE;AAAA,EACD;AAEA,QAAM,eAAe,qBAAqB,aACxC,OAAO,CAAC,EAAE,MAAM,MAAM,CAAC,mBAAmB,IAAI,EAAE,SAAS,KAAK,CAAC,EAC/D;AAAA,IAAI,CAAC,gBACL,YAAY,UAAU,oBACnB,EAAE,GAAG,aAAa,eAAe,CAAC,MAAM,EAAE,IAC1C;AAAA,MACA,GAAG;AAAA,MACH,eAAe,MAAM;AAAA,QACpB,oBAAI,IAAI,CAAC,GAAG,YAAY,eAAe,MAAM,CAAC;AAAA,MAC/C;AAAA,IACA;AAAA,EACJ;AAED,MAAI,CAAC,aAAa,KAAK,CAAC,gBAAgB,YAAY,UAAU,IAAI,GAAG;AACpE,iBAAa,KAAK;AAAA,MACjB,eAAe,CAAC,MAAM;AAAA,MACtB,OAAO;AAAA,IACR,CAAC;AAAA,EACF;AAEA,QAAM,GAAG;AAAA,IACR;AAAA,IACA,MAAM,SAAS;AAAA,MACd,KAAK,UAAU;AAAA,QACd,GAAG;AAAA,QACH;AAAA,MACD,CAAC;AAAA,MACD,EAAE,QAAQ,OAAO;AAAA,IAClB;AAAA,EACD;AACD;AAEA,SAAS,2BACR,OAC+B;AAC/B,SAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,kBAAkB;AAClE;","names":[]}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { Options } from '../shared/types.js';
|
|
2
|
+
import 'zod';
|
|
3
|
+
import '../shared/codes.js';
|
|
4
|
+
|
|
5
|
+
declare function addToolAllContributors(options: Pick<Options, "offline" | "owner">): Promise<void>;
|
|
2
6
|
|
|
3
7
|
export { addToolAllContributors };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $ } from "execa";
|
|
2
2
|
import { getGitHubUserAsAllContributor } from "../shared/getGitHubUserAsAllContributor.js";
|
|
3
|
-
async function addToolAllContributors(
|
|
4
|
-
const login = await getGitHubUserAsAllContributor(
|
|
3
|
+
async function addToolAllContributors(options) {
|
|
4
|
+
const login = await getGitHubUserAsAllContributor(options);
|
|
5
5
|
if (login !== "JoshuaKGoldberg") {
|
|
6
6
|
await $`npx -y all-contributors-cli add JoshuaKGoldberg tool`;
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/addToolAllContributors.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport { getGitHubUserAsAllContributor } from \"../shared/getGitHubUserAsAllContributor.js\";\n\nexport async function addToolAllContributors(
|
|
1
|
+
{"version":3,"sources":["../../src/steps/addToolAllContributors.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport { getGitHubUserAsAllContributor } from \"../shared/getGitHubUserAsAllContributor.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport async function addToolAllContributors(\n\toptions: Pick<Options, \"offline\" | \"owner\">,\n) {\n\tconst login = await getGitHubUserAsAllContributor(options);\n\n\tif (login !== \"JoshuaKGoldberg\") {\n\t\tawait $`npx -y all-contributors-cli add JoshuaKGoldberg tool`;\n\t}\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAElB,SAAS,qCAAqC;AAG9C,eAAsB,uBACrB,SACC;AACD,QAAM,QAAQ,MAAM,8BAA8B,OAAO;AAEzD,MAAI,UAAU,mBAAmB;AAChC,UAAM;AAAA,EACP;AACD;","names":[]}
|
|
@@ -10,6 +10,8 @@ async function finalizeDependencies(options) {
|
|
|
10
10
|
"eslint-plugin-eslint-comments",
|
|
11
11
|
"eslint-plugin-jsdoc",
|
|
12
12
|
"eslint-plugin-n",
|
|
13
|
+
"eslint-plugin-import",
|
|
14
|
+
"eslint-plugin-prettier",
|
|
13
15
|
"eslint-plugin-regexp",
|
|
14
16
|
"husky",
|
|
15
17
|
"lint-staged",
|
|
@@ -18,7 +20,7 @@ async function finalizeDependencies(options) {
|
|
|
18
20
|
"prettier-plugin-packagejson",
|
|
19
21
|
"tsup",
|
|
20
22
|
"typescript",
|
|
21
|
-
...options.
|
|
23
|
+
...options.excludeAllContributors ? [] : ["all-contributors-cli"],
|
|
22
24
|
...options.excludeLintJson ? [] : ["eslint-plugin-jsonc", "jsonc-eslint-parser"],
|
|
23
25
|
...options.excludeLintKnip ? [] : ["knip"],
|
|
24
26
|
...options.excludeLintMd ? [] : [
|
|
@@ -44,8 +46,10 @@ async function finalizeDependencies(options) {
|
|
|
44
46
|
"vitest"
|
|
45
47
|
]
|
|
46
48
|
].filter(Boolean).sort().map((packageName) => `${packageName}@latest`).join(" ");
|
|
47
|
-
await execaCommand(
|
|
48
|
-
|
|
49
|
+
await execaCommand(
|
|
50
|
+
`pnpm add ${devDependencies} -D${options.offline ? " --offline" : ""}`
|
|
51
|
+
);
|
|
52
|
+
if (!options.excludeAllContributors) {
|
|
49
53
|
await execaCommand(`npx all-contributors-cli generate`);
|
|
50
54
|
await removeDependencies(
|
|
51
55
|
["all-contributors-cli", "all-contributors-for-repository"],
|
|
@@ -53,7 +57,7 @@ async function finalizeDependencies(options) {
|
|
|
53
57
|
"-D"
|
|
54
58
|
);
|
|
55
59
|
}
|
|
56
|
-
await execaCommand(
|
|
60
|
+
await execaCommand(`pnpm dedupe`);
|
|
57
61
|
}
|
|
58
62
|
export {
|
|
59
63
|
finalizeDependencies
|
|
@@ -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-plugin-deprecation\",\n\t\t\"eslint-plugin-eslint-comments\",\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.
|
|
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-plugin-deprecation\",\n\t\t\"eslint-plugin-eslint-comments\",\n\t\t\"eslint-plugin-jsdoc\",\n\t\t\"eslint-plugin-n\",\n\t\t\"eslint-plugin-import\",\n\t\t\"eslint-plugin-prettier\",\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.excludeAllContributors ? [] : [\"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(\n\t\t`pnpm add ${devDependencies} -D${options.offline ? \" --offline\" : \"\"}`,\n\t);\n\n\tif (!options.excludeAllContributors) {\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 dedupe`);\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,yBAAyB,CAAC,IAAI,CAAC,sBAAsB;AAAA,IACjE,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,IACL,YAAY,eAAe,MAAM,QAAQ,UAAU,eAAe,EAAE;AAAA,EACrE;AAEA,MAAI,CAAC,QAAQ,wBAAwB;AACpC,UAAM,aAAa,mCAAmC;AACtD,UAAM;AAAA,MACL,CAAC,wBAAwB,iCAAiC;AAAA,OACzD,MAAM,gBAAgB,GAAG;AAAA,MAC1B;AAAA,IACD;AAAA,EACD;AAEA,QAAM,aAAa,aAAa;AACjC;","names":[]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Octokit } from 'octokit';
|
|
2
2
|
import { Options } from '../../shared/types.js';
|
|
3
|
+
import 'zod';
|
|
4
|
+
import '../../shared/codes.js';
|
|
3
5
|
|
|
4
6
|
declare function initializeBranchProtectionSettings(octokit: Octokit, { owner, repository }: Pick<Options, "owner" | "repository">): Promise<false | undefined>;
|
|
5
7
|
|
|
@@ -29,6 +29,11 @@ const outcomeLabels = [
|
|
|
29
29
|
description: "Please, send a pull request to resolve this!",
|
|
30
30
|
name: "status: accepting prs"
|
|
31
31
|
},
|
|
32
|
+
{
|
|
33
|
+
color: "eeeeee",
|
|
34
|
+
description: "Issue is stale and/or no longer valid",
|
|
35
|
+
name: "status: aged away"
|
|
36
|
+
},
|
|
32
37
|
{
|
|
33
38
|
color: "#ddcccc",
|
|
34
39
|
description: "Waiting for something else to be resolved",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/initializeGitHubRepository/labels/outcomeLabels.ts"],"sourcesContent":["/* spellchecker: disable */\nexport const outcomeLabels = [\n\t{\n\t\tcolor: \"0075ca\",\n\t\tdescription: \"Improvements or additions to docs\",\n\t\tname: \"area: documentation\",\n\t},\n\t{\n\t\tcolor: \"6009D7\",\n\t\tdescription:\n\t\t\t\"Improving how the repository's tests are run and/or code is tested\",\n\t\tname: \"area: testing\",\n\t},\n\t{\n\t\tcolor: \"f9d0c4\",\n\t\tdescription: \"Managing the repository's maintenance\",\n\t\tname: \"area: tooling\",\n\t},\n\t{\n\t\tcolor: \"5319E7\",\n\t\tdescription: \"Good for newcomers, please hop on!\",\n\t\tname: \"good first issue\",\n\t},\n\t{\n\t\tcolor: \"7a5901\",\n\t\tdescription: \"This doesn't seem right\",\n\t\tname: \"invalid\",\n\t},\n\t{\n\t\tcolor: \"0E8A16\",\n\t\tdescription: \"Please, send a pull request to resolve this!\",\n\t\tname: \"status: accepting prs\",\n\t},\n\t{\n\t\tcolor: \"#ddcccc\",\n\t\tdescription: \"Waiting for something else to be resolved\",\n\t\tname: \"status: blocked\",\n\t},\n\t{\n\t\tcolor: \"cfd3d7\",\n\t\tdescription: \"This issue or pull request already exists\",\n\t\tname: \"status: duplicate\",\n\t},\n\t{\n\t\tcolor: \"#05104F\",\n\t\tdescription: \"Not yet ready for implementation or a pull request\",\n\t\tname: \"status: in discussion\",\n\t},\n\t{\n\t\tcolor: \"D3F82D\",\n\t\tdescription: \"Further research required...?\",\n\t\tname: \"status: needs investigation\",\n\t},\n\t{\n\t\tcolor: \"E4BC82\",\n\t\tdescription: \"Needs an action taken by the original poster\",\n\t\tname: \"status: waiting for author\",\n\t},\n\t{\n\t\tcolor: \"ffffff\",\n\t\tdescription: \"This will not be worked on\",\n\t\tname: \"status: wontfix\",\n\t},\n\t{\n\t\tcolor: \"d73a4a\",\n\t\tdescription: \"Something isn't working :(\",\n\t\tname: \"type: bug\",\n\t},\n\t{\n\t\tcolor: \"a2eeef\",\n\t\tdescription: \"New enhancement or request\",\n\t\tname: \"type: feature\",\n\t},\n\t{\n\t\tcolor: \"d876e3\",\n\t\tdescription: \"Further information is requested\",\n\t\tname: \"type: question\",\n\t},\n\t{\n\t\tcolor: \"fde282\",\n\t\tdescription: \"Tech debt or other code/repository cleanups\",\n\t\tname: \"type: cleanup\",\n\t},\n];\n"],"mappings":"AACO,MAAM,gBAAgB;AAAA,EAC5B;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aACC;AAAA,IACD,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AACD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/initializeGitHubRepository/labels/outcomeLabels.ts"],"sourcesContent":["/* spellchecker: disable */\nexport const outcomeLabels = [\n\t{\n\t\tcolor: \"0075ca\",\n\t\tdescription: \"Improvements or additions to docs\",\n\t\tname: \"area: documentation\",\n\t},\n\t{\n\t\tcolor: \"6009D7\",\n\t\tdescription:\n\t\t\t\"Improving how the repository's tests are run and/or code is tested\",\n\t\tname: \"area: testing\",\n\t},\n\t{\n\t\tcolor: \"f9d0c4\",\n\t\tdescription: \"Managing the repository's maintenance\",\n\t\tname: \"area: tooling\",\n\t},\n\t{\n\t\tcolor: \"5319E7\",\n\t\tdescription: \"Good for newcomers, please hop on!\",\n\t\tname: \"good first issue\",\n\t},\n\t{\n\t\tcolor: \"7a5901\",\n\t\tdescription: \"This doesn't seem right\",\n\t\tname: \"invalid\",\n\t},\n\t{\n\t\tcolor: \"0E8A16\",\n\t\tdescription: \"Please, send a pull request to resolve this!\",\n\t\tname: \"status: accepting prs\",\n\t},\n\t{\n\t\tcolor: \"eeeeee\",\n\t\tdescription: \"Issue is stale and/or no longer valid\",\n\t\tname: \"status: aged away\",\n\t},\n\t{\n\t\tcolor: \"#ddcccc\",\n\t\tdescription: \"Waiting for something else to be resolved\",\n\t\tname: \"status: blocked\",\n\t},\n\t{\n\t\tcolor: \"cfd3d7\",\n\t\tdescription: \"This issue or pull request already exists\",\n\t\tname: \"status: duplicate\",\n\t},\n\t{\n\t\tcolor: \"#05104F\",\n\t\tdescription: \"Not yet ready for implementation or a pull request\",\n\t\tname: \"status: in discussion\",\n\t},\n\t{\n\t\tcolor: \"D3F82D\",\n\t\tdescription: \"Further research required...?\",\n\t\tname: \"status: needs investigation\",\n\t},\n\t{\n\t\tcolor: \"E4BC82\",\n\t\tdescription: \"Needs an action taken by the original poster\",\n\t\tname: \"status: waiting for author\",\n\t},\n\t{\n\t\tcolor: \"ffffff\",\n\t\tdescription: \"This will not be worked on\",\n\t\tname: \"status: wontfix\",\n\t},\n\t{\n\t\tcolor: \"d73a4a\",\n\t\tdescription: \"Something isn't working :(\",\n\t\tname: \"type: bug\",\n\t},\n\t{\n\t\tcolor: \"a2eeef\",\n\t\tdescription: \"New enhancement or request\",\n\t\tname: \"type: feature\",\n\t},\n\t{\n\t\tcolor: \"d876e3\",\n\t\tdescription: \"Further information is requested\",\n\t\tname: \"type: question\",\n\t},\n\t{\n\t\tcolor: \"fde282\",\n\t\tdescription: \"Tech debt or other code/repository cleanups\",\n\t\tname: \"type: cleanup\",\n\t},\n];\n"],"mappings":"AACO,MAAM,gBAAgB;AAAA,EAC5B;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aACC;AAAA,IACD,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AACD;","names":[]}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Options } from '../shared/types.js';
|
|
2
|
+
import 'zod';
|
|
3
|
+
import '../shared/codes.js';
|
|
2
4
|
|
|
3
5
|
type InitializeRepositorySettings = Pick<Options, "owner" | "repository">;
|
|
4
6
|
declare function initializeGitRemote({ owner, repository, }: InitializeRepositorySettings): Promise<void>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Octokit } from 'octokit';
|
|
2
2
|
import { Options } from '../shared/types.js';
|
|
3
|
+
import 'zod';
|
|
4
|
+
import '../shared/codes.js';
|
|
3
5
|
|
|
4
6
|
type InitializeRepositorySettings = Pick<Options, "description" | "owner" | "repository">;
|
|
5
7
|
declare function initializeRepositorySettings(octokit: Octokit, { description, owner, repository }: InitializeRepositorySettings): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { $ } from "execa";
|
|
2
2
|
import { readPackageData, removeDependencies } from "../shared/packages.js";
|
|
3
|
-
async function uninstallPackages() {
|
|
3
|
+
async function uninstallPackages(offline) {
|
|
4
4
|
const packageData = await readPackageData();
|
|
5
5
|
await removeDependencies(
|
|
6
6
|
[
|
|
@@ -37,7 +37,7 @@ async function uninstallPackages() {
|
|
|
37
37
|
packageData.devDependencies,
|
|
38
38
|
"-D"
|
|
39
39
|
);
|
|
40
|
-
await $`pnpm add prettier -D`;
|
|
40
|
+
await $`pnpm add prettier -D${offline ? " --offline" : ""}`;
|
|
41
41
|
}
|
|
42
42
|
export {
|
|
43
43
|
uninstallPackages
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/uninstallPackages.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport { readPackageData, removeDependencies } from \"../shared/packages.js\";\n\nexport async function uninstallPackages() {\n\tconst packageData = await readPackageData();\n\n\tawait removeDependencies(\n\t\t[\n\t\t\t\"@clack/prompts\",\n\t\t\t\"all-contributors-for-repository\",\n\t\t\t\"chalk\",\n\t\t\t\"execa\",\n\t\t\t\"git-remote-origin-url\",\n\t\t\t\"git-url-parse\",\n\t\t\t\"lazy-value\",\n\t\t\t\"js-yaml\",\n\t\t\t\"npm-user\",\n\t\t\t\"octokit\",\n\t\t\t\"prettier\",\n\t\t\t\"replace-in-file\",\n\t\t\t\"title-case\",\n\t\t\t\"zod\",\n\t\t\t\"zod-validation-error\",\n\t\t],\n\t\tpackageData.dependencies,\n\t);\n\n\tawait removeDependencies(\n\t\t[\n\t\t\t\"@octokit/request-error\",\n\t\t\t\"@types/git-url-parse\",\n\t\t\t\"@types/js-yaml\",\n\t\t\t\"@types/prettier\",\n\t\t\t\"all-contributors-cli\",\n\t\t\t\"c8\",\n\t\t\t\"eslint-config-prettier\",\n\t\t\t\"globby\",\n\t\t\t\"tsx\",\n\t\t],\n\t\tpackageData.devDependencies,\n\t\t\"-D\",\n\t);\n\n\tawait $`pnpm add prettier -D`;\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAElB,SAAS,iBAAiB,0BAA0B;AAEpD,eAAsB,
|
|
1
|
+
{"version":3,"sources":["../../src/steps/uninstallPackages.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport { readPackageData, removeDependencies } from \"../shared/packages.js\";\n\nexport async function uninstallPackages(offline: boolean | undefined) {\n\tconst packageData = await readPackageData();\n\n\tawait removeDependencies(\n\t\t[\n\t\t\t\"@clack/prompts\",\n\t\t\t\"all-contributors-for-repository\",\n\t\t\t\"chalk\",\n\t\t\t\"execa\",\n\t\t\t\"git-remote-origin-url\",\n\t\t\t\"git-url-parse\",\n\t\t\t\"lazy-value\",\n\t\t\t\"js-yaml\",\n\t\t\t\"npm-user\",\n\t\t\t\"octokit\",\n\t\t\t\"prettier\",\n\t\t\t\"replace-in-file\",\n\t\t\t\"title-case\",\n\t\t\t\"zod\",\n\t\t\t\"zod-validation-error\",\n\t\t],\n\t\tpackageData.dependencies,\n\t);\n\n\tawait removeDependencies(\n\t\t[\n\t\t\t\"@octokit/request-error\",\n\t\t\t\"@types/git-url-parse\",\n\t\t\t\"@types/js-yaml\",\n\t\t\t\"@types/prettier\",\n\t\t\t\"all-contributors-cli\",\n\t\t\t\"c8\",\n\t\t\t\"eslint-config-prettier\",\n\t\t\t\"globby\",\n\t\t\t\"tsx\",\n\t\t],\n\t\tpackageData.devDependencies,\n\t\t\"-D\",\n\t);\n\n\tawait $`pnpm add prettier -D${offline ? \" --offline\" : \"\"}`;\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAElB,SAAS,iBAAiB,0BAA0B;AAEpD,eAAsB,kBAAkB,SAA8B;AACrE,QAAM,cAAc,MAAM,gBAAgB;AAE1C,QAAM;AAAA,IACL;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA,YAAY;AAAA,EACb;AAEA,QAAM;AAAA,IACL;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,EACD;AAEA,QAAM,wBAAwB,UAAU,eAAe,EAAE;AAC1D;","names":[]}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Mode } from '../bin/mode.js';
|
|
2
1
|
import { Options } from '../shared/types.js';
|
|
3
2
|
import 'zod';
|
|
4
3
|
import '../shared/codes.js';
|
|
5
4
|
|
|
6
|
-
declare function updateLocalFiles(options: Options
|
|
5
|
+
declare function updateLocalFiles(options: Options): Promise<void>;
|
|
7
6
|
|
|
8
7
|
export { updateLocalFiles };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import replaceInFile from "replace-in-file";
|
|
2
2
|
import { readFileSafeAsJson } from "../shared/readFileSafeAsJson.js";
|
|
3
|
-
async function updateLocalFiles(options
|
|
3
|
+
async function updateLocalFiles(options) {
|
|
4
4
|
const existingPackage = await readFileSafeAsJson("./package.json") ?? {};
|
|
5
5
|
const replacements = [
|
|
6
6
|
[/Create TypeScript App/g, options.title],
|
|
@@ -8,7 +8,7 @@ async function updateLocalFiles(options, mode) {
|
|
|
8
8
|
[/create-typescript-app/g, options.repository],
|
|
9
9
|
[/\/\*\n.+\*\/\n\n/gs, ``, ".eslintrc.cjs"],
|
|
10
10
|
[/"author": ".+"/g, `"author": "${options.author}"`, "./package.json"],
|
|
11
|
-
...mode === "migrate" ? [] : [[/"bin": ".+\n/g, ``, "./package.json"]],
|
|
11
|
+
...options.mode === "migrate" ? [] : [[/"bin": ".+\n/g, ``, "./package.json"]],
|
|
12
12
|
[/"test:create": ".+\n/g, ``, "./package.json"],
|
|
13
13
|
[/"test:initialize": ".*/g, ``, "./package.json"],
|
|
14
14
|
[/"initialize": ".*/g, ``, "./package.json"],
|
|
@@ -35,7 +35,7 @@ async function updateLocalFiles(options, mode) {
|
|
|
35
35
|
if (existingPackage.description) {
|
|
36
36
|
replacements.push([existingPackage.description, options.description]);
|
|
37
37
|
}
|
|
38
|
-
if (mode === "initialize" && existingPackage.version) {
|
|
38
|
+
if (options.mode === "initialize" && existingPackage.version) {
|
|
39
39
|
replacements.push([
|
|
40
40
|
new RegExp(`"version": "${existingPackage.version}"`, "g"),
|
|
41
41
|
`"version": "0.0.0"`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/updateLocalFiles.ts"],"sourcesContent":["import replaceInFile from \"replace-in-file\";\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/steps/updateLocalFiles.ts"],"sourcesContent":["import replaceInFile from \"replace-in-file\";\n\nimport { readFileSafeAsJson } from \"../shared/readFileSafeAsJson.js\";\nimport { Options } from \"../shared/types.js\";\n\ninterface ExistingPackageData {\n\tdescription?: string;\n\tversion?: string;\n}\n\nexport async function updateLocalFiles(options: Options) {\n\tconst existingPackage = ((await readFileSafeAsJson(\"./package.json\")) ??\n\t\t{}) as ExistingPackageData;\n\n\tconst replacements = [\n\t\t[/Create TypeScript App/g, options.title],\n\t\t[/JoshuaKGoldberg(?!\\/console-fail-test)/g, options.owner],\n\t\t[/create-typescript-app/g, options.repository],\n\t\t[/\\/\\*\\n.+\\*\\/\\n\\n/gs, ``, \".eslintrc.cjs\"],\n\t\t[/\"author\": \".+\"/g, `\"author\": \"${options.author}\"`, \"./package.json\"],\n\t\t...(options.mode === \"migrate\"\n\t\t\t? []\n\t\t\t: [[/\"bin\": \".+\\n/g, ``, \"./package.json\"]]),\n\t\t[/\"test:create\": \".+\\n/g, ``, \"./package.json\"],\n\t\t[/\"test:initialize\": \".*/g, ``, \"./package.json\"],\n\t\t[/\"initialize\": \".*/g, ``, \"./package.json\"],\n\t\t[/\"test:migrate\": \".+\\n/g, ``, \"./package.json\"],\n\t\t[/## Getting Started.*## Development/gs, `## Development`, \"./README.md\"],\n\t\t[/\\n## Setup Scripts.*$/gs, \"\", \"./.github/DEVELOPMENT.md\"],\n\t\t[`\\t\\t\"src/initialize/index.ts\",\\n`, ``, \"./knip.jsonc\"],\n\t\t[`\\t\\t\"src/migrate/index.ts\",\\n`, ``, \"./knip.jsonc\"],\n\t\t[\n\t\t\t`[\"src/index.ts!\", \"script/initialize*.js\"]`,\n\t\t\t`\"src/index.ts!\"`,\n\t\t\t\"./knip.jsonc\",\n\t\t],\n\t\t[`[\"src/**/*.ts!\", \"script/**/*.js\"]`, `\"src/**/*.ts!\"`, \"./knip.jsonc\"],\n\t\t// Edge case: migration scripts will rewrite README.md attribution\n\t\t[\n\t\t\t`> 💙 This package is based on [@${options.owner}](https://github.com/${options.owner})'s [${options.repository}](https://github.com/JoshuaKGoldberg/${options.repository}).`,\n\t\t\t`> 💙 This package is based on [@JoshuaKGoldberg](https://github.com/JoshuaKGoldberg)'s [create-typescript-app](https://github.com/JoshuaKGoldberg/create-typescript-app).`,\n\t\t\t\"./README.md\",\n\t\t],\n\t];\n\n\tif (existingPackage.description) {\n\t\treplacements.push([existingPackage.description, options.description]);\n\t}\n\n\tif (options.mode === \"initialize\" && existingPackage.version) {\n\t\treplacements.push([\n\t\t\tnew RegExp(`\"version\": \"${existingPackage.version}\"`, \"g\"),\n\t\t\t`\"version\": \"0.0.0\"`,\n\t\t\t\"./package.json\",\n\t\t]);\n\t}\n\n\tfor (const [from, to, files = [\"./.github/**/*\", \"./*.*\"]] of replacements) {\n\t\ttry {\n\t\t\t// @ts-expect-error -- https://github.com/microsoft/TypeScript/issues/54342\n\t\t\tawait replaceInFile({ files, from, to });\n\t\t} catch (error) {\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to replace ${from.toString()} with ${to} in ${files.toString()}`,\n\t\t\t\t{\n\t\t\t\t\tcause: error,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n}\n"],"mappings":"AAAA,OAAO,mBAAmB;AAE1B,SAAS,0BAA0B;AAQnC,eAAsB,iBAAiB,SAAkB;AACxD,QAAM,kBAAoB,MAAM,mBAAmB,gBAAgB,KAClE,CAAC;AAEF,QAAM,eAAe;AAAA,IACpB,CAAC,0BAA0B,QAAQ,KAAK;AAAA,IACxC,CAAC,2CAA2C,QAAQ,KAAK;AAAA,IACzD,CAAC,0BAA0B,QAAQ,UAAU;AAAA,IAC7C,CAAC,sBAAsB,IAAI,eAAe;AAAA,IAC1C,CAAC,mBAAmB,cAAc,QAAQ,MAAM,KAAK,gBAAgB;AAAA,IACrE,GAAI,QAAQ,SAAS,YAClB,CAAC,IACD,CAAC,CAAC,iBAAiB,IAAI,gBAAgB,CAAC;AAAA,IAC3C,CAAC,yBAAyB,IAAI,gBAAgB;AAAA,IAC9C,CAAC,2BAA2B,IAAI,gBAAgB;AAAA,IAChD,CAAC,sBAAsB,IAAI,gBAAgB;AAAA,IAC3C,CAAC,0BAA0B,IAAI,gBAAgB;AAAA,IAC/C,CAAC,wCAAwC,kBAAkB,aAAa;AAAA,IACxE,CAAC,2BAA2B,IAAI,0BAA0B;AAAA,IAC1D,CAAC;AAAA,GAAoC,IAAI,cAAc;AAAA,IACvD,CAAC;AAAA,GAAiC,IAAI,cAAc;AAAA,IACpD;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA,CAAC,sCAAsC,kBAAkB,cAAc;AAAA;AAAA,IAEvE;AAAA,MACC,0CAAmC,QAAQ,KAAK,wBAAwB,QAAQ,KAAK,QAAQ,QAAQ,UAAU,wCAAwC,QAAQ,UAAU;AAAA,MACzK;AAAA,MACA;AAAA,IACD;AAAA,EACD;AAEA,MAAI,gBAAgB,aAAa;AAChC,iBAAa,KAAK,CAAC,gBAAgB,aAAa,QAAQ,WAAW,CAAC;AAAA,EACrE;AAEA,MAAI,QAAQ,SAAS,gBAAgB,gBAAgB,SAAS;AAC7D,iBAAa,KAAK;AAAA,MACjB,IAAI,OAAO,eAAe,gBAAgB,OAAO,KAAK,GAAG;AAAA,MACzD;AAAA,MACA;AAAA,IACD,CAAC;AAAA,EACF;AAEA,aAAW,CAAC,MAAM,IAAI,QAAQ,CAAC,kBAAkB,OAAO,CAAC,KAAK,cAAc;AAC3E,QAAI;AAEH,YAAM,cAAc,EAAE,OAAO,MAAM,GAAG,CAAC;AAAA,IACxC,SAAS,OAAO;AACf,YAAM,IAAI;AAAA,QACT,qBAAqB,KAAK,SAAS,CAAC,SAAS,EAAE,OAAO,MAAM,SAAS,CAAC;AAAA,QACtE;AAAA,UACC,OAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/steps/writeReadme/findIntroSectionClose.ts"],"sourcesContent":["import { existingBadgeMatcherCreators } from \"./findExistingBadges.js\";\n\nexport function findIntroSectionClose(contents: string) {\n\t// Highest priority match: an h2, presumably following badges\n\tconst indexOfH2OrCodeBlock = contents.search(/## |<\\s*h2|```/);\n\n\tif (indexOfH2OrCodeBlock !== -1) {\n\t\treturn indexOfH2OrCodeBlock - 2;\n\t}\n\n\t// Failing that, if any badges are found, go after the last of them\n\tfor (const createMatcher of existingBadgeMatcherCreators) {\n\t\tconst lastMatch = [...contents.matchAll(createMatcher())].at(-1);\n\n\t\tif (lastMatch?.index) {\n\t\t\treturn lastMatch.index + lastMatch[0].length + 2;\n\t\t}\n\t}\n\n\t// Lastly, go for the second line altogether\n\treturn contents.indexOf(\"\\n\",
|
|
1
|
+
{"version":3,"sources":["../../../src/steps/writeReadme/findIntroSectionClose.ts"],"sourcesContent":["import { existingBadgeMatcherCreators } from \"./findExistingBadges.js\";\n\nexport function findIntroSectionClose(contents: string) {\n\t// Highest priority match: an h2, presumably following badges\n\tconst indexOfH2OrCodeBlock = contents.search(/## |<\\s*h2|```/);\n\n\tif (indexOfH2OrCodeBlock !== -1) {\n\t\treturn indexOfH2OrCodeBlock - 2;\n\t}\n\n\t// Failing that, if any badges are found, go after the last of them\n\tfor (const createMatcher of existingBadgeMatcherCreators) {\n\t\tconst lastMatch = [...contents.matchAll(createMatcher())].at(-1);\n\n\t\tif (lastMatch?.index) {\n\t\t\treturn lastMatch.index + lastMatch[0].length + 2;\n\t\t}\n\t}\n\n\t// Lastly, go for the second line altogether\n\treturn contents.indexOf(\"\\n\", 1) + 1;\n}\n"],"mappings":"AAAA,SAAS,oCAAoC;AAEtC,SAAS,sBAAsB,UAAkB;AAEvD,QAAM,uBAAuB,SAAS,OAAO,gBAAgB;AAE7D,MAAI,yBAAyB,IAAI;AAChC,WAAO,uBAAuB;AAAA,EAC/B;AAGA,aAAW,iBAAiB,8BAA8B;AACzD,UAAM,YAAY,CAAC,GAAG,SAAS,SAAS,cAAc,CAAC,CAAC,EAAE,GAAG,EAAE;AAE/D,QAAI,WAAW,OAAO;AACrB,aAAO,UAAU,QAAQ,UAAU,CAAC,EAAE,SAAS;AAAA,IAChD;AAAA,EACD;AAGA,SAAO,SAAS,QAAQ,MAAM,CAAC,IAAI;AACpC;","names":[]}
|
|
@@ -14,7 +14,7 @@ function generateTopContent(options, existingBadges) {
|
|
|
14
14
|
}
|
|
15
15
|
for (const [badgeLine, existingMatcher] of [
|
|
16
16
|
[
|
|
17
|
-
!options.
|
|
17
|
+
!options.excludeAllContributors && `<a href="#contributors" target="_blank">
|
|
18
18
|
<!-- prettier-ignore-start -->
|
|
19
19
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
20
20
|
<img alt="All Contributors: 2" src="https://img.shields.io/badge/all_contributors-17-21bb42.svg" />
|
|
@@ -54,6 +54,10 @@ function generateTopContent(options, existingBadges) {
|
|
|
54
54
|
[
|
|
55
55
|
`<img alt="TypeScript: Strict" src="https://img.shields.io/badge/typescript-strict-21bb42.svg" />`,
|
|
56
56
|
/typescript.*strict/i
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
`<img alt="npm package version" src="https://img.shields.io/npm/v/create-typescript-app?color=21bb42" />`,
|
|
60
|
+
/npm.*v/i
|
|
57
61
|
]
|
|
58
62
|
]) {
|
|
59
63
|
spliceBadge(badgeLine, existingMatcher);
|
|
@@ -64,7 +68,18 @@ function generateTopContent(options, existingBadges) {
|
|
|
64
68
|
|
|
65
69
|
<p align="center">
|
|
66
70
|
${[...badges, ...remainingExistingBadges].map((badge) => ` ${badge}`).join("\n")}
|
|
67
|
-
</p
|
|
71
|
+
</p>${options.mode === "migrate" ? "" : `
|
|
72
|
+
|
|
73
|
+
## Usage
|
|
74
|
+
|
|
75
|
+
\`\`\`shell
|
|
76
|
+
npm i ${options.repository}
|
|
77
|
+
\`\`\`
|
|
78
|
+
\`\`\`ts
|
|
79
|
+
import { greet } from "${options.repository}";
|
|
80
|
+
|
|
81
|
+
greet("Hello, world! \u{1F496}");
|
|
82
|
+
\`\`\``}`;
|
|
68
83
|
}
|
|
69
84
|
export {
|
|
70
85
|
generateTopContent
|
|
@@ -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\tfunction spliceBadge(\n\t\tbadgeLine: false | string | undefined,\n\t\texistingMatcher: RegExp,\n\t) {\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\tfor (const [badgeLine, existingMatcher] of [\n\t\t[\n\t\t\t!options.
|
|
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\tfunction spliceBadge(\n\t\tbadgeLine: false | string | undefined,\n\t\texistingMatcher: RegExp,\n\t) {\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\tfor (const [badgeLine, existingMatcher] of [\n\t\t[\n\t\t\t!options.excludeAllContributors &&\n\t\t\t\t`<a href=\"#contributors\" target=\"_blank\">\n<!-- prettier-ignore-start -->\n<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->\n<img alt=\"All Contributors: 2\" src=\"https://img.shields.io/badge/all_contributors-17-21bb42.svg\" />\n<!-- ALL-CONTRIBUTORS-BADGE:END -->\n<!-- prettier-ignore-end -->\n</a>`,\n\t\t\t/ALL-CONTRIBUTORS-BADGE:START/,\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\">\n\t\t<img alt=\"Codecov Test Coverage\" src=\"https://codecov.io/gh/${options.owner}/${options.repository}/branch/main/graph/badge.svg\"/>\n\t</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/.github/CODE_OF_CONDUCT.md\" target=\"_blank\">\n\t\t<img alt=\"Contributor Covenant\" src=\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\" />\n\t</a>`,\n\t\t\t/CODE_OF_CONDUCT\\.md/,\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\">\n\t\t<img alt=\"License: MIT\" src=\"https://img.shields.io/github/license/${options.owner}/${options.repository}?color=21bb42\">\n\t</a>`,\n\t\t\t/LICENSE\\.(md|txt)/,\n\t\t],\n\t\t[\n\t\t\toptions.funding &&\n\t\t\t\t`<a href=\"https://github.com/sponsors/${options.funding}\" target=\"_blank\">\n\t\t<img alt=\"Sponsor: On GitHub\" src=\"https://img.shields.io/badge/sponsor-on_github-21bb42.svg\" />\n\t</a>`,\n\t\t\t/github.+sponsors/,\n\t\t],\n\t\t[\n\t\t\t`<img alt=\"Style: Prettier\" src=\"https://img.shields.io/badge/style-prettier-21bb42.svg\" />`,\n\t\t\t/style.*prettier/i,\n\t\t],\n\t\t[\n\t\t\t`<img alt=\"TypeScript: Strict\" src=\"https://img.shields.io/badge/typescript-strict-21bb42.svg\" />`,\n\t\t\t/typescript.*strict/i,\n\t\t],\n\t\t[\n\t\t\t`<img alt=\"npm package version\" src=\"https://img.shields.io/npm/v/create-typescript-app?color=21bb42\" />`,\n\t\t\t/npm.*v/i,\n\t\t],\n\t] as const) {\n\t\tspliceBadge(badgeLine, existingMatcher);\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\"\n\t\t\t? \"\"\n\t\t\t: `\n\n## Usage\n\n\\`\\`\\`shell\nnpm i ${options.repository}\n\\`\\`\\`\n\\`\\`\\`ts\nimport { greet } from \"${options.repository}\";\n\ngreet(\"Hello, world! 💖\");\n\\`\\`\\``\n\t}`;\n}\n"],"mappings":"AAEO,SAAS,mBAAmB,SAAkB,gBAA0B;AAC9E,QAAM,0BAA0B,IAAI,IAAI,cAAc;AACtD,QAAM,SAAmB,CAAC;AAE1B,WAAS,YACR,WACA,iBACC;AACD,UAAM,gBAAgB,eAAe;AAAA,MAAK,CAAC,iBAC1C,gBAAgB,KAAK,YAAY;AAAA,IAClC;AAEA,QAAI,eAAe;AAClB,8BAAwB,OAAO,aAAa;AAAA,IAC7C;AAEA,QAAI,WAAW;AACd,aAAO,KAAK,SAAS;AAAA,IACtB;AAAA,EACD;AAEA,aAAW,CAAC,WAAW,eAAe,KAAK;AAAA,IAC1C;AAAA,MACC,CAAC,QAAQ,0BACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOD;AAAA,IACD;AAAA,IACA;AAAA,MACC,CAAC,QAAQ,gBACR,kCAAkC,QAAQ,KAAK,IAAI,QAAQ,UAAU;AAAA,gEACT,QAAQ,KAAK,IAAI,QAAQ,UAAU;AAAA;AAAA,MAEhG;AAAA,IACD;AAAA,IACA;AAAA,MACC,+BAA+B,QAAQ,KAAK,IAAI,QAAQ,UAAU;AAAA;AAAA;AAAA,MAGlE;AAAA,IACD;AAAA,IACA;AAAA,MACC,+BAA+B,QAAQ,KAAK,IAAI,QAAQ,UAAU;AAAA,uEACE,QAAQ,KAAK,IAAI,QAAQ,UAAU;AAAA;AAAA,MAEvG;AAAA,IACD;AAAA,IACA;AAAA,MACC,QAAQ,WACP,wCAAwC,QAAQ,OAAO;AAAA;AAAA;AAAA,MAGxD;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA;AAAA,IACD;AAAA,EACD,GAAY;AACX,gBAAY,WAAW,eAAe;AAAA,EACvC;AAEA,SAAO,sBAAsB,QAAQ,KAAK;AAAA;AAAA,oBAEvB,QAAQ,WAAW;AAAA;AAAA;AAAA,EAGrC,CAAC,GAAG,QAAQ,GAAG,uBAAuB,EACtC,IAAI,CAAC,UAAU,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":[]}
|
|
@@ -25,7 +25,7 @@ function generateAllContributorsContent(options) {
|
|
|
25
25
|
].filter(Boolean).join("\n");
|
|
26
26
|
}
|
|
27
27
|
async function writeReadme(options) {
|
|
28
|
-
const allContributorsContent = !options.
|
|
28
|
+
const allContributorsContent = !options.excludeAllContributors && generateAllContributorsContent(options);
|
|
29
29
|
let contents = await readFileSafe("README.md", "");
|
|
30
30
|
if (!contents) {
|
|
31
31
|
await fs.writeFile(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/steps/writeReadme/index.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\n\nimport { readFileSafe } from \"../../shared/readFileSafe.js\";\nimport { Options } from \"../../shared/types.js\";\nimport { endOfReadmeNotice } from \"../updateReadme.js\";\nimport { findExistingBadges } from \"./findExistingBadges.js\";\nimport { findIntroSectionClose } from \"./findIntroSectionClose.js\";\nimport { generateTopContent } from \"./generateTopContent.js\";\n\nconst contributorsIndicator = `<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->`;\n\nfunction generateAllContributorsContent(options: Options) {\n\treturn [\n\t\t`## Contributors`,\n\t\t``,\n\t\t`<!-- spellchecker: disable -->`,\n\t\tcontributorsIndicator,\n\t\t`<!-- prettier-ignore-start -->`,\n\t\t!options.excludeLintMd && `<!-- markdownlint-disable -->`,\n\t\t`<table>`,\n\t\t`<!-- (this will be filled in by all-contributors) -->`,\n\t\t`</table>`,\n\t\t``,\n\t\t!options.excludeLintMd && `<!-- markdownlint-restore -->`,\n\t\t`<!-- prettier-ignore-end -->`,\n\t\t``,\n\t\t`<!-- ALL-CONTRIBUTORS-LIST:END -->`,\n\t\t`<!-- spellchecker: enable -->`,\n\t]\n\t\t.filter(Boolean)\n\t\t.join(\"\\n\");\n}\n\nexport async function writeReadme(options: Options) {\n\tconst allContributorsContent =\n\t\t!options.
|
|
1
|
+
{"version":3,"sources":["../../../src/steps/writeReadme/index.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\n\nimport { readFileSafe } from \"../../shared/readFileSafe.js\";\nimport { Options } from \"../../shared/types.js\";\nimport { endOfReadmeNotice } from \"../updateReadme.js\";\nimport { findExistingBadges } from \"./findExistingBadges.js\";\nimport { findIntroSectionClose } from \"./findIntroSectionClose.js\";\nimport { generateTopContent } from \"./generateTopContent.js\";\n\nconst contributorsIndicator = `<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->`;\n\nfunction generateAllContributorsContent(options: Options) {\n\treturn [\n\t\t`## Contributors`,\n\t\t``,\n\t\t`<!-- spellchecker: disable -->`,\n\t\tcontributorsIndicator,\n\t\t`<!-- prettier-ignore-start -->`,\n\t\t!options.excludeLintMd && `<!-- markdownlint-disable -->`,\n\t\t`<table>`,\n\t\t`<!-- (this will be filled in by all-contributors) -->`,\n\t\t`</table>`,\n\t\t``,\n\t\t!options.excludeLintMd && `<!-- markdownlint-restore -->`,\n\t\t`<!-- prettier-ignore-end -->`,\n\t\t``,\n\t\t`<!-- ALL-CONTRIBUTORS-LIST:END -->`,\n\t\t`<!-- spellchecker: enable -->`,\n\t]\n\t\t.filter(Boolean)\n\t\t.join(\"\\n\");\n}\n\nexport async function writeReadme(options: Options) {\n\tconst allContributorsContent =\n\t\t!options.excludeAllContributors && generateAllContributorsContent(options);\n\tlet contents = await readFileSafe(\"README.md\", \"\");\n\tif (!contents) {\n\t\tawait fs.writeFile(\n\t\t\t\"README.md\",\n\t\t\t[\n\t\t\t\tgenerateTopContent(options, []),\n\t\t\t\tallContributorsContent,\n\t\t\t\tendOfReadmeNotice,\n\t\t\t]\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.join(\"\\n\\n\"),\n\t\t);\n\t\treturn;\n\t}\n\n\tconst endOfIntroSection = findIntroSectionClose(contents);\n\n\tcontents = [\n\t\tgenerateTopContent(options, findExistingBadges(contents)),\n\t\tcontents.slice(endOfIntroSection),\n\t]\n\t\t.join(\"\")\n\t\t.replace(/\\[!\\[.+\\]\\(.+\\)\\]\\(.+\\)/g, \"\")\n\t\t.replace(/!\\[.+\\]\\(.+\\)/g, \"\")\n\t\t.replaceAll(\"\\r\", \"\")\n\t\t.replaceAll(\"\\n\\n\\n\", \"\\n\\n\");\n\n\tif (allContributorsContent && !contents.includes(contributorsIndicator)) {\n\t\tcontents = [contents, allContributorsContent].join(\"\\n\\n\");\n\t}\n\n\tif (!contents.includes(endOfReadmeNotice)) {\n\t\tcontents = [contents, endOfReadmeNotice].join(\"\\n\\n\");\n\t}\n\n\tawait fs.writeFile(\"README.md\", contents);\n}\n"],"mappings":"AAAA,OAAO,QAAQ;AAEf,SAAS,oBAAoB;AAE7B,SAAS,yBAAyB;AAClC,SAAS,0BAA0B;AACnC,SAAS,6BAA6B;AACtC,SAAS,0BAA0B;AAEnC,MAAM,wBAAwB;AAE9B,SAAS,+BAA+B,SAAkB;AACzD,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,CAAC,QAAQ,iBAAiB;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,CAAC,QAAQ,iBAAiB;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,EACE,OAAO,OAAO,EACd,KAAK,IAAI;AACZ;AAEA,eAAsB,YAAY,SAAkB;AACnD,QAAM,yBACL,CAAC,QAAQ,0BAA0B,+BAA+B,OAAO;AAC1E,MAAI,WAAW,MAAM,aAAa,aAAa,EAAE;AACjD,MAAI,CAAC,UAAU;AACd,UAAM,GAAG;AAAA,MACR;AAAA,MACA;AAAA,QACC,mBAAmB,SAAS,CAAC,CAAC;AAAA,QAC9B;AAAA,QACA;AAAA,MACD,EACE,OAAO,OAAO,EACd,KAAK,MAAM;AAAA,IACd;AACA;AAAA,EACD;AAEA,QAAM,oBAAoB,sBAAsB,QAAQ;AAExD,aAAW;AAAA,IACV,mBAAmB,SAAS,mBAAmB,QAAQ,CAAC;AAAA,IACxD,SAAS,MAAM,iBAAiB;AAAA,EACjC,EACE,KAAK,EAAE,EACP,QAAQ,4BAA4B,EAAE,EACtC,QAAQ,kBAAkB,EAAE,EAC5B,WAAW,MAAM,EAAE,EACnB,WAAW,UAAU,MAAM;AAE7B,MAAI,0BAA0B,CAAC,SAAS,SAAS,qBAAqB,GAAG;AACxE,eAAW,CAAC,UAAU,sBAAsB,EAAE,KAAK,MAAM;AAAA,EAC1D;AAEA,MAAI,CAAC,SAAS,SAAS,iBAAiB,GAAG;AAC1C,eAAW,CAAC,UAAU,iBAAiB,EAAE,KAAK,MAAM;AAAA,EACrD;AAEA,QAAM,GAAG,UAAU,aAAa,QAAQ;AACzC;","names":[]}
|
|
@@ -10,7 +10,7 @@ module.exports = {
|
|
|
10
10
|
"eslint:recommended",
|
|
11
11
|
${options.excludeLintESLint ? "" : `"plugin:eslint-comments/recommended",
|
|
12
12
|
`}"plugin:n/recommended",${options.excludeLintPerfectionist ? "" : `
|
|
13
|
-
"plugin:perfectionist/recommended-natural",`}${options.excludeLintRegex ? "" : `"plugin:regexp/recommended",`}
|
|
13
|
+
"plugin:perfectionist/recommended-natural",`}${options.excludeLintRegex ? "" : `"plugin:regexp/recommended",`}${options.excludeTests ? "" : `"plugin:vitest/recommended",`}
|
|
14
14
|
],
|
|
15
15
|
overrides: [${options.excludeLintMd ? "" : `
|
|
16
16
|
{
|
|
@@ -43,6 +43,15 @@ module.exports = {
|
|
|
43
43
|
"jsdoc/require-returns": "off",`}
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
|
+
{
|
|
47
|
+
files: "**/*.md/*.ts",
|
|
48
|
+
rules: {
|
|
49
|
+
"n/no-missing-import": [
|
|
50
|
+
"error",
|
|
51
|
+
{ allowModules: ["${options.repository}"] },
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
46
55
|
{
|
|
47
56
|
${options.excludeLintMd ? "" : `excludedFiles: ["**/*.md/*.ts"],
|
|
48
57
|
`}extends: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/writing/creation/createESLintRC.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\n\nexport async function createESLintRC(options: Options) {\n\treturn await formatTypeScript(`/** @type {import(\"@types/eslint\").Linter.Config} */\nmodule.exports = {\n\tenv: {\n\t\tes2022: true,\n\t\tnode: true,\n\t},\n\textends: [\n\t\t\"eslint:recommended\",\n\t\t${\n\t\t\toptions.excludeLintESLint\n\t\t\t\t? \"\"\n\t\t\t\t: `\"plugin:eslint-comments/recommended\",\n\t\t`\n\t\t}\"plugin:n/recommended\",${\n\t\t\toptions.excludeLintPerfectionist\n\t\t\t\t? \"\"\n\t\t\t\t: `\n\t\t\"plugin:perfectionist/recommended-natural\",`\n\t\t}${options.excludeLintRegex ? \"\" : `\"plugin:regexp/recommended\",`}\n\t],\n\toverrides: [${\n\t\toptions.excludeLintMd\n\t\t\t? \"\"\n\t\t\t: `\n\t\t{\n\t\t\textends: [\"plugin:markdown/recommended\"],\n\t\t\tfiles: [\"**/*.md\"],\n\t\t\tprocessor: \"markdown/markdown\",\n\t\t},`\n\t}\n\t\t{\n\t\t\textends: [\n\t\t\t\t${\n\t\t\t\t\toptions.excludeLintJSDoc\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: `\"plugin:jsdoc/recommended-typescript-error\",\n\t\t\t\t`\n\t\t\t\t}\"plugin:@typescript-eslint/${\n\t\t\t\t\toptions.excludeLintStrict ? \"recommended\" : \"strict\"\n\t\t\t\t}\",${\n\t\t\t\t\toptions.excludeLintStylistic\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: `\n\t\t\t\t\"plugin:@typescript-eslint/stylistic\",`\n\t\t\t\t}\n\t\t\t],\n\t\t\tfiles: [\"**/*.ts\"],\n\t\t\tparser: \"@typescript-eslint/parser\",\n\t\t\trules: {\n\t\t\t\t// These off-by-default rules work well for this repo and we like them on.\n\t\t\t\t${\n\t\t\t\t\toptions.excludeLintJSDoc\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: `\"jsdoc/informative-docs\": \"error\",\n\t\t\t\t`\n\t\t\t\t}\"logical-assignment-operators\": [\n\t\t\t\t\t\"error\",\n\t\t\t\t\t\"always\",\n\t\t\t\t\t{ enforceForIfStatements: true },\n\t\t\t\t],\n\t\t\t\t\"operator-assignment\": \"error\",${\n\t\t\t\t\toptions.excludeLintJSDoc\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: `\n\n\t\t\t\t// These on-by-default rules don't work well for this repo and we like them off.\n\t\t\t\t\"jsdoc/require-jsdoc\": \"off\",\n\t\t\t\t\"jsdoc/require-param\": \"off\",\n\t\t\t\t\"jsdoc/require-property\": \"off\",\n\t\t\t\t\"jsdoc/require-returns\": \"off\",`\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t${\n\t\t\t\toptions.excludeLintMd\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `excludedFiles: [\"**/*.md/*.ts\"],\n\t\t\t`\n\t\t\t}extends: [\n\t\t\t\t\"plugin:@typescript-eslint/${\n\t\t\t\t\toptions.excludeLintStrict ? \"recommended\" : \"strict\"\n\t\t\t\t}-type-checked\",${\n\t\t\t\t\toptions.excludeLintStylistic\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: `\n\t\t\t\t\"plugin:@typescript-eslint/stylistic-type-checked\",`\n\t\t\t\t}\n\t\t\t],\n\t\t\tfiles: [\"**/*.ts\"],\n\t\t\tparser: \"@typescript-eslint/parser\",\n\t\t\tparserOptions: {\n\t\t\t\tproject: \"./tsconfig.eslint.json\",\n\t\t\t},${\n\t\t\t\toptions.excludeLintDeprecation\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `rules: {\n\t\t\t\t// These off-by-default rules work well for this repo and we like them on.\n\t\t\t\t\"deprecation/deprecation\": \"error\",\n\t\t\t},`\n\t\t\t}\n\t\t},\n\t\t${\n\t\t\toptions.excludeLintJson\n\t\t\t\t? \"\"\n\t\t\t\t: `{\n\t\t\texcludedFiles: [\"package.json\"],\n\t\t\textends: [\"plugin:jsonc/recommended-with-json\"],\n\t\t\tfiles: [\"*.json\", \"*.jsonc\"],\n\t\t\tparser: \"jsonc-eslint-parser\",\n\t\t\trules: {\n\t\t\t\t\"jsonc/sort-keys\": \"error\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: [\"*.jsonc\"],\n\t\t\trules: {\n\t\t\t\t\"jsonc/no-comments\": \"off\",\n\t\t\t},\n\t\t},`\n\t\t}${\n\t\t\toptions.excludeTests\n\t\t\t\t? \"\"\n\t\t\t\t: `\\n{\n\t\t\tfiles: \"**/*.test.ts\",\n\t\t\trules: {\n\t\t\t\t// These on-by-default rules aren't useful in test files.\n\t\t\t\t\"@typescript-eslint/no-unsafe-assignment\": \"off\",\n\t\t\t\t\"@typescript-eslint/no-unsafe-call\": \"off\",\n\t\t\t},\n\t\t},`\n\t\t}${\n\t\t\toptions.excludeLintYml\n\t\t\t\t? \"\"\n\t\t\t\t: `\\n{\n\t\t\textends: [\"plugin:yml/standard\", \"plugin:yml/prettier\"],\n\t\t\tfiles: [\"**/*.{yml,yaml}\"],\n\t\t\tparser: \"yaml-eslint-parser\",\n\t\t\trules: {\n\t\t\t\t\"yml/file-extension\": [\"error\", { extension: \"yml\" }],\n\t\t\t\t\"yml/sort-keys\": [\n\t\t\t\t\t\"error\",\n\t\t\t\t\t{\n\t\t\t\t\t\torder: { type: \"asc\" },\n\t\t\t\t\t\tpathPattern: \"^.*$\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\t\"yml/sort-sequence-values\": [\n\t\t\t\t\t\"error\",\n\t\t\t\t\t{\n\t\t\t\t\t\torder: { type: \"asc\" },\n\t\t\t\t\t\tpathPattern: \"^.*$\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t`\n\t\t}],\n\tparser: \"@typescript-eslint/parser\",\n\tplugins: [\n\t\t\"@typescript-eslint\",\n\t\t${\n\t\t\toptions.excludeLintDeprecation\n\t\t\t\t? \"\"\n\t\t\t\t: `\"deprecation\",\n\t\t`\n\t\t}${\n\t\t\toptions.excludeLintJSDoc\n\t\t\t\t? \"\"\n\t\t\t\t: `\"jsdoc\",\n\t\t`\n\t\t}${options.excludeTests ? \"\" : `\"no-only-tests\",`}${\n\t\t\toptions.excludeLintPerfectionist ? \"\" : `\"perfectionist\",`\n\t\t}${options.excludeLintRegex ? \"\" : `\"regexp\",`}${\n\t\t\toptions.excludeTests ? \"\" : `\\n\"vitest\",`\n\t\t}\n\t],\n\treportUnusedDisableDirectives: true,\n\troot: true,\n\trules: {\n\t\t// These off/less-strict-by-default rules work well for this repo and we like them on.\n\t\t\"@typescript-eslint/no-unused-vars\": [\"error\", { caughtErrors: \"all\" }],${\n\t\t\toptions.excludeTests ? \"\" : `\\n\"no-only-tests/no-only-tests\": \"error\",`\n\t\t}\n\n\t\t// These on-by-default rules don't work well for this repo and we like them off.\n\t\t\"no-case-declarations\": \"off\",\n\t\t\"no-constant-condition\": \"off\",\n\t\t\"no-inner-declarations\": \"off\",\n\t\t\"no-mixed-spaces-and-tabs\": \"off\",\n\n\t\t${\n\t\t\toptions.excludeLintStylistic\n\t\t\t\t? \"\"\n\t\t\t\t: `// Stylistic concerns that don't interfere with Prettier\n\t\t\"@typescript-eslint/padding-line-between-statements\": [\n\t\t\t\"error\",\n\t\t\t{ blankLine: \"always\", next: \"*\", prev: \"block-like\" },\n\t\t],\n\t\t`\n\t\t}${\n\t\t\toptions.excludeLintPerfectionist\n\t\t\t\t? \"\"\n\t\t\t\t: `\"perfectionist/sort-objects\": [\n\t\t\t\"error\",\n\t\t\t{\n\t\t\t\torder: \"asc\",\n\t\t\t\t\"partition-by-comment\": true,\n\t\t\t\ttype: \"natural\",\n\t\t\t},\n\t\t],`\n\t\t}\n\t},\n};\n`);\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AAEjC,eAAsB,eAAe,SAAkB;AACtD,SAAO,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAS5B,QAAQ,oBACL,KACA;AAAA,GAEJ,0BACC,QAAQ,2BACL,KACA;AAAA,8CAEJ,GAAG,QAAQ,mBAAmB,KAAK,8BAA8B;AAAA;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/writing/creation/createESLintRC.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\n\nexport async function createESLintRC(options: Options) {\n\treturn await formatTypeScript(`/** @type {import(\"@types/eslint\").Linter.Config} */\nmodule.exports = {\n\tenv: {\n\t\tes2022: true,\n\t\tnode: true,\n\t},\n\textends: [\n\t\t\"eslint:recommended\",\n\t\t${\n\t\t\toptions.excludeLintESLint\n\t\t\t\t? \"\"\n\t\t\t\t: `\"plugin:eslint-comments/recommended\",\n\t\t`\n\t\t}\"plugin:n/recommended\",${\n\t\t\toptions.excludeLintPerfectionist\n\t\t\t\t? \"\"\n\t\t\t\t: `\n\t\t\"plugin:perfectionist/recommended-natural\",`\n\t\t}${options.excludeLintRegex ? \"\" : `\"plugin:regexp/recommended\",`}${\n\t\t\toptions.excludeTests ? \"\" : `\"plugin:vitest/recommended\",`\n\t\t}\n\t],\n\toverrides: [${\n\t\toptions.excludeLintMd\n\t\t\t? \"\"\n\t\t\t: `\n\t\t{\n\t\t\textends: [\"plugin:markdown/recommended\"],\n\t\t\tfiles: [\"**/*.md\"],\n\t\t\tprocessor: \"markdown/markdown\",\n\t\t},`\n\t}\n\t\t{\n\t\t\textends: [\n\t\t\t\t${\n\t\t\t\t\toptions.excludeLintJSDoc\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: `\"plugin:jsdoc/recommended-typescript-error\",\n\t\t\t\t`\n\t\t\t\t}\"plugin:@typescript-eslint/${\n\t\t\t\t\toptions.excludeLintStrict ? \"recommended\" : \"strict\"\n\t\t\t\t}\",${\n\t\t\t\t\toptions.excludeLintStylistic\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: `\n\t\t\t\t\"plugin:@typescript-eslint/stylistic\",`\n\t\t\t\t}\n\t\t\t],\n\t\t\tfiles: [\"**/*.ts\"],\n\t\t\tparser: \"@typescript-eslint/parser\",\n\t\t\trules: {\n\t\t\t\t// These off-by-default rules work well for this repo and we like them on.\n\t\t\t\t${\n\t\t\t\t\toptions.excludeLintJSDoc\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: `\"jsdoc/informative-docs\": \"error\",\n\t\t\t\t`\n\t\t\t\t}\"logical-assignment-operators\": [\n\t\t\t\t\t\"error\",\n\t\t\t\t\t\"always\",\n\t\t\t\t\t{ enforceForIfStatements: true },\n\t\t\t\t],\n\t\t\t\t\"operator-assignment\": \"error\",${\n\t\t\t\t\toptions.excludeLintJSDoc\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: `\n\n\t\t\t\t// These on-by-default rules don't work well for this repo and we like them off.\n\t\t\t\t\"jsdoc/require-jsdoc\": \"off\",\n\t\t\t\t\"jsdoc/require-param\": \"off\",\n\t\t\t\t\"jsdoc/require-property\": \"off\",\n\t\t\t\t\"jsdoc/require-returns\": \"off\",`\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: \"**/*.md/*.ts\",\n\t\t\trules: {\n\t\t\t\t\"n/no-missing-import\": [\n\t\t\t\t\t\"error\",\n\t\t\t\t\t{ allowModules: [\"${options.repository}\"] },\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t${\n\t\t\t\toptions.excludeLintMd\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `excludedFiles: [\"**/*.md/*.ts\"],\n\t\t\t`\n\t\t\t}extends: [\n\t\t\t\t\"plugin:@typescript-eslint/${\n\t\t\t\t\toptions.excludeLintStrict ? \"recommended\" : \"strict\"\n\t\t\t\t}-type-checked\",${\n\t\t\t\t\toptions.excludeLintStylistic\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: `\n\t\t\t\t\"plugin:@typescript-eslint/stylistic-type-checked\",`\n\t\t\t\t}\n\t\t\t],\n\t\t\tfiles: [\"**/*.ts\"],\n\t\t\tparser: \"@typescript-eslint/parser\",\n\t\t\tparserOptions: {\n\t\t\t\tproject: \"./tsconfig.eslint.json\",\n\t\t\t},${\n\t\t\t\toptions.excludeLintDeprecation\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `rules: {\n\t\t\t\t// These off-by-default rules work well for this repo and we like them on.\n\t\t\t\t\"deprecation/deprecation\": \"error\",\n\t\t\t},`\n\t\t\t}\n\t\t},\n\t\t${\n\t\t\toptions.excludeLintJson\n\t\t\t\t? \"\"\n\t\t\t\t: `{\n\t\t\texcludedFiles: [\"package.json\"],\n\t\t\textends: [\"plugin:jsonc/recommended-with-json\"],\n\t\t\tfiles: [\"*.json\", \"*.jsonc\"],\n\t\t\tparser: \"jsonc-eslint-parser\",\n\t\t\trules: {\n\t\t\t\t\"jsonc/sort-keys\": \"error\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: [\"*.jsonc\"],\n\t\t\trules: {\n\t\t\t\t\"jsonc/no-comments\": \"off\",\n\t\t\t},\n\t\t},`\n\t\t}${\n\t\t\toptions.excludeTests\n\t\t\t\t? \"\"\n\t\t\t\t: `\\n{\n\t\t\tfiles: \"**/*.test.ts\",\n\t\t\trules: {\n\t\t\t\t// These on-by-default rules aren't useful in test files.\n\t\t\t\t\"@typescript-eslint/no-unsafe-assignment\": \"off\",\n\t\t\t\t\"@typescript-eslint/no-unsafe-call\": \"off\",\n\t\t\t},\n\t\t},`\n\t\t}${\n\t\t\toptions.excludeLintYml\n\t\t\t\t? \"\"\n\t\t\t\t: `\\n{\n\t\t\textends: [\"plugin:yml/standard\", \"plugin:yml/prettier\"],\n\t\t\tfiles: [\"**/*.{yml,yaml}\"],\n\t\t\tparser: \"yaml-eslint-parser\",\n\t\t\trules: {\n\t\t\t\t\"yml/file-extension\": [\"error\", { extension: \"yml\" }],\n\t\t\t\t\"yml/sort-keys\": [\n\t\t\t\t\t\"error\",\n\t\t\t\t\t{\n\t\t\t\t\t\torder: { type: \"asc\" },\n\t\t\t\t\t\tpathPattern: \"^.*$\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\t\"yml/sort-sequence-values\": [\n\t\t\t\t\t\"error\",\n\t\t\t\t\t{\n\t\t\t\t\t\torder: { type: \"asc\" },\n\t\t\t\t\t\tpathPattern: \"^.*$\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t`\n\t\t}],\n\tparser: \"@typescript-eslint/parser\",\n\tplugins: [\n\t\t\"@typescript-eslint\",\n\t\t${\n\t\t\toptions.excludeLintDeprecation\n\t\t\t\t? \"\"\n\t\t\t\t: `\"deprecation\",\n\t\t`\n\t\t}${\n\t\t\toptions.excludeLintJSDoc\n\t\t\t\t? \"\"\n\t\t\t\t: `\"jsdoc\",\n\t\t`\n\t\t}${options.excludeTests ? \"\" : `\"no-only-tests\",`}${\n\t\t\toptions.excludeLintPerfectionist ? \"\" : `\"perfectionist\",`\n\t\t}${options.excludeLintRegex ? \"\" : `\"regexp\",`}${\n\t\t\toptions.excludeTests ? \"\" : `\\n\"vitest\",`\n\t\t}\n\t],\n\treportUnusedDisableDirectives: true,\n\troot: true,\n\trules: {\n\t\t// These off/less-strict-by-default rules work well for this repo and we like them on.\n\t\t\"@typescript-eslint/no-unused-vars\": [\"error\", { caughtErrors: \"all\" }],${\n\t\t\toptions.excludeTests ? \"\" : `\\n\"no-only-tests/no-only-tests\": \"error\",`\n\t\t}\n\n\t\t// These on-by-default rules don't work well for this repo and we like them off.\n\t\t\"no-case-declarations\": \"off\",\n\t\t\"no-constant-condition\": \"off\",\n\t\t\"no-inner-declarations\": \"off\",\n\t\t\"no-mixed-spaces-and-tabs\": \"off\",\n\n\t\t${\n\t\t\toptions.excludeLintStylistic\n\t\t\t\t? \"\"\n\t\t\t\t: `// Stylistic concerns that don't interfere with Prettier\n\t\t\"@typescript-eslint/padding-line-between-statements\": [\n\t\t\t\"error\",\n\t\t\t{ blankLine: \"always\", next: \"*\", prev: \"block-like\" },\n\t\t],\n\t\t`\n\t\t}${\n\t\t\toptions.excludeLintPerfectionist\n\t\t\t\t? \"\"\n\t\t\t\t: `\"perfectionist/sort-objects\": [\n\t\t\t\"error\",\n\t\t\t{\n\t\t\t\torder: \"asc\",\n\t\t\t\t\"partition-by-comment\": true,\n\t\t\t\ttype: \"natural\",\n\t\t\t},\n\t\t],`\n\t\t}\n\t},\n};\n`);\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AAEjC,eAAsB,eAAe,SAAkB;AACtD,SAAO,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAS5B,QAAQ,oBACL,KACA;AAAA,GAEJ,0BACC,QAAQ,2BACL,KACA;AAAA,8CAEJ,GAAG,QAAQ,mBAAmB,KAAK,8BAA8B,GAChE,QAAQ,eAAe,KAAK,8BAC7B;AAAA;AAAA,eAGA,QAAQ,gBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA,KAMJ;AAAA;AAAA;AAAA,MAII,QAAQ,mBACL,KACA;AAAA,KAEJ,8BACC,QAAQ,oBAAoB,gBAAgB,QAC7C,KACC,QAAQ,uBACL,KACA;AAAA,2CAEJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOC,QAAQ,mBACL,KACA;AAAA,KAEJ;AAAA;AAAA;AAAA;AAAA;AAAA,qCAMC,QAAQ,mBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oCAOJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAQqB,QAAQ,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,KAMvC,QAAQ,gBACL,KACA;AAAA,IAEJ;AAAA,iCAEE,QAAQ,oBAAoB,gBAAgB,QAC7C,kBACC,QAAQ,uBACL,KACA;AAAA,wDAEJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAOA,QAAQ,yBACL,KACA;AAAA;AAAA;AAAA,MAIJ;AAAA;AAAA,IAGA,QAAQ,kBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAeJ,GACC,QAAQ,eACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAQJ,GACC,QAAQ,iBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuBJ;AAAA;AAAA;AAAA;AAAA,IAKC,QAAQ,yBACL,KACA;AAAA,GAEJ,GACC,QAAQ,mBACL,KACA;AAAA,GAEJ,GAAG,QAAQ,eAAe,KAAK,kBAAkB,GAChD,QAAQ,2BAA2B,KAAK,kBACzC,GAAG,QAAQ,mBAAmB,KAAK,WAAW,GAC7C,QAAQ,eAAe,KAAK;AAAA,UAC7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4EAOC,QAAQ,eAAe,KAAK;AAAA,wCAC7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASC,QAAQ,uBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA,GAMJ,GACC,QAAQ,2BACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAQJ;AAAA;AAAA;AAAA,CAGD;AACD;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/steps/writing/creation/dotGitHub/createDevelopment.ts"],"sourcesContent":["import { Options } from \"../../../../shared/types.js\";\n\nexport function createDevelopment(options: Options) {\n\tconst lintLines = [\n\t\t!options.excludeLintKnip &&\n\t\t\t`- \\`pnpm lint:knip\\` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports`,\n\t\t!options.excludeLintMd &&\n\t\t\t`- \\`pnpm lint:md\\` ([Markdownlint](https://github.com/DavidAnson/markdownlint)): Checks Markdown source files`,\n\t\t!options.excludeLintPackageJson &&\n\t\t\t`- \\`pnpm lint:package-json\\` ([npm-package-json-lint](https://npmpackagejsonlint.org/)): Lints the \\`package.json\\` file`,\n\t\t!options.excludeLintPackages &&\n\t\t\t`- \\`pnpm lint:packages\\` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the \\`pnpm-lock.yml\\` file`,\n\t\t!options.excludeLintSpelling &&\n\t\t\t`- \\`pnpm lint:spelling\\` ([cspell](https://cspell.org)): Spell checks across all source files`,\n\t].filter(Boolean);\n\n\treturn `# Development\n\nAfter [forking the repo from GitHub](https://help.github.com/articles/fork-a-repo) and [installing pnpm](https://pnpm.io/installation):\n\n\\`\\`\\`shell\ngit clone https://github.com/<your-name-here>/${options.repository}\ncd ${options.repository}\npnpm install\n\\`\\`\\`\n\n> This repository includes a list of suggested VS Code extensions.\n> It's a good idea to use [VS Code](https://code.visualstudio.com) and accept its suggestion to install them, as they'll help with development.\n\n## Building\n\nRun [**tsup**](https://tsup.egoist.dev) locally to build source files from \\`src/\\` into output files in \\`lib/\\`:\n\n\\`\\`\\`shell\npnpm build\n\\`\\`\\`\n\nAdd \\`--watch\\` to run the builder in a watch mode that continuously cleans and recreates \\`lib/\\` as you save files:\n\n\\`\\`\\`shell\npnpm build --watch\n\\`\\`\\`\n\n## Formatting\n\n[Prettier](https://prettier.io) is used to format code.\nIt should be applied automatically when you save files in VS Code or make a Git commit.\n\nTo manually reformat all files, you can run:\n\n\\`\\`\\`shell\npnpm format
|
|
1
|
+
{"version":3,"sources":["../../../../../src/steps/writing/creation/dotGitHub/createDevelopment.ts"],"sourcesContent":["import { Options } from \"../../../../shared/types.js\";\n\nexport function createDevelopment(options: Options) {\n\tconst lintLines = [\n\t\t!options.excludeLintKnip &&\n\t\t\t`- \\`pnpm lint:knip\\` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports`,\n\t\t!options.excludeLintMd &&\n\t\t\t`- \\`pnpm lint:md\\` ([Markdownlint](https://github.com/DavidAnson/markdownlint)): Checks Markdown source files`,\n\t\t!options.excludeLintPackageJson &&\n\t\t\t`- \\`pnpm lint:package-json\\` ([npm-package-json-lint](https://npmpackagejsonlint.org/)): Lints the \\`package.json\\` file`,\n\t\t!options.excludeLintPackages &&\n\t\t\t`- \\`pnpm lint:packages\\` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the \\`pnpm-lock.yml\\` file`,\n\t\t!options.excludeLintSpelling &&\n\t\t\t`- \\`pnpm lint:spelling\\` ([cspell](https://cspell.org)): Spell checks across all source files`,\n\t].filter(Boolean);\n\n\treturn `# Development\n\nAfter [forking the repo from GitHub](https://help.github.com/articles/fork-a-repo) and [installing pnpm](https://pnpm.io/installation):\n\n\\`\\`\\`shell\ngit clone https://github.com/<your-name-here>/${options.repository}\ncd ${options.repository}\npnpm install\n\\`\\`\\`\n\n> This repository includes a list of suggested VS Code extensions.\n> It's a good idea to use [VS Code](https://code.visualstudio.com) and accept its suggestion to install them, as they'll help with development.\n\n## Building\n\nRun [**tsup**](https://tsup.egoist.dev) locally to build source files from \\`src/\\` into output files in \\`lib/\\`:\n\n\\`\\`\\`shell\npnpm build\n\\`\\`\\`\n\nAdd \\`--watch\\` to run the builder in a watch mode that continuously cleans and recreates \\`lib/\\` as you save files:\n\n\\`\\`\\`shell\npnpm build --watch\n\\`\\`\\`\n\n## Formatting\n\n[Prettier](https://prettier.io) is used to format code.\nIt should be applied automatically when you save files in VS Code or make a Git commit.\n\nTo manually reformat all files, you can run:\n\n\\`\\`\\`shell\npnpm format --write\n\\`\\`\\`\n\n## Linting\n\n${\n\tlintLines.length\n\t\t? [\n\t\t\t\t`This package includes several forms of linting to enforce consistent code quality and styling.`,\n\t\t\t\t`Each should be shown in VS Code, and can be run manually on the command-line:`,\n\t\t\t\t``,\n\t\t\t\t`- \\`pnpm lint\\` ([ESLint](https://eslint.org) with [typescript-eslint](https://typescript-eslint.io)): Lints JavaScript and TypeScript source files`,\n\t\t\t\t...lintLines,\n\t\t\t\t``,\n\t\t\t\t`Read the individual documentation for each linter to understand how it can be configured and used best.`,\n\t\t\t\t``,\n\t\t\t\t`For example, ESLint can be run with \\`--fix\\` to auto-fix some lint rule complaints:`,\n\t\t ].join(\"\\n\")\n\t\t: `[ESLint](https://eslint.org) is used with with [typescript-eslint](https://typescript-eslint.io)) to lint JavaScript and TypeScript source files.\nYou can run it locally on the command-line:\n\n\\`\\`\\`shell\npnpm run lint\n\\`\\`\\`\n\nESLint can be run with \\`--fix\\` to auto-fix some lint rule complaints:`\n}\n\n\\`\\`\\`shell\npnpm run lint --fix\n\\`\\`\\`\n\n${\n\t!options.excludeTests &&\n\t`## Testing\n\n[Vitest](https://vitest.dev) is used for tests.\nYou can run it locally on the command-line:\n\n\\`\\`\\`shell\npnpm run test\n\\`\\`\\`\n\nAdd the \\`--coverage\\` flag to compute test coverage and place reports in the \\`coverage/\\` directory:\n\n\\`\\`\\`shell\npnpm run test --coverage\n\\`\\`\\`\n\nNote that [console-fail-test](https://github.com/JoshuaKGoldberg/console-fail-test) is enabled for all test runs.\nCalls to \\`console.log\\`, \\`console.warn\\`, and other console methods will cause a test to fail.\n\n### Debugging Tests\n\nThis repository includes a [VS Code launch configuration](https://code.visualstudio.com/docs/editor/debugging) for debugging unit tests.\nTo launch it, open a test file, then run _Debug Current Test File_ from the VS Code Debug panel (or press F5).\n`\n}\n## Type Checking\n\nYou should be able to see suggestions from [TypeScript](https://typescriptlang.org) in your editor for all open files.\n\nHowever, it can be useful to run the TypeScript command-line (\\`tsc\\`) to type check all files in \\`src/\\`:\n\n\\`\\`\\`shell\npnpm tsc\n\\`\\`\\`\n\nAdd \\`--watch\\` to keep the type checker running in a watch mode that updates the display as you save files:\n\n\\`\\`\\`shell\npnpm tsc --watch\n\\`\\`\\`\n`;\n}\n"],"mappings":"AAEO,SAAS,kBAAkB,SAAkB;AACnD,QAAM,YAAY;AAAA,IACjB,CAAC,QAAQ,mBACR;AAAA,IACD,CAAC,QAAQ,iBACR;AAAA,IACD,CAAC,QAAQ,0BACR;AAAA,IACD,CAAC,QAAQ,uBACR;AAAA,IACD,CAAC,QAAQ,uBACR;AAAA,EACF,EAAE,OAAO,OAAO;AAEhB,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA,gDAKwC,QAAQ,UAAU;AAAA,KAC7D,QAAQ,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmCtB,UAAU,SACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACA,EAAE,KAAK,IAAI,IACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wEAQJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOC,CAAC,QAAQ,gBACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAuBD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBA;","names":[]}
|