create-typescript-app 2.12.0 → 2.13.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.
@@ -6,6 +6,7 @@ import { resolveBin } from "../utils/resolveBin.js";
6
6
  import { blockDevelopmentDocs } from "./blockDevelopmentDocs.js";
7
7
  import { blockGitHubActionsCI } from "./blockGitHubActionsCI.js";
8
8
  import { blockPackageJson } from "./blockPackageJson.js";
9
+ import { blockRemoveWorkflows } from "./blockRemoveWorkflows.js";
9
10
  import { blockVSCode } from "./blockVSCode.js";
10
11
  import { CommandPhase } from "./phases.js";
11
12
  const filesGlob = `"**" ".github/**/*"`;
@@ -44,8 +45,7 @@ const blockCSpell = base.createBlock({
44
45
  name: "Lint Spelling",
45
46
  steps: [{ run: "pnpm lint:spelling" }]
46
47
  }
47
- ],
48
- removedWorkflows: ["lint-spelling", "spelling"]
48
+ ]
49
49
  }),
50
50
  blockPackageJson({
51
51
  properties: {
@@ -84,6 +84,15 @@ const blockCSpell = base.createBlock({
84
84
  }
85
85
  ]
86
86
  };
87
+ },
88
+ transition() {
89
+ return {
90
+ addons: [
91
+ blockRemoveWorkflows({
92
+ workflows: ["lint-spelling", "spelling"]
93
+ })
94
+ ]
95
+ };
87
96
  }
88
97
  });
89
98
  export {
@@ -9,6 +9,7 @@ import { blockGitHubActionsCI } from "./blockGitHubActionsCI.js";
9
9
  import { blockPackageJson } from "./blockPackageJson.js";
10
10
  import { blockRemoveDependencies } from "./blockRemoveDependencies.js";
11
11
  import { blockRemoveFiles } from "./blockRemoveFiles.js";
12
+ import { blockRemoveWorkflows } from "./blockRemoveWorkflows.js";
12
13
  import { blockVSCode } from "./blockVSCode.js";
13
14
  import { CommandPhase } from "./phases.js";
14
15
  const zRuleOptions = z.union([
@@ -141,8 +142,7 @@ Each should be shown in VS Code, and can be run manually on the command-line:
141
142
  { run: "pnpm lint" }
142
143
  ]
143
144
  }
144
- ],
145
- removedWorkflows: ["eslint", "lint"]
145
+ ]
146
146
  }),
147
147
  blockPackageJson({
148
148
  properties: {
@@ -218,6 +218,9 @@ export default tseslint.config(
218
218
  }),
219
219
  blockRemoveFiles({
220
220
  files: [".eslintrc*", ".eslintignore", "eslint.config.{cjs,mjs}"]
221
+ }),
222
+ blockRemoveWorkflows({
223
+ workflows: ["eslint", "lint"]
221
224
  })
222
225
  ]
223
226
  };
@@ -1,8 +1,9 @@
1
1
  import { base } from "../base.js";
2
2
  import { blockESLint } from "./blockESLint.js";
3
- import { blockGitHubActionsCI } from "./blockGitHubActionsCI.js";
4
3
  import { blockPackageJson } from "./blockPackageJson.js";
5
4
  import { blockRemoveDependencies } from "./blockRemoveDependencies.js";
