@book000/create-ts 0.2.104 → 0.2.106

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 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 (which includes a pnpm section), optionally appending a `data/` section.
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", "");
@@ -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 (which includes a pnpm section), optionally appending a `data/` section.
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.
@@ -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 (which includes a pnpm section), optionally appending a `data/` section.
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.104",
3
+ "version": "0.2.106",
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.16.125",
32
+ "@book000/eslint-config": "1.17.0",
33
33
  "@types/node": "26.6.6",
34
34
  "eslint": "10.14.0",
35
35
  "prettier": "3.10.1",
@@ -18,7 +18,7 @@
18
18
  "fix:prettier": "prettier --write src/"
19
19
  },
20
20
  "devDependencies": {
21
- "@book000/eslint-config": "1.16.125",
21
+ "@book000/eslint-config": "1.17.0",
22
22
  "@types/jest": "30.0.0",
23
23
  "@types/node": "26.6.6",
24
24
  "eslint": "10.14.0",
@@ -9,8 +9,8 @@ importers:
9
9
  .:
10
10
  devDependencies:
11
11
  '@book000/eslint-config':
12
- specifier: 1.16.125
13
- version: 1.16.125(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)
12
+ specifier: 1.17.0
13
+ version: 1.17.0(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,8 +206,8 @@ packages:
206
206
  '@bcoe/v8-coverage@0.2.3':
207
207
  resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==}
208
208
 
209
- '@book000/eslint-config@1.16.125':
210
- resolution: {integrity: sha512-Wnab6p01tP6Rzxf1Jox6qIBYaRg8pYAlhUQVSHJmOrHA3RuOFZ2cxpvymMJIu0aZ7Ey5vvcB3FOwYRdF/eRCdw==}
209
+ '@book000/eslint-config@1.17.0':
210
+ resolution: {integrity: sha512-tzvBdGWCjgkurB4xXC/tICEv7yQiXyRduJVlsQYI9VQnfRgBe4+ADRc9UitbaKfLZ8E1bXfwTkhiNM+n7hn/9A==}
211
211
  peerDependencies:
212
212
  eslint: 10.14.0
213
213
 
@@ -2460,7 +2460,7 @@ snapshots:
2460
2460
 
2461
2461
  '@bcoe/v8-coverage@0.2.3': {}
2462
2462
 
2463
- '@book000/eslint-config@1.16.125(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)':
2463
+ '@book000/eslint-config@1.17.0(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)
@@ -22,7 +22,7 @@
22
22
  "@book000/node-utils": "1.26.25"
23
23
  },
24
24
  "devDependencies": {
25
- "@book000/eslint-config": "1.16.125",
25
+ "@book000/eslint-config": "1.17.0",
26
26
  "@types/jest": "30.0.0",
27
27
  "@types/node": "26.6.6",
28
28
  "eslint": "10.14.0",
@@ -13,8 +13,8 @@ importers:
13
13
  version: 1.26.25
14
14
  devDependencies:
15
15
  '@book000/eslint-config':
16
- specifier: 1.16.125
17
- version: 1.16.125(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)
16
+ specifier: 1.17.0
17
+ version: 1.17.0(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,8 +213,8 @@ packages:
213
213
  '@bcoe/v8-coverage@0.2.3':
214
214
  resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==}
215
215
 
216
- '@book000/eslint-config@1.16.125':
217
- resolution: {integrity: sha512-Wnab6p01tP6Rzxf1Jox6qIBYaRg8pYAlhUQVSHJmOrHA3RuOFZ2cxpvymMJIu0aZ7Ey5vvcB3FOwYRdF/eRCdw==}
216
+ '@book000/eslint-config@1.17.0':
217
+ resolution: {integrity: sha512-tzvBdGWCjgkurB4xXC/tICEv7yQiXyRduJVlsQYI9VQnfRgBe4+ADRc9UitbaKfLZ8E1bXfwTkhiNM+n7hn/9A==}
218
218
  peerDependencies:
219
219
  eslint: 10.14.0
220
220
 
@@ -2872,7 +2872,7 @@ snapshots:
2872
2872
 
2873
2873
  '@bcoe/v8-coverage@0.2.3': {}
2874
2874
 
2875
- '@book000/eslint-config@1.16.125(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)':
2875
+ '@book000/eslint-config@1.17.0(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)
@@ -23,7 +23,7 @@
23
23
  "discord.js": "14.28.1"
24
24
  },
