create-typescript-app 2.68.1 → 2.69.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.
@@ -8,6 +8,7 @@ import { blockREADME } from "./blockREADME.mjs";
8
8
  import { blockPrettier } from "./blockPrettier.mjs";
9
9
  import { blockRepositorySecrets } from "./blockRepositorySecrets.mjs";
10
10
  import _ from "lodash";
11
+ import { contributionTypes, createContributionLink, isContributionTypeName } from "all-contributors-types";
11
12
  //#region src/blocks/blockAllContributors.ts
12
13
  const blockAllContributors = base.createBlock({
13
14
  about: { name: "AllContributors" },
@@ -31,7 +32,10 @@ const blockAllContributors = base.createBlock({
31
32
  href: "#contributors",
32
33
  src: `https://img.shields.io/badge/%F0%9F%91%AA_all_contributors-${contributions}-21bb42.svg`
33
34
  }],
34
- sections: options.contributors ? [printAllContributorsTable(options.contributors)] : void 0
35
+ sections: options.contributors ? [printAllContributorsTable(options.contributors, {
36
+ projectName: options.repository,
37
+ projectOwner: options.owner
38
+ })] : void 0
35
39
  }),
36
40
  blockRepositorySecrets({ secrets: [{
37
41
  description: "a GitHub PAT with repo and workflow permissions",
@@ -73,7 +77,7 @@ const blockAllContributors = base.createBlock({
73
77
  };
74
78
  }
75
79
  });
76
- function printAllContributorsTable(contributors) {
80
+ function printAllContributorsTable(contributors, project) {
77
81
  return [
78
82
  `## Contributors`,
79
83
  ``,
@@ -84,7 +88,7 @@ function printAllContributorsTable(contributors) {
84
88
  ` <tbody>`,
85
89
  ` <tr>`,
86
90
  ..._.sortBy(contributors, "name").flatMap((contributor, i) => {
87
- const row = printContributorCell(contributor);
91
+ const row = printContributorCell(contributor, project);
88
92
  return i && i % 7 === 0 ? [
89
93
  ` </tr>`,
90
94
  ` <tr>`,
@@ -101,26 +105,19 @@ function printAllContributorsTable(contributors) {
101
105
  `<!-- spellchecker: enable -->`
102
106
  ].join("\n");
103
107
  }
104
- function printContributorCell(contributor) {
108
+ function printContributorCell(contributor, project) {
105
109
  return [
106
110
  ` <td align="center" valign="top" width="14.28%">`,
107
111
  `<a href="${contributor.profile}">`,
108
112
  `<img src="${contributor.avatar_url}?s=100" width="100px;" alt="${contributor.name}"/>`,
109
113
  `<br />`,
110
114
  `<sub><b>${contributor.name}</b></sub></a><br />`,
111
- contributor.contributions.map((contribution) => {
112
- switch (contribution) {
113
- case "bug": return `<a href="https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=author%3A${contributor.login}" title="Bug reports">🐛</a>`;
114
- case "code": return `<a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=${contributor.login}" title="Code">💻</a>`;
115
- case "design": return `<a href="#design-${contributor.login}" title="Design">🎨</a>`;
116
- case "doc": return `<a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=${contributor.login}" title="Documentation">📖</a>`;
117
- case "ideas": return `<a href="#ideas-${contributor.login}" title="Ideas, Planning, & Feedback">🤔</a>`;
118
- case "infra": return `<a href="#infra-${contributor.login}" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a>`;
119
- case "maintenance": return `<a href="#maintenance-${contributor.login}" title="Maintenance">🚧</a>`;
120
- case "review": return `<a href="https://github.com/JoshuaKGoldberg/create-typescript-app/pulls?q=is%3Apr+reviewed-by%3A${contributor.login}" title="Reviewed Pull Requests">👀</a>`;
121
- case "test": return `<a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=${contributor.login}" title="Tests">⚠️</a>`;
122
- case "tool": return `<a href="#tool-${contributor.login}" title="Tools">🔧</a>`;
123
- }
115
+ contributor.contributions.filter(isContributionTypeName).map((contribution) => {
116
+ const { description, symbol } = contributionTypes[contribution];
117
+ return `<a href="${createContributionLink(contribution, {
118
+ ...project,
119
+ login: contributor.login
120
+ })}" title="${description}">${symbol}</a>`;
124
121
  }).join(" "),
125
122
  `</td>`
126
123
  ].join("");
@@ -1,5 +1,12 @@
1
1
  //#region src/blocks/blockGitHubIssueTemplates.d.ts
2
- export declare const blockGitHubIssueTemplates: import("bingo-stratum").BlockWithoutAddons<{
2
+ export declare const blockGitHubIssueTemplates: import("bingo-stratum").BlockWithAddons<{
3
+ checklists: {
4
+ bug?: string[] | undefined;
5
+ documentation?: string[] | undefined;
6
+ feature?: string[] | undefined;
7
+ tooling?: string[] | undefined;
8
+ };
9
+ }, {
3
10
  access: "public" | "restricted";
4
11
  description: string;
5
12
  directory: string;
@@ -1,10 +1,23 @@
1
1
  import { base } from "../base.mjs";
2
2
  import { formatYaml } from "./files/formatYaml.mjs";
3
3
  import { withPreviously } from "./files/withPreviously.mjs";
4
+ import { z } from "zod";
4
5
  //#region src/blocks/blockGitHubIssueTemplates.ts
6
+ const zChecklist = z.array(z.string()).optional();
5
7
  const blockGitHubIssueTemplates = base.createBlock({
6
8
  about: { name: "GitHub Issue Templates" },
7
- produce({ options }) {
9
+ addons: { checklists: z.object({
10
+ bug: zChecklist,
11
+ documentation: zChecklist,
12
+ feature: zChecklist,
13
+ tooling: zChecklist
14
+ }).default({}) },
15
+ produce({ addons, options }) {
16
+ const { checklists } = addons;
17
+ const createChecklistOptions = (labels = []) => [...labels.toSorted(), `I have [searched for related issues](https://github.com/${options.owner}/${options.repository}/issues?q=is%3Aissue) and found none that matched my issue.`].map((label) => ({
18
+ label,
19
+ required: true
20
+ }));
8
21
  return { files: { ".github": {
9
22
  ISSUE_TEMPLATE: {
10
23
  "01-bug.yaml": withPreviously(formatYaml({
@@ -13,20 +26,7 @@ const blockGitHubIssueTemplates = base.createBlock({
13
26
  attributes: {
14
27
  description: "If any of these required steps are not taken, we may not be able to review your issue. Help us to help you!",
15
28
  label: "Bug Report Checklist",
16
- options: [
17
- {
18
- label: "I have tried restarting my IDE and the issue persists.",
19
- required: true
20
- },
21
- {
22
- label: "I have pulled in the newest version of the project.",
23
- required: true
24
- },
25
- {
26
- label: `I have [searched for related issues](https://github.com/${options.owner}/${options.repository}/issues?q=is%3Aissue) and found none that matched my issue.`,
27
- required: true
28
- }
29
- ]
29
+ options: createChecklistOptions(checklists.bug)
30
30
  },
31
31
  type: "checkboxes"
32
32
  },
@@ -65,13 +65,7 @@ const blockGitHubIssueTemplates = base.createBlock({
65
65
  attributes: {
66
66
  description: "If any of these required steps are not taken, we may not be able to review your issue. Help us to help you!",
67
67
  label: "Documentation Report Checklist",
68
- options: [{
69
- label: "I have looked at the latest `main` branch of the repository.",
70
- required: true
71
- }, {
72
- label: `I have [searched for related issues](https://github.com/${options.owner}/${options.repository}/issues?q=is%3Aissue) and found none that matched my issue.`,
73
- required: true
74
- }]
68
+ options: createChecklistOptions([...checklists.documentation ?? [], "I have looked at the latest `main` branch of the repository."])
75
69
  },
76
70
  type: "checkboxes"
77
71
  },
@@ -102,13 +96,7 @@ const blockGitHubIssueTemplates = base.createBlock({
102
96
  attributes: {
103
97
  description: "If any of these required steps are not taken, we may not be able to review your issue. Help us to help you!",
104
98
  label: "Feature Request Checklist",
105
- options: [{
106
- label: "I have looked at the latest version of the project.",
107
- required: true
108
- }, {
109
- label: `I have [searched for related issues](https://github.com/${options.owner}/${options.repository}/issues?q=is%3Aissue) and found none that matched my issue.`,
110
- required: true
111
- }]
99
+ options: createChecklistOptions(checklists.feature)
112
100
  },
113
101
  type: "checkboxes"
114
102
  },
@@ -139,20 +127,7 @@ const blockGitHubIssueTemplates = base.createBlock({
139
127
  attributes: {
140
128
  description: "If any of these required steps are not taken, we may not be able to review your issue. Help us to help you!",
141
129
  label: "Tooling Report Checklist",
142
- options: [
143
- {
144
- label: "I have tried restarting my IDE and the issue persists.",
145
- required: true
146
- },
147
- {
148
- label: "I have pulled in the newest version of the project.",
149
- required: true
150
- },
151
- {
152
- label: `I have [searched for related issues](https://github.com/${options.owner}/${options.repository}/issues?q=is%3Aissue) and found none that matched my issue.`,
153
- required: true
154
- }
155
- ]
130
+ options: createChecklistOptions([...checklists.tooling ?? [], "I have pulled in the newest version of the project."])
156
131
  },
157
132
  type: "checkboxes"
158
133
  },
@@ -2,6 +2,7 @@ import { base } from "../base.mjs";
2
2
  import { blockGitHubActionsCI } from "./blockGitHubActionsCI.mjs";
3
3
  import { blockDevelopmentDocs } from "./blockDevelopmentDocs.mjs";
4
4
  import { blockPackageJson } from "./blockPackageJson.mjs";
5
+ import { blockGitHubIssueTemplates } from "./blockGitHubIssueTemplates.mjs";
5
6
  import { blockCSpell } from "./blockCSpell.mjs";
6
7
  import { blockESLint } from "./blockESLint.mjs";
7
8
  import { blockGitignore } from "./blockGitignore.mjs";
@@ -14,7 +15,7 @@ const blockNcc = base.createBlock({
14
15
  intake({ options }) {
15
16
  return { entry: options.packageData?.scripts?.["build:release"]?.match(/ncc build (.+) -o dist/)?.[1] };
16
17
  },
17
- produce({ addons }) {
18
+ produce({ addons, options }) {
18
19
  const { entry = "src/index.ts" } = addons;
19
20
  return { addons: [
20
21
  blockCSpell({ ignorePaths: ["dist"] }),
@@ -62,6 +63,10 @@ if [ -n "$changes" ]; then
62
63
  fi
63
64
  ` }]
64
65
  }] }),
66
+ blockGitHubIssueTemplates({ checklists: {
67
+ bug: ["I have checked the workflow run logs for errors.", `I have tried the [latest release](https://github.com/${options.owner}/${options.repository}/releases/latest) of this action and the issue persists.`],
68
+ feature: [`I have looked at the [latest release](https://github.com/${options.owner}/${options.repository}/releases/latest) of this action.`]
69
+ } }),
65
70
  blockGitignore({ ignores: ["/dist/**/*.d.ts", "/dist/**/*.d.ts.map"] }),
66
71
  blockPackageJson({ properties: {
67
72
  devDependencies: { "@vercel/ncc": "^0.38.3" },
@@ -9,6 +9,7 @@ import { blockDevelopmentDocs } from "./blockDevelopmentDocs.mjs";
9
9
  import { intakeFileAsJson } from "./intake/intakeFileAsJson.mjs";
10
10
  import { blockPackageJson } from "./blockPackageJson.mjs";
11
11
  import { blockRemoveWorkflows } from "./blockRemoveWorkflows.mjs";
12
+ import { blockGitHubIssueTemplates } from "./blockGitHubIssueTemplates.mjs";
12
13
  import { blockRemoveDependencies } from "./blockRemoveDependencies.mjs";
13
14
  import { blockESLint } from "./blockESLint.mjs";
14
15
  import { blockGitignore } from "./blockGitignore.mjs";
@@ -78,6 +79,10 @@ pnpm build --watch
78
79
  name: "Build",
79
80
  steps: [{ run: "pnpm build" }, ...runInCI.map((run) => ({ run }))]
80
81
  }] }),
82
+ blockGitHubIssueTemplates({ checklists: {
83
+ bug: ["I have pulled in the newest version of the project.", "I have tried restarting my IDE and the issue persists."],
84
+ feature: ["I have looked at the latest version of the project."]
85
+ } }),
81
86
  blockPackageJson({ properties: {
82
87
  devDependencies: getPackageDependencies("tsdown"),
83
88
  scripts: { build: "tsdown" }
@@ -2,6 +2,7 @@ import { base } from "../base.mjs";
2
2
  import { formatFile } from "../utils/formatFile.mjs";
3
3
  import { blockDevelopmentDocs } from "./blockDevelopmentDocs.mjs";
4
4
  import { getPrimaryBin } from "./bin/getPrimaryBin.mjs";
5
+ import { blockGitHubIssueTemplates } from "./blockGitHubIssueTemplates.mjs";
5
6
  import { z } from "zod";
6
7
  import sortKeys from "sort-keys";
7
8
  //#region src/blocks/blockVSCode.ts
@@ -36,7 +37,7 @@ To launch it, open a test file, then run _Debug Current Test File_ from the VS C
36
37
  heading: "Debugging Tests"
37
38
  }] }
38
39
  }
39
- })],
40
+ }), blockGitHubIssueTemplates({ checklists: { tooling: ["I have tried restarting my IDE and the issue persists."] } })],
40
41
  files: { ".vscode": {
41
42
  "extensions.json": extensions?.length ? formatFile(".vscode/extensions.json", JSON.stringify({ recommendations: [...extensions].sort() })) : void 0,
42
43
  "launch.json": debuggers?.length ? formatFile(".vscode/launch.json", JSON.stringify({
@@ -2,6 +2,7 @@ import { base } from "../base.mjs";
2
2
  import { blockGitHubActionsCI } from "./blockGitHubActionsCI.mjs";
3
3
  import { blockDevelopmentDocs } from "./blockDevelopmentDocs.mjs";
4
4
  import { blockPackageJson } from "./blockPackageJson.mjs";
5
+ import { blockGitHubIssueTemplates } from "./blockGitHubIssueTemplates.mjs";
5
6
  import { blockCSpell } from "./blockCSpell.mjs";
6
7
  import { blockESLint } from "./blockESLint.mjs";
7
8
  import { blockGitignore } from "./blockGitignore.mjs";
@@ -78,6 +79,10 @@ Then upload that \`./web-ext-artifacts/refined_saved_replies-*.zip\` file to:
78
79
  name: "Lint Web-ext",
79
80
  steps: [{ run: "pnpm dev" }, { run: "pnpm lint:web-ext" }]
80
81
  }] }),
82
+ blockGitHubIssueTemplates({ checklists: {
83
+ bug: ["I have tried the latest version of the extension and the issue persists."],
84
+ feature: ["I have looked at the latest version of the extension."]
85
+ } }),
81
86
  blockGitignore({ ignores: [
82
87
  "*.zip",
83
88
  "/lib",
@@ -1822,7 +1822,14 @@ export declare const blocks: {
1822
1822
  pinned?: boolean | undefined;
1823
1823
  }>> | undefined;
1824
1824
  }>;
1825
- blockGitHubIssueTemplates: import("bingo-stratum").BlockWithoutAddons<{
1825
+ blockGitHubIssueTemplates: import("bingo-stratum").BlockWithAddons<{
1826
+ checklists: {
1827
+ bug?: string[] | undefined;
1828
+ documentation?: string[] | undefined;
1829
+ feature?: string[] | undefined;
1830
+ tooling?: string[] | undefined;
1831
+ };
1832
+ }, {
1826
1833
  access: "public" | "restricted";
1827
1834
  description: string;
1828
1835
  directory: string;
@@ -2,6 +2,7 @@ import { blockGitHubActionsCI } from "./blockGitHubActionsCI.mjs";
2
2
  import { blockAreTheTypesWrong } from "./blockAreTheTypesWrong.mjs";
3
3
  import { blockDevelopmentDocs } from "./blockDevelopmentDocs.mjs";
4
4
  import { blockPackageJson } from "./blockPackageJson.mjs";
5
+ import { blockGitHubIssueTemplates } from "./blockGitHubIssueTemplates.mjs";
5
6
  import { blockVSCode } from "./blockVSCode.mjs";
6
7
  import { blockCSpell } from "./blockCSpell.mjs";
7
8
  import { blockCTATransitions } from "./blockCTATransitions.mjs";
@@ -25,7 +26,6 @@ import { blockBin } from "./blockBin.mjs";
25
26
  import { blockContributingDocs } from "./blockContributingDocs.mjs";
26
27
  import { blockContributorCovenant } from "./blockContributorCovenant.mjs";
27
28
  import { blockExports } from "./blockExports.mjs";
28
- import { blockGitHubIssueTemplates } from "./blockGitHubIssueTemplates.mjs";
29
29
  import { blockGitHubPRTemplate } from "./blockGitHubPRTemplate.mjs";
30
30
  import { blockMITLicense } from "./blockMITLicense.mjs";
31
31
  import { blockSecurityDocs } from "./blockSecurityDocs.mjs";
package/dist/index.mjs CHANGED
@@ -3,6 +3,7 @@ import { blockGitHubActionsCI } from "./blocks/blockGitHubActionsCI.mjs";
3
3
  import { blockAreTheTypesWrong } from "./blocks/blockAreTheTypesWrong.mjs";
4
4
  import { blockDevelopmentDocs } from "./blocks/blockDevelopmentDocs.mjs";
5
5
  import { blockPackageJson } from "./blocks/blockPackageJson.mjs";
6
+ import { blockGitHubIssueTemplates } from "./blocks/blockGitHubIssueTemplates.mjs";
6
7
  import { blockVSCode } from "./blocks/blockVSCode.mjs";
7
8
  import { blockCSpell } from "./blocks/blockCSpell.mjs";
8
9
  import { blockCTATransitions } from "./blocks/blockCTATransitions.mjs";
@@ -26,7 +27,6 @@ import { blockBin } from "./blocks/blockBin.mjs";
26
27
  import { blockContributingDocs } from "./blocks/blockContributingDocs.mjs";
27
28
  import { blockContributorCovenant } from "./blocks/blockContributorCovenant.mjs";
28
29
  import { blockExports } from "./blocks/blockExports.mjs";
29
- import { blockGitHubIssueTemplates } from "./blocks/blockGitHubIssueTemplates.mjs";
30
30
  import { blockGitHubPRTemplate } from "./blocks/blockGitHubPRTemplate.mjs";
31
31
  import { blockMITLicense } from "./blocks/blockMITLicense.mjs";
32
32
  import { blockSecurityDocs } from "./blocks/blockSecurityDocs.mjs";
@@ -36,6 +36,7 @@ declare const _exports: {
36
36
  dependencies: {
37
37
  "@prettier/sync": string;
38
38
  "@typescript-eslint/typescript-estree": string;
39
+ "all-contributors-types": string;
39
40
  bingo: string;
40
41
  "bingo-fs": string;
41
42
  "bingo-stratum": string;
@@ -5,6 +5,7 @@ import { blockGitHubActionsCI } from "../blocks/blockGitHubActionsCI.mjs";
5
5
  import { blockDevelopmentDocs } from "../blocks/blockDevelopmentDocs.mjs";
6
6
  import { blockPackageJson } from "../blocks/blockPackageJson.mjs";
7
7
  import { blockRemoveWorkflows } from "../blocks/blockRemoveWorkflows.mjs";
8
+ import { blockGitHubIssueTemplates } from "../blocks/blockGitHubIssueTemplates.mjs";
8
9
  import { blockRemoveDependencies } from "../blocks/blockRemoveDependencies.mjs";
9
10
  import { blockESLint } from "../blocks/blockESLint.mjs";
10
11
  import { blockREADME } from "../blocks/blockREADME.mjs";
@@ -18,7 +19,6 @@ import { blockBin } from "../blocks/blockBin.mjs";
18
19
  import { blockContributingDocs } from "../blocks/blockContributingDocs.mjs";
19
20
  import { blockContributorCovenant } from "../blocks/blockContributorCovenant.mjs";
20
21
  import { blockExports } from "../blocks/blockExports.mjs";
21
- import { blockGitHubIssueTemplates } from "../blocks/blockGitHubIssueTemplates.mjs";
22
22
  import { blockGitHubPRTemplate } from "../blocks/blockGitHubPRTemplate.mjs";
23
23
  import { blockMITLicense } from "../blocks/blockMITLicense.mjs";
24
24
  import { blockRepositoryLabels } from "../blocks/blockRepositoryLabels.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-typescript-app",
3
- "version": "2.68.1",
3
+ "version": "2.69.0",
4
4
  "description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 🎁",
5
5
  "repository": {
6
6
  "type": "git",
@@ -35,6 +35,7 @@
35
35
  "dependencies": {
36
36
  "@prettier/sync": "^0.6.1",
37
37
  "@typescript-eslint/typescript-estree": "^8.67.0",
38
+ "all-contributors-types": "^0.1.0",
38
39
  "bingo": "^0.13.1",
39
40
  "bingo-fs": "^0.6.0",
40
41
  "bingo-stratum": "^0.7.1",