5
+ import { blockRemoveFiles } from "./blockRemoveFiles.js";
6
+ import { blockRemoveWorkflows } from "./blockRemoveWorkflows.js";
6
7
  const blockESLintPackageJson = base.createBlock({
7
8
  about: {
8
9
  name: "ESLint package.json Plugin"
@@ -19,21 +20,30 @@ const blockESLintPackageJson = base.createBlock({
19
20
  }
20
21
  ]
21
22
  }),
22
- blockGitHubActionsCI({
23
- removedWorkflows: ["lint-package-json"]
24
- }),
25
23
  blockPackageJson({
26
24
  properties: {
27
25
  scripts: {
28
26
  "lint:package-json": void 0
29
27
  }
30
28
  }
29
+ })
30
+ ]
31
+ };
32
+ },
33
+ transition() {
34
+ return {
35
+ addons: [
36
+ blockRemoveFiles({
37
+ files: [".npmpackagejsonlintrc*"]
31
38
  }),
32
39
  blockRemoveDependencies({
33
40
  dependencies: [
34
41
  "npm-package-json-lint",
35
42
  "npm-package-json-lint-config-default"
36
43
  ]
44
+ }),
45
+ blockRemoveWorkflows({
46
+ workflows: ["lint-package-json"]
37
47
  })
38
48
  ]
39
49
  };
@@ -41,7 +41,6 @@ declare const blockGitHubActionsCI: bingo_stratum.BlockWithAddons<{
41
41
  if?: string | undefined;
42
42
  checkoutWith?: Record<string, string> | undefined;
43
43
  }[] | undefined;
44
- removedWorkflows?: string[] | undefined;
45
44
  }, {
46
45
  access: "public" | "restricted";
47
46
  description: string;
@@ -26,8 +26,7 @@ const blockGitHubActionsCI = base.createBlock({
26
26
  name: z.string(),
27
27
  steps: z.array(zActionStep)
28
28
  })
29
- ).optional(),
30
- removedWorkflows: z.array(z.string()).optional()
29
+ ).optional()
31
30
  },
32
31
  produce({ addons, options }) {
33
32
  const { jobs } = addons;
@@ -139,18 +138,11 @@ echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221."
139
138
  }
140
139
  };
141
140
  },
