create-typescript-app 1.76.0 → 1.77.1
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 +1 -1
- 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 -12
- package/lib/create/createWithOptions.js.map +1 -1
- package/lib/index.d.ts +45 -0
- package/lib/index.js +5 -0
- package/lib/index.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.d.ts +101 -0
- package/lib/next/base.js +144 -0
- package/lib/next/base.js.map +1 -0
- package/lib/next/blocks/blockAllContributors.d.ts +48 -0
- package/lib/next/blocks/blockAllContributors.js +60 -0
- package/lib/next/blocks/blockAllContributors.js.map +1 -0
- package/lib/next/blocks/blockAreTheTypesWrong.d.ts +48 -0
- package/lib/next/blocks/blockAreTheTypesWrong.js +29 -0
- package/lib/next/blocks/blockAreTheTypesWrong.js.map +1 -0
- package/lib/next/blocks/blockCSpell.d.ts +51 -0
- package/lib/next/blocks/blockCSpell.js +72 -0
- package/lib/next/blocks/blockCSpell.js.map +1 -0
- package/lib/next/blocks/blockContributingDocs.d.ts +48 -0
- package/lib/next/blocks/blockContributingDocs.js +127 -0
- package/lib/next/blocks/blockContributingDocs.js.map +1 -0
- package/lib/next/blocks/blockContributorCovenant.d.ts +48 -0
- package/lib/next/blocks/blockContributorCovenant.js +162 -0
- package/lib/next/blocks/blockContributorCovenant.js.map +1 -0
- package/lib/next/blocks/blockDevelopmentDocs.d.ts +62 -0
- package/lib/next/blocks/blockDevelopmentDocs.js +92 -0
- package/lib/next/blocks/blockDevelopmentDocs.js.map +1 -0
- package/lib/next/blocks/blockESLint.d.ts +73 -0
- package/lib/next/blocks/blockESLint.js +242 -0
- package/lib/next/blocks/blockESLint.js.map +1 -0
- package/lib/next/blocks/blockESLintComments.d.ts +48 -0
- package/lib/next/blocks/blockESLintComments.js +26 -0
- package/lib/next/blocks/blockESLintComments.js.map +1 -0
- package/lib/next/blocks/blockESLintJSDoc.d.ts +48 -0
- package/lib/next/blocks/blockESLintJSDoc.js +25 -0
- package/lib/next/blocks/blockESLintJSDoc.js.map +1 -0
- package/lib/next/blocks/blockESLintJSONC.d.ts +48 -0
- package/lib/next/blocks/blockESLintJSONC.js +21 -0
- package/lib/next/blocks/blockESLintJSONC.js.map +1 -0
- package/lib/next/blocks/blockESLintMarkdown.d.ts +48 -0
- package/lib/next/blocks/blockESLintMarkdown.js +27 -0
- package/lib/next/blocks/blockESLintMarkdown.js.map +1 -0
- package/lib/next/blocks/blockESLintMoreStyling.d.ts +48 -0
- package/lib/next/blocks/blockESLintMoreStyling.js +34 -0
- package/lib/next/blocks/blockESLintMoreStyling.js.map +1 -0
- package/lib/next/blocks/blockESLintNode.d.ts +48 -0
- package/lib/next/blocks/blockESLintNode.js +33 -0
- package/lib/next/blocks/blockESLintNode.js.map +1 -0
- package/lib/next/blocks/blockESLintPackageJson.d.ts +48 -0
- package/lib/next/blocks/blockESLintPackageJson.js +26 -0
- package/lib/next/blocks/blockESLintPackageJson.js.map +1 -0
- package/lib/next/blocks/blockESLintPerfectionist.d.ts +48 -0
- package/lib/next/blocks/blockESLintPerfectionist.js +32 -0
- package/lib/next/blocks/blockESLintPerfectionist.js.map +1 -0
- package/lib/next/blocks/blockESLintRegexp.d.ts +48 -0
- package/lib/next/blocks/blockESLintRegexp.js +23 -0
- package/lib/next/blocks/blockESLintRegexp.js.map +1 -0
- package/lib/next/blocks/blockESLintYML.d.ts +48 -0
- package/lib/next/blocks/blockESLintYML.js +46 -0
- package/lib/next/blocks/blockESLintYML.js.map +1 -0
- 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/blockFunding.d.ts +48 -0
- package/lib/next/blocks/blockFunding.js +20 -0
- package/lib/next/blocks/blockFunding.js.map +1 -0
- package/lib/next/blocks/blockGitHubActionsCI.d.ts +60 -0
- package/lib/next/blocks/blockGitHubActionsCI.js +133 -0
- package/lib/next/blocks/blockGitHubActionsCI.js.map +1 -0
- package/lib/next/blocks/blockGitHubIssueTemplates.d.ts +48 -0
- package/lib/next/blocks/blockGitHubIssueTemplates.js +217 -0
- package/lib/next/blocks/blockGitHubIssueTemplates.js.map +1 -0
- package/lib/next/blocks/blockGitHubPRTemplate.d.ts +48 -0
- package/lib/next/blocks/blockGitHubPRTemplate.js +32 -0
- package/lib/next/blocks/blockGitHubPRTemplate.js.map +1 -0
- package/lib/next/blocks/blockGitignore.d.ts +50 -0
- package/lib/next/blocks/blockGitignore.js +23 -0
- package/lib/next/blocks/blockGitignore.js.map +1 -0
- package/lib/next/blocks/blockKnip.d.ts +48 -0
- package/lib/next/blocks/blockKnip.js +58 -0
- package/lib/next/blocks/blockKnip.js.map +1 -0
- package/lib/next/blocks/blockMITLicense.d.ts +48 -0
- package/lib/next/blocks/blockMITLicense.js +46 -0
- package/lib/next/blocks/blockMITLicense.js.map +1 -0
- package/lib/next/blocks/blockMarkdownlint.d.ts +50 -0
- package/lib/next/blocks/blockMarkdownlint.js +77 -0
- package/lib/next/blocks/blockMarkdownlint.js.map +1 -0
- package/lib/next/blocks/blockNvmrc.d.ts +48 -0
- package/lib/next/blocks/blockNvmrc.js +26 -0
- package/lib/next/blocks/blockNvmrc.js.map +1 -0
- package/lib/next/blocks/blockPRCompliance.d.ts +48 -0
- package/lib/next/blocks/blockPRCompliance.js +48 -0
- package/lib/next/blocks/blockPRCompliance.js.map +1 -0
- package/lib/next/blocks/blockPackageJson.d.ts +57 -0
- package/lib/next/blocks/blockPackageJson.js +92 -0
- package/lib/next/blocks/blockPackageJson.js.map +1 -0
- package/lib/next/blocks/blockPnpmDedupe.d.ts +48 -0
- package/lib/next/blocks/blockPnpmDedupe.js +46 -0
- package/lib/next/blocks/blockPnpmDedupe.js.map +1 -0
- package/lib/next/blocks/blockPrettier.d.ts +57 -0
- package/lib/next/blocks/blockPrettier.js +114 -0
- package/lib/next/blocks/blockPrettier.js.map +1 -0
- package/lib/next/blocks/blockPrettierPluginCurly.d.ts +48 -0
- package/lib/next/blocks/blockPrettierPluginCurly.js +20 -0
- package/lib/next/blocks/blockPrettierPluginCurly.js.map +1 -0
- package/lib/next/blocks/blockPrettierPluginPackageJson.d.ts +48 -0
- package/lib/next/blocks/blockPrettierPluginPackageJson.js +20 -0
- package/lib/next/blocks/blockPrettierPluginPackageJson.js.map +1 -0
- package/lib/next/blocks/blockPrettierPluginSh.d.ts +48 -0
- package/lib/next/blocks/blockPrettierPluginSh.js +20 -0
- package/lib/next/blocks/blockPrettierPluginSh.js.map +1 -0
- package/lib/next/blocks/blockREADME.d.ts +50 -0
- package/lib/next/blocks/blockREADME.js +63 -0
- package/lib/next/blocks/blockREADME.js.map +1 -0
- package/lib/next/blocks/blockReleaseIt.d.ts +48 -0
- package/lib/next/blocks/blockReleaseIt.js +131 -0
- package/lib/next/blocks/blockReleaseIt.js.map +1 -0
- package/lib/next/blocks/blockRenovate.d.ts +48 -0
- package/lib/next/blocks/blockRenovate.js +34 -0
- package/lib/next/blocks/blockRenovate.js.map +1 -0
- package/lib/next/blocks/blockRepositoryBranchProtection.d.ts +50 -0
- package/lib/next/blocks/blockRepositoryBranchProtection.js +49 -0
- package/lib/next/blocks/blockRepositoryBranchProtection.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/blockSecurityDocs.d.ts +48 -0
- package/lib/next/blocks/blockSecurityDocs.js +28 -0
- package/lib/next/blocks/blockSecurityDocs.js.map +1 -0
- package/lib/next/blocks/blockTSup.d.ts +50 -0
- package/lib/next/blocks/blockTSup.js +95 -0
- package/lib/next/blocks/blockTSup.js.map +1 -0
- package/lib/next/blocks/blockTemplatedBy.d.ts +48 -0
- package/lib/next/blocks/blockTemplatedBy.js +30 -0
- package/lib/next/blocks/blockTemplatedBy.js.map +1 -0
- package/lib/next/blocks/blockTypeScript.d.ts +48 -0
- package/lib/next/blocks/blockTypeScript.js +137 -0
- package/lib/next/blocks/blockTypeScript.js.map +1 -0
- package/lib/next/blocks/blockVSCode.d.ts +57 -0
- package/lib/next/blocks/blockVSCode.js +91 -0
- package/lib/next/blocks/blockVSCode.js.map +1 -0
- package/lib/next/blocks/blockVitest.d.ts +55 -0
- package/lib/next/blocks/blockVitest.js +217 -0
- package/lib/next/blocks/blockVitest.js.map +1 -0
- package/lib/next/blocks/index.d.ts +43 -0
- package/lib/next/blocks/index.js +43 -0
- package/lib/next/blocks/index.js.map +1 -0
- package/lib/next/blocks/options.fakes.d.ts +13 -0
- package/lib/next/blocks/options.fakes.js +15 -0
- package/lib/next/blocks/options.fakes.js.map +1 -0
- package/lib/next/blocks/packageData.d.ts +5 -0
- package/lib/next/blocks/packageData.js +25 -0
- package/lib/next/blocks/packageData.js.map +1 -0
- 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/presetCommon.d.ts +99 -0
- package/lib/next/presetCommon.js +21 -0
- package/lib/next/presetCommon.js.map +1 -0
- package/lib/next/presetEverything.d.ts +99 -0
- package/lib/next/presetEverything.js +59 -0
- package/lib/next/presetEverything.js.map +1 -0
- package/lib/next/presetMinimal.d.ts +99 -0
- package/lib/next/presetMinimal.js +53 -0
- package/lib/next/presetMinimal.js.map +1 -0
- 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/next/template.d.ts +99 -0
- package/lib/next/template.js +21 -0
- package/lib/next/template.js.map +1 -0
- package/lib/next/utils/sortObject.d.ts +5 -0
- package/lib/next/utils/sortObject.js +9 -0
- package/lib/next/utils/sortObject.js.map +1 -0
- package/lib/next/utils/swallowError.d.ts +3 -0
- package/lib/next/utils/swallowError.js +7 -0
- package/lib/next/utils/swallowError.js.map +1 -0
- package/lib/shared/isUsingCreateEngine.d.ts +3 -0
- package/lib/shared/isUsingCreateEngine.js +7 -0
- package/lib/shared/isUsingCreateEngine.js.map +1 -0
- package/lib/shared/options/createOptionDefaults/index.d.ts +2 -4
- package/lib/shared/options/createOptionDefaults/index.js +4 -13
- package/lib/shared/options/createOptionDefaults/index.js.map +1 -1
- package/lib/shared/options/createOptionDefaults/readDefaultsFromReadme.js +4 -1
- package/lib/shared/options/createOptionDefaults/readDefaultsFromReadme.js.map +1 -1
- package/lib/shared/options/createOptionDefaults/readEmails.d.ts +11 -0
- package/lib/shared/options/createOptionDefaults/readEmails.js +14 -0
- package/lib/shared/options/createOptionDefaults/readEmails.js.map +1 -0
- package/lib/shared/options/createOptionDefaults/readFunding.d.ts +3 -0
- package/lib/shared/options/createOptionDefaults/readFunding.js +11 -0
- package/lib/shared/options/createOptionDefaults/readFunding.js.map +1 -0
- package/lib/shared/options/createOptionDefaults/readGuide.d.ts +6 -0
- package/lib/shared/options/createOptionDefaults/readGuide.js +18 -0
- package/lib/shared/options/createOptionDefaults/readGuide.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/shared/types.d.ts +7 -0
- package/lib/steps/addOwnerAsAllContributor.js.map +1 -1
- package/lib/steps/clearUnnecessaryFiles.js +0 -1
- package/lib/steps/clearUnnecessaryFiles.js.map +1 -1
- package/lib/steps/finalizeDependencies.js +5 -7
- 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/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/removeSetupScripts.js +9 -3
- package/lib/steps/removeSetupScripts.js.map +1 -1
- package/lib/steps/uninstallPackages.js +14 -5
- package/lib/steps/uninstallPackages.js.map +1 -1
- package/lib/steps/writing/creation/createCSpellConfig.d.ts +7 -0
- package/lib/steps/writing/creation/createCSpellConfig.js +27 -0
- package/lib/steps/writing/creation/createCSpellConfig.js.map +1 -0
- package/lib/steps/writing/creation/createDotGitignore.js +7 -5
- package/lib/steps/writing/creation/createDotGitignore.js.map +1 -1
- package/lib/steps/writing/creation/createESLintConfig.js +1 -3
- package/lib/steps/writing/creation/createESLintConfig.js.map +1 -1
- package/lib/steps/writing/creation/createTsupConfig.js +10 -10
- package/lib/steps/writing/creation/createTsupConfig.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/createDevelopment/index.js +31 -16
- package/lib/steps/writing/creation/dotGitHub/createDevelopment/index.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/createDevelopment/splitIntoSections.js +1 -1
- package/lib/steps/writing/creation/dotGitHub/createDevelopment/splitIntoSections.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.js +5 -5
- package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/createMultiWorkflowFile.d.ts +3 -1
- package/lib/steps/writing/creation/dotGitHub/createMultiWorkflowFile.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/createWorkflows.js +5 -1
- package/lib/steps/writing/creation/dotGitHub/createWorkflows.js.map +1 -1
- package/lib/steps/writing/creation/formatters/formatIgnoreFile.d.ts +1 -1
- package/lib/steps/writing/creation/formatters/formatIgnoreFile.js +1 -1
- package/lib/steps/writing/creation/formatters/formatIgnoreFile.js.map +1 -1
- package/lib/steps/writing/creation/formatters/formatTypeScript.js +1 -1
- package/lib/steps/writing/creation/formatters/formatTypeScript.js.map +1 -1
- package/lib/steps/writing/creation/formatters/formatYaml.js +3 -1
- package/lib/steps/writing/creation/formatters/formatYaml.js.map +1 -1
- package/lib/steps/writing/creation/index.d.ts +1 -1
- package/lib/steps/writing/creation/index.js +48 -1
- package/lib/steps/writing/creation/index.js.map +1 -1
- package/lib/steps/writing/creation/rootFiles.js +4 -14
- package/lib/steps/writing/creation/rootFiles.js.map +1 -1
- package/lib/steps/writing/creation/writeAllContributorsRC.js +1 -9
- package/lib/steps/writing/creation/writeAllContributorsRC.js.map +1 -1
- package/lib/steps/writing/creation/writePackageJson.js +69 -62
- package/lib/steps/writing/creation/writePackageJson.js.map +1 -1
- package/lib/steps/writing/types.d.ts +1 -1
- package/lib/steps/writing/writeStructure.js +9 -1
- package/lib/steps/writing/writeStructure.js.map +1 -1
- package/lib/steps/writing/writeStructureWorker.js +1 -1
- package/lib/steps/writing/writeStructureWorker.js.map +1 -1
- package/package.json +35 -28
- package/lib/shared/options/createOptionDefaults/readDefaultsFromDevelopment.d.ts +0 -8
- package/lib/shared/options/createOptionDefaults/readDefaultsFromDevelopment.js +0 -22
- package/lib/shared/options/createOptionDefaults/readDefaultsFromDevelopment.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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { parseArgs } from "node:util";
|
|
2
|
+
import { octokitFromAuth } from "octokit-from-auth";
|
|
2
3
|
import { titleCase } from "title-case";
|
|
3
4
|
import { withSpinner } from "../cli/spinners.js";
|
|
4
5
|
import { allArgOptions } from "./args.js";
|
|
@@ -7,7 +8,6 @@ import { createOptionDefaults } from "./createOptionDefaults/index.js";
|
|
|
7
8
|
import { detectEmailRedundancy } from "./detectEmailRedundancy.js";
|
|
8
9
|
import { ensureRepositoryExists } from "./ensureRepositoryExists.js";
|
|
9
10
|
import { getBase } from "./getBase.js";
|
|
10
|
-
import { getGitHub } from "./getGitHub.js";
|
|
11
11
|
import { getPrefillOrPromptedOption } from "./getPrefillOrPromptedOption.js";
|
|
12
12
|
import { logInferredOptions } from "./logInferredOptions.js";
|
|
13
13
|
import { optionsSchema } from "./optionsSchema.js";
|
|
@@ -116,8 +116,11 @@ async function readOptions(args, mode, promptedOptions = {}) {
|
|
|
116
116
|
options
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
const {
|
|
120
|
-
options.skipGitHubApi ? void 0 : await withSpinner(
|
|
119
|
+
const { octokit, repository } = await ensureRepositoryExists(
|
|
120
|
+
options.skipGitHubApi ? void 0 : await withSpinner(
|
|
121
|
+
"Checking GitHub authentication",
|
|
122
|
+
async () => octokitFromAuth()
|
|
123
|
+
),
|
|
121
124
|
{
|
|
122
125
|
mode,
|
|
123
126
|
owner: options.owner,
|
|
@@ -220,7 +223,7 @@ async function readOptions(args, mode, promptedOptions = {}) {
|
|
|
220
223
|
}
|
|
221
224
|
return {
|
|
222
225
|
cancelled: false,
|
|
223
|
-
|
|
226
|
+
octokit,
|
|
224
227
|
options: augmentedOptions
|
|
225
228
|
};
|
|
226
229
|
}
|
|
@@ -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 type OptionsParseResult = OptionsParseCancelled | OptionsParseSuccess;\n\nexport interface OptionsParseSuccess extends GitHubAndOptions {\n\tcancelled: false;\n}\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\texcludeTemplatedBy: values[\"exclude-templated-by\"],\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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ions.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport { Octokit } from \"octokit\";\nimport { octokitFromAuth } from \"octokit-from-auth\";\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 { getPrefillOrPromptedOption } from \"./getPrefillOrPromptedOption.js\";\nimport { logInferredOptions } from \"./logInferredOptions.js\";\nimport { optionsSchema } from \"./optionsSchema.js\";\n\nexport interface OctokitAndOptions {\n\toctokit: Octokit | undefined;\n\toptions: Options;\n}\n\nexport interface OptionsParseCancelled {\n\tcancelled: true;\n\terror?: string | z.ZodError<object>;\n\toptions: object;\n}\n\nexport type OptionsParseResult = OptionsParseCancelled | OptionsParseSuccess;\n\nexport interface OptionsParseSuccess extends OctokitAndOptions {\n\tcancelled: false;\n}\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\texcludeTemplatedBy: values[\"exclude-templated-by\"],\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 { octokit, repository } = await ensureRepositoryExists(\n\t\toptions.skipGitHubApi\n\t\t\t? undefined\n\t\t\t: await withSpinner(\"Checking GitHub authentication\", async () =>\n\t\t\t\t\toctokitFromAuth(),\n\t\t\t\t),\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\toctokit,\n\t\toptions: augmentedOptions,\n\t};\n}\n"],"mappings":"AAAA,SAAS,iBAAiB;AAE1B,SAAS,uBAAuB;AAChC,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,kCAAkC;AAC3C,SAAS,0BAA0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,QAAQ;AAAA,IAC7D;AAEA,YAAQ,EAAE,QAAQ,YAAY,OAAO,KAAK,YAAY,MAAM;AAAA,EAC7D;AAEA,QAAM,mBAAmB,MAAM,2BAA2B;AAAA,IACzD,GAAG;AAAA,IACH,QAAQ,QAAQ,UAAU;AAAA,IAC1B,QACC,QAAQ,UAAW,MAAM,SAAS,OAAO,KAAO,MAAM,SAAS,MAAM;AAAA,IACtE,KAAK,QAAQ,OAAQ,MAAM,SAAS,IAAI;AAAA,IACxC,aAAa,QAAQ;AAAA,IACrB,WACC,QAAQ,aAAa,gBAAgB,aAAa,QAAQ;AAAA,IAC3D;AAAA,IACA,SAAS,QAAQ,WAAY,MAAM,SAAS,QAAQ;AAAA,IACpD,OAAO,SAAU,MAAM,SAAS,MAAM;AAAA,IACtC,MAAM,QAAS,MAAM,SAAS,KAAK;AAAA,IACnC;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"]}
|
package/lib/shared/types.d.ts
CHANGED
|
@@ -2,8 +2,11 @@ import { z } from 'zod';
|
|
|
2
2
|
import { StatusCode } from './codes.js';
|
|
3
3
|
|
|
4
4
|
interface AllContributorContributor {
|
|
5
|
+
avatar_url: string;
|
|
5
6
|
contributions: string[];
|
|
6
7
|
login: string;
|
|
8
|
+
name: string;
|
|
9
|
+
profile: string;
|
|
7
10
|
}
|
|
8
11
|
interface AllContributorsData {
|
|
9
12
|
contributors: AllContributorContributor[];
|
|
@@ -32,12 +35,16 @@ interface PartialPackageData {
|
|
|
32
35
|
description?: string;
|
|
33
36
|
devDependencies?: Record<string, string>;
|
|
34
37
|
email?: string;
|
|
38
|
+
engines?: {
|
|
39
|
+
node?: string;
|
|
40
|
+
};
|
|
35
41
|
name?: string;
|
|
36
42
|
repository?: string | {
|
|
37
43
|
type: string;
|
|
38
44
|
url: string;
|
|
39
45
|
};
|
|
40
46
|
scripts?: Record<string, string>;
|
|
47
|
+
version?: string;
|
|
41
48
|
}
|
|
42
49
|
/**
|
|
43
50
|
* All runtime options that may (or must) be specified for setup.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/addOwnerAsAllContributor.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\nimport { Octokit } from \"octokit\";\n\nimport { getGitHubUserAsAllContributor } from \"../shared/getGitHubUserAsAllContributor.js\";\nimport { readFileAsJson } from \"../shared/readFileAsJson.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/steps/addOwnerAsAllContributor.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\nimport { Octokit } from \"octokit\";\n\nimport { getGitHubUserAsAllContributor } from \"../shared/getGitHubUserAsAllContributor.js\";\nimport { readFileAsJson } from \"../shared/readFileAsJson.js\";\nimport {\n\tAllContributorContributor,\n\tAllContributorsData,\n\tOptions,\n} from \"../shared/types.js\";\nimport { formatJson } from \"./writing/creation/formatters/formatJson.js\";\n\nexport async function addOwnerAsAllContributor(\n\toctokit: Octokit | undefined,\n\toptions: Pick<Options, \"offline\" | \"owner\">,\n) {\n\tconst user = await getGitHubUserAsAllContributor(octokit, options);\n\n\tconst existingContributors = (await readFileAsJson(\n\t\t\"./.all-contributorsrc\",\n\t)) as AllContributorsData;\n\tif (!isValidAllContributorsData(existingContributors)) {\n\t\tthrow new Error(\n\t\t\t`Invalid .all-contributorsrc: ${JSON.stringify(existingContributors)}`,\n\t\t);\n\t}\n\n\tconst contributors = existingContributors.contributors\n\t\t.filter(({ login }) => [\"JoshuaKGoldberg\", user].includes(login))\n\t\t.map((contributor) =>\n\t\t\tcontributor.login === \"JoshuaKGoldberg\"\n\t\t\t\t? { ...contributor, contributions: [\"tool\"] }\n\t\t\t\t: {\n\t\t\t\t\t\t...contributor,\n\t\t\t\t\t\tcontributions: Array.from(\n\t\t\t\t\t\t\tnew Set([\"tool\", ...contributor.contributions]),\n\t\t\t\t\t\t).sort(),\n\t\t\t\t\t},\n\t\t);\n\n\tif (!contributors.some((contributor) => contributor.login === user)) {\n\t\tcontributors.push({\n\t\t\tcontributions: [\"tool\"],\n\t\t\tlogin: user,\n\t\t} as AllContributorContributor);\n\t}\n\n\tawait fs.writeFile(\n\t\t\"./.all-contributorsrc\",\n\t\tawait formatJson({\n\t\t\t...existingContributors,\n\t\t\tcontributors,\n\t\t}),\n\t);\n}\n\nfunction isValidAllContributorsData(\n\tvalue: unknown,\n): value is AllContributorsData {\n\treturn !!value && typeof value === \"object\" && \"contributors\" in value;\n}\n"],"mappings":"AAAA,YAAY,QAAQ;AAGpB,SAAS,qCAAqC;AAC9C,SAAS,sBAAsB;AAM/B,SAAS,kBAAkB;AAE3B,eAAsB,yBACrB,SACA,SACC;AACD,QAAM,OAAO,MAAM,8BAA8B,SAAS,OAAO;AAEjE,QAAM,uBAAwB,MAAM;AAAA,IACnC;AAAA,EACD;AACA,MAAI,CAAC,2BAA2B,oBAAoB,GAAG;AACtD,UAAM,IAAI;AAAA,MACT,gCAAgC,KAAK,UAAU,oBAAoB,CAAC;AAAA,IACrE;AAAA,EACD;AAEA,QAAM,eAAe,qBAAqB,aACxC,OAAO,CAAC,EAAE,MAAM,MAAM,CAAC,mBAAmB,IAAI,EAAE,SAAS,KAAK,CAAC,EAC/D;AAAA,IAAI,CAAC,gBACL,YAAY,UAAU,oBACnB,EAAE,GAAG,aAAa,eAAe,CAAC,MAAM,EAAE,IAC1C;AAAA,MACA,GAAG;AAAA,MACH,eAAe,MAAM;AAAA,QACpB,oBAAI,IAAI,CAAC,QAAQ,GAAG,YAAY,aAAa,CAAC;AAAA,MAC/C,EAAE,KAAK;AAAA,IACR;AAAA,EACH;AAED,MAAI,CAAC,aAAa,KAAK,CAAC,gBAAgB,YAAY,UAAU,IAAI,GAAG;AACpE,iBAAa,KAAK;AAAA,MACjB,eAAe,CAAC,MAAM;AAAA,MACtB,OAAO;AAAA,IACR,CAA8B;AAAA,EAC/B;AAEA,QAAM,GAAG;AAAA,IACR;AAAA,IACA,MAAM,WAAW;AAAA,MAChB,GAAG;AAAA,MACH;AAAA,IACD,CAAC;AAAA,EACF;AACD;AAEA,SAAS,2BACR,OAC+B;AAC/B,SAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,kBAAkB;AAClE;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/clearUnnecessaryFiles.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nconst globPaths = [\n\t...extensions(\".babelrc\", \"cjs\", \"cts\", \"js\", \"json\", \"mjs\"),\n\t...extensions(\".eslintrc\", \"js\", \"json\", \"yml\"),\n\t...extensions(\".mocha\", \"cjs\", \"js\", \"json\", \"jsonc\", \"yaml\", \"yml\"),\n\t...extensions(\".prettierrc\", \"json\", \"json5\", \"yaml\", \"yml\"),\n\t...extensions(\"prettier.config\", \"js\", \"mjs\", \"cjs\"),\n\t...extensions(\"babel.config\", \"cjs\", \"cts\", \"js\", \"json\", \"mjs\"),\n\t...extensions(\"jest.config\", \"cjs\", \"js\", \"json\", \"mjs\", \"ts\"),\n\t\"./src/**/*.js\",\n\t\".circleci/config.yml\",\n\t\".github/codecov.yml\",\n\t\".babelrc\",\n\t\".npmignore\",\n\t\".eslintignore\",\n\t\".eslintrc\",\n\t\"CODE_OF_CONDUCT.md\",\n\t\"CONTRIBUTING.md\",\n\t\"
|
|
1
|
+
{"version":3,"sources":["../../src/steps/clearUnnecessaryFiles.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nconst globPaths = [\n\t...extensions(\".babelrc\", \"cjs\", \"cts\", \"js\", \"json\", \"mjs\"),\n\t...extensions(\".eslintrc\", \"js\", \"json\", \"yml\"),\n\t...extensions(\".mocha\", \"cjs\", \"js\", \"json\", \"jsonc\", \"yaml\", \"yml\"),\n\t...extensions(\".prettierrc\", \"json\", \"json5\", \"yaml\", \"yml\"),\n\t...extensions(\"prettier.config\", \"js\", \"mjs\", \"cjs\"),\n\t...extensions(\"babel.config\", \"cjs\", \"cts\", \"js\", \"json\", \"mjs\"),\n\t...extensions(\"jest.config\", \"cjs\", \"js\", \"json\", \"mjs\", \"ts\"),\n\t\"./src/**/*.js\",\n\t\".circleci/config.yml\",\n\t\".github/codecov.yml\",\n\t\".babelrc\",\n\t\".npmignore\",\n\t\".eslintignore\",\n\t\".eslintrc\",\n\t\"CODE_OF_CONDUCT.md\",\n\t\"CONTRIBUTING.md\",\n\t\"codecov.yml\",\n\t\"DEVELOPMENT.md\",\n\t\"dist\",\n\t\"lib\",\n\t\"package-lock.json\",\n\t\"travis.yml\",\n\t\"yarn.lock\",\n];\n\nexport async function clearUnnecessaryFiles() {\n\tfor (const globPath of globPaths) {\n\t\tawait fs.rm(globPath, { force: true, recursive: true });\n\t}\n}\n\nfunction extensions(base: string, ...extensions: string[]) {\n\treturn extensions.map((extension) => [base, extension].join(\".\"));\n}\n"],"mappings":"AAAA,YAAY,QAAQ;AAEpB,MAAM,YAAY;AAAA,EACjB,GAAG,WAAW,YAAY,OAAO,OAAO,MAAM,QAAQ,KAAK;AAAA,EAC3D,GAAG,WAAW,aAAa,MAAM,QAAQ,KAAK;AAAA,EAC9C,GAAG,WAAW,UAAU,OAAO,MAAM,QAAQ,SAAS,QAAQ,KAAK;AAAA,EACnE,GAAG,WAAW,eAAe,QAAQ,SAAS,QAAQ,KAAK;AAAA,EAC3D,GAAG,WAAW,mBAAmB,MAAM,OAAO,KAAK;AAAA,EACnD,GAAG,WAAW,gBAAgB,OAAO,OAAO,MAAM,QAAQ,KAAK;AAAA,EAC/D,GAAG,WAAW,eAAe,OAAO,MAAM,QAAQ,OAAO,IAAI;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,eAAsB,wBAAwB;AAC7C,aAAW,YAAY,WAAW;AACjC,UAAM,GAAG,GAAG,UAAU,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AAAA,EACvD;AACD;AAEA,SAAS,WAAW,SAAiBA,aAAsB;AAC1D,SAAOA,YAAW,IAAI,CAAC,cAAc,CAAC,MAAM,SAAS,EAAE,KAAK,GAAG,CAAC;AACjE;","names":["extensions"]}
|
|
@@ -3,24 +3,22 @@ import { readPackageData, removeDependencies } from "../shared/packages.js";
|
|
|
3
3
|
async function finalizeDependencies(options) {
|
|
4
4
|
const devDependencies = [
|
|
5
5
|
"@eslint/js",
|
|
6
|
-
"@types/eslint__js",
|
|
7
6
|
"@types/node",
|
|
8
|
-
"eslint",
|
|
9
7
|
"eslint-plugin-n",
|
|
8
|
+
"eslint",
|
|
10
9
|
"husky",
|
|
11
10
|
"lint-staged",
|
|
12
|
-
"prettier",
|
|
13
11
|
"prettier-plugin-curly",
|
|
14
|
-
"prettier-plugin-sh",
|
|
15
12
|
"prettier-plugin-packagejson",
|
|
13
|
+
"prettier-plugin-sh",
|
|
14
|
+
"prettier",
|
|
16
15
|
"tsup",
|
|
17
|
-
"typescript",
|
|
18
16
|
"typescript-eslint",
|
|
17
|
+
"typescript",
|
|
19
18
|
...options.excludeAllContributors ? [] : ["all-contributors-cli"],
|
|
20
19
|
...options.excludeLintESLint ? [] : ["@eslint-community/eslint-plugin-eslint-comments"],
|
|
21
20
|
...options.excludeLintJSDoc ? [] : ["eslint-plugin-jsdoc"],
|
|
22
21
|
...options.excludeLintJson ? [] : ["eslint-plugin-jsonc"],
|
|
23
|
-
...options.excludeLintJson && options.excludeLintPackageJson ? [] : ["jsonc-eslint-parser"],
|
|
24
22
|
...options.excludeLintKnip ? [] : ["knip"],
|
|
25
23
|
...options.excludeLintMd ? [] : [
|
|
26
24
|
"@types/eslint-plugin-markdown",
|
|
@@ -48,7 +46,7 @@ async function finalizeDependencies(options) {
|
|
|
48
46
|
if (!options.excludeAllContributors) {
|
|
49
47
|
await execaCommand(`npx all-contributors-cli generate`);
|
|
50
48
|
await removeDependencies(
|
|
51
|
-
["all-contributors-cli"
|
|
49
|
+
["all-contributors-cli"],
|
|
52
50
|
(await readPackageData()).devDependencies,
|
|
53
51
|
"-D"
|
|
54
52
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/finalizeDependencies.ts"],"sourcesContent":["import { execaCommand } from \"execa\";\n\nimport { readPackageData, removeDependencies } from \"../shared/packages.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport async function finalizeDependencies(options: Options) {\n\tconst devDependencies = [\n\t\t\"@eslint/js\",\n\t\t\"@types/
|
|
1
|
+
{"version":3,"sources":["../../src/steps/finalizeDependencies.ts"],"sourcesContent":["import { execaCommand } from \"execa\";\n\nimport { readPackageData, removeDependencies } from \"../shared/packages.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport async function finalizeDependencies(options: Options) {\n\tconst devDependencies = [\n\t\t\"@eslint/js\",\n\t\t\"@types/node\",\n\t\t\"eslint-plugin-n\",\n\t\t\"eslint\",\n\t\t\"husky\",\n\t\t\"lint-staged\",\n\t\t\"prettier-plugin-curly\",\n\t\t\"prettier-plugin-packagejson\",\n\t\t\"prettier-plugin-sh\",\n\t\t\"prettier\",\n\t\t\"tsup\",\n\t\t\"typescript-eslint\",\n\t\t\"typescript\",\n\t\t...(options.excludeAllContributors ? [] : [\"all-contributors-cli\"]),\n\t\t...(options.excludeLintESLint\n\t\t\t? []\n\t\t\t: [\"@eslint-community/eslint-plugin-eslint-comments\"]),\n\t\t...(options.excludeLintJSDoc ? [] : [\"eslint-plugin-jsdoc\"]),\n\t\t...(options.excludeLintJson ? [] : [\"eslint-plugin-jsonc\"]),\n\t\t...(options.excludeLintKnip ? [] : [\"knip\"]),\n\t\t...(options.excludeLintMd\n\t\t\t? []\n\t\t\t: [\n\t\t\t\t\t\"@types/eslint-plugin-markdown\",\n\t\t\t\t\t\"eslint-plugin-markdown\",\n\t\t\t\t\t\"markdownlint\",\n\t\t\t\t\t\"markdownlint-cli\",\n\t\t\t\t\t\"sentences-per-line\",\n\t\t\t\t]),\n\t\t...(options.excludeLintPackageJson ? [] : [\"eslint-plugin-package-json\"]),\n\t\t...(options.excludeLintPerfectionist\n\t\t\t? []\n\t\t\t: [\"eslint-plugin-perfectionist\"]),\n\t\t...(options.excludeLintRegex ? [] : [\"eslint-plugin-regexp\"]),\n\t\t...(options.excludeLintSpelling ? [] : [\"cspell\"]),\n\t\t...(options.excludeLintYml ? [] : [\"eslint-plugin-yml\"]),\n\t\t...(options.excludeReleases\n\t\t\t? []\n\t\t\t: [\"@release-it/conventional-changelog\", \"release-it\"]),\n\t\t...(options.excludeTests\n\t\t\t? []\n\t\t\t: [\n\t\t\t\t\t\"@vitest/coverage-v8\",\n\t\t\t\t\t\"@vitest/eslint-plugin\",\n\t\t\t\t\t\"console-fail-test\",\n\t\t\t\t\t\"vitest\",\n\t\t\t\t]),\n\t]\n\t\t.filter(Boolean)\n\t\t.sort()\n\t\t.map((packageName) => `${packageName}@latest`)\n\t\t.join(\" \");\n\n\tawait execaCommand(\n\t\t`pnpm add ${devDependencies} -D${options.offline ? \" --offline\" : \"\"}`,\n\t);\n\n\tif (!options.excludeAllContributors) {\n\t\tawait execaCommand(`npx all-contributors-cli generate`);\n\t\tawait removeDependencies(\n\t\t\t[\"all-contributors-cli\"],\n\t\t\t(await readPackageData()).devDependencies,\n\t\t\t\"-D\",\n\t\t);\n\t}\n\n\tawait execaCommand(`pnpm dedupe --offline`);\n}\n"],"mappings":"AAAA,SAAS,oBAAoB;AAE7B,SAAS,iBAAiB,0BAA0B;AAGpD,eAAsB,qBAAqB,S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BAAwB;AACpC,UAAM,aAAa,mCAAmC;AACtD,UAAM;AAAA,MACL,CAAC,sBAAsB;AAAA,OACtB,MAAM,gBAAgB,GAAG;AAAA,MAC1B;AAAA,IACD;AAAA,EACD;AAEA,QAAM,aAAa,uBAAuB;AAC3C;","names":[]}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
import { setGitHubRepositoryLabels } from "set-github-repository-labels";
|
|
1
2
|
import { initializeGitRemote } from "../initializeGitRemote.js";
|
|
2
3
|
import { initializeRepositorySettings } from "../initializeRepositorySettings.js";
|
|
3
4
|
import { initializeBranchProtectionSettings } from "./initializeBranchProtectionSettings.js";
|
|
4
|
-
import {
|
|
5
|
+
import { outcomeLabels } from "./outcomeLabels.js";
|
|
5
6
|
async function initializeGitHubRepository(octokit, options) {
|
|
6
7
|
await initializeGitRemote(options);
|
|
7
8
|
await initializeRepositorySettings(octokit, options);
|
|
8
9
|
await initializeBranchProtectionSettings(octokit, options);
|
|
9
|
-
await
|
|
10
|
+
await setGitHubRepositoryLabels({
|
|
11
|
+
labels: outcomeLabels,
|
|
12
|
+
owner: options.owner,
|
|
13
|
+
repository: options.repository
|
|
14
|
+
});
|
|
10
15
|
}
|
|
11
16
|
export {
|
|
12
17
|
initializeGitHubRepository
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/steps/initializeGitHubRepository/index.ts"],"sourcesContent":["import { Octokit } from \"octokit\";\n\nimport { Options } from \"../../shared/types.js\";\nimport { initializeGitRemote } from \"../initializeGitRemote.js\";\nimport { initializeRepositorySettings } from \"../initializeRepositorySettings.js\";\nimport { initializeBranchProtectionSettings } from \"./initializeBranchProtectionSettings.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/steps/initializeGitHubRepository/index.ts"],"sourcesContent":["import { Octokit } from \"octokit\";\nimport { setGitHubRepositoryLabels } from \"set-github-repository-labels\";\n\nimport { Options } from \"../../shared/types.js\";\nimport { initializeGitRemote } from \"../initializeGitRemote.js\";\nimport { initializeRepositorySettings } from \"../initializeRepositorySettings.js\";\nimport { initializeBranchProtectionSettings } from \"./initializeBranchProtectionSettings.js\";\nimport { outcomeLabels } from \"./outcomeLabels.js\";\n\nexport async function initializeGitHubRepository(\n\toctokit: Octokit,\n\toptions: Options,\n) {\n\tawait initializeGitRemote(options);\n\tawait initializeRepositorySettings(octokit, options);\n\tawait initializeBranchProtectionSettings(octokit, options);\n\tawait setGitHubRepositoryLabels({\n\t\tlabels: outcomeLabels,\n\t\towner: options.owner,\n\t\trepository: options.repository,\n\t});\n}\n"],"mappings":"AACA,SAAS,iCAAiC;AAG1C,SAAS,2BAA2B;AACpC,SAAS,oCAAoC;AAC7C,SAAS,0CAA0C;AACnD,SAAS,qBAAqB;AAE9B,eAAsB,2BACrB,SACA,SACC;AACD,QAAM,oBAAoB,OAAO;AACjC,QAAM,6BAA6B,SAAS,OAAO;AACnD,QAAM,mCAAmC,SAAS,OAAO;AACzD,QAAM,0BAA0B;AAAA,IAC/B,QAAQ;AAAA,IACR,OAAO,QAAQ;AAAA,IACf,YAAY,QAAQ;AAAA,EACrB,CAAC;AACF;","names":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const outcomeLabels = [
|
|
2
2
|
{
|
|
3
|
+
aliases: ["docs"],
|
|
3
4
|
color: "0075ca",
|
|
4
5
|
description: "Improvements or additions to docs \u{1F4DD}",
|
|
5
6
|
name: "area: documentation"
|
|
@@ -25,6 +26,7 @@ const outcomeLabels = [
|
|
|
25
26
|
name: "invalid"
|
|
26
27
|
},
|
|
27
28
|
{
|
|
29
|
+
aliases: ["help wanted"],
|
|
28
30
|
color: "0E8A16",
|
|
29
31
|
description: "Please, send a pull request to resolve this! \u{1F64F}",
|
|
30
32
|
name: "status: accepting prs"
|
|
@@ -66,10 +68,11 @@ const outcomeLabels = [
|
|
|
66
68
|
},
|
|
67
69
|
{
|
|
68
70
|
color: "d73a4a",
|
|
69
|
-
description: "Something isn't working
|
|
71
|
+
description: "Something isn't working \u{1F41B}",
|
|
70
72
|
name: "type: bug"
|
|
71
73
|
},
|
|
72
74
|
{
|
|
75
|
+
aliases: ["enhancement"],
|
|
73
76
|
color: "a2eeef",
|
|
74
77
|
description: "New enhancement or request \u{1F680}",
|
|
75
78
|
name: "type: feature"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/steps/initializeGitHubRepository/outcomeLabels.ts"],"sourcesContent":["/* spellchecker: disable */\nexport const outcomeLabels = [\n\t{\n\t\taliases: [\"docs\"],\n\t\tcolor: \"0075ca\",\n\t\tdescription: \"Improvements or additions to docs 📝\",\n\t\tname: \"area: documentation\",\n\t},\n\t{\n\t\tcolor: \"1177aa\",\n\t\tdescription:\n\t\t\t\"Improving how the repository's tests are run and/or code is tested 🧪\",\n\t\tname: \"area: testing\",\n\t},\n\t{\n\t\tcolor: \"f9d0c4\",\n\t\tdescription: \"Managing the repository's maintenance 🛠️\",\n\t\tname: \"area: tooling\",\n\t},\n\t{\n\t\tcolor: \"5319E7\",\n\t\tdescription: \"Good for newcomers, please hop on! 🙌\",\n\t\tname: \"good first issue\",\n\t},\n\t{\n\t\tcolor: \"7a5901\",\n\t\tdescription: \"This doesn't seem right\",\n\t\tname: \"invalid\",\n\t},\n\t{\n\t\taliases: [\"help wanted\"],\n\t\tcolor: \"0E8A16\",\n\t\tdescription: \"Please, send a pull request to resolve this! 🙏\",\n\t\tname: \"status: accepting prs\",\n\t},\n\t{\n\t\tcolor: \"eeeeee\",\n\t\tdescription: \"Issue is stale and/or no longer valid\",\n\t\tname: \"status: aged away\",\n\t},\n\t{\n\t\tcolor: \"#ddcccc\",\n\t\tdescription: \"Waiting for something else to be resolved 🙅\",\n\t\tname: \"status: blocked\",\n\t},\n\t{\n\t\tcolor: \"cfd3d7\",\n\t\tdescription: \"This issue or pull request already exists\",\n\t\tname: \"status: duplicate\",\n\t},\n\t{\n\t\tcolor: \"#05104F\",\n\t\tdescription: \"Not yet ready for implementation or a pull request\",\n\t\tname: \"status: in discussion\",\n\t},\n\t{\n\t\tcolor: \"D3F82D\",\n\t\tdescription: \"Further research required...? 🔎\",\n\t\tname: \"status: needs investigation\",\n\t},\n\t{\n\t\tcolor: \"E4BC82\",\n\t\tdescription: \"Needs an action taken by the original poster\",\n\t\tname: \"status: waiting for author\",\n\t},\n\t{\n\t\tcolor: \"ffffff\",\n\t\tdescription: \"This will not be worked on\",\n\t\tname: \"status: wontfix\",\n\t},\n\t{\n\t\tcolor: \"d73a4a\",\n\t\tdescription: \"Something isn't working 🐛\",\n\t\tname: \"type: bug\",\n\t},\n\t{\n\t\taliases: [\"enhancement\"],\n\t\tcolor: \"a2eeef\",\n\t\tdescription: \"New enhancement or request 🚀\",\n\t\tname: \"type: feature\",\n\t},\n\t{\n\t\tcolor: \"d876e3\",\n\t\tdescription: \"Further information is requested\",\n\t\tname: \"type: question\",\n\t},\n\t{\n\t\tcolor: \"fde282\",\n\t\tdescription: \"Tech debt or other code/repository cleanups 🧹\",\n\t\tname: \"type: cleanup\",\n\t},\n];\n"],"mappings":"AACO,MAAM,gBAAgB;AAAA,EAC5B;AAAA,IACC,SAAS,CAAC,MAAM;AAAA,IAChB,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aACC;AAAA,IACD,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,SAAS,CAAC,aAAa;AAAA,IACvB,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,SAAS,CAAC,aAAa;AAAA,IACvB,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AACD;","names":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as fs from "node:fs/promises";
|
|
2
|
+
import { formatTypeScript } from "./writing/creation/formatters/formatTypeScript.js";
|
|
2
3
|
const globPaths = [
|
|
3
4
|
"./bin",
|
|
4
5
|
"./docs",
|
|
@@ -7,15 +8,20 @@ const globPaths = [
|
|
|
7
8
|
"./src/create",
|
|
8
9
|
"./src/initialize",
|
|
9
10
|
"./src/migrate",
|
|
11
|
+
"./src/next",
|
|
10
12
|
"./src/shared",
|
|
11
|
-
"./src/steps"
|
|
12
|
-
".github/workflows/test-initialize.yml",
|
|
13
|
-
".github/workflows/test-migrate.yml"
|
|
13
|
+
"./src/steps"
|
|
14
14
|
];
|
|
15
15
|
async function removeSetupScripts() {
|
|
16
16
|
for (const globPath of globPaths) {
|
|
17
17
|
await fs.rm(globPath, { force: true, recursive: true });
|
|
18
18
|
}
|
|
19
|
+
await fs.writeFile(
|
|
20
|
+
"./src/index.ts",
|
|
21
|
+
await formatTypeScript(
|
|
22
|
+
[`export * from "./greet.js";`, `export * from "./types.js";`].join("\n")
|
|
23
|
+
)
|
|
24
|
+
);
|
|
19
25
|
}
|
|
20
26
|
export {
|
|
21
27
|
removeSetupScripts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/removeSetupScripts.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nconst globPaths = [\n\t\"./bin\",\n\t\"./docs\",\n\t\"./script\",\n\t\"./src/bin\",\n\t\"./src/create\",\n\t\"./src/initialize\",\n\t\"./src/migrate\",\n\t\"./src/
|
|
1
|
+
{"version":3,"sources":["../../src/steps/removeSetupScripts.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nimport { formatTypeScript } from \"./writing/creation/formatters/formatTypeScript.js\";\n\nconst globPaths = [\n\t\"./bin\",\n\t\"./docs\",\n\t\"./script\",\n\t\"./src/bin\",\n\t\"./src/create\",\n\t\"./src/initialize\",\n\t\"./src/migrate\",\n\t\"./src/next\",\n\t\"./src/shared\",\n\t\"./src/steps\",\n];\n\nexport async function removeSetupScripts() {\n\tfor (const globPath of globPaths) {\n\t\tawait fs.rm(globPath, { force: true, recursive: true });\n\t}\n\n\tawait fs.writeFile(\n\t\t\"./src/index.ts\",\n\t\tawait formatTypeScript(\n\t\t\t[`export * from \"./greet.js\";`, `export * from \"./types.js\";`].join(\"\\n\"),\n\t\t),\n\t);\n}\n"],"mappings":"AAAA,YAAY,QAAQ;AAEpB,SAAS,wBAAwB;AAEjC,MAAM,YAAY;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,eAAsB,qBAAqB;AAC1C,aAAW,YAAY,WAAW;AACjC,UAAM,GAAG,GAAG,UAAU,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AAAA,EACvD;AAEA,QAAM,GAAG;AAAA,IACR;AAAA,IACA,MAAM;AAAA,MACL,CAAC,+BAA+B,6BAA6B,EAAE,KAAK,IAAI;AAAA,IACzE;AAAA,EACD;AACD;","names":[]}
|
|
@@ -5,20 +5,28 @@ async function uninstallPackages(offline) {
|
|
|
5
5
|
await removeDependencies(
|
|
6
6
|
[
|
|
7
7
|
"@clack/prompts",
|
|
8
|
-
"
|
|
8
|
+
"@prettier/sync",
|
|
9
|
+
"all-contributors-cli",
|
|
9
10
|
"chalk",
|
|
11
|
+
"create",
|
|
10
12
|
"execa",
|
|
11
|
-
"get-github-auth-token",
|
|
12
13
|
"git-remote-origin-url",
|
|
13
14
|
"git-url-parse",
|
|
14
|
-
"
|
|
15
|
+
"input-from-file",
|
|
16
|
+
"input-from-file-json",
|
|
15
17
|
"js-yaml",
|
|
18
|
+
"lazy-value",
|
|
16
19
|
"npm-user",
|
|
17
|
-
"parse-author",
|
|
18
|
-
"rimraf",
|
|
19
20
|
"octokit",
|
|
21
|
+
"octokit-from-auth",
|
|
22
|
+
"parse-author",
|
|
23
|
+
"parse-package-name",
|
|
24
|
+
"populate-all-contributors-for-repository",
|
|
20
25
|
"prettier",
|
|
21
26
|
"replace-in-file",
|
|
27
|
+
"rimraf",
|
|
28
|
+
"set-github-repository-labels",
|
|
29
|
+
"sort-package-json",
|
|
22
30
|
"title-case",
|
|
23
31
|
"zod",
|
|
24
32
|
"zod-validation-error"
|
|
@@ -33,6 +41,7 @@ async function uninstallPackages(offline) {
|
|
|
33
41
|
"@types/parse-author",
|
|
34
42
|
"all-contributors-cli",
|
|
35
43
|
"c8",
|
|
44
|
+
"create-testers",
|
|
36
45
|
"eslint-config-prettier",
|
|
37
46
|
"globby",
|
|
38
47
|
"tsx"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/uninstallPackages.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport { readPackageData, removeDependencies } from \"../shared/packages.js\";\n\nexport async function uninstallPackages(offline: boolean | undefined) {\n\tconst packageData = await readPackageData();\n\n\tawait removeDependencies(\n\t\t[\n\t\t\t\"@clack/prompts\",\n\t\t\t\"all-contributors-
|
|
1
|
+
{"version":3,"sources":["../../src/steps/uninstallPackages.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport { readPackageData, removeDependencies } from \"../shared/packages.js\";\n\nexport async function uninstallPackages(offline: boolean | undefined) {\n\tconst packageData = await readPackageData();\n\n\tawait removeDependencies(\n\t\t[\n\t\t\t\"@clack/prompts\",\n\t\t\t\"@prettier/sync\",\n\t\t\t\"all-contributors-cli\",\n\t\t\t\"chalk\",\n\t\t\t\"create\",\n\t\t\t\"execa\",\n\t\t\t\"git-remote-origin-url\",\n\t\t\t\"git-url-parse\",\n\t\t\t\"input-from-file\",\n\t\t\t\"input-from-file-json\",\n\t\t\t\"js-yaml\",\n\t\t\t\"lazy-value\",\n\t\t\t\"npm-user\",\n\t\t\t\"octokit\",\n\t\t\t\"octokit-from-auth\",\n\t\t\t\"parse-author\",\n\t\t\t\"parse-package-name\",\n\t\t\t\"populate-all-contributors-for-repository\",\n\t\t\t\"prettier\",\n\t\t\t\"replace-in-file\",\n\t\t\t\"rimraf\",\n\t\t\t\"set-github-repository-labels\",\n\t\t\t\"sort-package-json\",\n\t\t\t\"title-case\",\n\t\t\t\"zod\",\n\t\t\t\"zod-validation-error\",\n\t\t],\n\t\tpackageData.dependencies,\n\t);\n\n\tawait removeDependencies(\n\t\t[\n\t\t\t\"@octokit/request-error\",\n\t\t\t\"@types/git-url-parse\",\n\t\t\t\"@types/js-yaml\",\n\t\t\t\"@types/parse-author\",\n\t\t\t\"all-contributors-cli\",\n\t\t\t\"c8\",\n\t\t\t\"create-testers\",\n\t\t\t\"eslint-config-prettier\",\n\t\t\t\"globby\",\n\t\t\t\"tsx\",\n\t\t],\n\t\tpackageData.devDependencies,\n\t\t\"-D\",\n\t);\n\n\tawait $`pnpm add prettier -D${offline ? \" --offline\" : \"\"}`;\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAElB,SAAS,iBAAiB,0BAA0B;AAEpD,eAAsB,kBAAkB,SAA8B;AACrE,QAAM,cAAc,MAAM,gBAAgB;AAE1C,QAAM;AAAA,IACL;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA,YAAY;AAAA,EACb;AAEA,QAAM;AAAA,IACL;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,EACD;AAEA,QAAM,wBAAwB,UAAU,eAAe,EAAE;AAC1D;","names":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Options } from '../../../shared/types.js';
|
|
2
|
+
import 'zod';
|
|
3
|
+
import '../../../shared/codes.js';
|
|
4
|
+
|
|
5
|
+
declare function createCSpellConfig(options: Pick<Options, "excludeAllContributors" | "excludeLintMd" | "excludeReleases" | "excludeRenovate" | "excludeTemplatedBy" | "excludeTests">): Promise<string>;
|
|
6
|
+
|
|
7
|
+
export { createCSpellConfig };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { formatJson } from "./formatters/formatJson.js";
|
|
2
|
+
async function createCSpellConfig(options) {
|
|
3
|
+
const words = [
|
|
4
|
+
"tseslint",
|
|
5
|
+
!options.excludeReleases && "apexskier",
|
|
6
|
+
!options.excludeRenovate && "automerge",
|
|
7
|
+
!options.excludeLintMd && "markdownlintignore",
|
|
8
|
+
!options.excludeTemplatedBy && "joshuakgoldberg"
|
|
9
|
+
].filter(Boolean).sort();
|
|
10
|
+
return await formatJson({
|
|
11
|
+
dictionaries: ["npm", "node", "typescript"],
|
|
12
|
+
ignorePaths: [
|
|
13
|
+
...options.excludeAllContributors ? [] : [".all-contributorsrc"],
|
|
14
|
+
".github",
|
|
15
|
+
"CHANGELOG.md",
|
|
16
|
+
...options.excludeTests ? [] : ["coverage"],
|
|
17
|
+
"lib",
|
|
18
|
+
"node_modules",
|
|
19
|
+
"pnpm-lock.yaml"
|
|
20
|
+
],
|
|
21
|
+
words
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
createCSpellConfig
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=createCSpellConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/writing/creation/createCSpellConfig.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatJson } from \"./formatters/formatJson.js\";\n\nexport async function createCSpellConfig(\n\toptions: Pick<\n\t\tOptions,\n\t\t| \"excludeAllContributors\"\n\t\t| \"excludeLintMd\"\n\t\t| \"excludeReleases\"\n\t\t| \"excludeRenovate\"\n\t\t| \"excludeTemplatedBy\"\n\t\t| \"excludeTests\"\n\t>,\n) {\n\tconst words = [\n\t\t\"tseslint\",\n\t\t!options.excludeReleases && \"apexskier\",\n\t\t!options.excludeRenovate && \"automerge\",\n\t\t!options.excludeLintMd && \"markdownlintignore\",\n\t\t!options.excludeTemplatedBy && \"joshuakgoldberg\",\n\t]\n\t\t.filter(Boolean)\n\t\t.sort();\n\n\treturn await formatJson({\n\t\tdictionaries: [\"npm\", \"node\", \"typescript\"],\n\t\tignorePaths: [\n\t\t\t...(options.excludeAllContributors ? [] : [\".all-contributorsrc\"]),\n\t\t\t\".github\",\n\t\t\t\"CHANGELOG.md\",\n\t\t\t...(options.excludeTests ? [] : [\"coverage\"]),\n\t\t\t\"lib\",\n\t\t\t\"node_modules\",\n\t\t\t\"pnpm-lock.yaml\",\n\t\t],\n\t\twords,\n\t});\n}\n"],"mappings":"AACA,SAAS,kBAAkB;AAE3B,eAAsB,mBACrB,SASC;AACD,QAAM,QAAQ;AAAA,IACb;AAAA,IACA,CAAC,QAAQ,mBAAmB;AAAA,IAC5B,CAAC,QAAQ,mBAAmB;AAAA,IAC5B,CAAC,QAAQ,iBAAiB;AAAA,IAC1B,CAAC,QAAQ,sBAAsB;AAAA,EAChC,EACE,OAAO,OAAO,EACd,KAAK;AAEP,SAAO,MAAM,WAAW;AAAA,IACvB,cAAc,CAAC,OAAO,QAAQ,YAAY;AAAA,IAC1C,aAAa;AAAA,MACZ,GAAI,QAAQ,yBAAyB,CAAC,IAAI,CAAC,qBAAqB;AAAA,MAChE;AAAA,MACA;AAAA,MACA,GAAI,QAAQ,eAAe,CAAC,IAAI,CAAC,UAAU;AAAA,MAC3C;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,EACD,CAAC;AACF;","names":[]}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { formatIgnoreFile } from "./formatters/formatIgnoreFile.js";
|
|
2
2
|
function createDotGitignore(options) {
|
|
3
|
-
return formatIgnoreFile(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
return formatIgnoreFile(
|
|
4
|
+
[
|
|
5
|
+
...options.excludeTests ? [] : ["/coverage"],
|
|
6
|
+
"/lib",
|
|
7
|
+
"/node_modules"
|
|
8
|
+
].sort()
|
|
9
|
+
);
|
|
8
10
|
}
|
|
9
11
|
export {
|
|
10
12
|
createDotGitignore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/writing/creation/createDotGitignore.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatIgnoreFile } from \"./formatters/formatIgnoreFile.js\";\n\nexport function createDotGitignore(options: Pick<Options, \"excludeTests\">) {\n\treturn formatIgnoreFile([\n\t\t...(options.excludeTests ? [] : [\"/coverage\"]),\n\t\t\"/lib\",\n\t\t\"/node_modules\",\n\t]);\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AAE1B,SAAS,mBAAmB,SAAwC;AAC1E,SAAO,
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/writing/creation/createDotGitignore.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatIgnoreFile } from \"./formatters/formatIgnoreFile.js\";\n\nexport function createDotGitignore(options: Pick<Options, \"excludeTests\">) {\n\treturn formatIgnoreFile(\n\t\t[\n\t\t\t...(options.excludeTests ? [] : [\"/coverage\"]),\n\t\t\t\"/lib\",\n\t\t\t\"/node_modules\",\n\t\t].sort(),\n\t);\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AAE1B,SAAS,mBAAmB,SAAwC;AAC1E,SAAO;AAAA,IACN;AAAA,MACC,GAAI,QAAQ,eAAe,CAAC,IAAI,CAAC,WAAW;AAAA,MAC5C;AAAA,MACA;AAAA,IACD,EAAE,KAAK;AAAA,EACR;AACD;","names":[]}
|
|
@@ -79,9 +79,7 @@ export default tseslint.config(
|
|
|
79
79
|
{
|
|
80
80
|
extends: [vitest.configs.recommended],
|
|
81
81
|
files: ["**/*.test.*"],
|
|
82
|
-
rules: {
|
|
83
|
-
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
84
|
-
},
|
|
82
|
+
rules: { "@typescript-eslint/no-unsafe-assignment": "off" },
|
|
85
83
|
},`}${options.excludeLintYml ? "" : `
|
|
86
84
|
{
|
|
87
85
|
extends: [yml.configs["flat/recommended"], yml.configs["flat/prettier"]],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/writing/creation/createESLintConfig.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\n\nexport async function createESLintConfig(options: Options) {\n\tconst tseslintBase = options.excludeLintStrict ? \"recommended\" : \"strict\";\n\n\tconst imports = [\n\t\t!options.excludeLintESLint &&\n\t\t\t`import comments from \"@eslint-community/eslint-plugin-eslint-comments/configs\";`,\n\t\t`import eslint from \"@eslint/js\";`,\n\t\t!options.excludeTests && `import vitest from \"@vitest/eslint-plugin\";`,\n\t\t!options.excludeLintJSDoc && `import jsdoc from \"eslint-plugin-jsdoc\";`,\n\t\t!options.excludeLintJson && `import jsonc from \"eslint-plugin-jsonc\";`,\n\t\t!options.excludeLintMd && `import markdown from \"eslint-plugin-markdown\";`,\n\t\t`import n from \"eslint-plugin-n\";`,\n\t\t!options.excludeLintPackageJson &&\n\t\t\t`import packageJson from \"eslint-plugin-package-json/configs/recommended\";`,\n\t\t!options.excludeLintPerfectionist &&\n\t\t\t`import perfectionist from \"eslint-plugin-perfectionist\";`,\n\t\t!options.excludeLintRegex &&\n\t\t\t`import * as regexp from \"eslint-plugin-regexp\";`,\n\t\t!options.excludeLintYml && `import yml from \"eslint-plugin-yml\";`,\n\t\t`import tseslint from \"typescript-eslint\";`,\n\t].filter(Boolean);\n\n\tconst elements = [\n\t\t`eslint.configs.recommended,`,\n\t\t!options.excludeLintESLint && `\tcomments.recommended,`,\n\t\t!options.excludeLintJSDoc &&\n\t\t\t`\tjsdoc.configs[\"flat/contents-typescript-error\"],\n\t\tjsdoc.configs[\"flat/logical-typescript-error\"],\n\t\tjsdoc.configs[\"flat/stylistic-typescript-error\"],`,\n\t\t!options.excludeLintJson && `\tjsonc.configs[\"flat/recommended-with-json\"],`,\n\t\t!options.excludeLintMd && `\tmarkdown.configs.recommended,`,\n\t\t`\tn.configs[\"flat/recommended\"],`,\n\t\t!options.excludeLintPackageJson && `\tpackageJson,`,\n\t\t!options.excludeLintPerfectionist &&\n\t\t\t`\tperfectionist.configs[\"recommended-natural\"],`,\n\t\t!options.excludeLintRegex && `\tregexp.configs[\"flat/recommended\"],`,\n\t].filter(Boolean);\n\n\tconst ignores = [\n\t\t...(options.excludeTests ? [] : [\"**/*.snap\", \"coverage\"]),\n\t\t\"lib\",\n\t\t\"node_modules\",\n\t\t\"pnpm-lock.yaml\",\n\t]\n\t\t.map((ignore) => JSON.stringify(ignore))\n\t\t.sort();\n\n\tconst rules =\n\t\t!options.excludeLintStylistic &&\n\t\t`{\n\t\t\t// Stylistic concerns that don't interfere with Prettier\n\t\t\t\"logical-assignment-operators\": [\n\t\t\t\t\"error\",\n\t\t\t\t\"always\",\n\t\t\t\t{ enforceForIfStatements: true },\n\t\t\t],\n\t\t\t\"no-useless-rename\": \"error\",\n\t\t\t\"object-shorthand\": \"error\",\n\t\t\t\"operator-assignment\": \"error\",\n\t\t}`;\n\n\treturn await formatTypeScript(`${imports.join(\"\\n\")}\n\nexport default tseslint.config(\n\t{ ignores: [${ignores.join(\", \")}], },\n\t{ linterOptions: { reportUnusedDisableDirectives: \"error\" } },\n\t${elements.join(\"\\n\")}\n\t{\n\t\textends: ${\n\t\t\toptions.excludeLintStylistic\n\t\t\t\t? `tseslint.configs.${tseslintBase}TypeChecked`\n\t\t\t\t: `[\n\t\t\ttseslint.configs.${tseslintBase}TypeChecked,\n\t\t\ttseslint.configs.stylisticTypeChecked,\n\t\t]`\n\t\t},\n\t\tfiles: [\"**/*.js\", \"**/*.ts\"],\n\t\tlanguageOptions: {\n\t\t\tparserOptions: {\n\t\t\t\tprojectService: { allowDefaultProject: [\"*.config.*s\"] },\n\t\t\t\ttsconfigRootDir: import.meta.dirname\n\t\t\t},\n\t\t},${\n\t\t\trules\n\t\t\t\t? `\n\t\trules: ${rules},`\n\t\t\t\t: \"\"\n\t\t}${\n\t\t\toptions.excludeLintPerfectionist\n\t\t\t\t? \"\"\n\t\t\t\t: `\n\t\tsettings: { perfectionist: { partitionByComment: true, type: \"natural\" } },`\n\t\t}\n\t},\n\t{\n\t\textends: [tseslint.configs.disableTypeChecked],\n\t\tfiles: [\"**/*.md/*.ts\"],\n\t\trules: {\n\t\t\t\"n/no-missing-import\": [\n\t\t\t\t\"error\",\n\t\t\t\t{ allowModules: [\"${options.repository}\"] },\n\t\t\t],\n\t\t},\n\t},${\n\t\toptions.excludeTests\n\t\t\t? \"\"\n\t\t\t: `\n\t{\n\t\textends: [vitest.configs.recommended],\n\t\tfiles: [\"**/*.test.*\"],\n\t\trules: {\
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/writing/creation/createESLintConfig.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\n\nexport async function createESLintConfig(options: Options) {\n\tconst tseslintBase = options.excludeLintStrict ? \"recommended\" : \"strict\";\n\n\tconst imports = [\n\t\t!options.excludeLintESLint &&\n\t\t\t`import comments from \"@eslint-community/eslint-plugin-eslint-comments/configs\";`,\n\t\t`import eslint from \"@eslint/js\";`,\n\t\t!options.excludeTests && `import vitest from \"@vitest/eslint-plugin\";`,\n\t\t!options.excludeLintJSDoc && `import jsdoc from \"eslint-plugin-jsdoc\";`,\n\t\t!options.excludeLintJson && `import jsonc from \"eslint-plugin-jsonc\";`,\n\t\t!options.excludeLintMd && `import markdown from \"eslint-plugin-markdown\";`,\n\t\t`import n from \"eslint-plugin-n\";`,\n\t\t!options.excludeLintPackageJson &&\n\t\t\t`import packageJson from \"eslint-plugin-package-json/configs/recommended\";`,\n\t\t!options.excludeLintPerfectionist &&\n\t\t\t`import perfectionist from \"eslint-plugin-perfectionist\";`,\n\t\t!options.excludeLintRegex &&\n\t\t\t`import * as regexp from \"eslint-plugin-regexp\";`,\n\t\t!options.excludeLintYml && `import yml from \"eslint-plugin-yml\";`,\n\t\t`import tseslint from \"typescript-eslint\";`,\n\t].filter(Boolean);\n\n\tconst elements = [\n\t\t`eslint.configs.recommended,`,\n\t\t!options.excludeLintESLint && `\tcomments.recommended,`,\n\t\t!options.excludeLintJSDoc &&\n\t\t\t`\tjsdoc.configs[\"flat/contents-typescript-error\"],\n\t\tjsdoc.configs[\"flat/logical-typescript-error\"],\n\t\tjsdoc.configs[\"flat/stylistic-typescript-error\"],`,\n\t\t!options.excludeLintJson && `\tjsonc.configs[\"flat/recommended-with-json\"],`,\n\t\t!options.excludeLintMd && `\tmarkdown.configs.recommended,`,\n\t\t`\tn.configs[\"flat/recommended\"],`,\n\t\t!options.excludeLintPackageJson && `\tpackageJson,`,\n\t\t!options.excludeLintPerfectionist &&\n\t\t\t`\tperfectionist.configs[\"recommended-natural\"],`,\n\t\t!options.excludeLintRegex && `\tregexp.configs[\"flat/recommended\"],`,\n\t].filter(Boolean);\n\n\tconst ignores = [\n\t\t...(options.excludeTests ? [] : [\"**/*.snap\", \"coverage\"]),\n\t\t\"lib\",\n\t\t\"node_modules\",\n\t\t\"pnpm-lock.yaml\",\n\t]\n\t\t.map((ignore) => JSON.stringify(ignore))\n\t\t.sort();\n\n\tconst rules =\n\t\t!options.excludeLintStylistic &&\n\t\t`{\n\t\t\t// Stylistic concerns that don't interfere with Prettier\n\t\t\t\"logical-assignment-operators\": [\n\t\t\t\t\"error\",\n\t\t\t\t\"always\",\n\t\t\t\t{ enforceForIfStatements: true },\n\t\t\t],\n\t\t\t\"no-useless-rename\": \"error\",\n\t\t\t\"object-shorthand\": \"error\",\n\t\t\t\"operator-assignment\": \"error\",\n\t\t}`;\n\n\treturn await formatTypeScript(`${imports.join(\"\\n\")}\n\nexport default tseslint.config(\n\t{ ignores: [${ignores.join(\", \")}], },\n\t{ linterOptions: { reportUnusedDisableDirectives: \"error\" } },\n\t${elements.join(\"\\n\")}\n\t{\n\t\textends: ${\n\t\t\toptions.excludeLintStylistic\n\t\t\t\t? `tseslint.configs.${tseslintBase}TypeChecked`\n\t\t\t\t: `[\n\t\t\ttseslint.configs.${tseslintBase}TypeChecked,\n\t\t\ttseslint.configs.stylisticTypeChecked,\n\t\t]`\n\t\t},\n\t\tfiles: [\"**/*.js\", \"**/*.ts\"],\n\t\tlanguageOptions: {\n\t\t\tparserOptions: {\n\t\t\t\tprojectService: { allowDefaultProject: [\"*.config.*s\"] },\n\t\t\t\ttsconfigRootDir: import.meta.dirname\n\t\t\t},\n\t\t},${\n\t\t\trules\n\t\t\t\t? `\n\t\trules: ${rules},`\n\t\t\t\t: \"\"\n\t\t}${\n\t\t\toptions.excludeLintPerfectionist\n\t\t\t\t? \"\"\n\t\t\t\t: `\n\t\tsettings: { perfectionist: { partitionByComment: true, type: \"natural\" } },`\n\t\t}\n\t},\n\t{\n\t\textends: [tseslint.configs.disableTypeChecked],\n\t\tfiles: [\"**/*.md/*.ts\"],\n\t\trules: {\n\t\t\t\"n/no-missing-import\": [\n\t\t\t\t\"error\",\n\t\t\t\t{ allowModules: [\"${options.repository}\"] },\n\t\t\t],\n\t\t},\n\t},${\n\t\toptions.excludeTests\n\t\t\t? \"\"\n\t\t\t: `\n\t{\n\t\textends: [vitest.configs.recommended],\n\t\tfiles: [\"**/*.test.*\"],\n\t\trules: { \"@typescript-eslint/no-unsafe-assignment\": \"off\" },\n\t},`\n\t}${\n\t\toptions.excludeLintYml\n\t\t\t? \"\"\n\t\t\t: `\n\t{\n\t\textends: [yml.configs[\"flat/recommended\"], yml.configs[\"flat/prettier\"]],\n\t\tfiles: [\"**/*.{yml,yaml}\"],\n\t\trules: {\n\t\t\t\"yml/file-extension\": [\"error\", { extension: \"yml\" }],\n\t\t\t\"yml/sort-keys\": [\n\t\t\t\t\"error\",\n\t\t\t\t{ order: { type: \"asc\" }, pathPattern: \"^.*$\" },\n\t\t\t],\n\t\t\t\"yml/sort-sequence-values\": [\n\t\t\t\t\"error\",\n\t\t\t\t{ order: { type: \"asc\" }, pathPattern: \"^.*$\" },\n\t\t\t],\n\t\t},\n\t},`\n\t}\n);\n`);\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AAEjC,eAAsB,mBAAmB,SAAkB;AAC1D,QAAM,eAAe,QAAQ,oBAAoB,gBAAg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AA;AAAA;AAAA;AAAA;AAAA,MAQC,QACG;AAAA,WACK,KAAK,MACV,EACJ,GACC,QAAQ,2BACL,KACA;AAAA,8EAEJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAQsB,QAAQ,UAAU;AAAA;AAAA;AAAA,KAIxC,QAAQ,eACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMJ,GACC,QAAQ,iBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgBJ;AAAA;AAAA,CAEA;AACD;","names":[]}
|
|
@@ -2,16 +2,16 @@ import { formatTypeScript } from "./formatters/formatTypeScript.js";
|
|
|
2
2
|
async function createTsupConfig(options) {
|
|
3
3
|
return await formatTypeScript(`import { defineConfig } from "tsup";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
bundle: false,
|
|
7
|
+
clean: true,
|
|
8
|
+
dts: true,
|
|
9
|
+
entry: ["src/**/*.ts"${options.excludeTests ? "" : `, "!src/**/*.test.*"`}],
|
|
10
|
+
format: "esm",
|
|
11
|
+
outDir: "lib",
|
|
12
|
+
sourcemap: true,
|
|
13
|
+
});
|
|
14
|
+
`);
|
|
15
15
|
}
|
|
16
16
|
export {
|
|
17
17
|
createTsupConfig
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/writing/creation/createTsupConfig.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\n\nexport async function createTsupConfig(options: Pick<Options, \"excludeTests\">) {\n\treturn await formatTypeScript(`import { defineConfig } from \"tsup\";\n\
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/writing/creation/createTsupConfig.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\n\nexport async function createTsupConfig(options: Pick<Options, \"excludeTests\">) {\n\treturn await formatTypeScript(`import { defineConfig } from \"tsup\";\n\nexport default defineConfig({\n\tbundle: false,\n\tclean: true,\n\tdts: true,\n\tentry: [\"src/**/*.ts\"${options.excludeTests ? \"\" : `, \"!src/**/*.test.*\"`}],\n\tformat: \"esm\",\n\toutDir: \"lib\",\n\tsourcemap: true,\n});\n`);\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AAEjC,eAAsB,iBAAiB,SAAwC;AAC9E,SAAO,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAMP,QAAQ,eAAe,KAAK,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA,CAKzE;AACD;","names":[]}
|