create-typescript-app 2.31.0 → 2.33.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.
@@ -1,3 +1,4 @@
1
+ import JSON5 from "json5";
1
2
  import { getObjectStringsDeep } from "object-strings-deep";
2
3
  import { z } from "zod";
3
4
  import { base } from "../base.js";
@@ -8,18 +9,32 @@ import { blockGitHubActionsCI } from "./blockGitHubActionsCI.js";
8
9
  import { blockPackageJson } from "./blockPackageJson.js";
9
10
  import { blockRemoveWorkflows } from "./blockRemoveWorkflows.js";
10
11
  import { blockVSCode } from "./blockVSCode.js";
12
+ import { intakeFile } from "./intake/intakeFile.js";
11
13
  import { CommandPhase } from "./phases.js";
12
14
  const filesGlob = `"**" ".github/**/*"`;
15
+ const addons = {
16
+ ignores: z.array(z.string()).default([]),
17
+ words: z.array(z.string()).default([])
18
+ };
19
+ const zAddons = z.object(addons);
13
20
  const blockCSpell = base.createBlock({
14
21
  about: {
15
22
  name: "CSpell"
16
23
  },
17
- addons: {
18
- ignores: z.array(z.string()).default([]),
19
- words: z.array(z.string()).default([])
24
+ addons,
25
+ intake({ files }) {
26
+ const cspellJson = intakeFile(files, ["cspell.json"]);
27
+ if (!cspellJson) {
28
+ return void 0;
29
+ }
30
+ const { data } = zAddons.safeParse(JSON5.parse(cspellJson[0]));
31
+ if (!data) {
32
+ return void 0;
33
+ }
34
+ return data;
20
35
  },
21
- produce({ addons, options }) {
22
- const { ignores, words } = addons;
36
+ produce({ addons: addons2, options }) {
37
+ const { ignores, words } = addons2;
23
38
  const allWords = Array.from(
24
39
  /* @__PURE__ */ new Set([...options.words ?? [], ...words])
25
40
  ).sort();
@@ -9,7 +9,6 @@ declare const blockESLint: bingo_stratum.BlockWithAddons<{
9
9
  specifier: string;
10
10
  types?: boolean | undefined;
11
11
  }[];
12
- ignores: string[];
13
12
  extensions: (string | {
14
13
  files?: string[] | undefined;
15
14
  rules?: Record<string, "off" | "error" | "warn" | ["error" | "warn", unknown] | ["error" | "warn", unknown, unknown]> | {
@@ -22,6 +21,7 @@ declare const blockESLint: bingo_stratum.BlockWithAddons<{
22
21
  linterOptions?: unknown;
23
22
  plugins?: Record<string, string> | undefined;
24
23
  })[];
24
+ ignores: string[];
25
25
  explanations: string[];
26
26
  rules?: Record<string, "off" | "error" | "warn" | ["error" | "warn", unknown] | ["error" | "warn", unknown, unknown]> | {
27
27
  entries: Record<string, "off" | "error" | "warn" | ["error" | "warn", unknown] | ["error" | "warn", unknown, unknown]>;
@@ -38,8 +38,8 @@ declare const blockGitHubActionsCI: bingo_stratum.BlockWithAddons<{
38
38
  } | {
39
39
  uses: string;
40
40
  }))[];
41
- checkoutWith?: Record<string, string> | undefined;
42
41
  if?: string | undefined;
42
+ checkoutWith?: Record<string, string> | undefined;
43
43
  }[] | undefined;
44
44
  }, {
45
45
  access: "public" | "restricted";
@@ -50,6 +50,7 @@ declare const blockPackageJson: bingo_stratum.BlockWithAddons<{
50
50
  url?: string | undefined;
51
51
  email?: string | undefined;
52
52
  })[] | undefined;
53
+ publishConfig?: Record<string, unknown> | undefined;
53
54
  main?: string | undefined;
54
55
  types?: string | undefined;
55
56
  bugs?: string | {
@@ -65,7 +66,6 @@ declare const blockPackageJson: bingo_stratum.BlockWithAddons<{
65
66
  overrides?: Record<string, unknown> | undefined;
66
67
  os?: string[] | undefined;
67
68
  cpu?: string[] | undefined;
68
- publishConfig?: Record<string, unknown> | undefined;
69
69
  workspaces?: string[] | undefined;
70
70
  deprecated?: string | undefined;
71
71
  typings?: string | undefined;
@@ -2,8 +2,8 @@ import * as bingo_stratum from 'bingo-stratum';
2
2
 
3
3
  declare const blockReleaseIt: bingo_stratum.BlockWithAddons<{
4
4
  builders: {
5
- run: string;
6
5
  order: number;
6
+ run: string;
7
7
  }[];
8
8
  }, {
9
9
  access: "public" | "restricted";
@@ -1,3 +1,4 @@
1
+ import JSON5 from "json5";
1
2
  import sortKeys from "sort-keys";
2
3
  import { CompilerOptionsSchema } from "zod-tsconfig";
3
4
  import { base } from "../base.js";
@@ -13,6 +14,7 @@ import { blockPackageJson } from "./blockPackageJson.js";
13
14
  import { blockRemoveWorkflows } from "./blockRemoveWorkflows.js";
14
15
  import { blockVitest } from "./blockVitest.js";
15
16
  import { blockVSCode } from "./blockVSCode.js";
17
+ import { intakeFile } from "./intake/intakeFile.js";
16
18
  const blockTypeScript = base.createBlock({
17
19
  about: {
18
20
  name: "TypeScript"
@@ -20,6 +22,20 @@ const blockTypeScript = base.createBlock({
20
22
  addons: {
21
23
  compilerOptions: CompilerOptionsSchema.optional()
22
24
  },
25
+ intake({ files }) {
26
+ const tsconfig = intakeFile(files, ["tsconfig.json"]);
27
+ if (!tsconfig) {
28
+ return void 0;
29
+ }
30
+ const raw = JSON5.parse(tsconfig[0]);
31
+ const { data } = CompilerOptionsSchema.safeParse(raw?.compilerOptions);
32
+ if (!data) {
33
+ return void 0;
34
+ }
35
+ return {
36
+ compilerOptions: data
37
+ };
38
+ },
23
39
  produce({ addons, options }) {
24
40
  const { compilerOptions } = addons;
25
41
  const primaryBin = getPrimaryBin(options.bin, options.repository);
@@ -2,6 +2,10 @@ import * as bingo_stratum from 'bingo-stratum';
2
2
 
3
3
  declare const blockVitest: bingo_stratum.BlockWithAddons<{
4
4
  exclude: string[];
5
+ coverage: {
6
+ exclude?: string[] | undefined;
7
+ include?: string[] | undefined;
8
+ };
5
9
  actionSteps: ({
6
10
  with?: Record<string, string> | undefined;
7
11
  env?: Record<string, string> | undefined;
@@ -11,10 +15,6 @@ declare const blockVitest: bingo_stratum.BlockWithAddons<{
11
15
  } | {
12
16
  uses: string;
13
17
  }))[];
14
- coverage: {
15
- exclude?: string[] | undefined;
16
- include?: string[] | undefined;
17
- };
18
18
  flags: string[];
19
19
  environment?: string | undefined;
20
20
  }, {
@@ -554,7 +554,6 @@ declare const blocks: {
554
554
  specifier: string;
555
555
  types?: boolean | undefined;
556
556
  }[];
557
- ignores: string[];
558
557
  extensions: (string | {
559
558
  files?: string[] | undefined;
560
559
  rules?: Record<string, "off" | "error" | "warn" | ["error" | "warn", unknown] | ["error" | "warn", unknown, unknown]> | {
@@ -567,6 +566,7 @@ declare const blocks: {
567
566
  linterOptions?: unknown;
568
567
  plugins?: Record<string, string> | undefined;
569
568
  })[];
569
+ ignores: string[];
570
570
  explanations: string[];
571
571
  rules?: Record<string, "off" | "error" | "warn" | ["error" | "warn", unknown] | ["error" | "warn", unknown, unknown]> | {
572
572
  entries: Record<string, "off" | "error" | "warn" | ["error" | "warn", unknown] | ["error" | "warn", unknown, unknown]>;
@@ -1470,8 +1470,8 @@ declare const blocks: {
1470
1470
  } | {
1471
1471
  uses: string;
1472
1472
  }))[];
1473
- checkoutWith?: Record<string, string> | undefined;
1474
1473
  if?: string | undefined;
1474
+ checkoutWith?: Record<string, string> | undefined;
1475
1475
  }[] | undefined;
1476
1476
  }, {
1477
1477
  access: "public" | "restricted";
@@ -2216,6 +2216,7 @@ declare const blocks: {
2216
2216
  url?: string | undefined;
2217
2217
  email?: string | undefined;
2218
2218
  })[] | undefined;
2219
+ publishConfig?: Record<string, unknown> | undefined;
2219
2220
  main?: string | undefined;
2220
2221
  types?: string | undefined;
2221
2222
  bugs?: string | {
@@ -2231,7 +2232,6 @@ declare const blocks: {
2231
2232
  overrides?: Record<string, unknown> | undefined;
2232
2233
  os?: string[] | undefined;
2233
2234
  cpu?: string[] | undefined;
2234
- publishConfig?: Record<string, unknown> | undefined;
2235
2235
  workspaces?: string[] | undefined;
2236
2236
  deprecated?: string | undefined;
2237
2237
  typings?: string | undefined;
@@ -2811,8 +2811,8 @@ declare const blocks: {
2811
2811
  }>;
2812
2812
  blockReleaseIt: bingo_stratum.BlockWithAddons<{
2813
2813
  builders: {
2814
- run: string;
2815
2814
  order: number;
2815
+ run: string;
2816
2816
  }[];
2817
2817
  }, {
2818
2818
  access: "public" | "restricted";
@@ -3340,6 +3340,10 @@ declare const blocks: {
3340
3340
  }>;
3341
3341
  blockVitest: bingo_stratum.BlockWithAddons<{
3342
3342
  exclude: string[];
3343
+ coverage: {
3344
+ exclude?: string[] | undefined;
3345
+ include?: string[] | undefined;
3346
+ };
3343
3347
  actionSteps: ({
3344
3348
  with?: Record<string, string> | undefined;
3345
3349
  env?: Record<string, string> | undefined;
@@ -3349,10 +3353,6 @@ declare const blocks: {
3349
3353
  } | {
3350
3354
  uses: string;
3351
3355
  }))[];
3352
- coverage: {
3353
- exclude?: string[] | undefined;
3354
- include?: string[] | undefined;
3355
- };
3356
3356
  flags: string[];
3357
3357
  environment?: string | undefined;
3358
3358
  }, {
@@ -1,5 +1,5 @@
1
1
  var name = "create-typescript-app";
2
- var version = "2.30.0";
2
+ var version = "2.32.0";
3
3
  var description = "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 🎁";
4
4
  var repository = {
5
5
  type: "git",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-typescript-app",
3
- "version": "2.31.0",
3
+ "version": "2.33.0",
4
4
  "description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 🎁",
5
5
  "repository": {
6
6
  "type": "git",