@tukuyomil032/bricklayer 1.0.42 → 1.0.43
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/LICENSE +21 -0
- package/README.md +3 -3
- package/dist/create/installer.js +19 -7
- package/dist/create/package-versions.js +2 -0
- package/dist/create/prompts.js +2 -0
- package/dist/create/templates.js +45 -29
- package/dist/index.js +1 -1
- package/package.json +2 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 tukuyomil032
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -52,9 +52,9 @@ $ brick create -d ~/Documents/dev/CLI/my-test-project
|
|
|
52
52
|
|
|
53
53
|
## Available Options
|
|
54
54
|
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
55
|
+
- `-h --help` - display help for command
|
|
56
|
+
- `-V --version` - output the version number
|
|
57
|
+
- `-d --destination` - Specify the project creation directory
|
|
58
58
|
- This option can be used either to manually select the directory path where the project will be created, or to specify a relative path by entering it directly after “-d”.
|
|
59
59
|
|
|
60
60
|
Follow the interactive prompts to configure your project:
|
package/dist/create/installer.js
CHANGED
|
@@ -89,7 +89,9 @@ function runCommandWithProgress(command, cwd) {
|
|
|
89
89
|
try {
|
|
90
90
|
bar.update(floor);
|
|
91
91
|
}
|
|
92
|
-
catch {
|
|
92
|
+
catch {
|
|
93
|
+
// Ignore update errors during progress
|
|
94
|
+
}
|
|
93
95
|
}
|
|
94
96
|
}, tickInterval);
|
|
95
97
|
const child = spawn(parts[0], parts.slice(1), { cwd, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
@@ -109,25 +111,31 @@ function runCommandWithProgress(command, cwd) {
|
|
|
109
111
|
try {
|
|
110
112
|
bar.update(floor);
|
|
111
113
|
}
|
|
112
|
-
catch {
|
|
114
|
+
catch {
|
|
115
|
+
// Ignore update errors
|
|
116
|
+
}
|
|
113
117
|
}
|
|
114
118
|
};
|
|
115
|
-
if (child.stdout)
|
|
119
|
+
if (child.stdout) {
|
|
116
120
|
child.stdout.on('data', (c) => {
|
|
117
121
|
stdoutChunks.push(Buffer.from(c));
|
|
118
122
|
onOutput();
|
|
119
123
|
});
|
|
120
|
-
|
|
124
|
+
}
|
|
125
|
+
if (child.stderr) {
|
|
121
126
|
child.stderr.on('data', (c) => {
|
|
122
127
|
stderrChunks.push(Buffer.from(c));
|
|
123
128
|
onOutput();
|
|
124
129
|
});
|
|
130
|
+
}
|
|
125
131
|
child.on('error', (err) => {
|
|
126
132
|
clearInterval(timer);
|
|
127
133
|
try {
|
|
128
134
|
bar.stop();
|
|
129
135
|
}
|
|
130
|
-
catch {
|
|
136
|
+
catch {
|
|
137
|
+
// Ignore stop errors
|
|
138
|
+
}
|
|
131
139
|
reject(err);
|
|
132
140
|
});
|
|
133
141
|
child.on('close', (code) => {
|
|
@@ -140,7 +148,9 @@ function runCommandWithProgress(command, cwd) {
|
|
|
140
148
|
bar.update(100);
|
|
141
149
|
bar.stop();
|
|
142
150
|
}
|
|
143
|
-
catch {
|
|
151
|
+
catch {
|
|
152
|
+
// Ignore final update errors
|
|
153
|
+
}
|
|
144
154
|
clearInterval(finishTimer);
|
|
145
155
|
if (code === 0) {
|
|
146
156
|
return resolve();
|
|
@@ -157,7 +167,9 @@ function runCommandWithProgress(command, cwd) {
|
|
|
157
167
|
try {
|
|
158
168
|
bar.update(floor);
|
|
159
169
|
}
|
|
160
|
-
catch {
|
|
170
|
+
catch {
|
|
171
|
+
// Ignore update errors
|
|
172
|
+
}
|
|
161
173
|
}
|
|
162
174
|
}, finishInterval);
|
|
163
175
|
});
|
|
@@ -25,6 +25,7 @@ export async function getLatestVersions() {
|
|
|
25
25
|
'ts-node',
|
|
26
26
|
'husky',
|
|
27
27
|
'@types/node',
|
|
28
|
+
'@types/cli-progress',
|
|
28
29
|
'eslint',
|
|
29
30
|
'eslint-config-prettier',
|
|
30
31
|
'eslint-plugin-prettier',
|
|
@@ -37,6 +38,7 @@ export async function getLatestVersions() {
|
|
|
37
38
|
'commander',
|
|
38
39
|
'inquirer',
|
|
39
40
|
'chalk',
|
|
41
|
+
'cli-progress',
|
|
40
42
|
'ora',
|
|
41
43
|
'yargs',
|
|
42
44
|
'pnpm',
|
package/dist/create/prompts.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import inquirer from 'inquirer';
|
|
2
2
|
import Enquirer from 'enquirer';
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3
4
|
const Select = Enquirer.Select || Enquirer.default?.Select;
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
6
|
const Input = Enquirer.Input || Enquirer.default?.Input;
|
|
5
7
|
import chalk from 'chalk';
|
|
6
8
|
import readline from 'readline';
|
package/dist/create/templates.js
CHANGED
|
@@ -177,6 +177,7 @@ export function generatePackageJson(answers, versions) {
|
|
|
177
177
|
typescript: versions?.['typescript'] || '^5.7.2',
|
|
178
178
|
'ts-node': versions?.['ts-node'] || '^10.9.1',
|
|
179
179
|
'@types/node': versions?.['@types/node'] || '^22.10.5',
|
|
180
|
+
'@types/cli-progress': versions?.['@types/cli-progress'] || '^3.11.6',
|
|
180
181
|
'lint-staged': versions?.['lint-staged'] || '^15.2.11',
|
|
181
182
|
};
|
|
182
183
|
// Include ESLint and Prettier by default in generated projects
|
|
@@ -197,6 +198,7 @@ export function generatePackageJson(answers, versions) {
|
|
|
197
198
|
commander: versions?.['commander'] || '^11.1.0',
|
|
198
199
|
inquirer: versions?.['inquirer'] || '^9.0.0',
|
|
199
200
|
chalk: versions?.['chalk'] || '^5.3.0',
|
|
201
|
+
'cli-progress': versions?.['cli-progress'] || '^3.12.0',
|
|
200
202
|
ora: versions?.['ora'] || '^8.1.1',
|
|
201
203
|
yargs: versions?.['yargs'] || '^18.0.0',
|
|
202
204
|
};
|
|
@@ -208,16 +210,19 @@ export function generatePackageJson(answers, versions) {
|
|
|
208
210
|
bun: versions?.['bun'] || '1.3.6',
|
|
209
211
|
};
|
|
210
212
|
function exactVersion(v) {
|
|
211
|
-
if (!v)
|
|
213
|
+
if (!v) {
|
|
212
214
|
return v;
|
|
215
|
+
}
|
|
213
216
|
const m = v.match(/\d+\.\d+\.\d+/);
|
|
214
217
|
return m ? m[0] : v.replace(/^[^\d]*/, '');
|
|
215
218
|
}
|
|
216
219
|
function buildCmdForManager(m) {
|
|
217
|
-
if (m === 'yarn')
|
|
220
|
+
if (m === 'yarn') {
|
|
218
221
|
return 'yarn build';
|
|
219
|
-
|
|
222
|
+
}
|
|
223
|
+
if (m === 'bun') {
|
|
220
224
|
return 'bun run build';
|
|
225
|
+
}
|
|
221
226
|
return `${m} run build`;
|
|
222
227
|
}
|
|
223
228
|
// When Husky is enabled, keep prepare as just 'husky' (user requested).
|
|
@@ -363,43 +368,53 @@ export function generateEditorConfig() {
|
|
|
363
368
|
: staticTemplates.editorconfig;
|
|
364
369
|
}
|
|
365
370
|
export function generateEslintConfig() {
|
|
366
|
-
return `import
|
|
367
|
-
import
|
|
368
|
-
import
|
|
369
|
-
import
|
|
371
|
+
return `import eslint from '@eslint/js';
|
|
372
|
+
import tseslint from '@typescript-eslint/eslint-plugin';
|
|
373
|
+
import tsparser from '@typescript-eslint/parser';
|
|
374
|
+
import prettier from 'eslint-plugin-prettier';
|
|
375
|
+
import prettierConfig from 'eslint-config-prettier';
|
|
370
376
|
|
|
371
377
|
export default [
|
|
378
|
+
eslint.configs.recommended,
|
|
372
379
|
{
|
|
373
|
-
|
|
374
|
-
},
|
|
375
|
-
|
|
376
|
-
{
|
|
377
|
-
files: ['**/*.{js,mjs,cjs}'],
|
|
380
|
+
files: ['src/**/*.ts'],
|
|
378
381
|
languageOptions: {
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
382
|
+
parser: tsparser,
|
|
383
|
+
parserOptions: {
|
|
384
|
+
ecmaVersion: 'latest',
|
|
385
|
+
sourceType: 'module',
|
|
386
|
+
project: './tsconfig.json',
|
|
387
|
+
},
|
|
388
|
+
globals: {
|
|
389
|
+
console: 'readonly',
|
|
390
|
+
process: 'readonly',
|
|
391
|
+
Buffer: 'readonly',
|
|
392
|
+
__dirname: 'readonly',
|
|
393
|
+
__filename: 'readonly',
|
|
394
|
+
},
|
|
389
395
|
},
|
|
390
396
|
plugins: {
|
|
391
|
-
'@typescript-eslint': tseslint
|
|
397
|
+
'@typescript-eslint': tseslint,
|
|
398
|
+
prettier: prettier,
|
|
392
399
|
},
|
|
393
400
|
rules: {
|
|
394
401
|
...tseslint.configs.recommended.rules,
|
|
402
|
+
...prettierConfig.rules,
|
|
403
|
+
'prettier/prettier': 'error',
|
|
404
|
+
'@typescript-eslint/no-unused-vars': [
|
|
405
|
+
'error',
|
|
406
|
+
{
|
|
407
|
+
argsIgnorePattern: '^_',
|
|
408
|
+
varsIgnorePattern: '^_',
|
|
409
|
+
},
|
|
410
|
+
],
|
|
411
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
412
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
413
|
+
'no-console': 'off',
|
|
395
414
|
},
|
|
396
415
|
},
|
|
397
|
-
|
|
398
416
|
{
|
|
399
|
-
|
|
400
|
-
language: 'json/json',
|
|
401
|
-
plugins: { json },
|
|
402
|
-
...json.configs.recommended,
|
|
417
|
+
ignores: ['dist/**', 'node_modules/**', '*.js'],
|
|
403
418
|
},
|
|
404
419
|
];
|
|
405
420
|
`;
|
|
@@ -417,8 +432,9 @@ export async function generateLicenseText(license, author, year) {
|
|
|
417
432
|
};
|
|
418
433
|
const key = keyMap[license] || 'MIT';
|
|
419
434
|
const textTemplate = (LICENSE_TEXTS && LICENSE_TEXTS[key]) || '';
|
|
420
|
-
if (!textTemplate)
|
|
435
|
+
if (!textTemplate) {
|
|
421
436
|
return `MIT License\n\nCopyright (c) ${year} ${author}`;
|
|
437
|
+
}
|
|
422
438
|
// Common placeholder patterns to replace in license text files.
|
|
423
439
|
// Support multiple variants users may paste: [year], <YEAR>, {{year}}, {yyyy}, etc.
|
|
424
440
|
const yearRegex = /\[year\]|\{yyyy\}|<year>|\{\{year\}\}|\[YEAR\]|<YEAR>|\{YEAR\}/gi;
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ const program = new Command();
|
|
|
5
5
|
program
|
|
6
6
|
.name('brick')
|
|
7
7
|
.description('Interactive CLI to scaffold TypeScript CLI projects')
|
|
8
|
-
.version('1.0.
|
|
8
|
+
.version('1.0.43');
|
|
9
9
|
program.addCommand(createCommand());
|
|
10
10
|
program.addCommand(sampleCommand());
|
|
11
11
|
program.parseAsync(process.argv).catch((err) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tukuyomil032/bricklayer",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.43",
|
|
5
5
|
"description": "Interactive TypeScript CLI project scaffolder",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -47,11 +47,9 @@
|
|
|
47
47
|
"chalk": "^5.3.0",
|
|
48
48
|
"cli-progress": "^3.12.0",
|
|
49
49
|
"commander": "^11.1.0",
|
|
50
|
-
"consola": "^3.4.2",
|
|
51
50
|
"enquirer": "^2.4.1",
|
|
52
51
|
"inquirer": "^9.2.11",
|
|
53
|
-
"ora": "^8.1.1"
|
|
54
|
-
"yargs": "^18.0.0"
|
|
52
|
+
"ora": "^8.1.1"
|
|
55
53
|
},
|
|
56
54
|
"devDependencies": {
|
|
57
55
|
"@eslint/js": "^9.39.2",
|
|
@@ -59,7 +57,6 @@
|
|
|
59
57
|
"@types/cli-progress": "^3.11.6",
|
|
60
58
|
"@types/inquirer": "^9.0.9",
|
|
61
59
|
"@types/node": "^22.10.5",
|
|
62
|
-
"@types/yargs": "^17.0.35",
|
|
63
60
|
"@typescript-eslint/eslint-plugin": "^8.52.0",
|
|
64
61
|
"@typescript-eslint/parser": "^8.52.0",
|
|
65
62
|
"eslint": "^9.39.2",
|