create-typescript-app 2.67.1 → 2.67.2
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.
- package/dist/blocks/blockESLintPlugin.mjs +2 -0
- package/dist/blocks/blockGitignore.d.mts +2 -0
- package/dist/blocks/blockGitignore.mjs +20 -3
- package/dist/blocks/blockTSDown.mjs +2 -0
- package/dist/blocks/blockTypeScript.mjs +1 -1
- package/dist/blocks/blockVitest.mjs +5 -0
- package/dist/blocks/index.d.mts +2 -0
- package/package.json +1 -1
|
@@ -1,13 +1,30 @@
|
|
|
1
|
+
import { intakeFile } from "./intake/intakeFile.mjs";
|
|
1
2
|
import { base } from "../base.mjs";
|
|
2
3
|
import { formatIgnoreFile } from "./files/formatIgnoreFile.mjs";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
//#region src/blocks/blockGitignore.ts
|
|
5
6
|
const blockGitignore = base.createBlock({
|
|
6
7
|
about: { name: "Gitignore" },
|
|
7
|
-
addons: {
|
|
8
|
+
addons: {
|
|
9
|
+
existing: z.array(z.string()).default([]),
|
|
10
|
+
ignores: z.array(z.string()).default([]),
|
|
11
|
+
removals: z.array(z.string()).default([])
|
|
12
|
+
},
|
|
13
|
+
intake({ files }) {
|
|
14
|
+
const gitignore = intakeFile(files, [".gitignore"]);
|
|
15
|
+
if (!gitignore) return;
|
|
16
|
+
return { existing: gitignore[0].split(/\r?\n/u).map((line) => line.trim()).filter((line) => line && !line.startsWith("#")) };
|
|
17
|
+
},
|
|
8
18
|
produce({ addons }) {
|
|
9
|
-
const
|
|
10
|
-
|
|
19
|
+
const removals = /* @__PURE__ */ new Set(["node_modules/", ...addons.removals]);
|
|
20
|
+
const ignores = /* @__PURE__ */ new Set([
|
|
21
|
+
"/node_modules",
|
|
22
|
+
...addons.existing.filter((line) => !removals.has(line)),
|
|
23
|
+
...addons.ignores
|
|
24
|
+
]);
|
|
25
|
+
const negations = [...ignores].filter((line) => line.startsWith("!"));
|
|
26
|
+
const patterns = [...ignores].filter((line) => !line.startsWith("!"));
|
|
27
|
+
return { files: { ".gitignore": formatIgnoreFile([...patterns.sort(), ...negations]) } };
|
|
11
28
|
}
|
|
12
29
|
});
|
|
13
30
|
//#endregion
|
|
@@ -10,6 +10,7 @@ import { blockDevelopmentDocs } from "./blockDevelopmentDocs.mjs";
|
|
|
10
10
|
import { blockRemoveWorkflows } from "./blockRemoveWorkflows.mjs";
|
|
11
11
|
import { blockRemoveDependencies } from "./blockRemoveDependencies.mjs";
|
|
12
12
|
import { blockESLint } from "./blockESLint.mjs";
|
|
13
|
+
import { blockGitignore } from "./blockGitignore.mjs";
|
|
13
14
|
import { intakeFileAsJson } from "./intake/intakeFileAsJson.mjs";
|
|
14
15
|
import { blockReleaseIt } from "./blockReleaseIt.mjs";
|
|
15
16
|
import { intakeFileDefineConfig } from "./intake/intakeFileDefineConfig.mjs";
|
|
@@ -102,6 +103,7 @@ export default defineConfig(${JSON.stringify({
|
|
|
102
103
|
},
|
|
103
104
|
transition() {
|
|
104
105
|
return { addons: [
|
|
106
|
+
blockGitignore({ removals: ["/lib", "lib/"] }),
|
|
105
107
|
blockRemoveDependencies({ dependencies: [
|
|
106
108
|
"@babel/cli",
|
|
107
109
|
"@babel/core",
|
|
@@ -130,7 +130,7 @@ greet("Hello, world! ${options.emoji}");
|
|
|
130
130
|
};
|
|
131
131
|
},
|
|
132
132
|
transition() {
|
|
133
|
-
return { addons: [blockRemoveWorkflows({ workflows: ["tsc"] })] };
|
|
133
|
+
return { addons: [blockGitignore({ removals: ["dist/"] }), blockRemoveWorkflows({ workflows: ["tsc"] })] };
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
136
|
//#endregion
|
|
@@ -189,6 +189,11 @@ export default defineConfig({
|
|
|
189
189
|
},
|
|
190
190
|
transition() {
|
|
191
191
|
return { addons: [
|
|
192
|
+
blockGitignore({ removals: [
|
|
193
|
+
"/coverage*",
|
|
194
|
+
"coverage*/",
|
|
195
|
+
"coverage/"
|
|
196
|
+
] }),
|
|
192
197
|
blockRemoveDependencies({ dependencies: [
|
|
193
198
|
"@vitest/coverage-istanbul",
|
|
194
199
|
"eslint-plugin-jest",
|
package/dist/blocks/index.d.mts
CHANGED
|
@@ -1964,7 +1964,9 @@ export declare const blocks: {
|
|
|
1964
1964
|
}>> | undefined;
|
|
1965
1965
|
}>;
|
|
1966
1966
|
blockGitignore: import("bingo-stratum").BlockWithAddons<{
|
|
1967
|
+
existing: string[];
|
|
1967
1968
|
ignores: string[];
|
|
1969
|
+
removals: string[];
|
|
1968
1970
|
}, {
|
|
1969
1971
|
access: "public" | "restricted";
|
|
1970
1972
|
description: string;
|