create-typescript-app 1.67.2 → 1.67.4
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/lib/create/createWithOptions.js +3 -1
- package/lib/create/createWithOptions.js.map +1 -1
- package/lib/initialize/initializeWithOptions.js +4 -1
- package/lib/initialize/initializeWithOptions.js.map +1 -1
- package/lib/migrate/migrateWithOptions.js +1 -1
- package/lib/migrate/migrateWithOptions.js.map +1 -1
- package/lib/shared/createCleanupCommands.d.ts +1 -5
- package/lib/shared/createCleanupCommands.js +2 -6
- package/lib/shared/createCleanupCommands.js.map +1 -1
- package/lib/shared/options/createOptionDefaults/index.d.ts +9 -4
- package/lib/shared/options/createOptionDefaults/index.js +7 -3
- package/lib/shared/options/createOptionDefaults/index.js.map +1 -1
- package/lib/shared/options/createOptionDefaults/readDefaultsFromDevelopment.d.ts +4 -2
- package/lib/shared/options/createOptionDefaults/readDefaultsFromDevelopment.js +12 -10
- package/lib/shared/options/createOptionDefaults/readDefaultsFromDevelopment.js.map +1 -1
- package/lib/shared/options/createOptionDefaults/readDefaultsFromReadme.d.ts +4 -1
- package/lib/shared/options/createOptionDefaults/readDefaultsFromReadme.js +16 -3
- package/lib/shared/options/createOptionDefaults/readDefaultsFromReadme.js.map +1 -1
- package/lib/shared/options/createOptionDefaults/readGitHubEmail.d.ts +3 -0
- package/lib/shared/options/createOptionDefaults/readGitHubEmail.js +12 -0
- package/lib/shared/options/createOptionDefaults/readGitHubEmail.js.map +1 -0
- package/lib/shared/options/optionsSchema.d.ts +20 -20
- package/lib/shared/options/readOptions.js +4 -3
- package/lib/shared/options/readOptions.js.map +1 -1
- package/lib/shared/runOrRestore.d.ts +1 -1
- package/lib/steps/clearLocalGitTags.d.ts +3 -0
- package/lib/steps/clearLocalGitTags.js +9 -0
- package/lib/steps/clearLocalGitTags.js.map +1 -0
- package/package.json +2 -2
|
@@ -3,6 +3,7 @@ import { withSpinner, withSpinners } from "../shared/cli/spinners.js";
|
|
|
3
3
|
import { createCleanupCommands } from "../shared/createCleanupCommands.js";
|
|
4
4
|
import { doesRepositoryExist } from "../shared/doesRepositoryExist.js";
|
|
5
5
|
import { addToolAllContributors } from "../steps/addToolAllContributors.js";
|
|
6
|
+
import { clearLocalGitTags } from "../steps/clearLocalGitTags.js";
|
|
6
7
|
import { finalizeDependencies } from "../steps/finalizeDependencies.js";
|
|
7
8
|
import { initializeGitHubRepository } from "../steps/initializeGitHubRepository/index.js";
|
|
8
9
|
import { populateCSpellDictionary } from "../steps/populateCSpellDictionary.js";
|
|
@@ -40,8 +41,9 @@ async function createWithOptions({ github, options }) {
|
|
|
40
41
|
populateCSpellDictionary
|
|
41
42
|
);
|
|
42
43
|
}
|
|
43
|
-
await runCleanup(createCleanupCommands(options), options.mode);
|
|
44
|
+
await runCleanup(createCleanupCommands(options.bin), options.mode);
|
|
44
45
|
}
|
|
46
|
+
await withSpinner("Clearing any local Git tags", clearLocalGitTags);
|
|
45
47
|
const sendToGitHub = github && await doesRepositoryExist(github.octokit, options);
|
|
46
48
|
if (sendToGitHub) {
|
|
47
49
|
await withSpinner("Initializing GitHub repository", async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/create/createWithOptions.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { createCleanupCommands } from \"../shared/createCleanupCommands.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 { runCleanup } from \"../steps/runCleanup.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 runCleanup(createCleanupCommands(options), options.mode);\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,6BAA6B;AACtC,SAAS,2BAA2B;AAEpC,SAAS,8BAA8B;AACvC,SAAS,4BAA4B;AACrC,SAAS,kCAAkC;AAC3C,SAAS,gCAAgC;AACzC,SAAS,kBAAkB;AAC3B,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,WAAW,sBAAsB,
|
|
1
|
+
{"version":3,"sources":["../../src/create/createWithOptions.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { createCleanupCommands } from \"../shared/createCleanupCommands.js\";\nimport { doesRepositoryExist } from \"../shared/doesRepositoryExist.js\";\nimport { GitHubAndOptions } 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 { populateCSpellDictionary } from \"../steps/populateCSpellDictionary.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({ 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 runCleanup(createCleanupCommands(options.bin), options.mode);\n\t}\n\n\tawait withSpinner(\"Clearing any local Git tags\", clearLocalGitTags);\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,6BAA6B;AACtC,SAAS,2BAA2B;AAEpC,SAAS,8BAA8B;AACvC,SAAS,yBAAyB;AAClC,SAAS,4BAA4B;AACrC,SAAS,kCAAkC;AAC3C,SAAS,gCAAgC;AACzC,SAAS,kBAAkB;AAC3B,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,WAAW,sBAAsB,QAAQ,GAAG,GAAG,QAAQ,IAAI;AAAA,EAClE;AAEA,QAAM,YAAY,+BAA+B,iBAAiB;AAElE,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":[]}
|
|
@@ -55,7 +55,10 @@ async function initializeWithOptions({
|
|
|
55
55
|
async () => uninstallPackages(options.offline)
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
|
-
await runCleanup(
|
|
58
|
+
await runCleanup(
|
|
59
|
+
createCleanupCommands(options.bin, "pnpm dedupe --offline"),
|
|
60
|
+
options.mode
|
|
61
|
+
);
|
|
59
62
|
}
|
|
60
63
|
export {
|
|
61
64
|
initializeWithOptions
|
|
@@ -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 { GitHubAndOptions } 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\tgithub,\n\toptions,\n}: GitHubAndOptions) {\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(options);\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.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(
|
|
1
|
+
{"version":3,"sources":["../../src/initialize/initializeWithOptions.ts"],"sourcesContent":["import { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { createCleanupCommands } from \"../shared/createCleanupCommands.js\";\nimport { GitHubAndOptions } 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\tgithub,\n\toptions,\n}: GitHubAndOptions) {\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(options);\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.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;AAC3C,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAE7B,eAAsB,sBAAsB;AAAA,EAC3C;AAAA,EACA;AACD,GAAqB;AACpB,QAAM,aAAa,4BAA4B;AAAA,IAC9C;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,iBAAiB,OAAO;AAAA,MAC/B;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,aAAa,OAAO;AAAA,MAC3B;AAAA,IACD;AAAA,IACA,CAAC,sBAAsB,cAAc;AAAA,IACrC;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,2BAA2B,OAAO;AAAA,MACzC;AAAA,IACD;AAAA,IACA,CAAC,sBAAsB,YAAY;AAAA,EACpC,CAAC;AAED,MAAI,CAAC,QAAQ,wBAAwB;AACpC,UAAM,YAAY,yCAAyC,YAAY;AACtE,YAAM,yBAAyB,OAAO;AAAA,IACvC,CAAC;AAAA,EACF;AAEA,MAAI,QAAQ;AACX,UAAM,YAAY,kCAAkC,YAAY;AAC/D,YAAM,2BAA2B,OAAO,SAAS,OAAO;AAAA,IACzD,CAAC;AAAA,EACF;AAEA,MAAI,CAAC,QAAQ,aAAa;AACzB,UAAM,YAAY,0BAA0B,kBAAkB;AAAA,EAC/D;AAEA,MAAI,CAAC,QAAQ,eAAe;AAC3B,UAAM;AAAA,MAAY;AAAA,MAA6C,YAC9D,kBAAkB,QAAQ,OAAO;AAAA,IAClC;AAAA,EACD;AAEA,QAAM;AAAA,IACL,sBAAsB,QAAQ,KAAK,uBAAuB;AAAA,IAC1D,QAAQ;AAAA,EACT;AACD;","names":[]}
|
|
@@ -61,7 +61,7 @@ async function migrateWithOptions({
|
|
|
61
61
|
if (!options.excludeLintSpelling) {
|
|
62
62
|
await withSpinner("Populating CSpell dictionary", populateCSpellDictionary);
|
|
63
63
|
}
|
|
64
|
-
await runCleanup(createCleanupCommands(options), options.mode);
|
|
64
|
+
await runCleanup(createCleanupCommands(options.bin), options.mode);
|
|
65
65
|
}
|
|
66
66
|
export {
|
|
67
67
|
migrateWithOptions
|
|
@@ -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 { 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 { 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\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 runCleanup(createCleanupCommands(options), options.mode);\n}\n"],"mappings":"AAAA,SAAS,aAAa,oBAAoB;AAC1C,SAAS,6BAA6B;AAEtC,SAAS,6BAA6B;AACtC,SAAS,kCAAkC;AAC3C,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,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,WAAW,sBAAsB,
|
|
1
|
+
{"version":3,"sources":["../../src/migrate/migrateWithOptions.ts"],"sourcesContent":["import { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { createCleanupCommands } from \"../shared/createCleanupCommands.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 { 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\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 runCleanup(createCleanupCommands(options.bin), options.mode);\n}\n"],"mappings":"AAAA,SAAS,aAAa,oBAAoB;AAC1C,SAAS,6BAA6B;AAEtC,SAAS,6BAA6B;AACtC,SAAS,kCAAkC;AAC3C,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,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,WAAW,sBAAsB,QAAQ,GAAG,GAAG,QAAQ,IAAI;AAClE;","names":[]}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import 'zod';
|
|
3
|
-
import './codes.js';
|
|
4
|
-
|
|
5
|
-
declare function createCleanupCommands({ bin, mode, }: Pick<Options, "bin" | "mode">): string[];
|
|
1
|
+
declare function createCleanupCommands(bin: string | undefined, ...prependedCommands: string[]): string[];
|
|
6
2
|
|
|
7
3
|
export { createCleanupCommands };
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
function createCleanupCommands({
|
|
2
|
-
bin,
|
|
3
|
-
mode
|
|
4
|
-
}) {
|
|
1
|
+
function createCleanupCommands(bin, ...prependedCommands) {
|
|
5
2
|
return [
|
|
6
|
-
|
|
7
|
-
...mode === "initialize" ? [] : ["pnpm dedupe --offline"],
|
|
3
|
+
...prependedCommands,
|
|
8
4
|
// n/no-missing-import rightfully reports on a missing the bin .js file
|
|
9
5
|
...bin ? ["pnpm build"] : [],
|
|
10
6
|
"pnpm lint --fix",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/shared/createCleanupCommands.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../src/shared/createCleanupCommands.ts"],"sourcesContent":["export function createCleanupCommands(\n\tbin: string | undefined,\n\t...prependedCommands: string[]\n) {\n\treturn [\n\t\t...prependedCommands,\n\t\t// n/no-missing-import rightfully reports on a missing the bin .js file\n\t\t...(bin ? [\"pnpm build\"] : []),\n\t\t\"pnpm lint --fix\",\n\t\t\"pnpm format --write\",\n\t];\n}\n"],"mappings":"AAAO,SAAS,sBACf,QACG,mBACF;AACD,SAAO;AAAA,IACN,GAAG;AAAA;AAAA,IAEH,GAAI,MAAM,CAAC,YAAY,IAAI,CAAC;AAAA,IAC5B;AAAA,IACA;AAAA,EACD;AACD;","names":[]}
|
|
@@ -3,11 +3,16 @@ import 'zod';
|
|
|
3
3
|
import '../../codes.js';
|
|
4
4
|
|
|
5
5
|
declare function createOptionDefaults(promptedOptions?: PromptedOptions): {
|
|
6
|
-
logo: () => Promise<
|
|
6
|
+
logo: () => Promise<{
|
|
7
|
+
alt: string;
|
|
8
|
+
src: string;
|
|
9
|
+
} | undefined>;
|
|
7
10
|
title: () => Promise<string | undefined>;
|
|
8
|
-
guide: () => Promise<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
guide: () => Promise<{
|
|
12
|
+
href: string;
|
|
13
|
+
title: string;
|
|
14
|
+
} | undefined>;
|
|
15
|
+
author: () => Promise<string | undefined>;
|
|
11
16
|
bin: () => Promise<string | undefined>;
|
|
12
17
|
description: () => Promise<string | undefined>;
|
|
13
18
|
email: () => Promise<{
|
|
@@ -10,6 +10,7 @@ import { tryCatchLazyValueAsync } from "../../tryCatchLazyValueAsync.js";
|
|
|
10
10
|
import { parsePackageAuthor } from "./parsePackageAuthor.js";
|
|
11
11
|
import { readDefaultsFromDevelopment } from "./readDefaultsFromDevelopment.js";
|
|
12
12
|
import { readDefaultsFromReadme } from "./readDefaultsFromReadme.js";
|
|
13
|
+
import { readGitHubEmail } from "./readGitHubEmail.js";
|
|
13
14
|
function createOptionDefaults(promptedOptions) {
|
|
14
15
|
const gitDefaults = tryCatchLazyValueAsync(
|
|
15
16
|
async () => gitUrlParse(await gitRemoteOriginUrl())
|
|
@@ -23,15 +24,18 @@ function createOptionDefaults(promptedOptions) {
|
|
|
23
24
|
async () => parsePackageAuthor(await packageData())
|
|
24
25
|
);
|
|
25
26
|
return {
|
|
26
|
-
author: async () => (await packageAuthor()).author ?? npmDefaults
|
|
27
|
+
author: async () => (await packageAuthor()).author ?? (await npmDefaults())?.name,
|
|
27
28
|
bin: async () => (await packageData()).bin,
|
|
28
29
|
description: async () => (await packageData()).description,
|
|
29
30
|
email: async () => {
|
|
30
|
-
const
|
|
31
|
+
const githubEmail = await readGitHubEmail() ?? await tryCatchAsync(
|
|
31
32
|
async () => (await $`git config --get user.email`).stdout
|
|
32
33
|
);
|
|
33
34
|
const npmEmail = (await npmDefaults())?.email ?? (await packageAuthor()).email;
|
|
34
|
-
return
|
|
35
|
+
return githubEmail || npmEmail ? {
|
|
36
|
+
github: githubEmail || npmEmail,
|
|
37
|
+
npm: npmEmail || githubEmail
|
|
38
|
+
} : void 0;
|
|
35
39
|
},
|
|
36
40
|
funding: async () => await tryCatchAsync(
|
|
37
41
|
async () => (await fs.readFile(".github/FUNDING.yml")).toString().split(":")[1]?.trim()
|
|
@@ -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 * 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 ()
|
|
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\";\nimport { readGitHubEmail } from \"./readGitHubEmail.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 () =>\n\t\t\t(await packageAuthor()).author ?? (await npmDefaults())?.name,\n\t\tbin: async () => (await packageData()).bin,\n\t\tdescription: async () => (await packageData()).description,\n\t\temail: async () => {\n\t\t\tconst githubEmail =\n\t\t\t\t(await readGitHubEmail()) ??\n\t\t\t\t(await tryCatchAsync(\n\t\t\t\t\tasync () => (await $`git config --get user.email`).stdout,\n\t\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 githubEmail || npmEmail\n\t\t\t\t? {\n\t\t\t\t\t\tgithub: (githubEmail || npmEmail)!,\n\t\t\t\t\t\tnpm: (npmEmail || githubEmail)!,\n\t\t\t\t\t}\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(async () =>\n\t\t\t\t(await fs.readFile(\".github/FUNDING.yml\"))\n\t\t\t\t\t.toString()\n\t\t\t\t\t.split(\":\")[1]\n\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;AACvC,SAAS,uBAAuB;AAEzB,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,aACN,MAAM,cAAc,GAAG,WAAW,MAAM,YAAY,IAAI;AAAA,IAC1D,KAAK,aAAa,MAAM,YAAY,GAAG;AAAA,IACvC,aAAa,aAAa,MAAM,YAAY,GAAG;AAAA,IAC/C,OAAO,YAAY;AAClB,YAAM,cACJ,MAAM,gBAAgB,KACtB,MAAM;AAAA,QACN,aAAa,MAAM,gCAAgC;AAAA,MACpD;AACD,YAAM,YACJ,MAAM,YAAY,IAAI,UAAU,MAAM,cAAc,GAAG;AAGzD,aAAO,eAAe,WACnB;AAAA,QACA,QAAS,eAAe;AAAA,QACxB,KAAM,YAAY;AAAA,MACnB,IACC;AAAA,IAEJ;AAAA,IACA,SAAS,YACR,MAAM;AAAA,MAAc,aAClB,MAAM,GAAG,SAAS,qBAAqB,GACtC,SAAS,EACT,MAAM,GAAG,EAAE,CAAC,GACX,KAAK;AAAA,IACT;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,6 +1,8 @@
|
|
|
1
1
|
declare function readDefaultsFromDevelopment(): {
|
|
2
|
-
guide: () => Promise<
|
|
3
|
-
|
|
2
|
+
guide: () => Promise<{
|
|
3
|
+
href: string;
|
|
4
|
+
title: string;
|
|
5
|
+
} | undefined>;
|
|
4
6
|
};
|
|
5
7
|
|
|
6
8
|
export { readDefaultsFromDevelopment };
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import lazyValue from "lazy-value";
|
|
2
2
|
import { readFileSafe } from "../../readFileSafe.js";
|
|
3
3
|
function readDefaultsFromDevelopment() {
|
|
4
|
-
const development = lazyValue(
|
|
5
|
-
async () => await readFileSafe(".github/DEVELOPMENT.md", "")
|
|
6
|
-
);
|
|
7
|
-
const guideTag = lazyValue(
|
|
8
|
-
async () => /> .*guided walkthrough, see \[((?!\[).+)\]\((.+)\)/i.exec(
|
|
9
|
-
await development()
|
|
10
|
-
)
|
|
11
|
-
);
|
|
12
4
|
return {
|
|
13
|
-
guide: async () =>
|
|
14
|
-
|
|
5
|
+
guide: lazyValue(async () => {
|
|
6
|
+
const tag = /> .*guided walkthrough, see \[((?!\[).+)\]\((.+)\)/i.exec(
|
|
7
|
+
await readFileSafe(".github/DEVELOPMENT.md", "")
|
|
8
|
+
);
|
|
9
|
+
if (!tag) {
|
|
10
|
+
return void 0;
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
href: tag[2],
|
|
14
|
+
title: tag[1]
|
|
15
|
+
};
|
|
16
|
+
})
|
|
15
17
|
};
|
|
16
18
|
}
|
|
17
19
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/shared/options/createOptionDefaults/readDefaultsFromDevelopment.ts"],"sourcesContent":["import lazyValue from \"lazy-value\";\n\nimport { readFileSafe } from \"../../readFileSafe.js\";\n\nexport function readDefaultsFromDevelopment() {\n\
|
|
1
|
+
{"version":3,"sources":["../../../../src/shared/options/createOptionDefaults/readDefaultsFromDevelopment.ts"],"sourcesContent":["import lazyValue from \"lazy-value\";\n\nimport { readFileSafe } from \"../../readFileSafe.js\";\n\nexport function readDefaultsFromDevelopment() {\n\treturn {\n\t\tguide: lazyValue(async () => {\n\t\t\tconst tag = /> .*guided walkthrough, see \\[((?!\\[).+)\\]\\((.+)\\)/i.exec(\n\t\t\t\tawait readFileSafe(\".github/DEVELOPMENT.md\", \"\"),\n\t\t\t);\n\n\t\t\tif (!tag) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\thref: tag[2],\n\t\t\t\ttitle: tag[1],\n\t\t\t};\n\t\t}),\n\t};\n}\n"],"mappings":"AAAA,OAAO,eAAe;AAEtB,SAAS,oBAAoB;AAEtB,SAAS,8BAA8B;AAC7C,SAAO;AAAA,IACN,OAAO,UAAU,YAAY;AAC5B,YAAM,MAAM,sDAAsD;AAAA,QACjE,MAAM,aAAa,0BAA0B,EAAE;AAAA,MAChD;AAEA,UAAI,CAAC,KAAK;AACT,eAAO;AAAA,MACR;AAEA,aAAO;AAAA,QACN,MAAM,IAAI,CAAC;AAAA,QACX,OAAO,IAAI,CAAC;AAAA,MACb;AAAA,IACD,CAAC;AAAA,EACF;AACD;","names":[]}
|
|
@@ -3,11 +3,24 @@ import { readFileSafe } from "../../readFileSafe.js";
|
|
|
3
3
|
function readDefaultsFromReadme() {
|
|
4
4
|
const readme = lazyValue(async () => await readFileSafe("README.md", ""));
|
|
5
5
|
const imageTag = lazyValue(
|
|
6
|
-
async () =>
|
|
6
|
+
async () => /\n<img.+src=.+>/.exec(await readme())?.[0]
|
|
7
7
|
);
|
|
8
8
|
return {
|
|
9
|
-
logo: async () =>
|
|
10
|
-
|
|
9
|
+
logo: async () => {
|
|
10
|
+
const tag = await imageTag();
|
|
11
|
+
if (!tag) {
|
|
12
|
+
return void 0;
|
|
13
|
+
}
|
|
14
|
+
const src = /src\s*=(.+)['"/]>/.exec(tag)?.[1]?.replaceAll(/^['"]|['"]$/g, "");
|
|
15
|
+
if (!src) {
|
|
16
|
+
return void 0;
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
alt: /alt=['"](.+)['"]\s*src=/.exec(tag)?.[1] ?? "Project logo",
|
|
20
|
+
src
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
title: async () => (/^<h1\s+align="center">(.+)<\/h1>/.exec(await readme()) ?? /^# (.+)/.exec(await readme()))?.[1]
|
|
11
24
|
};
|
|
12
25
|
}
|
|
13
26
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/shared/options/createOptionDefaults/readDefaultsFromReadme.ts"],"sourcesContent":["import lazyValue from \"lazy-value\";\n\nimport { readFileSafe } from \"../../readFileSafe.js\";\n\nexport function readDefaultsFromReadme() {\n\tconst readme = lazyValue(async () => await readFileSafe(\"README.md\", \"\"));\n\n\tconst imageTag = lazyValue(\n\t\tasync () =>
|
|
1
|
+
{"version":3,"sources":["../../../../src/shared/options/createOptionDefaults/readDefaultsFromReadme.ts"],"sourcesContent":["import lazyValue from \"lazy-value\";\n\nimport { readFileSafe } from \"../../readFileSafe.js\";\n\nexport function readDefaultsFromReadme() {\n\tconst readme = lazyValue(async () => await readFileSafe(\"README.md\", \"\"));\n\n\tconst imageTag = lazyValue(\n\t\tasync () => /\\n<img.+src=.+>/.exec(await readme())?.[0],\n\t);\n\n\treturn {\n\t\tlogo: async () => {\n\t\t\tconst tag = await imageTag();\n\n\t\t\tif (!tag) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst src = /src\\s*=(.+)['\"/]>/\n\t\t\t\t.exec(tag)?.[1]\n\t\t\t\t?.replaceAll(/^['\"]|['\"]$/g, \"\");\n\n\t\t\tif (!src) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\talt: /alt=['\"](.+)['\"]\\s*src=/.exec(tag)?.[1] ?? \"Project logo\",\n\t\t\t\tsrc,\n\t\t\t};\n\t\t},\n\t\ttitle: async () =>\n\t\t\t(/^<h1\\s+align=\"center\">(.+)<\\/h1>/.exec(await readme()) ??\n\t\t\t\t/^# (.+)/.exec(await readme()))?.[1],\n\t};\n}\n"],"mappings":"AAAA,OAAO,eAAe;AAEtB,SAAS,oBAAoB;AAEtB,SAAS,yBAAyB;AACxC,QAAM,SAAS,UAAU,YAAY,MAAM,aAAa,aAAa,EAAE,CAAC;AAExE,QAAM,WAAW;AAAA,IAChB,YAAY,kBAAkB,KAAK,MAAM,OAAO,CAAC,IAAI,CAAC;AAAA,EACvD;AAEA,SAAO;AAAA,IACN,MAAM,YAAY;AACjB,YAAM,MAAM,MAAM,SAAS;AAE3B,UAAI,CAAC,KAAK;AACT,eAAO;AAAA,MACR;AAEA,YAAM,MAAM,oBACV,KAAK,GAAG,IAAI,CAAC,GACZ,WAAW,gBAAgB,EAAE;AAEhC,UAAI,CAAC,KAAK;AACT,eAAO;AAAA,MACR;AAEA,aAAO;AAAA,QACN,KAAK,0BAA0B,KAAK,GAAG,IAAI,CAAC,KAAK;AAAA,QACjD;AAAA,MACD;AAAA,IACD;AAAA,IACA,OAAO,aACL,mCAAmC,KAAK,MAAM,OAAO,CAAC,KACtD,UAAU,KAAK,MAAM,OAAO,CAAC,KAAK,CAAC;AAAA,EACtC;AACD;","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { readFileSafe } from "../../readFileSafe.js";
|
|
2
|
+
async function readGitHubEmail() {
|
|
3
|
+
const codeOfConduct = await readFileSafe(".github/CODE_OF_CONDUCT.md", "");
|
|
4
|
+
if (!codeOfConduct.includes("Contributor Covenant Code of Conduct")) {
|
|
5
|
+
return void 0;
|
|
6
|
+
}
|
|
7
|
+
return /for enforcement at[\r\n]+(.+)\.[\r\n]+All/.exec(codeOfConduct)?.[1];
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
readGitHubEmail
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=readGitHubEmail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/shared/options/createOptionDefaults/readGitHubEmail.ts"],"sourcesContent":["import { readFileSafe } from \"../../readFileSafe.js\";\n\nexport async function readGitHubEmail() {\n\t// The create-typescript-app template puts the GitHub email in the CoC.\n\t// If they seem to be using the template, we can go with that.\n\tconst codeOfConduct = await readFileSafe(\".github/CODE_OF_CONDUCT.md\", \"\");\n\tif (!codeOfConduct.includes(\"Contributor Covenant Code of Conduct\")) {\n\t\treturn undefined;\n\t}\n\n\treturn /for enforcement at[\\r\\n]+(.+)\\.[\\r\\n]+All/.exec(codeOfConduct)?.[1];\n}\n"],"mappings":"AAAA,SAAS,oBAAoB;AAE7B,eAAsB,kBAAkB;AAGvC,QAAM,gBAAgB,MAAM,aAAa,8BAA8B,EAAE;AACzE,MAAI,CAAC,cAAc,SAAS,sCAAsC,GAAG;AACpE,WAAO;AAAA,EACR;AAEA,SAAO,4CAA4C,KAAK,aAAa,IAAI,CAAC;AAC3E;","names":[]}
|
|
@@ -112,26 +112,17 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
112
112
|
skipUninstall: z.ZodOptional<z.ZodBoolean>;
|
|
113
113
|
title: z.ZodOptional<z.ZodString>;
|
|
114
114
|
}, "strip", z.ZodTypeAny, {
|
|
115
|
-
description?: string | undefined;
|
|
116
115
|
offline?: boolean | undefined;
|
|
117
116
|
access?: "public" | "restricted" | undefined;
|
|
118
117
|
author?: string | undefined;
|
|
119
|
-
auto?: boolean | undefined;
|
|
120
118
|
base?: "common" | "everything" | "minimal" | "prompt" | undefined;
|
|
121
119
|
bin?: string | undefined;
|
|
120
|
+
description?: string | undefined;
|
|
122
121
|
directory?: string | undefined;
|
|
123
122
|
email?: {
|
|
124
123
|
github: string;
|
|
125
124
|
npm: string;
|
|
126
125
|
} | undefined;
|
|
127
|
-
funding?: string | undefined;
|
|
128
|
-
guide?: string | undefined;
|
|
129
|
-
keywords?: string[] | undefined;
|
|
130
|
-
logo?: string | undefined;
|
|
131
|
-
mode?: "create" | "initialize" | "migrate" | undefined;
|
|
132
|
-
owner?: string | undefined;
|
|
133
|
-
repository?: string | undefined;
|
|
134
|
-
title?: string | undefined;
|
|
135
126
|
excludeAllContributors?: boolean | undefined;
|
|
136
127
|
excludeBuild?: boolean | undefined;
|
|
137
128
|
excludeCompliance?: boolean | undefined;
|
|
@@ -151,36 +142,36 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
151
142
|
excludeReleases?: boolean | undefined;
|
|
152
143
|
excludeRenovate?: boolean | undefined;
|
|
153
144
|
excludeTests?: boolean | undefined;
|
|
145
|
+
funding?: string | undefined;
|
|
146
|
+
guide?: string | undefined;
|
|
147
|
+
keywords?: string[] | undefined;
|
|
148
|
+
logo?: string | undefined;
|
|
149
|
+
mode?: "create" | "initialize" | "migrate" | undefined;
|
|
150
|
+
owner?: string | undefined;
|
|
154
151
|
preserveGeneratedFrom?: boolean | undefined;
|
|
152
|
+
repository?: string | undefined;
|
|
155
153
|
skipAllContributorsApi?: boolean | undefined;
|
|
156
154
|
skipGitHubApi?: boolean | undefined;
|
|
157
155
|
skipInstall?: boolean | undefined;
|
|
158
156
|
skipRemoval?: boolean | undefined;
|
|
159
157
|
skipRestore?: boolean | undefined;
|
|
160
158
|
skipUninstall?: boolean | undefined;
|
|
159
|
+
title?: string | undefined;
|
|
161
160
|
guideTitle?: string | undefined;
|
|
162
161
|
logoAlt?: string | undefined;
|
|
162
|
+
auto?: boolean | undefined;
|
|
163
163
|
}, {
|
|
164
|
-
description?: string | undefined;
|
|
165
164
|
offline?: boolean | undefined;
|
|
166
165
|
access?: "public" | "restricted" | undefined;
|
|
167
166
|
author?: string | undefined;
|
|
168
|
-
auto?: boolean | undefined;
|
|
169
167
|
base?: "common" | "everything" | "minimal" | "prompt" | undefined;
|
|
170
168
|
bin?: string | undefined;
|
|
169
|
+
description?: string | undefined;
|
|
171
170
|
directory?: string | undefined;
|
|
172
171
|
email?: {
|
|
173
172
|
github: string;
|
|
174
173
|
npm: string;
|
|
175
174
|
} | undefined;
|
|
176
|
-
funding?: string | undefined;
|
|
177
|
-
guide?: string | undefined;
|
|
178
|
-
keywords?: string[] | undefined;
|
|
179
|
-
logo?: string | undefined;
|
|
180
|
-
mode?: "create" | "initialize" | "migrate" | undefined;
|
|
181
|
-
owner?: string | undefined;
|
|
182
|
-
repository?: string | undefined;
|
|
183
|
-
title?: string | undefined;
|
|
184
175
|
excludeAllContributors?: boolean | undefined;
|
|
185
176
|
excludeBuild?: boolean | undefined;
|
|
186
177
|
excludeCompliance?: boolean | undefined;
|
|
@@ -200,15 +191,24 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
200
191
|
excludeReleases?: boolean | undefined;
|
|
201
192
|
excludeRenovate?: boolean | undefined;
|
|
202
193
|
excludeTests?: boolean | undefined;
|
|
194
|
+
funding?: string | undefined;
|
|
195
|
+
guide?: string | undefined;
|
|
196
|
+
keywords?: string[] | undefined;
|
|
197
|
+
logo?: string | undefined;
|
|
198
|
+
mode?: "create" | "initialize" | "migrate" | undefined;
|
|
199
|
+
owner?: string | undefined;
|
|
203
200
|
preserveGeneratedFrom?: boolean | undefined;
|
|
201
|
+
repository?: string | undefined;
|
|
204
202
|
skipAllContributorsApi?: boolean | undefined;
|
|
205
203
|
skipGitHubApi?: boolean | undefined;
|
|
206
204
|
skipInstall?: boolean | undefined;
|
|
207
205
|
skipRemoval?: boolean | undefined;
|
|
208
206
|
skipRestore?: boolean | undefined;
|
|
209
207
|
skipUninstall?: boolean | undefined;
|
|
208
|
+
title?: string | undefined;
|
|
210
209
|
guideTitle?: string | undefined;
|
|
211
210
|
logoAlt?: string | undefined;
|
|
211
|
+
auto?: boolean | undefined;
|
|
212
212
|
}>;
|
|
213
213
|
|
|
214
214
|
export { optionsSchema, optionsSchemaShape };
|
|
@@ -195,13 +195,14 @@ async function readOptions(args, mode, promptedOptions = {}) {
|
|
|
195
195
|
const augmentedOptions = await augmentOptionsWithExcludes({
|
|
196
196
|
...options,
|
|
197
197
|
access: options.access ?? "public",
|
|
198
|
-
author: options.author ?? await defaults.owner(),
|
|
198
|
+
author: options.author ?? await defaults.author() ?? await defaults.owner(),
|
|
199
|
+
bin: options.bin ?? await defaults.bin(),
|
|
199
200
|
description: options.description,
|
|
200
201
|
directory: options.directory ?? promptedOptions.directory ?? options.repository,
|
|
201
202
|
email,
|
|
202
203
|
funding: options.funding ?? await defaults.funding(),
|
|
203
|
-
guide,
|
|
204
|
-
logo,
|
|
204
|
+
guide: guide ?? await defaults.guide(),
|
|
205
|
+
logo: logo ?? await defaults.logo(),
|
|
205
206
|
mode,
|
|
206
207
|
owner: options.owner,
|
|
207
208
|
repository,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/shared/options/readOptions.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport { titleCase } from \"title-case\";\nimport { z } from \"zod\";\n\nimport { withSpinner } from \"../cli/spinners.js\";\nimport { Mode, OptionsGuide, PromptedOptions } from \"../types.js\";\nimport { Options, OptionsLogo } from \"../types.js\";\nimport { allArgOptions } from \"./args.js\";\nimport { augmentOptionsWithExcludes } from \"./augmentOptionsWithExcludes.js\";\nimport { createOptionDefaults } from \"./createOptionDefaults/index.js\";\nimport { detectEmailRedundancy } from \"./detectEmailRedundancy.js\";\nimport { ensureRepositoryExists } from \"./ensureRepositoryExists.js\";\nimport { getBase } from \"./getBase.js\";\nimport { getGitHub, GitHub } from \"./getGitHub.js\";\nimport { getPrefillOrPromptedOption } from \"./getPrefillOrPromptedOption.js\";\nimport { logInferredOptions } from \"./logInferredOptions.js\";\nimport { optionsSchema } from \"./optionsSchema.js\";\n\nexport interface GitHubAndOptions {\n\tgithub: GitHub | undefined;\n\toptions: Options;\n}\n\nexport interface OptionsParseCancelled {\n\tcancelled: true;\n\terror?: string | z.ZodError<object>;\n\toptions: object;\n}\n\nexport interface OptionsParseSuccess extends GitHubAndOptions {\n\tcancelled: false;\n}\n\nexport type OptionsParseResult = OptionsParseCancelled | OptionsParseSuccess;\n\nexport async function readOptions(\n\targs: string[],\n\tmode: Mode,\n\tpromptedOptions: PromptedOptions = {},\n): Promise<OptionsParseResult> {\n\tconst defaults = createOptionDefaults(promptedOptions);\n\tconst { values } = parseArgs({\n\t\targs,\n\t\toptions: allArgOptions,\n\t\tstrict: false,\n\t\ttokens: true,\n\t});\n\n\tif (mode === \"migrate\" && !values.base) {\n\t\tvalues.base = await getBase();\n\t}\n\n\tconst mappedOptions = {\n\t\taccess: values.access,\n\t\tauthor: values.author,\n\t\tauto: !!values.auto,\n\t\tbase: values.base,\n\t\tbin: values.bin,\n\t\tdescription: values.description,\n\t\tdirectory: values.directory,\n\t\temail:\n\t\t\t(values.email ?? values[\"email-github\"] ?? values[\"email-npm\"])\n\t\t\t\t? {\n\t\t\t\t\t\tgithub: values.email ?? values[\"email-github\"],\n\t\t\t\t\t\tnpm: values.email ?? values[\"email-npm\"],\n\t\t\t\t\t}\n\t\t\t\t: undefined,\n\t\texcludeAllContributors: values[\"exclude-all-contributors\"],\n\t\texcludeCompliance: values[\"exclude-compliance\"],\n\t\texcludeLintESLint: values[\"exclude-lint-eslint\"],\n\t\texcludeLintJSDoc: values[\"exclude-lint-jsdoc\"],\n\t\texcludeLintJson: values[\"exclude-lint-json\"],\n\t\texcludeLintKnip: values[\"exclude-lint-knip\"],\n\t\texcludeLintMd: values[\"exclude-lint-md\"],\n\t\texcludeLintPackageJson: values[\"exclude-lint-package-json\"],\n\t\texcludeLintPackages: values[\"exclude-lint-packages\"],\n\t\texcludeLintPerfectionist: values[\"exclude-lint-perfectionist\"],\n\t\texcludeLintRegex: values[\"exclude-lint-regex\"],\n\t\texcludeLintSpelling: values[\"exclude-lint-spelling\"],\n\t\texcludeLintStrict: values[\"exclude-lint-strict\"],\n\t\texcludeLintYml: values[\"exclude-lint-yml\"],\n\t\texcludeReleases: values[\"exclude-releases\"],\n\t\texcludeRenovate: values[\"exclude-renovate\"],\n\t\texcludeTests: values[\"unit-tests\"],\n\t\tfunding: values.funding,\n\t\tguide: values.guide,\n\t\tguideTitle: values[\"guide-title\"],\n\t\tlogo: values.logo,\n\t\tlogoAlt: values[\"logo-alt\"],\n\t\toffline: values.offline,\n\t\towner: values.owner,\n\t\tpreserveGeneratedFrom:\n\t\t\tvalues[\"preserve-generated-from\"] ?? values.owner === \"JoshuaKGoldberg\",\n\t\trepository: values.repository,\n\t\tskipAllContributorsApi:\n\t\t\tvalues[\"skip-all-contributors-api\"] ?? values.offline,\n\t\tskipGitHubApi: values[\"skip-github-api\"] ?? values.offline,\n\t\tskipInstall: values[\"skip-install\"],\n\t\tskipRemoval: values[\"skip-removal\"],\n\t\tskipRestore: values[\"skip-restore\"],\n\t\tskipUninstall: values[\"skip-uninstall\"],\n\t\ttitle: values.title,\n\t};\n\n\tconst emailError = detectEmailRedundancy(values);\n\tif (emailError) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: emailError,\n\t\t\toptions: mappedOptions,\n\t\t};\n\t}\n\n\tconst optionsParseResult = optionsSchema.safeParse(mappedOptions);\n\n\tif (!optionsParseResult.success) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: optionsParseResult.error,\n\t\t\toptions: mappedOptions,\n\t\t};\n\t}\n\n\tconst options = optionsParseResult.data;\n\n\tconst ownerOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: defaults.owner,\n\t\tmessage: \"What organization or user will the repository be under?\",\n\t\tname: \"owner\",\n\t\tprovided: options.owner,\n\t});\n\n\toptions.owner ??= ownerOption.value;\n\n\tif (!options.owner) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: ownerOption.error,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tconst repositoryOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: defaults.repository,\n\t\tmessage: \"What will the kebab-case name of the repository be?\",\n\t\tname: \"repository\",\n\t\tprovided: options.repository,\n\t});\n\n\toptions.repository ??= repositoryOption.value;\n\n\tif (!options.repository) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: repositoryOption.error,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tconst { github, repository } = await ensureRepositoryExists(\n\t\toptions.skipGitHubApi\n\t\t\t? undefined\n\t\t\t: await withSpinner(\"Checking GitHub authentication\", getGitHub),\n\t\t{\n\t\t\tmode,\n\t\t\towner: options.owner,\n\t\t\trepository: options.repository,\n\t\t},\n\t);\n\n\tif (!repository) {\n\t\treturn { cancelled: true, error: repositoryOption.error, options };\n\t}\n\n\tconst descriptionOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: async () =>\n\t\t\t(await defaults.description()) ?? \"A very lovely package. Hooray!\",\n\t\tmessage: \"How would you describe the new package?\",\n\t\tname: \"description\",\n\t\tprovided: options.description,\n\t});\n\n\toptions.description ??= descriptionOption.value;\n\n\tif (!options.description) {\n\t\treturn { cancelled: true, error: descriptionOption.error, options };\n\t}\n\n\tconst titleOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: async () =>\n\t\t\t(await defaults.title()) ?? titleCase(repository).replaceAll(\"-\", \" \"),\n\t\tmessage: \"What will the Title Case title of the repository be?\",\n\t\tname: \"title\",\n\t\tprovided: options.title,\n\t});\n\n\toptions.title ??= titleOption.value;\n\n\tif (!options.title) {\n\t\treturn { cancelled: true, error: titleOption.error, options };\n\t}\n\n\tlet guide: OptionsGuide | undefined;\n\n\tif (options.guide) {\n\t\tif (options.guideTitle) {\n\t\t\tguide = { href: options.guide, title: options.guideTitle };\n\t\t} else {\n\t\t\tconst titleOption = await getPrefillOrPromptedOption({\n\t\t\t\tauto: !!mappedOptions.auto,\n\t\t\t\tmessage: \"What is the title text for the guide?\",\n\t\t\t\tname: \"getPrefillOrPromptedOption\",\n\t\t\t});\n\n\t\t\tif (!titleOption.value) {\n\t\t\t\treturn { cancelled: true, error: titleOption.error, options };\n\t\t\t}\n\n\t\t\tguide = { href: options.guide, title: titleOption.value };\n\t\t}\n\t}\n\n\tlet logo: OptionsLogo | undefined;\n\n\tif (options.logo) {\n\t\tif (options.logoAlt) {\n\t\t\tlogo = { alt: options.logoAlt, src: options.logo };\n\t\t} else {\n\t\t\tconst logoAltOption = await getPrefillOrPromptedOption({\n\t\t\t\tauto: !!mappedOptions.auto,\n\t\t\t\tmessage: \"What is the alt text (non-visual description) of the logo?\",\n\t\t\t\tname: \"getPrefillOrPromptedOption\",\n\t\t\t});\n\n\t\t\tif (!logoAltOption.value) {\n\t\t\t\treturn { cancelled: true, error: logoAltOption.error, options };\n\t\t\t}\n\n\t\t\tlogo = { alt: logoAltOption.value, src: options.logo };\n\t\t}\n\t}\n\n\tlet email = options.email ?? (await defaults.email());\n\n\tif (!email) {\n\t\tconst emailOption = await getPrefillOrPromptedOption({\n\t\t\tauto: !!mappedOptions.auto,\n\t\t\tmessage: \"What email should be used in package.json and .md files?\",\n\t\t\tname: \"email\",\n\t\t});\n\n\t\tif (!emailOption.value) {\n\t\t\treturn { cancelled: true, error: emailOption.error, options };\n\t\t}\n\n\t\temail = { github: emailOption.value, npm: emailOption.value };\n\t}\n\n\tconst augmentedOptions = await augmentOptionsWithExcludes({\n\t\t...options,\n\t\taccess: options.access ?? \"public\",\n\t\tauthor: options.author ?? (await defaults.owner()),\n\t\tdescription: options.description,\n\t\tdirectory:\n\t\t\toptions.directory ?? promptedOptions.directory ?? options.repository,\n\t\temail,\n\t\tfunding: options.funding ?? (await defaults.funding()),\n\t\tguide,\n\t\tlogo,\n\t\tmode,\n\t\towner: options.owner,\n\t\trepository,\n\t\ttitle: options.title,\n\t});\n\n\tif (!augmentedOptions) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tif (options.auto) {\n\t\tlogInferredOptions(augmentedOptions);\n\t}\n\n\treturn {\n\t\tcancelled: false,\n\t\tgithub,\n\t\toptions: augmentedOptions,\n\t};\n}\n"],"mappings":"AAAA,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAG1B,SAAS,mBAAmB;AAG5B,SAAS,qBAAqB;AAC9B,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AACtC,SAAS,8BAA8B;AACvC,SAAS,eAAe;AACxB,SAAS,iBAAyB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAmB9B,eAAsB,YACrB,MACA,MACA,kBAAmC,CAAC,GACN;AAC9B,QAAM,WAAW,qBAAqB,eAAe;AACrD,QAAM,EAAE,OAAO,IAA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AQ,UAAW,MAAM,SAAS,MAAM;AAAA,IAChD,aAAa,QAAQ;AAAA,IACrB,WACC,QAAQ,aAAa,gBAAgB,aAAa,QAAQ;AAAA,IAC3D;AAAA,IACA,SAAS,QAAQ,WAAY,MAAM,SAAS,QAAQ;AAAA,IACpD;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,QAAQ;AAAA,IACf;AAAA,IACA,OAAO,QAAQ;AAAA,EAChB,CAAC;AAED,MAAI,CAAC,kBAAkB;AACtB,WAAO;AAAA,MACN,WAAW;AAAA,MACX;AAAA,IACD;AAAA,EACD;AAEA,MAAI,QAAQ,MAAM;AACjB,uBAAmB,gBAAgB;AAAA,EACpC;AAEA,SAAO;AAAA,IACN,WAAW;AAAA,IACX;AAAA,IACA,SAAS;AAAA,EACV;AACD;","names":["titleOption"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/shared/options/readOptions.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport { titleCase } from \"title-case\";\nimport { z } from \"zod\";\n\nimport { withSpinner } from \"../cli/spinners.js\";\nimport { Mode, OptionsGuide, PromptedOptions } from \"../types.js\";\nimport { Options, OptionsLogo } from \"../types.js\";\nimport { allArgOptions } from \"./args.js\";\nimport { augmentOptionsWithExcludes } from \"./augmentOptionsWithExcludes.js\";\nimport { createOptionDefaults } from \"./createOptionDefaults/index.js\";\nimport { detectEmailRedundancy } from \"./detectEmailRedundancy.js\";\nimport { ensureRepositoryExists } from \"./ensureRepositoryExists.js\";\nimport { getBase } from \"./getBase.js\";\nimport { getGitHub, GitHub } from \"./getGitHub.js\";\nimport { getPrefillOrPromptedOption } from \"./getPrefillOrPromptedOption.js\";\nimport { logInferredOptions } from \"./logInferredOptions.js\";\nimport { optionsSchema } from \"./optionsSchema.js\";\n\nexport interface GitHubAndOptions {\n\tgithub: GitHub | undefined;\n\toptions: Options;\n}\n\nexport interface OptionsParseCancelled {\n\tcancelled: true;\n\terror?: string | z.ZodError<object>;\n\toptions: object;\n}\n\nexport interface OptionsParseSuccess extends GitHubAndOptions {\n\tcancelled: false;\n}\n\nexport type OptionsParseResult = OptionsParseCancelled | OptionsParseSuccess;\n\nexport async function readOptions(\n\targs: string[],\n\tmode: Mode,\n\tpromptedOptions: PromptedOptions = {},\n): Promise<OptionsParseResult> {\n\tconst defaults = createOptionDefaults(promptedOptions);\n\tconst { values } = parseArgs({\n\t\targs,\n\t\toptions: allArgOptions,\n\t\tstrict: false,\n\t\ttokens: true,\n\t});\n\n\tif (mode === \"migrate\" && !values.base) {\n\t\tvalues.base = await getBase();\n\t}\n\n\tconst mappedOptions = {\n\t\taccess: values.access,\n\t\tauthor: values.author,\n\t\tauto: !!values.auto,\n\t\tbase: values.base,\n\t\tbin: values.bin,\n\t\tdescription: values.description,\n\t\tdirectory: values.directory,\n\t\temail:\n\t\t\t(values.email ?? values[\"email-github\"] ?? values[\"email-npm\"])\n\t\t\t\t? {\n\t\t\t\t\t\tgithub: values.email ?? values[\"email-github\"],\n\t\t\t\t\t\tnpm: values.email ?? values[\"email-npm\"],\n\t\t\t\t\t}\n\t\t\t\t: undefined,\n\t\texcludeAllContributors: values[\"exclude-all-contributors\"],\n\t\texcludeCompliance: values[\"exclude-compliance\"],\n\t\texcludeLintESLint: values[\"exclude-lint-eslint\"],\n\t\texcludeLintJSDoc: values[\"exclude-lint-jsdoc\"],\n\t\texcludeLintJson: values[\"exclude-lint-json\"],\n\t\texcludeLintKnip: values[\"exclude-lint-knip\"],\n\t\texcludeLintMd: values[\"exclude-lint-md\"],\n\t\texcludeLintPackageJson: values[\"exclude-lint-package-json\"],\n\t\texcludeLintPackages: values[\"exclude-lint-packages\"],\n\t\texcludeLintPerfectionist: values[\"exclude-lint-perfectionist\"],\n\t\texcludeLintRegex: values[\"exclude-lint-regex\"],\n\t\texcludeLintSpelling: values[\"exclude-lint-spelling\"],\n\t\texcludeLintStrict: values[\"exclude-lint-strict\"],\n\t\texcludeLintYml: values[\"exclude-lint-yml\"],\n\t\texcludeReleases: values[\"exclude-releases\"],\n\t\texcludeRenovate: values[\"exclude-renovate\"],\n\t\texcludeTests: values[\"unit-tests\"],\n\t\tfunding: values.funding,\n\t\tguide: values.guide,\n\t\tguideTitle: values[\"guide-title\"],\n\t\tlogo: values.logo,\n\t\tlogoAlt: values[\"logo-alt\"],\n\t\toffline: values.offline,\n\t\towner: values.owner,\n\t\tpreserveGeneratedFrom:\n\t\t\tvalues[\"preserve-generated-from\"] ?? values.owner === \"JoshuaKGoldberg\",\n\t\trepository: values.repository,\n\t\tskipAllContributorsApi:\n\t\t\tvalues[\"skip-all-contributors-api\"] ?? values.offline,\n\t\tskipGitHubApi: values[\"skip-github-api\"] ?? values.offline,\n\t\tskipInstall: values[\"skip-install\"],\n\t\tskipRemoval: values[\"skip-removal\"],\n\t\tskipRestore: values[\"skip-restore\"],\n\t\tskipUninstall: values[\"skip-uninstall\"],\n\t\ttitle: values.title,\n\t};\n\n\tconst emailError = detectEmailRedundancy(values);\n\tif (emailError) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: emailError,\n\t\t\toptions: mappedOptions,\n\t\t};\n\t}\n\n\tconst optionsParseResult = optionsSchema.safeParse(mappedOptions);\n\n\tif (!optionsParseResult.success) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: optionsParseResult.error,\n\t\t\toptions: mappedOptions,\n\t\t};\n\t}\n\n\tconst options = optionsParseResult.data;\n\n\tconst ownerOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: defaults.owner,\n\t\tmessage: \"What organization or user will the repository be under?\",\n\t\tname: \"owner\",\n\t\tprovided: options.owner,\n\t});\n\n\toptions.owner ??= ownerOption.value;\n\n\tif (!options.owner) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: ownerOption.error,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tconst repositoryOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: defaults.repository,\n\t\tmessage: \"What will the kebab-case name of the repository be?\",\n\t\tname: \"repository\",\n\t\tprovided: options.repository,\n\t});\n\n\toptions.repository ??= repositoryOption.value;\n\n\tif (!options.repository) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: repositoryOption.error,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tconst { github, repository } = await ensureRepositoryExists(\n\t\toptions.skipGitHubApi\n\t\t\t? undefined\n\t\t\t: await withSpinner(\"Checking GitHub authentication\", getGitHub),\n\t\t{\n\t\t\tmode,\n\t\t\towner: options.owner,\n\t\t\trepository: options.repository,\n\t\t},\n\t);\n\n\tif (!repository) {\n\t\treturn { cancelled: true, error: repositoryOption.error, options };\n\t}\n\n\tconst descriptionOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: async () =>\n\t\t\t(await defaults.description()) ?? \"A very lovely package. Hooray!\",\n\t\tmessage: \"How would you describe the new package?\",\n\t\tname: \"description\",\n\t\tprovided: options.description,\n\t});\n\n\toptions.description ??= descriptionOption.value;\n\n\tif (!options.description) {\n\t\treturn { cancelled: true, error: descriptionOption.error, options };\n\t}\n\n\tconst titleOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: async () =>\n\t\t\t(await defaults.title()) ?? titleCase(repository).replaceAll(\"-\", \" \"),\n\t\tmessage: \"What will the Title Case title of the repository be?\",\n\t\tname: \"title\",\n\t\tprovided: options.title,\n\t});\n\n\toptions.title ??= titleOption.value;\n\n\tif (!options.title) {\n\t\treturn { cancelled: true, error: titleOption.error, options };\n\t}\n\n\tlet guide: OptionsGuide | undefined;\n\n\tif (options.guide) {\n\t\tif (options.guideTitle) {\n\t\t\tguide = { href: options.guide, title: options.guideTitle };\n\t\t} else {\n\t\t\tconst titleOption = await getPrefillOrPromptedOption({\n\t\t\t\tauto: !!mappedOptions.auto,\n\t\t\t\tmessage: \"What is the title text for the guide?\",\n\t\t\t\tname: \"getPrefillOrPromptedOption\",\n\t\t\t});\n\n\t\t\tif (!titleOption.value) {\n\t\t\t\treturn { cancelled: true, error: titleOption.error, options };\n\t\t\t}\n\n\t\t\tguide = { href: options.guide, title: titleOption.value };\n\t\t}\n\t}\n\n\tlet logo: OptionsLogo | undefined;\n\n\tif (options.logo) {\n\t\tif (options.logoAlt) {\n\t\t\tlogo = { alt: options.logoAlt, src: options.logo };\n\t\t} else {\n\t\t\tconst logoAltOption = await getPrefillOrPromptedOption({\n\t\t\t\tauto: !!mappedOptions.auto,\n\t\t\t\tmessage: \"What is the alt text (non-visual description) of the logo?\",\n\t\t\t\tname: \"getPrefillOrPromptedOption\",\n\t\t\t});\n\n\t\t\tif (!logoAltOption.value) {\n\t\t\t\treturn { cancelled: true, error: logoAltOption.error, options };\n\t\t\t}\n\n\t\t\tlogo = { alt: logoAltOption.value, src: options.logo };\n\t\t}\n\t}\n\n\tlet email = options.email ?? (await defaults.email());\n\n\tif (!email) {\n\t\tconst emailOption = await getPrefillOrPromptedOption({\n\t\t\tauto: !!mappedOptions.auto,\n\t\t\tmessage: \"What email should be used in package.json and .md files?\",\n\t\t\tname: \"email\",\n\t\t});\n\n\t\tif (!emailOption.value) {\n\t\t\treturn { cancelled: true, error: emailOption.error, options };\n\t\t}\n\n\t\temail = { github: emailOption.value, npm: emailOption.value };\n\t}\n\n\tconst augmentedOptions = await augmentOptionsWithExcludes({\n\t\t...options,\n\t\taccess: options.access ?? \"public\",\n\t\tauthor:\n\t\t\toptions.author ?? (await defaults.author()) ?? (await defaults.owner()),\n\t\tbin: options.bin ?? (await defaults.bin()),\n\t\tdescription: options.description,\n\t\tdirectory:\n\t\t\toptions.directory ?? promptedOptions.directory ?? options.repository,\n\t\temail,\n\t\tfunding: options.funding ?? (await defaults.funding()),\n\t\tguide: guide ?? (await defaults.guide()),\n\t\tlogo: logo ?? (await defaults.logo()),\n\t\tmode,\n\t\towner: options.owner,\n\t\trepository,\n\t\ttitle: options.title,\n\t});\n\n\tif (!augmentedOptions) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tif (options.auto) {\n\t\tlogInferredOptions(augmentedOptions);\n\t}\n\n\treturn {\n\t\tcancelled: false,\n\t\tgithub,\n\t\toptions: augmentedOptions,\n\t};\n}\n"],"mappings":"AAAA,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAG1B,SAAS,mBAAmB;AAG5B,SAAS,qBAAqB;AAC9B,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AACtC,SAAS,8BAA8B;AACvC,SAAS,eAAe;AACxB,SAAS,iBAAyB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAmB9B,eAAsB,YACrB,MACA,MACA,kBAAmC,CAAC,GACN;AAC9B,QAAM,WAAW,qBAAqB,eAAe;AACrD,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,EACT,CAAC;AAED,MAAI,SAAS,aAAa,CAAC,OAAO,MAAM;AACvC,WAAO,OAAO,MAAM,QAAQ;AAAA,EAC7B;AAEA,QAAM,gBAAgB;AAAA,IACrB,QAAQ,OAAO;AAAA,IACf,QAAQ,OAAO;AAAA,IACf,MAAM,CAAC,CAAC,OAAO;AAAA,IACf,MAAM,OAAO;AAAA,IACb,KAAK,OAAO;AAAA,IACZ,aAAa,OAAO;AAAA,IACpB,WAAW,OAAO;AAAA,IAClB,OACE,OAAO,SAAS,OAAO,cAAc,KAAK,OAAO,WAAW,IAC1D;AAAA,MACA,QAAQ,OAAO,SAAS,OAAO,cAAc;AAAA,MAC7C,KAAK,OAAO,SAAS,OAAO,WAAW;AAAA,IACxC,IACC;AAAA,IACJ,wBAAwB,OAAO,0BAA0B;AAAA,IACzD,mBAAmB,OAAO,oBAAoB;AAAA,IAC9C,mBAAmB,OAAO,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ption"]}
|
|
@@ -2,6 +2,6 @@ interface RunOrRestoreOptions {
|
|
|
2
2
|
run: () => Promise<void>;
|
|
3
3
|
skipRestore: boolean | undefined;
|
|
4
4
|
}
|
|
5
|
-
declare function runOrRestore({ run, skipRestore }: RunOrRestoreOptions): Promise<
|
|
5
|
+
declare function runOrRestore({ run, skipRestore }: RunOrRestoreOptions): Promise<2 | 0>;
|
|
6
6
|
|
|
7
7
|
export { type RunOrRestoreOptions, runOrRestore };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { execaCommand } from "execa";
|
|
2
|
+
async function clearLocalGitTags() {
|
|
3
|
+
const tags = await execaCommand("git tag -l");
|
|
4
|
+
await execaCommand(`git tag -d ${tags.stdout.replaceAll("\n", " ")}`);
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
clearLocalGitTags
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=clearLocalGitTags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/steps/clearLocalGitTags.ts"],"sourcesContent":["import { execaCommand } from \"execa\";\n\nexport async function clearLocalGitTags() {\n\tconst tags = await execaCommand(\"git tag -l\");\n\n\tawait execaCommand(`git tag -d ${tags.stdout.replaceAll(\"\\n\", \" \")}`);\n}\n"],"mappings":"AAAA,SAAS,oBAAoB;AAE7B,eAAsB,oBAAoB;AACzC,QAAM,OAAO,MAAM,aAAa,YAAY;AAE5C,QAAM,aAAa,cAAc,KAAK,OAAO,WAAW,MAAM,GAAG,CAAC,EAAE;AACrE;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-typescript-app",
|
|
3
|
-
"version": "1.67.
|
|
3
|
+
"version": "1.67.4",
|
|
4
4
|
"description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 💝",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"author": {
|
|
11
|
-
"name": "Josh Goldberg",
|
|
11
|
+
"name": "Josh Goldberg ✨",
|
|
12
12
|
"email": "npm@joshuakgoldberg.com"
|
|
13
13
|
},
|
|
14
14
|
"type": "module",
|