create-typescript-app 0.1.2 → 1.29.14
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/LICENSE.md +17 -5
- package/README.md +118 -0
- package/bin/index.js +4 -0
- package/lib/bin/index.d.ts +3 -0
- package/lib/bin/index.js +52 -0
- package/lib/bin/index.js.map +1 -0
- package/lib/bin/mode.d.ts +4 -0
- package/lib/bin/mode.js +43 -0
- package/lib/bin/mode.js.map +1 -0
- package/lib/create/createRerunSuggestion.d.ts +6 -0
- package/lib/create/createRerunSuggestion.js +17 -0
- package/lib/create/createRerunSuggestion.js.map +1 -0
- package/lib/create/createWithOptions.d.ts +9 -0
- package/lib/create/createWithOptions.js +62 -0
- package/lib/create/createWithOptions.js.map +1 -0
- package/lib/create/index.d.ts +3 -0
- package/lib/create/index.js +64 -0
- package/lib/create/index.js.map +1 -0
- package/lib/greet.d.ts +5 -0
- package/lib/greet.js +14 -0
- package/lib/greet.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -0
- package/lib/initialize/index.d.ts +3 -0
- package/lib/initialize/index.js +32 -0
- package/lib/initialize/index.js.map +1 -0
- package/lib/initialize/initializeWithOptions.d.ts +7 -0
- package/lib/initialize/initializeWithOptions.js +60 -0
- package/lib/initialize/initializeWithOptions.js.map +1 -0
- package/lib/migrate/index.d.ts +3 -0
- package/lib/migrate/index.js +29 -0
- package/lib/migrate/index.js.map +1 -0
- package/lib/migrate/migrateWithOptions.d.ts +7 -0
- package/lib/migrate/migrateWithOptions.js +67 -0
- package/lib/migrate/migrateWithOptions.js.map +1 -0
- package/lib/shared/cli/lines.d.ts +5 -0
- package/lib/shared/cli/lines.js +17 -0
- package/lib/shared/cli/lines.js.map +1 -0
- package/lib/shared/cli/lowerFirst.d.ts +3 -0
- package/lib/shared/cli/lowerFirst.js +7 -0
- package/lib/shared/cli/lowerFirst.js.map +1 -0
- package/lib/shared/cli/outro.d.ts +7 -0
- package/lib/shared/cli/outro.js +21 -0
- package/lib/shared/cli/outro.js.map +1 -0
- package/lib/shared/cli/spinners.d.ts +6 -0
- package/lib/shared/cli/spinners.js +49 -0
- package/lib/shared/cli/spinners.js.map +1 -0
- package/lib/shared/cli/startLineWithDots.d.ts +3 -0
- package/lib/shared/cli/startLineWithDots.js +31 -0
- package/lib/shared/cli/startLineWithDots.js.map +1 -0
- package/lib/shared/doesRepositoryExist.d.ts +9 -0
- package/lib/shared/doesRepositoryExist.js +18 -0
- package/lib/shared/doesRepositoryExist.js.map +1 -0
- package/lib/shared/ensureGitRepository.d.ts +3 -0
- package/lib/shared/ensureGitRepository.js +12 -0
- package/lib/shared/ensureGitRepository.js.map +1 -0
- package/lib/shared/getGitHubUserAsAllContributor.d.ts +3 -0
- package/lib/shared/getGitHubUserAsAllContributor.js +31 -0
- package/lib/shared/getGitHubUserAsAllContributor.js.map +1 -0
- package/lib/shared/options/args.d.ts +85 -0
- package/lib/shared/options/args.js +33 -0
- package/lib/shared/options/args.js.map +1 -0
- package/lib/shared/options/augmentOptionsWithExcludes.d.ts +5 -0
- package/lib/shared/options/augmentOptionsWithExcludes.js +126 -0
- package/lib/shared/options/augmentOptionsWithExcludes.js.map +1 -0
- package/lib/shared/options/ensureRepositoryExists.d.ts +11 -0
- package/lib/shared/options/ensureRepositoryExists.js +58 -0
- package/lib/shared/options/ensureRepositoryExists.js.map +1 -0
- package/lib/shared/options/getOctokit.d.ts +5 -0
- package/lib/shared/options/getOctokit.js +17 -0
- package/lib/shared/options/getOctokit.js.map +1 -0
- package/lib/shared/options/getPrefillOrPromptedOption.d.ts +3 -0
- package/lib/shared/options/getPrefillOrPromptedOption.js +23 -0
- package/lib/shared/options/getPrefillOrPromptedOption.js.map +1 -0
- package/lib/shared/options/optionalDefault.d.ts +3 -0
- package/lib/shared/options/optionalDefault.js +13 -0
- package/lib/shared/options/optionalDefault.js.map +1 -0
- package/lib/shared/options/readGitAndNpmDefaults/index.d.ts +11 -0
- package/lib/shared/options/readGitAndNpmDefaults/index.js +36 -0
- package/lib/shared/options/readGitAndNpmDefaults/index.js.map +1 -0
- package/lib/shared/options/readGitAndNpmDefaults/parsePackageAuthor.d.ts +8 -0
- package/lib/shared/options/readGitAndNpmDefaults/parsePackageAuthor.js +14 -0
- package/lib/shared/options/readGitAndNpmDefaults/parsePackageAuthor.js.map +1 -0
- package/lib/shared/options/readGitAndNpmDefaults/readTitleFromReadme.d.ts +3 -0
- package/lib/shared/options/readGitAndNpmDefaults/readTitleFromReadme.js +8 -0
- package/lib/shared/options/readGitAndNpmDefaults/readTitleFromReadme.js.map +1 -0
- package/lib/shared/options/readOptions.d.ts +10 -0
- package/lib/shared/options/readOptions.js +83 -0
- package/lib/shared/options/readOptions.js.map +1 -0
- package/lib/shared/packages.d.ts +6 -0
- package/lib/shared/packages.js +20 -0
- package/lib/shared/packages.js.map +1 -0
- package/lib/shared/prompts.d.ts +4 -0
- package/lib/shared/prompts.js +16 -0
- package/lib/shared/prompts.js.map +1 -0
- package/lib/shared/readFileAsJson.d.ts +3 -0
- package/lib/shared/readFileAsJson.js +15 -0
- package/lib/shared/readFileAsJson.js.map +1 -0
- package/lib/shared/readFileSafe.d.ts +3 -0
- package/lib/shared/readFileSafe.js +12 -0
- package/lib/shared/readFileSafe.js.map +1 -0
- package/lib/shared/readFileSafeAsJson.d.ts +3 -0
- package/lib/shared/readFileSafeAsJson.js +8 -0
- package/lib/shared/readFileSafeAsJson.js.map +1 -0
- package/lib/shared/runOrRestore.d.ts +7 -0
- package/lib/shared/runOrRestore.js +41 -0
- package/lib/shared/runOrRestore.js.map +1 -0
- package/lib/shared/tryCatchAsync.d.ts +3 -0
- package/lib/shared/tryCatchAsync.js +11 -0
- package/lib/shared/tryCatchAsync.js.map +1 -0
- package/lib/shared/types.d.ts +54 -0
- package/lib/shared/types.js +1 -0
- package/lib/shared/types.js.map +1 -0
- package/lib/steps/addOwnerAsAllContributor.d.ts +3 -0
- package/lib/steps/addOwnerAsAllContributor.js +41 -0
- package/lib/steps/addOwnerAsAllContributor.js.map +1 -0
- package/lib/steps/addToolAllContributors.d.ts +3 -0
- package/lib/steps/addToolAllContributors.js +12 -0
- package/lib/steps/addToolAllContributors.js.map +1 -0
- package/lib/steps/clearChangelog.d.ts +3 -0
- package/lib/steps/clearChangelog.js +12 -0
- package/lib/steps/clearChangelog.js.map +1 -0
- package/lib/steps/clearUnnecessaryFiles.d.ts +3 -0
- package/lib/steps/clearUnnecessaryFiles.js +33 -0
- package/lib/steps/clearUnnecessaryFiles.js.map +1 -0
- package/lib/steps/detectExistingContributors.d.ts +3 -0
- package/lib/steps/detectExistingContributors.js +16 -0
- package/lib/steps/detectExistingContributors.js.map +1 -0
- package/lib/steps/finalizeDependencies.d.ts +5 -0
- package/lib/steps/finalizeDependencies.js +59 -0
- package/lib/steps/finalizeDependencies.js.map +1 -0
- package/lib/steps/initializeGitHubRepository/index.d.ts +6 -0
- package/lib/steps/initializeGitHubRepository/index.js +14 -0
- package/lib/steps/initializeGitHubRepository/index.js.map +1 -0
- package/lib/steps/initializeGitHubRepository/initializeBranchProtectionSettings.d.ts +6 -0
- package/lib/steps/initializeGitHubRepository/initializeBranchProtectionSettings.js +46 -0
- package/lib/steps/initializeGitHubRepository/initializeBranchProtectionSettings.js.map +1 -0
- package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabel.d.ts +3 -0
- package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabel.js +14 -0
- package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabel.js.map +1 -0
- package/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.d.ts +3 -0
- package/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.js +31 -0
- package/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.js.map +1 -0
- package/lib/steps/initializeGitHubRepository/labels/outcomeLabels.d.ts +7 -0
- package/lib/steps/initializeGitHubRepository/labels/outcomeLabels.js +86 -0
- package/lib/steps/initializeGitHubRepository/labels/outcomeLabels.js.map +1 -0
- package/lib/steps/initializeGitRemote.d.ts +6 -0
- package/lib/steps/initializeGitRemote.js +15 -0
- package/lib/steps/initializeGitRemote.js.map +1 -0
- package/lib/steps/initializeRepositorySettings.d.ts +7 -0
- package/lib/steps/initializeRepositorySettings.js +27 -0
- package/lib/steps/initializeRepositorySettings.js.map +1 -0
- package/lib/steps/removeSetupScripts.d.ts +3 -0
- package/lib/steps/removeSetupScripts.js +23 -0
- package/lib/steps/removeSetupScripts.js.map +1 -0
- package/lib/steps/resetGitTags.d.ts +3 -0
- package/lib/steps/resetGitTags.js +12 -0
- package/lib/steps/resetGitTags.js.map +1 -0
- package/lib/steps/runCommands.d.ts +3 -0
- package/lib/steps/runCommands.js +33 -0
- package/lib/steps/runCommands.js.map +1 -0
- package/lib/steps/uninstallPackages.d.ts +3 -0
- package/lib/steps/uninstallPackages.js +41 -0
- package/lib/steps/uninstallPackages.js.map +1 -0
- package/lib/steps/updateAllContributorsTable.d.ts +5 -0
- package/lib/steps/updateAllContributorsTable.js +27 -0
- package/lib/steps/updateAllContributorsTable.js.map +1 -0
- package/lib/steps/updateLocalFiles.d.ts +5 -0
- package/lib/steps/updateLocalFiles.js +58 -0
- package/lib/steps/updateLocalFiles.js.map +1 -0
- package/lib/steps/updateReadme.d.ts +4 -0
- package/lib/steps/updateReadme.js +17 -0
- package/lib/steps/updateReadme.js.map +1 -0
- package/lib/steps/writeReadme.d.ts +5 -0
- package/lib/steps/writeReadme.js +87 -0
- package/lib/steps/writeReadme.js.map +1 -0
- package/lib/steps/writing/creation/createESLintRC.d.ts +5 -0
- package/lib/steps/writing/creation/createESLintRC.js +163 -0
- package/lib/steps/writing/creation/createESLintRC.js.map +1 -0
- package/lib/steps/writing/creation/dotGitHub/actions.d.ts +7 -0
- package/lib/steps/writing/creation/dotGitHub/actions.js +29 -0
- package/lib/steps/writing/creation/dotGitHub/actions.js.map +1 -0
- package/lib/steps/writing/creation/dotGitHub/createDevelopment.d.ts +5 -0
- package/lib/steps/writing/creation/dotGitHub/createDevelopment.js +96 -0
- package/lib/steps/writing/creation/dotGitHub/createDevelopment.js.map +1 -0
- package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.d.ts +14 -0
- package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.js +282 -0
- package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.js.map +1 -0
- package/lib/steps/writing/creation/dotGitHub/createWorkflowFile.d.ts +49 -0
- package/lib/steps/writing/creation/dotGitHub/createWorkflowFile.js +34 -0
- package/lib/steps/writing/creation/dotGitHub/createWorkflowFile.js.map +1 -0
- package/lib/steps/writing/creation/dotGitHub/index.d.ts +41 -0
- package/lib/steps/writing/creation/dotGitHub/index.js +16 -0
- package/lib/steps/writing/creation/dotGitHub/index.js.map +1 -0
- package/lib/steps/writing/creation/dotGitHub/issueTemplate.d.ts +10 -0
- package/lib/steps/writing/creation/dotGitHub/issueTemplate.js +202 -0
- package/lib/steps/writing/creation/dotGitHub/issueTemplate.js.map +1 -0
- package/lib/steps/writing/creation/dotGitHub/workflows.d.ts +20 -0
- package/lib/steps/writing/creation/dotGitHub/workflows.js +280 -0
- package/lib/steps/writing/creation/dotGitHub/workflows.js.map +1 -0
- package/lib/steps/writing/creation/dotHusky.d.ts +6 -0
- package/lib/steps/writing/creation/dotHusky.js +15 -0
- package/lib/steps/writing/creation/dotHusky.js.map +1 -0
- package/lib/steps/writing/creation/dotVSCode.d.ts +9 -0
- package/lib/steps/writing/creation/dotVSCode.js +55 -0
- package/lib/steps/writing/creation/dotVSCode.js.map +1 -0
- package/lib/steps/writing/creation/formatters/formatIgnoreFile.d.ts +3 -0
- package/lib/steps/writing/creation/formatters/formatIgnoreFile.js +7 -0
- package/lib/steps/writing/creation/formatters/formatIgnoreFile.js.map +1 -0
- package/lib/steps/writing/creation/formatters/formatJson.d.ts +3 -0
- package/lib/steps/writing/creation/formatters/formatJson.js +17 -0
- package/lib/steps/writing/creation/formatters/formatJson.js.map +1 -0
- package/lib/steps/writing/creation/formatters/formatTypeScript.d.ts +3 -0
- package/lib/steps/writing/creation/formatters/formatTypeScript.js +8 -0
- package/lib/steps/writing/creation/formatters/formatTypeScript.js.map +1 -0
- package/lib/steps/writing/creation/formatters/formatYaml.d.ts +3 -0
- package/lib/steps/writing/creation/formatters/formatYaml.js +23 -0
- package/lib/steps/writing/creation/formatters/formatYaml.js.map +1 -0
- package/lib/steps/writing/creation/index.d.ts +6 -0
- package/lib/steps/writing/creation/index.js +18 -0
- package/lib/steps/writing/creation/index.js.map +1 -0
- package/lib/steps/writing/creation/rootFiles.d.ts +25 -0
- package/lib/steps/writing/creation/rootFiles.js +202 -0
- package/lib/steps/writing/creation/rootFiles.js.map +1 -0
- package/lib/steps/writing/creation/src.d.ts +10 -0
- package/lib/steps/writing/creation/src.js +90 -0
- package/lib/steps/writing/creation/src.js.map +1 -0
- package/lib/steps/writing/creation/writeAllContributorsRC.d.ts +5 -0
- package/lib/steps/writing/creation/writeAllContributorsRC.js +25 -0
- package/lib/steps/writing/creation/writeAllContributorsRC.js.map +1 -0
- package/lib/steps/writing/creation/writePackageJson.d.ts +5 -0
- package/lib/steps/writing/creation/writePackageJson.js +98 -0
- package/lib/steps/writing/creation/writePackageJson.js.map +1 -0
- package/lib/steps/writing/types.d.ts +5 -0
- package/lib/steps/writing/types.js +1 -0
- package/lib/steps/writing/types.js.map +1 -0
- package/lib/steps/writing/writeStructure.d.ts +5 -0
- package/lib/steps/writing/writeStructure.js +11 -0
- package/lib/steps/writing/writeStructure.js.map +1 -0
- package/lib/steps/writing/writeStructureWorker.d.ts +5 -0
- package/lib/steps/writing/writeStructureWorker.js +47 -0
- package/lib/steps/writing/writeStructureWorker.js.map +1 -0
- package/lib/types.d.ts +7 -0
- package/lib/types.js +1 -0
- package/lib/types.js.map +1 -0
- package/package.json +112 -23
- package/.vscode/settings.json +0 -3
- package/dist/src/cli.d.ts +0 -0
- package/dist/src/cli.js +0 -2
- package/dist/src/cli.js.map +0 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.js +0 -54
- package/dist/src/index.js.map +0 -1
- package/dist/template/src/cli.d.ts +0 -0
- package/dist/template/src/cli.js +0 -2
- package/dist/template/src/cli.js.map +0 -1
- package/dist/template/src/index.d.ts +0 -0
- package/dist/template/src/index.js +0 -2
- package/dist/template/src/index.js.map +0 -1
- package/src/cli.ts +0 -0
- package/src/index.ts +0 -58
- package/src/types.d.ts +0 -10
- package/template/.vscode/settings.json +0 -3
- package/template/README.md +0 -28
- package/template/package.json +0 -34
- package/template/src/cli.ts +0 -0
- package/template/src/index.ts +0 -0
- package/template/tsconfig.json +0 -15
- package/template/tslint.json +0 -48
- package/tsconfig.json +0 -15
- package/tslint.json +0 -48
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { formatTypeScript } from "./formatters/formatTypeScript.js";
|
|
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} */
|
|
14
|
+
module.exports = {
|
|
15
|
+
env: {
|
|
16
|
+
es2022: true,
|
|
17
|
+
node: true,
|
|
18
|
+
},
|
|
19
|
+
extends: [
|
|
20
|
+
"eslint:recommended",
|
|
21
|
+
"plugin:eslint-comments/recommended",
|
|
22
|
+
"plugin:n/recommended",${options.excludeLintPerfectionist ? "" : `
|
|
23
|
+
"plugin:perfectionist/recommended-natural",`}
|
|
24
|
+
"plugin:regexp/recommended",
|
|
25
|
+
"prettier",
|
|
26
|
+
],
|
|
27
|
+
overrides: [${options.excludeLintMd ? "" : `
|
|
28
|
+
{
|
|
29
|
+
extends: ["plugin:markdown/recommended"],
|
|
30
|
+
files: ["**/*.md"],
|
|
31
|
+
processor: "markdown/markdown",
|
|
32
|
+
},`}
|
|
33
|
+
{
|
|
34
|
+
extends: [
|
|
35
|
+
"plugin:jsdoc/recommended-typescript-error",
|
|
36
|
+
"plugin:@typescript-eslint/strict",
|
|
37
|
+
"plugin:@typescript-eslint/stylistic",
|
|
38
|
+
],
|
|
39
|
+
files: ["**/*.ts"],
|
|
40
|
+
parser: "@typescript-eslint/parser",
|
|
41
|
+
rules: {
|
|
42
|
+
// These off-by-default rules work well for this repo and we like them on.
|
|
43
|
+
"jsdoc/informative-docs": "error",
|
|
44
|
+
"logical-assignment-operators": [
|
|
45
|
+
"error",
|
|
46
|
+
"always",
|
|
47
|
+
{ enforceForIfStatements: true },
|
|
48
|
+
],
|
|
49
|
+
"operator-assignment": "error",
|
|
50
|
+
|
|
51
|
+
// These on-by-default rules don't work well for this repo and we like them off.
|
|
52
|
+
"jsdoc/require-jsdoc": "off",
|
|
53
|
+
"jsdoc/require-param": "off",
|
|
54
|
+
"jsdoc/require-property": "off",
|
|
55
|
+
"jsdoc/require-returns": "off",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
${options.excludeLintMd ? "" : `excludedFiles: ["**/*.md/*.ts"],
|
|
60
|
+
`}extends: [
|
|
61
|
+
"plugin:@typescript-eslint/strict-type-checked",
|
|
62
|
+
"plugin:@typescript-eslint/stylistic-type-checked",
|
|
63
|
+
],
|
|
64
|
+
files: ["**/*.ts"],
|
|
65
|
+
parser: "@typescript-eslint/parser",
|
|
66
|
+
parserOptions: {
|
|
67
|
+
project: "./tsconfig.eslint.json",
|
|
68
|
+
},
|
|
69
|
+
rules: {
|
|
70
|
+
// These off-by-default rules work well for this repo and we like them on.
|
|
71
|
+
"deprecation/deprecation": "error",
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
excludedFiles: ["package.json"],
|
|
76
|
+
extends: ["plugin:jsonc/recommended-with-json"],
|
|
77
|
+
files: ["*.json", "*.jsonc"],
|
|
78
|
+
parser: "jsonc-eslint-parser",
|
|
79
|
+
rules: {
|
|
80
|
+
"jsonc/sort-keys": "error",
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
files: ["*.jsonc"],
|
|
85
|
+
rules: {
|
|
86
|
+
"jsonc/no-comments": "off",
|
|
87
|
+
},
|
|
88
|
+
},${options.excludeTests ? "" : `
|
|
89
|
+
{
|
|
90
|
+
files: "**/*.test.ts",
|
|
91
|
+
rules: {
|
|
92
|
+
// These on-by-default rules aren't useful in test files.
|
|
93
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
94
|
+
"@typescript-eslint/no-unsafe-call": "off",
|
|
95
|
+
},
|
|
96
|
+
},`}${options.excludeLintYml ? "" : `
|
|
97
|
+
|
|
98
|
+
{
|
|
99
|
+
extends: ["plugin:yml/standard", "plugin:yml/prettier"],
|
|
100
|
+
files: ["**/*.{yml,yaml}"],
|
|
101
|
+
parser: "yaml-eslint-parser",
|
|
102
|
+
rules: {
|
|
103
|
+
"yml/file-extension": ["error", { extension: "yml" }],
|
|
104
|
+
"yml/sort-keys": [
|
|
105
|
+
"error",
|
|
106
|
+
{
|
|
107
|
+
order: { type: "asc" },
|
|
108
|
+
pathPattern: "^.*$",
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
"yml/sort-sequence-values": [
|
|
112
|
+
"error",
|
|
113
|
+
{
|
|
114
|
+
order: { type: "asc" },
|
|
115
|
+
pathPattern: "^.*$",
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
`}],
|
|
121
|
+
parser: "@typescript-eslint/parser",
|
|
122
|
+
plugins: [
|
|
123
|
+
"@typescript-eslint",
|
|
124
|
+
"deprecation",
|
|
125
|
+
"import",
|
|
126
|
+
"jsdoc",${options.excludeTests ? "" : `"no-only-tests",`}${options.excludeLintPerfectionist ? "" : `"perfectionist",`}
|
|
127
|
+
"regexp",${options.excludeTests ? "" : `
|
|
128
|
+
"vitest",`}
|
|
129
|
+
],
|
|
130
|
+
root: true,
|
|
131
|
+
rules: {
|
|
132
|
+
// These off/less-strict-by-default rules work well for this repo and we like them on.
|
|
133
|
+
"@typescript-eslint/no-unused-vars": ["error", { caughtErrors: "all" }],
|
|
134
|
+
"import/extensions": ["error", "ignorePackages"],${options.excludeTests ? "" : `
|
|
135
|
+
"no-only-tests/no-only-tests": "error",`}
|
|
136
|
+
|
|
137
|
+
// These on-by-default rules don't work well for this repo and we like them off.
|
|
138
|
+
"n/no-missing-import": "off",
|
|
139
|
+
"no-case-declarations": "off",
|
|
140
|
+
"no-constant-condition": "off",
|
|
141
|
+
"no-inner-declarations": "off",
|
|
142
|
+
|
|
143
|
+
// Stylistic concerns that don't interfere with Prettier
|
|
144
|
+
"@typescript-eslint/padding-line-between-statements": [
|
|
145
|
+
"error",
|
|
146
|
+
{ blankLine: "always", next: "*", prev: "block-like" },
|
|
147
|
+
],
|
|
148
|
+
"perfectionist/sort-objects": [
|
|
149
|
+
"error",
|
|
150
|
+
{
|
|
151
|
+
order: "asc",
|
|
152
|
+
"partition-by-comment": true,
|
|
153
|
+
type: "natural",
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
`);
|
|
159
|
+
}
|
|
160
|
+
export {
|
|
161
|
+
createESLintRC
|
|
162
|
+
};
|
|
163
|
+
//# sourceMappingURL=createESLintRC.js.map
|
|
@@ -0,0 +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(`/*\n👋 Hi! This ESLint configuration contains a lot more stuff than many repos'!\nYou can read from it to see all sorts of linting goodness, but don't worry -\nit's not something you need to exhaustively understand immediately. 💙\n\nIf you're interested in learning more, see the 'getting started' docs on:\n- ESLint: https://eslint.org\n- typescript-eslint: https://typescript-eslint.io\n*/\n\n/** @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\"plugin:eslint-comments/recommended\",\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}\n\t\t\"plugin:regexp/recommended\",\n\t\t\"prettier\",\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\"plugin:jsdoc/recommended-typescript-error\",\n\t\t\t\t\"plugin:@typescript-eslint/strict\",\n\t\t\t\t\"plugin:@typescript-eslint/stylistic\",\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\"jsdoc/informative-docs\": \"error\",\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\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},\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/strict-type-checked\",\n\t\t\t\t\"plugin:@typescript-eslint/stylistic-type-checked\",\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\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\"deprecation/deprecation\": \"error\",\n\t\t\t},\n\t\t},\n\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\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{\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\"deprecation\",\n\t\t\"import\",\n\t\t\"jsdoc\",${options.excludeTests ? \"\" : `\"no-only-tests\",`}${\n\t\t\toptions.excludeLintPerfectionist ? \"\" : `\"perfectionist\",`\n\t\t}\n\t\t\"regexp\",${options.excludeTests ? \"\" : `\\n\"vitest\",`}\n\t],\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\"import/extensions\": [\"error\", \"ignorePackages\"],${\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\"n/no-missing-import\": \"off\",\n\t\t\"no-case-declarations\": \"off\",\n\t\t\"no-constant-condition\": \"off\",\n\t\t\"no-inner-declarations\": \"off\",\n\n\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\"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},\n};\n`);\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AAEjC,eAAsB,eAAe,SAAkB;AACtD,SAAO,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAoB5B,QAAQ,2BACL,KACA;AAAA,8CAEJ;AAAA;AAAA;AAAA;AAAA,eAKA,QAAQ,gBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA,KAMJ;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,KA4BG,QAAQ,gBACL,KACA;AAAA,IAEJ;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,MA6BA,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;AAAA,EAwBJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAMU,QAAQ,eAAe,KAAK,kBAAkB,GACvD,QAAQ,2BAA2B,KAAK,kBACzC;AAAA,aACW,QAAQ,eAAe,KAAK;AAAA,UAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qDAOnD,QAAQ,eAAe,KAAK;AAAA,wCAC7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAuBD;AACD;","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import jsYaml from "js-yaml";
|
|
2
|
+
function createDotGitHubActions() {
|
|
3
|
+
return {
|
|
4
|
+
prepare: {
|
|
5
|
+
"action.yml": jsYaml.dump({
|
|
6
|
+
description: "Prepares the repo for a typical CI job",
|
|
7
|
+
name: "Prepare",
|
|
8
|
+
runs: {
|
|
9
|
+
steps: [
|
|
10
|
+
{ uses: "pnpm/action-setup@v2" },
|
|
11
|
+
{
|
|
12
|
+
uses: "actions/setup-node@v3",
|
|
13
|
+
with: { cache: "pnpm", "node-version": "18" }
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
run: "pnpm install --frozen-lockfile",
|
|
17
|
+
shell: "bash"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
using: "composite"
|
|
21
|
+
}
|
|
22
|
+
}).replaceAll(/\n(\S)/g, "\n\n$1")
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
createDotGitHubActions
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/steps/writing/creation/dotGitHub/actions.ts"],"sourcesContent":["import jsYaml from \"js-yaml\";\n\nexport function createDotGitHubActions() {\n\treturn {\n\t\tprepare: {\n\t\t\t\"action.yml\": jsYaml\n\t\t\t\t.dump({\n\t\t\t\t\tdescription: \"Prepares the repo for a typical CI job\",\n\t\t\t\t\tname: \"Prepare\",\n\t\t\t\t\truns: {\n\t\t\t\t\t\tsteps: [\n\t\t\t\t\t\t\t{ uses: \"pnpm/action-setup@v2\" },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tuses: \"actions/setup-node@v3\",\n\t\t\t\t\t\t\t\twith: { cache: \"pnpm\", \"node-version\": \"18\" },\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\trun: \"pnpm install --frozen-lockfile\",\n\t\t\t\t\t\t\t\tshell: \"bash\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tusing: \"composite\",\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t\t.replaceAll(/\\n(\\S)/g, \"\\n\\n$1\"),\n\t\t},\n\t};\n}\n"],"mappings":"AAAA,OAAO,YAAY;AAEZ,SAAS,yBAAyB;AACxC,SAAO;AAAA,IACN,SAAS;AAAA,MACR,cAAc,OACZ,KAAK;AAAA,QACL,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,UACL,OAAO;AAAA,YACN,EAAE,MAAM,uBAAuB;AAAA,YAC/B;AAAA,cACC,MAAM;AAAA,cACN,MAAM,EAAE,OAAO,QAAQ,gBAAgB,KAAK;AAAA,YAC7C;AAAA,YACA;AAAA,cACC,KAAK;AAAA,cACL,OAAO;AAAA,YACR;AAAA,UACD;AAAA,UACA,OAAO;AAAA,QACR;AAAA,MACD,CAAC,EACA,WAAW,WAAW,QAAQ;AAAA,IACjC;AAAA,EACD;AACD;","names":[]}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
function createDevelopment(options) {
|
|
2
|
+
const lintLines = [
|
|
3
|
+
options.excludeLintKnip && `- \`pnpm lint:knip\` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports`,
|
|
4
|
+
options.excludeLintMd && `- \`pnpm lint:md\` ([Markdownlint](https://github.com/DavidAnson/markdownlint)): Checks Markdown source files`,
|
|
5
|
+
options.excludeLintPackageJson && `- \`pnpm lint:package-json\` ([npm-package-json-lint](https://npmpackagejsonlint.org/)): Lints the \`package.json\` file`,
|
|
6
|
+
options.excludeLintPackages && `- \`pnpm lint:packages\` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the \`pnpm-lock.yml\` file`,
|
|
7
|
+
options.excludeLintSpelling && `- \`pnpm lint:spelling\` ([cspell](https://cspell.org)): Spell checks across all source files`
|
|
8
|
+
].filter(Boolean);
|
|
9
|
+
return `# Development
|
|
10
|
+
|
|
11
|
+
After [forking the repo from GitHub](https://help.github.com/articles/fork-a-repo) and [installing pnpm](https://pnpm.io/installation):
|
|
12
|
+
|
|
13
|
+
\`\`\`shell
|
|
14
|
+
git clone https://github.com/<your-name-here>/${options.repository}
|
|
15
|
+
cd ${options.repository}
|
|
16
|
+
pnpm install
|
|
17
|
+
\`\`\`
|
|
18
|
+
|
|
19
|
+
> This repository includes a list of suggested VS Code extensions.
|
|
20
|
+
> 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.
|
|
21
|
+
|
|
22
|
+
## Building
|
|
23
|
+
|
|
24
|
+
Run [TypeScript](https://typescriptlang.org) locally to type check and build source files from \`src/\` into output files in \`lib/\`:
|
|
25
|
+
|
|
26
|
+
\`\`\`shell
|
|
27
|
+
pnpm build --watch
|
|
28
|
+
\`\`\`
|
|
29
|
+
|
|
30
|
+
You should also see suggestions from TypeScript in your editor.
|
|
31
|
+
|
|
32
|
+
## Formatting
|
|
33
|
+
|
|
34
|
+
[Prettier](https://prettier.io) is used to format code.
|
|
35
|
+
It should be applied automatically when you save files in VS Code or make a Git commit.
|
|
36
|
+
|
|
37
|
+
To manually reformat all files, you can run:
|
|
38
|
+
|
|
39
|
+
\`\`\`shell
|
|
40
|
+
pnpm format:write
|
|
41
|
+
\`\`\`
|
|
42
|
+
|
|
43
|
+
## Linting
|
|
44
|
+
|
|
45
|
+
${lintLines.length ? [
|
|
46
|
+
`This package includes several forms of linting to enforce consistent code quality and styling.`,
|
|
47
|
+
`Each should be shown in VS Code, and can be run manually on the command-line:`,
|
|
48
|
+
``,
|
|
49
|
+
`- \`pnpm lint\` ([ESLint](https://eslint.org) with [typescript-eslint](https://typescript-eslint.io)): Lints JavaScript and TypeScript source files`,
|
|
50
|
+
...lintLines,
|
|
51
|
+
``,
|
|
52
|
+
`Read the individual documentation for each linter to understand how it can be configured and used best.`,
|
|
53
|
+
``,
|
|
54
|
+
`For example, ESLint can be run with \`--fix\` to auto-fix some lint rule complaints:`
|
|
55
|
+
].join("\n") : `[ESLint](https://eslint.org) is used with with [typescript-eslint](https://typescript-eslint.io)) to lint JavaScript and TypeScript source files.
|
|
56
|
+
You can run it locally on the command-line:
|
|
57
|
+
|
|
58
|
+
\`\`\`shell
|
|
59
|
+
pnpm run lint
|
|
60
|
+
\`\`\`
|
|
61
|
+
|
|
62
|
+
ESLint can be run with \`--fix\` to auto-fix some lint rule complaints:`}
|
|
63
|
+
|
|
64
|
+
\`\`\`shell
|
|
65
|
+
pnpm run lint --fix
|
|
66
|
+
\`\`\`
|
|
67
|
+
|
|
68
|
+
${!options.excludeTests && `## Testing
|
|
69
|
+
|
|
70
|
+
[Vitest](https://vitest.dev) is used for tests.
|
|
71
|
+
You can run it locally on the command-line:
|
|
72
|
+
|
|
73
|
+
\`\`\`shell
|
|
74
|
+
pnpm run test
|
|
75
|
+
\`\`\`
|
|
76
|
+
|
|
77
|
+
Add the \`--coverage\` flag to compute test coverage and place reports in the \`coverage/\` directory:
|
|
78
|
+
|
|
79
|
+
\`\`\`shell
|
|
80
|
+
pnpm run test --coverage
|
|
81
|
+
\`\`\`
|
|
82
|
+
|
|
83
|
+
Note that [console-fail-test](https://github.com/JoshuaKGoldberg/console-fail-test) is enabled for all test runs.
|
|
84
|
+
Calls to \`console.log\`, \`console.warn\`, and other console methods will cause a test to fail.
|
|
85
|
+
|
|
86
|
+
### Debugging Tests
|
|
87
|
+
|
|
88
|
+
This repository includes a [VS Code launch configuration](https://code.visualstudio.com/docs/editor/debugging) for debugging unit tests.
|
|
89
|
+
To launch it, open a test file, then run _Debug Current Test File_ from the VS Code Debug panel (or press F5).
|
|
90
|
+
`}
|
|
91
|
+
`;
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
createDevelopment
|
|
95
|
+
};
|
|
96
|
+
//# sourceMappingURL=createDevelopment.js.map
|
|
@@ -0,0 +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\toptions.excludeLintKnip &&\n\t\t\t`- \\`pnpm lint:knip\\` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports`,\n\t\toptions.excludeLintMd &&\n\t\t\t`- \\`pnpm lint:md\\` ([Markdownlint](https://github.com/DavidAnson/markdownlint)): Checks Markdown source files`,\n\t\toptions.excludeLintPackageJson &&\n\t\t\t`- \\`pnpm lint:package-json\\` ([npm-package-json-lint](https://npmpackagejsonlint.org/)): Lints the \\`package.json\\` file`,\n\t\toptions.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\toptions.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 [TypeScript](https://typescriptlang.org) locally to type check and build source files from \\`src/\\` into output files in \\`lib/\\`:\n\n\\`\\`\\`shell\npnpm build --watch\n\\`\\`\\`\n\nYou should also see suggestions from TypeScript in your editor.\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`;\n}\n"],"mappings":"AAEO,SAAS,kBAAkB,SAAkB;AACnD,QAAM,YAAY;AAAA,IACjB,QAAQ,mBACP;AAAA,IACD,QAAQ,iBACP;AAAA,IACD,QAAQ,0BACP;AAAA,IACD,QAAQ,uBACP;AAAA,IACD,QAAQ,uBACP;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,EA+BtB,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;AAEA;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Options } from '../../../../shared/types.js';
|
|
2
|
+
|
|
3
|
+
declare function createDotGitHubFiles(options: Options): Promise<{
|
|
4
|
+
"renovate.json"?: string | undefined;
|
|
5
|
+
"ISSUE_TEMPLATE.md": string;
|
|
6
|
+
"PULL_REQUEST_TEMPLATE.md": string;
|
|
7
|
+
"SECURITY.md": string;
|
|
8
|
+
"FUNDING.yml"?: string | undefined;
|
|
9
|
+
"CODE_OF_CONDUCT.md": string;
|
|
10
|
+
"CONTRIBUTING.md": string;
|
|
11
|
+
"DEVELOPMENT.md": string;
|
|
12
|
+
}>;
|
|
13
|
+
|
|
14
|
+
export { createDotGitHubFiles };
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { formatJson } from "../formatters/formatJson.js";
|
|
2
|
+
import { formatYaml } from "../formatters/formatYaml.js";
|
|
3
|
+
import { createDevelopment } from "./createDevelopment.js";
|
|
4
|
+
async function createDotGitHubFiles(options) {
|
|
5
|
+
return {
|
|
6
|
+
"CODE_OF_CONDUCT.md": `# Contributor Covenant Code of Conduct
|
|
7
|
+
|
|
8
|
+
## Our Pledge
|
|
9
|
+
|
|
10
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
11
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
12
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
13
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
14
|
+
nationality, personal appearance, race, caste, color, religion, or sexual
|
|
15
|
+
identity and orientation.
|
|
16
|
+
|
|
17
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
18
|
+
diverse, inclusive, and healthy community.
|
|
19
|
+
|
|
20
|
+
## Our Standards
|
|
21
|
+
|
|
22
|
+
Examples of behavior that contributes to a positive environment for our
|
|
23
|
+
community include:
|
|
24
|
+
|
|
25
|
+
- Demonstrating empathy and kindness toward other people
|
|
26
|
+
- Being respectful of differing opinions, viewpoints, and experiences
|
|
27
|
+
- Giving and gracefully accepting constructive feedback
|
|
28
|
+
- Accepting responsibility and apologizing to those affected by our mistakes,
|
|
29
|
+
and learning from the experience
|
|
30
|
+
- Focusing on what is best not just for us as individuals, but for the overall
|
|
31
|
+
community
|
|
32
|
+
|
|
33
|
+
Examples of unacceptable behavior include:
|
|
34
|
+
|
|
35
|
+
- The use of sexualized language or imagery, and sexual attention or advances of
|
|
36
|
+
any kind
|
|
37
|
+
- Trolling, insulting or derogatory comments, and personal or political attacks
|
|
38
|
+
- Public or private harassment
|
|
39
|
+
- Publishing others' private information, such as a physical or email address,
|
|
40
|
+
without their explicit permission
|
|
41
|
+
- Other conduct which could reasonably be considered inappropriate in a
|
|
42
|
+
professional setting
|
|
43
|
+
|
|
44
|
+
## Enforcement Responsibilities
|
|
45
|
+
|
|
46
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
47
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
48
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
49
|
+
or harmful.
|
|
50
|
+
|
|
51
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
52
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
53
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
54
|
+
decisions when appropriate.
|
|
55
|
+
|
|
56
|
+
## Scope
|
|
57
|
+
|
|
58
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
59
|
+
an individual is officially representing the community in public spaces.
|
|
60
|
+
Examples of representing our community include using an official e-mail address,
|
|
61
|
+
posting via an official social media account, or acting as an appointed
|
|
62
|
+
representative at an online or offline event.
|
|
63
|
+
|
|
64
|
+
## Enforcement
|
|
65
|
+
|
|
66
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
67
|
+
reported to the community leaders responsible for enforcement at
|
|
68
|
+
${options.email}.
|
|
69
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
|
70
|
+
|
|
71
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
72
|
+
reporter of any incident.
|
|
73
|
+
|
|
74
|
+
## Enforcement Guidelines
|
|
75
|
+
|
|
76
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
|
77
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
|
78
|
+
|
|
79
|
+
### 1. Correction
|
|
80
|
+
|
|
81
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
82
|
+
unprofessional or unwelcome in the community.
|
|
83
|
+
|
|
84
|
+
**Consequence**: A private, written warning from community leaders, providing
|
|
85
|
+
clarity around the nature of the violation and an explanation of why the
|
|
86
|
+
behavior was inappropriate. A public apology may be requested.
|
|
87
|
+
|
|
88
|
+
### 2. Warning
|
|
89
|
+
|
|
90
|
+
**Community Impact**: A violation through a single incident or series of
|
|
91
|
+
actions.
|
|
92
|
+
|
|
93
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
|
94
|
+
interaction with the people involved, including unsolicited interaction with
|
|
95
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
|
96
|
+
includes avoiding interactions in community spaces as well as external channels
|
|
97
|
+
like social media. Violating these terms may lead to a temporary or permanent
|
|
98
|
+
ban.
|
|
99
|
+
|
|
100
|
+
### 3. Temporary Ban
|
|
101
|
+
|
|
102
|
+
**Community Impact**: A serious violation of community standards, including
|
|
103
|
+
sustained inappropriate behavior.
|
|
104
|
+
|
|
105
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
|
106
|
+
communication with the community for a specified period of time. No public or
|
|
107
|
+
private interaction with the people involved, including unsolicited interaction
|
|
108
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
|
109
|
+
Violating these terms may lead to a permanent ban.
|
|
110
|
+
|
|
111
|
+
### 4. Permanent Ban
|
|
112
|
+
|
|
113
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
|
114
|
+
standards, including sustained inappropriate behavior, harassment of an
|
|
115
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
|
116
|
+
|
|
117
|
+
**Consequence**: A permanent ban from any sort of public interaction within the
|
|
118
|
+
community.
|
|
119
|
+
|
|
120
|
+
## Attribution
|
|
121
|
+
|
|
122
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
123
|
+
version 2.1, available at
|
|
124
|
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
125
|
+
|
|
126
|
+
Community Impact Guidelines were inspired by
|
|
127
|
+
[Mozilla's code of conduct enforcement ladder][mozilla coc].
|
|
128
|
+
|
|
129
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
130
|
+
[https://www.contributor-covenant.org/faq][faq]. Translations are available at
|
|
131
|
+
[https://www.contributor-covenant.org/translations][translations].
|
|
132
|
+
|
|
133
|
+
[homepage]: https://www.contributor-covenant.org
|
|
134
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
135
|
+
[mozilla coc]: https://github.com/mozilla/diversity
|
|
136
|
+
[faq]: https://www.contributor-covenant.org/faq
|
|
137
|
+
[translations]: https://www.contributor-covenant.org/translations
|
|
138
|
+
`,
|
|
139
|
+
"CONTRIBUTING.md": `# Contributing
|
|
140
|
+
|
|
141
|
+
Thanks for your interest in contributing to \`${options.repository}\`! \u{1F496}
|
|
142
|
+
|
|
143
|
+
> After this page, see [DEVELOPMENT.md](./DEVELOPMENT.md) for local development instructions.
|
|
144
|
+
|
|
145
|
+
## Code of Conduct
|
|
146
|
+
|
|
147
|
+
This project contains a [Contributor Covenant code of conduct](./CODE_OF_CONDUCT.md) all contributors are expected to follow.
|
|
148
|
+
|
|
149
|
+
## Reporting Issues
|
|
150
|
+
|
|
151
|
+
Please do [report an issue on the issue tracker](https://github.com/${options.owner}/${options.repository}/issues/new/choose) if there's any bugfix, documentation improvement, or general enhancement you'd like to see in the repository! Please fully fill out all required fields in the most appropriate issue form.
|
|
152
|
+
|
|
153
|
+
## Sending Contributions
|
|
154
|
+
|
|
155
|
+
Sending your own changes as contribution is always appreciated!
|
|
156
|
+
There are two steps involved:
|
|
157
|
+
|
|
158
|
+
1. [Finding an Issue](#finding-an-issue)
|
|
159
|
+
2. [Sending a Pull Request](#sending-a-pull-request)
|
|
160
|
+
|
|
161
|
+
### Finding an Issue
|
|
162
|
+
|
|
163
|
+
With the exception of very small typos, all changes to this repository generally need to correspond to an [open issue marked as \`accepting prs\` on the issue tracker](https://github.com/${options.owner}/${options.repository}/issues?q=is%3Aopen+is%3Aissue+label%3A%22accepting+prs%22).
|
|
164
|
+
If this is your first time contributing, consider searching for [unassigned issues that also have the \`good first issue\` label](https://github.com/${options.owner}/${options.repository}/issues?q=is%3Aopen+is%3Aissue+label%3A%22accepting+prs%22+label%3A%22good+first+issue%22+no%3Aassignee).
|
|
165
|
+
If the issue you'd like to fix isn't found on the issue, see [Reporting Issues](#reporting-issues) for filing your own (please do!).
|
|
166
|
+
|
|
167
|
+
### Sending a Pull Request
|
|
168
|
+
|
|
169
|
+
Once you've identified an open issue accepting PRs that doesn't yet have a PR sent, you're free to send a pull request.
|
|
170
|
+
Be sure to fill out the pull request template's requested information -- otherwise your PR will likely be closed.
|
|
171
|
+
|
|
172
|
+
PRs are also expected to have a title that adheres to [commitlint](https://github.com/conventional-changelog/commitlint).
|
|
173
|
+
Only PR titles need to be in that format, not individual commits.
|
|
174
|
+
Don't worry if you get this wrong: you can always change the PR title after sending it.
|
|
175
|
+
Check [previously merged PRs](https://github.com/${options.owner}/${options.repository}/pulls?q=is%3Apr+is%3Amerged+-label%3Adependencies+) for reference.
|
|
176
|
+
|
|
177
|
+
#### Draft PRs
|
|
178
|
+
|
|
179
|
+
If you don't think your PR is ready for review, [set it as a draft](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#converting-a-pull-request-to-a-draft).
|
|
180
|
+
Draft PRs won't be reviewed.
|
|
181
|
+
|
|
182
|
+
#### Granular PRs
|
|
183
|
+
|
|
184
|
+
Please keep pull requests single-purpose: in other words, don't attempt to solve multiple unrelated problems in one pull request.
|
|
185
|
+
Send one PR per area of concern.
|
|
186
|
+
Multi-purpose pull requests are harder and slower to review, block all changes from being merged until the whole pull request is reviewed, and are difficult to name well with semantic PR titles.
|
|
187
|
+
|
|
188
|
+
#### Pull Request Reviews
|
|
189
|
+
|
|
190
|
+
When a PR is not in draft, it's considered ready for review.
|
|
191
|
+
Please don't manually \`@\` tag anybody to request review.
|
|
192
|
+
A maintainer will look at it when they're next able to.
|
|
193
|
+
|
|
194
|
+
PRs should have passing [GitHub status checks](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks) before review is requested (unless there are explicit questions asked in the PR about any failures).
|
|
195
|
+
|
|
196
|
+
#### Asking Questions
|
|
197
|
+
|
|
198
|
+
If you need help and/or have a question, posting a comment in the PR is a great way to do so.
|
|
199
|
+
There's no need to tag anybody individually.
|
|
200
|
+
One of us will drop by and help when we can.
|
|
201
|
+
|
|
202
|
+
Please post comments as [line comments](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request) when possible, so that they can be threaded.
|
|
203
|
+
You can [resolve conversations](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/commenting-on-a-pull-request#resolving-conversations) on your own when you feel they're resolved - no need to comment explicitly and/or wait for a maintainer.
|
|
204
|
+
|
|
205
|
+
#### Requested Changes
|
|
206
|
+
|
|
207
|
+
After a maintainer reviews your PR, they may request changes on it.
|
|
208
|
+
Once you've made those changes, [re-request review on GitHub](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/about-pull-request-reviews#re-requesting-a-review).
|
|
209
|
+
|
|
210
|
+
Please try not to force-push commits to PRs that have already been reviewed.
|
|
211
|
+
Doing so makes it harder to review the changes.
|
|
212
|
+
We squash merge all commits so there's no need to try to preserve Git history within a PR branch.
|
|
213
|
+
|
|
214
|
+
Once you've addressed all our feedback by making code changes and/or started a followup discussion, [re-request review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/about-pull-request-reviews#re-requesting-a-review) from each maintainer whose feedback you addressed.
|
|
215
|
+
|
|
216
|
+
Once all feedback is addressed and the PR is approved, we'll ensure the branch is up to date with \`main\` and merge it for you.
|
|
217
|
+
|
|
218
|
+
#### Post-Merge Recognition
|
|
219
|
+
|
|
220
|
+
Once your PR is merged, if you haven't yet been added to the [_Contributors_ table in the README.md](../README.md#contributors) for its [type of contribution](https://allcontributors.org/docs/en/emoji-key "Allcontributors emoji key"), you should be soon.
|
|
221
|
+
Please do ping the maintainer who merged your PR if that doesn't happen within 24 hours - it was likely an oversight on our end!
|
|
222
|
+
|
|
223
|
+
## Emojis & Appreciation
|
|
224
|
+
|
|
225
|
+
If you made it all the way to the end, bravo dear user, we love you.
|
|
226
|
+
Please include your favorite emoji in the bottom of your issues and PRs to signal to us that you did in fact read this file and are trying to conform to it as best as possible.
|
|
227
|
+
\u{1F496} is a good starter if you're not sure which to use.
|
|
228
|
+
`,
|
|
229
|
+
"DEVELOPMENT.md": createDevelopment(options),
|
|
230
|
+
...options.funding && {
|
|
231
|
+
"FUNDING.yml": formatYaml({ github: options.funding })
|
|
232
|
+
},
|
|
233
|
+
"ISSUE_TEMPLATE.md": `<!-- Note: Please must use one of our issue templates to file an issue! \u{1F6D1} -->
|
|
234
|
+
<!-- \u{1F449} https://github.com/${options.owner}/${options.repository}/issues/new/choose \u{1F448} -->
|
|
235
|
+
<!-- **Issues that should have been filed with a template will be closed without action, and we will ask you to use a template.** -->
|
|
236
|
+
|
|
237
|
+
<!-- This blank issue template is only for issues that don't fit any of the templates. -->
|
|
238
|
+
|
|
239
|
+
## Overview
|
|
240
|
+
|
|
241
|
+
...
|
|
242
|
+
`,
|
|
243
|
+
"PULL_REQUEST_TEMPLATE.md": `<!-- \u{1F44B} Hi, thanks for sending a PR to ${options.repository}! \u{1F496}.
|
|
244
|
+
Please fill out all fields below and make sure each item is true and [x] checked.
|
|
245
|
+
Otherwise we may not be able to review your PR. -->
|
|
246
|
+
|
|
247
|
+
## PR Checklist
|
|
248
|
+
|
|
249
|
+
- [ ] Addresses an existing open issue: fixes #000
|
|
250
|
+
- [ ] That issue was marked as [\`status: accepting prs\`](https://github.com/${options.owner}/${options.repository}/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22)
|
|
251
|
+
- [ ] Steps in [CONTRIBUTING.md](https://github.com/${options.owner}/${options.repository}/blob/main/.github/CONTRIBUTING.md) were taken
|
|
252
|
+
|
|
253
|
+
## Overview
|
|
254
|
+
|
|
255
|
+
<!-- Description of what is changed and how the code change does that. -->
|
|
256
|
+
`,
|
|
257
|
+
"SECURITY.md": `# Security Policy
|
|
258
|
+
|
|
259
|
+
We take all security vulnerabilities seriously.
|
|
260
|
+
If you have a vulnerability or other security issues to disclose:
|
|
261
|
+
|
|
262
|
+
- Thank you very much, please do!
|
|
263
|
+
- Please send them to us by emailing \`${options.email}\`
|
|
264
|
+
|
|
265
|
+
We appreciate your efforts and responsible disclosure and will make every effort to acknowledge your contributions.
|
|
266
|
+
`,
|
|
267
|
+
...!options.excludeRenovate && {
|
|
268
|
+
"renovate.json": await formatJson({
|
|
269
|
+
$schema: "https://docs.renovatebot.com/renovate-schema.json",
|
|
270
|
+
automerge: true,
|
|
271
|
+
internalChecksFilter: "strict",
|
|
272
|
+
labels: ["dependencies"],
|
|
273
|
+
postUpdateOptions: ["pnpmDedupe"],
|
|
274
|
+
stabilityDays: 3
|
|
275
|
+
})
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
export {
|
|
280
|
+
createDotGitHubFiles
|
|
281
|
+
};
|
|
282
|
+
//# sourceMappingURL=createDotGitHubFiles.js.map
|