create-typescript-app 1.30.0 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -32
- package/lib/bin/index.js +8 -7
- package/lib/bin/index.js.map +1 -1
- package/lib/bin/promptForMode.d.ts +11 -0
- package/lib/bin/promptForMode.js +102 -0
- package/lib/bin/promptForMode.js.map +1 -0
- package/lib/create/createAndEnterGitDirectory.d.ts +3 -0
- package/lib/create/createAndEnterGitDirectory.js +19 -0
- package/lib/create/createAndEnterGitDirectory.js.map +1 -0
- package/lib/create/createRerunSuggestion.d.ts +1 -2
- package/lib/create/createRerunSuggestion.js +18 -5
- package/lib/create/createRerunSuggestion.js.map +1 -1
- package/lib/create/createWithOptions.d.ts +1 -0
- package/lib/create/createWithOptions.js +6 -9
- package/lib/create/createWithOptions.js.map +1 -1
- package/lib/create/index.d.ts +2 -3
- package/lib/create/index.js +16 -19
- package/lib/create/index.js.map +1 -1
- package/lib/initialize/index.d.ts +1 -2
- package/lib/initialize/index.js +7 -7
- package/lib/initialize/index.js.map +1 -1
- package/lib/initialize/initializeWithOptions.d.ts +1 -0
- package/lib/initialize/initializeWithOptions.js +4 -4
- package/lib/initialize/initializeWithOptions.js.map +1 -1
- package/lib/migrate/index.d.ts +1 -2
- package/lib/migrate/index.js +8 -5
- package/lib/migrate/index.js.map +1 -1
- package/lib/migrate/migrateWithOptions.d.ts +1 -0
- package/lib/migrate/migrateWithOptions.js +3 -3
- package/lib/migrate/migrateWithOptions.js.map +1 -1
- package/lib/shared/cli/outro.d.ts +4 -3
- package/lib/shared/cli/outro.js +2 -2
- package/lib/shared/cli/outro.js.map +1 -1
- package/lib/shared/generateNextSteps.d.ts +8 -0
- package/lib/shared/generateNextSteps.js +60 -0
- package/lib/shared/generateNextSteps.js.map +1 -0
- package/lib/shared/getGitHubUserAsAllContributor.d.ts +5 -1
- package/lib/shared/getGitHubUserAsAllContributor.js +11 -3
- package/lib/shared/getGitHubUserAsAllContributor.js.map +1 -1
- package/lib/shared/options/args.d.ts +44 -4
- package/lib/shared/options/args.js +15 -2
- package/lib/shared/options/args.js.map +1 -1
- package/lib/shared/options/augmentOptionsWithExcludes.d.ts +2 -0
- package/lib/shared/options/augmentOptionsWithExcludes.js +33 -3
- package/lib/shared/options/augmentOptionsWithExcludes.js.map +1 -1
- package/lib/shared/options/{readOptionDefaults → createOptionDefaults}/index.d.ts +10 -3
- package/lib/shared/options/{readOptionDefaults → createOptionDefaults}/index.js +14 -9
- package/lib/shared/options/createOptionDefaults/index.js.map +1 -0
- package/lib/shared/options/{readOptionDefaults → createOptionDefaults}/parsePackageAuthor.d.ts +2 -0
- package/lib/shared/options/createOptionDefaults/parsePackageAuthor.js.map +1 -0
- package/lib/shared/options/createOptionDefaults/readDefaultsFromReadme.js.map +1 -0
- package/lib/shared/options/detectEmailRedundancy.d.ts +8 -0
- package/lib/shared/options/detectEmailRedundancy.js +16 -0
- package/lib/shared/options/detectEmailRedundancy.js.map +1 -0
- package/lib/shared/options/ensureRepositoryExists.d.ts +3 -1
- package/lib/shared/options/ensureRepositoryExists.js +2 -1
- package/lib/shared/options/ensureRepositoryExists.js.map +1 -1
- package/lib/shared/options/getPrefillOrPromptedOption.d.ts +1 -1
- package/lib/shared/options/getPrefillOrPromptedOption.js +1 -4
- package/lib/shared/options/getPrefillOrPromptedOption.js.map +1 -1
- package/lib/shared/options/optionsSchema.d.ts +194 -0
- package/lib/shared/options/optionsSchema.js +57 -0
- package/lib/shared/options/optionsSchema.js.map +1 -0
- package/lib/shared/options/readOptions.d.ts +4 -3
- package/lib/shared/options/readOptions.js +46 -58
- package/lib/shared/options/readOptions.js.map +1 -1
- package/lib/shared/packages.d.ts +2 -0
- package/lib/shared/runOrRestore.d.ts +1 -1
- package/lib/shared/types.d.ts +49 -7
- package/lib/steps/addOwnerAsAllContributor.d.ts +5 -1
- package/lib/steps/addOwnerAsAllContributor.js +8 -3
- package/lib/steps/addOwnerAsAllContributor.js.map +1 -1
- package/lib/steps/addToolAllContributors.d.ts +5 -1
- package/lib/steps/addToolAllContributors.js +2 -2
- package/lib/steps/addToolAllContributors.js.map +1 -1
- package/lib/steps/detectExistingContributors.d.ts +2 -0
- package/lib/steps/finalizeDependencies.d.ts +2 -0
- package/lib/steps/finalizeDependencies.js +8 -6
- package/lib/steps/finalizeDependencies.js.map +1 -1
- package/lib/steps/initializeGitHubRepository/index.d.ts +2 -0
- package/lib/steps/initializeGitHubRepository/initializeBranchProtectionSettings.d.ts +2 -0
- package/lib/steps/initializeGitHubRepository/labels/outcomeLabels.js +5 -0
- package/lib/steps/initializeGitHubRepository/labels/outcomeLabels.js.map +1 -1
- package/lib/steps/initializeGitRemote.d.ts +2 -0
- package/lib/steps/initializeRepositorySettings.d.ts +2 -0
- package/lib/steps/uninstallPackages.d.ts +1 -1
- package/lib/steps/uninstallPackages.js +3 -2
- package/lib/steps/uninstallPackages.js.map +1 -1
- package/lib/steps/updateAllContributorsTable.d.ts +2 -0
- package/lib/steps/updateLocalFiles.d.ts +1 -2
- package/lib/steps/updateLocalFiles.js +4 -7
- package/lib/steps/updateLocalFiles.js.map +1 -1
- package/lib/steps/writeReadme/findIntroSectionClose.js +1 -1
- package/lib/steps/writeReadme/findIntroSectionClose.js.map +1 -1
- package/lib/steps/writeReadme/generateTopContent.d.ts +2 -0
- package/lib/steps/writeReadme/generateTopContent.js +17 -2
- package/lib/steps/writeReadme/generateTopContent.js.map +1 -1
- package/lib/steps/writeReadme/index.d.ts +2 -0
- package/lib/steps/writeReadme/index.js +1 -1
- package/lib/steps/writeReadme/index.js.map +1 -1
- package/lib/steps/writing/creation/createESLintRC.d.ts +2 -0
- package/lib/steps/writing/creation/createESLintRC.js +35 -42
- package/lib/steps/writing/creation/createESLintRC.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/createDevelopment.d.ts +2 -0
- package/lib/steps/writing/creation/dotGitHub/createDevelopment.js +1 -1
- package/lib/steps/writing/creation/dotGitHub/createDevelopment.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.d.ts +2 -0
- package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.js +9 -9
- package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/createWorkflowFile.d.ts +1 -1
- package/lib/steps/writing/creation/dotGitHub/createWorkflowFile.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/{workflows.d.ts → createWorkflows.d.ts} +2 -0
- package/lib/steps/writing/creation/dotGitHub/{workflows.js → createWorkflows.js} +11 -89
- package/lib/steps/writing/creation/dotGitHub/createWorkflows.js.map +1 -0
- package/lib/steps/writing/creation/dotGitHub/index.d.ts +2 -0
- package/lib/steps/writing/creation/dotGitHub/index.js +1 -1
- package/lib/steps/writing/creation/dotGitHub/index.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/issueTemplate.d.ts +2 -0
- package/lib/steps/writing/creation/dotVSCode.d.ts +2 -0
- package/lib/steps/writing/creation/index.d.ts +1 -2
- package/lib/steps/writing/creation/index.js +2 -2
- package/lib/steps/writing/creation/index.js.map +1 -1
- package/lib/steps/writing/creation/rootFiles.d.ts +2 -0
- package/lib/steps/writing/creation/rootFiles.js +4 -3
- package/lib/steps/writing/creation/rootFiles.js.map +1 -1
- package/lib/steps/writing/creation/src.d.ts +2 -0
- package/lib/steps/writing/creation/writeAllContributorsRC.d.ts +2 -0
- package/lib/steps/writing/creation/writeAllContributorsRC.js +1 -1
- package/lib/steps/writing/creation/writeAllContributorsRC.js.map +1 -1
- package/lib/steps/writing/creation/writePackageJson.d.ts +2 -0
- package/lib/steps/writing/creation/writePackageJson.js +3 -3
- package/lib/steps/writing/creation/writePackageJson.js.map +1 -1
- package/lib/steps/writing/writeStructure.d.ts +1 -2
- package/lib/steps/writing/writeStructure.js +2 -2
- package/lib/steps/writing/writeStructure.js.map +1 -1
- package/package.json +5 -8
- package/lib/bin/mode.d.ts +0 -14
- package/lib/bin/mode.js +0 -50
- package/lib/bin/mode.js.map +0 -1
- package/lib/create/createAndEnterRepository.d.ts +0 -3
- package/lib/create/createAndEnterRepository.js +0 -15
- package/lib/create/createAndEnterRepository.js.map +0 -1
- package/lib/shared/options/readOptionDefaults/index.js.map +0 -1
- package/lib/shared/options/readOptionDefaults/parsePackageAuthor.js.map +0 -1
- package/lib/shared/options/readOptionDefaults/readDefaultsFromReadme.js.map +0 -1
- package/lib/steps/writing/creation/dotGitHub/workflows.js.map +0 -1
- /package/lib/shared/options/{readOptionDefaults → createOptionDefaults}/parsePackageAuthor.js +0 -0
- /package/lib/shared/options/{readOptionDefaults → createOptionDefaults}/readDefaultsFromReadme.d.ts +0 -0
- /package/lib/shared/options/{readOptionDefaults → createOptionDefaults}/readDefaultsFromReadme.js +0 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Octokit } from 'octokit';
|
|
2
2
|
import { Options } from '../../shared/types.js';
|
|
3
|
+
import 'zod';
|
|
4
|
+
import '../../shared/codes.js';
|
|
3
5
|
|
|
4
6
|
declare function initializeBranchProtectionSettings(octokit: Octokit, { owner, repository }: Pick<Options, "owner" | "repository">): Promise<false | undefined>;
|
|
5
7
|
|
|
@@ -29,6 +29,11 @@ const outcomeLabels = [
|
|
|
29
29
|
description: "Please, send a pull request to resolve this!",
|
|
30
30
|
name: "status: accepting prs"
|
|
31
31
|
},
|
|
32
|
+
{
|
|
33
|
+
color: "eeeeee",
|
|
34
|
+
description: "Issue is stale and/or no longer valid",
|
|
35
|
+
name: "status: aged away"
|
|
36
|
+
},
|
|
32
37
|
{
|
|
33
38
|
color: "#ddcccc",
|
|
34
39
|
description: "Waiting for something else to be resolved",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/initializeGitHubRepository/labels/outcomeLabels.ts"],"sourcesContent":["/* spellchecker: disable */\nexport const outcomeLabels = [\n\t{\n\t\tcolor: \"0075ca\",\n\t\tdescription: \"Improvements or additions to docs\",\n\t\tname: \"area: documentation\",\n\t},\n\t{\n\t\tcolor: \"6009D7\",\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\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: \"#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\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,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,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,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
|
+
{"version":3,"sources":["../../../../src/steps/initializeGitHubRepository/labels/outcomeLabels.ts"],"sourcesContent":["/* spellchecker: disable */\nexport const outcomeLabels = [\n\t{\n\t\tcolor: \"0075ca\",\n\t\tdescription: \"Improvements or additions to docs\",\n\t\tname: \"area: documentation\",\n\t},\n\t{\n\t\tcolor: \"6009D7\",\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\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\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,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,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,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,6 @@
|
|
|
1
1
|
import { Options } from '../shared/types.js';
|
|
2
|
+
import 'zod';
|
|
3
|
+
import '../shared/codes.js';
|
|
2
4
|
|
|
3
5
|
type InitializeRepositorySettings = Pick<Options, "owner" | "repository">;
|
|
4
6
|
declare function initializeGitRemote({ owner, repository, }: InitializeRepositorySettings): Promise<void>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Octokit } from 'octokit';
|
|
2
2
|
import { Options } from '../shared/types.js';
|
|
3
|
+
import 'zod';
|
|
4
|
+
import '../shared/codes.js';
|
|
3
5
|
|
|
4
6
|
type InitializeRepositorySettings = Pick<Options, "description" | "owner" | "repository">;
|
|
5
7
|
declare function initializeRepositorySettings(octokit: Octokit, { description, owner, repository }: InitializeRepositorySettings): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { $ } from "execa";
|
|
2
2
|
import { readPackageData, removeDependencies } from "../shared/packages.js";
|
|
3
|
-
async function uninstallPackages() {
|
|
3
|
+
async function uninstallPackages(offline) {
|
|
4
4
|
const packageData = await readPackageData();
|
|
5
5
|
await removeDependencies(
|
|
6
6
|
[
|
|
@@ -30,13 +30,14 @@ async function uninstallPackages() {
|
|
|
30
30
|
"@types/prettier",
|
|
31
31
|
"all-contributors-cli",
|
|
32
32
|
"c8",
|
|
33
|
+
"eslint-config-prettier",
|
|
33
34
|
"globby",
|
|
34
35
|
"tsx"
|
|
35
36
|
],
|
|
36
37
|
packageData.devDependencies,
|
|
37
38
|
"-D"
|
|
38
39
|
);
|
|
39
|
-
await $`pnpm add prettier -D`;
|
|
40
|
+
await $`pnpm add prettier -D${offline ? " --offline" : ""}`;
|
|
40
41
|
}
|
|
41
42
|
export {
|
|
42
43
|
uninstallPackages
|
|
@@ -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() {\n\tconst packageData = await readPackageData();\n\n\tawait removeDependencies(\n\t\t[\n\t\t\t\"@clack/prompts\",\n\t\t\t\"all-contributors-for-repository\",\n\t\t\t\"chalk\",\n\t\t\t\"execa\",\n\t\t\t\"git-remote-origin-url\",\n\t\t\t\"git-url-parse\",\n\t\t\t\"lazy-value\",\n\t\t\t\"js-yaml\",\n\t\t\t\"npm-user\",\n\t\t\t\"octokit\",\n\t\t\t\"prettier\",\n\t\t\t\"replace-in-file\",\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/prettier\",\n\t\t\t\"all-contributors-cli\",\n\t\t\t\"c8\",\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`;\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAElB,SAAS,iBAAiB,0BAA0B;AAEpD,eAAsB,
|
|
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-for-repository\",\n\t\t\t\"chalk\",\n\t\t\t\"execa\",\n\t\t\t\"git-remote-origin-url\",\n\t\t\t\"git-url-parse\",\n\t\t\t\"lazy-value\",\n\t\t\t\"js-yaml\",\n\t\t\t\"npm-user\",\n\t\t\t\"octokit\",\n\t\t\t\"prettier\",\n\t\t\t\"replace-in-file\",\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/prettier\",\n\t\t\t\"all-contributors-cli\",\n\t\t\t\"c8\",\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,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,IACD;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,EACD;AAEA,QAAM,wBAAwB,UAAU,eAAe,EAAE;AAC1D;","names":[]}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Mode } from '../bin/mode.js';
|
|
2
1
|
import { Options } from '../shared/types.js';
|
|
3
2
|
import 'zod';
|
|
4
3
|
import '../shared/codes.js';
|
|
5
4
|
|
|
6
|
-
declare function updateLocalFiles(options: Options
|
|
5
|
+
declare function updateLocalFiles(options: Options): Promise<void>;
|
|
7
6
|
|
|
8
7
|
export { updateLocalFiles };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import replaceInFile from "replace-in-file";
|
|
2
2
|
import { readFileSafeAsJson } from "../shared/readFileSafeAsJson.js";
|
|
3
|
-
async function updateLocalFiles(options
|
|
3
|
+
async function updateLocalFiles(options) {
|
|
4
4
|
const existingPackage = await readFileSafeAsJson("./package.json") ?? {};
|
|
5
5
|
const replacements = [
|
|
6
6
|
[/Create TypeScript App/g, options.title],
|
|
@@ -8,7 +8,7 @@ async function updateLocalFiles(options, mode) {
|
|
|
8
8
|
[/create-typescript-app/g, options.repository],
|
|
9
9
|
[/\/\*\n.+\*\/\n\n/gs, ``, ".eslintrc.cjs"],
|
|
10
10
|
[/"author": ".+"/g, `"author": "${options.author}"`, "./package.json"],
|
|
11
|
-
...mode === "migrate" ? [] : [[/"bin": ".+\n/g, ``, "./package.json"]],
|
|
11
|
+
...options.mode === "migrate" ? [] : [[/"bin": ".+\n/g, ``, "./package.json"]],
|
|
12
12
|
[/"test:create": ".+\n/g, ``, "./package.json"],
|
|
13
13
|
[/"test:initialize": ".*/g, ``, "./package.json"],
|
|
14
14
|
[/"initialize": ".*/g, ``, "./package.json"],
|
|
@@ -33,12 +33,9 @@ async function updateLocalFiles(options, mode) {
|
|
|
33
33
|
]
|
|
34
34
|
];
|
|
35
35
|
if (existingPackage.description) {
|
|
36
|
-
replacements.push([
|
|
37
|
-
new RegExp(existingPackage.description, "g"),
|
|
38
|
-
options.description
|
|
39
|
-
]);
|
|
36
|
+
replacements.push([existingPackage.description, options.description]);
|
|
40
37
|
}
|
|
41
|
-
if (mode === "initialize" && existingPackage.version) {
|
|
38
|
+
if (options.mode === "initialize" && existingPackage.version) {
|
|
42
39
|
replacements.push([
|
|
43
40
|
new RegExp(`"version": "${existingPackage.version}"`, "g"),
|
|
44
41
|
`"version": "0.0.0"`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/updateLocalFiles.ts"],"sourcesContent":["import replaceInFile from \"replace-in-file\";\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/steps/updateLocalFiles.ts"],"sourcesContent":["import replaceInFile from \"replace-in-file\";\n\nimport { readFileSafeAsJson } from \"../shared/readFileSafeAsJson.js\";\nimport { Options } from \"../shared/types.js\";\n\ninterface ExistingPackageData {\n\tdescription?: string;\n\tversion?: string;\n}\n\nexport async function updateLocalFiles(options: Options) {\n\tconst existingPackage = ((await readFileSafeAsJson(\"./package.json\")) ??\n\t\t{}) as ExistingPackageData;\n\n\tconst replacements = [\n\t\t[/Create TypeScript App/g, options.title],\n\t\t[/JoshuaKGoldberg(?!\\/console-fail-test)/g, options.owner],\n\t\t[/create-typescript-app/g, options.repository],\n\t\t[/\\/\\*\\n.+\\*\\/\\n\\n/gs, ``, \".eslintrc.cjs\"],\n\t\t[/\"author\": \".+\"/g, `\"author\": \"${options.author}\"`, \"./package.json\"],\n\t\t...(options.mode === \"migrate\"\n\t\t\t? []\n\t\t\t: [[/\"bin\": \".+\\n/g, ``, \"./package.json\"]]),\n\t\t[/\"test:create\": \".+\\n/g, ``, \"./package.json\"],\n\t\t[/\"test:initialize\": \".*/g, ``, \"./package.json\"],\n\t\t[/\"initialize\": \".*/g, ``, \"./package.json\"],\n\t\t[/\"test:migrate\": \".+\\n/g, ``, \"./package.json\"],\n\t\t[/## Getting Started.*## Development/gs, `## Development`, \"./README.md\"],\n\t\t[/\\n## Setup Scripts.*$/gs, \"\", \"./.github/DEVELOPMENT.md\"],\n\t\t[`\\t\\t\"src/initialize/index.ts\",\\n`, ``, \"./knip.jsonc\"],\n\t\t[`\\t\\t\"src/migrate/index.ts\",\\n`, ``, \"./knip.jsonc\"],\n\t\t[\n\t\t\t`[\"src/index.ts!\", \"script/initialize*.js\"]`,\n\t\t\t`\"src/index.ts!\"`,\n\t\t\t\"./knip.jsonc\",\n\t\t],\n\t\t[`[\"src/**/*.ts!\", \"script/**/*.js\"]`, `\"src/**/*.ts!\"`, \"./knip.jsonc\"],\n\t\t// Edge case: migration scripts will rewrite README.md attribution\n\t\t[\n\t\t\t`> 💙 This package is based on [@${options.owner}](https://github.com/${options.owner})'s [${options.repository}](https://github.com/JoshuaKGoldberg/${options.repository}).`,\n\t\t\t`> 💙 This package is based on [@JoshuaKGoldberg](https://github.com/JoshuaKGoldberg)'s [create-typescript-app](https://github.com/JoshuaKGoldberg/create-typescript-app).`,\n\t\t\t\"./README.md\",\n\t\t],\n\t];\n\n\tif (existingPackage.description) {\n\t\treplacements.push([existingPackage.description, options.description]);\n\t}\n\n\tif (options.mode === \"initialize\" && existingPackage.version) {\n\t\treplacements.push([\n\t\t\tnew RegExp(`\"version\": \"${existingPackage.version}\"`, \"g\"),\n\t\t\t`\"version\": \"0.0.0\"`,\n\t\t\t\"./package.json\",\n\t\t]);\n\t}\n\n\tfor (const [from, to, files = [\"./.github/**/*\", \"./*.*\"]] of replacements) {\n\t\ttry {\n\t\t\t// @ts-expect-error -- https://github.com/microsoft/TypeScript/issues/54342\n\t\t\tawait replaceInFile({ files, from, to });\n\t\t} catch (error) {\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to replace ${from.toString()} with ${to} in ${files.toString()}`,\n\t\t\t\t{\n\t\t\t\t\tcause: error,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n}\n"],"mappings":"AAAA,OAAO,mBAAmB;AAE1B,SAAS,0BAA0B;AAQnC,eAAsB,iBAAiB,SAAkB;AACxD,QAAM,kBAAoB,MAAM,mBAAmB,gBAAgB,KAClE,CAAC;AAEF,QAAM,eAAe;AAAA,IACpB,CAAC,0BAA0B,QAAQ,KAAK;AAAA,IACxC,CAAC,2CAA2C,QAAQ,KAAK;AAAA,IACzD,CAAC,0BAA0B,QAAQ,UAAU;AAAA,IAC7C,CAAC,sBAAsB,IAAI,eAAe;AAAA,IAC1C,CAAC,mBAAmB,cAAc,QAAQ,MAAM,KAAK,gBAAgB;AAAA,IACrE,GAAI,QAAQ,SAAS,YAClB,CAAC,IACD,CAAC,CAAC,iBAAiB,IAAI,gBAAgB,CAAC;AAAA,IAC3C,CAAC,yBAAyB,IAAI,gBAAgB;AAAA,IAC9C,CAAC,2BAA2B,IAAI,gBAAgB;AAAA,IAChD,CAAC,sBAAsB,IAAI,gBAAgB;AAAA,IAC3C,CAAC,0BAA0B,IAAI,gBAAgB;AAAA,IAC/C,CAAC,wCAAwC,kBAAkB,aAAa;AAAA,IACxE,CAAC,2BAA2B,IAAI,0BAA0B;AAAA,IAC1D,CAAC;AAAA,GAAoC,IAAI,cAAc;AAAA,IACvD,CAAC;AAAA,GAAiC,IAAI,cAAc;AAAA,IACpD;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA,CAAC,sCAAsC,kBAAkB,cAAc;AAAA;AAAA,IAEvE;AAAA,MACC,0CAAmC,QAAQ,KAAK,wBAAwB,QAAQ,KAAK,QAAQ,QAAQ,UAAU,wCAAwC,QAAQ,UAAU;AAAA,MACzK;AAAA,MACA;AAAA,IACD;AAAA,EACD;AAEA,MAAI,gBAAgB,aAAa;AAChC,iBAAa,KAAK,CAAC,gBAAgB,aAAa,QAAQ,WAAW,CAAC;AAAA,EACrE;AAEA,MAAI,QAAQ,SAAS,gBAAgB,gBAAgB,SAAS;AAC7D,iBAAa,KAAK;AAAA,MACjB,IAAI,OAAO,eAAe,gBAAgB,OAAO,KAAK,GAAG;AAAA,MACzD;AAAA,MACA;AAAA,IACD,CAAC;AAAA,EACF;AAEA,aAAW,CAAC,MAAM,IAAI,QAAQ,CAAC,kBAAkB,OAAO,CAAC,KAAK,cAAc;AAC3E,QAAI;AAEH,YAAM,cAAc,EAAE,OAAO,MAAM,GAAG,CAAC;AAAA,IACxC,SAAS,OAAO;AACf,YAAM,IAAI;AAAA,QACT,qBAAqB,KAAK,SAAS,CAAC,SAAS,EAAE,OAAO,MAAM,SAAS,CAAC;AAAA,QACtE;AAAA,UACC,OAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/steps/writeReadme/findIntroSectionClose.ts"],"sourcesContent":["import { existingBadgeMatcherCreators } from \"./findExistingBadges.js\";\n\nexport function findIntroSectionClose(contents: string) {\n\t// Highest priority match: an h2, presumably following badges\n\tconst indexOfH2OrCodeBlock = contents.search(/## |<\\s*h2|```/);\n\n\tif (indexOfH2OrCodeBlock !== -1) {\n\t\treturn indexOfH2OrCodeBlock - 2;\n\t}\n\n\t// Failing that, if any badges are found, go after the last of them\n\tfor (const createMatcher of existingBadgeMatcherCreators) {\n\t\tconst lastMatch = [...contents.matchAll(createMatcher())].at(-1);\n\n\t\tif (lastMatch?.index) {\n\t\t\treturn lastMatch.index + lastMatch[0].length + 2;\n\t\t}\n\t}\n\n\t// Lastly, go for the second line altogether\n\treturn contents.indexOf(\"\\n\",
|
|
1
|
+
{"version":3,"sources":["../../../src/steps/writeReadme/findIntroSectionClose.ts"],"sourcesContent":["import { existingBadgeMatcherCreators } from \"./findExistingBadges.js\";\n\nexport function findIntroSectionClose(contents: string) {\n\t// Highest priority match: an h2, presumably following badges\n\tconst indexOfH2OrCodeBlock = contents.search(/## |<\\s*h2|```/);\n\n\tif (indexOfH2OrCodeBlock !== -1) {\n\t\treturn indexOfH2OrCodeBlock - 2;\n\t}\n\n\t// Failing that, if any badges are found, go after the last of them\n\tfor (const createMatcher of existingBadgeMatcherCreators) {\n\t\tconst lastMatch = [...contents.matchAll(createMatcher())].at(-1);\n\n\t\tif (lastMatch?.index) {\n\t\t\treturn lastMatch.index + lastMatch[0].length + 2;\n\t\t}\n\t}\n\n\t// Lastly, go for the second line altogether\n\treturn contents.indexOf(\"\\n\", 1) + 1;\n}\n"],"mappings":"AAAA,SAAS,oCAAoC;AAEtC,SAAS,sBAAsB,UAAkB;AAEvD,QAAM,uBAAuB,SAAS,OAAO,gBAAgB;AAE7D,MAAI,yBAAyB,IAAI;AAChC,WAAO,uBAAuB;AAAA,EAC/B;AAGA,aAAW,iBAAiB,8BAA8B;AACzD,UAAM,YAAY,CAAC,GAAG,SAAS,SAAS,cAAc,CAAC,CAAC,EAAE,GAAG,EAAE;AAE/D,QAAI,WAAW,OAAO;AACrB,aAAO,UAAU,QAAQ,UAAU,CAAC,EAAE,SAAS;AAAA,IAChD;AAAA,EACD;AAGA,SAAO,SAAS,QAAQ,MAAM,CAAC,IAAI;AACpC;","names":[]}
|
|
@@ -14,7 +14,7 @@ function generateTopContent(options, existingBadges) {
|
|
|
14
14
|
}
|
|
15
15
|
for (const [badgeLine, existingMatcher] of [
|
|
16
16
|
[
|
|
17
|
-
!options.
|
|
17
|
+
!options.excludeAllContributors && `<a href="#contributors" target="_blank">
|
|
18
18
|
<!-- prettier-ignore-start -->
|
|
19
19
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
20
20
|
<img alt="All Contributors: 2" src="https://img.shields.io/badge/all_contributors-17-21bb42.svg" />
|
|
@@ -54,6 +54,10 @@ function generateTopContent(options, existingBadges) {
|
|
|
54
54
|
[
|
|
55
55
|
`<img alt="TypeScript: Strict" src="https://img.shields.io/badge/typescript-strict-21bb42.svg" />`,
|
|
56
56
|
/typescript.*strict/i
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
`<img alt="npm package version" src="https://img.shields.io/npm/v/create-typescript-app?color=21bb42" />`,
|
|
60
|
+
/npm.*v/i
|
|
57
61
|
]
|
|
58
62
|
]) {
|
|
59
63
|
spliceBadge(badgeLine, existingMatcher);
|
|
@@ -64,7 +68,18 @@ function generateTopContent(options, existingBadges) {
|
|
|
64
68
|
|
|
65
69
|
<p align="center">
|
|
66
70
|
${[...badges, ...remainingExistingBadges].map((badge) => ` ${badge}`).join("\n")}
|
|
67
|
-
</p
|
|
71
|
+
</p>${options.mode === "migrate" ? "" : `
|
|
72
|
+
|
|
73
|
+
## Usage
|
|
74
|
+
|
|
75
|
+
\`\`\`shell
|
|
76
|
+
npm i ${options.repository}
|
|
77
|
+
\`\`\`
|
|
78
|
+
\`\`\`ts
|
|
79
|
+
import { greet } from "${options.repository}";
|
|
80
|
+
|
|
81
|
+
greet("Hello, world! \u{1F496}");
|
|
82
|
+
\`\`\``}`;
|
|
68
83
|
}
|
|
69
84
|
export {
|
|
70
85
|
generateTopContent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/steps/writeReadme/generateTopContent.ts"],"sourcesContent":["import { Options } from \"../../shared/types.js\";\n\nexport function generateTopContent(options: Options, existingBadges: string[]) {\n\tconst remainingExistingBadges = new Set(existingBadges);\n\tconst badges: string[] = [];\n\n\tfunction spliceBadge(\n\t\tbadgeLine: false | string | undefined,\n\t\texistingMatcher: RegExp,\n\t) {\n\t\tconst existingMatch = existingBadges.find((existingLine) =>\n\t\t\texistingMatcher.test(existingLine),\n\t\t);\n\n\t\tif (existingMatch) {\n\t\t\tremainingExistingBadges.delete(existingMatch);\n\t\t}\n\n\t\tif (badgeLine) {\n\t\t\tbadges.push(badgeLine);\n\t\t}\n\t}\n\n\tfor (const [badgeLine, existingMatcher] of [\n\t\t[\n\t\t\t!options.
|
|
1
|
+
{"version":3,"sources":["../../../src/steps/writeReadme/generateTopContent.ts"],"sourcesContent":["import { Options } from \"../../shared/types.js\";\n\nexport function generateTopContent(options: Options, existingBadges: string[]) {\n\tconst remainingExistingBadges = new Set(existingBadges);\n\tconst badges: string[] = [];\n\n\tfunction spliceBadge(\n\t\tbadgeLine: false | string | undefined,\n\t\texistingMatcher: RegExp,\n\t) {\n\t\tconst existingMatch = existingBadges.find((existingLine) =>\n\t\t\texistingMatcher.test(existingLine),\n\t\t);\n\n\t\tif (existingMatch) {\n\t\t\tremainingExistingBadges.delete(existingMatch);\n\t\t}\n\n\t\tif (badgeLine) {\n\t\t\tbadges.push(badgeLine);\n\t\t}\n\t}\n\n\tfor (const [badgeLine, existingMatcher] of [\n\t\t[\n\t\t\t!options.excludeAllContributors &&\n\t\t\t\t`<a href=\"#contributors\" target=\"_blank\">\n<!-- prettier-ignore-start -->\n<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->\n<img alt=\"All Contributors: 2\" src=\"https://img.shields.io/badge/all_contributors-17-21bb42.svg\" />\n<!-- ALL-CONTRIBUTORS-BADGE:END -->\n<!-- prettier-ignore-end -->\n</a>`,\n\t\t\t/ALL-CONTRIBUTORS-BADGE:START/,\n\t\t],\n\t\t[\n\t\t\t!options.excludeTests &&\n\t\t\t\t`<a href=\"https://codecov.io/gh/${options.owner}/${options.repository}\" target=\"_blank\">\n\t\t<img alt=\"Codecov Test Coverage\" src=\"https://codecov.io/gh/${options.owner}/${options.repository}/branch/main/graph/badge.svg\"/>\n\t</a>`,\n\t\t\t/https:\\/\\/codecov\\.io\\/gh/,\n\t\t],\n\t\t[\n\t\t\t`<a href=\"https://github.com/${options.owner}/${options.repository}/blob/main/.github/CODE_OF_CONDUCT.md\" target=\"_blank\">\n\t\t<img alt=\"Contributor Covenant\" src=\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\" />\n\t</a>`,\n\t\t\t/CODE_OF_CONDUCT\\.md/,\n\t\t],\n\t\t[\n\t\t\t`<a href=\"https://github.com/${options.owner}/${options.repository}/blob/main/LICENSE.md\" target=\"_blank\">\n\t\t<img alt=\"License: MIT\" src=\"https://img.shields.io/github/license/${options.owner}/${options.repository}?color=21bb42\">\n\t</a>`,\n\t\t\t/LICENSE\\.(md|txt)/,\n\t\t],\n\t\t[\n\t\t\toptions.funding &&\n\t\t\t\t`<a href=\"https://github.com/sponsors/${options.funding}\" target=\"_blank\">\n\t\t<img alt=\"Sponsor: On GitHub\" src=\"https://img.shields.io/badge/sponsor-on_github-21bb42.svg\" />\n\t</a>`,\n\t\t\t/github.+sponsors/,\n\t\t],\n\t\t[\n\t\t\t`<img alt=\"Style: Prettier\" src=\"https://img.shields.io/badge/style-prettier-21bb42.svg\" />`,\n\t\t\t/style.*prettier/i,\n\t\t],\n\t\t[\n\t\t\t`<img alt=\"TypeScript: Strict\" src=\"https://img.shields.io/badge/typescript-strict-21bb42.svg\" />`,\n\t\t\t/typescript.*strict/i,\n\t\t],\n\t\t[\n\t\t\t`<img alt=\"npm package version\" src=\"https://img.shields.io/npm/v/create-typescript-app?color=21bb42\" />`,\n\t\t\t/npm.*v/i,\n\t\t],\n\t] as const) {\n\t\tspliceBadge(badgeLine, existingMatcher);\n\t}\n\n\treturn `<h1 align=\"center\">${options.title}</h1>\n\n<p align=\"center\">${options.description}</p>\n\n<p align=\"center\">\n${[...badges, ...remainingExistingBadges]\n\t.map((badge) => `\\t${badge}`)\n\t.join(\"\\n\")}\n</p>${\n\t\toptions.mode === \"migrate\"\n\t\t\t? \"\"\n\t\t\t: `\n\n## Usage\n\n\\`\\`\\`shell\nnpm i ${options.repository}\n\\`\\`\\`\n\\`\\`\\`ts\nimport { greet } from \"${options.repository}\";\n\ngreet(\"Hello, world! 💖\");\n\\`\\`\\``\n\t}`;\n}\n"],"mappings":"AAEO,SAAS,mBAAmB,SAAkB,gBAA0B;AAC9E,QAAM,0BAA0B,IAAI,IAAI,cAAc;AACtD,QAAM,SAAmB,CAAC;AAE1B,WAAS,YACR,WACA,iBACC;AACD,UAAM,gBAAgB,eAAe;AAAA,MAAK,CAAC,iBAC1C,gBAAgB,KAAK,YAAY;AAAA,IAClC;AAEA,QAAI,eAAe;AAClB,8BAAwB,OAAO,aAAa;AAAA,IAC7C;AAEA,QAAI,WAAW;AACd,aAAO,KAAK,SAAS;AAAA,IACtB;AAAA,EACD;AAEA,aAAW,CAAC,WAAW,eAAe,KAAK;AAAA,IAC1C;AAAA,MACC,CAAC,QAAQ,0BACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOD;AAAA,IACD;AAAA,IACA;AAAA,MACC,CAAC,QAAQ,gBACR,kCAAkC,QAAQ,KAAK,IAAI,QAAQ,UAAU;AAAA,gEACT,QAAQ,KAAK,IAAI,QAAQ,UAAU;AAAA;AAAA,MAEhG;AAAA,IACD;AAAA,IACA;AAAA,MACC,+BAA+B,QAAQ,KAAK,IAAI,QAAQ,UAAU;AAAA;AAAA;AAAA,MAGlE;AAAA,IACD;AAAA,IACA;AAAA,MACC,+BAA+B,QAAQ,KAAK,IAAI,QAAQ,UAAU;AAAA,uEACE,QAAQ,KAAK,IAAI,QAAQ,UAAU;AAAA;AAAA,MAEvG;AAAA,IACD;AAAA,IACA;AAAA,MACC,QAAQ,WACP,wCAAwC,QAAQ,OAAO;AAAA;AAAA;AAAA,MAGxD;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA;AAAA,IACD;AAAA,EACD,GAAY;AACX,gBAAY,WAAW,eAAe;AAAA,EACvC;AAEA,SAAO,sBAAsB,QAAQ,KAAK;AAAA;AAAA,oBAEvB,QAAQ,WAAW;AAAA;AAAA;AAAA,EAGrC,CAAC,GAAG,QAAQ,GAAG,uBAAuB,EACtC,IAAI,CAAC,UAAU,IAAK,KAAK,EAAE,EAC3B,KAAK,IAAI,CAAC;AAAA,MAEV,QAAQ,SAAS,YACd,KACA;AAAA;AAAA;AAAA;AAAA;AAAA,QAKG,QAAQ,UAAU;AAAA;AAAA;AAAA,yBAGD,QAAQ,UAAU;AAAA;AAAA;AAAA,OAI1C;AACD;","names":[]}
|
|
@@ -25,7 +25,7 @@ function generateAllContributorsContent(options) {
|
|
|
25
25
|
].filter(Boolean).join("\n");
|
|
26
26
|
}
|
|
27
27
|
async function writeReadme(options) {
|
|
28
|
-
const allContributorsContent = !options.
|
|
28
|
+
const allContributorsContent = !options.excludeAllContributors && generateAllContributorsContent(options);
|
|
29
29
|
let contents = await readFileSafe("README.md", "");
|
|
30
30
|
if (!contents) {
|
|
31
31
|
await fs.writeFile(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/steps/writeReadme/index.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\n\nimport { readFileSafe } from \"../../shared/readFileSafe.js\";\nimport { Options } from \"../../shared/types.js\";\nimport { endOfReadmeNotice } from \"../updateReadme.js\";\nimport { findExistingBadges } from \"./findExistingBadges.js\";\nimport { findIntroSectionClose } from \"./findIntroSectionClose.js\";\nimport { generateTopContent } from \"./generateTopContent.js\";\n\nconst contributorsIndicator = `<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->`;\n\nfunction generateAllContributorsContent(options: Options) {\n\treturn [\n\t\t`## Contributors`,\n\t\t``,\n\t\t`<!-- spellchecker: disable -->`,\n\t\tcontributorsIndicator,\n\t\t`<!-- prettier-ignore-start -->`,\n\t\t!options.excludeLintMd && `<!-- markdownlint-disable -->`,\n\t\t`<table>`,\n\t\t`<!-- (this will be filled in by all-contributors) -->`,\n\t\t`</table>`,\n\t\t``,\n\t\t!options.excludeLintMd && `<!-- markdownlint-restore -->`,\n\t\t`<!-- prettier-ignore-end -->`,\n\t\t``,\n\t\t`<!-- ALL-CONTRIBUTORS-LIST:END -->`,\n\t\t`<!-- spellchecker: enable -->`,\n\t]\n\t\t.filter(Boolean)\n\t\t.join(\"\\n\");\n}\n\nexport async function writeReadme(options: Options) {\n\tconst allContributorsContent =\n\t\t!options.
|
|
1
|
+
{"version":3,"sources":["../../../src/steps/writeReadme/index.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\n\nimport { readFileSafe } from \"../../shared/readFileSafe.js\";\nimport { Options } from \"../../shared/types.js\";\nimport { endOfReadmeNotice } from \"../updateReadme.js\";\nimport { findExistingBadges } from \"./findExistingBadges.js\";\nimport { findIntroSectionClose } from \"./findIntroSectionClose.js\";\nimport { generateTopContent } from \"./generateTopContent.js\";\n\nconst contributorsIndicator = `<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->`;\n\nfunction generateAllContributorsContent(options: Options) {\n\treturn [\n\t\t`## Contributors`,\n\t\t``,\n\t\t`<!-- spellchecker: disable -->`,\n\t\tcontributorsIndicator,\n\t\t`<!-- prettier-ignore-start -->`,\n\t\t!options.excludeLintMd && `<!-- markdownlint-disable -->`,\n\t\t`<table>`,\n\t\t`<!-- (this will be filled in by all-contributors) -->`,\n\t\t`</table>`,\n\t\t``,\n\t\t!options.excludeLintMd && `<!-- markdownlint-restore -->`,\n\t\t`<!-- prettier-ignore-end -->`,\n\t\t``,\n\t\t`<!-- ALL-CONTRIBUTORS-LIST:END -->`,\n\t\t`<!-- spellchecker: enable -->`,\n\t]\n\t\t.filter(Boolean)\n\t\t.join(\"\\n\");\n}\n\nexport async function writeReadme(options: Options) {\n\tconst allContributorsContent =\n\t\t!options.excludeAllContributors && generateAllContributorsContent(options);\n\tlet contents = await readFileSafe(\"README.md\", \"\");\n\tif (!contents) {\n\t\tawait fs.writeFile(\n\t\t\t\"README.md\",\n\t\t\t[\n\t\t\t\tgenerateTopContent(options, []),\n\t\t\t\tallContributorsContent,\n\t\t\t\tendOfReadmeNotice,\n\t\t\t]\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.join(\"\\n\\n\"),\n\t\t);\n\t\treturn;\n\t}\n\n\tconst endOfIntroSection = findIntroSectionClose(contents);\n\n\tcontents = [\n\t\tgenerateTopContent(options, findExistingBadges(contents)),\n\t\tcontents.slice(endOfIntroSection),\n\t]\n\t\t.join(\"\")\n\t\t.replace(/\\[!\\[.+\\]\\(.+\\)\\]\\(.+\\)/g, \"\")\n\t\t.replace(/!\\[.+\\]\\(.+\\)/g, \"\")\n\t\t.replaceAll(\"\\r\", \"\")\n\t\t.replaceAll(\"\\n\\n\\n\", \"\\n\\n\");\n\n\tif (allContributorsContent && !contents.includes(contributorsIndicator)) {\n\t\tcontents = [contents, allContributorsContent].join(\"\\n\\n\");\n\t}\n\n\tif (!contents.includes(endOfReadmeNotice)) {\n\t\tcontents = [contents, endOfReadmeNotice].join(\"\\n\\n\");\n\t}\n\n\tawait fs.writeFile(\"README.md\", contents);\n}\n"],"mappings":"AAAA,OAAO,QAAQ;AAEf,SAAS,oBAAoB;AAE7B,SAAS,yBAAyB;AAClC,SAAS,0BAA0B;AACnC,SAAS,6BAA6B;AACtC,SAAS,0BAA0B;AAEnC,MAAM,wBAAwB;AAE9B,SAAS,+BAA+B,SAAkB;AACzD,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,CAAC,QAAQ,iBAAiB;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,CAAC,QAAQ,iBAAiB;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,EACE,OAAO,OAAO,EACd,KAAK,IAAI;AACZ;AAEA,eAAsB,YAAY,SAAkB;AACnD,QAAM,yBACL,CAAC,QAAQ,0BAA0B,+BAA+B,OAAO;AAC1E,MAAI,WAAW,MAAM,aAAa,aAAa,EAAE;AACjD,MAAI,CAAC,UAAU;AACd,UAAM,GAAG;AAAA,MACR;AAAA,MACA;AAAA,QACC,mBAAmB,SAAS,CAAC,CAAC;AAAA,QAC9B;AAAA,QACA;AAAA,MACD,EACE,OAAO,OAAO,EACd,KAAK,MAAM;AAAA,IACd;AACA;AAAA,EACD;AAEA,QAAM,oBAAoB,sBAAsB,QAAQ;AAExD,aAAW;AAAA,IACV,mBAAmB,SAAS,mBAAmB,QAAQ,CAAC;AAAA,IACxD,SAAS,MAAM,iBAAiB;AAAA,EACjC,EACE,KAAK,EAAE,EACP,QAAQ,4BAA4B,EAAE,EACtC,QAAQ,kBAAkB,EAAE,EAC5B,WAAW,MAAM,EAAE,EACnB,WAAW,UAAU,MAAM;AAE7B,MAAI,0BAA0B,CAAC,SAAS,SAAS,qBAAqB,GAAG;AACxE,eAAW,CAAC,UAAU,sBAAsB,EAAE,KAAK,MAAM;AAAA,EAC1D;AAEA,MAAI,CAAC,SAAS,SAAS,iBAAiB,GAAG;AAC1C,eAAW,CAAC,UAAU,iBAAiB,EAAE,KAAK,MAAM;AAAA,EACrD;AAEA,QAAM,GAAG,UAAU,aAAa,QAAQ;AACzC;","names":[]}
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { formatTypeScript } from "./formatters/formatTypeScript.js";
|
|
2
2
|
async function createESLintRC(options) {
|
|
3
|
-
return await formatTypeScript(
|
|
4
|
-
\u{1F44B} Hi! This ESLint configuration contains a lot more stuff than many repos'!
|
|
5
|
-
You can read from it to see all sorts of linting goodness, but don't worry -
|
|
6
|
-
it's not something you need to exhaustively understand immediately. \u{1F499}
|
|
7
|
-
|
|
8
|
-
If you're interested in learning more, see the 'getting started' docs on:
|
|
9
|
-
- ESLint: https://eslint.org
|
|
10
|
-
- typescript-eslint: https://typescript-eslint.io
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/** @type {import("@types/eslint").Linter.Config} */
|
|
3
|
+
return await formatTypeScript(`/** @type {import("@types/eslint").Linter.Config} */
|
|
14
4
|
module.exports = {
|
|
15
5
|
env: {
|
|
16
6
|
es2022: true,
|
|
@@ -18,11 +8,9 @@ module.exports = {
|
|
|
18
8
|
},
|
|
19
9
|
extends: [
|
|
20
10
|
"eslint:recommended",
|
|
21
|
-
"plugin:eslint-comments/recommended",
|
|
22
|
-
"plugin:n/recommended",${options.excludeLintPerfectionist ? "" : `
|
|
23
|
-
"plugin:perfectionist/recommended-natural",`}
|
|
24
|
-
"plugin:regexp/recommended",
|
|
25
|
-
"prettier",
|
|
11
|
+
${options.excludeLintESLint ? "" : `"plugin:eslint-comments/recommended",
|
|
12
|
+
`}"plugin:n/recommended",${options.excludeLintPerfectionist ? "" : `
|
|
13
|
+
"plugin:perfectionist/recommended-natural",`}${options.excludeLintRegex ? "" : `"plugin:regexp/recommended",`}${options.excludeTests ? "" : `"plugin:vitest/recommended",`}
|
|
26
14
|
],
|
|
27
15
|
overrides: [${options.excludeLintMd ? "" : `
|
|
28
16
|
{
|
|
@@ -32,46 +20,54 @@ module.exports = {
|
|
|
32
20
|
},`}
|
|
33
21
|
{
|
|
34
22
|
extends: [
|
|
35
|
-
"plugin:jsdoc/recommended-typescript-error",
|
|
36
|
-
"plugin:@typescript-eslint
|
|
37
|
-
"plugin:@typescript-eslint/stylistic"
|
|
23
|
+
${options.excludeLintJSDoc ? "" : `"plugin:jsdoc/recommended-typescript-error",
|
|
24
|
+
`}"plugin:@typescript-eslint/${options.excludeLintStrict ? "recommended" : "strict"}",${options.excludeLintStylistic ? "" : `
|
|
25
|
+
"plugin:@typescript-eslint/stylistic",`}
|
|
38
26
|
],
|
|
39
27
|
files: ["**/*.ts"],
|
|
40
28
|
parser: "@typescript-eslint/parser",
|
|
41
29
|
rules: {
|
|
42
30
|
// These off-by-default rules work well for this repo and we like them on.
|
|
43
|
-
"jsdoc/informative-docs": "error",
|
|
44
|
-
"logical-assignment-operators": [
|
|
31
|
+
${options.excludeLintJSDoc ? "" : `"jsdoc/informative-docs": "error",
|
|
32
|
+
`}"logical-assignment-operators": [
|
|
45
33
|
"error",
|
|
46
34
|
"always",
|
|
47
35
|
{ enforceForIfStatements: true },
|
|
48
36
|
],
|
|
49
|
-
"operator-assignment": "error"
|
|
37
|
+
"operator-assignment": "error",${options.excludeLintJSDoc ? "" : `
|
|
50
38
|
|
|
51
39
|
// These on-by-default rules don't work well for this repo and we like them off.
|
|
52
40
|
"jsdoc/require-jsdoc": "off",
|
|
53
41
|
"jsdoc/require-param": "off",
|
|
54
42
|
"jsdoc/require-property": "off",
|
|
55
|
-
"jsdoc/require-returns": "off"
|
|
43
|
+
"jsdoc/require-returns": "off",`}
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
files: "**/*.md/*.ts",
|
|
48
|
+
rules: {
|
|
49
|
+
"n/no-missing-import": [
|
|
50
|
+
"error",
|
|
51
|
+
{ allowModules: ["${options.repository}"] },
|
|
52
|
+
],
|
|
56
53
|
},
|
|
57
54
|
},
|
|
58
55
|
{
|
|
59
56
|
${options.excludeLintMd ? "" : `excludedFiles: ["**/*.md/*.ts"],
|
|
60
57
|
`}extends: [
|
|
61
|
-
"plugin:@typescript-eslint
|
|
62
|
-
"plugin:@typescript-eslint/stylistic-type-checked"
|
|
58
|
+
"plugin:@typescript-eslint/${options.excludeLintStrict ? "recommended" : "strict"}-type-checked",${options.excludeLintStylistic ? "" : `
|
|
59
|
+
"plugin:@typescript-eslint/stylistic-type-checked",`}
|
|
63
60
|
],
|
|
64
61
|
files: ["**/*.ts"],
|
|
65
62
|
parser: "@typescript-eslint/parser",
|
|
66
63
|
parserOptions: {
|
|
67
64
|
project: "./tsconfig.eslint.json",
|
|
68
|
-
}
|
|
69
|
-
rules: {
|
|
65
|
+
},${options.excludeLintDeprecation ? "" : `rules: {
|
|
70
66
|
// These off-by-default rules work well for this repo and we like them on.
|
|
71
67
|
"deprecation/deprecation": "error",
|
|
72
|
-
}
|
|
68
|
+
},`}
|
|
73
69
|
},
|
|
74
|
-
{
|
|
70
|
+
${options.excludeLintJson ? "" : `{
|
|
75
71
|
excludedFiles: ["package.json"],
|
|
76
72
|
extends: ["plugin:jsonc/recommended-with-json"],
|
|
77
73
|
files: ["*.json", "*.jsonc"],
|
|
@@ -85,7 +81,7 @@ module.exports = {
|
|
|
85
81
|
rules: {
|
|
86
82
|
"jsonc/no-comments": "off",
|
|
87
83
|
},
|
|
88
|
-
}
|
|
84
|
+
},`}${options.excludeTests ? "" : `
|
|
89
85
|
{
|
|
90
86
|
files: "**/*.test.ts",
|
|
91
87
|
rules: {
|
|
@@ -94,8 +90,7 @@ module.exports = {
|
|
|
94
90
|
"@typescript-eslint/no-unsafe-call": "off",
|
|
95
91
|
},
|
|
96
92
|
},`}${options.excludeLintYml ? "" : `
|
|
97
|
-
|
|
98
|
-
{
|
|
93
|
+
{
|
|
99
94
|
extends: ["plugin:yml/standard", "plugin:yml/prettier"],
|
|
100
95
|
files: ["**/*.{yml,yaml}"],
|
|
101
96
|
parser: "yaml-eslint-parser",
|
|
@@ -121,39 +116,37 @@ module.exports = {
|
|
|
121
116
|
parser: "@typescript-eslint/parser",
|
|
122
117
|
plugins: [
|
|
123
118
|
"@typescript-eslint",
|
|
124
|
-
"deprecation",
|
|
125
|
-
"
|
|
126
|
-
|
|
127
|
-
"regexp",${options.excludeTests ? "" : `
|
|
119
|
+
${options.excludeLintDeprecation ? "" : `"deprecation",
|
|
120
|
+
`}${options.excludeLintJSDoc ? "" : `"jsdoc",
|
|
121
|
+
`}${options.excludeTests ? "" : `"no-only-tests",`}${options.excludeLintPerfectionist ? "" : `"perfectionist",`}${options.excludeLintRegex ? "" : `"regexp",`}${options.excludeTests ? "" : `
|
|
128
122
|
"vitest",`}
|
|
129
123
|
],
|
|
130
124
|
reportUnusedDisableDirectives: true,
|
|
131
125
|
root: true,
|
|
132
126
|
rules: {
|
|
133
127
|
// These off/less-strict-by-default rules work well for this repo and we like them on.
|
|
134
|
-
"@typescript-eslint/no-unused-vars": ["error", { caughtErrors: "all" }]
|
|
135
|
-
"import/extensions": ["error", "ignorePackages"],${options.excludeTests ? "" : `
|
|
128
|
+
"@typescript-eslint/no-unused-vars": ["error", { caughtErrors: "all" }],${options.excludeTests ? "" : `
|
|
136
129
|
"no-only-tests/no-only-tests": "error",`}
|
|
137
130
|
|
|
138
131
|
// These on-by-default rules don't work well for this repo and we like them off.
|
|
139
|
-
"n/no-missing-import": "off",
|
|
140
132
|
"no-case-declarations": "off",
|
|
141
133
|
"no-constant-condition": "off",
|
|
142
134
|
"no-inner-declarations": "off",
|
|
135
|
+
"no-mixed-spaces-and-tabs": "off",
|
|
143
136
|
|
|
144
|
-
|
|
137
|
+
${options.excludeLintStylistic ? "" : `// Stylistic concerns that don't interfere with Prettier
|
|
145
138
|
"@typescript-eslint/padding-line-between-statements": [
|
|
146
139
|
"error",
|
|
147
140
|
{ blankLine: "always", next: "*", prev: "block-like" },
|
|
148
141
|
],
|
|
149
|
-
"perfectionist/sort-objects": [
|
|
142
|
+
`}${options.excludeLintPerfectionist ? "" : `"perfectionist/sort-objects": [
|
|
150
143
|
"error",
|
|
151
144
|
{
|
|
152
145
|
order: "asc",
|
|
153
146
|
"partition-by-comment": true,
|
|
154
147
|
type: "natural",
|
|
155
148
|
},
|
|
156
|
-
]
|
|
149
|
+
],`}
|
|
157
150
|
},
|
|
158
151
|
};
|
|
159
152
|
`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/writing/creation/createESLintRC.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\n\nexport async function createESLintRC(options: Options) {\n\treturn await formatTypeScript(
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/writing/creation/createESLintRC.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\n\nexport async function createESLintRC(options: Options) {\n\treturn await formatTypeScript(`/** @type {import(\"@types/eslint\").Linter.Config} */\nmodule.exports = {\n\tenv: {\n\t\tes2022: true,\n\t\tnode: true,\n\t},\n\textends: [\n\t\t\"eslint:recommended\",\n\t\t${\n\t\t\toptions.excludeLintESLint\n\t\t\t\t? \"\"\n\t\t\t\t: `\"plugin:eslint-comments/recommended\",\n\t\t`\n\t\t}\"plugin:n/recommended\",${\n\t\t\toptions.excludeLintPerfectionist\n\t\t\t\t? \"\"\n\t\t\t\t: `\n\t\t\"plugin:perfectionist/recommended-natural\",`\n\t\t}${options.excludeLintRegex ? \"\" : `\"plugin:regexp/recommended\",`}${\n\t\t\toptions.excludeTests ? \"\" : `\"plugin:vitest/recommended\",`\n\t\t}\n\t],\n\toverrides: [${\n\t\toptions.excludeLintMd\n\t\t\t? \"\"\n\t\t\t: `\n\t\t{\n\t\t\textends: [\"plugin:markdown/recommended\"],\n\t\t\tfiles: [\"**/*.md\"],\n\t\t\tprocessor: \"markdown/markdown\",\n\t\t},`\n\t}\n\t\t{\n\t\t\textends: [\n\t\t\t\t${\n\t\t\t\t\toptions.excludeLintJSDoc\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: `\"plugin:jsdoc/recommended-typescript-error\",\n\t\t\t\t`\n\t\t\t\t}\"plugin:@typescript-eslint/${\n\t\t\t\t\toptions.excludeLintStrict ? \"recommended\" : \"strict\"\n\t\t\t\t}\",${\n\t\t\t\t\toptions.excludeLintStylistic\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: `\n\t\t\t\t\"plugin:@typescript-eslint/stylistic\",`\n\t\t\t\t}\n\t\t\t],\n\t\t\tfiles: [\"**/*.ts\"],\n\t\t\tparser: \"@typescript-eslint/parser\",\n\t\t\trules: {\n\t\t\t\t// These off-by-default rules work well for this repo and we like them on.\n\t\t\t\t${\n\t\t\t\t\toptions.excludeLintJSDoc\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: `\"jsdoc/informative-docs\": \"error\",\n\t\t\t\t`\n\t\t\t\t}\"logical-assignment-operators\": [\n\t\t\t\t\t\"error\",\n\t\t\t\t\t\"always\",\n\t\t\t\t\t{ enforceForIfStatements: true },\n\t\t\t\t],\n\t\t\t\t\"operator-assignment\": \"error\",${\n\t\t\t\t\toptions.excludeLintJSDoc\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: `\n\n\t\t\t\t// These on-by-default rules don't work well for this repo and we like them off.\n\t\t\t\t\"jsdoc/require-jsdoc\": \"off\",\n\t\t\t\t\"jsdoc/require-param\": \"off\",\n\t\t\t\t\"jsdoc/require-property\": \"off\",\n\t\t\t\t\"jsdoc/require-returns\": \"off\",`\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: \"**/*.md/*.ts\",\n\t\t\trules: {\n\t\t\t\t\"n/no-missing-import\": [\n\t\t\t\t\t\"error\",\n\t\t\t\t\t{ allowModules: [\"${options.repository}\"] },\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t${\n\t\t\t\toptions.excludeLintMd\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `excludedFiles: [\"**/*.md/*.ts\"],\n\t\t\t`\n\t\t\t}extends: [\n\t\t\t\t\"plugin:@typescript-eslint/${\n\t\t\t\t\toptions.excludeLintStrict ? \"recommended\" : \"strict\"\n\t\t\t\t}-type-checked\",${\n\t\t\t\t\toptions.excludeLintStylistic\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: `\n\t\t\t\t\"plugin:@typescript-eslint/stylistic-type-checked\",`\n\t\t\t\t}\n\t\t\t],\n\t\t\tfiles: [\"**/*.ts\"],\n\t\t\tparser: \"@typescript-eslint/parser\",\n\t\t\tparserOptions: {\n\t\t\t\tproject: \"./tsconfig.eslint.json\",\n\t\t\t},${\n\t\t\t\toptions.excludeLintDeprecation\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `rules: {\n\t\t\t\t// These off-by-default rules work well for this repo and we like them on.\n\t\t\t\t\"deprecation/deprecation\": \"error\",\n\t\t\t},`\n\t\t\t}\n\t\t},\n\t\t${\n\t\t\toptions.excludeLintJson\n\t\t\t\t? \"\"\n\t\t\t\t: `{\n\t\t\texcludedFiles: [\"package.json\"],\n\t\t\textends: [\"plugin:jsonc/recommended-with-json\"],\n\t\t\tfiles: [\"*.json\", \"*.jsonc\"],\n\t\t\tparser: \"jsonc-eslint-parser\",\n\t\t\trules: {\n\t\t\t\t\"jsonc/sort-keys\": \"error\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: [\"*.jsonc\"],\n\t\t\trules: {\n\t\t\t\t\"jsonc/no-comments\": \"off\",\n\t\t\t},\n\t\t},`\n\t\t}${\n\t\t\toptions.excludeTests\n\t\t\t\t? \"\"\n\t\t\t\t: `\\n{\n\t\t\tfiles: \"**/*.test.ts\",\n\t\t\trules: {\n\t\t\t\t// These on-by-default rules aren't useful in test files.\n\t\t\t\t\"@typescript-eslint/no-unsafe-assignment\": \"off\",\n\t\t\t\t\"@typescript-eslint/no-unsafe-call\": \"off\",\n\t\t\t},\n\t\t},`\n\t\t}${\n\t\t\toptions.excludeLintYml\n\t\t\t\t? \"\"\n\t\t\t\t: `\\n{\n\t\t\textends: [\"plugin:yml/standard\", \"plugin:yml/prettier\"],\n\t\t\tfiles: [\"**/*.{yml,yaml}\"],\n\t\t\tparser: \"yaml-eslint-parser\",\n\t\t\trules: {\n\t\t\t\t\"yml/file-extension\": [\"error\", { extension: \"yml\" }],\n\t\t\t\t\"yml/sort-keys\": [\n\t\t\t\t\t\"error\",\n\t\t\t\t\t{\n\t\t\t\t\t\torder: { type: \"asc\" },\n\t\t\t\t\t\tpathPattern: \"^.*$\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\t\"yml/sort-sequence-values\": [\n\t\t\t\t\t\"error\",\n\t\t\t\t\t{\n\t\t\t\t\t\torder: { type: \"asc\" },\n\t\t\t\t\t\tpathPattern: \"^.*$\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t`\n\t\t}],\n\tparser: \"@typescript-eslint/parser\",\n\tplugins: [\n\t\t\"@typescript-eslint\",\n\t\t${\n\t\t\toptions.excludeLintDeprecation\n\t\t\t\t? \"\"\n\t\t\t\t: `\"deprecation\",\n\t\t`\n\t\t}${\n\t\t\toptions.excludeLintJSDoc\n\t\t\t\t? \"\"\n\t\t\t\t: `\"jsdoc\",\n\t\t`\n\t\t}${options.excludeTests ? \"\" : `\"no-only-tests\",`}${\n\t\t\toptions.excludeLintPerfectionist ? \"\" : `\"perfectionist\",`\n\t\t}${options.excludeLintRegex ? \"\" : `\"regexp\",`}${\n\t\t\toptions.excludeTests ? \"\" : `\\n\"vitest\",`\n\t\t}\n\t],\n\treportUnusedDisableDirectives: true,\n\troot: true,\n\trules: {\n\t\t// These off/less-strict-by-default rules work well for this repo and we like them on.\n\t\t\"@typescript-eslint/no-unused-vars\": [\"error\", { caughtErrors: \"all\" }],${\n\t\t\toptions.excludeTests ? \"\" : `\\n\"no-only-tests/no-only-tests\": \"error\",`\n\t\t}\n\n\t\t// These on-by-default rules don't work well for this repo and we like them off.\n\t\t\"no-case-declarations\": \"off\",\n\t\t\"no-constant-condition\": \"off\",\n\t\t\"no-inner-declarations\": \"off\",\n\t\t\"no-mixed-spaces-and-tabs\": \"off\",\n\n\t\t${\n\t\t\toptions.excludeLintStylistic\n\t\t\t\t? \"\"\n\t\t\t\t: `// Stylistic concerns that don't interfere with Prettier\n\t\t\"@typescript-eslint/padding-line-between-statements\": [\n\t\t\t\"error\",\n\t\t\t{ blankLine: \"always\", next: \"*\", prev: \"block-like\" },\n\t\t],\n\t\t`\n\t\t}${\n\t\t\toptions.excludeLintPerfectionist\n\t\t\t\t? \"\"\n\t\t\t\t: `\"perfectionist/sort-objects\": [\n\t\t\t\"error\",\n\t\t\t{\n\t\t\t\torder: \"asc\",\n\t\t\t\t\"partition-by-comment\": true,\n\t\t\t\ttype: \"natural\",\n\t\t\t},\n\t\t],`\n\t\t}\n\t},\n};\n`);\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AAEjC,eAAsB,eAAe,SAAkB;AACtD,SAAO,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAS5B,QAAQ,oBACL,KACA;AAAA,GAEJ,0BACC,QAAQ,2BACL,KACA;AAAA,8CAEJ,GAAG,QAAQ,mBAAmB,KAAK,8BAA8B,GAChE,QAAQ,eAAe,KAAK,8BAC7B;AAAA;AAAA,eAGA,QAAQ,gBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA,KAMJ;AAAA;AAAA;AAAA,MAII,QAAQ,mBACL,KACA;AAAA,KAEJ,8BACC,QAAQ,oBAAoB,gBAAgB,QAC7C,KACC,QAAQ,uBACL,KACA;AAAA,2CAEJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOC,QAAQ,mBACL,KACA;AAAA,KAEJ;AAAA;AAAA;AAAA;AAAA;AAAA,qCAMC,QAAQ,mBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oCAOJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAQqB,QAAQ,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,KAMvC,QAAQ,gBACL,KACA;AAAA,IAEJ;AAAA,iCAEE,QAAQ,oBAAoB,gBAAgB,QAC7C,kBACC,QAAQ,uBACL,KACA;AAAA,wDAEJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAOA,QAAQ,yBACL,KACA;AAAA;AAAA;AAAA,MAIJ;AAAA;AAAA,IAGA,QAAQ,kBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAeJ,GACC,QAAQ,eACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAQJ,GACC,QAAQ,iBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuBJ;AAAA;AAAA;AAAA;AAAA,IAKC,QAAQ,yBACL,KACA;AAAA,GAEJ,GACC,QAAQ,mBACL,KACA;AAAA,GAEJ,GAAG,QAAQ,eAAe,KAAK,kBAAkB,GAChD,QAAQ,2BAA2B,KAAK,kBACzC,GAAG,QAAQ,mBAAmB,KAAK,WAAW,GAC7C,QAAQ,eAAe,KAAK;AAAA,UAC7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4EAOC,QAAQ,eAAe,KAAK;AAAA,wCAC7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASC,QAAQ,uBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA,GAMJ,GACC,QAAQ,2BACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAQJ;AAAA;AAAA;AAAA,CAGD;AACD;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/steps/writing/creation/dotGitHub/createDevelopment.ts"],"sourcesContent":["import { Options } from \"../../../../shared/types.js\";\n\nexport function createDevelopment(options: Options) {\n\tconst lintLines = [\n\t\t!options.excludeLintKnip &&\n\t\t\t`- \\`pnpm lint:knip\\` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports`,\n\t\t!options.excludeLintMd &&\n\t\t\t`- \\`pnpm lint:md\\` ([Markdownlint](https://github.com/DavidAnson/markdownlint)): Checks Markdown source files`,\n\t\t!options.excludeLintPackageJson &&\n\t\t\t`- \\`pnpm lint:package-json\\` ([npm-package-json-lint](https://npmpackagejsonlint.org/)): Lints the \\`package.json\\` file`,\n\t\t!options.excludeLintPackages &&\n\t\t\t`- \\`pnpm lint:packages\\` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the \\`pnpm-lock.yml\\` file`,\n\t\t!options.excludeLintSpelling &&\n\t\t\t`- \\`pnpm lint:spelling\\` ([cspell](https://cspell.org)): Spell checks across all source files`,\n\t].filter(Boolean);\n\n\treturn `# Development\n\nAfter [forking the repo from GitHub](https://help.github.com/articles/fork-a-repo) and [installing pnpm](https://pnpm.io/installation):\n\n\\`\\`\\`shell\ngit clone https://github.com/<your-name-here>/${options.repository}\ncd ${options.repository}\npnpm install\n\\`\\`\\`\n\n> This repository includes a list of suggested VS Code extensions.\n> It's a good idea to use [VS Code](https://code.visualstudio.com) and accept its suggestion to install them, as they'll help with development.\n\n## Building\n\nRun [**tsup**](https://tsup.egoist.dev) locally to build source files from \\`src/\\` into output files in \\`lib/\\`:\n\n\\`\\`\\`shell\npnpm build\n\\`\\`\\`\n\nAdd \\`--watch\\` to run the builder in a watch mode that continuously cleans and recreates \\`lib/\\` as you save files:\n\n\\`\\`\\`shell\npnpm build --watch\n\\`\\`\\`\n\n## Formatting\n\n[Prettier](https://prettier.io) is used to format code.\nIt should be applied automatically when you save files in VS Code or make a Git commit.\n\nTo manually reformat all files, you can run:\n\n\\`\\`\\`shell\npnpm format
|
|
1
|
+
{"version":3,"sources":["../../../../../src/steps/writing/creation/dotGitHub/createDevelopment.ts"],"sourcesContent":["import { Options } from \"../../../../shared/types.js\";\n\nexport function createDevelopment(options: Options) {\n\tconst lintLines = [\n\t\t!options.excludeLintKnip &&\n\t\t\t`- \\`pnpm lint:knip\\` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports`,\n\t\t!options.excludeLintMd &&\n\t\t\t`- \\`pnpm lint:md\\` ([Markdownlint](https://github.com/DavidAnson/markdownlint)): Checks Markdown source files`,\n\t\t!options.excludeLintPackageJson &&\n\t\t\t`- \\`pnpm lint:package-json\\` ([npm-package-json-lint](https://npmpackagejsonlint.org/)): Lints the \\`package.json\\` file`,\n\t\t!options.excludeLintPackages &&\n\t\t\t`- \\`pnpm lint:packages\\` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the \\`pnpm-lock.yml\\` file`,\n\t\t!options.excludeLintSpelling &&\n\t\t\t`- \\`pnpm lint:spelling\\` ([cspell](https://cspell.org)): Spell checks across all source files`,\n\t].filter(Boolean);\n\n\treturn `# Development\n\nAfter [forking the repo from GitHub](https://help.github.com/articles/fork-a-repo) and [installing pnpm](https://pnpm.io/installation):\n\n\\`\\`\\`shell\ngit clone https://github.com/<your-name-here>/${options.repository}\ncd ${options.repository}\npnpm install\n\\`\\`\\`\n\n> This repository includes a list of suggested VS Code extensions.\n> It's a good idea to use [VS Code](https://code.visualstudio.com) and accept its suggestion to install them, as they'll help with development.\n\n## Building\n\nRun [**tsup**](https://tsup.egoist.dev) locally to build source files from \\`src/\\` into output files in \\`lib/\\`:\n\n\\`\\`\\`shell\npnpm build\n\\`\\`\\`\n\nAdd \\`--watch\\` to run the builder in a watch mode that continuously cleans and recreates \\`lib/\\` as you save files:\n\n\\`\\`\\`shell\npnpm build --watch\n\\`\\`\\`\n\n## Formatting\n\n[Prettier](https://prettier.io) is used to format code.\nIt should be applied automatically when you save files in VS Code or make a Git commit.\n\nTo manually reformat all files, you can run:\n\n\\`\\`\\`shell\npnpm format --write\n\\`\\`\\`\n\n## Linting\n\n${\n\tlintLines.length\n\t\t? [\n\t\t\t\t`This package includes several forms of linting to enforce consistent code quality and styling.`,\n\t\t\t\t`Each should be shown in VS Code, and can be run manually on the command-line:`,\n\t\t\t\t``,\n\t\t\t\t`- \\`pnpm lint\\` ([ESLint](https://eslint.org) with [typescript-eslint](https://typescript-eslint.io)): Lints JavaScript and TypeScript source files`,\n\t\t\t\t...lintLines,\n\t\t\t\t``,\n\t\t\t\t`Read the individual documentation for each linter to understand how it can be configured and used best.`,\n\t\t\t\t``,\n\t\t\t\t`For example, ESLint can be run with \\`--fix\\` to auto-fix some lint rule complaints:`,\n\t\t ].join(\"\\n\")\n\t\t: `[ESLint](https://eslint.org) is used with with [typescript-eslint](https://typescript-eslint.io)) to lint JavaScript and TypeScript source files.\nYou can run it locally on the command-line:\n\n\\`\\`\\`shell\npnpm run lint\n\\`\\`\\`\n\nESLint can be run with \\`--fix\\` to auto-fix some lint rule complaints:`\n}\n\n\\`\\`\\`shell\npnpm run lint --fix\n\\`\\`\\`\n\n${\n\t!options.excludeTests &&\n\t`## Testing\n\n[Vitest](https://vitest.dev) is used for tests.\nYou can run it locally on the command-line:\n\n\\`\\`\\`shell\npnpm run test\n\\`\\`\\`\n\nAdd the \\`--coverage\\` flag to compute test coverage and place reports in the \\`coverage/\\` directory:\n\n\\`\\`\\`shell\npnpm run test --coverage\n\\`\\`\\`\n\nNote that [console-fail-test](https://github.com/JoshuaKGoldberg/console-fail-test) is enabled for all test runs.\nCalls to \\`console.log\\`, \\`console.warn\\`, and other console methods will cause a test to fail.\n\n### Debugging Tests\n\nThis repository includes a [VS Code launch configuration](https://code.visualstudio.com/docs/editor/debugging) for debugging unit tests.\nTo launch it, open a test file, then run _Debug Current Test File_ from the VS Code Debug panel (or press F5).\n`\n}\n## Type Checking\n\nYou should be able to see suggestions from [TypeScript](https://typescriptlang.org) in your editor for all open files.\n\nHowever, it can be useful to run the TypeScript command-line (\\`tsc\\`) to type check all files in \\`src/\\`:\n\n\\`\\`\\`shell\npnpm tsc\n\\`\\`\\`\n\nAdd \\`--watch\\` to keep the type checker running in a watch mode that updates the display as you save files:\n\n\\`\\`\\`shell\npnpm tsc --watch\n\\`\\`\\`\n`;\n}\n"],"mappings":"AAEO,SAAS,kBAAkB,SAAkB;AACnD,QAAM,YAAY;AAAA,IACjB,CAAC,QAAQ,mBACR;AAAA,IACD,CAAC,QAAQ,iBACR;AAAA,IACD,CAAC,QAAQ,0BACR;AAAA,IACD,CAAC,QAAQ,uBACR;AAAA,IACD,CAAC,QAAQ,uBACR;AAAA,EACF,EAAE,OAAO,OAAO;AAEhB,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA,gDAKwC,QAAQ,UAAU;AAAA,KAC7D,QAAQ,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmCtB,UAAU,SACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACA,EAAE,KAAK,IAAI,IACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wEAQJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOC,CAAC,QAAQ,gBACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAuBD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBA;","names":[]}
|