142
- transition({ addons }) {
143
- const { removedWorkflows = [] } = addons;
141
+ transition() {
144
142
  return {
145
143
  addons: [
146
144
  blockRemoveFiles({
147
- files: [
148
- ".circleci",
149
- "travis.yml",
150
- ...removedWorkflows.map(
151
- (removedWorkflow) => `.github/workflows/${removedWorkflow}.yml`
152
- )
153
- ]
145
+ files: [".circleci", "travis.yml"]
154
146
  })
155
147
  ]
156
148
  };
@@ -8,6 +8,7 @@ import { blockDevelopmentDocs } from "./blockDevelopmentDocs.js";
8
8
  import { blockGitHubActionsCI } from "./blockGitHubActionsCI.js";
9
9
  import { blockPackageJson } from "./blockPackageJson.js";
10
10
  import { blockRemoveFiles } from "./blockRemoveFiles.js";
11
+ import { blockRemoveWorkflows } from "./blockRemoveWorkflows.js";
11
12
  const blockKnip = base.createBlock({
12
13
  about: {
13
14
  name: "Knip"
@@ -36,8 +37,7 @@ const blockKnip = base.createBlock({
36
37
  name: "Lint Knip",
37
38
  steps: [{ run: "pnpm lint:knip" }]
38
39
  }
39
- ],
40
- removedWorkflows: ["knip", "lint-knip"]
40
+ ]
41
41
  }),
42
42
  blockPackageJson({
43
43
  properties: {
@@ -67,6 +67,9 @@ const blockKnip = base.createBlock({
67
67
  addons: [
68
68
  blockRemoveFiles({
69
69
  files: [".knip*", "knip.{c,m,t}*", "knip.js", "knip.jsonc"]
70
+ }),
71
+ blockRemoveWorkflows({
72
+ workflows: ["knip", "lint-knip"]
70
73
  })
71
74
  ]
72
75
  };
@@ -5,6 +5,7 @@ import { blockCSpell } from "./blockCSpell.js";
5
5
  import { blockDevelopmentDocs } from "./blockDevelopmentDocs.js";
6
6
  import { blockGitHubActionsCI } from "./blockGitHubActionsCI.js";
7
7
  import { blockPackageJson } from "./blockPackageJson.js";
8
+ import { blockRemoveWorkflows } from "./blockRemoveWorkflows.js";
8
9
  import { blockVSCode } from "./blockVSCode.js";
9
10
  import { formatIgnoreFile } from "./files/formatIgnoreFile.js";
10
11
  import { CommandPhase } from "./phases.js";
@@ -39,12 +40,6 @@ const blockMarkdownlint = base.createBlock({
39
40
  name: "Lint Markdown",
40
41
  steps: [{ run: "pnpm lint:md" }]
41
42
  }
42
- ],
43
- removedWorkflows: [
44
- "lint-md",
45
- "lint-markdown",
46
- "lint-markdownlint",
47
- "markdownlint"
48
43
  ]
49
44
  }),
50
45
  blockPackageJson({
@@ -85,6 +80,20 @@ const blockMarkdownlint = base.createBlock({
85
80
  }
86
81
  ]
87
82
  };
83
+ },
84
+ transition() {
85
+ return {
86
+ addons: [
87
+ blockRemoveWorkflows({
88
+ workflows: [
89
+ "lint-md",
90
+ "lint-markdown",
91
+ "lint-markdownlint",
92
+ "markdownlint"
93
+ ]
94
+ })
95
+ ]
96
+ };
88
97
  }
89
98
  });
90
99
  export {
@@ -2,6 +2,7 @@ import { base } from "../base.js";
2
2
  import { blockDevelopmentDocs } from "./blockDevelopmentDocs.js";
3
3
  import { blockGitHubActionsCI } from "./blockGitHubActionsCI.js";
4
4
  import { blockPackageJson } from "./blockPackageJson.js";
5
+ import { blockRemoveWorkflows } from "./blockRemoveWorkflows.js";
5
6
  const blockPnpmDedupe = base.createBlock({
6
7
  about: {
7
8
  name: "pnpm Dedupe"
@@ -26,8 +27,7 @@ const blockPnpmDedupe = base.createBlock({
26
27
  name: "Lint Packages",
27
28
  steps: [{ run: "pnpm lint:packages" }]
28
29
  }
29
- ],
30
- removedWorkflows: ["lint-packages"]
30
+ ]
31
31
  }),
32
32
  blockPackageJson({
33
33
  cleanupCommands: ["pnpm dedupe"],
@@ -39,6 +39,15 @@ const blockPnpmDedupe = base.createBlock({
39
39
  })
40
40
  ]
41
41
  };
42
+ },
43
+ transition() {
44
+ return {
45
+ addons: [
46
+ blockRemoveWorkflows({
47
+ workflows: ["lint-packages"]
48
+ })
49
+ ]
50
+ };
42
51
  }
43
52
  });
44
53
  export {
@@ -5,7 +5,9 @@ import { blockCSpell } from "./blockCSpell.js";
5
5
  import { blockDevelopmentDocs } from "./blockDevelopmentDocs.js";
6
6
  import { blockGitHubActionsCI } from "./blockGitHubActionsCI.js";
7
7
  import { blockPackageJson } from "./blockPackageJson.js";
8
+ import { blockRemoveDependencies } from "./blockRemoveDependencies.js";
8
9
  import { blockRemoveFiles } from "./blockRemoveFiles.js";
10
+ import { blockRemoveWorkflows } from "./blockRemoveWorkflows.js";
9
11
  import { blockVSCode } from "./blockVSCode.js";
10
12
  import { formatIgnoreFile } from "./files/formatIgnoreFile.js";
11
13
  import { CommandPhase } from "./phases.js";
@@ -54,8 +56,7 @@ pnpm format --write
54
56
  name: "Prettier",
55
57
  steps: [{ run: "pnpm format --list-different" }]
56
58
  }
57
- ],
58
- removedWorkflows: ["format", "prettier"]
59
+ ]
59
60
  }),
