create-typescript-app 2.21.4 → 2.22.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.
@@ -9,12 +9,25 @@ import { blockGitHubActionsCI } from "./blockGitHubActionsCI.js";
9
9
  import { blockPackageJson } from "./blockPackageJson.js";
10
10
  import { blockRemoveFiles } from "./blockRemoveFiles.js";
11
11
  import { blockRemoveWorkflows } from "./blockRemoveWorkflows.js";
12
+ import { intakeFileAsJson } from "./intake/intakeFileAsJson.js";
13
+ const zIgnoreDependencies = z.array(z.string());
12
14
  const blockKnip = base.createBlock({
13
15
  about: {
14
16
  name: "Knip"
15
17
  },
16
18
  addons: {
17
- ignoreDependencies: z.array(z.string()).optional()
19
+ ignoreDependencies: zIgnoreDependencies.optional()
20
+ },
21
+ intake({ files }) {
22
+ const knipJson = intakeFileAsJson(files, ["knip.json"]);
23
+ if (!knipJson?.ignoreDependencies) {
24
+ return void 0;
25
+ }
26
+ return {
27
+ ignoreDependencies: zIgnoreDependencies.safeParse(
28
+ knipJson.ignoreDependencies
29
+ ).data
30
+ };
18
31
  },
19
32
  produce({ addons }) {
20
33
  const { ignoreDependencies } = addons;
@@ -0,0 +1,5 @@
1
+ import { IntakeDirectory } from 'bingo-fs';
2
+
3
+ declare function intakeFileAsJson(files: IntakeDirectory, filePath: string[]): Record<string, unknown> | undefined;
4
+
5
+ export { intakeFileAsJson };
@@ -0,0 +1,13 @@
1
+ import JSON5 from "json5";
2
+ import { intakeFile } from "./intakeFile.js";
3
+ function intakeFileAsJson(files, filePath) {
4
+ const file = intakeFile(files, filePath);
5
+ try {
6
+ return file && JSON5.parse(file[0]);
7
+ } catch {
8
+ return void 0;
9
+ }
10
+ }
11
+ export {
12
+ intakeFileAsJson
13
+ };
@@ -1,5 +1,5 @@
1
1
  var name = "create-typescript-app";
2
- var version = "2.21.3";
2
+ var version = "2.21.4";
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.21.4",
3
+ "version": "2.22.0",
4
4
  "description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 🎁",
5
5
  "repository": {
6
6
  "type": "git",