create-typescript-app 1.77.0 → 1.78.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 +5 -4
- package/lib/bin/promptForMode.js +2 -1
- package/lib/bin/promptForMode.js.map +1 -1
- package/lib/create/createWithOptions.d.ts +3 -4
- package/lib/create/createWithOptions.js +19 -11
- package/lib/create/createWithOptions.js.map +1 -1
- package/lib/initialize/initializeWithOptions.d.ts +3 -4
- package/lib/initialize/initializeWithOptions.js +4 -4
- package/lib/initialize/initializeWithOptions.js.map +1 -1
- package/lib/migrate/migrateWithOptions.d.ts +3 -4
- package/lib/migrate/migrateWithOptions.js +8 -5
- package/lib/migrate/migrateWithOptions.js.map +1 -1
- package/lib/next/base.js +4 -0
- package/lib/next/base.js.map +1 -1
- package/lib/next/blocks/blockAllContributors.js +12 -11
- package/lib/next/blocks/blockAllContributors.js.map +1 -1
- package/lib/next/blocks/blockCSpell.js +2 -7
- package/lib/next/blocks/blockCSpell.js.map +1 -1
- package/lib/next/blocks/blockContributingDocs.js +11 -0
- package/lib/next/blocks/blockContributingDocs.js.map +1 -1
- package/lib/next/blocks/blockContributorCovenant.js +11 -0
- package/lib/next/blocks/blockContributorCovenant.js.map +1 -1
- package/lib/next/blocks/blockDevelopmentDocs.js +15 -9
- package/lib/next/blocks/blockDevelopmentDocs.js.map +1 -1
- package/lib/next/blocks/blockESLint.js +18 -1
- package/lib/next/blocks/blockESLint.js.map +1 -1
- package/lib/next/blocks/blockExampleFiles.d.ts +50 -0
- package/lib/next/blocks/blockExampleFiles.js +25 -0
- package/lib/next/blocks/blockExampleFiles.js.map +1 -0
- package/lib/next/blocks/blockGitHubActionsCI.js +11 -0
- package/lib/next/blocks/blockGitHubActionsCI.js.map +1 -1
- package/lib/next/blocks/blockPackageJson.d.ts +1 -0
- package/lib/next/blocks/blockPackageJson.js +18 -7
- package/lib/next/blocks/blockPackageJson.js.map +1 -1
- package/lib/next/blocks/blockPnpmDedupe.js +1 -6
- package/lib/next/blocks/blockPnpmDedupe.js.map +1 -1
- package/lib/next/blocks/blockPrettier.js +18 -8
- package/lib/next/blocks/blockPrettier.js.map +1 -1
- package/lib/next/blocks/blockReleaseIt.js +5 -0
- package/lib/next/blocks/blockReleaseIt.js.map +1 -1
- package/lib/next/blocks/blockRepositoryBranchRuleset.d.ts +50 -0
- package/lib/next/blocks/blockRepositoryBranchRuleset.js +62 -0
- package/lib/next/blocks/blockRepositoryBranchRuleset.js.map +1 -0
- package/lib/next/blocks/blockRepositoryLabels.d.ts +48 -0
- package/lib/next/blocks/blockRepositoryLabels.js +18 -0
- package/lib/next/blocks/blockRepositoryLabels.js.map +1 -0
- package/lib/next/blocks/blockRepositorySettings.d.ts +48 -0
- package/lib/next/blocks/blockRepositorySettings.js +42 -0
- package/lib/next/blocks/blockRepositorySettings.js.map +1 -0
- package/lib/next/blocks/blockTSup.js +19 -2
- package/lib/next/blocks/blockTSup.js.map +1 -1
- package/lib/next/blocks/blockTemplatedBy.d.ts +1 -3
- package/lib/next/blocks/blockTemplatedBy.js +0 -4
- package/lib/next/blocks/blockTemplatedBy.js.map +1 -1
- package/lib/next/blocks/blockTypeScript.js +28 -0
- package/lib/next/blocks/blockTypeScript.js.map +1 -1
- package/lib/next/blocks/blockVSCode.js +4 -0
- package/lib/next/blocks/blockVSCode.js.map +1 -1
- package/lib/next/blocks/blockVitest.js +63 -0
- package/lib/next/blocks/blockVitest.js.map +1 -1
- package/lib/next/blocks/packageData.js.map +1 -1
- package/lib/next/blocks/phases.d.ts +9 -0
- package/lib/next/blocks/phases.js +11 -0
- package/lib/next/blocks/phases.js.map +1 -0
- package/lib/next/presetMinimal.js +8 -0
- package/lib/next/presetMinimal.js.map +1 -1
- package/lib/next/runCreateEnginePreset.d.ts +7 -0
- package/lib/next/runCreateEnginePreset.js +20 -0
- package/lib/next/runCreateEnginePreset.js.map +1 -0
- package/lib/shared/options/ensureRepositoryExists.d.ts +3 -4
- package/lib/shared/options/ensureRepositoryExists.js +9 -8
- package/lib/shared/options/ensureRepositoryExists.js.map +1 -1
- package/lib/shared/options/readOptions.d.ts +5 -6
- package/lib/shared/options/readOptions.js +7 -4
- package/lib/shared/options/readOptions.js.map +1 -1
- package/lib/steps/finalizeDependencies.js +43 -48
- package/lib/steps/finalizeDependencies.js.map +1 -1
- package/lib/steps/initializeGitHubRepository/index.js +7 -2
- package/lib/steps/initializeGitHubRepository/index.js.map +1 -1
- package/lib/steps/initializeGitHubRepository/initializeBranchProtectionSettings.js +44 -31
- package/lib/steps/initializeGitHubRepository/initializeBranchProtectionSettings.js.map +1 -1
- package/lib/steps/initializeGitHubRepository/outcomeLabels.d.ts +13 -0
- package/lib/steps/initializeGitHubRepository/{labels/outcomeLabels.js → outcomeLabels.js} +4 -1
- package/lib/steps/initializeGitHubRepository/outcomeLabels.js.map +1 -0
- package/lib/steps/uninstallPackages.js +4 -2
- package/lib/steps/uninstallPackages.js.map +1 -1
- package/lib/steps/writing/creation/index.js +4 -5
- package/lib/steps/writing/creation/index.js.map +1 -1
- package/lib/steps/writing/creation/writeAllContributorsRC.js +1 -9
- package/lib/steps/writing/creation/writeAllContributorsRC.js.map +1 -1
- package/package.json +27 -25
- package/lib/next/utils/removeTrailingSlash.d.ts +0 -3
- package/lib/next/utils/removeTrailingSlash.js +0 -7
- package/lib/next/utils/removeTrailingSlash.js.map +0 -1
- package/lib/shared/options/getGitHub.d.ts +0 -9
- package/lib/shared/options/getGitHub.js +0 -17
- package/lib/shared/options/getGitHub.js.map +0 -1
- package/lib/steps/detectExistingContributors.d.ts +0 -7
- package/lib/steps/detectExistingContributors.js +0 -19
- package/lib/steps/detectExistingContributors.js.map +0 -1
- package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabels.d.ts +0 -8
- package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabels.js +0 -14
- package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabels.js.map +0 -1
- package/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.d.ts +0 -8
- package/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.js +0 -63
- package/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.js.map +0 -1
- package/lib/steps/initializeGitHubRepository/labels/outcomeLabels.d.ts +0 -7
- package/lib/steps/initializeGitHubRepository/labels/outcomeLabels.js.map +0 -1
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: 51" src="https://img.shields.io/badge/%F0%9F%91%AA_all_contributors-51-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>
|
|
@@ -107,30 +107,31 @@ Thanks! 💖
|
|
|
107
107
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/NazCodeland"><img src="https://avatars.githubusercontent.com/u/113494366?v=4?s=100" width="100px;" alt="NazCodeland"/><br /><sub><b>NazCodeland</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=NazCodeland" title="Code">💻</a></td>
|
|
108
108
|
<td align="center" valign="top" width="14.28%"><a href="https://orta.io"><img src="https://avatars.githubusercontent.com/u/49038?v=4?s=100" width="100px;" alt="Orta Therox"/><br /><sub><b>Orta Therox</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=orta" title="Code">💻</a></td>
|
|
109
109
|
<td align="center" valign="top" width="14.28%"><a href="https://paulisaweso.me/"><img src="https://avatars.githubusercontent.com/u/6335792?v=4?s=100" width="100px;" alt="Paul Esch-Laurent"/><br /><sub><b>Paul Esch-Laurent</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=Pinjasaur" title="Code">💻</a></td>
|
|
110
|
+
<td align="center" valign="top" width="14.28%"><a href="https://kodfabrik.se/"><img src="https://avatars.githubusercontent.com/u/34457?v=4?s=100" width="100px;" alt="Pelle Wessman"/><br /><sub><b>Pelle Wessman</b></sub></a><br /><a href="#ideas-voxpelli" title="Ideas, Planning, & Feedback">🤔</a></td>
|
|
110
111
|
<td align="center" valign="top" width="14.28%"><a href="https://praveenshinde.vercel.app/"><img src="https://avatars.githubusercontent.com/u/107350270?v=4?s=100" width="100px;" alt="Praveen Shinde"/><br /><sub><b>Praveen Shinde</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=praveenshinde3" title="Code">💻</a></td>
|
|
111
112
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/promise-dash"><img src="https://avatars.githubusercontent.com/u/86062880?v=4?s=100" width="100px;" alt="Promise Dash"/><br /><sub><b>Promise Dash</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=promise-dash" title="Code">💻</a></td>
|
|
112
113
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/RebeccaStevens"><img src="https://avatars.githubusercontent.com/u/7224206?v=4?s=100" width="100px;" alt="Rebecca Stevens"/><br /><sub><b>Rebecca Stevens</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=RebeccaStevens" title="Code">💻</a> <a href="#infra-RebeccaStevens" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
|
|
113
|
-
<td align="center" valign="top" width="14.28%"><a href="https://linktr.ee/ronbraha"><img src="https://avatars.githubusercontent.com/u/45559220?v=4?s=100" width="100px;" alt="Ron Braha"/><br /><sub><b>Ron Braha</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=RNR1" title="Code">💻</a> <a href="#design-RNR1" title="Design">🎨</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=RNR1" title="Tests">⚠️</a></td>
|
|
114
114
|
</tr>
|
|
115
115
|
<tr>
|
|
116
|
+
<td align="center" valign="top" width="14.28%"><a href="https://linktr.ee/ronbraha"><img src="https://avatars.githubusercontent.com/u/45559220?v=4?s=100" width="100px;" alt="Ron Braha"/><br /><sub><b>Ron Braha</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=RNR1" title="Code">💻</a> <a href="#design-RNR1" title="Design">🎨</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=RNR1" title="Tests">⚠️</a></td>
|
|
116
117
|
<td align="center" valign="top" width="14.28%"><a href="http://ronjeanfrancois.com"><img src="https://avatars.githubusercontent.com/u/105710107?v=4?s=100" width="100px;" alt="Ron Jean-Francois"/><br /><sub><b>Ron Jean-Francois</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=ronthetech" title="Code">💻</a> <a href="#infra-ronthetech" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
|
|
117
118
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/RuthwikReddy09"><img src="https://avatars.githubusercontent.com/u/126862059?v=4?s=100" width="100px;" alt="Ruthwik"/><br /><sub><b>Ruthwik</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=ruthwikreddy09" title="Code">💻</a></td>
|
|
118
119
|
<td align="center" valign="top" width="14.28%"><a href="https://ryota-murakami.github.io/"><img src="https://avatars.githubusercontent.com/u/5501268?v=4?s=100" width="100px;" alt="Ryota Murakami"/><br /><sub><b>Ryota Murakami</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=ryota-murakami" title="Code">💻</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=author%3Aryota-murakami" title="Bug reports">🐛</a></td>
|
|
119
120
|
<td align="center" valign="top" width="14.28%"><a href="https://www.shraddha.tech"><img src="https://avatars.githubusercontent.com/u/27571141?v=4?s=100" width="100px;" alt="Shraddha"/><br /><sub><b>Shraddha</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=5hraddha" title="Code">💻</a></td>
|
|
120
121
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/the-lazy-learner"><img src="https://avatars.githubusercontent.com/u/13695177?v=4?s=100" width="100px;" alt="Sudhansu"/><br /><sub><b>Sudhansu</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=the-lazy-learner" title="Code">💻</a></td>
|
|
121
122
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/mrswastik-robot"><img src="https://avatars.githubusercontent.com/u/107865087?v=4?s=100" width="100px;" alt="Swastik Patel"/><br /><sub><b>Swastik Patel</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=mrswastik-robot" title="Documentation">📖</a></td>
|
|
122
|
-
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/timonjurschitsch/"><img src="https://avatars.githubusercontent.com/u/103483059?v=4?s=100" width="100px;" alt="Timon Jurschitsch"/><br /><sub><b>Timon Jurschitsch</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=dertimonius" title="Code">💻</a></td>
|
|
123
123
|
</tr>
|
|
124
124
|
<tr>
|
|
125
|
+
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/timonjurschitsch/"><img src="https://avatars.githubusercontent.com/u/103483059?v=4?s=100" width="100px;" alt="Timon Jurschitsch"/><br /><sub><b>Timon Jurschitsch</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=dertimonius" title="Code">💻</a></td>
|
|
125
126
|
<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>
|
|
126
127
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/valon-loshaj"><img src="https://avatars.githubusercontent.com/u/73202963?v=4?s=100" width="100px;" alt="Valon"/><br /><sub><b>Valon</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=valon-loshaj" title="Documentation">📖</a></td>
|
|
127
128
|
<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>
|
|
128
129
|
<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>
|
|
129
130
|
<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>
|
|
130
131
|
<td align="center" valign="top" width="14.28%"><a href="http://nandertga.ddns.net"><img src="https://avatars.githubusercontent.com/u/65074195?v=4?s=100" width="100px;" alt="nandertga"/><br /><sub><b>nandertga</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=nandertga" title="Code">💻</a></td>
|
|
131
|
-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rubiesonthesky"><img src="https://avatars.githubusercontent.com/u/2591240?v=4?s=100" width="100px;" alt="rubiesonthesky"/><br /><sub><b>rubiesonthesky</b></sub></a><br /><a href="#ideas-rubiesonthesky" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=rubiesonthesky" title="Code">💻</a></td>
|
|
132
132
|
</tr>
|
|
133
133
|
<tr>
|
|
134
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rubiesonthesky"><img src="https://avatars.githubusercontent.com/u/2591240?v=4?s=100" width="100px;" alt="rubiesonthesky"/><br /><sub><b>rubiesonthesky</b></sub></a><br /><a href="#ideas-rubiesonthesky" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=rubiesonthesky" title="Code">💻</a></td>
|
|
134
135
|
<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>
|
|
135
136
|
</tr>
|
|
136
137
|
</tbody>
|
package/lib/bin/promptForMode.js
CHANGED
|
@@ -4,6 +4,7 @@ import * as fs from "fs/promises";
|
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import * as process from "node:process";
|
|
6
6
|
import { logLine } from "../shared/cli/lines.js";
|
|
7
|
+
import { isUsingCreateEngine } from "../shared/isUsingCreateEngine.js";
|
|
7
8
|
import { filterPromptCancel } from "../shared/prompts.js";
|
|
8
9
|
const allowedModes = ["create", "initialize", "migrate"];
|
|
9
10
|
async function promptForMode(auto, input) {
|
|
@@ -25,7 +26,7 @@ async function promptForMode(auto, input) {
|
|
|
25
26
|
return { mode: input };
|
|
26
27
|
}
|
|
27
28
|
const dir = await fs.readdir(".");
|
|
28
|
-
if (dir.length === 0) {
|
|
29
|
+
if (dir.length === 0 && !isUsingCreateEngine()) {
|
|
29
30
|
const mode = filterPromptCancel(
|
|
30
31
|
await prompts.select({
|
|
31
32
|
message: chalk.blue("How would you like to use the template?"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/bin/promptForMode.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\nimport * as fs from \"fs/promises\";\nimport path from \"node:path\";\nimport * as process from \"node:process\";\n\nimport { logLine } from \"../shared/cli/lines.js\";\nimport { filterPromptCancel } from \"../shared/prompts.js\";\nimport { Mode, PromptedOptions } from \"../shared/types.js\";\n\nconst allowedModes = [\"create\", \"initialize\", \"migrate\"] satisfies Mode[];\n\nexport interface PromptedMode {\n\tmode: Error | Mode | undefined;\n\toptions?: PromptedOptions;\n}\n\nexport async function promptForMode(\n\tauto: boolean,\n\tinput: boolean | string | undefined,\n): Promise<PromptedMode> {\n\tif (auto && input !== \"migrate\") {\n\t\treturn {\n\t\t\tmode: new Error(\"--auto can only be used with --mode migrate.\"),\n\t\t};\n\t}\n\n\tif (input) {\n\t\tif (!isMode(input)) {\n\t\t\treturn {\n\t\t\t\tmode: new Error(\n\t\t\t\t\t`Unknown --mode: ${input}. Allowed modes are: ${allowedModes.join(\n\t\t\t\t\t\t\", \",\n\t\t\t\t\t)}.`,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\treturn { mode: input };\n\t}\n\n\tconst dir = await fs.readdir(\".\");\n\n\tif (dir.length === 0) {\n\t\tconst mode = filterPromptCancel(\n\t\t\t(await prompts.select({\n\t\t\t\tmessage: chalk.blue(\"How would you like to use the template?\"),\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: label(\n\t\t\t\t\t\t\t\"create\",\n\t\t\t\t\t\t\t\"a new repository in the current empty directory\",\n\t\t\t\t\t\t),\n\t\t\t\t\t\tvalue: \"create-current\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: label(\"create\", \"a new repository in a new child directory\"),\n\t\t\t\t\t\tvalue: \"create-child\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t})) as string,\n\t\t);\n\n\t\tconst directory = path.basename(process.cwd());\n\n\t\treturn {\n\t\t\tmode: \"create\",\n\t\t\t...(mode === \"create-current\" && {\n\t\t\t\toptions: {\n\t\t\t\t\tdirectory: \".\",\n\t\t\t\t\trepository: directory,\n\t\t\t\t},\n\t\t\t}),\n\t\t};\n\t}\n\n\tif (dir.includes(\".git\")) {\n\t\treturn {\n\t\t\tmode: filterPromptCancel(\n\t\t\t\t(await prompts.select({\n\t\t\t\t\tinitialValue: \"migrate\" as Mode,\n\t\t\t\t\tmessage: chalk.blue(\"How would you like to use the template?\"),\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: label(\"create\", \"a new repository in a child directory\"),\n\t\t\t\t\t\t\tvalue: \"create\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: label(\n\t\t\t\t\t\t\t\t\"initialize\",\n\t\t\t\t\t\t\t\t\"a freshly cloned repository in the current directory\",\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tvalue: \"initialize\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: label(\n\t\t\t\t\t\t\t\t\"migrate\",\n\t\t\t\t\t\t\t\t\"the existing repository in the current directory\",\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tvalue: \"migrate\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t})) as Mode | symbol,\n\t\t\t),\n\t\t};\n\t}\n\n\tlogLine();\n\tlogLine(\n\t\tchalk.gray(\n\t\t\t\"Defaulting to --mode create because the directory contains children and isn't a Git repository.\",\n\t\t),\n\t);\n\n\treturn {\n\t\tmode: \"create\",\n\t};\n}\n\nfunction isMode(input: boolean | string): input is Mode {\n\treturn allowedModes.includes(input as Mode);\n}\n\nfunction label(base: string, text: string) {\n\treturn `${chalk.bold(base)} ${text}`;\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAClB,YAAY,QAAQ;AACpB,OAAO,UAAU;AACjB,YAAY,aAAa;AAEzB,SAAS,eAAe;AACxB,SAAS,0BAA0B;AAGnC,MAAM,eAAe,CAAC,UAAU,cAAc,SAAS;AAOvD,eAAsB,cACrB,MACA,OACwB;AACxB,MAAI,QAAQ,UAAU,WAAW;AAChC,WAAO;AAAA,MACN,MAAM,IAAI,MAAM,8CAA8C;AAAA,IAC/D;AAAA,EACD;AAEA,MAAI,OAAO;AACV,QAAI,CAAC,OAAO,KAAK,GAAG;AACnB,aAAO;AAAA,QACN,MAAM,IAAI;AAAA,UACT,mBAAmB,KAAK,wBAAwB,aAAa;AAAA,YAC5D;AAAA,UACD,CAAC;AAAA,QACF;AAAA,MACD;AAAA,IACD;AAEA,WAAO,EAAE,MAAM,MAAM;AAAA,EACtB;AAEA,QAAM,MAAM,MAAM,GAAG,QAAQ,GAAG;AAEhC,MAAI,IAAI,WAAW,GAAG;
|
|
1
|
+
{"version":3,"sources":["../../src/bin/promptForMode.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\nimport * as fs from \"fs/promises\";\nimport path from \"node:path\";\nimport * as process from \"node:process\";\n\nimport { logLine } from \"../shared/cli/lines.js\";\nimport { isUsingCreateEngine } from \"../shared/isUsingCreateEngine.js\";\nimport { filterPromptCancel } from \"../shared/prompts.js\";\nimport { Mode, PromptedOptions } from \"../shared/types.js\";\n\nconst allowedModes = [\"create\", \"initialize\", \"migrate\"] satisfies Mode[];\n\nexport interface PromptedMode {\n\tmode: Error | Mode | undefined;\n\toptions?: PromptedOptions;\n}\n\nexport async function promptForMode(\n\tauto: boolean,\n\tinput: boolean | string | undefined,\n): Promise<PromptedMode> {\n\tif (auto && input !== \"migrate\") {\n\t\treturn {\n\t\t\tmode: new Error(\"--auto can only be used with --mode migrate.\"),\n\t\t};\n\t}\n\n\tif (input) {\n\t\tif (!isMode(input)) {\n\t\t\treturn {\n\t\t\t\tmode: new Error(\n\t\t\t\t\t`Unknown --mode: ${input}. Allowed modes are: ${allowedModes.join(\n\t\t\t\t\t\t\", \",\n\t\t\t\t\t)}.`,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\treturn { mode: input };\n\t}\n\n\tconst dir = await fs.readdir(\".\");\n\n\tif (dir.length === 0 && !isUsingCreateEngine()) {\n\t\tconst mode = filterPromptCancel(\n\t\t\t(await prompts.select({\n\t\t\t\tmessage: chalk.blue(\"How would you like to use the template?\"),\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: label(\n\t\t\t\t\t\t\t\"create\",\n\t\t\t\t\t\t\t\"a new repository in the current empty directory\",\n\t\t\t\t\t\t),\n\t\t\t\t\t\tvalue: \"create-current\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: label(\"create\", \"a new repository in a new child directory\"),\n\t\t\t\t\t\tvalue: \"create-child\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t})) as string,\n\t\t);\n\n\t\tconst directory = path.basename(process.cwd());\n\n\t\treturn {\n\t\t\tmode: \"create\",\n\t\t\t...(mode === \"create-current\" && {\n\t\t\t\toptions: {\n\t\t\t\t\tdirectory: \".\",\n\t\t\t\t\trepository: directory,\n\t\t\t\t},\n\t\t\t}),\n\t\t};\n\t}\n\n\tif (dir.includes(\".git\")) {\n\t\treturn {\n\t\t\tmode: filterPromptCancel(\n\t\t\t\t(await prompts.select({\n\t\t\t\t\tinitialValue: \"migrate\" as Mode,\n\t\t\t\t\tmessage: chalk.blue(\"How would you like to use the template?\"),\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: label(\"create\", \"a new repository in a child directory\"),\n\t\t\t\t\t\t\tvalue: \"create\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: label(\n\t\t\t\t\t\t\t\t\"initialize\",\n\t\t\t\t\t\t\t\t\"a freshly cloned repository in the current directory\",\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tvalue: \"initialize\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: label(\n\t\t\t\t\t\t\t\t\"migrate\",\n\t\t\t\t\t\t\t\t\"the existing repository in the current directory\",\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tvalue: \"migrate\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t})) as Mode | symbol,\n\t\t\t),\n\t\t};\n\t}\n\n\tlogLine();\n\tlogLine(\n\t\tchalk.gray(\n\t\t\t\"Defaulting to --mode create because the directory contains children and isn't a Git repository.\",\n\t\t),\n\t);\n\n\treturn {\n\t\tmode: \"create\",\n\t};\n}\n\nfunction isMode(input: boolean | string): input is Mode {\n\treturn allowedModes.includes(input as Mode);\n}\n\nfunction label(base: string, text: string) {\n\treturn `${chalk.bold(base)} ${text}`;\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAClB,YAAY,QAAQ;AACpB,OAAO,UAAU;AACjB,YAAY,aAAa;AAEzB,SAAS,eAAe;AACxB,SAAS,2BAA2B;AACpC,SAAS,0BAA0B;AAGnC,MAAM,eAAe,CAAC,UAAU,cAAc,SAAS;AAOvD,eAAsB,cACrB,MACA,OACwB;AACxB,MAAI,QAAQ,UAAU,WAAW;AAChC,WAAO;AAAA,MACN,MAAM,IAAI,MAAM,8CAA8C;AAAA,IAC/D;AAAA,EACD;AAEA,MAAI,OAAO;AACV,QAAI,CAAC,OAAO,KAAK,GAAG;AACnB,aAAO;AAAA,QACN,MAAM,IAAI;AAAA,UAC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EACD;AAEA,UAAQ;AACR;AAAA,IACC,MAAM;AAAA,MACL;AAAA,IACD;AAAA,EACD;AAEA,SAAO;AAAA,IACN,MAAM;AAAA,EACP;AACD;AAEA,SAAS,OAAO,OAAwC;AACvD,SAAO,aAAa,SAAS,KAAa;AAC3C;AAEA,SAAS,MAAM,MAAc,MAAc;AAC1C,SAAO,GAAG,MAAM,KAAK,IAAI,CAAC,IAAI,IAAI;AACnC;","names":[]}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OctokitAndOptions } from '../shared/options/readOptions.js';
|
|
2
|
+
import 'octokit';
|
|
2
3
|
import 'zod';
|
|
3
4
|
import '../shared/types.js';
|
|
4
5
|
import '../shared/codes.js';
|
|
5
|
-
import '../shared/options/getGitHub.js';
|
|
6
|
-
import 'octokit';
|
|
7
6
|
|
|
8
|
-
declare function createWithOptions({
|
|
7
|
+
declare function createWithOptions({ octokit, options, }: OctokitAndOptions): Promise<{
|
|
9
8
|
sentToGitHub: boolean | undefined;
|
|
10
9
|
}>;
|
|
11
10
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { $ } from "execa";
|
|
2
|
+
import { runCreateEnginePreset } from "../next/runCreateEnginePreset.js";
|
|
2
3
|
import {
|
|
3
4
|
withSpinner,
|
|
4
5
|
withSpinners
|
|
@@ -13,7 +14,16 @@ import { initializeGitHubRepository } from "../steps/initializeGitHubRepository/
|
|
|
13
14
|
import { runCleanup } from "../steps/runCleanup.js";
|
|
14
15
|
import { writeReadme } from "../steps/writeReadme/index.js";
|
|
15
16
|
import { writeStructure } from "../steps/writing/writeStructure.js";
|
|
16
|
-
async function createWithOptions({
|
|
17
|
+
async function createWithOptions({
|
|
18
|
+
octokit,
|
|
19
|
+
options
|
|
20
|
+
}) {
|
|
21
|
+
if (isUsingCreateEngine()) {
|
|
22
|
+
await withSpinner("Creating repository", async () => {
|
|
23
|
+
await runCreateEnginePreset(options);
|
|
24
|
+
});
|
|
25
|
+
return { sentToGitHub: false };
|
|
26
|
+
}
|
|
17
27
|
await withSpinners("Creating repository structure", [
|
|
18
28
|
[
|
|
19
29
|
"Writing structure",
|
|
@@ -21,18 +31,16 @@ async function createWithOptions({ github, options }) {
|
|
|
21
31
|
await writeStructure(options);
|
|
22
32
|
}
|
|
23
33
|
],
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
]
|
|
34
|
+
[
|
|
35
|
+
"Writing README.md",
|
|
36
|
+
async () => {
|
|
37
|
+
await writeReadme(options);
|
|
38
|
+
}
|
|
31
39
|
]
|
|
32
40
|
]);
|
|
33
41
|
if (!options.excludeAllContributors && !options.skipAllContributorsApi) {
|
|
34
42
|
await withSpinner("Adding contributors to table", async () => {
|
|
35
|
-
await addToolAllContributors(
|
|
43
|
+
await addToolAllContributors(octokit, options);
|
|
36
44
|
});
|
|
37
45
|
}
|
|
38
46
|
if (!options.skipInstall) {
|
|
@@ -43,14 +51,14 @@ async function createWithOptions({ github, options }) {
|
|
|
43
51
|
await runCleanup(createCleanupCommands(options.bin), options.mode);
|
|
44
52
|
}
|
|
45
53
|
await withSpinner("Clearing any local Git tags", clearLocalGitTags);
|
|
46
|
-
const sendToGitHub =
|
|
54
|
+
const sendToGitHub = octokit && await doesRepositoryExist(octokit, options);
|
|
47
55
|
if (sendToGitHub) {
|
|
48
56
|
await withSpinner("Initializing GitHub repository", async () => {
|
|
49
57
|
await $`git remote add origin https://github.com/${options.owner}/${options.repository}`;
|
|
50
58
|
await $`git add -A`;
|
|
51
59
|
await $`git commit --message ${"feat: initialized repo \u2728"} --no-gpg-sign`;
|
|
52
60
|
await $`git push -u origin main --force`;
|
|
53
|
-
await initializeGitHubRepository(
|
|
61
|
+
await initializeGitHubRepository(octokit, options);
|
|
54
62
|
});
|
|
55
63
|
}
|
|
56
64
|
return { sentToGitHub: sendToGitHub };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/create/createWithOptions.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport {\n\tLabeledSpinnerTask,\n\twithSpinner,\n\twithSpinners,\n} from \"../shared/cli/spinners.js\";\nimport { createCleanupCommands } from \"../shared/createCleanupCommands.js\";\nimport { doesRepositoryExist } from \"../shared/doesRepositoryExist.js\";\nimport { isUsingCreateEngine } from \"../shared/isUsingCreateEngine.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/create/createWithOptions.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport { runCreateEnginePreset } from \"../next/runCreateEnginePreset.js\";\nimport {\n\tLabeledSpinnerTask,\n\twithSpinner,\n\twithSpinners,\n} from \"../shared/cli/spinners.js\";\nimport { createCleanupCommands } from \"../shared/createCleanupCommands.js\";\nimport { doesRepositoryExist } from \"../shared/doesRepositoryExist.js\";\nimport { isUsingCreateEngine } from \"../shared/isUsingCreateEngine.js\";\nimport { OctokitAndOptions } from \"../shared/options/readOptions.js\";\nimport { addToolAllContributors } from \"../steps/addToolAllContributors.js\";\nimport { clearLocalGitTags } from \"../steps/clearLocalGitTags.js\";\nimport { finalizeDependencies } from \"../steps/finalizeDependencies.js\";\nimport { initializeGitHubRepository } from \"../steps/initializeGitHubRepository/index.js\";\nimport { runCleanup } from \"../steps/runCleanup.js\";\nimport { writeReadme } from \"../steps/writeReadme/index.js\";\nimport { writeStructure } from \"../steps/writing/writeStructure.js\";\n\nexport async function createWithOptions({\n\toctokit,\n\toptions,\n}: OctokitAndOptions) {\n\tif (isUsingCreateEngine()) {\n\t\tawait withSpinner(\"Creating repository\", async () => {\n\t\t\tawait runCreateEnginePreset(options);\n\t\t});\n\t\treturn { sentToGitHub: false };\n\t}\n\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] satisfies LabeledSpinnerTask<void>,\n\t]);\n\n\tif (!options.excludeAllContributors && !options.skipAllContributorsApi) {\n\t\tawait withSpinner(\"Adding contributors to table\", async () => {\n\t\t\tawait addToolAllContributors(octokit, 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 runCleanup(createCleanupCommands(options.bin), options.mode);\n\t}\n\n\tawait withSpinner(\"Clearing any local Git tags\", clearLocalGitTags);\n\n\tconst sendToGitHub = octokit && (await doesRepositoryExist(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 ✨\"} --no-gpg-sign`;\n\t\t\tawait $`git push -u origin main --force`;\n\t\t\tawait initializeGitHubRepository(octokit, options);\n\t\t});\n\t}\n\n\treturn { sentToGitHub: sendToGitHub };\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAElB,SAAS,6BAA6B;AACtC;AAAA,EAEC;AAAA,EACA;AAAA,OACM;AACP,SAAS,6BAA6B;AACtC,SAAS,2BAA2B;AACpC,SAAS,2BAA2B;AAEpC,SAAS,8BAA8B;AACvC,SAAS,yBAAyB;AAClC,SAAS,4BAA4B;AACrC,SAAS,kCAAkC;AAC3C,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAE/B,eAAsB,kBAAkB;AAAA,EACvC;AAAA,EACA;AACD,GAAsB;AACrB,MAAI,oBAAoB,GAAG;AAC1B,UAAM,YAAY,uBAAuB,YAAY;AACpD,YAAM,sBAAsB,OAAO;AAAA,IACpC,CAAC;AACD,WAAO,EAAE,cAAc,MAAM;AAAA,EAC9B;AAEA,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,SAAS,OAAO;AAAA,IAC9C,CAAC;AAAA,EACF;AAEA,MAAI,CAAC,QAAQ,aAAa;AACzB,UAAM;AAAA,MAAY;AAAA,MAAuB,YACxC,qBAAqB,OAAO;AAAA,IAC7B;AAEA,UAAM,WAAW,sBAAsB,QAAQ,GAAG,GAAG,QAAQ,IAAI;AAAA,EAClE;AAEA,QAAM,YAAY,+BAA+B,iBAAiB;AAElE,QAAM,eAAe,WAAY,MAAM,oBAAoB,SAAS,OAAO;AAE3E,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,SAAS,OAAO;AAAA,IAClD,CAAC;AAAA,EACF;AAEA,SAAO,EAAE,cAAc,aAAa;AACrC;","names":[]}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OctokitAndOptions } from '../shared/options/readOptions.js';
|
|
2
|
+
import 'octokit';
|
|
2
3
|
import 'zod';
|
|
3
4
|
import '../shared/types.js';
|
|
4
5
|
import '../shared/codes.js';
|
|
5
|
-
import '../shared/options/getGitHub.js';
|
|
6
|
-
import 'octokit';
|
|
7
6
|
|
|
8
|
-
declare function initializeWithOptions({
|
|
7
|
+
declare function initializeWithOptions({ octokit, options, }: OctokitAndOptions): Promise<void>;
|
|
9
8
|
|
|
10
9
|
export { initializeWithOptions };
|
|
@@ -11,7 +11,7 @@ import { updateAllContributorsTable } from "../steps/updateAllContributorsTable.
|
|
|
11
11
|
import { updateLocalFiles } from "../steps/updateLocalFiles.js";
|
|
12
12
|
import { updateReadme } from "../steps/updateReadme.js";
|
|
13
13
|
async function initializeWithOptions({
|
|
14
|
-
|
|
14
|
+
octokit,
|
|
15
15
|
options
|
|
16
16
|
}) {
|
|
17
17
|
await withSpinners("Initializing local files", [
|
|
@@ -38,12 +38,12 @@ async function initializeWithOptions({
|
|
|
38
38
|
]);
|
|
39
39
|
if (!options.excludeAllContributors) {
|
|
40
40
|
await withSpinner("Updating existing contributor details", async () => {
|
|
41
|
-
await addOwnerAsAllContributor(
|
|
41
|
+
await addOwnerAsAllContributor(octokit, options);
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
if (
|
|
44
|
+
if (octokit) {
|
|
45
45
|
await withSpinner("Initializing GitHub repository", async () => {
|
|
46
|
-
await initializeGitHubRepository(
|
|
46
|
+
await initializeGitHubRepository(octokit, options);
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
if (!options.skipRemoval) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/initialize/initializeWithOptions.ts"],"sourcesContent":["import { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { createCleanupCommands } from \"../shared/createCleanupCommands.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/initialize/initializeWithOptions.ts"],"sourcesContent":["import { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { createCleanupCommands } from \"../shared/createCleanupCommands.js\";\nimport { OctokitAndOptions } from \"../shared/options/readOptions.js\";\nimport { addOwnerAsAllContributor } from \"../steps/addOwnerAsAllContributor.js\";\nimport { clearChangelog } from \"../steps/clearChangelog.js\";\nimport { initializeGitHubRepository } from \"../steps/initializeGitHubRepository/index.js\";\nimport { removeSetupScripts } from \"../steps/removeSetupScripts.js\";\nimport { resetGitTags } from \"../steps/resetGitTags.js\";\nimport { runCleanup } from \"../steps/runCleanup.js\";\nimport { uninstallPackages } from \"../steps/uninstallPackages.js\";\nimport { updateAllContributorsTable } from \"../steps/updateAllContributorsTable.js\";\nimport { updateLocalFiles } from \"../steps/updateLocalFiles.js\";\nimport { updateReadme } from \"../steps/updateReadme.js\";\n\nexport async function initializeWithOptions({\n\toctokit,\n\toptions,\n}: OctokitAndOptions) {\n\tawait withSpinners(\"Initializing local files\", [\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 README.md\",\n\t\t\tasync () => {\n\t\t\t\tawait updateReadme(options);\n\t\t\t},\n\t\t],\n\t\t[\"Clearing changelog\", clearChangelog],\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\t[\"Resetting Git tags\", resetGitTags],\n\t]);\n\n\tif (!options.excludeAllContributors) {\n\t\tawait withSpinner(\"Updating existing contributor details\", async () => {\n\t\t\tawait addOwnerAsAllContributor(octokit, options);\n\t\t});\n\t}\n\n\tif (octokit) {\n\t\tawait withSpinner(\"Initializing GitHub repository\", async () => {\n\t\t\tawait initializeGitHubRepository(octokit, options);\n\t\t});\n\t}\n\n\tif (!options.skipRemoval) {\n\t\tawait withSpinner(\"Removing setup scripts\", removeSetupScripts);\n\t}\n\n\tif (!options.skipUninstall) {\n\t\tawait withSpinner(\"Uninstalling initialization-only packages\", async () =>\n\t\t\tuninstallPackages(options.offline),\n\t\t);\n\t}\n\n\tawait runCleanup(\n\t\tcreateCleanupCommands(options.bin, \"pnpm dedupe --offline\"),\n\t\toptions.mode,\n\t);\n}\n"],"mappings":"AAAA,SAAS,aAAa,oBAAoB;AAC1C,SAAS,6BAA6B;AAEtC,SAAS,gCAAgC;AACzC,SAAS,sBAAsB;AAC/B,SAAS,kCAAkC;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3
|
import 'zod';
|
|
3
4
|
import '../shared/types.js';
|
|
4
5
|
import '../shared/codes.js';
|
|
5
|
-
import '../shared/options/getGitHub.js';
|
|
6
|
-
import 'octokit';
|
|
7
6
|
|
|
8
|
-
declare function migrateWithOptions({
|
|
7
|
+
declare function migrateWithOptions({ octokit, options, }: OctokitAndOptions): Promise<void>;
|
|
9
8
|
|
|
10
9
|
export { migrateWithOptions };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { populateAllContributorsForRepository } from "populate-all-contributors-for-repository";
|
|
1
2
|
import { withSpinner, withSpinners } from "../shared/cli/spinners.js";
|
|
2
3
|
import { createCleanupCommands } from "../shared/createCleanupCommands.js";
|
|
3
4
|
import { clearUnnecessaryFiles } from "../steps/clearUnnecessaryFiles.js";
|
|
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
7
|
import { populateCSpellDictionary } from "../steps/populateCSpellDictionary.js";
|
|
@@ -11,7 +11,7 @@ import { updateLocalFiles } from "../steps/updateLocalFiles.js";
|
|
|
11
11
|
import { writeReadme } from "../steps/writeReadme/index.js";
|
|
12
12
|
import { writeStructure } from "../steps/writing/writeStructure.js";
|
|
13
13
|
async function migrateWithOptions({
|
|
14
|
-
|
|
14
|
+
octokit,
|
|
15
15
|
options
|
|
16
16
|
}) {
|
|
17
17
|
await withSpinners("Migrating repository structure", [
|
|
@@ -41,15 +41,18 @@ async function migrateWithOptions({
|
|
|
41
41
|
}
|
|
42
42
|
]
|
|
43
43
|
]);
|
|
44
|
-
if (
|
|
44
|
+
if (octokit) {
|
|
45
45
|
await withSpinner("Initializing GitHub repository", async () => {
|
|
46
|
-
await initializeGitHubRepository(
|
|
46
|
+
await initializeGitHubRepository(octokit, options);
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
if (!options.excludeAllContributors && !options.skipAllContributorsApi) {
|
|
50
50
|
await withSpinner(
|
|
51
51
|
"Detecting existing contributors",
|
|
52
|
-
async () =>
|
|
52
|
+
async () => populateAllContributorsForRepository({
|
|
53
|
+
owner: options.owner,
|
|
54
|
+
repo: options.repository
|
|
55
|
+
})
|
|
53
56
|
);
|
|
54
57
|
}
|
|
55
58
|
if (!options.skipInstall) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/migrate/migrateWithOptions.ts"],"sourcesContent":["import { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { createCleanupCommands } from \"../shared/createCleanupCommands.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/migrate/migrateWithOptions.ts"],"sourcesContent":["import { populateAllContributorsForRepository } from \"populate-all-contributors-for-repository\";\n\nimport { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { createCleanupCommands } from \"../shared/createCleanupCommands.js\";\nimport { OctokitAndOptions } from \"../shared/options/readOptions.js\";\nimport { clearUnnecessaryFiles } from \"../steps/clearUnnecessaryFiles.js\";\nimport { finalizeDependencies } from \"../steps/finalizeDependencies.js\";\nimport { initializeGitHubRepository } from \"../steps/initializeGitHubRepository/index.js\";\nimport { populateCSpellDictionary } from \"../steps/populateCSpellDictionary.js\";\nimport { runCleanup } from \"../steps/runCleanup.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\toctokit,\n\toptions,\n}: OctokitAndOptions) {\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 (octokit) {\n\t\tawait withSpinner(\"Initializing GitHub repository\", async () => {\n\t\t\tawait initializeGitHubRepository(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\tpopulateAllContributorsForRepository({\n\t\t\t\towner: options.owner,\n\t\t\t\trepo: options.repository,\n\t\t\t}),\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 runCleanup(createCleanupCommands(options.bin), options.mode);\n}\n"],"mappings":"AAAA,SAAS,4CAA4C;AAErD,SAAS,aAAa,oBAAoB;AAC1C,SAAS,6BAA6B;AAEtC,SAAS,6BAA6B;AACtC,SAAS,4BAA4B;AACrC,SAAS,kCAAkC;AAC3C,SAAS,gCAAgC;AACzC,SAAS,kBAAkB;AAC3B,SAAS,kCAAkC;AAC3C,SAAS,wBAAwB;AACjC,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAE/B,eAAsB,mBAAmB;AAAA,EACxC;AAAA,EACA;AACD,GAAsB;AACrB,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,SAAS;AACZ,UAAM,YAAY,kCAAkC,YAAY;AAC/D,YAAM,2BAA2B,SAAS,OAAO;AAAA,IAClD,CAAC;AAAA,EACF;AAEA,MAAI,CAAC,QAAQ,0BAA0B,CAAC,QAAQ,wBAAwB;AACvE,UAAM;AAAA,MAAY;AAAA,MAAmC,YACpD,qCAAqC;AAAA,QACpC,OAAO,QAAQ;AAAA,QACf,MAAM,QAAQ;AAAA,MACf,CAAC;AAAA,IACF;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,WAAW,sBAAsB,QAAQ,GAAG,GAAG,QAAQ,IAAI;AAClE;","names":[]}
|
package/lib/next/base.js
CHANGED
package/lib/next/base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/next/base.ts"],"sourcesContent":["import { BaseOptionsFor, createBase } from \"create\";\nimport { execaCommand } from \"execa\";\nimport gitRemoteOriginUrl from \"git-remote-origin-url\";\nimport gitUrlParse from \"git-url-parse\";\nimport { inputFromFile } from \"input-from-file\";\nimport { inputFromFileJSON } from \"input-from-file-json\";\nimport lazyValue from \"lazy-value\";\nimport npmUser from \"npm-user\";\nimport { z } from \"zod\";\n\nimport { parsePackageAuthor } from \"../shared/options/createOptionDefaults/parsePackageAuthor.js\";\nimport { readDefaultsFromReadme } from \"../shared/options/createOptionDefaults/readDefaultsFromReadme.js\";\nimport { readEmails } from \"../shared/options/createOptionDefaults/readEmails.js\";\nimport { readFunding } from \"../shared/options/createOptionDefaults/readFunding.js\";\nimport { readGuide } from \"../shared/options/createOptionDefaults/readGuide.js\";\nimport { readPackageData } from \"../shared/packages.js\";\nimport { tryCatchLazyValueAsync } from \"../shared/tryCatchLazyValueAsync.js\";\nimport { AllContributorsData } from \"../shared/types.js\";\nimport { swallowError } from \"./utils/swallowError.js\";\n\nexport const base = createBase({\n\toptions: {\n\t\taccess: z.union([z.literal(\"public\"), z.literal(\"restricted\")]).optional(),\n\t\tauthor: z.string().optional(),\n\t\tbin: z.string().optional(),\n\t\tcontributors: z\n\t\t\t.array(\n\t\t\t\tz.object({\n\t\t\t\t\tavatar_url: z.string(),\n\t\t\t\t\tcontributions: z.array(z.string()),\n\t\t\t\t\tlogin: z.string(),\n\t\t\t\t\tname: z.string(),\n\t\t\t\t\tprofile: z.string(),\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.optional(),\n\t\tdescription: z.string(),\n\t\tdocumentation: z.string().optional(),\n\t\temail: z\n\t\t\t.union([\n\t\t\t\tz.string(),\n\t\t\t\tz.object({\n\t\t\t\t\tgithub: z.string(),\n\t\t\t\t\tnpm: z.string(),\n\t\t\t\t}),\n\t\t\t])\n\t\t\t.transform((email) =>\n\t\t\t\ttypeof email === \"string\" ? { github: email, npm: email } : email,\n\t\t\t),\n\t\tfunding: z.string().optional(),\n\t\tguide: z\n\t\t\t.object({\n\t\t\t\thref: z.string(),\n\t\t\t\ttitle: z.string(),\n\t\t\t})\n\t\t\t.optional(),\n\t\thideTemplatedBy: z.boolean().optional(),\n\t\tkeywords: z.array(z.string()).optional(),\n\t\tlogin: z.string().optional(),\n\t\tlogo: z\n\t\t\t.object({\n\t\t\t\talt: z.string(),\n\t\t\t\tsrc: z.string(),\n\t\t\t})\n\t\t\t.optional(),\n\t\tnode: z\n\t\t\t.object({\n\t\t\t\tminimum: z.string(),\n\t\t\t\tpinned: z.string().optional(),\n\t\t\t})\n\t\t\t.optional(),\n\t\towner: z.string(),\n\t\tpackageData: z\n\t\t\t.object({\n\t\t\t\tdependencies: z.record(z.string(), z.string()).optional(),\n\t\t\t\tdevDependencies: z.record(z.string(), z.string()).optional(),\n\t\t\t\tscripts: z.record(z.string(), z.string()).optional(),\n\t\t\t})\n\t\t\t.optional(),\n\t\tpreserveGeneratedFrom: z.boolean().optional(),\n\t\trepository: z.string(),\n\t\ttitle: z.string(),\n\t\tversion: z.string().optional(),\n\t},\n\tproduce({ options, take }) {\n\t\tconst allContributors = lazyValue(async () => {\n\t\t\tconst contributions = (await take(inputFromFileJSON, {\n\t\t\t\tfilePath: \".all-contributorsrc\",\n\t\t\t})) as AllContributorsData;\n\n\t\t\treturn contributions.contributors;\n\t\t});\n\n\t\tconst documentation = lazyValue(async () =>\n\t\t\tswallowError(\n\t\t\t\tawait take(inputFromFile, {\n\t\t\t\t\tfilePath: \".github/DEVELOPMENT.md\",\n\t\t\t\t}),\n\t\t\t),\n\t\t);\n\n\t\tconst nvmrc = lazyValue(\n\t\t\tasync () =>\n\t\t\t\tawait take(inputFromFile, {\n\t\t\t\t\tfilePath: \".nvmrc\",\n\t\t\t\t}),\n\t\t);\n\n\t\t// TODO: Make these all use take\n\n\t\tconst gitDefaults = tryCatchLazyValueAsync(async () =>\n\t\t\tgitUrlParse(await gitRemoteOriginUrl()),\n\t\t);\n\n\t\tconst npmDefaults = tryCatchLazyValueAsync(async () => {\n\t\t\tconst whoami = (await execaCommand(`npm whoami`)).stdout;\n\t\t\treturn whoami ? await npmUser(whoami) : undefined;\n\t\t});\n\n\t\tconst packageData = lazyValue(readPackageData);\n\t\tconst packageAuthor = lazyValue(async () =>\n\t\t\tparsePackageAuthor(await packageData()),\n\t\t);\n\n\t\tconst author = lazyValue(async () =>\n\t\t\t(\n\t\t\t\t(await packageAuthor()).author ??\n\t\t\t\t(await npmDefaults())?.name ??\n\t\t\t\toptions.owner\n\t\t\t)?.toLowerCase(),\n\t\t);\n\n\t\tconst node = lazyValue(async () => {\n\t\t\tconst { engines } = await packageData();\n\n\t\t\treturn {\n\t\t\t\tminimum:\n\t\t\t\t\t(engines?.node && /[\\d+.]+/.exec(engines.node))?.[0] ?? \"18.3.0\",\n\t\t\t\tpinned: swallowError(await nvmrc()) ?? \"20.18.0\",\n\t\t\t};\n\t\t});\n\n\t\tconst version = lazyValue(async () => (await packageData()).version);\n\n\t\treturn {\n\t\t\tauthor,\n\t\t\tbin: async () => (await packageData()).bin,\n\t\t\tcontributors: allContributors,\n\t\t\tdescription: async () => (await packageData()).description,\n\t\t\tdocumentation,\n\t\t\temail: async () => readEmails(npmDefaults, packageAuthor),\n\t\t\tfunding: readFunding,\n\t\t\tguide: readGuide,\n\t\t\tlogin: author,\n\t\t\tnode,\n\t\t\towner: async () =>\n\t\t\t\t(await gitDefaults())?.organization ?? (await packageAuthor()).author,\n\t\t\tpackageData: async () => {\n\t\t\t\tconst original = await packageData();\n\n\t\t\t\treturn {\n\t\t\t\t\tdependencies: original.dependencies,\n\t\t\t\t\tdevDependencies: original.devDependencies,\n\t\t\t\t\tscripts: original.scripts,\n\t\t\t\t};\n\t\t\t},\n\t\t\trepository: async () =>\n\t\t\t\toptions.repository ??\n\t\t\t\t(await gitDefaults())?.name ??\n\t\t\t\t(await packageData()).name,\n\t\t\t...readDefaultsFromReadme(),\n\t\t\tversion,\n\t\t};\n\t},\n});\n\nexport type BaseOptions = BaseOptionsFor<typeof base>;\n"],"mappings":"AAAA,SAAyB,kBAAkB;AAC3C,SAAS,oBAAoB;AAC7B,OAAO,wBAAwB;AAC/B,OAAO,iBAAiB;AACxB,SAAS,qBAAqB;AAC9B,SAAS,yBAAyB;AAClC,OAAO,eAAe;AACtB,OAAO,aAAa;AACpB,SAAS,SAAS;AAElB,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;AACvC,SAAS,kBA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B;AAAA,IACD;AAAA,EACD;AACD,CAAC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/next/base.ts"],"sourcesContent":["import { BaseOptionsFor, createBase } from \"create\";\nimport { execaCommand } from \"execa\";\nimport gitRemoteOriginUrl from \"git-remote-origin-url\";\nimport gitUrlParse from \"git-url-parse\";\nimport { inputFromFile } from \"input-from-file\";\nimport { inputFromFileJSON } from \"input-from-file-json\";\nimport lazyValue from \"lazy-value\";\nimport npmUser from \"npm-user\";\nimport { z } from \"zod\";\n\nimport { parsePackageAuthor } from \"../shared/options/createOptionDefaults/parsePackageAuthor.js\";\nimport { readDefaultsFromReadme } from \"../shared/options/createOptionDefaults/readDefaultsFromReadme.js\";\nimport { readEmails } from \"../shared/options/createOptionDefaults/readEmails.js\";\nimport { readFunding } from \"../shared/options/createOptionDefaults/readFunding.js\";\nimport { readGuide } from \"../shared/options/createOptionDefaults/readGuide.js\";\nimport { readPackageData } from \"../shared/packages.js\";\nimport { tryCatchLazyValueAsync } from \"../shared/tryCatchLazyValueAsync.js\";\nimport { AllContributorsData } from \"../shared/types.js\";\nimport { swallowError } from \"./utils/swallowError.js\";\n\nexport const base = createBase({\n\toptions: {\n\t\taccess: z.union([z.literal(\"public\"), z.literal(\"restricted\")]).optional(),\n\t\tauthor: z.string().optional(),\n\t\tbin: z.string().optional(),\n\t\tcontributors: z\n\t\t\t.array(\n\t\t\t\tz.object({\n\t\t\t\t\tavatar_url: z.string(),\n\t\t\t\t\tcontributions: z.array(z.string()),\n\t\t\t\t\tlogin: z.string(),\n\t\t\t\t\tname: z.string(),\n\t\t\t\t\tprofile: z.string(),\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.optional(),\n\t\tdescription: z.string(),\n\t\tdocumentation: z.string().optional(),\n\t\temail: z\n\t\t\t.union([\n\t\t\t\tz.string(),\n\t\t\t\tz.object({\n\t\t\t\t\tgithub: z.string(),\n\t\t\t\t\tnpm: z.string(),\n\t\t\t\t}),\n\t\t\t])\n\t\t\t.transform((email) =>\n\t\t\t\ttypeof email === \"string\" ? { github: email, npm: email } : email,\n\t\t\t),\n\t\tfunding: z.string().optional(),\n\t\tguide: z\n\t\t\t.object({\n\t\t\t\thref: z.string(),\n\t\t\t\ttitle: z.string(),\n\t\t\t})\n\t\t\t.optional(),\n\t\thideTemplatedBy: z.boolean().optional(),\n\t\tkeywords: z.array(z.string()).optional(),\n\t\tlogin: z.string().optional(),\n\t\tlogo: z\n\t\t\t.object({\n\t\t\t\talt: z.string(),\n\t\t\t\tsrc: z.string(),\n\t\t\t})\n\t\t\t.optional(),\n\t\tnode: z\n\t\t\t.object({\n\t\t\t\tminimum: z.string(),\n\t\t\t\tpinned: z.string().optional(),\n\t\t\t})\n\t\t\t.optional(),\n\t\towner: z.string(),\n\t\tpackageData: z\n\t\t\t.object({\n\t\t\t\tdependencies: z.record(z.string(), z.string()).optional(),\n\t\t\t\tdevDependencies: z.record(z.string(), z.string()).optional(),\n\t\t\t\tscripts: z.record(z.string(), z.string()).optional(),\n\t\t\t})\n\t\t\t.optional(),\n\t\tpreserveGeneratedFrom: z.boolean().optional(),\n\t\trepository: z.string(),\n\t\ttitle: z.string(),\n\t\tversion: z.string().optional(),\n\t},\n\tproduce({ options, take }) {\n\t\tconst allContributors = lazyValue(async () => {\n\t\t\tconst contributions = (await take(inputFromFileJSON, {\n\t\t\t\tfilePath: \".all-contributorsrc\",\n\t\t\t})) as AllContributorsData;\n\n\t\t\treturn contributions.contributors;\n\t\t});\n\n\t\tconst documentation = lazyValue(async () =>\n\t\t\tswallowError(\n\t\t\t\tawait take(inputFromFile, {\n\t\t\t\t\tfilePath: \".github/DEVELOPMENT.md\",\n\t\t\t\t}),\n\t\t\t),\n\t\t);\n\n\t\tconst nvmrc = lazyValue(\n\t\t\tasync () =>\n\t\t\t\tawait take(inputFromFile, {\n\t\t\t\t\tfilePath: \".nvmrc\",\n\t\t\t\t}),\n\t\t);\n\n\t\t// TODO: Make these all use take\n\n\t\tconst gitDefaults = tryCatchLazyValueAsync(async () =>\n\t\t\tgitUrlParse(await gitRemoteOriginUrl()),\n\t\t);\n\n\t\tconst npmDefaults = tryCatchLazyValueAsync(async () => {\n\t\t\tconst whoami = (await execaCommand(`npm whoami`)).stdout;\n\t\t\treturn whoami ? await npmUser(whoami) : undefined;\n\t\t});\n\n\t\tconst packageData = lazyValue(readPackageData);\n\t\tconst packageAuthor = lazyValue(async () =>\n\t\t\tparsePackageAuthor(await packageData()),\n\t\t);\n\n\t\tconst author = lazyValue(async () =>\n\t\t\t(\n\t\t\t\t(await packageAuthor()).author ??\n\t\t\t\t(await npmDefaults())?.name ??\n\t\t\t\toptions.owner\n\t\t\t)?.toLowerCase(),\n\t\t);\n\n\t\tconst node = lazyValue(async () => {\n\t\t\tconst { engines } = await packageData();\n\n\t\t\treturn {\n\t\t\t\tminimum:\n\t\t\t\t\t(engines?.node && /[\\d+.]+/.exec(engines.node))?.[0] ?? \"18.3.0\",\n\t\t\t\tpinned: swallowError(await nvmrc()) ?? \"20.18.0\",\n\t\t\t};\n\t\t});\n\n\t\tconst version = lazyValue(async () => (await packageData()).version);\n\n\t\treturn {\n\t\t\tauthor,\n\t\t\tbin: async () => (await packageData()).bin,\n\t\t\tcontributors: allContributors,\n\t\t\tdescription: async () => (await packageData()).description,\n\t\t\tdocumentation,\n\t\t\temail: async () => readEmails(npmDefaults, packageAuthor),\n\t\t\tfunding: readFunding,\n\t\t\tguide: readGuide,\n\t\t\tlogin: author,\n\t\t\tnode,\n\t\t\towner: async () =>\n\t\t\t\t(await gitDefaults())?.organization ?? (await packageAuthor()).author,\n\t\t\tpackageData: async () => {\n\t\t\t\tconst original = await packageData();\n\n\t\t\t\treturn {\n\t\t\t\t\tdependencies: original.dependencies,\n\t\t\t\t\tdevDependencies: original.devDependencies,\n\t\t\t\t\tscripts: original.scripts,\n\t\t\t\t};\n\t\t\t},\n\t\t\trepository: async () =>\n\t\t\t\toptions.repository ??\n\t\t\t\t(await gitDefaults())?.name ??\n\t\t\t\t(await packageData()).name,\n\t\t\t...readDefaultsFromReadme(),\n\t\t\tversion,\n\t\t};\n\t},\n\ttemplate: {\n\t\towner: \"JoshuaKGoldberg\",\n\t\trepository: \"create-typescript-app\",\n\t},\n});\n\nexport type BaseOptions = BaseOptionsFor<typeof base>;\n"],"mappings":"AAAA,SAAyB,kBAAkB;AAC3C,SAAS,oBAAoB;AAC7B,OAAO,wBAAwB;AAC/B,OAAO,iBAAiB;AACxB,SAAS,qBAAqB;AAC9B,SAAS,yBAAyB;AAClC,OAAO,eAAe;AACtB,OAAO,aAAa;AACpB,SAAS,SAAS;AAElB,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;AACvC,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAChC,SAAS,8BAA8B;AAEvC,SAAS,oBAAoB;AAEtB,MAAM,OAAO,WAAW;AAAA,EAC9B,SAAS;AAAA,IACR,QAAQ,EAAE,MAAM,CAAC,EAAE,QAAQ,QAAQ,GAAG,EAAE,QAAQ,YAAY,CAAC,CAAC,EAAE,SAAS;AAAA,IACzE,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,IAC5B,KAAK,EAAE,OAAO,EAAE,SAAS;AAAA,IACzB,cAAc,EACZ;AAAA,MACA,EAAE,OAAO;AAAA,QACR,YAAY,EAAE,OAAO;AAAA,QACrB,eAAe,EAAE,MAAM,EAAE,OAAO,CAAC;AAAA,QACjC,OAAO,EAAE,OAAO;AAAA,QAChB,MAAM,EAAE,OAAO;AAAA,QACf,SAAS,EAAE,OAAO;AAAA,MACnB,CAAC;AAAA,IACF,EACC,SAAS;AAAA,IACX,aAAa,EAAE,OAAO;AAAA,IACtB,eAAe,EAAE,OAAO,EAAE,SAAS;AAAA,IACnC,OAAO,EACL,MAAM;AAAA,MACN,EAAE,OAAO;AAAA,MACT,EAAE,OAAO;AAAA,QACR,QAAQ,EAAE,OAAO;AAAA,QACjB,KAAK,EAAE,OAAO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,WAAW,aAAa,aAAa;AAAA,MACxD,SAAS;AAAA,MACT,OAAO;AAAA,MACP,OAAO;AAAA,MACP;AAAA,MACA,OAAO,aACL,MAAM,YAAY,IAAI,iBAAiB,MAAM,cAAc,GAAG;AAAA,MAChE,aAAa,YAAY;AACxB,cAAM,WAAW,MAAM,YAAY;AAEnC,eAAO;AAAA,UACN,cAAc,SAAS;AAAA,UACvB,iBAAiB,SAAS;AAAA,UAC1B,SAAS,SAAS;AAAA,QACnB;AAAA,MACD;AAAA,MACA,YAAY,YACX,QAAQ,eACP,MAAM,YAAY,IAAI,SACtB,MAAM,YAAY,GAAG;AAAA,MACvB,GAAG,uBAAuB;AAAA,MAC1B;AAAA,IACD;AAAA,EACD;AAAA,EACA,UAAU;AAAA,IACT,OAAO;AAAA,IACP,YAAY;AAAA,EACb;AACD,CAAC;","names":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createSoloWorkflowFile } from "../../steps/writing/creation/dotGitHub/createSoloWorkflowFile.js";
|
|
2
2
|
import { base } from "../base.js";
|
|
3
3
|
import { blockPrettier } from "./blockPrettier.js";
|
|
4
|
+
import { CommandPhase } from "./phases.js";
|
|
4
5
|
const blockAllContributors = base.createBlock({
|
|
5
6
|
about: {
|
|
6
7
|
name: "AllContributors"
|
|
@@ -12,22 +13,13 @@ const blockAllContributors = base.createBlock({
|
|
|
12
13
|
ignores: ["/.all-contributorsrc"]
|
|
13
14
|
})
|
|
14
15
|
],
|
|
15
|
-
commands: options.login === "JoshuaKGoldberg" ? [`npx -y all-contributors-cli add JoshuaKGoldberg tool`] : void 0,
|
|
16
16
|
files: {
|
|
17
17
|
".all-contributorsrc": JSON.stringify({
|
|
18
18
|
badgeTemplate: ' <a href="#contributors" target="_blank"><img alt="\u{1F46A} All Contributors: <%= contributors.length %>" src="https://img.shields.io/badge/%F0%9F%91%AA_all_contributors-<%= contributors.length %>-21bb42.svg" /></a>',
|
|
19
|
-
commit: false,
|
|
20
|
-
commitConvention: "angular",
|
|
21
|
-
commitType: "docs",
|
|
22
19
|
contributors: options.contributors ?? [],
|
|
23
|
-
contributorsPerLine: 7,
|
|
24
20
|
contributorsSortAlphabetically: true,
|
|
25
|
-
files: ["README.md"],
|
|
26
|
-
imageSize: 100,
|
|
27
21
|
projectName: options.repository,
|
|
28
|
-
projectOwner: options.owner
|
|
29
|
-
repoHost: "https://github.com",
|
|
30
|
-
repoType: "github"
|
|
22
|
+
projectOwner: options.owner
|
|
31
23
|
}),
|
|
32
24
|
".github": {
|
|
33
25
|
workflows: {
|
|
@@ -49,7 +41,16 @@ const blockAllContributors = base.createBlock({
|
|
|
49
41
|
})
|
|
50
42
|
}
|
|
51
43
|
}
|
|
52
|
-
}
|
|
44
|
+
},
|
|
45
|
+
scripts: [
|
|
46
|
+
{
|
|
47
|
+
commands: [
|
|
48
|
+
`npx -y all-contributors-cli generate`,
|
|
49
|
+
`npx -y all-contributors-cli add ${options.owner} code,content,docs,ideas,infra,maintenance,projectManagement,tool`
|
|
50
|
+
],
|
|
51
|
+
phase: CommandPhase.Process
|
|
52
|
+
}
|
|
53
|
+
]
|
|
53
54
|
};
|
|
54
55
|
}
|
|
55
56
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/next/blocks/blockAllContributors.ts"],"sourcesContent":["import { createSoloWorkflowFile } from \"../../steps/writing/creation/dotGitHub/createSoloWorkflowFile.js\";\nimport { base } from \"../base.js\";\nimport { blockPrettier } from \"./blockPrettier.js\";\n\nexport const blockAllContributors = base.createBlock({\n\tabout: {\n\t\tname: \"AllContributors\",\n\t},\n\tproduce({ options }) {\n\t\treturn {\n\t\t\taddons: [\n\t\t\t\tblockPrettier({\n\t\t\t\t\tignores: [\"/.all-contributorsrc\"],\n\t\t\t\t}),\n\t\t\t],\n\t\t\
|
|
1
|
+
{"version":3,"sources":["../../../src/next/blocks/blockAllContributors.ts"],"sourcesContent":["import { createSoloWorkflowFile } from \"../../steps/writing/creation/dotGitHub/createSoloWorkflowFile.js\";\nimport { base } from \"../base.js\";\nimport { blockPrettier } from \"./blockPrettier.js\";\nimport { CommandPhase } from \"./phases.js\";\n\nexport const blockAllContributors = base.createBlock({\n\tabout: {\n\t\tname: \"AllContributors\",\n\t},\n\tproduce({ options }) {\n\t\treturn {\n\t\t\taddons: [\n\t\t\t\tblockPrettier({\n\t\t\t\t\tignores: [\"/.all-contributorsrc\"],\n\t\t\t\t}),\n\t\t\t],\n\t\t\tfiles: {\n\t\t\t\t\".all-contributorsrc\": JSON.stringify({\n\t\t\t\t\tbadgeTemplate:\n\t\t\t\t\t\t'\t<a href=\"#contributors\" target=\"_blank\"><img alt=\"👪 All Contributors: <%= contributors.length %>\" src=\"https://img.shields.io/badge/%F0%9F%91%AA_all_contributors-<%= contributors.length %>-21bb42.svg\" /></a>',\n\t\t\t\t\tcontributors: options.contributors ?? [],\n\t\t\t\t\tcontributorsSortAlphabetically: true,\n\t\t\t\t\tprojectName: options.repository,\n\t\t\t\t\tprojectOwner: options.owner,\n\t\t\t\t}),\n\t\t\t\t\".github\": {\n\t\t\t\t\tworkflows: {\n\t\t\t\t\t\t\"contributors.yml\": createSoloWorkflowFile({\n\t\t\t\t\t\t\tname: \"Contributors\",\n\t\t\t\t\t\t\ton: {\n\t\t\t\t\t\t\t\tpush: {\n\t\t\t\t\t\t\t\t\tbranches: [\"main\"],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsteps: [\n\t\t\t\t\t\t\t\t{ uses: \"actions/checkout@v4\", with: { \"fetch-depth\": 0 } },\n\t\t\t\t\t\t\t\t{ uses: \"./.github/actions/prepare\" },\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tenv: { GITHUB_TOKEN: \"${{ secrets.ACCESS_TOKEN }}\" },\n\t\t\t\t\t\t\t\t\tuses: `JoshuaKGoldberg/all-contributors-auto-action@v0.5.0`,\n\t\t\t\t\t\t\t\t},\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\t\t\tscripts: [\n\t\t\t\t{\n\t\t\t\t\tcommands: [\n\t\t\t\t\t\t`npx -y all-contributors-cli generate`,\n\t\t\t\t\t\t`npx -y all-contributors-cli add ${options.owner} code,content,docs,ideas,infra,maintenance,projectManagement,tool`,\n\t\t\t\t\t],\n\t\t\t\t\tphase: CommandPhase.Process,\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t},\n});\n"],"mappings":"AAAA,SAAS,8BAA8B;AACvC,SAAS,YAAY;AACrB,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAEtB,MAAM,uBAAuB,KAAK,YAAY;AAAA,EACpD,OAAO;AAAA,IACN,MAAM;AAAA,EACP;AAAA,EACA,QAAQ,EAAE,QAAQ,GAAG;AACpB,WAAO;AAAA,MACN,QAAQ;AAAA,QACP,cAAc;AAAA,UACb,SAAS,CAAC,sBAAsB;AAAA,QACjC,CAAC;AAAA,MACF;AAAA,MACA,OAAO;AAAA,QACN,uBAAuB,KAAK,UAAU;AAAA,UACrC,eACC;AAAA,UACD,cAAc,QAAQ,gBAAgB,CAAC;AAAA,UACvC,gCAAgC;AAAA,UAChC,aAAa,QAAQ;AAAA,UACrB,cAAc,QAAQ;AAAA,QACvB,CAAC;AAAA,QACD,WAAW;AAAA,UACV,WAAW;AAAA,YACV,oBAAoB,uBAAuB;AAAA,cAC1C,MAAM;AAAA,cACN,IAAI;AAAA,gBACH,MAAM;AAAA,kBACL,UAAU,CAAC,MAAM;AAAA,gBAClB;AAAA,cACD;AAAA,cACA,OAAO;AAAA,gBACN,EAAE,MAAM,uBAAuB,MAAM,EAAE,eAAe,EAAE,EAAE;AAAA,gBAC1D,EAAE,MAAM,4BAA4B;AAAA,gBACpC;AAAA,kBACC,KAAK,EAAE,cAAc,8BAA8B;AAAA,kBACnD,MAAM;AAAA,gBACP;AAAA,cACD;AAAA,YACD,CAAC;AAAA,UACF;AAAA,QACD;AAAA,MACD;AAAA,MACA,SAAS;AAAA,QACR;AAAA,UACC,UAAU;AAAA,YACT;AAAA,YACA,mCAAmC,QAAQ,KAAK;AAAA,UACjD;AAAA,UACA,OAAO,aAAa;AAAA,QACrB;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD,CAAC;","names":[]}
|
|
@@ -5,6 +5,7 @@ import { blockGitHubActionsCI } from "./blockGitHubActionsCI.js";
|
|
|
5
5
|
import { blockPackageJson } from "./blockPackageJson.js";
|
|
6
6
|
import { blockVSCode } from "./blockVSCode.js";
|
|
7
7
|
import { getPackageDependencies } from "./packageData.js";
|
|
8
|
+
const filesGlob = `"**" ".github/**/*"`;
|
|
8
9
|
const blockCSpell = base.createBlock({
|
|
9
10
|
about: {
|
|
10
11
|
name: "CSpell"
|
|
@@ -43,7 +44,7 @@ const blockCSpell = base.createBlock({
|
|
|
43
44
|
properties: {
|
|
44
45
|
devDependencies: getPackageDependencies("cspell"),
|
|
45
46
|
scripts: {
|
|
46
|
-
"lint:spelling":
|
|
47
|
+
"lint:spelling": `cspell ${filesGlob}`
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
})
|
|
@@ -61,12 +62,6 @@ const blockCSpell = base.createBlock({
|
|
|
61
62
|
].sort(),
|
|
62
63
|
...words.length && { words: words.sort() }
|
|
63
64
|
})
|
|
64
|
-
},
|
|
65
|
-
package: {
|
|
66
|
-
devDependencies: getPackageDependencies("cspell"),
|
|
67
|
-
scripts: {
|
|
68
|
-
"lint:spelling": 'cspell "**" ".github/**/*"'
|
|
69
|
-
}
|
|
70
65
|
}
|
|
71
66
|
};
|
|
72
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/next/blocks/blockCSpell.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { base } from \"../base.js\";\nimport { blockDevelopmentDocs } from \"./blockDevelopmentDocs.js\";\nimport { blockGitHubActionsCI } from \"./blockGitHubActionsCI.js\";\nimport { blockPackageJson } from \"./blockPackageJson.js\";\nimport { blockVSCode } from \"./blockVSCode.js\";\nimport { getPackageDependencies } from \"./packageData.js\";\n\nexport const blockCSpell = base.createBlock({\n\tabout: {\n\t\tname: \"CSpell\",\n\t},\n\taddons: {\n\t\tignores: z.array(z.string()).default([]),\n\t\twords: z.array(z.string()).default([]),\n\t},\n\tproduce({ addons }) {\n\t\tconst { ignores, words } = addons;\n\n\t\treturn {\n\t\t\taddons: [\n\t\t\t\tblockDevelopmentDocs({\n\t\t\t\t\tsections: {\n\t\t\t\t\t\tLinting: {\n\t\t\t\t\t\t\tcontents: {\n\t\t\t\t\t\t\t\titems: [\n\t\t\t\t\t\t\t\t\t`- \\`pnpm lint:spelling\\` ([cspell](https://cspell.org)): Spell checks across all source files`,\n\t\t\t\t\t\t\t\t],\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\tblockVSCode({\n\t\t\t\t\textensions: [\"streetsidesoftware.code-spell-checker\"],\n\t\t\t\t}),\n\t\t\t\tblockGitHubActionsCI({\n\t\t\t\t\tjobs: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: \"Lint Spelling\",\n\t\t\t\t\t\t\tsteps: [{ run: \"pnpm lint:spelling\" }],\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t\tblockPackageJson({\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tdevDependencies: getPackageDependencies(\"cspell\"),\n\t\t\t\t\t\tscripts: {\n\t\t\t\t\t\t\t\"lint:spelling\":
|
|
1
|
+
{"version":3,"sources":["../../../src/next/blocks/blockCSpell.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { base } from \"../base.js\";\nimport { blockDevelopmentDocs } from \"./blockDevelopmentDocs.js\";\nimport { blockGitHubActionsCI } from \"./blockGitHubActionsCI.js\";\nimport { blockPackageJson } from \"./blockPackageJson.js\";\nimport { blockVSCode } from \"./blockVSCode.js\";\nimport { getPackageDependencies } from \"./packageData.js\";\n\nconst filesGlob = `\"**\" \".github/**/*\"`;\n\nexport const blockCSpell = base.createBlock({\n\tabout: {\n\t\tname: \"CSpell\",\n\t},\n\taddons: {\n\t\tignores: z.array(z.string()).default([]),\n\t\twords: z.array(z.string()).default([]),\n\t},\n\tproduce({ addons }) {\n\t\tconst { ignores, words } = addons;\n\n\t\treturn {\n\t\t\taddons: [\n\t\t\t\tblockDevelopmentDocs({\n\t\t\t\t\tsections: {\n\t\t\t\t\t\tLinting: {\n\t\t\t\t\t\t\tcontents: {\n\t\t\t\t\t\t\t\titems: [\n\t\t\t\t\t\t\t\t\t`- \\`pnpm lint:spelling\\` ([cspell](https://cspell.org)): Spell checks across all source files`,\n\t\t\t\t\t\t\t\t],\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\tblockVSCode({\n\t\t\t\t\textensions: [\"streetsidesoftware.code-spell-checker\"],\n\t\t\t\t}),\n\t\t\t\tblockGitHubActionsCI({\n\t\t\t\t\tjobs: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: \"Lint Spelling\",\n\t\t\t\t\t\t\tsteps: [{ run: \"pnpm lint:spelling\" }],\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t\tblockPackageJson({\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tdevDependencies: getPackageDependencies(\"cspell\"),\n\t\t\t\t\t\tscripts: {\n\t\t\t\t\t\t\t\"lint:spelling\": `cspell ${filesGlob}`,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t],\n\t\t\tfiles: {\n\t\t\t\t\"cspell.json\": JSON.stringify({\n\t\t\t\t\tdictionaries: [\"npm\", \"node\", \"typescript\"],\n\t\t\t\t\tignorePaths: [\n\t\t\t\t\t\t\".github\",\n\t\t\t\t\t\t\"CHANGELOG.md\",\n\t\t\t\t\t\t\"lib\",\n\t\t\t\t\t\t\"node_modules\",\n\t\t\t\t\t\t\"pnpm-lock.yaml\",\n\t\t\t\t\t\t...ignores,\n\t\t\t\t\t].sort(),\n\t\t\t\t\t...(words.length && { words: words.sort() }),\n\t\t\t\t}),\n\t\t\t},\n\t\t};\n\t},\n});\n"],"mappings":"AAAA,SAAS,SAAS;AAElB,SAAS,YAAY;AACrB,SAAS,4BAA4B;AACrC,SAAS,4BAA4B;AACrC,SAAS,wBAAwB;AACjC,SAAS,mBAAmB;AAC5B,SAAS,8BAA8B;AAEvC,MAAM,YAAY;AAEX,MAAM,cAAc,KAAK,YAAY;AAAA,EAC3C,OAAO;AAAA,IACN,MAAM;AAAA,EACP;AAAA,EACA,QAAQ;AAAA,IACP,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC;AAAA,IACvC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC;AAAA,EACtC;AAAA,EACA,QAAQ,EAAE,OAAO,GAAG;AACnB,UAAM,EAAE,SAAS,MAAM,IAAI;AAE3B,WAAO;AAAA,MACN,QAAQ;AAAA,QACP,qBAAqB;AAAA,UACpB,UAAU;AAAA,YACT,SAAS;AAAA,cACR,UAAU;AAAA,gBACT,OAAO;AAAA,kBACN;AAAA,gBACD;AAAA,cACD;AAAA,YACD;AAAA,UACD;AAAA,QACD,CAAC;AAAA,QACD,YAAY;AAAA,UACX,YAAY,CAAC,uCAAuC;AAAA,QACrD,CAAC;AAAA,QACD,qBAAqB;AAAA,UACpB,MAAM;AAAA,YACL;AAAA,cACC,MAAM;AAAA,cACN,OAAO,CAAC,EAAE,KAAK,qBAAqB,CAAC;AAAA,YACtC;AAAA,UACD;AAAA,QACD,CAAC;AAAA,QACD,iBAAiB;AAAA,UAChB,YAAY;AAAA,YACX,iBAAiB,uBAAuB,QAAQ;AAAA,YAChD,SAAS;AAAA,cACR,iBAAiB,UAAU,SAAS;AAAA,YACrC;AAAA,UACD;AAAA,QACD,CAAC;AAAA,MACF;AAAA,MACA,OAAO;AAAA,QACN,eAAe,KAAK,UAAU;AAAA,UAC7B,cAAc,CAAC,OAAO,QAAQ,YAAY;AAAA,UAC1C,aAAa;AAAA,YACZ;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,GAAG;AAAA,UACJ,EAAE,KAAK;AAAA,UACP,GAAI,MAAM,UAAU,EAAE,OAAO,MAAM,KAAK,EAAE;AAAA,QAC3C,CAAC;AAAA,MACF;AAAA,IACD;AAAA,EACD;AACD,CAAC;","names":[]}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { base } from "../base.js";
|
|
2
|
+
import { CommandPhase } from "./phases.js";
|
|
2
3
|
const blockContributingDocs = base.createBlock({
|
|
3
4
|
about: {
|
|
4
5
|
name: "Contributing Docs"
|
|
5
6
|
},
|
|
7
|
+
migrate() {
|
|
8
|
+
return {
|
|
9
|
+
scripts: [
|
|
10
|
+
{
|
|
11
|
+
commands: ["rm CONTRIBUTING.md"],
|
|
12
|
+
phase: CommandPhase.Migrations
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
};
|
|
16
|
+
},
|
|
6
17
|
produce({ options }) {
|
|
7
18
|
return {
|
|
8
19
|
files: {
|