60
61
  blockPackageJson({
61
62
  properties: {
@@ -105,8 +106,14 @@ pnpm format --write
105
106
  transition() {
106
107
  return {
107
108
  addons: [
109
+ blockRemoveDependencies({
110
+ dependencies: ["eslint-config-prettier", "eslint-plugin-prettier"]
111
+ }),
108
112
  blockRemoveFiles({
109
113
  files: [".prettierrc.{c*,js,m*,t*}", "prettier.config*"]
114
+ }),
115
+ blockRemoveWorkflows({
116
+ workflows: ["format", "prettier"]
110
117
  })
111
118
  ]
112
119
  };
@@ -0,0 +1,65 @@
1
+ import * as bingo_stratum from 'bingo-stratum';
2
+
3
+ declare const blockRemoveWorkflows: bingo_stratum.BlockWithAddons<{
4
+ workflows?: string[] | undefined;
5
+ }, {
6
+ access: "public" | "restricted";
7
+ description: string;
8
+ directory: string;
9
+ email: {
10
+ github: string;
11
+ npm: string;
12
+ };
13
+ title: string;
14
+ owner: string;
15
+ repository: string;
16
+ author?: string | undefined;
17
+ bin?: string | undefined;
18
+ contributors?: {
19
+ avatar_url: string;
20
+ contributions: string[];
21
+ login: string;
22
+ name: string;
23
+ profile: string;
24
+ }[] | undefined;
25
+ documentation?: string | undefined;
26
+ emoji?: string | undefined;
27
+ existingLabels?: {
28
+ name: string;
29
+ description: string;
30
+ color: string;
31
+ }[] | undefined;
32
+ explainer?: string[] | undefined;
33
+ funding?: string | undefined;
34
+ guide?: {
35
+ href: string;
36
+ title: string;
37
+ } | undefined;
38
+ keywords?: string[] | undefined;
39
+ logo?: {
40
+ alt: string;
41
+ src: string;
42
+ height?: number | undefined;
43
+ width?: number | undefined;
44
+ } | undefined;
45
+ node?: {
46
+ minimum: string;
47
+ pinned?: string | undefined;
48
+ } | undefined;
49
+ packageData?: {
50
+ dependencies?: Record<string, string> | undefined;
51
+ devDependencies?: Record<string, string> | undefined;
52
+ scripts?: Record<string, string> | undefined;
53
+ } | undefined;
54
+ pnpm?: string | undefined;
55
+ rulesetId?: string | undefined;
56
+ usage?: string | undefined;
57
+ version?: string | undefined;
58
+ words?: string[] | undefined;
59
+ workflowsVersions?: Record<string, Record<string, {
60
+ pinned?: boolean | undefined;
61
+ hash?: string | undefined;
62
+ }>> | undefined;
63
+ }>;
64
+
65
+ export { blockRemoveWorkflows };
@@ -0,0 +1,31 @@
1
+ import { z } from "zod";
2
+ import { base } from "../base.js";
3
+ import { blockRemoveFiles } from "./blockRemoveFiles.js";
4
+ const blockRemoveWorkflows = base.createBlock({
5
+ about: {
6
+ name: "Remove Workflows"
7
+ },
8
+ addons: {
9
+ workflows: z.array(z.string()).optional()
10
+ },
11
+ // TODO: Make produce() optional, so this empty-ish produce() can be removed
12
+ // https://github.com/JoshuaKGoldberg/bingo/issues/295
13
+ produce() {
14
+ return {};
15
+ },
16
+ transition({ addons }) {
17
+ const { workflows } = addons;
18
+ return {
19
+ addons: [
20
+ blockRemoveFiles({
21
+ files: workflows?.map(
22
+ (workflow) => `.github/workflows/${workflow}.yml`
23
+ )
24
+ })
25
+ ]
26
+ };
27
+ }
28
+ });
29
+ export {
30
+ blockRemoveWorkflows
31
+ };
@@ -7,6 +7,7 @@ import { blockGitHubActionsCI } from "./blockGitHubActionsCI.js";
7
7
  import { blockPackageJson } from "./blockPackageJson.js";
8
8
  import { blockRemoveDependencies } from "./blockRemoveDependencies.js";
9
9
  import { blockRemoveFiles } from "./blockRemoveFiles.js";
10
+ import { blockRemoveWorkflows } from "./blockRemoveWorkflows.js";
10
11
  import { CommandPhase } from "./phases.js";
11
12
  const blockTSup = base.createBlock({
12
13
  about: {
@@ -53,8 +54,7 @@ pnpm build --watch
53
54
  }
54
55
  ]
55
56
  }
56
- ],
57
- removedWorkflows: ["build", "tsup"]
57
+ ]
58
58
  }),
