create-typescript-app 2.32.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
|
-
|
|
19
|
-
|
|
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 } =
|
|
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();
|