@libria/scaffold 0.1.1 → 0.2.0
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/.clean-publish.hash +1 -1
- package/README.md +136 -0
- package/package.json +1 -1
package/.clean-publish.hash
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
67292df359f00038fa640827b2a95a50df39ff84b0d73ed79def8ee3c1a802ce
|
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@ Forge your next project with lightning-fast scaffolding. A pluggable CLI that tr
|
|
|
9
9
|
|
|
10
10
|
- **Interactive CLI**: Guided project creation with sensible defaults
|
|
11
11
|
- **Plugin System**: Extensible architecture for custom templates
|
|
12
|
+
- **Configuration File**: Register custom plugin directories via `.lbscaffold`
|
|
12
13
|
- **Dry Run Mode**: Preview what will be generated before committing
|
|
13
14
|
- **Force Overwrite**: Safely regenerate existing projects
|
|
14
15
|
- **Built-in Templates**: TypeScript libraries and more included
|
|
@@ -92,6 +93,141 @@ A modern TypeScript library template with:
|
|
|
92
93
|
- Package.json with proper exports
|
|
93
94
|
- Comprehensive README and LICENSE
|
|
94
95
|
|
|
96
|
+
### angular
|
|
97
|
+
|
|
98
|
+
A complete Angular application template using the official Angular CLI. Supports:
|
|
99
|
+
|
|
100
|
+
- Angular versions: Latest, 20, 19, 18, 17, 16
|
|
101
|
+
- Stylesheet formats: SCSS, CSS, Sass, Less
|
|
102
|
+
- Optional routing module
|
|
103
|
+
- Optional Server-Side Rendering (SSR)
|
|
104
|
+
- Git initialization (optional)
|
|
105
|
+
- Dependency installation (optional)
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
lb-scaffold create -t angular -n my-angular-app
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Interactive prompts:**
|
|
112
|
+
- Angular version selection
|
|
113
|
+
- Stylesheet format (SCSS recommended)
|
|
114
|
+
- Add routing module?
|
|
115
|
+
- Enable SSR?
|
|
116
|
+
- Skip git initialization?
|
|
117
|
+
- Skip npm install?
|
|
118
|
+
|
|
119
|
+
### nestjs
|
|
120
|
+
|
|
121
|
+
A production-ready NestJS backend application using the official NestJS CLI. Includes:
|
|
122
|
+
|
|
123
|
+
- TypeScript with strict mode (optional)
|
|
124
|
+
- Package manager choice: npm, Yarn, or pnpm
|
|
125
|
+
- Controller, Service, and Module structure
|
|
126
|
+
- Unit test setup with Jest
|
|
127
|
+
- E2E test configuration
|
|
128
|
+
- Git initialization (optional)
|
|
129
|
+
- Dependency installation (optional)
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
lb-scaffold create -t nestjs -n my-nest-api
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Interactive prompts:**
|
|
136
|
+
- Package manager selection (npm, Yarn, pnpm)
|
|
137
|
+
- Enable strict TypeScript mode?
|
|
138
|
+
- Skip git initialization?
|
|
139
|
+
- Skip package installation?
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
## Configuration
|
|
143
|
+
|
|
144
|
+
The scaffold CLI supports a configuration file (`.lbscaffold`) that allows you to register custom plugin directories. This enables you to use your own templates alongside the built-in ones.
|
|
145
|
+
|
|
146
|
+
### Config File Location
|
|
147
|
+
|
|
148
|
+
The CLI searches for `.lbscaffold` starting from the current directory and walking up the directory tree. This allows you to have project-specific or workspace-level configurations.
|
|
149
|
+
|
|
150
|
+
### Config Commands
|
|
151
|
+
|
|
152
|
+
Initialize a new config file:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
lb-scaffold config init
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
This creates a `.lbscaffold` file with a default plugin path:
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"plugins": ["./plugins/**"]
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Add a custom plugin directory:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
lb-scaffold config add ./my-templates/**
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Remove a plugin directory:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
lb-scaffold config remove ./my-templates/**
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
List all configured plugin patterns:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
lb-scaffold config list
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Show the full config file:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
lb-scaffold config show
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Config File Format
|
|
191
|
+
|
|
192
|
+
The `.lbscaffold` config file is a JSON file with the following structure:
|
|
193
|
+
|
|
194
|
+
```json
|
|
195
|
+
{
|
|
196
|
+
"plugins": [
|
|
197
|
+
"./plugins/**",
|
|
198
|
+
"./custom-templates/**",
|
|
199
|
+
"/absolute/path/to/plugins/**"
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
The `plugins` array contains glob patterns pointing to directories containing template plugins. Paths can be:
|
|
205
|
+
- **Relative**: Resolved relative to the config file location
|
|
206
|
+
- **Absolute**: Used as-is
|
|
207
|
+
|
|
208
|
+
### Plugin Override Behavior
|
|
209
|
+
|
|
210
|
+
When a user plugin has the same name as a built-in plugin, the user plugin takes precedence. This allows you to customize or replace built-in templates.
|
|
211
|
+
|
|
212
|
+
### Example: Using Custom Templates
|
|
213
|
+
|
|
214
|
+
1. Create a config file:
|
|
215
|
+
```bash
|
|
216
|
+
lb-scaffold config init
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
2. Add your custom templates directory:
|
|
220
|
+
```bash
|
|
221
|
+
lb-scaffold config add ./my-company-templates/**
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
3. Create a template plugin in that directory (see [Creating Custom Template Plugins](#creating-custom-template-plugins))
|
|
225
|
+
|
|
226
|
+
4. Your template will now appear in the template selection:
|
|
227
|
+
```bash
|
|
228
|
+
lb-scaffold create
|
|
229
|
+
```
|
|
230
|
+
|
|
95
231
|
## Creating Custom Template Plugins
|
|
96
232
|
|
|
97
233
|
The scaffold CLI uses a plugin system powered by `@libria/plugin-loader`. Each template is a self-contained plugin.
|
package/package.json
CHANGED