@book000/create-ts 0.2.105 → 0.2.107
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/index.mjs +4 -3
- package/dist/src/generate.d.ts +2 -2
- package/dist/src/generate.js +5 -2
- package/dist/src/index.js +1 -1
- package/dist/test/generate.test.js +8 -2
- package/package.json +2 -2
- package/templates/nodejs/base/package.json +1 -1
- package/templates/nodejs/base/pnpm-lock.yaml +6 -6
- package/templates/nodejs/config-batch/package.json +1 -1
- package/templates/nodejs/config-batch/pnpm-lock.yaml +6 -6
- package/templates/nodejs/discord-bot/package.json +1 -1
- package/templates/nodejs/discord-bot/pnpm-lock.yaml +6 -6
- package/templates/nodejs/fastify/package.json +1 -1
- package/templates/nodejs/fastify/pnpm-lock.yaml +6 -6
package/dist/index.mjs
CHANGED
|
@@ -82,10 +82,11 @@ function patchDockerWorkflow(content, org, repo) {
|
|
|
82
82
|
return result;
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
|
-
* Generates .gitignore from the bundled Node.gitignore
|
|
85
|
+
* Generates .gitignore from the bundled Node.gitignore, optionally appending a `data/` section and always excluding Discord bot config.
|
|
86
86
|
*/
|
|
87
|
-
function generateGitignore(ignoreData) {
|
|
87
|
+
function generateGitignore(ignoreData, variant) {
|
|
88
88
|
let result = readTemplate("gitignore/Node.gitignore");
|
|
89
|
+
if (variant === "discord-bot") result += "\n\n# Discord bot configuration\ndata/config.json";
|
|
89
90
|
if (ignoreData) result += "\n\n# データディレクトリ\ndata/";
|
|
90
91
|
return result;
|
|
91
92
|
}
|
|
@@ -434,7 +435,7 @@ async function main() {
|
|
|
434
435
|
const patchedTsConfig = patchTsConfig(JSON.parse(readFileSync(tsconfigPath, "utf8")), options);
|
|
435
436
|
writeFileSync(tsconfigPath, JSON.stringify(patchedTsConfig, null, 2) + "\n", "utf8");
|
|
436
437
|
s.start(".gitignore を生成しています...");
|
|
437
|
-
const gitignoreContent = generateGitignore(options.ignoreData);
|
|
438
|
+
const gitignoreContent = generateGitignore(options.ignoreData, options.variant);
|
|
438
439
|
writeFileSync(path.join(outDir, ".gitignore"), gitignoreContent, "utf8");
|
|
439
440
|
const { stdout: nodeVersion } = await execa("node", ["--version"]);
|
|
440
441
|
const nodeVersionNumber = nodeVersion.trim().replace("v", "");
|
package/dist/src/generate.d.ts
CHANGED
|
@@ -17,9 +17,9 @@ export declare function patchTsConfig(tsconfig: Record<string, unknown>, options
|
|
|
17
17
|
*/
|
|
18
18
|
export declare function patchDockerWorkflow(content: string, org: string, repo: string): string;
|
|
19
19
|
/**
|
|
20
|
-
* Generates .gitignore from the bundled Node.gitignore
|
|
20
|
+
* Generates .gitignore from the bundled Node.gitignore, optionally appending a `data/` section and always excluding Discord bot config.
|
|
21
21
|
*/
|
|
22
|
-
export declare function generateGitignore(ignoreData: boolean): string;
|
|
22
|
+
export declare function generateGitignore(ignoreData: boolean, variant: ProjectOptions['variant']): string;
|
|
23
23
|
/**
|
|
24
24
|
* Updates the `ignores` array of .depcheckrc.json without duplicates.
|
|
25
25
|
* Adds the variant's depcheckIgnore entries, plus `@types/jest` when `test` is set.
|
package/dist/src/generate.js
CHANGED
|
@@ -66,10 +66,13 @@ export function patchDockerWorkflow(content, org, repo) {
|
|
|
66
66
|
return result;
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
|
-
* Generates .gitignore from the bundled Node.gitignore
|
|
69
|
+
* Generates .gitignore from the bundled Node.gitignore, optionally appending a `data/` section and always excluding Discord bot config.
|
|
70
70
|
*/
|
|
71
|
-
export function generateGitignore(ignoreData) {
|
|
71
|
+
export function generateGitignore(ignoreData, variant) {
|
|
72
72
|
let result = readTemplate('gitignore/Node.gitignore');
|
|
73
|
+
if (variant === 'discord-bot') {
|
|
74
|
+
result += '\n\n# Discord bot configuration\ndata/config.json';
|
|
75
|
+
}
|
|
73
76
|
if (ignoreData) {
|
|
74
77
|
result += '\n\n# データディレクトリ\ndata/';
|
|
75
78
|
}
|
package/dist/src/index.js
CHANGED
|
@@ -156,7 +156,7 @@ async function main() {
|
|
|
156
156
|
writeFileSync(tsconfigPath, JSON.stringify(patchedTsConfig, null, 2) + '\n', 'utf8');
|
|
157
157
|
// generate .gitignore and .node-version (the running Node.js version)
|
|
158
158
|
s.start('.gitignore を生成しています...');
|
|
159
|
-
const gitignoreContent = generateGitignore(options.ignoreData);
|
|
159
|
+
const gitignoreContent = generateGitignore(options.ignoreData, options.variant);
|
|
160
160
|
writeFileSync(path.join(outDir, '.gitignore'), gitignoreContent, 'utf8');
|
|
161
161
|
const { stdout: nodeVersion } = await execa('node', ['--version']);
|
|
162
162
|
const nodeVersionNumber = nodeVersion.trim().replace('v', '');
|
|
@@ -135,18 +135,24 @@ describe('patchDockerWorkflow', () => {
|
|
|
135
135
|
// ---- generateGitignore ----
|
|
136
136
|
describe('generateGitignore', () => {
|
|
137
137
|
it('basic: includes the pnpm section', () => {
|
|
138
|
-
const result = generateGitignore(false);
|
|
138
|
+
const result = generateGitignore(false, 'base');
|
|
139
139
|
expect(result).toContain('node_modules/');
|
|
140
140
|
expect(result).toContain('# pnpm');
|
|
141
141
|
expect(result).toContain('pnpm-debug.log*');
|
|
142
142
|
expect(result).not.toContain('data/');
|
|
143
143
|
});
|
|
144
144
|
it('--ignore-data: additionally appends the data/ section', () => {
|
|
145
|
-
const result = generateGitignore(true);
|
|
145
|
+
const result = generateGitignore(true, 'base');
|
|
146
146
|
expect(result).toContain('# pnpm');
|
|
147
147
|
expect(result).toContain('# データディレクトリ');
|
|
148
148
|
expect(result).toContain('data/');
|
|
149
149
|
});
|
|
150
|
+
it('always ignores the Discord bot configuration file', () => {
|
|
151
|
+
const result = generateGitignore(false, 'discord-bot');
|
|
152
|
+
const entries = result.split('\n');
|
|
153
|
+
expect(entries).toContain('data/config.json');
|
|
154
|
+
expect(entries).not.toContain('data/');
|
|
155
|
+
});
|
|
150
156
|
});
|
|
151
157
|
// ---- updateDepcheck ----
|
|
152
158
|
describe('updateDepcheck', () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@book000/create-ts",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.107",
|
|
4
4
|
"description": "Create book000-style TypeScript projects",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"execa": "10.2.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@book000/eslint-config": "1.17.
|
|
32
|
+
"@book000/eslint-config": "1.17.2",
|
|
33
33
|
"@types/node": "26.6.6",
|
|
34
34
|
"eslint": "10.14.0",
|
|
35
35
|
"prettier": "3.10.1",
|
|
@@ -9,8 +9,8 @@ importers:
|
|
|
9
9
|
.:
|
|
10
10
|
devDependencies:
|
|
11
11
|
'@book000/eslint-config':
|
|
12
|
-
specifier: 1.17.
|
|
13
|
-
version: 1.17.
|
|
12
|
+
specifier: 1.17.2
|
|
13
|
+
version: 1.17.2(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)
|
|
14
14
|
'@types/jest':
|
|
15
15
|
specifier: 30.0.0
|
|
16
16
|
version: 30.0.0
|
|
@@ -206,10 +206,10 @@ packages:
|
|
|
206
206
|
'@bcoe/v8-coverage@0.2.3':
|
|
207
207
|
resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==}
|
|
208
208
|
|
|
209
|
-
'@book000/eslint-config@1.17.
|
|
210
|
-
resolution: {integrity: sha512-
|
|
209
|
+
'@book000/eslint-config@1.17.2':
|
|
210
|
+
resolution: {integrity: sha512-xyGeqoShjdWlj3RFSthB2ZzlhMjn0AG0eFVfq1lcyUPrLeWLVyZZQbIuwlLggkiQ8KPiv88vvT9LFKCT2rs5Kw==}
|
|
211
211
|
peerDependencies:
|
|
212
|
-
eslint: 10.
|
|
212
|
+
eslint: 10.15.0
|
|
213
213
|
|
|
214
214
|
'@cacheable/memory@2.2.0':
|
|
215
215
|
resolution: {integrity: sha512-CTLKqLItRCEixEAewD3/j9DB3/o96gpTPD4eJ1v+DGOlxZRZncRQkGYqqnAGCscYd6RNeXfGeiuCphsPtqyIfQ==}
|
|
@@ -2460,7 +2460,7 @@ snapshots:
|
|
|
2460
2460
|
|
|
2461
2461
|
'@bcoe/v8-coverage@0.2.3': {}
|
|
2462
2462
|
|
|
2463
|
-
'@book000/eslint-config@1.17.
|
|
2463
|
+
'@book000/eslint-config@1.17.2(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)':
|
|
2464
2464
|
dependencies:
|
|
2465
2465
|
'@typescript-eslint/parser': 8.72.2(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)
|
|
2466
2466
|
eslint: 10.14.0(supports-color@8.1.1)
|
|
@@ -13,8 +13,8 @@ importers:
|
|
|
13
13
|
version: 1.26.25
|
|
14
14
|
devDependencies:
|
|
15
15
|
'@book000/eslint-config':
|
|
16
|
-
specifier: 1.17.
|
|
17
|
-
version: 1.17.
|
|
16
|
+
specifier: 1.17.2
|
|
17
|
+
version: 1.17.2(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)
|
|
18
18
|
'@types/jest':
|
|
19
19
|
specifier: 30.0.0
|
|
20
20
|
version: 30.0.0
|
|
@@ -213,10 +213,10 @@ packages:
|
|
|
213
213
|
'@bcoe/v8-coverage@0.2.3':
|
|
214
214
|
resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==}
|
|
215
215
|
|
|
216
|
-
'@book000/eslint-config@1.17.
|
|
217
|
-
resolution: {integrity: sha512-
|
|
216
|
+
'@book000/eslint-config@1.17.2':
|
|
217
|
+
resolution: {integrity: sha512-xyGeqoShjdWlj3RFSthB2ZzlhMjn0AG0eFVfq1lcyUPrLeWLVyZZQbIuwlLggkiQ8KPiv88vvT9LFKCT2rs5Kw==}
|
|
218
218
|
peerDependencies:
|
|
219
|
-
eslint: 10.
|
|
219
|
+
eslint: 10.15.0
|
|
220
220
|
|
|
221
221
|
'@book000/node-utils@1.26.25':
|
|
222
222
|
resolution: {integrity: sha512-8+TsV7DZNCqw9heCR4BYgAg4udjsHaUCCBqnenext0VG3eGEJC8a/htbrMXFIGBrz5cKZA/M7w5pPN37+Ek7Mw==}
|
|
@@ -2872,7 +2872,7 @@ snapshots:
|
|
|
2872
2872
|
|
|
2873
2873
|
'@bcoe/v8-coverage@0.2.3': {}
|
|
2874
2874
|
|
|
2875
|
-
'@book000/eslint-config@1.17.
|
|
2875
|
+
'@book000/eslint-config@1.17.2(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)':
|
|
2876
2876
|
dependencies:
|
|
2877
2877
|
'@typescript-eslint/parser': 8.72.2(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)
|
|
2878
2878
|
eslint: 10.14.0(supports-color@8.1.1)
|
|
@@ -16,8 +16,8 @@ importers:
|
|
|
16
16
|
version: 14.28.1
|
|
17
17
|
devDependencies:
|
|
18
18
|
'@book000/eslint-config':
|
|
19
|
-
specifier: 1.17.
|
|
20
|
-
version: 1.17.
|
|
19
|
+
specifier: 1.17.2
|
|
20
|
+
version: 1.17.2(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)
|
|
21
21
|
'@types/jest':
|
|
22
22
|
specifier: 30.0.0
|
|
23
23
|
version: 30.0.0
|
|
@@ -216,10 +216,10 @@ packages:
|
|
|
216
216
|
'@bcoe/v8-coverage@0.2.3':
|
|
217
217
|
resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==}
|
|
218
218
|
|
|
219
|
-
'@book000/eslint-config@1.17.
|
|
220
|
-
resolution: {integrity: sha512-
|
|
219
|
+
'@book000/eslint-config@1.17.2':
|
|
220
|
+
resolution: {integrity: sha512-xyGeqoShjdWlj3RFSthB2ZzlhMjn0AG0eFVfq1lcyUPrLeWLVyZZQbIuwlLggkiQ8KPiv88vvT9LFKCT2rs5Kw==}
|
|
221
221
|
peerDependencies:
|
|
222
|
-
eslint: 10.
|
|
222
|
+
eslint: 10.15.0
|
|
223
223
|
|
|
224
224
|
'@book000/node-utils@1.26.25':
|
|
225
225
|
resolution: {integrity: sha512-8+TsV7DZNCqw9heCR4BYgAg4udjsHaUCCBqnenext0VG3eGEJC8a/htbrMXFIGBrz5cKZA/M7w5pPN37+Ek7Mw==}
|
|
@@ -2960,7 +2960,7 @@ snapshots:
|
|
|
2960
2960
|
|
|
2961
2961
|
'@bcoe/v8-coverage@0.2.3': {}
|
|
2962
2962
|
|
|
2963
|
-
'@book000/eslint-config@1.17.
|
|
2963
|
+
'@book000/eslint-config@1.17.2(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)':
|
|
2964
2964
|
dependencies:
|
|
2965
2965
|
'@typescript-eslint/parser': 8.72.2(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)
|
|
2966
2966
|
eslint: 10.14.0(supports-color@8.1.1)
|
|
@@ -16,8 +16,8 @@ importers:
|
|
|
16
16
|
version: 5.12.8
|
|
17
17
|
devDependencies:
|
|
18
18
|
'@book000/eslint-config':
|
|
19
|
-
specifier: 1.17.
|
|
20
|
-
version: 1.17.
|
|
19
|
+
specifier: 1.17.2
|
|
20
|
+
version: 1.17.2(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)
|
|
21
21
|
'@types/jest':
|
|
22
22
|
specifier: 30.0.0
|
|
23
23
|
version: 30.0.0
|
|
@@ -216,10 +216,10 @@ packages:
|
|
|
216
216
|
'@bcoe/v8-coverage@0.2.3':
|
|
217
217
|
resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==}
|
|
218
218
|
|
|
219
|
-
'@book000/eslint-config@1.17.
|
|
220
|
-
resolution: {integrity: sha512-
|
|
219
|
+
'@book000/eslint-config@1.17.2':
|
|
220
|
+
resolution: {integrity: sha512-xyGeqoShjdWlj3RFSthB2ZzlhMjn0AG0eFVfq1lcyUPrLeWLVyZZQbIuwlLggkiQ8KPiv88vvT9LFKCT2rs5Kw==}
|
|
221
221
|
peerDependencies:
|
|
222
|
-
eslint: 10.
|
|
222
|
+
eslint: 10.15.0
|
|
223
223
|
|
|
224
224
|
'@cacheable/memory@2.2.0':
|
|
225
225
|
resolution: {integrity: sha512-CTLKqLItRCEixEAewD3/j9DB3/o96gpTPD4eJ1v+DGOlxZRZncRQkGYqqnAGCscYd6RNeXfGeiuCphsPtqyIfQ==}
|
|
@@ -2675,7 +2675,7 @@ snapshots:
|
|
|
2675
2675
|
|
|
2676
2676
|
'@bcoe/v8-coverage@0.2.3': {}
|
|
2677
2677
|
|
|
2678
|
-
'@book000/eslint-config@1.17.
|
|
2678
|
+
'@book000/eslint-config@1.17.2(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)':
|
|
2679
2679
|
dependencies:
|
|
2680
2680
|
'@typescript-eslint/parser': 8.72.2(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)
|
|
2681
2681
|
eslint: 10.14.0(supports-color@8.1.1)
|