59
59
  blockPackageJson({
60
60
  properties: {
@@ -90,10 +90,18 @@ export default defineConfig({
90
90
  return {
91
91
  addons: [
92
92
  blockRemoveDependencies({
93
- dependencies: ["@babel/core", "babel"]
93
+ dependencies: [
94
+ "@babel/cli",
95
+ "@babel/core",
96
+ "@babel/preset-typescript",
97
+ "babel"
98
+ ]
94
99
  }),
95
100
  blockRemoveFiles({
96
101
  files: [".babelrc*", "babel.config.*", "dist", "lib"]
102
+ }),
103
+ blockRemoveWorkflows({
104
+ workflows: ["build", "tsup"]
97
105
  })
98
106
  ]
99
107
  };
@@ -6,6 +6,7 @@ import { blockGitHubActionsCI } from "./blockGitHubActionsCI.js";
6
6
  import { blockGitignore } from "./blockGitignore.js";
7
7
  import { blockMarkdownlint } from "./blockMarkdownlint.js";
8
8
  import { blockPackageJson } from "./blockPackageJson.js";
9
+ import { blockRemoveWorkflows } from "./blockRemoveWorkflows.js";
9
10
  import { blockVitest } from "./blockVitest.js";
10
11
  import { blockVSCode } from "./blockVSCode.js";
11
12
  const blockTypeScript = base.createBlock({
@@ -67,8 +68,7 @@ export * from "./types.js";
67
68
  ignores: ["/lib"]
68
69
  }),
69
70
  blockGitHubActionsCI({
70
- jobs: [{ name: "Type Check", steps: [{ run: "pnpm tsc" }] }],
71
- removedWorkflows: ["tsc"]
71
+ jobs: [{ name: "Type Check", steps: [{ run: "pnpm tsc" }] }]
72
72
  }),
73
73
  blockMarkdownlint({
74
74
  ignores: ["lib/"]
@@ -126,6 +126,15 @@ export * from "./types.js";
126
126
  })
127
127
  }
128
128
  };
129
+ },
130
+ transition() {
131
+ return {
132
+ addons: [
133
+ blockRemoveWorkflows({
134
+ workflows: ["tsc"]
135
+ })
136
+ ]
137
+ };
129
138
  }
130
139
  });
131
140
  export {
@@ -11,6 +11,7 @@ import { blockPackageJson } from "./blockPackageJson.js";
11
11
  import { blockPrettier } from "./blockPrettier.js";
12
12
  import { blockRemoveDependencies } from "./blockRemoveDependencies.js";
13
13
  import { blockRemoveFiles } from "./blockRemoveFiles.js";
14
+ import { blockRemoveWorkflows } from "./blockRemoveWorkflows.js";
14
15
  import { blockTSup } from "./blockTSup.js";
15
16
  import { blockVSCode } from "./blockVSCode.js";
16
17
  const blockVitest = base.createBlock({
@@ -136,8 +137,7 @@ describe(greet, () => {
136
137
  name: "Test",
137
138
  steps: [{ run: "pnpm run test --coverage" }, ...actionSteps]
138
139
  }
139
- ],
140
- removedWorkflows: ["test"]
140
+ ]
141
141
  }),