25
25
  "devDependencies": {
26
- "@book000/eslint-config": "1.16.125",
26
+ "@book000/eslint-config": "1.17.0",
27
27
  "@types/jest": "30.0.0",
28
28
  "@types/node": "26.6.6",
29
29
  "eslint": "10.14.0",
@@ -16,8 +16,8 @@ importers:
16
16
  version: 14.28.1
17
17
  devDependencies:
18
18
  '@book000/eslint-config':
19
- specifier: 1.16.125
20
- version: 1.16.125(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)
19
+ specifier: 1.17.0
20
+ version: 1.17.0(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,8 +216,8 @@ packages:
216
216
  '@bcoe/v8-coverage@0.2.3':
217
217
  resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==}
218
218
 
219
- '@book000/eslint-config@1.16.125':
220
- resolution: {integrity: sha512-Wnab6p01tP6Rzxf1Jox6qIBYaRg8pYAlhUQVSHJmOrHA3RuOFZ2cxpvymMJIu0aZ7Ey5vvcB3FOwYRdF/eRCdw==}
219
+ '@book000/eslint-config@1.17.0':
220
+ resolution: {integrity: sha512-tzvBdGWCjgkurB4xXC/tICEv7yQiXyRduJVlsQYI9VQnfRgBe4+ADRc9UitbaKfLZ8E1bXfwTkhiNM+n7hn/9A==}
221
221
  peerDependencies:
222
222
  eslint: 10.14.0
223
223
 
@@ -2960,7 +2960,7 @@ snapshots:
2960
2960
 
2961
2961
  '@bcoe/v8-coverage@0.2.3': {}
2962
2962
 
2963
- '@book000/eslint-config@1.16.125(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)':
2963
+ '@book000/eslint-config@1.17.0(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)
@@ -18,11 +18,11 @@
18
18
  "fix:prettier": "prettier --write src/"
19
19
  },
20
20
  "dependencies": {
21
- "@fastify/cors": "11.4.2",
21
+ "@fastify/cors": "11.4.3",
22
22
  "fastify": "5.12.8"
23
23
  },
24
24
  "devDependencies": {
25
- "@book000/eslint-config": "1.16.125",
25
+ "@book000/eslint-config": "1.17.0",
26
26
  "@types/jest": "30.0.0",
27
27
  "@types/node": "26.6.6",
28
28
  "eslint": "10.14.0",
@@ -9,15 +9,15 @@ importers:
9
9
  .:
10
10
  dependencies:
11
11
  '@fastify/cors':
12
- specifier: 11.4.2
13
- version: 11.4.2
12
+ specifier: 11.4.3
13
+ version: 11.4.3
14
14
  fastify:
15
15
  specifier: 5.12.8
16
16
  version: 5.12.8
17
17
  devDependencies:
18
18
  '@book000/eslint-config':
19
- specifier: 1.16.125
20
- version: 1.16.125(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)
19
+ specifier: 1.17.0
20
+ version: 1.17.0(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,8 +216,8 @@ packages:
216
216
  '@bcoe/v8-coverage@0.2.3':
217
217
  resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==}
218
218
 
219
- '@book000/eslint-config@1.16.125':
220
- resolution: {integrity: sha512-Wnab6p01tP6Rzxf1Jox6qIBYaRg8pYAlhUQVSHJmOrHA3RuOFZ2cxpvymMJIu0aZ7Ey5vvcB3FOwYRdF/eRCdw==}
219
+ '@book000/eslint-config@1.17.0':
220
+ resolution: {integrity: sha512-tzvBdGWCjgkurB4xXC/tICEv7yQiXyRduJVlsQYI9VQnfRgBe4+ADRc9UitbaKfLZ8E1bXfwTkhiNM+n7hn/9A==}
221
221
  peerDependencies:
222
222
  eslint: 10.14.0
223
223
 
@@ -420,8 +420,8 @@ packages:
420
420
  '@fastify/ajv-compiler@4.0.7':
421
421
  resolution: {integrity: sha512-VP0yIfwlc1ohj733keYDqyHm1VWeP9VQxYomunhr90jkC4aNNibbkrRiaNgPgqj1ORxUenILR4qzA/ppYBNAtQ==}
422
422
 
423
- '@fastify/cors@11.4.2':
424
- resolution: {integrity: sha512-YEVXrPWmKOGtnU/21mH2kErmrP1zsLJwWG8KOIbtRe/Sayu+LQPxSubRIVmddDudr05w/GGgUtIzac6Jp3zNzA==}
423
+ '@fastify/cors@11.4.3':
424
+ resolution: {integrity: sha512-6NNFNR1i9t1oG1WlQftwc2ugElFm4cG75ylYyGNiKKiyxlVGueneup9MQ9Nd3eI4lT6kVOJaxV1Jqa727/E4jg==}
425
425
 
426
426
  '@fastify/deepmerge@3.2.4':
427
427
  resolution: {integrity: sha512-kc8GQq5gX9RRhw0rov3DMrN8wS8yRlxJRdDzsYwwdBV/wazuVgc/1K7CKL90tlvu3RlHan6Y0R0aE3nJtBz2eQ==}
@@ -2675,7 +2675,7 @@ snapshots:
2675
2675
 
2676
2676
  '@bcoe/v8-coverage@0.2.3': {}
2677
2677
 
2678
- '@book000/eslint-config@1.16.125(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)':
2678
+ '@book000/eslint-config@1.17.0(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)
@@ -2820,7 +2820,7 @@ snapshots:
2820
2820
  ajv-formats: 3.0.1
2821
2821
  fast-uri: 4.2.3
2822
2822
 
2823
- '@fastify/cors@11.4.2':
2823
+ '@fastify/cors@11.4.3':
2824
2824
  dependencies:
2825
2825
  fastify-plugin: 6.0.1
2826
2826
  toad-cache: 3.7.4