create-typescript-app 1.52.7 → 1.53.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 +2 -1
- package/lib/create/createWithOptions.js +7 -0
- package/lib/create/createWithOptions.js.map +1 -1
- package/lib/migrate/migrateWithOptions.js +4 -0
- package/lib/migrate/migrateWithOptions.js.map +1 -1
- package/lib/shared/options/createOptionDefaults/index.js +1 -1
- package/lib/shared/options/createOptionDefaults/index.js.map +1 -1
- package/lib/shared/readFileSafe.js +1 -1
- package/lib/shared/readFileSafe.js.map +1 -1
- package/lib/steps/addOwnerAsAllContributor.js +6 -9
- package/lib/steps/addOwnerAsAllContributor.js.map +1 -1
- package/lib/steps/clearChangelog.js +1 -1
- package/lib/steps/clearChangelog.js.map +1 -1
- package/lib/steps/clearUnnecessaryFiles.js +1 -1
- package/lib/steps/clearUnnecessaryFiles.js.map +1 -1
- package/lib/steps/populateCSpellDictionary.d.ts +3 -0
- package/lib/steps/populateCSpellDictionary.js +36 -0
- package/lib/steps/populateCSpellDictionary.js.map +1 -0
- package/lib/steps/removeSetupScripts.js +1 -1
- package/lib/steps/removeSetupScripts.js.map +1 -1
- package/lib/steps/updateAllContributorsTable.js +9 -12
- package/lib/steps/updateAllContributorsTable.js.map +1 -1
- package/lib/steps/updateReadme.js +1 -1
- package/lib/steps/updateReadme.js.map +1 -1
- package/lib/steps/writeReadme/index.js +1 -1
- package/lib/steps/writeReadme/index.js.map +1 -1
- package/lib/steps/writing/creation/formatters/formatJson.js +2 -1
- package/lib/steps/writing/creation/formatters/formatJson.js.map +1 -1
- package/lib/steps/writing/creation/rootFiles.js +1 -17
- package/lib/steps/writing/creation/rootFiles.js.map +1 -1
- package/lib/steps/writing/creation/writePackageJson.js +1 -1
- package/lib/steps/writing/creation/writePackageJson.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<p align="center">
|
|
6
6
|
<!-- prettier-ignore-start -->
|
|
7
7
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
8
|
-
<a href="#contributors" target="_blank"><img alt="👪 All Contributors:
|
|
8
|
+
<a href="#contributors" target="_blank"><img alt="👪 All Contributors: 41" src="https://img.shields.io/badge/%F0%9F%91%AA_all_contributors-41-21bb42.svg" /></a>
|
|
9
9
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
10
10
|
<!-- prettier-ignore-end -->
|
|
11
11
|
<a href="https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank"><img alt="🤝 Code of Conduct: Kept" src="https://img.shields.io/badge/%F0%9F%A4%9D_code_of_conduct-kept-21bb42" /></a>
|
|
@@ -117,6 +117,7 @@ Thanks! 💖
|
|
|
117
117
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tungbq"><img src="https://avatars.githubusercontent.com/u/85242618?v=4?s=100" width="100px;" alt="Tung Bui (Leo)"/><br /><sub><b>Tung Bui (Leo)</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=tungbq" title="Code">💻</a></td>
|
|
118
118
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/vasanth9"><img src="https://avatars.githubusercontent.com/u/42891954?v=4?s=100" width="100px;" alt="Vasanth Kumar Cheepurupalli"/><br /><sub><b>Vasanth Kumar Cheepurupalli</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=vasanth9" title="Code">💻</a></td>
|
|
119
119
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/xl4624"><img src="https://avatars.githubusercontent.com/u/116298054?v=4?s=100" width="100px;" alt="Xiaomin Liu"/><br /><sub><b>Xiaomin Liu</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=xl4624" title="Code">💻</a></td>
|
|
120
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lcforbes"><img src="https://avatars.githubusercontent.com/u/42080532?v=4?s=100" width="100px;" alt="lcforbes"/><br /><sub><b>lcforbes</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=author%3Alcforbes" title="Bug reports">🐛</a></td>
|
|
120
121
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/TAKANOME-DEV"><img src="https://avatars.githubusercontent.com/u/79809121?v=4?s=100" width="100px;" alt="takanomedev"/><br /><sub><b>takanomedev</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=TAKANOME-DEV" title="Code">💻</a></td>
|
|
121
122
|
</tr>
|
|
122
123
|
</tbody>
|
|
@@ -5,6 +5,7 @@ import { doesRepositoryExist } from "../shared/doesRepositoryExist.js";
|
|
|
5
5
|
import { addToolAllContributors } from "../steps/addToolAllContributors.js";
|
|
6
6
|
import { finalizeDependencies } from "../steps/finalizeDependencies.js";
|
|
7
7
|
import { initializeGitHubRepository } from "../steps/initializeGitHubRepository/index.js";
|
|
8
|
+
import { populateCSpellDictionary } from "../steps/populateCSpellDictionary.js";
|
|
8
9
|
import { runCommands } from "../steps/runCommands.js";
|
|
9
10
|
import { writeReadme } from "../steps/writeReadme/index.js";
|
|
10
11
|
import { writeStructure } from "../steps/writing/writeStructure.js";
|
|
@@ -33,6 +34,12 @@ async function createWithOptions({ github, options }) {
|
|
|
33
34
|
"Installing packages",
|
|
34
35
|
async () => finalizeDependencies(options)
|
|
35
36
|
);
|
|
37
|
+
if (!options.excludeLintSpelling) {
|
|
38
|
+
await withSpinner(
|
|
39
|
+
"Populating CSpell dictionary",
|
|
40
|
+
populateCSpellDictionary
|
|
41
|
+
);
|
|
42
|
+
}
|
|
36
43
|
await runCommands(
|
|
37
44
|
"Cleaning up files",
|
|
38
45
|
createCleanUpFilesCommands({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/create/createWithOptions.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { createCleanUpFilesCommands } from \"../shared/createCleanUpFilesCommands.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);\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.excludeAllContributors && !options.skipAllContributorsApi) {\n\t\tawait withSpinner(\"Adding contributors to table\", async () => {\n\t\t\tawait addToolAllContributors(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\n\t\tawait runCommands(\n\t\t\t\"Cleaning up files\",\n\t\t\tcreateCleanUpFilesCommands({\n\t\t\t\tbin: !!options.bin,\n\t\t\t\tdedupe: true,\n\t\t\t}),\n\t\t);\n\t}\n\n\tconst sendToGitHub =\n\t\tgithub && (await doesRepositoryExist(github.octokit, options));\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,SAAS,SAAS;AAElB,SAAS,aAAa,oBAAoB;AAC1C,SAAS,kCAAkC;AAC3C,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,OAAO;AAAA,MAC7B;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,YAAY,OAAO;AAAA,MAC1B;AAAA,IACD;AAAA,EACD,CAAC;AAED,MAAI,CAAC,QAAQ,0BAA0B,CAAC,QAAQ,wBAAwB;AACvE,UAAM,YAAY,gCAAgC,YAAY;AAC7D,YAAM,uBAAuB,OAAO;AAAA,IACrC,CAAC;AAAA,EACF;AAEA,MAAI,CAAC,QAAQ,aAAa;AACzB,UAAM;AAAA,MAAY;AAAA,MAAuB,YACxC,qBAAqB,OAAO;AAAA,IAC7B;AAEA,UAAM;AAAA,MACL;AAAA,MACA,2BAA2B;AAAA,QAC1B,KAAK,CAAC,CAAC,QAAQ;AAAA,QACf,QAAQ;AAAA,MACT,CAAC;AAAA,IACF;AAAA,EACD;AAEA,QAAM,eACL,UAAW,MAAM,oBAAoB,OAAO,SAAS,OAAO;AAE7D,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 { $ } from \"execa\";\n\nimport { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { createCleanUpFilesCommands } from \"../shared/createCleanUpFilesCommands.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 { populateCSpellDictionary } from \"../steps/populateCSpellDictionary.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);\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.excludeAllContributors && !options.skipAllContributorsApi) {\n\t\tawait withSpinner(\"Adding contributors to table\", async () => {\n\t\t\tawait addToolAllContributors(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\n\t\tif (!options.excludeLintSpelling) {\n\t\t\tawait withSpinner(\n\t\t\t\t\"Populating CSpell dictionary\",\n\t\t\t\tpopulateCSpellDictionary,\n\t\t\t);\n\t\t}\n\n\t\tawait runCommands(\n\t\t\t\"Cleaning up files\",\n\t\t\tcreateCleanUpFilesCommands({\n\t\t\t\tbin: !!options.bin,\n\t\t\t\tdedupe: true,\n\t\t\t}),\n\t\t);\n\t}\n\n\tconst sendToGitHub =\n\t\tgithub && (await doesRepositoryExist(github.octokit, options));\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,SAAS,SAAS;AAElB,SAAS,aAAa,oBAAoB;AAC1C,SAAS,kCAAkC;AAC3C,SAAS,2BAA2B;AAEpC,SAAS,8BAA8B;AACvC,SAAS,4BAA4B;AACrC,SAAS,kCAAkC;AAC3C,SAAS,gCAAgC;AACzC,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,OAAO;AAAA,MAC7B;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,YAAY,OAAO;AAAA,MAC1B;AAAA,IACD;AAAA,EACD,CAAC;AAED,MAAI,CAAC,QAAQ,0BAA0B,CAAC,QAAQ,wBAAwB;AACvE,UAAM,YAAY,gCAAgC,YAAY;AAC7D,YAAM,uBAAuB,OAAO;AAAA,IACrC,CAAC;AAAA,EACF;AAEA,MAAI,CAAC,QAAQ,aAAa;AACzB,UAAM;AAAA,MAAY;AAAA,MAAuB,YACxC,qBAAqB,OAAO;AAAA,IAC7B;AAEA,QAAI,CAAC,QAAQ,qBAAqB;AACjC,YAAM;AAAA,QACL;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAEA,UAAM;AAAA,MACL;AAAA,MACA,2BAA2B;AAAA,QAC1B,KAAK,CAAC,CAAC,QAAQ;AAAA,QACf,QAAQ;AAAA,MACT,CAAC;AAAA,IACF;AAAA,EACD;AAEA,QAAM,eACL,UAAW,MAAM,oBAAoB,OAAO,SAAS,OAAO;AAE7D,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":[]}
|
|
@@ -4,6 +4,7 @@ import { clearUnnecessaryFiles } from "../steps/clearUnnecessaryFiles.js";
|
|
|
4
4
|
import { detectExistingContributors } from "../steps/detectExistingContributors.js";
|
|
5
5
|
import { finalizeDependencies } from "../steps/finalizeDependencies.js";
|
|
6
6
|
import { initializeGitHubRepository } from "../steps/initializeGitHubRepository/index.js";
|
|
7
|
+
import { populateCSpellDictionary } from "../steps/populateCSpellDictionary.js";
|
|
7
8
|
import { runCommands } from "../steps/runCommands.js";
|
|
8
9
|
import { updateAllContributorsTable } from "../steps/updateAllContributorsTable.js";
|
|
9
10
|
import { updateLocalFiles } from "../steps/updateLocalFiles.js";
|
|
@@ -57,6 +58,9 @@ async function migrateWithOptions({
|
|
|
57
58
|
async () => finalizeDependencies(options)
|
|
58
59
|
);
|
|
59
60
|
}
|
|
61
|
+
if (!options.excludeLintSpelling) {
|
|
62
|
+
await withSpinner("Populating CSpell dictionary", populateCSpellDictionary);
|
|
63
|
+
}
|
|
60
64
|
await runCommands(
|
|
61
65
|
"Cleaning up files",
|
|
62
66
|
createCleanUpFilesCommands({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/migrate/migrateWithOptions.ts"],"sourcesContent":["import { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { createCleanUpFilesCommands } from \"../shared/createCleanUpFilesCommands.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);\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.excludeAllContributors && !options.skipAllContributorsApi) {\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(\n\t\t\"Cleaning up files\",\n\t\tcreateCleanUpFilesCommands({\n\t\t\tbin: !!options.bin,\n\t\t\tdedupe: true,\n\t\t}),\n\t);\n}\n"],"mappings":"AAAA,SAAS,aAAa,oBAAoB;AAC1C,SAAS,kCAAkC;AAE3C,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,OAAO;AAAA,MAC7B;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,0BAA0B,CAAC,QAAQ,wBAAwB;AACvE,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;AAAA,IACL;AAAA,IACA,2BAA2B;AAAA,MAC1B,KAAK,CAAC,CAAC,QAAQ;AAAA,MACf,QAAQ;AAAA,IACT,CAAC;AAAA,EACF;AACD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/migrate/migrateWithOptions.ts"],"sourcesContent":["import { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { createCleanUpFilesCommands } from \"../shared/createCleanUpFilesCommands.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 { populateCSpellDictionary } from \"../steps/populateCSpellDictionary.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);\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.excludeAllContributors && !options.skipAllContributorsApi) {\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\tif (!options.excludeLintSpelling) {\n\t\tawait withSpinner(\"Populating CSpell dictionary\", populateCSpellDictionary);\n\t}\n\n\tawait runCommands(\n\t\t\"Cleaning up files\",\n\t\tcreateCleanUpFilesCommands({\n\t\t\tbin: !!options.bin,\n\t\t\tdedupe: true,\n\t\t}),\n\t);\n}\n"],"mappings":"AAAA,SAAS,aAAa,oBAAoB;AAC1C,SAAS,kCAAkC;AAE3C,SAAS,6BAA6B;AACtC,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AACrC,SAAS,kCAAkC;AAC3C,SAAS,gCAAgC;AACzC,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,OAAO;AAAA,MAC7B;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,0BAA0B,CAAC,QAAQ,wBAAwB;AACvE,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,MAAI,CAAC,QAAQ,qBAAqB;AACjC,UAAM,YAAY,gCAAgC,wBAAwB;AAAA,EAC3E;AAEA,QAAM;AAAA,IACL;AAAA,IACA,2BAA2B;AAAA,MAC1B,KAAK,CAAC,CAAC,QAAQ;AAAA,MACf,QAAQ;AAAA,IACT,CAAC;AAAA,EACF;AACD;","names":[]}
|
|
@@ -2,7 +2,7 @@ import { $ } from "execa";
|
|
|
2
2
|
import gitRemoteOriginUrl from "git-remote-origin-url";
|
|
3
3
|
import gitUrlParse from "git-url-parse";
|
|
4
4
|
import lazyValue from "lazy-value";
|
|
5
|
-
import fs from "node:fs/promises";
|
|
5
|
+
import * as fs from "node:fs/promises";
|
|
6
6
|
import npmUser from "npm-user";
|
|
7
7
|
import { readPackageData } from "../../packages.js";
|
|
8
8
|
import { tryCatchAsync } from "../../tryCatchAsync.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/shared/options/createOptionDefaults/index.ts"],"sourcesContent":["import { $ } from \"execa\";\nimport gitRemoteOriginUrl from \"git-remote-origin-url\";\nimport gitUrlParse from \"git-url-parse\";\nimport lazyValue from \"lazy-value\";\nimport fs from \"node:fs/promises\";\nimport npmUser from \"npm-user\";\n\nimport { readPackageData } from \"../../packages.js\";\nimport { tryCatchAsync } from \"../../tryCatchAsync.js\";\nimport { tryCatchLazyValueAsync } from \"../../tryCatchLazyValueAsync.js\";\nimport { PromptedOptions } from \"../../types.js\";\nimport { parsePackageAuthor } from \"./parsePackageAuthor.js\";\nimport { readDefaultsFromDevelopment } from \"./readDefaultsFromDevelopment.js\";\nimport { readDefaultsFromReadme } from \"./readDefaultsFromReadme.js\";\n\nexport function createOptionDefaults(promptedOptions?: PromptedOptions) {\n\tconst gitDefaults = tryCatchLazyValueAsync(async () =>\n\t\tgitUrlParse(await gitRemoteOriginUrl()),\n\t);\n\n\tconst npmDefaults = tryCatchLazyValueAsync(async () => {\n\t\tconst whoami = (await $`npm whoami`).stdout;\n\t\treturn whoami ? await npmUser(whoami) : undefined;\n\t});\n\n\tconst packageData = lazyValue(readPackageData);\n\tconst packageAuthor = lazyValue(async () =>\n\t\tparsePackageAuthor(await packageData()),\n\t);\n\n\treturn {\n\t\tauthor: async () => (await packageAuthor()).author ?? npmDefaults.name,\n\t\tbin: async () => (await packageData()).bin,\n\t\tdescription: async () => (await packageData()).description,\n\t\temail: async () => {\n\t\t\tconst gitEmail = await tryCatchAsync(\n\t\t\t\tasync () => (await $`git config --get user.email`).stdout,\n\t\t\t);\n\t\t\tconst npmEmail =\n\t\t\t\t(await npmDefaults())?.email ?? (await packageAuthor()).email;\n\n\t\t\t/* eslint-disable @typescript-eslint/no-non-null-assertion */\n\t\t\treturn gitEmail || npmEmail\n\t\t\t\t? { github: (gitEmail || npmEmail)!, npm: (npmEmail || gitEmail)! }\n\t\t\t\t: undefined;\n\t\t\t/* eslint-enable @typescript-eslint/no-non-null-assertion */\n\t\t},\n\t\tfunding: async () =>\n\t\t\tawait tryCatchAsync(\n\t\t\t\tasync () =>\n\t\t\t\t\t(await fs.readFile(\".github/FUNDING.yml\"))\n\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t.split(\":\")[1]\n\t\t\t\t\t\t?.trim(),\n\t\t\t),\n\t\towner: async () =>\n\t\t\t(await gitDefaults())?.organization ?? (await packageAuthor()).author,\n\t\trepository: async () =>\n\t\t\tpromptedOptions?.repository ??\n\t\t\t(await gitDefaults())?.name ??\n\t\t\t(await packageData()).name,\n\t\t...readDefaultsFromDevelopment(),\n\t\t...readDefaultsFromReadme(),\n\t};\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAClB,OAAO,wBAAwB;AAC/B,OAAO,iBAAiB;AACxB,OAAO,eAAe;AACtB,
|
|
1
|
+
{"version":3,"sources":["../../../../src/shared/options/createOptionDefaults/index.ts"],"sourcesContent":["import { $ } from \"execa\";\nimport gitRemoteOriginUrl from \"git-remote-origin-url\";\nimport gitUrlParse from \"git-url-parse\";\nimport lazyValue from \"lazy-value\";\nimport * as fs from \"node:fs/promises\";\nimport npmUser from \"npm-user\";\n\nimport { readPackageData } from \"../../packages.js\";\nimport { tryCatchAsync } from \"../../tryCatchAsync.js\";\nimport { tryCatchLazyValueAsync } from \"../../tryCatchLazyValueAsync.js\";\nimport { PromptedOptions } from \"../../types.js\";\nimport { parsePackageAuthor } from \"./parsePackageAuthor.js\";\nimport { readDefaultsFromDevelopment } from \"./readDefaultsFromDevelopment.js\";\nimport { readDefaultsFromReadme } from \"./readDefaultsFromReadme.js\";\n\nexport function createOptionDefaults(promptedOptions?: PromptedOptions) {\n\tconst gitDefaults = tryCatchLazyValueAsync(async () =>\n\t\tgitUrlParse(await gitRemoteOriginUrl()),\n\t);\n\n\tconst npmDefaults = tryCatchLazyValueAsync(async () => {\n\t\tconst whoami = (await $`npm whoami`).stdout;\n\t\treturn whoami ? await npmUser(whoami) : undefined;\n\t});\n\n\tconst packageData = lazyValue(readPackageData);\n\tconst packageAuthor = lazyValue(async () =>\n\t\tparsePackageAuthor(await packageData()),\n\t);\n\n\treturn {\n\t\tauthor: async () => (await packageAuthor()).author ?? npmDefaults.name,\n\t\tbin: async () => (await packageData()).bin,\n\t\tdescription: async () => (await packageData()).description,\n\t\temail: async () => {\n\t\t\tconst gitEmail = await tryCatchAsync(\n\t\t\t\tasync () => (await $`git config --get user.email`).stdout,\n\t\t\t);\n\t\t\tconst npmEmail =\n\t\t\t\t(await npmDefaults())?.email ?? (await packageAuthor()).email;\n\n\t\t\t/* eslint-disable @typescript-eslint/no-non-null-assertion */\n\t\t\treturn gitEmail || npmEmail\n\t\t\t\t? { github: (gitEmail || npmEmail)!, npm: (npmEmail || gitEmail)! }\n\t\t\t\t: undefined;\n\t\t\t/* eslint-enable @typescript-eslint/no-non-null-assertion */\n\t\t},\n\t\tfunding: async () =>\n\t\t\tawait tryCatchAsync(\n\t\t\t\tasync () =>\n\t\t\t\t\t(await fs.readFile(\".github/FUNDING.yml\"))\n\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t.split(\":\")[1]\n\t\t\t\t\t\t?.trim(),\n\t\t\t),\n\t\towner: async () =>\n\t\t\t(await gitDefaults())?.organization ?? (await packageAuthor()).author,\n\t\trepository: async () =>\n\t\t\tpromptedOptions?.repository ??\n\t\t\t(await gitDefaults())?.name ??\n\t\t\t(await packageData()).name,\n\t\t...readDefaultsFromDevelopment(),\n\t\t...readDefaultsFromReadme(),\n\t};\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAClB,OAAO,wBAAwB;AAC/B,OAAO,iBAAiB;AACxB,OAAO,eAAe;AACtB,YAAY,QAAQ;AACpB,OAAO,aAAa;AAEpB,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,8BAA8B;AAEvC,SAAS,0BAA0B;AACnC,SAAS,mCAAmC;AAC5C,SAAS,8BAA8B;AAEhC,SAAS,qBAAqB,iBAAmC;AACvE,QAAM,cAAc;AAAA,IAAuB,YAC1C,YAAY,MAAM,mBAAmB,CAAC;AAAA,EACvC;AAEA,QAAM,cAAc,uBAAuB,YAAY;AACtD,UAAM,UAAU,MAAM,eAAe;AACrC,WAAO,SAAS,MAAM,QAAQ,MAAM,IAAI;AAAA,EACzC,CAAC;AAED,QAAM,cAAc,UAAU,eAAe;AAC7C,QAAM,gBAAgB;AAAA,IAAU,YAC/B,mBAAmB,MAAM,YAAY,CAAC;AAAA,EACvC;AAEA,SAAO;AAAA,IACN,QAAQ,aAAa,MAAM,cAAc,GAAG,UAAU,YAAY;AAAA,IAClE,KAAK,aAAa,MAAM,YAAY,GAAG;AAAA,IACvC,aAAa,aAAa,MAAM,YAAY,GAAG;AAAA,IAC/C,OAAO,YAAY;AAClB,YAAM,WAAW,MAAM;AAAA,QACtB,aAAa,MAAM,gCAAgC;AAAA,MACpD;AACA,YAAM,YACJ,MAAM,YAAY,IAAI,UAAU,MAAM,cAAc,GAAG;AAGzD,aAAO,YAAY,WAChB,EAAE,QAAS,YAAY,UAAY,KAAM,YAAY,SAAW,IAChE;AAAA,IAEJ;AAAA,IACA,SAAS,YACR,MAAM;AAAA,MACL,aACE,MAAM,GAAG,SAAS,qBAAqB,GACtC,SAAS,EACT,MAAM,GAAG,EAAE,CAAC,GACX,KAAK;AAAA,IACV;AAAA,IACD,OAAO,aACL,MAAM,YAAY,IAAI,iBAAiB,MAAM,cAAc,GAAG;AAAA,IAChE,YAAY,YACX,iBAAiB,eAChB,MAAM,YAAY,IAAI,SACtB,MAAM,YAAY,GAAG;AAAA,IACvB,GAAG,4BAA4B;AAAA,IAC/B,GAAG,uBAAuB;AAAA,EAC3B;AACD;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/shared/readFileSafe.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\n\nexport async function readFileSafe(filePath: URL | string, fallback: string) {\n\ttry {\n\t\treturn (await fs.readFile(filePath)).toString();\n\t} catch {\n\t\treturn fallback;\n\t}\n}\n"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/shared/readFileSafe.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nexport async function readFileSafe(filePath: URL | string, fallback: string) {\n\ttry {\n\t\treturn (await fs.readFile(filePath)).toString();\n\t} catch {\n\t\treturn fallback;\n\t}\n}\n"],"mappings":"AAAA,YAAY,QAAQ;AAEpB,eAAsB,aAAa,UAAwB,UAAkB;AAC5E,MAAI;AACH,YAAQ,MAAM,GAAG,SAAS,QAAQ,GAAG,SAAS;AAAA,EAC/C,QAAQ;AACP,WAAO;AAAA,EACR;AACD;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import fs from "node:fs/promises";
|
|
2
|
-
import prettier from "prettier";
|
|
1
|
+
import * as fs from "node:fs/promises";
|
|
3
2
|
import { getGitHubUserAsAllContributor } from "../shared/getGitHubUserAsAllContributor.js";
|
|
4
3
|
import { readFileAsJson } from "../shared/readFileAsJson.js";
|
|
4
|
+
import { formatJson } from "./writing/creation/formatters/formatJson.js";
|
|
5
5
|
async function addOwnerAsAllContributor(options) {
|
|
6
6
|
const user = await getGitHubUserAsAllContributor(options);
|
|
7
7
|
const existingContributors = await readFileAsJson(
|
|
@@ -28,13 +28,10 @@ async function addOwnerAsAllContributor(options) {
|
|
|
28
28
|
}
|
|
29
29
|
await fs.writeFile(
|
|
30
30
|
"./.all-contributorsrc",
|
|
31
|
-
await
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}),
|
|
36
|
-
{ parser: "json" }
|
|
37
|
-
)
|
|
31
|
+
await formatJson({
|
|
32
|
+
...existingContributors,
|
|
33
|
+
contributors
|
|
34
|
+
})
|
|
38
35
|
);
|
|
39
36
|
}
|
|
40
37
|
function isValidAllContributorsData(value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/addOwnerAsAllContributor.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\
|
|
1
|
+
{"version":3,"sources":["../../src/steps/addOwnerAsAllContributor.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nimport { getGitHubUserAsAllContributor } from \"../shared/getGitHubUserAsAllContributor.js\";\nimport { readFileAsJson } from \"../shared/readFileAsJson.js\";\nimport { AllContributorsData, Options } from \"../shared/types.js\";\nimport { formatJson } from \"./writing/creation/formatters/formatJson.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 formatJson({\n\t\t\t...existingContributors,\n\t\t\tcontributors,\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,YAAY,QAAQ;AAEpB,SAAS,qCAAqC;AAC9C,SAAS,sBAAsB;AAE/B,SAAS,kBAAkB;AAE3B,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,WAAW;AAAA,MAChB,GAAG;AAAA,MACH;AAAA,IACD,CAAC;AAAA,EACF;AACD;AAEA,SAAS,2BACR,OAC+B;AAC/B,SAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,kBAAkB;AAClE;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/clearChangelog.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport prettier from \"prettier\";\n\nexport async function clearChangelog() {\n\tawait fs.writeFile(\n\t\t\"./CHANGELOG.md\",\n\t\tawait prettier.format(`# Changelog`, { parser: \"markdown\" }),\n\t);\n}\n"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/steps/clearChangelog.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\nimport prettier from \"prettier\";\n\nexport async function clearChangelog() {\n\tawait fs.writeFile(\n\t\t\"./CHANGELOG.md\",\n\t\tawait prettier.format(`# Changelog`, { parser: \"markdown\" }),\n\t);\n}\n"],"mappings":"AAAA,YAAY,QAAQ;AACpB,OAAO,cAAc;AAErB,eAAsB,iBAAiB;AACtC,QAAM,GAAG;AAAA,IACR;AAAA,IACA,MAAM,SAAS,OAAO,eAAe,EAAE,QAAQ,WAAW,CAAC;AAAA,EAC5D;AACD;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/clearUnnecessaryFiles.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\n\nconst globPaths = [\n\t...extensions(\".babelrc\", \"cjs\", \"cts\", \"js\", \"json\", \"mjs\"),\n\t...extensions(\".eslintrc\", \"js\", \"json\", \"yml\"),\n\t...extensions(\".prettierrc\", \"json\", \"json5\", \"yaml\", \"yml\"),\n\t...extensions(\"prettier.config\", \"js\", \"mjs\", \"cjs\"),\n\t...extensions(\"babel.config\", \"cjs\", \"cts\", \"js\", \"json\", \"mjs\"),\n\t...extensions(\"jest.config\", \"cjs\", \"js\", \"json\", \"mjs\", \"ts\"),\n\t\"./src/**/*.js\",\n\t\".circleci/config.yml\",\n\t\".babelrc\",\n\t\".npmignore\",\n\t\".eslintrc\",\n\t\"CODE_OF_CONDUCT.md\",\n\t\"CONTRIBUTING.md\",\n\t\"codecov.yml\",\n\t\"DEVELOPMENT.md\",\n\t\"dist\",\n\t\"lib\",\n\t\"package-lock.json\",\n\t\"travis.yml\",\n\t\"yarn.lock\",\n];\n\nfunction extensions(base: string, ...extensions: string[]) {\n\treturn extensions.map((extension) => [base, extension].join(\".\"));\n}\n\nexport async function clearUnnecessaryFiles() {\n\tfor (const globPath of globPaths) {\n\t\tawait fs.rm(globPath, { force: true, recursive: true });\n\t}\n}\n"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/steps/clearUnnecessaryFiles.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nconst globPaths = [\n\t...extensions(\".babelrc\", \"cjs\", \"cts\", \"js\", \"json\", \"mjs\"),\n\t...extensions(\".eslintrc\", \"js\", \"json\", \"yml\"),\n\t...extensions(\".prettierrc\", \"json\", \"json5\", \"yaml\", \"yml\"),\n\t...extensions(\"prettier.config\", \"js\", \"mjs\", \"cjs\"),\n\t...extensions(\"babel.config\", \"cjs\", \"cts\", \"js\", \"json\", \"mjs\"),\n\t...extensions(\"jest.config\", \"cjs\", \"js\", \"json\", \"mjs\", \"ts\"),\n\t\"./src/**/*.js\",\n\t\".circleci/config.yml\",\n\t\".babelrc\",\n\t\".npmignore\",\n\t\".eslintrc\",\n\t\"CODE_OF_CONDUCT.md\",\n\t\"CONTRIBUTING.md\",\n\t\"codecov.yml\",\n\t\"DEVELOPMENT.md\",\n\t\"dist\",\n\t\"lib\",\n\t\"package-lock.json\",\n\t\"travis.yml\",\n\t\"yarn.lock\",\n];\n\nfunction extensions(base: string, ...extensions: string[]) {\n\treturn extensions.map((extension) => [base, extension].join(\".\"));\n}\n\nexport async function clearUnnecessaryFiles() {\n\tfor (const globPath of globPaths) {\n\t\tawait fs.rm(globPath, { force: true, recursive: true });\n\t}\n}\n"],"mappings":"AAAA,YAAY,QAAQ;AAEpB,MAAM,YAAY;AAAA,EACjB,GAAG,WAAW,YAAY,OAAO,OAAO,MAAM,QAAQ,KAAK;AAAA,EAC3D,GAAG,WAAW,aAAa,MAAM,QAAQ,KAAK;AAAA,EAC9C,GAAG,WAAW,eAAe,QAAQ,SAAS,QAAQ,KAAK;AAAA,EAC3D,GAAG,WAAW,mBAAmB,MAAM,OAAO,KAAK;AAAA,EACnD,GAAG,WAAW,gBAAgB,OAAO,OAAO,MAAM,QAAQ,KAAK;AAAA,EAC/D,GAAG,WAAW,eAAe,OAAO,MAAM,QAAQ,OAAO,IAAI;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,SAAS,WAAW,SAAiBA,aAAsB;AAC1D,SAAOA,YAAW,IAAI,CAAC,cAAc,CAAC,MAAM,SAAS,EAAE,KAAK,GAAG,CAAC;AACjE;AAEA,eAAsB,wBAAwB;AAC7C,aAAW,YAAY,WAAW;AACjC,UAAM,GAAG,GAAG,UAAU,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AAAA,EACvD;AACD;","names":["extensions"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { $ } from "execa";
|
|
2
|
+
import * as fs from "node:fs/promises";
|
|
3
|
+
import { readFileAsJson } from "../shared/readFileAsJson.js";
|
|
4
|
+
import { formatJson } from "./writing/creation/formatters/formatJson.js";
|
|
5
|
+
async function getStdout() {
|
|
6
|
+
try {
|
|
7
|
+
return await $`pnpm run lint:spelling`;
|
|
8
|
+
} catch (error) {
|
|
9
|
+
return error;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
async function populateCSpellDictionary() {
|
|
13
|
+
const { stdout } = await getStdout();
|
|
14
|
+
const unknownWords = new Set(
|
|
15
|
+
Array.from(stdout.matchAll(/Unknown word \((.+)\)/g)).map(
|
|
16
|
+
([, matched]) => matched
|
|
17
|
+
)
|
|
18
|
+
);
|
|
19
|
+
const existing = await readFileAsJson("cspell.json");
|
|
20
|
+
const allWords = [...existing.words ?? [], ...unknownWords];
|
|
21
|
+
const allWordsUnique = new Set(allWords);
|
|
22
|
+
await fs.writeFile(
|
|
23
|
+
"cspell.json",
|
|
24
|
+
await formatJson({
|
|
25
|
+
...existing,
|
|
26
|
+
words: allWords.filter((word) => {
|
|
27
|
+
const wordLowerCase = word.toLowerCase();
|
|
28
|
+
return word === wordLowerCase || !allWordsUnique.has(wordLowerCase);
|
|
29
|
+
}).sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()))
|
|
30
|
+
})
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
populateCSpellDictionary
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=populateCSpellDictionary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/steps/populateCSpellDictionary.ts"],"sourcesContent":["import { $ } from \"execa\";\nimport * as fs from \"node:fs/promises\";\n\nimport { readFileAsJson } from \"../shared/readFileAsJson.js\";\nimport { formatJson } from \"./writing/creation/formatters/formatJson.js\";\n\nasync function getStdout() {\n\ttry {\n\t\treturn await $`pnpm run lint:spelling`;\n\t} catch (error) {\n\t\treturn error as { stdout: string };\n\t}\n}\n\nexport async function populateCSpellDictionary() {\n\tconst { stdout } = await getStdout();\n\tconst unknownWords = new Set(\n\t\tArray.from(stdout.matchAll(/Unknown word \\((.+)\\)/g)).map(\n\t\t\t([, matched]) => matched,\n\t\t),\n\t);\n\n\tconst existing = (await readFileAsJson(\"cspell.json\")) as Partial<\n\t\ttypeof import(\"../../cspell.json\")\n\t>;\n\n\tconst allWords = [...(existing.words ?? []), ...unknownWords];\n\tconst allWordsUnique = new Set(allWords);\n\n\tawait fs.writeFile(\n\t\t\"cspell.json\",\n\t\tawait formatJson({\n\t\t\t...existing,\n\t\t\twords: allWords\n\t\t\t\t.filter((word) => {\n\t\t\t\t\tconst wordLowerCase = word.toLowerCase();\n\t\t\t\t\treturn word === wordLowerCase || !allWordsUnique.has(wordLowerCase);\n\t\t\t\t})\n\t\t\t\t.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase())),\n\t\t}),\n\t);\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAClB,YAAY,QAAQ;AAEpB,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAE3B,eAAe,YAAY;AAC1B,MAAI;AACH,WAAO,MAAM;AAAA,EACd,SAAS,OAAO;AACf,WAAO;AAAA,EACR;AACD;AAEA,eAAsB,2BAA2B;AAChD,QAAM,EAAE,OAAO,IAAI,MAAM,UAAU;AACnC,QAAM,eAAe,IAAI;AAAA,IACxB,MAAM,KAAK,OAAO,SAAS,wBAAwB,CAAC,EAAE;AAAA,MACrD,CAAC,CAAC,EAAE,OAAO,MAAM;AAAA,IAClB;AAAA,EACD;AAEA,QAAM,WAAY,MAAM,eAAe,aAAa;AAIpD,QAAM,WAAW,CAAC,GAAI,SAAS,SAAS,CAAC,GAAI,GAAG,YAAY;AAC5D,QAAM,iBAAiB,IAAI,IAAI,QAAQ;AAEvC,QAAM,GAAG;AAAA,IACR;AAAA,IACA,MAAM,WAAW;AAAA,MAChB,GAAG;AAAA,MACH,OAAO,SACL,OAAO,CAAC,SAAS;AACjB,cAAM,gBAAgB,KAAK,YAAY;AACvC,eAAO,SAAS,iBAAiB,CAAC,eAAe,IAAI,aAAa;AAAA,MACnE,CAAC,EACA,KAAK,CAAC,GAAG,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;AAAA,IAChE,CAAC;AAAA,EACF;AACD;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/removeSetupScripts.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\n\nconst globPaths = [\n\t\"./bin\",\n\t\"./docs\",\n\t\"./script\",\n\t\"./src/bin\",\n\t\"./src/create\",\n\t\"./src/initialize\",\n\t\"./src/migrate\",\n\t\"./src/shared\",\n\t\"./src/steps\",\n\t\".github/workflows/test-initialize.yml\",\n\t\".github/workflows/test-migrate.yml\",\n];\n\nexport async function removeSetupScripts() {\n\tfor (const globPath of globPaths) {\n\t\tawait fs.rm(globPath, { force: true, recursive: true });\n\t}\n}\n"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/steps/removeSetupScripts.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nconst globPaths = [\n\t\"./bin\",\n\t\"./docs\",\n\t\"./script\",\n\t\"./src/bin\",\n\t\"./src/create\",\n\t\"./src/initialize\",\n\t\"./src/migrate\",\n\t\"./src/shared\",\n\t\"./src/steps\",\n\t\".github/workflows/test-initialize.yml\",\n\t\".github/workflows/test-migrate.yml\",\n];\n\nexport async function removeSetupScripts() {\n\tfor (const globPath of globPaths) {\n\t\tawait fs.rm(globPath, { force: true, recursive: true });\n\t}\n}\n"],"mappings":"AAAA,YAAY,QAAQ;AAEpB,MAAM,YAAY;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,eAAsB,qBAAqB;AAC1C,aAAW,YAAY,WAAW;AACjC,UAAM,GAAG,GAAG,UAAU,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AAAA,EACvD;AACD;","names":[]}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import { $ } from "execa";
|
|
2
|
-
import fs from "node:fs/promises";
|
|
3
|
-
import prettier from "prettier";
|
|
2
|
+
import * as fs from "node:fs/promises";
|
|
4
3
|
import { readFileSafeAsJson } from "../shared/readFileSafeAsJson.js";
|
|
4
|
+
import { formatJson } from "./writing/creation/formatters/formatJson.js";
|
|
5
5
|
async function updateAllContributorsTable({
|
|
6
6
|
owner,
|
|
7
7
|
repository
|
|
8
8
|
}) {
|
|
9
9
|
await fs.writeFile(
|
|
10
10
|
".all-contributorsrc",
|
|
11
|
-
await
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}),
|
|
19
|
-
{ parser: "json" }
|
|
20
|
-
)
|
|
11
|
+
await formatJson({
|
|
12
|
+
...await readFileSafeAsJson(
|
|
13
|
+
".all-contributorsrc"
|
|
14
|
+
),
|
|
15
|
+
projectName: repository,
|
|
16
|
+
projectOwner: owner
|
|
17
|
+
})
|
|
21
18
|
);
|
|
22
19
|
await $`npx -y all-contributors-cli generate`;
|
|
23
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/updateAllContributorsTable.ts"],"sourcesContent":["import { $ } from \"execa\";\nimport fs from \"node:fs/promises\";\
|
|
1
|
+
{"version":3,"sources":["../../src/steps/updateAllContributorsTable.ts"],"sourcesContent":["import { $ } from \"execa\";\nimport * as fs from \"node:fs/promises\";\n\nimport { readFileSafeAsJson } from \"../shared/readFileSafeAsJson.js\";\nimport { AllContributorsData, Options } from \"../shared/types.js\";\nimport { formatJson } from \"./writing/creation/formatters/formatJson.js\";\n\nexport async function updateAllContributorsTable({\n\towner,\n\trepository,\n}: Pick<Options, \"owner\" | \"repository\">) {\n\tawait fs.writeFile(\n\t\t\".all-contributorsrc\",\n\t\tawait formatJson({\n\t\t\t...((await readFileSafeAsJson(\n\t\t\t\t\".all-contributorsrc\",\n\t\t\t)) as AllContributorsData),\n\t\t\tprojectName: repository,\n\t\t\tprojectOwner: owner,\n\t\t}),\n\t);\n\n\tawait $`npx -y all-contributors-cli generate`;\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAClB,YAAY,QAAQ;AAEpB,SAAS,0BAA0B;AAEnC,SAAS,kBAAkB;AAE3B,eAAsB,2BAA2B;AAAA,EAChD;AAAA,EACA;AACD,GAA0C;AACzC,QAAM,GAAG;AAAA,IACR;AAAA,IACA,MAAM,WAAW;AAAA,MAChB,GAAK,MAAM;AAAA,QACV;AAAA,MACD;AAAA,MACA,aAAa;AAAA,MACb,cAAc;AAAA,IACf,CAAC;AAAA,EACF;AAEA,QAAM;AACP;","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import fs from "node:fs/promises";
|
|
1
|
+
import * as fs from "node:fs/promises";
|
|
2
2
|
import { EOL } from "node:os";
|
|
3
3
|
import { readFileSafe } from "../shared/readFileSafe.js";
|
|
4
4
|
const endOfReadmeTemplateLine = `> \u{1F499} This package was templated with [\`create-typescript-app\`](https://github.com/JoshuaKGoldberg/create-typescript-app).`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/updateReadme.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport { EOL } from \"node:os\";\n\nimport { readFileSafe } from \"../shared/readFileSafe.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport const endOfReadmeTemplateLine = `> 💙 This package was templated with [\\`create-typescript-app\\`](https://github.com/JoshuaKGoldberg/create-typescript-app).`;\n\nexport const endOfReadmeNotice = [\n\t``,\n\t`<!-- You can remove this notice if you don't want it 🙂 no worries! -->`,\n\t``,\n\tendOfReadmeTemplateLine,\n\t``,\n].join(EOL);\n\nexport const endOfReadmeMatcher =\n\t/💙.+(?:based|built|templated).+(?:from|using|on|with).+create-typescript-app/;\n\nexport async function updateReadme(options: Pick<Options, \"owner\">) {\n\tlet contents = await readFileSafe(\"./README.md\", \"\");\n\n\tcontents = contents.replaceAll(\"JoshuaKGoldberg\", options.owner);\n\n\tif (!endOfReadmeMatcher.test(contents)) {\n\t\tcontents += endOfReadmeNotice;\n\t}\n\n\tawait fs.writeFile(\"./README.md\", contents);\n}\n"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/steps/updateReadme.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\nimport { EOL } from \"node:os\";\n\nimport { readFileSafe } from \"../shared/readFileSafe.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport const endOfReadmeTemplateLine = `> 💙 This package was templated with [\\`create-typescript-app\\`](https://github.com/JoshuaKGoldberg/create-typescript-app).`;\n\nexport const endOfReadmeNotice = [\n\t``,\n\t`<!-- You can remove this notice if you don't want it 🙂 no worries! -->`,\n\t``,\n\tendOfReadmeTemplateLine,\n\t``,\n].join(EOL);\n\nexport const endOfReadmeMatcher =\n\t/💙.+(?:based|built|templated).+(?:from|using|on|with).+create-typescript-app/;\n\nexport async function updateReadme(options: Pick<Options, \"owner\">) {\n\tlet contents = await readFileSafe(\"./README.md\", \"\");\n\n\tcontents = contents.replaceAll(\"JoshuaKGoldberg\", options.owner);\n\n\tif (!endOfReadmeMatcher.test(contents)) {\n\t\tcontents += endOfReadmeNotice;\n\t}\n\n\tawait fs.writeFile(\"./README.md\", contents);\n}\n"],"mappings":"AAAA,YAAY,QAAQ;AACpB,SAAS,WAAW;AAEpB,SAAS,oBAAoB;AAGtB,MAAM,0BAA0B;AAEhC,MAAM,oBAAoB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,EAAE,KAAK,GAAG;AAEH,MAAM,qBACZ;AAED,eAAsB,aAAa,SAAiC;AACnE,MAAI,WAAW,MAAM,aAAa,eAAe,EAAE;AAEnD,aAAW,SAAS,WAAW,mBAAmB,QAAQ,KAAK;AAE/D,MAAI,CAAC,mBAAmB,KAAK,QAAQ,GAAG;AACvC,gBAAY;AAAA,EACb;AAEA,QAAM,GAAG,UAAU,eAAe,QAAQ;AAC3C;","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import fs from "node:fs/promises";
|
|
1
|
+
import * as fs from "node:fs/promises";
|
|
2
2
|
import { readFileSafe } from "../../shared/readFileSafe.js";
|
|
3
3
|
import { endOfReadmeMatcher, endOfReadmeNotice } from "../updateReadme.js";
|
|
4
4
|
import { findExistingBadges } from "./findExistingBadges.js";
|
|
@@ -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 { endOfReadmeMatcher, 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.slice(1),\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 (!endOfReadmeMatcher.test(contents)) {\n\t\tcontents = [contents, endOfReadmeNotice].join(\"\\n\");\n\t}\n\n\tawait fs.writeFile(\"README.md\", contents);\n}\n"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"sources":["../../../src/steps/writeReadme/index.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nimport { readFileSafe } from \"../../shared/readFileSafe.js\";\nimport { Options } from \"../../shared/types.js\";\nimport { endOfReadmeMatcher, 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.slice(1),\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 (!endOfReadmeMatcher.test(contents)) {\n\t\tcontents = [contents, endOfReadmeNotice].join(\"\\n\");\n\t}\n\n\tawait fs.writeFile(\"README.md\", contents);\n}\n"],"mappings":"AAAA,YAAY,QAAQ;AAEpB,SAAS,oBAAoB;AAE7B,SAAS,oBAAoB,yBAAyB;AACtD,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,kBAAkB,MAAM,CAAC;AAAA,MAC1B,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,mBAAmB,KAAK,QAAQ,GAAG;AACvC,eAAW,CAAC,UAAU,iBAAiB,EAAE,KAAK,IAAI;AAAA,EACnD;AAEA,QAAM,GAAG,UAAU,aAAa,QAAQ;AACzC;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/steps/writing/creation/formatters/formatJson.ts"],"sourcesContent":["import prettier from \"prettier\";\n\nexport async function formatJson(value: object) {\n\treturn await prettier.format(\n\t\tJSON.stringify(\n\t\t\tObject.fromEntries(\n\t\t\t\tObject.entries(value).filter((entry) => entry[1] !== undefined),\n\t\t\t),\n\t\t),\n\t\t{\n\t\t\tparser: \"json\",\n\t\t},\n\t);\n}\n"],"mappings":"AAAA,OAAO,cAAc;AAErB,eAAsB,WAAW,OAAe;AAC/C,SAAO,MAAM,SAAS;AAAA,IACrB,KAAK;AAAA,MACJ,OAAO;AAAA,QACN,OAAO,QAAQ,KAAK,EAAE,OAAO,CAAC,UAAU,MAAM,CAAC,MAAM,MAAS;AAAA,MAC/D;AAAA,IACD;AAAA,IACA;AAAA,MACC,QAAQ;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/steps/writing/creation/formatters/formatJson.ts"],"sourcesContent":["import prettier from \"prettier\";\n\nexport async function formatJson(value: object) {\n\treturn await prettier.format(\n\t\tJSON.stringify(\n\t\t\tObject.fromEntries(\n\t\t\t\tObject.entries(value).filter((entry) => entry[1] !== undefined),\n\t\t\t),\n\t\t),\n\t\t{\n\t\t\tparser: \"json\",\n\t\t\tuseTabs: true,\n\t\t},\n\t);\n}\n"],"mappings":"AAAA,OAAO,cAAc;AAErB,eAAsB,WAAW,OAAe;AAC/C,SAAO,MAAM,SAAS;AAAA,IACrB,KAAK;AAAA,MACJ,OAAO;AAAA,QACN,OAAO,QAAQ,KAAK,EAAE,OAAO,CAAC,UAAU,MAAM,CAAC,MAAM,MAAS;AAAA,MAC/D;AAAA,IACD;AAAA,IACA;AAAA,MACC,QAAQ;AAAA,MACR,SAAS;AAAA,IACV;AAAA,EACD;AACD;","names":[]}
|
|
@@ -110,23 +110,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
110
110
|
"lib",
|
|
111
111
|
"node_modules",
|
|
112
112
|
"pnpm-lock.yaml"
|
|
113
|
-
]
|
|
114
|
-
words: [
|
|
115
|
-
"Codecov",
|
|
116
|
-
"codespace",
|
|
117
|
-
"commitlint",
|
|
118
|
-
"contributorsrc",
|
|
119
|
-
"conventionalcommits",
|
|
120
|
-
...options.excludeLintKnip ? [] : ["knip"],
|
|
121
|
-
"lcov",
|
|
122
|
-
"markdownlintignore",
|
|
123
|
-
"npmpackagejsonlintrc",
|
|
124
|
-
"outro",
|
|
125
|
-
"packagejson",
|
|
126
|
-
"tsup",
|
|
127
|
-
"quickstart",
|
|
128
|
-
"wontfix"
|
|
129
|
-
].sort()
|
|
113
|
+
]
|
|
130
114
|
})
|
|
131
115
|
},
|
|
132
116
|
...!options.excludeLintKnip && {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/writing/creation/rootFiles.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { createDotESLintignore } from \"./createDotESLintignore.js\";\nimport { createDotGitignore } from \"./createDotGitignore.js\";\nimport { createESLintRC } from \"./createESLintRC.js\";\nimport { createTsupConfig } from \"./createTsupConfig.js\";\nimport { formatIgnoreFile } from \"./formatters/formatIgnoreFile.js\";\nimport { formatJson } from \"./formatters/formatJson.js\";\nimport { writeAllContributorsRC } from \"./writeAllContributorsRC.js\";\nimport { writePackageJson } from \"./writePackageJson.js\";\n\nexport async function createRootFiles(options: Options) {\n\treturn {\n\t\t\".all-contributorsrc\": await writeAllContributorsRC(options),\n\t\t\".eslintignore\": createDotESLintignore(options),\n\t\t\".eslintrc.cjs\": await createESLintRC(options),\n\t\t\".gitignore\": createDotGitignore(options),\n\t\t...(!options.excludeLintMd && {\n\t\t\t\".markdownlint.json\": await formatJson({\n\t\t\t\textends: \"markdownlint/style/prettier\",\n\t\t\t\t\"first-line-h1\": false,\n\t\t\t\t\"no-inline-html\": false,\n\t\t\t}),\n\t\t\t\".markdownlintignore\": formatIgnoreFile([\n\t\t\t\t\".github/CODE_OF_CONDUCT.md\",\n\t\t\t\t\"CHANGELOG.md\",\n\t\t\t\t\"lib/\",\n\t\t\t\t\"node_modules/\",\n\t\t\t]),\n\t\t}),\n\t\t...(!options.excludeLintPackageJson && {\n\t\t\t\".npmpackagejsonlintrc.json\": await formatJson({\n\t\t\t\textends: \"npm-package-json-lint-config-default\",\n\t\t\t\trules: {\n\t\t\t\t\t\"require-description\": \"error\",\n\t\t\t\t\t\"require-license\": \"error\",\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\t\".nvmrc\": `20.10.0\\n`,\n\t\t\".prettierignore\": formatIgnoreFile([\n\t\t\t...(options.excludeAllContributors ? [] : [\".all-contributorsrc\"]),\n\t\t\t...(options.excludeTests ? [] : [\"coverage/\"]),\n\t\t\t\"lib/\",\n\t\t\t\"pnpm-lock.yaml\",\n\t\t]),\n\t\t\".prettierrc\": await formatJson({\n\t\t\t$schema: \"http://json.schemastore.org/prettierrc\",\n\t\t\toverrides: [\n\t\t\t\t{\n\t\t\t\t\tfiles: \".*rc\",\n\t\t\t\t\toptions: { parser: \"json\" },\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfiles: \".nvmrc\",\n\t\t\t\t\toptions: { parser: \"yaml\" },\n\t\t\t\t},\n\t\t\t],\n\t\t\tplugins: [\"prettier-plugin-curly\", \"prettier-plugin-packagejson\"],\n\t\t\tuseTabs: true,\n\t\t}),\n\t\t...(!options.excludeReleases && {\n\t\t\t\".release-it.json\": await formatJson({\n\t\t\t\tgit: {\n\t\t\t\t\tcommitMessage: \"chore: release v${version}\",\n\t\t\t\t\trequireCommits: true,\n\t\t\t\t},\n\t\t\t\tgithub: {\n\t\t\t\t\tautoGenerate: true,\n\t\t\t\t\trelease: true,\n\t\t\t\t\treleaseName: \"v${version}\",\n\t\t\t\t},\n\t\t\t\tnpm: {\n\t\t\t\t\tpublishArgs: [`--access ${options.access}`, \"--provenance\"],\n\t\t\t\t},\n\t\t\t\tplugins: {\n\t\t\t\t\t\"@release-it/conventional-changelog\": {\n\t\t\t\t\t\tinfile: \"CHANGELOG.md\",\n\t\t\t\t\t\tpreset: \"angular\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\t\"LICENSE.md\": `# MIT License\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n`,\n\t\t...(!options.excludeLintSpelling && {\n\t\t\t\"cspell.json\": await formatJson({\n\t\t\t\tdictionaries: [\"typescript\"],\n\t\t\t\tignorePaths: [\n\t\t\t\t\t\".github\",\n\t\t\t\t\t\"CHANGELOG.md\",\n\t\t\t\t\t...(options.excludeTests ? [] : [\"coverage\"]),\n\t\t\t\t\t\"lib\",\n\t\t\t\t\t\"node_modules\",\n\t\t\t\t\t\"pnpm-lock.yaml\",\n\t\t\t\t],\n\t\t\t
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/writing/creation/rootFiles.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { createDotESLintignore } from \"./createDotESLintignore.js\";\nimport { createDotGitignore } from \"./createDotGitignore.js\";\nimport { createESLintRC } from \"./createESLintRC.js\";\nimport { createTsupConfig } from \"./createTsupConfig.js\";\nimport { formatIgnoreFile } from \"./formatters/formatIgnoreFile.js\";\nimport { formatJson } from \"./formatters/formatJson.js\";\nimport { writeAllContributorsRC } from \"./writeAllContributorsRC.js\";\nimport { writePackageJson } from \"./writePackageJson.js\";\n\nexport async function createRootFiles(options: Options) {\n\treturn {\n\t\t\".all-contributorsrc\": await writeAllContributorsRC(options),\n\t\t\".eslintignore\": createDotESLintignore(options),\n\t\t\".eslintrc.cjs\": await createESLintRC(options),\n\t\t\".gitignore\": createDotGitignore(options),\n\t\t...(!options.excludeLintMd && {\n\t\t\t\".markdownlint.json\": await formatJson({\n\t\t\t\textends: \"markdownlint/style/prettier\",\n\t\t\t\t\"first-line-h1\": false,\n\t\t\t\t\"no-inline-html\": false,\n\t\t\t}),\n\t\t\t\".markdownlintignore\": formatIgnoreFile([\n\t\t\t\t\".github/CODE_OF_CONDUCT.md\",\n\t\t\t\t\"CHANGELOG.md\",\n\t\t\t\t\"lib/\",\n\t\t\t\t\"node_modules/\",\n\t\t\t]),\n\t\t}),\n\t\t...(!options.excludeLintPackageJson && {\n\t\t\t\".npmpackagejsonlintrc.json\": await formatJson({\n\t\t\t\textends: \"npm-package-json-lint-config-default\",\n\t\t\t\trules: {\n\t\t\t\t\t\"require-description\": \"error\",\n\t\t\t\t\t\"require-license\": \"error\",\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\t\".nvmrc\": `20.10.0\\n`,\n\t\t\".prettierignore\": formatIgnoreFile([\n\t\t\t...(options.excludeAllContributors ? [] : [\".all-contributorsrc\"]),\n\t\t\t...(options.excludeTests ? [] : [\"coverage/\"]),\n\t\t\t\"lib/\",\n\t\t\t\"pnpm-lock.yaml\",\n\t\t]),\n\t\t\".prettierrc\": await formatJson({\n\t\t\t$schema: \"http://json.schemastore.org/prettierrc\",\n\t\t\toverrides: [\n\t\t\t\t{\n\t\t\t\t\tfiles: \".*rc\",\n\t\t\t\t\toptions: { parser: \"json\" },\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfiles: \".nvmrc\",\n\t\t\t\t\toptions: { parser: \"yaml\" },\n\t\t\t\t},\n\t\t\t],\n\t\t\tplugins: [\"prettier-plugin-curly\", \"prettier-plugin-packagejson\"],\n\t\t\tuseTabs: true,\n\t\t}),\n\t\t...(!options.excludeReleases && {\n\t\t\t\".release-it.json\": await formatJson({\n\t\t\t\tgit: {\n\t\t\t\t\tcommitMessage: \"chore: release v${version}\",\n\t\t\t\t\trequireCommits: true,\n\t\t\t\t},\n\t\t\t\tgithub: {\n\t\t\t\t\tautoGenerate: true,\n\t\t\t\t\trelease: true,\n\t\t\t\t\treleaseName: \"v${version}\",\n\t\t\t\t},\n\t\t\t\tnpm: {\n\t\t\t\t\tpublishArgs: [`--access ${options.access}`, \"--provenance\"],\n\t\t\t\t},\n\t\t\t\tplugins: {\n\t\t\t\t\t\"@release-it/conventional-changelog\": {\n\t\t\t\t\t\tinfile: \"CHANGELOG.md\",\n\t\t\t\t\t\tpreset: \"angular\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\t\"LICENSE.md\": `# MIT License\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n`,\n\t\t...(!options.excludeLintSpelling && {\n\t\t\t\"cspell.json\": await formatJson({\n\t\t\t\tdictionaries: [\"typescript\"],\n\t\t\t\tignorePaths: [\n\t\t\t\t\t\".github\",\n\t\t\t\t\t\"CHANGELOG.md\",\n\t\t\t\t\t...(options.excludeTests ? [] : [\"coverage\"]),\n\t\t\t\t\t\"lib\",\n\t\t\t\t\t\"node_modules\",\n\t\t\t\t\t\"pnpm-lock.yaml\",\n\t\t\t\t],\n\t\t\t}),\n\t\t}),\n\t\t...(!options.excludeLintKnip && {\n\t\t\t\"knip.jsonc\": await formatJson({\n\t\t\t\t$schema: \"https://unpkg.com/knip@latest/schema.json\",\n\t\t\t\tentry: [\"src/index.ts!\"],\n\t\t\t\tignoreExportsUsedInFile: {\n\t\t\t\t\tinterface: true,\n\t\t\t\t\ttype: true,\n\t\t\t\t},\n\t\t\t\tproject: [\"src/**/*.ts!\"],\n\t\t\t}),\n\t\t}),\n\t\t\"package.json\": await writePackageJson(options),\n\t\t\"tsconfig.eslint.json\": await formatJson({\n\t\t\textends: \"./tsconfig.json\",\n\t\t\tinclude: [\".\"],\n\t\t}),\n\t\t\"tsconfig.json\": await formatJson({\n\t\t\tcompilerOptions: {\n\t\t\t\tdeclaration: true,\n\t\t\t\tdeclarationMap: true,\n\t\t\t\tesModuleInterop: true,\n\t\t\t\tmodule: \"NodeNext\",\n\t\t\t\tmoduleResolution: \"NodeNext\",\n\t\t\t\tnoEmit: true,\n\t\t\t\toutDir: \"lib\",\n\t\t\t\tresolveJsonModule: true,\n\t\t\t\tskipLibCheck: true,\n\t\t\t\tsourceMap: true,\n\t\t\t\tstrict: true,\n\t\t\t\ttarget: \"ES2022\",\n\t\t\t},\n\t\t\tinclude: [\"src\"],\n\t\t}),\n\t\t\"tsup.config.ts\": await createTsupConfig(options),\n\t\t...(!options.excludeTests && {\n\t\t\t\"vitest.config.ts\": `import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n\ttest: {\n\t\tclearMocks: true,\n\t\tcoverage: {\n\t\t\tall: true,\n\t\t\texclude: [\"lib\"],\n\t\t\tinclude: [\"src\"],\n\t\t\treporter: [\"html\", \"lcov\"],\n\t\t},\n\t\texclude: [\"lib\", \"node_modules\"],\n\t\tsetupFiles: [\"console-fail-test/setup\"],\n\t},\n});\n`,\n\t\t}),\n\t};\n}\n"],"mappings":"AACA,SAAS,6BAA6B;AACtC,SAAS,0BAA0B;AACnC,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AACjC,SAAS,kBAAkB;AAC3B,SAAS,8BAA8B;AACvC,SAAS,wBAAwB;AAEjC,eAAsB,gBAAgB,SAAkB;AACvD,SAAO;AAAA,IACN,uBAAuB,MAAM,uBAAuB,OAAO;AAAA,IAC3D,iBAAiB,sBAAsB,OAAO;AAAA,IAC9C,iBAAiB,MAAM,eAAe,OAAO;AAAA,IAC7C,cAAc,mBAAmB,OAAO;AAAA,IACxC,GAAI,CAAC,QAAQ,iBAAiB;AAAA,MAC7B,sBAAsB,MAAM,WAAW;AAAA,QACtC,SAAS;AAAA,QACT,iBAAiB;AAAA,QACjB,kBAAkB;AAAA,MACnB,CAAC;AAAA,MACD,uBAAuB,iBAAiB;AAAA,QACvC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAC;AAAA,IACF;AAAA,IACA,GAAI,CAAC,QAAQ,0BAA0B;AAAA,MACtC,8BAA8B,MAAM,WAAW;AAAA,QAC9C,SAAS;AAAA,QACT,OAAO;AAAA,UACN,uBAAuB;AAAA,UACvB,mBAAmB;AAAA,QACpB;AAAA,MACD,CAAC;AAAA,IACF;AAAA,IACA,UAAU;AAAA;AAAA,IACV,mBAAmB,iBAAiB;AAAA,MACnC,GAAI,QAAQ,yBAAyB,CAAC,IAAI,CAAC,qBAAqB;AAAA,MAChE,GAAI,QAAQ,eAAe,CAAC,IAAI,CAAC,WAAW;AAAA,MAC5C;AAAA,MACA;AAAA,IACD,CAAC;AAAA,IACD,eAAe,MAAM,WAAW;AAAA,MAC/B,SAAS;AAAA,MACT,WAAW;AAAA,QACV;AAAA,UACC,OAAO;AAAA,UACP,SAAS,EAAE,QAAQ,OAAO;AAAA,QAC3B;AAAA,QACA;AAAA,UACC,OAAO;AAAA,UACP,SAAS,EAAE,QAAQ,OAAO;AAAA,QAC3B;AAAA,MACD;AAAA,MACA,SAAS,CAAC,yBAAyB,6BAA6B;AAAA,MAChE,SAAS;AAAA,IACV,CAAC;AAAA,IACD,GAAI,CAAC,QAAQ,mBAAmB;AAAA,MAC/B,oBAAoB,MAAM,WAAW;AAAA,QACpC,KAAK;AAAA,UACJ,eAAe;AAAA,UACf,gBAAgB;AAAA,QACjB;AAAA,QACA,QAAQ;AAAA,UACP,cAAc;AAAA,UACd,SAAS;AAAA,UACT,aAAa;AAAA,QACd;AAAA,QACA,KAAK;AAAA,UACJ,aAAa,CAAC,YAAY,QAAQ,MAAM,IAAI,cAAc;AAAA,QAC3D;AAAA,QACA,SAAS;AAAA,UACR,sCAAsC;AAAA,YACrC,QAAQ;AAAA,YACR,QAAQ;AAAA,UACT;AAAA,QACD;AAAA,MACD,CAAC;AAAA,IACF;AAAA,IACA,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAqBd,GAAI,CAAC,QAAQ,uBAAuB;AAAA,MACnC,eAAe,MAAM,WAAW;AAAA,QAC/B,cAAc,CAAC,YAAY;AAAA,QAC3B,aAAa;AAAA,UACZ;AAAA,UACA;AAAA,UACA,GAAI,QAAQ,eAAe,CAAC,IAAI,CAAC,UAAU;AAAA,UAC3C;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD,CAAC;AAAA,IACF;AAAA,IACA,GAAI,CAAC,QAAQ,mBAAmB;AAAA,MAC/B,cAAc,MAAM,WAAW;AAAA,QAC9B,SAAS;AAAA,QACT,OAAO,CAAC,eAAe;AAAA,QACvB,yBAAyB;AAAA,UACxB,WAAW;AAAA,UACX,MAAM;AAAA,QACP;AAAA,QACA,SAAS,CAAC,cAAc;AAAA,MACzB,CAAC;AAAA,IACF;AAAA,IACA,gBAAgB,MAAM,iBAAiB,OAAO;AAAA,IAC9C,wBAAwB,MAAM,WAAW;AAAA,MACxC,SAAS;AAAA,MACT,SAAS,CAAC,GAAG;AAAA,IACd,CAAC;AAAA,IACD,iBAAiB,MAAM,WAAW;AAAA,MACjC,iBAAiB;AAAA,QAChB,aAAa;AAAA,QACb,gBAAgB;AAAA,QAChB,iBAAiB;AAAA,QACjB,QAAQ;AAAA,QACR,kBAAkB;AAAA,QAClB,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,mBAAmB;AAAA,QACnB,cAAc;AAAA,QACd,WAAW;AAAA,QACX,QAAQ;AAAA,QACR,QAAQ;AAAA,MACT;AAAA,MACA,SAAS,CAAC,KAAK;AAAA,IAChB,CAAC;AAAA,IACD,kBAAkB,MAAM,iBAAiB,OAAO;AAAA,IAChD,GAAI,CAAC,QAAQ,gBAAgB;AAAA,MAC5B,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgBrB;AAAA,EACD;AACD;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/writing/creation/writePackageJson.ts"],"sourcesContent":["import { readFileSafeAsJson } from \"../../../shared/readFileSafeAsJson.js\";\nimport { Options } from \"../../../shared/types.js\";\nimport { formatJson } from \"./formatters/formatJson.js\";\n\nconst devDependenciesToRemove = [\n\t\"@babel/core\",\n\t\"@babel/preset-env\",\n\t\"@babel/preset-react\",\n\t\"@babel/preset-typescript\",\n\t\"@swc/jest\",\n\t\"@vitest/coverage-istanbul\",\n\t\"ava\",\n\t\"babel-jest\",\n\t\"commitlint\",\n\t\"cson-parser\",\n\t\"esbuild\",\n\t\"eslint-config-prettier\",\n\t\"eslint-plugin-import\",\n\t\"eslint-plugin-jest\",\n\t\"eslint-plugin-prettier\",\n\t\"eslint-plugin-simple-import-sort\",\n\t\"eslint-plugin-typescript-sort-keys\",\n\t\"jasmine\",\n\t\"jest\",\n\t\"mocha\",\n\t\"npm-run-all\",\n\t\"pnpm-deduplicate\",\n\t\"pretty-quick\",\n\t\"ts-jest\",\n];\n\nexport async function writePackageJson(options: Options) {\n\tconst existingPackageJson =\n\t\t((await readFileSafeAsJson(\"./package.json\")) as null | object) ?? {};\n\n\treturn await formatJson({\n\t\t// If we didn't already have a version, set it to 0.0.0\n\t\tversion: \"0.0.0\",\n\n\t\t// To start, copy over all existing package fields (e.g. \"dependencies\")\n\t\t...existingPackageJson,\n\n\t\tauthor: { email: options.email.npm, name: options.author },\n\t\tbin: options.bin,\n\t\tdescription: options.description,\n\t\tkeywords: options.keywords?.length\n\t\t\t? options.keywords.flatMap((keyword) => keyword.split(/ /))\n\t\t\t: undefined,\n\n\t\t// We copy all existing dev dependencies except those we know are not used anymore\n\t\tdevDependencies: copyDevDependencies(existingPackageJson),\n\n\t\t// Remove fields we know we don't want, such as old or redundant configs\n\t\teslintConfig: undefined,\n\t\thusky: undefined,\n\t\tprettierConfig: undefined,\n\t\ttypes: undefined,\n\n\t\t// The rest of the fields are ones we know from our template\n\t\tengines: {\n\t\t\tnode: \">=18\",\n\t\t},\n\t\tfiles: [\n\t\t\toptions.bin?.replace(/^\\.\\//, \"\"),\n\t\t\t\"lib/\",\n\t\t\t\"package.json\",\n\t\t\t\"LICENSE.md\",\n\t\t\t\"README.md\",\n\t\t].filter(Boolean),\n\t\tlicense: \"MIT\",\n\t\t\"lint-staged\": {\n\t\t\t\"*\": \"prettier --ignore-unknown --write\",\n\t\t},\n\t\tmain: \"./lib/index.js\",\n\t\tname: options.repository,\n\t\tpackageManager: \"pnpm@8.
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/writing/creation/writePackageJson.ts"],"sourcesContent":["import { readFileSafeAsJson } from \"../../../shared/readFileSafeAsJson.js\";\nimport { Options } from \"../../../shared/types.js\";\nimport { formatJson } from \"./formatters/formatJson.js\";\n\nconst devDependenciesToRemove = [\n\t\"@babel/core\",\n\t\"@babel/preset-env\",\n\t\"@babel/preset-react\",\n\t\"@babel/preset-typescript\",\n\t\"@swc/jest\",\n\t\"@vitest/coverage-istanbul\",\n\t\"ava\",\n\t\"babel-jest\",\n\t\"commitlint\",\n\t\"cson-parser\",\n\t\"esbuild\",\n\t\"eslint-config-prettier\",\n\t\"eslint-plugin-import\",\n\t\"eslint-plugin-jest\",\n\t\"eslint-plugin-prettier\",\n\t\"eslint-plugin-simple-import-sort\",\n\t\"eslint-plugin-typescript-sort-keys\",\n\t\"jasmine\",\n\t\"jest\",\n\t\"mocha\",\n\t\"npm-run-all\",\n\t\"pnpm-deduplicate\",\n\t\"pretty-quick\",\n\t\"ts-jest\",\n];\n\nexport async function writePackageJson(options: Options) {\n\tconst existingPackageJson =\n\t\t((await readFileSafeAsJson(\"./package.json\")) as null | object) ?? {};\n\n\treturn await formatJson({\n\t\t// If we didn't already have a version, set it to 0.0.0\n\t\tversion: \"0.0.0\",\n\n\t\t// To start, copy over all existing package fields (e.g. \"dependencies\")\n\t\t...existingPackageJson,\n\n\t\tauthor: { email: options.email.npm, name: options.author },\n\t\tbin: options.bin,\n\t\tdescription: options.description,\n\t\tkeywords: options.keywords?.length\n\t\t\t? options.keywords.flatMap((keyword) => keyword.split(/ /))\n\t\t\t: undefined,\n\n\t\t// We copy all existing dev dependencies except those we know are not used anymore\n\t\tdevDependencies: copyDevDependencies(existingPackageJson),\n\n\t\t// Remove fields we know we don't want, such as old or redundant configs\n\t\teslintConfig: undefined,\n\t\thusky: undefined,\n\t\tprettierConfig: undefined,\n\t\ttypes: undefined,\n\n\t\t// The rest of the fields are ones we know from our template\n\t\tengines: {\n\t\t\tnode: \">=18\",\n\t\t},\n\t\tfiles: [\n\t\t\toptions.bin?.replace(/^\\.\\//, \"\"),\n\t\t\t\"lib/\",\n\t\t\t\"package.json\",\n\t\t\t\"LICENSE.md\",\n\t\t\t\"README.md\",\n\t\t].filter(Boolean),\n\t\tlicense: \"MIT\",\n\t\t\"lint-staged\": {\n\t\t\t\"*\": \"prettier --ignore-unknown --write\",\n\t\t},\n\t\tmain: \"./lib/index.js\",\n\t\tname: options.repository,\n\t\tpackageManager: \"pnpm@8.14.0\",\n\t\tpublishConfig: {\n\t\t\tprovenance: true,\n\t\t},\n\t\trepository: {\n\t\t\ttype: \"git\",\n\t\t\turl: `https://github.com/${options.owner}/${options.repository}`,\n\t\t},\n\t\tscripts: {\n\t\t\tbuild: \"tsup\",\n\t\t\tformat: 'prettier \"**/*\" --ignore-unknown',\n\t\t\tlint: \"eslint . .*js --max-warnings 0\",\n\t\t\t...(!options.excludeLintKnip && {\n\t\t\t\t\"lint:knip\": \"knip\",\n\t\t\t}),\n\t\t\t...(!options.excludeLintMd && {\n\t\t\t\t\"lint:md\":\n\t\t\t\t\t'markdownlint \"**/*.md\" \".github/**/*.md\" --rules sentences-per-line',\n\t\t\t}),\n\t\t\t...(!options.excludeLintPackageJson && {\n\t\t\t\t\"lint:package-json\": \"npmPkgJsonLint .\",\n\t\t\t}),\n\t\t\t...(!options.excludeLintPackages && {\n\t\t\t\t\"lint:packages\": \"pnpm dedupe --check\",\n\t\t\t}),\n\t\t\t...(!options.excludeLintSpelling && {\n\t\t\t\t\"lint:spelling\": 'cspell \"**\" \".github/**/*\"',\n\t\t\t}),\n\t\t\tprepare: \"husky install\",\n\t\t\t...(!options.excludeReleases && {\n\t\t\t\t\"should-semantic-release\": \"should-semantic-release --verbose\",\n\t\t\t}),\n\t\t\t...(!options.excludeReleases && { test: \"vitest\" }),\n\t\t\ttsc: \"tsc\",\n\t\t},\n\t\ttype: \"module\",\n\t});\n}\n\nfunction copyDevDependencies(existingPackageJson: object) {\n\tconst devDependencies =\n\t\t\"devDependencies\" in existingPackageJson\n\t\t\t? (existingPackageJson.devDependencies as Record<string, string>)\n\t\t\t: {};\n\n\tfor (const devDependencyToRemove of devDependenciesToRemove) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\tdelete devDependencies[devDependencyToRemove];\n\t}\n\n\treturn devDependencies;\n}\n"],"mappings":"AAAA,SAAS,0BAA0B;AAEnC,SAAS,kBAAkB;AAE3B,MAAM,0BAA0B;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,eAAsB,iBAAiB,SAAkB;AACxD,QAAM,sBACH,MAAM,mBAAmB,gBAAgB,KAAwB,CAAC;AAErE,SAAO,MAAM,WAAW;AAAA;AAAA,IAEvB,SAAS;AAAA;AAAA,IAGT,GAAG;AAAA,IAEH,QAAQ,EAAE,OAAO,QAAQ,MAAM,KAAK,MAAM,QAAQ,OAAO;AAAA,IACzD,KAAK,QAAQ;AAAA,IACb,aAAa,QAAQ;AAAA,IACrB,UAAU,QAAQ,UAAU,SACzB,QAAQ,SAAS,QAAQ,CAAC,YAAY,QAAQ,MAAM,GAAG,CAAC,IACxD;AAAA;AAAA,IAGH,iBAAiB,oBAAoB,mBAAmB;AAAA;AAAA,IAGxD,cAAc;AAAA,IACd,OAAO;AAAA,IACP,gBAAgB;AAAA,IAChB,OAAO;AAAA;AAAA,IAGP,SAAS;AAAA,MACR,MAAM;AAAA,IACP;AAAA,IACA,OAAO;AAAA,MACN,QAAQ,KAAK,QAAQ,SAAS,EAAE;AAAA,MAChC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,EAAE,OAAO,OAAO;AAAA,IAChB,SAAS;AAAA,IACT,eAAe;AAAA,MACd,KAAK;AAAA,IACN;AAAA,IACA,MAAM;AAAA,IACN,MAAM,QAAQ;AAAA,IACd,gBAAgB;AAAA,IAChB,eAAe;AAAA,MACd,YAAY;AAAA,IACb;AAAA,IACA,YAAY;AAAA,MACX,MAAM;AAAA,MACN,KAAK,sBAAsB,QAAQ,KAAK,IAAI,QAAQ,UAAU;AAAA,IAC/D;AAAA,IACA,SAAS;AAAA,MACR,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,GAAI,CAAC,QAAQ,mBAAmB;AAAA,QAC/B,aAAa;AAAA,MACd;AAAA,MACA,GAAI,CAAC,QAAQ,iBAAiB;AAAA,QAC7B,WACC;AAAA,MACF;AAAA,MACA,GAAI,CAAC,QAAQ,0BAA0B;AAAA,QACtC,qBAAqB;AAAA,MACtB;AAAA,MACA,GAAI,CAAC,QAAQ,uBAAuB;AAAA,QACnC,iBAAiB;AAAA,MAClB;AAAA,MACA,GAAI,CAAC,QAAQ,uBAAuB;AAAA,QACnC,iBAAiB;AAAA,MAClB;AAAA,MACA,SAAS;AAAA,MACT,GAAI,CAAC,QAAQ,mBAAmB;AAAA,QAC/B,2BAA2B;AAAA,MAC5B;AAAA,MACA,GAAI,CAAC,QAAQ,mBAAmB,EAAE,MAAM,SAAS;AAAA,MACjD,KAAK;AAAA,IACN;AAAA,IACA,MAAM;AAAA,EACP,CAAC;AACF;AAEA,SAAS,oBAAoB,qBAA6B;AACzD,QAAM,kBACL,qBAAqB,sBACjB,oBAAoB,kBACrB,CAAC;AAEL,aAAW,yBAAyB,yBAAyB;AAE5D,WAAO,gBAAgB,qBAAqB;AAAA,EAC7C;AAEA,SAAO;AACR;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-typescript-app",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.53.0",
|
|
4
4
|
"description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 💝",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@typescript-eslint/eslint-plugin": "^6.13.2",
|
|
73
73
|
"@typescript-eslint/parser": "^6.13.2",
|
|
74
74
|
"@vitest/coverage-v8": "^1.0.2",
|
|
75
|
-
"c8": "^
|
|
75
|
+
"c8": "^9.0.0",
|
|
76
76
|
"console-fail-test": "^0.2.3",
|
|
77
77
|
"cspell": "^8.1.3",
|
|
78
78
|
"eslint": "^8.55.0",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"globby": "^14.0.0",
|
|
91
91
|
"husky": "^8.0.3",
|
|
92
92
|
"jsonc-eslint-parser": "^2.4.0",
|
|
93
|
-
"knip": "3.
|
|
93
|
+
"knip": "3.12.0",
|
|
94
94
|
"lint-staged": "^15.2.0",
|
|
95
95
|
"markdownlint": "^0.32.1",
|
|
96
96
|
"markdownlint-cli": "^0.38.0",
|