142
142
  blockPackageJson({
143
143
  properties: {
@@ -200,6 +200,7 @@ export default defineConfig({
200
200
  addons: [
201
201
  blockRemoveDependencies({
202
202
  dependencies: [
203
+ "@vitest/coverage-istanbul",
203
204
  "eslint-plugin-jest",
204
205
  "eslint-plugin-mocha",
205
206
  "eslint-plugin-vitest",
@@ -208,6 +209,9 @@ export default defineConfig({
208
209
  }),
209
210
  blockRemoveFiles({
210
211
  files: [".mocha*", "jest.config.*", "vitest.config.{c,j,m}*"]
212
+ }),
213
+ blockRemoveWorkflows({
214
+ workflows: ["test"]
211
215
  })
212
216
  ]
213
217
  };
@@ -1227,7 +1227,6 @@ declare const blocks: {
1227
1227
  if?: string | undefined;
1228
1228
  checkoutWith?: Record<string, string> | undefined;
1229
1229
  }[] | undefined;
1230
- removedWorkflows?: string[] | undefined;
1231
1230
  }, {
1232
1231
  access: "public" | "restricted";
1233
1232
  description: string;
@@ -1,5 +1,5 @@
1
1
  var name = "create-typescript-app";
2
- var version = "2.11.1";
2
+ var version = "2.12.1";
3
3
  var description = "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 🎁";
4
4
  var repository = {
5
5
  type: "git",
@@ -4,12 +4,16 @@ async function readLogo(getReadme) {
4
4
  if (!tag) {
5
5
  return void 0;
6
6
  }
7
+ const alt = /alt=['"](.+)['"]\s*src=/.exec(tag)?.[1].split(/['"]?\s*\w+=/)[0] ?? "Project logo";
8
+ if (/All Contributors: \d+/.test(alt)) {
9
+ return void 0;
10
+ }
7
11
  const src = /src\s*=(.+)['"/]>/.exec(tag)?.[1]?.split(/\s*\w+=/)[0].replaceAll(/^['"]|['"]$/g, "");
8
- if (!src) {
12
+ if (!src || src.includes("//img.shields.io")) {
9
13
  return void 0;
10
14
  }
11
15
  return {
12
- alt: /alt=['"](.+)['"]\s*src=/.exec(tag)?.[1].split(/['"]?\s*\w+=/)[0] ?? "Project logo",
16
+ alt,
13
17
  src,
14
18
  ...readLogoSizing(src)
15
19
  };
@@ -15,6 +15,7 @@ import { blockPrettier } from "../blocks/blockPrettier.js";
15
15
  import { blockREADME } from "../blocks/blockREADME.js";
16
16
  import { blockRemoveDependencies } from "../blocks/blockRemoveDependencies.js";
17
17
  import { blockRemoveFiles } from "../blocks/blockRemoveFiles.js";
18
+ import { blockRemoveWorkflows } from "../blocks/blockRemoveWorkflows.js";
18
19
  import { blockRepositoryBranchRuleset } from "../blocks/blockRepositoryBranchRuleset.js";
19
20
  import { blockRepositoryLabels } from "../blocks/blockRepositoryLabels.js";
20
21
  import { blockRepositorySecrets } from "../blocks/blockRepositorySecrets.js";
@@ -45,6 +46,7 @@ const presetMinimal = base.createPreset({
45
46
  blockREADME,
46
47
  blockRemoveDependencies,
47
48
  blockRemoveFiles,
49
+ blockRemoveWorkflows,
48
50
  blockRepositoryBranchRuleset,
49
51
  blockRepositoryLabels,
50
52
  blockRepositorySecrets,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-typescript-app",
3
- "version": "2.12.0",
3
+ "version": "2.13.0",
4
4
  "description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 🎁",
5
5
  "repository": {
6
6
  "type": "git",