create-typescript-app 1.29.47 → 1.29.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/lib/create/createWithOptions.js +1 -1
- package/lib/create/createWithOptions.js.map +1 -1
- package/lib/migrate/migrateWithOptions.js +1 -1
- package/lib/migrate/migrateWithOptions.js.map +1 -1
- package/lib/shared/options/augmentOptionsWithExcludes.js +46 -13
- package/lib/shared/options/augmentOptionsWithExcludes.js.map +1 -1
- package/lib/shared/options/readOptions.js +6 -1
- package/lib/shared/options/readOptions.js.map +1 -1
- package/lib/shared/types.d.ts +1 -1
- package/lib/steps/writeReadme/findExistingBadges.d.ts +4 -0
- package/lib/steps/writeReadme/findExistingBadges.js +31 -0
- package/lib/steps/writeReadme/findExistingBadges.js.map +1 -0
- package/lib/steps/writeReadme/findIntroSectionClose.d.ts +3 -0
- package/lib/steps/writeReadme/findIntroSectionClose.js +18 -0
- package/lib/steps/writeReadme/findIntroSectionClose.js.map +1 -0
- package/lib/steps/writeReadme/generateTopContent.d.ts +5 -0
- package/lib/steps/writeReadme/generateTopContent.js +72 -0
- package/lib/steps/writeReadme/generateTopContent.js.map +1 -0
- package/lib/steps/{writeReadme.d.ts → writeReadme/index.d.ts} +1 -1
- package/lib/steps/writeReadme/index.js +57 -0
- package/lib/steps/writeReadme/index.js.map +1 -0
- package/package.json +2 -2
- package/lib/steps/writeReadme.js +0 -86
- package/lib/steps/writeReadme.js.map +0 -1
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
</p>
|
|
28
28
|
|
|
29
29
|
Note that this template is early stage, opinionated, and not endorsed by the TypeScript team.
|
|
30
|
-
It
|
|
30
|
+
It can be configured to set up a _lot_ of tooling out of the box.
|
|
31
31
|
Each of the included tools exists for a good reason and provides real value.
|
|
32
32
|
|
|
33
33
|
If you don't want to use any particular tool, you can always remove it manually.
|
|
@@ -50,7 +50,7 @@ Use the corresponding docs page to get started:
|
|
|
50
50
|
## Explainer
|
|
51
51
|
|
|
52
52
|
This template is available for anybody who wants to set up a Node application using TypeScript.
|
|
53
|
-
It
|
|
53
|
+
It can set up the following tooling for you:
|
|
54
54
|
|
|
55
55
|
- [**All Contributors**](https://allcontributors.org): Tracks various kinds of contributions and displays them in a nicely formatted table in the README.md.
|
|
56
56
|
- [**ESLint**](https://eslint.org): Static analysis for JavaScript code, configured with [typescript-eslint](https://typescript-eslint.io) for TypeScript code and other general-use plugins.
|
|
@@ -6,7 +6,7 @@ import { addToolAllContributors } from "../steps/addToolAllContributors.js";
|
|
|
6
6
|
import { finalizeDependencies } from "../steps/finalizeDependencies.js";
|
|
7
7
|
import { initializeGitHubRepository } from "../steps/initializeGitHubRepository/index.js";
|
|
8
8
|
import { runCommands } from "../steps/runCommands.js";
|
|
9
|
-
import { writeReadme } from "../steps/writeReadme.js";
|
|
9
|
+
import { writeReadme } from "../steps/writeReadme/index.js";
|
|
10
10
|
import { writeStructure } from "../steps/writing/writeStructure.js";
|
|
11
11
|
async function createWithOptions({ github, options }) {
|
|
12
12
|
await withSpinners("Creating repository structure", [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/create/createWithOptions.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport { $ } from \"execa\";\n\nimport { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { doesRepositoryExist } from \"../shared/doesRepositoryExist.js\";\nimport { GitHubAndOptions } from \"../shared/options/readOptions.js\";\nimport { addToolAllContributors } from \"../steps/addToolAllContributors.js\";\nimport { finalizeDependencies } from \"../steps/finalizeDependencies.js\";\nimport { initializeGitHubRepository } from \"../steps/initializeGitHubRepository/index.js\";\nimport { runCommands } from \"../steps/runCommands.js\";\nimport { writeReadme } from \"../steps/writeReadme.js\";\nimport { writeStructure } from \"../steps/writing/writeStructure.js\";\n\nexport async function createWithOptions({ github, options }: GitHubAndOptions) {\n\tawait withSpinners(\"Creating repository structure\", [\n\t\t[\n\t\t\t\"Writing structure\",\n\t\t\tasync () => {\n\t\t\t\tawait writeStructure(options, \"create\");\n\t\t\t},\n\t\t],\n\t\t[\n\t\t\t\"Writing README.md\",\n\t\t\tasync () => {\n\t\t\t\tawait writeReadme(options);\n\t\t\t},\n\t\t],\n\t]);\n\n\tif (!options.excludeContributors) {\n\t\tawait withSpinner(\"Adding contributors to table\", async () => {\n\t\t\tawait addToolAllContributors(options.owner);\n\t\t});\n\t}\n\n\tif (!options.skipInstall) {\n\t\tawait withSpinner(\"Installing packages\", async () =>\n\t\t\tfinalizeDependencies(options),\n\t\t);\n\t}\n\n\tawait runCommands(\"Cleaning up files\", [\n\t\t\"pnpm dedupe\",\n\t\t\"pnpm format --write\",\n\t\t\"pnpm lint --fix\",\n\t]);\n\n\tconst sendToGitHub =\n\t\tgithub &&\n\t\t(await doesRepositoryExist(github.octokit, options)) &&\n\t\t(options.createRepository ??\n\t\t\t(await prompts.confirm({\n\t\t\t\tmessage:\n\t\t\t\t\t\"Would you like to push the template's tooling up to the repository on GitHub?\",\n\t\t\t})) === true);\n\n\tif (sendToGitHub) {\n\t\tawait withSpinner(\"Initializing GitHub repository\", async () => {\n\t\t\tawait $`git remote add origin https://github.com/${options.owner}/${options.repository}`;\n\t\t\tawait $`git add -A`;\n\t\t\tawait $`git commit --message ${\"feat: initialized repo ✨\"}`;\n\t\t\tawait $`git push -u origin main --force`;\n\t\t\tawait initializeGitHubRepository(github.octokit, options);\n\t\t});\n\t}\n\n\treturn { sentToGitHub: sendToGitHub };\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,SAAS,SAAS;AAElB,SAAS,aAAa,oBAAoB;AAC1C,SAAS,2BAA2B;AAEpC,SAAS,8BAA8B;AACvC,SAAS,4BAA4B;AACrC,SAAS,kCAAkC;AAC3C,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAE/B,eAAsB,kBAAkB,EAAE,QAAQ,QAAQ,GAAqB;AAC9E,QAAM,aAAa,iCAAiC;AAAA,IACnD;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,eAAe,SAAS,QAAQ;AAAA,MACvC;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,YAAY,OAAO;AAAA,MAC1B;AAAA,IACD;AAAA,EACD,CAAC;AAED,MAAI,CAAC,QAAQ,qBAAqB;AACjC,UAAM,YAAY,gCAAgC,YAAY;AAC7D,YAAM,uBAAuB,QAAQ,KAAK;AAAA,IAC3C,CAAC;AAAA,EACF;AAEA,MAAI,CAAC,QAAQ,aAAa;AACzB,UAAM;AAAA,MAAY;AAAA,MAAuB,YACxC,qBAAqB,OAAO;AAAA,IAC7B;AAAA,EACD;AAEA,QAAM,YAAY,qBAAqB;AAAA,IACtC;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAC;AAED,QAAM,eACL,UACC,MAAM,oBAAoB,OAAO,SAAS,OAAO,MACjD,QAAQ,oBACP,MAAM,QAAQ,QAAQ;AAAA,IACtB,SACC;AAAA,EACF,CAAC,MAAO;AAEV,MAAI,cAAc;AACjB,UAAM,YAAY,kCAAkC,YAAY;AAC/D,YAAM,6CAA6C,QAAQ,KAAK,IAAI,QAAQ,UAAU;AACtF,YAAM;AACN,YAAM,yBAAyB,+BAA0B;AACzD,YAAM;AACN,YAAM,2BAA2B,OAAO,SAAS,OAAO;AAAA,IACzD,CAAC;AAAA,EACF;AAEA,SAAO,EAAE,cAAc,aAAa;AACrC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/create/createWithOptions.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport { $ } from \"execa\";\n\nimport { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { doesRepositoryExist } from \"../shared/doesRepositoryExist.js\";\nimport { GitHubAndOptions } from \"../shared/options/readOptions.js\";\nimport { addToolAllContributors } from \"../steps/addToolAllContributors.js\";\nimport { finalizeDependencies } from \"../steps/finalizeDependencies.js\";\nimport { initializeGitHubRepository } from \"../steps/initializeGitHubRepository/index.js\";\nimport { runCommands } from \"../steps/runCommands.js\";\nimport { writeReadme } from \"../steps/writeReadme/index.js\";\nimport { writeStructure } from \"../steps/writing/writeStructure.js\";\n\nexport async function createWithOptions({ github, options }: GitHubAndOptions) {\n\tawait withSpinners(\"Creating repository structure\", [\n\t\t[\n\t\t\t\"Writing structure\",\n\t\t\tasync () => {\n\t\t\t\tawait writeStructure(options, \"create\");\n\t\t\t},\n\t\t],\n\t\t[\n\t\t\t\"Writing README.md\",\n\t\t\tasync () => {\n\t\t\t\tawait writeReadme(options);\n\t\t\t},\n\t\t],\n\t]);\n\n\tif (!options.excludeContributors) {\n\t\tawait withSpinner(\"Adding contributors to table\", async () => {\n\t\t\tawait addToolAllContributors(options.owner);\n\t\t});\n\t}\n\n\tif (!options.skipInstall) {\n\t\tawait withSpinner(\"Installing packages\", async () =>\n\t\t\tfinalizeDependencies(options),\n\t\t);\n\t}\n\n\tawait runCommands(\"Cleaning up files\", [\n\t\t\"pnpm dedupe\",\n\t\t\"pnpm format --write\",\n\t\t\"pnpm lint --fix\",\n\t]);\n\n\tconst sendToGitHub =\n\t\tgithub &&\n\t\t(await doesRepositoryExist(github.octokit, options)) &&\n\t\t(options.createRepository ??\n\t\t\t(await prompts.confirm({\n\t\t\t\tmessage:\n\t\t\t\t\t\"Would you like to push the template's tooling up to the repository on GitHub?\",\n\t\t\t})) === true);\n\n\tif (sendToGitHub) {\n\t\tawait withSpinner(\"Initializing GitHub repository\", async () => {\n\t\t\tawait $`git remote add origin https://github.com/${options.owner}/${options.repository}`;\n\t\t\tawait $`git add -A`;\n\t\t\tawait $`git commit --message ${\"feat: initialized repo ✨\"}`;\n\t\t\tawait $`git push -u origin main --force`;\n\t\t\tawait initializeGitHubRepository(github.octokit, options);\n\t\t});\n\t}\n\n\treturn { sentToGitHub: sendToGitHub };\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,SAAS,SAAS;AAElB,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
6
|
import { runCommands } from "../steps/runCommands.js";
|
|
7
7
|
import { updateAllContributorsTable } from "../steps/updateAllContributorsTable.js";
|
|
8
8
|
import { updateLocalFiles } from "../steps/updateLocalFiles.js";
|
|
9
|
-
import { writeReadme } from "../steps/writeReadme.js";
|
|
9
|
+
import { writeReadme } from "../steps/writeReadme/index.js";
|
|
10
10
|
import { writeStructure } from "../steps/writing/writeStructure.js";
|
|
11
11
|
async function migrateWithOptions({
|
|
12
12
|
github,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/migrate/migrateWithOptions.ts"],"sourcesContent":["import { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { GitHubAndOptions } from \"../shared/options/readOptions.js\";\nimport { clearUnnecessaryFiles } from \"../steps/clearUnnecessaryFiles.js\";\nimport { detectExistingContributors } from \"../steps/detectExistingContributors.js\";\nimport { finalizeDependencies } from \"../steps/finalizeDependencies.js\";\nimport { initializeGitHubRepository } from \"../steps/initializeGitHubRepository/index.js\";\nimport { runCommands } from \"../steps/runCommands.js\";\nimport { updateAllContributorsTable } from \"../steps/updateAllContributorsTable.js\";\nimport { updateLocalFiles } from \"../steps/updateLocalFiles.js\";\nimport { writeReadme } from \"../steps/writeReadme.js\";\nimport { writeStructure } from \"../steps/writing/writeStructure.js\";\n\nexport async function migrateWithOptions({\n\tgithub,\n\toptions,\n}: GitHubAndOptions) {\n\tawait withSpinners(\"Migrating repository structure\", [\n\t\t[\"Clearing unnecessary files\", clearUnnecessaryFiles],\n\t\t[\n\t\t\t\"Writing structure\",\n\t\t\tasync () => {\n\t\t\t\tawait writeStructure(options, \"migrate\");\n\t\t\t},\n\t\t],\n\t\t[\n\t\t\t\"Writing README.md\",\n\t\t\tasync () => {\n\t\t\t\tawait writeReadme(options);\n\t\t\t},\n\t\t],\n\t\t[\n\t\t\t\"Updating local files\",\n\t\t\tasync () => {\n\t\t\t\tawait updateLocalFiles(options);\n\t\t\t},\n\t\t],\n\t\t[\n\t\t\t\"Updating all-contributors table\",\n\t\t\tasync () => {\n\t\t\t\tawait updateAllContributorsTable(options);\n\t\t\t},\n\t\t],\n\t]);\n\n\tif (github) {\n\t\tawait withSpinner(\"Initializing GitHub repository\", async () => {\n\t\t\tawait initializeGitHubRepository(github.octokit, options);\n\t\t});\n\t}\n\n\tif (!options.excludeContributors) {\n\t\tawait withSpinner(\"Detecting existing contributors\", async () =>\n\t\t\tdetectExistingContributors(github?.auth, options),\n\t\t);\n\t}\n\n\tif (!options.skipInstall) {\n\t\tawait withSpinner(\"Installing packages\", async () =>\n\t\t\tfinalizeDependencies(options),\n\t\t);\n\t}\n\n\tawait runCommands(\"Cleaning up files\", [\n\t\t\"pnpm lint --fix\",\n\t\t\"pnpm format --write\",\n\t]);\n}\n"],"mappings":"AAAA,SAAS,aAAa,oBAAoB;AAE1C,SAAS,6BAA6B;AACtC,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AACrC,SAAS,kCAAkC;AAC3C,SAAS,mBAAmB;AAC5B,SAAS,kCAAkC;AAC3C,SAAS,wBAAwB;AACjC,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAE/B,eAAsB,mBAAmB;AAAA,EACxC;AAAA,EACA;AACD,GAAqB;AACpB,QAAM,aAAa,kCAAkC;AAAA,IACpD,CAAC,8BAA8B,qBAAqB;AAAA,IACpD;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,eAAe,SAAS,SAAS;AAAA,MACxC;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,YAAY,OAAO;AAAA,MAC1B;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,iBAAiB,OAAO;AAAA,MAC/B;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,2BAA2B,OAAO;AAAA,MACzC;AAAA,IACD;AAAA,EACD,CAAC;AAED,MAAI,QAAQ;AACX,UAAM,YAAY,kCAAkC,YAAY;AAC/D,YAAM,2BAA2B,OAAO,SAAS,OAAO;AAAA,IACzD,CAAC;AAAA,EACF;AAEA,MAAI,CAAC,QAAQ,qBAAqB;AACjC,UAAM;AAAA,MAAY;AAAA,MAAmC,YACpD,2BAA2B,QAAQ,MAAM,OAAO;AAAA,IACjD;AAAA,EACD;AAEA,MAAI,CAAC,QAAQ,aAAa;AACzB,UAAM;AAAA,MAAY;AAAA,MAAuB,YACxC,qBAAqB,OAAO;AAAA,IAC7B;AAAA,EACD;AAEA,QAAM,YAAY,qBAAqB;AAAA,IACtC;AAAA,IACA;AAAA,EACD,CAAC;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/migrate/migrateWithOptions.ts"],"sourcesContent":["import { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { GitHubAndOptions } from \"../shared/options/readOptions.js\";\nimport { clearUnnecessaryFiles } from \"../steps/clearUnnecessaryFiles.js\";\nimport { detectExistingContributors } from \"../steps/detectExistingContributors.js\";\nimport { finalizeDependencies } from \"../steps/finalizeDependencies.js\";\nimport { initializeGitHubRepository } from \"../steps/initializeGitHubRepository/index.js\";\nimport { runCommands } from \"../steps/runCommands.js\";\nimport { updateAllContributorsTable } from \"../steps/updateAllContributorsTable.js\";\nimport { updateLocalFiles } from \"../steps/updateLocalFiles.js\";\nimport { writeReadme } from \"../steps/writeReadme/index.js\";\nimport { writeStructure } from \"../steps/writing/writeStructure.js\";\n\nexport async function migrateWithOptions({\n\tgithub,\n\toptions,\n}: GitHubAndOptions) {\n\tawait withSpinners(\"Migrating repository structure\", [\n\t\t[\"Clearing unnecessary files\", clearUnnecessaryFiles],\n\t\t[\n\t\t\t\"Writing structure\",\n\t\t\tasync () => {\n\t\t\t\tawait writeStructure(options, \"migrate\");\n\t\t\t},\n\t\t],\n\t\t[\n\t\t\t\"Writing README.md\",\n\t\t\tasync () => {\n\t\t\t\tawait writeReadme(options);\n\t\t\t},\n\t\t],\n\t\t[\n\t\t\t\"Updating local files\",\n\t\t\tasync () => {\n\t\t\t\tawait updateLocalFiles(options);\n\t\t\t},\n\t\t],\n\t\t[\n\t\t\t\"Updating all-contributors table\",\n\t\t\tasync () => {\n\t\t\t\tawait updateAllContributorsTable(options);\n\t\t\t},\n\t\t],\n\t]);\n\n\tif (github) {\n\t\tawait withSpinner(\"Initializing GitHub repository\", async () => {\n\t\t\tawait initializeGitHubRepository(github.octokit, options);\n\t\t});\n\t}\n\n\tif (!options.excludeContributors) {\n\t\tawait withSpinner(\"Detecting existing contributors\", async () =>\n\t\t\tdetectExistingContributors(github?.auth, options),\n\t\t);\n\t}\n\n\tif (!options.skipInstall) {\n\t\tawait withSpinner(\"Installing packages\", async () =>\n\t\t\tfinalizeDependencies(options),\n\t\t);\n\t}\n\n\tawait runCommands(\"Cleaning up files\", [\n\t\t\"pnpm lint --fix\",\n\t\t\"pnpm format --write\",\n\t]);\n}\n"],"mappings":"AAAA,SAAS,aAAa,oBAAoB;AAE1C,SAAS,6BAA6B;AACtC,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AACrC,SAAS,kCAAkC;AAC3C,SAAS,mBAAmB;AAC5B,SAAS,kCAAkC;AAC3C,SAAS,wBAAwB;AACjC,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAE/B,eAAsB,mBAAmB;AAAA,EACxC;AAAA,EACA;AACD,GAAqB;AACpB,QAAM,aAAa,kCAAkC;AAAA,IACpD,CAAC,8BAA8B,qBAAqB;AAAA,IACpD;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,eAAe,SAAS,SAAS;AAAA,MACxC;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,YAAY,OAAO;AAAA,MAC1B;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,iBAAiB,OAAO;AAAA,MAC/B;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,2BAA2B,OAAO;AAAA,MACzC;AAAA,IACD;AAAA,EACD,CAAC;AAED,MAAI,QAAQ;AACX,UAAM,YAAY,kCAAkC,YAAY;AAC/D,YAAM,2BAA2B,OAAO,SAAS,OAAO;AAAA,IACzD,CAAC;AAAA,EACF;AAEA,MAAI,CAAC,QAAQ,qBAAqB;AACjC,UAAM;AAAA,MAAY;AAAA,MAAmC,YACpD,2BAA2B,QAAQ,MAAM,OAAO;AAAA,IACjD;AAAA,EACD;AAEA,MAAI,CAAC,QAAQ,aAAa;AACzB,UAAM;AAAA,MAAY;AAAA,MAAuB,YACxC,qBAAqB,OAAO;AAAA,IAC7B;AAAA,EACD;AAEA,QAAM,YAAY,qBAAqB;AAAA,IACtC;AAAA,IACA;AAAA,EACD,CAAC;AACF;","names":[]}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as prompts from "@clack/prompts";
|
|
2
|
+
import chalk from "chalk";
|
|
2
3
|
import { filterPromptCancel } from "../prompts.js";
|
|
3
4
|
const exclusionDescriptions = {
|
|
4
5
|
excludeCompliance: {
|
|
5
6
|
hint: "--exclude-compliance",
|
|
6
|
-
label: "Add a GitHub Actions workflow to verify that PRs match an expected format."
|
|
7
|
+
label: "Add a GitHub Actions workflow to verify that PRs match an expected format.",
|
|
8
|
+
uncommon: true
|
|
7
9
|
},
|
|
8
10
|
excludeContributors: {
|
|
9
11
|
hint: "--exclude-contributors",
|
|
@@ -11,7 +13,8 @@ const exclusionDescriptions = {
|
|
|
11
13
|
},
|
|
12
14
|
excludeLintJson: {
|
|
13
15
|
hint: "--exclude-lint-json",
|
|
14
|
-
label: "Apply linting and sorting to *.json and *.jsonc files."
|
|
16
|
+
label: "Apply linting and sorting to *.json and *.jsonc files.",
|
|
17
|
+
uncommon: true
|
|
15
18
|
},
|
|
16
19
|
excludeLintKnip: {
|
|
17
20
|
hint: "--exclude-lint-knip",
|
|
@@ -19,27 +22,33 @@ const exclusionDescriptions = {
|
|
|
19
22
|
},
|
|
20
23
|
excludeLintMd: {
|
|
21
24
|
hint: "--exclude-lint-md",
|
|
22
|
-
label: "Apply linting to *.md files."
|
|
25
|
+
label: "Apply linting to *.md files.",
|
|
26
|
+
uncommon: true
|
|
23
27
|
},
|
|
24
28
|
excludeLintPackageJson: {
|
|
25
29
|
hint: "--exclude-lint-package-json",
|
|
26
|
-
label: "Add npm-package-json-lint to lint for package.json correctness."
|
|
30
|
+
label: "Add npm-package-json-lint to lint for package.json correctness.",
|
|
31
|
+
uncommon: true
|
|
27
32
|
},
|
|
28
33
|
excludeLintPackages: {
|
|
29
34
|
hint: "--exclude-lint-packages",
|
|
30
|
-
label: "Add a pnpm dedupe workflow to ensure packages aren't duplicated unnecessarily."
|
|
35
|
+
label: "Add a pnpm dedupe workflow to ensure packages aren't duplicated unnecessarily.",
|
|
36
|
+
uncommon: true
|
|
31
37
|
},
|
|
32
38
|
excludeLintPerfectionist: {
|
|
33
39
|
hint: "--exclude-lint-perfectionist",
|
|
34
|
-
label: "Apply eslint-plugin-perfectionist to ensure imports, keys, and so on are in sorted order."
|
|
40
|
+
label: "Apply eslint-plugin-perfectionist to ensure imports, keys, and so on are in sorted order.",
|
|
41
|
+
uncommon: true
|
|
35
42
|
},
|
|
36
43
|
excludeLintSpelling: {
|
|
37
44
|
hint: "--exclude-lint-spelling",
|
|
38
|
-
label: "Add cspell to spell check against dictionaries of known words."
|
|
45
|
+
label: "Add cspell to spell check against dictionaries of known words.",
|
|
46
|
+
uncommon: true
|
|
39
47
|
},
|
|
40
48
|
excludeLintYml: {
|
|
41
49
|
hint: "--exclude-lint-yml",
|
|
42
|
-
label: "Apply linting and sorting to *.yaml and *.yml files."
|
|
50
|
+
label: "Apply linting and sorting to *.yaml and *.yml files.",
|
|
51
|
+
uncommon: true
|
|
43
52
|
},
|
|
44
53
|
excludeReleases: {
|
|
45
54
|
hint: "--exclude-releases",
|
|
@@ -47,7 +56,7 @@ const exclusionDescriptions = {
|
|
|
47
56
|
},
|
|
48
57
|
excludeRenovate: {
|
|
49
58
|
hint: "--exclude-renovate",
|
|
50
|
-
label: "Add a Renovate config to dependencies up-to-date with PRs."
|
|
59
|
+
label: "Add a Renovate config to keep dependencies up-to-date with PRs."
|
|
51
60
|
},
|
|
52
61
|
excludeTests: {
|
|
53
62
|
hint: "--exclude-tests",
|
|
@@ -63,19 +72,33 @@ async function augmentOptionsWithExcludes(options) {
|
|
|
63
72
|
}
|
|
64
73
|
const base = options.base ?? filterPromptCancel(
|
|
65
74
|
await prompts.select({
|
|
75
|
+
initialValue: "common",
|
|
66
76
|
message: `How much tooling would you like the template to set up for you?`,
|
|
67
77
|
options: [
|
|
68
78
|
{
|
|
69
|
-
|
|
70
|
-
|
|
79
|
+
label: makeLabel(
|
|
80
|
+
"everything",
|
|
81
|
+
"The most comprehensive tooling imaginable: sorting, spellchecking, and more!"
|
|
82
|
+
),
|
|
71
83
|
value: "everything"
|
|
72
84
|
},
|
|
73
85
|
{
|
|
74
|
-
|
|
86
|
+
hint: "recommended",
|
|
87
|
+
label: makeLabel(
|
|
88
|
+
"common",
|
|
89
|
+
"Bare starters plus testing and automation for all-contributors and releases."
|
|
90
|
+
),
|
|
91
|
+
value: "common"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
label: makeLabel(
|
|
95
|
+
"minimum",
|
|
96
|
+
"Just bare starter tooling: building, formatting, linting, and type checking."
|
|
97
|
+
),
|
|
75
98
|
value: "minimum"
|
|
76
99
|
},
|
|
77
100
|
{
|
|
78
|
-
label: "
|
|
101
|
+
label: makeLabel("prompt", "(allow me to customize)"),
|
|
79
102
|
value: "prompt"
|
|
80
103
|
}
|
|
81
104
|
]
|
|
@@ -84,6 +107,13 @@ async function augmentOptionsWithExcludes(options) {
|
|
|
84
107
|
switch (base) {
|
|
85
108
|
case void 0:
|
|
86
109
|
return void 0;
|
|
110
|
+
case "common":
|
|
111
|
+
return {
|
|
112
|
+
...options,
|
|
113
|
+
...Object.fromEntries(
|
|
114
|
+
exclusionKeys.filter((exclusion) => exclusionDescriptions[exclusion].uncommon).map((exclusion) => [exclusion, options[exclusion] ?? true])
|
|
115
|
+
)
|
|
116
|
+
};
|
|
87
117
|
case "everything":
|
|
88
118
|
return options;
|
|
89
119
|
case "minimum":
|
|
@@ -122,6 +152,9 @@ async function augmentOptionsWithExcludes(options) {
|
|
|
122
152
|
};
|
|
123
153
|
}
|
|
124
154
|
}
|
|
155
|
+
function makeLabel(label, message) {
|
|
156
|
+
return [chalk.bold(label), message].join(" ");
|
|
157
|
+
}
|
|
125
158
|
export {
|
|
126
159
|
augmentOptionsWithExcludes
|
|
127
160
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/shared/options/augmentOptionsWithExcludes.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\n\nimport { filterPromptCancel } from \"../prompts.js\";\nimport { InputBase, Options } from \"../types.js\";\n\nconst exclusionDescriptions = {\n\texcludeCompliance: {\n\t\thint: \"--exclude-compliance\",\n\t\tlabel:\n\t\t\t\"Add a GitHub Actions workflow to verify that PRs match an expected format.\",\n\t},\n\texcludeContributors: {\n\t\thint: \"--exclude-contributors\",\n\t\tlabel:\n\t\t\t\"Add all-contributors to track contributions and display them in a README.md table.\",\n\t},\n\texcludeLintJson: {\n\t\thint: \"--exclude-lint-json\",\n\t\tlabel: \"Apply linting and sorting to *.json and *.jsonc files.\",\n\t},\n\texcludeLintKnip: {\n\t\thint: \"--exclude-lint-knip\",\n\t\tlabel: \"Add Knip to detect unused files, dependencies, and code exports.\",\n\t},\n\texcludeLintMd: {\n\t\thint: \"--exclude-lint-md\",\n\t\tlabel: \"Apply linting to *.md files.\",\n\t},\n\texcludeLintPackageJson: {\n\t\thint: \"--exclude-lint-package-json\",\n\t\tlabel: \"Add npm-package-json-lint to lint for package.json correctness.\",\n\t},\n\texcludeLintPackages: {\n\t\thint: \"--exclude-lint-packages\",\n\t\tlabel:\n\t\t\t\"Add a pnpm dedupe workflow to ensure packages aren't duplicated unnecessarily.\",\n\t},\n\texcludeLintPerfectionist: {\n\t\thint: \"--exclude-lint-perfectionist\",\n\t\tlabel:\n\t\t\t\"Apply eslint-plugin-perfectionist to ensure imports, keys, and so on are in sorted order.\",\n\t},\n\texcludeLintSpelling: {\n\t\thint: \"--exclude-lint-spelling\",\n\t\tlabel: \"Add cspell to spell check against dictionaries of known words.\",\n\t},\n\texcludeLintYml: {\n\t\thint: \"--exclude-lint-yml\",\n\t\tlabel: \"Apply linting and sorting to *.yaml and *.yml files.\",\n\t},\n\texcludeReleases: {\n\t\thint: \"--exclude-releases\",\n\t\tlabel:\n\t\t\t\"Add release-it to generate changelogs, package bumps, and publishes based on conventional commits.\",\n\t},\n\texcludeRenovate: {\n\t\thint: \"--exclude-renovate\",\n\t\tlabel: \"Add a Renovate config to dependencies up-to-date with PRs.\",\n\t},\n\texcludeTests: {\n\t\thint: \"--exclude-tests\",\n\t\tlabel:\n\t\t\t\"Add Vitest tooling for fast unit tests, configured with coverage tracking.\",\n\t},\n}
|
|
1
|
+
{"version":3,"sources":["../../../src/shared/options/augmentOptionsWithExcludes.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\n\nimport { filterPromptCancel } from \"../prompts.js\";\nimport { InputBase, Options } from \"../types.js\";\n\ninterface ExclusionDescription {\n\thint: string;\n\tlabel: string;\n\tuncommon?: true;\n}\n\ntype ExclusionKey = keyof Options & `exclude${string}`;\n\nconst exclusionDescriptions: Record<ExclusionKey, ExclusionDescription> = {\n\texcludeCompliance: {\n\t\thint: \"--exclude-compliance\",\n\t\tlabel:\n\t\t\t\"Add a GitHub Actions workflow to verify that PRs match an expected format.\",\n\t\tuncommon: true,\n\t},\n\texcludeContributors: {\n\t\thint: \"--exclude-contributors\",\n\t\tlabel:\n\t\t\t\"Add all-contributors to track contributions and display them in a README.md table.\",\n\t},\n\texcludeLintJson: {\n\t\thint: \"--exclude-lint-json\",\n\t\tlabel: \"Apply linting and sorting to *.json and *.jsonc files.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintKnip: {\n\t\thint: \"--exclude-lint-knip\",\n\t\tlabel: \"Add Knip to detect unused files, dependencies, and code exports.\",\n\t},\n\texcludeLintMd: {\n\t\thint: \"--exclude-lint-md\",\n\t\tlabel: \"Apply linting to *.md files.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintPackageJson: {\n\t\thint: \"--exclude-lint-package-json\",\n\t\tlabel: \"Add npm-package-json-lint to lint for package.json correctness.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintPackages: {\n\t\thint: \"--exclude-lint-packages\",\n\t\tlabel:\n\t\t\t\"Add a pnpm dedupe workflow to ensure packages aren't duplicated unnecessarily.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintPerfectionist: {\n\t\thint: \"--exclude-lint-perfectionist\",\n\t\tlabel:\n\t\t\t\"Apply eslint-plugin-perfectionist to ensure imports, keys, and so on are in sorted order.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintSpelling: {\n\t\thint: \"--exclude-lint-spelling\",\n\t\tlabel: \"Add cspell to spell check against dictionaries of known words.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintYml: {\n\t\thint: \"--exclude-lint-yml\",\n\t\tlabel: \"Apply linting and sorting to *.yaml and *.yml files.\",\n\t\tuncommon: true,\n\t},\n\texcludeReleases: {\n\t\thint: \"--exclude-releases\",\n\t\tlabel:\n\t\t\t\"Add release-it to generate changelogs, package bumps, and publishes based on conventional commits.\",\n\t},\n\texcludeRenovate: {\n\t\thint: \"--exclude-renovate\",\n\t\tlabel: \"Add a Renovate config to keep dependencies up-to-date with PRs.\",\n\t},\n\texcludeTests: {\n\t\thint: \"--exclude-tests\",\n\t\tlabel:\n\t\t\t\"Add Vitest tooling for fast unit tests, configured with coverage tracking.\",\n\t},\n};\n\nconst exclusionKeys = Object.keys(exclusionDescriptions) as ExclusionKey[];\n\nexport async function augmentOptionsWithExcludes(\n\toptions: Options,\n): Promise<Options | undefined> {\n\tif (\n\t\tObject.keys(options).some(\n\t\t\t(key) =>\n\t\t\t\tkey in exclusionDescriptions &&\n\t\t\t\toptions[key as keyof typeof options] !== undefined,\n\t\t)\n\t) {\n\t\treturn options;\n\t}\n\n\tconst base =\n\t\toptions.base ??\n\t\tfilterPromptCancel<InputBase | symbol>(\n\t\t\tawait prompts.select({\n\t\t\t\tinitialValue: \"common\" as InputBase,\n\t\t\t\tmessage: `How much tooling would you like the template to set up for you?`,\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: makeLabel(\n\t\t\t\t\t\t\t\"everything\",\n\t\t\t\t\t\t\t\"The most comprehensive tooling imaginable: sorting, spellchecking, and more!\",\n\t\t\t\t\t\t),\n\t\t\t\t\t\tvalue: \"everything\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\thint: \"recommended\",\n\t\t\t\t\t\tlabel: makeLabel(\n\t\t\t\t\t\t\t\"common\",\n\t\t\t\t\t\t\t\"Bare starters plus testing and automation for all-contributors and releases.\",\n\t\t\t\t\t\t),\n\t\t\t\t\t\tvalue: \"common\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: makeLabel(\n\t\t\t\t\t\t\t\"minimum\",\n\t\t\t\t\t\t\t\"Just bare starter tooling: building, formatting, linting, and type checking.\",\n\t\t\t\t\t\t),\n\t\t\t\t\t\tvalue: \"minimum\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: makeLabel(\"prompt\", \"(allow me to customize)\"),\n\t\t\t\t\t\tvalue: \"prompt\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}),\n\t\t);\n\n\tswitch (base) {\n\t\tcase undefined:\n\t\t\treturn undefined;\n\n\t\tcase \"common\":\n\t\t\treturn {\n\t\t\t\t...options,\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\texclusionKeys\n\t\t\t\t\t\t.filter((exclusion) => exclusionDescriptions[exclusion].uncommon)\n\t\t\t\t\t\t.map((exclusion) => [exclusion, options[exclusion] ?? true]),\n\t\t\t\t),\n\t\t\t};\n\n\t\tcase \"everything\":\n\t\t\treturn options;\n\n\t\tcase \"minimum\":\n\t\t\treturn {\n\t\t\t\t...options,\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\texclusionKeys.map((exclusion) => [\n\t\t\t\t\t\texclusion,\n\t\t\t\t\t\toptions[exclusion] ?? true,\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t};\n\n\t\tcase \"prompt\":\n\t\t\tconst exclusionsNotEnabled = new Set(\n\t\t\t\tfilterPromptCancel(\n\t\t\t\t\tawait prompts.multiselect({\n\t\t\t\t\t\tinitialValues: exclusionKeys,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\"Select the tooling portions you'd like to remove. All are enabled by default.\",\n\t\t\t\t\t\toptions: Object.entries(exclusionDescriptions).map(\n\t\t\t\t\t\t\t([value, { hint, label }]) => ({\n\t\t\t\t\t\t\t\thint,\n\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\tvalue: value as ExclusionKey,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\t...options,\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\texclusionKeys.map(\n\t\t\t\t\t\t(exclusionKey) =>\n\t\t\t\t\t\t\t[exclusionKey, !exclusionsNotEnabled.has(exclusionKey)] as const,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t};\n\t}\n}\n\nfunction makeLabel(label: string, message: string) {\n\treturn [chalk.bold(label), message].join(\"\\t \");\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAElB,SAAS,0BAA0B;AAWnC,MAAM,wBAAoE;AAAA,EACzE,mBAAmB;AAAA,IAClB,MAAM;AAAA,IACN,OACC;AAAA,IACD,UAAU;AAAA,EACX;AAAA,EACA,qBAAqB;AAAA,IACpB,M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AC,cAAc,CAAC,qBAAqB,IAAI,YAAY,CAAC;AAAA,UACxD;AAAA,QACD;AAAA,MACD;AAAA,EACF;AACD;AAEA,SAAS,UAAU,OAAe,SAAiB;AAClD,SAAO,CAAC,MAAM,KAAK,KAAK,GAAG,OAAO,EAAE,KAAK,IAAK;AAC/C;","names":[]}
|
|
@@ -127,7 +127,12 @@ async function readOptions(args) {
|
|
|
127
127
|
}
|
|
128
128
|
const optionsSchema = z.object({
|
|
129
129
|
author: z.string().optional(),
|
|
130
|
-
base: z.union([
|
|
130
|
+
base: z.union([
|
|
131
|
+
z.literal("common"),
|
|
132
|
+
z.literal("everything"),
|
|
133
|
+
z.literal("minimum"),
|
|
134
|
+
z.literal("prompt")
|
|
135
|
+
]).optional(),
|
|
131
136
|
createRepository: z.boolean().optional(),
|
|
132
137
|
description: z.string().optional(),
|
|
133
138
|
email: z.string().email().optional(),
|
|
@@ -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([z.literal(\"everything\"), z.literal(\"minimum\"), z.literal(\"prompt\")])\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,IAC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AE,SAAS;AAAA,EAClC,eAAe,EAAE,QAAQ;AAAA,EACzB,OAAO,EAAE,OAAO,EAAE,SAAS;AAC5B,CAAC;","names":[]}
|
|
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;AAAA,IACvC,wBAAwB,OAAO,2BAA2B;AAAA,IAC1D,qBAAqB,OAAO,uBAAuB;AAAA,IACnD,0BAA0B,OAAO,4BAA4B;AAAA,IAC7D,qBAAqB,OAAO,uBAAuB;AAAA,IACnD,gBAAgB,OAAO,kBAAkB;AAAA,IACzC,iBAAiB,OAAO,kBAAkB;AAAA,IA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+
() => /<img.+src.+\/>/g
|
|
6
|
+
];
|
|
7
|
+
function findExistingBadges(contents) {
|
|
8
|
+
const badges = [];
|
|
9
|
+
let remaining = contents.split(/<\s*h2.*>|##/)[0];
|
|
10
|
+
for (const createMatcher of existingBadgeMatcherCreators) {
|
|
11
|
+
const matcher = createMatcher();
|
|
12
|
+
while (true) {
|
|
13
|
+
const matched = matcher.exec(remaining);
|
|
14
|
+
if (!matched) {
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
const [badge] = matched;
|
|
18
|
+
badges.push(badge.trim());
|
|
19
|
+
remaining = [
|
|
20
|
+
remaining.slice(0, matched.index),
|
|
21
|
+
remaining.slice(matched.index + badge.length)
|
|
22
|
+
].join("");
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return badges;
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
existingBadgeMatcherCreators,
|
|
29
|
+
findExistingBadges
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=findExistingBadges.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/steps/writeReadme/findExistingBadges.ts"],"sourcesContent":["export const existingBadgeMatcherCreators = [\n\t() => /\\[!\\[.+\\]\\(.+\\)\\]\\(.+\\)/g,\n\t() => /!\\[.+\\]\\(.+\\)/g,\n\t() => /^\\s*<a[ \\tA-Za-z_\\-=#&;?./:'\"]*>[\\s\\S]+?<\\/a>/gm,\n\t() => /<img.+src.+\\/>/g,\n];\n\nexport function findExistingBadges(contents: string): string[] {\n\tconst badges: string[] = [];\n\tlet remaining = contents.split(/<\\s*h2.*>|##/)[0];\n\n\tfor (const createMatcher of existingBadgeMatcherCreators) {\n\t\tconst matcher = createMatcher();\n\n\t\twhile (true) {\n\t\t\tconst matched = matcher.exec(remaining);\n\n\t\t\tif (!matched) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst [badge] = matched;\n\n\t\t\tbadges.push(badge.trim());\n\t\t\tremaining = [\n\t\t\t\tremaining.slice(0, matched.index),\n\t\t\t\tremaining.slice(matched.index + badge.length),\n\t\t\t].join(\"\");\n\t\t}\n\t}\n\n\treturn badges;\n}\n"],"mappings":"AAAO,MAAM,+BAA+B;AAAA,EAC3C,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACP;AAEO,SAAS,mBAAmB,UAA4B;AAC9D,QAAM,SAAmB,CAAC;AAC1B,MAAI,YAAY,SAAS,MAAM,cAAc,EAAE,CAAC;AAEhD,aAAW,iBAAiB,8BAA8B;AACzD,UAAM,UAAU,cAAc;AAE9B,WAAO,MAAM;AACZ,YAAM,UAAU,QAAQ,KAAK,SAAS;AAEtC,UAAI,CAAC,SAAS;AACb;AAAA,MACD;AAEA,YAAM,CAAC,KAAK,IAAI;AAEhB,aAAO,KAAK,MAAM,KAAK,CAAC;AACxB,kBAAY;AAAA,QACX,UAAU,MAAM,GAAG,QAAQ,KAAK;AAAA,QAChC,UAAU,MAAM,QAAQ,QAAQ,MAAM,MAAM;AAAA,MAC7C,EAAE,KAAK,EAAE;AAAA,IACV;AAAA,EACD;AAEA,SAAO;AACR;","names":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { existingBadgeMatcherCreators } from "./findExistingBadges.js";
|
|
2
|
+
function findIntroSectionClose(contents) {
|
|
3
|
+
const indexOfH2OrCodeBlock = contents.search(/## |<\s*h2|```/);
|
|
4
|
+
if (indexOfH2OrCodeBlock !== -1) {
|
|
5
|
+
return indexOfH2OrCodeBlock - 2;
|
|
6
|
+
}
|
|
7
|
+
for (const createMatcher of existingBadgeMatcherCreators) {
|
|
8
|
+
const lastMatch = [...contents.matchAll(createMatcher())].at(-1);
|
|
9
|
+
if (lastMatch?.index) {
|
|
10
|
+
return lastMatch.index + lastMatch[0].length + 2;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return contents.indexOf("\n", 2);
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
findIntroSectionClose
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=findIntroSectionClose.js.map
|
|
@@ -0,0 +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\", 2);\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;AAChC;","names":[]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
function generateTopContent(options, existingBadges) {
|
|
2
|
+
const remainingExistingBadges = new Set(existingBadges);
|
|
3
|
+
const badges = [];
|
|
4
|
+
function spliceBadge(badgeLine, existingMatcher) {
|
|
5
|
+
const existingMatch = existingBadges.find(
|
|
6
|
+
(existingLine) => existingMatcher.test(existingLine)
|
|
7
|
+
);
|
|
8
|
+
if (existingMatch) {
|
|
9
|
+
remainingExistingBadges.delete(existingMatch);
|
|
10
|
+
}
|
|
11
|
+
if (badgeLine) {
|
|
12
|
+
badges.push(badgeLine);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
for (const [badgeLine, existingMatcher] of [
|
|
16
|
+
[
|
|
17
|
+
!options.excludeContributors && `<a href="#contributors" target="_blank">
|
|
18
|
+
<!-- prettier-ignore-start -->
|
|
19
|
+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
20
|
+
<img alt="All Contributors: 2" src="https://img.shields.io/badge/all_contributors-17-21bb42.svg" />
|
|
21
|
+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
22
|
+
<!-- prettier-ignore-end -->
|
|
23
|
+
</a>`,
|
|
24
|
+
/ALL-CONTRIBUTORS-BADGE:START/
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
!options.excludeTests && `<a href="https://codecov.io/gh/${options.owner}/${options.repository}" target="_blank">
|
|
28
|
+
<img alt="Codecov Test Coverage" src="https://codecov.io/gh/${options.owner}/${options.repository}/branch/main/graph/badge.svg"/>
|
|
29
|
+
</a>`,
|
|
30
|
+
/https:\/\/codecov\.io\/gh/
|
|
31
|
+
],
|
|
32
|
+
[
|
|
33
|
+
`<a href="https://github.com/${options.owner}/${options.repository}/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank">
|
|
34
|
+
<img alt="Contributor Covenant" src="https://img.shields.io/badge/code_of_conduct-enforced-21bb42" />
|
|
35
|
+
</a>`,
|
|
36
|
+
/CODE_OF_CONDUCT\.md/
|
|
37
|
+
],
|
|
38
|
+
[
|
|
39
|
+
`<a href="https://github.com/${options.owner}/${options.repository}/blob/main/LICENSE.md" target="_blank">
|
|
40
|
+
<img alt="License: MIT" src="https://img.shields.io/github/license/${options.owner}/${options.repository}?color=21bb42">
|
|
41
|
+
</a>`,
|
|
42
|
+
/LICENSE\.(md|txt)/
|
|
43
|
+
],
|
|
44
|
+
[
|
|
45
|
+
options.funding && `<a href="https://github.com/sponsors/${options.funding}" target="_blank">
|
|
46
|
+
<img alt="Sponsor: On GitHub" src="https://img.shields.io/badge/sponsor-on_github-21bb42.svg" />
|
|
47
|
+
</a>`,
|
|
48
|
+
/github.+sponsors/
|
|
49
|
+
],
|
|
50
|
+
[
|
|
51
|
+
`<img alt="Style: Prettier" src="https://img.shields.io/badge/style-prettier-21bb42.svg" />`,
|
|
52
|
+
/style.*prettier/i
|
|
53
|
+
],
|
|
54
|
+
[
|
|
55
|
+
`<img alt="TypeScript: Strict" src="https://img.shields.io/badge/typescript-strict-21bb42.svg" />`,
|
|
56
|
+
/typescript.*strict/i
|
|
57
|
+
]
|
|
58
|
+
]) {
|
|
59
|
+
spliceBadge(badgeLine, existingMatcher);
|
|
60
|
+
}
|
|
61
|
+
return `<h1 align="center">${options.title}</h1>
|
|
62
|
+
|
|
63
|
+
<p align="center">${options.description}</p>
|
|
64
|
+
|
|
65
|
+
<p align="center">
|
|
66
|
+
${[...badges, ...remainingExistingBadges].map((badge) => ` ${badge}`).join("\n")}
|
|
67
|
+
</p>`;
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
generateTopContent
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=generateTopContent.js.map
|
|
@@ -0,0 +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.excludeContributors &&\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] 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}\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,uBACR;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,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;AAEZ;","names":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import { readFileSafe } from "../../shared/readFileSafe.js";
|
|
3
|
+
import { endOfReadmeNotice } from "../updateReadme.js";
|
|
4
|
+
import { findExistingBadges } from "./findExistingBadges.js";
|
|
5
|
+
import { findIntroSectionClose } from "./findIntroSectionClose.js";
|
|
6
|
+
import { generateTopContent } from "./generateTopContent.js";
|
|
7
|
+
const contributorsIndicator = `<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->`;
|
|
8
|
+
function generateAllContributorsContent(options) {
|
|
9
|
+
return [
|
|
10
|
+
`## Contributors`,
|
|
11
|
+
``,
|
|
12
|
+
`<!-- spellchecker: disable -->`,
|
|
13
|
+
contributorsIndicator,
|
|
14
|
+
`<!-- prettier-ignore-start -->`,
|
|
15
|
+
!options.excludeLintMd && `<!-- markdownlint-disable -->`,
|
|
16
|
+
`<table>`,
|
|
17
|
+
`<!-- (this will be filled in by all-contributors) -->`,
|
|
18
|
+
`</table>`,
|
|
19
|
+
``,
|
|
20
|
+
!options.excludeLintMd && `<!-- markdownlint-restore -->`,
|
|
21
|
+
`<!-- prettier-ignore-end -->`,
|
|
22
|
+
``,
|
|
23
|
+
`<!-- ALL-CONTRIBUTORS-LIST:END -->`,
|
|
24
|
+
`<!-- spellchecker: enable -->`
|
|
25
|
+
].filter(Boolean).join("\n");
|
|
26
|
+
}
|
|
27
|
+
async function writeReadme(options) {
|
|
28
|
+
const allContributorsContent = !options.excludeContributors && generateAllContributorsContent(options);
|
|
29
|
+
let contents = await readFileSafe("README.md", "");
|
|
30
|
+
if (!contents) {
|
|
31
|
+
await fs.writeFile(
|
|
32
|
+
"README.md",
|
|
33
|
+
[
|
|
34
|
+
generateTopContent(options, []),
|
|
35
|
+
allContributorsContent,
|
|
36
|
+
endOfReadmeNotice
|
|
37
|
+
].filter(Boolean).join("\n\n")
|
|
38
|
+
);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const endOfIntroSection = findIntroSectionClose(contents);
|
|
42
|
+
contents = [
|
|
43
|
+
generateTopContent(options, findExistingBadges(contents)),
|
|
44
|
+
contents.slice(endOfIntroSection)
|
|
45
|
+
].join("").replace(/\[!\[.+\]\(.+\)\]\(.+\)/g, "").replace(/!\[.+\]\(.+\)/g, "").replaceAll("\r", "").replaceAll("\n\n\n", "\n\n");
|
|
46
|
+
if (allContributorsContent && !contents.includes(contributorsIndicator)) {
|
|
47
|
+
contents = [contents, allContributorsContent].join("\n\n");
|
|
48
|
+
}
|
|
49
|
+
if (!contents.includes(endOfReadmeNotice)) {
|
|
50
|
+
contents = [contents, endOfReadmeNotice].join("\n\n");
|
|
51
|
+
}
|
|
52
|
+
await fs.writeFile("README.md", contents);
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
writeReadme
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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.excludeContributors && 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,uBAAuB,+BAA+B,OAAO;AACvE,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":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-typescript-app",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.49",
|
|
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",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"vitest": "^0.34.3",
|
|
108
108
|
"yaml-eslint-parser": "^1.2.2"
|
|
109
109
|
},
|
|
110
|
-
"packageManager": "pnpm@8.7.
|
|
110
|
+
"packageManager": "pnpm@8.7.6",
|
|
111
111
|
"engines": {
|
|
112
112
|
"node": ">=18"
|
|
113
113
|
},
|
package/lib/steps/writeReadme.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs/promises";
|
|
2
|
-
import { readFileSafe } from "../shared/readFileSafe.js";
|
|
3
|
-
import { endOfReadmeNotice } from "./updateReadme.js";
|
|
4
|
-
const contributorsIndicator = `<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->`;
|
|
5
|
-
function generateAllContributorsContent(options) {
|
|
6
|
-
return [
|
|
7
|
-
`## Contributors`,
|
|
8
|
-
``,
|
|
9
|
-
`<!-- spellchecker: disable -->`,
|
|
10
|
-
contributorsIndicator,
|
|
11
|
-
`<!-- prettier-ignore-start -->`,
|
|
12
|
-
!options.excludeLintMd && `<!-- markdownlint-disable -->`,
|
|
13
|
-
`<table>`,
|
|
14
|
-
`<!-- (this will be filled in by all-contributors) -->`,
|
|
15
|
-
`</table>`,
|
|
16
|
-
``,
|
|
17
|
-
!options.excludeLintMd && `<!-- markdownlint-restore -->`,
|
|
18
|
-
`<!-- prettier-ignore-end -->`,
|
|
19
|
-
``,
|
|
20
|
-
`<!-- ALL-CONTRIBUTORS-LIST:END -->`,
|
|
21
|
-
`<!-- spellchecker: enable -->`
|
|
22
|
-
].filter(Boolean).join("\n");
|
|
23
|
-
}
|
|
24
|
-
async function writeReadme(options) {
|
|
25
|
-
const allContributorsContent = !options.excludeContributors && generateAllContributorsContent(options);
|
|
26
|
-
let contents = await readFileSafe("README.md", "");
|
|
27
|
-
if (!contents) {
|
|
28
|
-
await fs.writeFile(
|
|
29
|
-
"README.md",
|
|
30
|
-
[generateTopContent(options), allContributorsContent, endOfReadmeNotice].filter(Boolean).join("\n\n")
|
|
31
|
-
);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
const endOfH1 = findH1Close(contents);
|
|
35
|
-
contents = [generateTopContent(options), contents.slice(endOfH1)].join("").replace(/\[!\[.+\]\(.+\)\]\(.+\)/g, "").replace(/!\[.+\]\(.+\)/g, "").replaceAll("\r", "").replaceAll("\n\n\n", "\n\n");
|
|
36
|
-
if (allContributorsContent && !contents.includes(contributorsIndicator)) {
|
|
37
|
-
contents = [contents, allContributorsContent].join("\n\n");
|
|
38
|
-
}
|
|
39
|
-
if (!contents.includes(endOfReadmeNotice)) {
|
|
40
|
-
contents = [contents, endOfReadmeNotice].join("\n\n");
|
|
41
|
-
}
|
|
42
|
-
await fs.writeFile("README.md", contents);
|
|
43
|
-
}
|
|
44
|
-
function findH1Close(contents) {
|
|
45
|
-
const markdownMatch = contents.match(/^#.+/);
|
|
46
|
-
if (markdownMatch) {
|
|
47
|
-
return (markdownMatch.index ?? 0) + markdownMatch[0].length;
|
|
48
|
-
}
|
|
49
|
-
return contents.indexOf("</h1>") + "</h1>".length;
|
|
50
|
-
}
|
|
51
|
-
function generateTopContent(options) {
|
|
52
|
-
const badgeLines = [
|
|
53
|
-
!options.excludeContributors && ` <a href="#contributors" target="_blank">
|
|
54
|
-
<!-- prettier-ignore-start -->
|
|
55
|
-
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
56
|
-
<img alt="All Contributors: 2" src="https://img.shields.io/badge/all_contributors-17-21bb42.svg" />
|
|
57
|
-
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
58
|
-
<!-- prettier-ignore-end -->
|
|
59
|
-
</a>`,
|
|
60
|
-
!options.excludeTests && ` <a href="https://codecov.io/gh/${options.owner}/${options.repository}" target="_blank">
|
|
61
|
-
<img alt="Codecov Test Coverage" src="https://codecov.io/gh/${options.owner}/${options.repository}/branch/main/graph/badge.svg"/>
|
|
62
|
-
</a>`,
|
|
63
|
-
` <a href="https://github.com/${options.owner}/${options.repository}/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank">
|
|
64
|
-
<img alt="Contributor Covenant" src="https://img.shields.io/badge/code_of_conduct-enforced-21bb42" />
|
|
65
|
-
</a>`,
|
|
66
|
-
` <a href="https://github.com/${options.owner}/${options.repository}/blob/main/LICENSE.md" target="_blank">
|
|
67
|
-
<img alt="License: MIT" src="https://img.shields.io/github/license/${options.owner}/${options.repository}?color=21bb42">
|
|
68
|
-
</a>`,
|
|
69
|
-
options.funding && ` <a href="https://github.com/sponsors/${options.funding}" target="_blank">
|
|
70
|
-
<img alt="Sponsor: On GitHub" src="https://img.shields.io/badge/sponsor-on_github-21bb42.svg" />
|
|
71
|
-
</a>`,
|
|
72
|
-
` <img alt="Style: Prettier" src="https://img.shields.io/badge/style-prettier-21bb42.svg" />`,
|
|
73
|
-
` <img alt="TypeScript: Strict" src="https://img.shields.io/badge/typescript-strict-21bb42.svg" />`
|
|
74
|
-
].filter(Boolean);
|
|
75
|
-
return `<h1 align="center">${options.title}</h1>
|
|
76
|
-
|
|
77
|
-
<p align="center">${options.description}</p>
|
|
78
|
-
|
|
79
|
-
<p align="center">
|
|
80
|
-
${badgeLines.join("\n")}
|
|
81
|
-
</p>`;
|
|
82
|
-
}
|
|
83
|
-
export {
|
|
84
|
-
writeReadme
|
|
85
|
-
};
|
|
86
|
-
//# sourceMappingURL=writeReadme.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/writeReadme.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\";\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.excludeContributors && 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[generateTopContent(options), allContributorsContent, endOfReadmeNotice]\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 endOfH1 = findH1Close(contents);\n\n\tcontents = [generateTopContent(options), contents.slice(endOfH1)]\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\nfunction findH1Close(contents: string) {\n\tconst markdownMatch = contents.match(/^#.+/);\n\tif (markdownMatch) {\n\t\treturn (markdownMatch.index ?? 0) + markdownMatch[0].length;\n\t}\n\n\treturn contents.indexOf(\"</h1>\") + \"</h1>\".length;\n}\n\nfunction generateTopContent(options: Options) {\n\tconst badgeLines = [\n\t\t!options.excludeContributors &&\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\t</a>`,\n\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<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<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\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<img alt=\"Style: Prettier\" src=\"https://img.shields.io/badge/style-prettier-21bb42.svg\" />`,\n\t\t`\t<img alt=\"TypeScript: Strict\" src=\"https://img.shields.io/badge/typescript-strict-21bb42.svg\" />`,\n\t].filter(Boolean);\n\n\treturn `<h1 align=\"center\">${options.title}</h1>\n\n<p align=\"center\">${options.description}</p>\n\n<p align=\"center\">\n${badgeLines.join(\"\\n\")}\n</p>`;\n}\n"],"mappings":"AAAA,OAAO,QAAQ;AAEf,SAAS,oBAAoB;AAE7B,SAAS,yBAAyB;AAElC,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,uBAAuB,+BAA+B,OAAO;AACvE,MAAI,WAAW,MAAM,aAAa,aAAa,EAAE;AACjD,MAAI,CA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