@tukuyomil032/bricklayer 1.0.3 ā 1.0.42
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/README.md +36 -20
- package/dist/create/package-versions.js +2 -0
- package/dist/create/templates.js +15 -3
- package/dist/index.js +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -6,12 +6,17 @@ Quickly generate a well-structured TypeScript CLI project with best practices bu
|
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
|
-
⨠**Interactive Setup** - Guided prompts for project configuration
|
|
10
|
-
š¦ **Latest Packages** - Automatically fetches the latest npm package versions
|
|
11
|
-
šØ **Optional Tools** - Choose Prettier and ESLint during setup
|
|
12
|
-
šŖ **Git Hooks** - Pre-configured Husky hooks with lint-staged
|
|
13
|
-
šļø **Clean Structure** - Role-separated files and commands
|
|
14
|
-
ā” **Multiple Package Managers** - Support for pnpm, npm, yarn, and bun
|
|
9
|
+
- ⨠**Interactive Setup** - Guided prompts for project configuration
|
|
10
|
+
- š¦ **Latest Packages** - Automatically fetches the latest npm package versions
|
|
11
|
+
- šØ **Optional Tools** - Choose Prettier and ESLint during setup
|
|
12
|
+
- šŖ **Git Hooks** - Pre-configured Husky hooks with lint-staged
|
|
13
|
+
- šļø **Clean Structure** - Role-separated files and commands
|
|
14
|
+
- ā” **Multiple Package Managers** - Support for pnpm, npm, yarn, and bun
|
|
15
|
+
|
|
16
|
+
## Prerequisites
|
|
17
|
+
|
|
18
|
+
- Node.js 18+
|
|
19
|
+
- npm, pnpm, yarn, bun
|
|
15
20
|
|
|
16
21
|
## Installation
|
|
17
22
|
|
|
@@ -32,16 +37,26 @@ bun add -g @tukuyomil032/bricklayer
|
|
|
32
37
|
|
|
33
38
|
```bash
|
|
34
39
|
# When treating the current directory during command execution as the project's root folder:
|
|
35
|
-
brick create
|
|
40
|
+
$ brick create
|
|
41
|
+
|
|
42
|
+
# To view the help screen:
|
|
43
|
+
$ brick -h
|
|
36
44
|
|
|
37
45
|
# If you want to specify the project's root folder yourself (we generally recommend using this option):
|
|
38
46
|
# Use the arrow keys (up and down) and the Enter key to navigate to the project's root folder.
|
|
39
|
-
brick create -d
|
|
47
|
+
$ brick create -d
|
|
40
48
|
|
|
41
49
|
# You can also specify a project folder directly by entering a relative path after the `-d` option.
|
|
42
|
-
brick create -d ~/Documents/dev/CLI/my-test-project
|
|
50
|
+
$ brick create -d ~/Documents/dev/CLI/my-test-project
|
|
43
51
|
```
|
|
44
52
|
|
|
53
|
+
## Available Options
|
|
54
|
+
|
|
55
|
+
- ``-h --help`` - display help for command
|
|
56
|
+
- ``-V --version`` - output the version number
|
|
57
|
+
- ``-d --destination`` - Specify the project creation directory
|
|
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
|
+
|
|
45
60
|
Follow the interactive prompts to configure your project:
|
|
46
61
|
|
|
47
62
|
- Project name
|
|
@@ -63,15 +78,16 @@ your-cli/
|
|
|
63
78
|
āāā .husky/ #options
|
|
64
79
|
ā āāā pre-commit
|
|
65
80
|
ā āāā pre-push
|
|
66
|
-
āāā .gitignore
|
|
67
|
-
āāā .prettierrc
|
|
68
|
-
āāā .prettierignore
|
|
69
81
|
āāā .editorconfig
|
|
82
|
+
āāā .gitignore
|
|
70
83
|
āāā .npmignore
|
|
84
|
+
āāā .npmrc
|
|
85
|
+
āāā .prettierignore
|
|
86
|
+
āāā .prettierrc
|
|
71
87
|
āāā eslint.config.js
|
|
72
88
|
āāā package.json
|
|
73
|
-
āāā
|
|
74
|
-
āāā
|
|
89
|
+
āāā README.md
|
|
90
|
+
āāā tsconfig.json
|
|
75
91
|
```
|
|
76
92
|
|
|
77
93
|
## Development
|
|
@@ -82,10 +98,10 @@ git clone https://github.com/tukuyomil032/bricklayer.git
|
|
|
82
98
|
cd bricklayer
|
|
83
99
|
|
|
84
100
|
# Install dependencies
|
|
85
|
-
|
|
101
|
+
npm install
|
|
86
102
|
|
|
87
103
|
# Build
|
|
88
|
-
|
|
104
|
+
npm run build
|
|
89
105
|
|
|
90
106
|
# Test locally
|
|
91
107
|
node dist/index.js create
|
|
@@ -93,10 +109,10 @@ node dist/index.js create
|
|
|
93
109
|
|
|
94
110
|
## Scripts
|
|
95
111
|
|
|
96
|
-
- `
|
|
97
|
-
- `
|
|
98
|
-
- `
|
|
99
|
-
- `
|
|
112
|
+
- `npm run build` - Build the TypeScript project
|
|
113
|
+
- `npm run dev` - Run in development mode
|
|
114
|
+
- `npm run lint` - Lint the code
|
|
115
|
+
- `npm run format` - Format the code with Prettier
|
|
100
116
|
|
|
101
117
|
## Requirements
|
|
102
118
|
|
package/dist/create/templates.js
CHANGED
|
@@ -161,6 +161,16 @@ const hooksTemplates = {
|
|
|
161
161
|
'pnpm run lint && pnpm run format:check',
|
|
162
162
|
],
|
|
163
163
|
};
|
|
164
|
+
// Generate scripts object with OS-specific postbuild handling
|
|
165
|
+
function generateScriptsWithPermissions(baseScripts) {
|
|
166
|
+
// Add postbuild script to handle file permissions across platforms
|
|
167
|
+
// Unix-like systems: set executable permission via chmod
|
|
168
|
+
// Windows: chmodSync still applies but has no effect (harmless)
|
|
169
|
+
return {
|
|
170
|
+
...baseScripts,
|
|
171
|
+
postbuild: "node -e \"require('fs').chmodSync('dist/index.js', 0o755)\"",
|
|
172
|
+
};
|
|
173
|
+
}
|
|
164
174
|
// license texts are provided from src/create/licenses.ts
|
|
165
175
|
export function generatePackageJson(answers, versions) {
|
|
166
176
|
const devDeps = {
|
|
@@ -176,6 +186,8 @@ export function generatePackageJson(answers, versions) {
|
|
|
176
186
|
devDeps['@typescript-eslint/parser'] = versions?.['@typescript-eslint/parser'] || '^8.52.0';
|
|
177
187
|
devDeps['@typescript-eslint/eslint-plugin'] =
|
|
178
188
|
versions?.['@typescript-eslint/eslint-plugin'] || '^8.52.0';
|
|
189
|
+
devDeps['typescript-eslint'] = versions?.['typescript-eslint'] || '^8.52.0';
|
|
190
|
+
devDeps['@eslint/json'] = versions?.['@eslint/json'] || '^0.1.1';
|
|
179
191
|
devDeps['prettier'] = versions?.['prettier'] || '^3.7.4';
|
|
180
192
|
// Husky should only be added when requested (useHusky)
|
|
181
193
|
if (answers.useHusky) {
|
|
@@ -222,8 +234,8 @@ export function generatePackageJson(answers, versions) {
|
|
|
222
234
|
[answers.name]: './dist/index.js',
|
|
223
235
|
},
|
|
224
236
|
files: ['dist', 'README.md'],
|
|
225
|
-
scripts: Object.assign({
|
|
226
|
-
build: 'tsc -p tsconfig.json
|
|
237
|
+
scripts: generateScriptsWithPermissions(Object.assign({
|
|
238
|
+
build: 'tsc -p tsconfig.json',
|
|
227
239
|
prepare: prepareScript,
|
|
228
240
|
prepublishOnly: buildCmdForManager(mgr),
|
|
229
241
|
dev: 'ts-node --esm src/index.ts',
|
|
@@ -234,7 +246,7 @@ export function generatePackageJson(answers, versions) {
|
|
|
234
246
|
'lint-staged': 'lint-staged',
|
|
235
247
|
format: 'prettier --write "src/**/*.ts"',
|
|
236
248
|
'format:check': 'prettier --check "src/**/*.ts"',
|
|
237
|
-
}, answers.useHusky ? {} : {}),
|
|
249
|
+
}, answers.useHusky ? {} : {})),
|
|
238
250
|
keywords: ['cli', 'scaffold', 'typescript', 'generator'],
|
|
239
251
|
author: answers.author,
|
|
240
252
|
license: answers.license,
|
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.42');
|
|
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.42",
|
|
5
5
|
"description": "Interactive TypeScript CLI project scaffolder",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"README.md"
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "tsc -p tsconfig.json
|
|
17
|
+
"build": "tsc -p tsconfig.json",
|
|
18
|
+
"postbuild": "node -e \"require('fs').chmodSync('dist/index.js', 0o755)\"",
|
|
18
19
|
"prepare": "husky",
|
|
19
20
|
"prepublishOnly": "pnpm run build",
|
|
20
21
|
"dev": "ts-node --esm src/index.ts",
|