@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 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.105",
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.0",
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",
@@ -18,7 +18,7 @@
18
18
  "fix:prettier": "prettier --write src/"
19
19
  },
20
20
  "devDependencies": {
21
- "@book000/eslint-config": "1.17.0",
21
+ "@book000/eslint-config": "1.17.2",
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.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)
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.0':
210
- resolution: {integrity: sha512-tzvBdGWCjgkurB4xXC/tICEv7yQiXyRduJVlsQYI9VQnfRgBe4+ADRc9UitbaKfLZ8E1bXfwTkhiNM+n7hn/9A==}
209
+ '@book000/eslint-config@1.17.2':
210
+ resolution: {integrity: sha512-xyGeqoShjdWlj3RFSthB2ZzlhMjn0AG0eFVfq1lcyUPrLeWLVyZZQbIuwlLggkiQ8KPiv88vvT9LFKCT2rs5Kw==}
211
211
  peerDependencies:
212
- eslint: 10.14.0
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.0(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)':
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)
@@ -22,7 +22,7 @@
22
22
  "@book000/node-utils": "1.26.25"
23
23
  },
24
24
  "devDependencies": {
25
- "@book000/eslint-config": "1.17.0",
25
+ "@book000/eslint-config": "1.17.2",
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.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)
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.0':
217
- resolution: {integrity: sha512-tzvBdGWCjgkurB4xXC/tICEv7yQiXyRduJVlsQYI9VQnfRgBe4+ADRc9UitbaKfLZ8E1bXfwTkhiNM+n7hn/9A==}
216
+ '@book000/eslint-config@1.17.2':
217
+ resolution: {integrity: sha512-xyGeqoShjdWlj3RFSthB2ZzlhMjn0AG0eFVfq1lcyUPrLeWLVyZZQbIuwlLggkiQ8KPiv88vvT9LFKCT2rs5Kw==}
218
218
  peerDependencies:
219
- eslint: 10.14.0
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.0(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)':
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)
@@ -23,7 +23,7 @@
23
23
  "discord.js": "14.28.1"
24
24
  },
25
25
  "devDependencies": {
26
- "@book000/eslint-config": "1.17.0",
26
+ "@book000/eslint-config": "1.17.2",
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.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)
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.0':
220
- resolution: {integrity: sha512-tzvBdGWCjgkurB4xXC/tICEv7yQiXyRduJVlsQYI9VQnfRgBe4+ADRc9UitbaKfLZ8E1bXfwTkhiNM+n7hn/9A==}
219
+ '@book000/eslint-config@1.17.2':
220
+ resolution: {integrity: sha512-xyGeqoShjdWlj3RFSthB2ZzlhMjn0AG0eFVfq1lcyUPrLeWLVyZZQbIuwlLggkiQ8KPiv88vvT9LFKCT2rs5Kw==}
221
221
  peerDependencies:
222
- eslint: 10.14.0
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.0(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)':
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)
@@ -22,7 +22,7 @@
22
22
  "fastify": "5.12.8"
23
23
  },
24
24
  "devDependencies": {
25
- "@book000/eslint-config": "1.17.0",
25
+ "@book000/eslint-config": "1.17.2",
26
26
  "@types/jest": "30.0.0",
27
27
  "@types/node": "26.6.6",
28
28
  "eslint": "10.14.0",
@@ -16,8 +16,8 @@ importers:
16
16
  version: 5.12.8
17
17
  devDependencies:
18
18
  '@book000/eslint-config':
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)
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.0':
220
- resolution: {integrity: sha512-tzvBdGWCjgkurB4xXC/tICEv7yQiXyRduJVlsQYI9VQnfRgBe4+ADRc9UitbaKfLZ8E1bXfwTkhiNM+n7hn/9A==}
219
+ '@book000/eslint-config@1.17.2':
220
+ resolution: {integrity: sha512-xyGeqoShjdWlj3RFSthB2ZzlhMjn0AG0eFVfq1lcyUPrLeWLVyZZQbIuwlLggkiQ8KPiv88vvT9LFKCT2rs5Kw==}
221
221
  peerDependencies:
222
- eslint: 10.14.0
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.0(eslint@10.14.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@6.0.3)':
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)