@libria/scaffold 0.1.1 → 0.1.2

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.
@@ -1 +1 @@
1
- fc81e29776ad0f9497efb0ab7b793ecedb74817722e96a078ed7d4be2915502e
1
+ 81fb90099d5aafefad5baa8e8a0fed424dfa1a5cbd7a224c2e23946de7c1d923
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,95 @@ A modern TypeScript library template with:
92
93
  - Package.json with proper exports
93
94
  - Comprehensive README and LICENSE
94
95
 
96
+ ## Configuration
97
+
98
+ 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.
99
+
100
+ ### Config File Location
101
+
102
+ 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.
103
+
104
+ ### Config Commands
105
+
106
+ Initialize a new config file:
107
+
108
+ ```bash
109
+ lb-scaffold config init
110
+ ```
111
+
112
+ This creates a `.lbscaffold` file with a default plugin path:
113
+
114
+ ```json
115
+ {
116
+ "plugins": ["./plugins/**"]
117
+ }
118
+ ```
119
+
120
+ Add a custom plugin directory:
121
+
122
+ ```bash
123
+ lb-scaffold config add ./my-templates/**
124
+ ```
125
+
126
+ Remove a plugin directory:
127
+
128
+ ```bash
129
+ lb-scaffold config remove ./my-templates/**
130
+ ```
131
+
132
+ List all configured plugin patterns:
133
+
134
+ ```bash
135
+ lb-scaffold config list
136
+ ```
137
+
138
+ Show the full config file:
139
+
140
+ ```bash
141
+ lb-scaffold config show
142
+ ```
143
+
144
+ ### Config File Format
145
+
146
+ The `.lbscaffold` config file is a JSON file with the following structure:
147
+
148
+ ```json
149
+ {
150
+ "plugins": [
151
+ "./plugins/**",
152
+ "./custom-templates/**",
153
+ "/absolute/path/to/plugins/**"
154
+ ]
155
+ }
156
+ ```
157
+
158
+ The `plugins` array contains glob patterns pointing to directories containing template plugins. Paths can be:
159
+ - **Relative**: Resolved relative to the config file location
160
+ - **Absolute**: Used as-is
161
+
162
+ ### Plugin Override Behavior
163
+
164
+ 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.
165
+
166
+ ### Example: Using Custom Templates
167
+
168
+ 1. Create a config file:
169
+ ```bash
170
+ lb-scaffold config init
171
+ ```
172
+
173
+ 2. Add your custom templates directory:
174
+ ```bash
175
+ lb-scaffold config add ./my-company-templates/**
176
+ ```
177
+
178
+ 3. Create a template plugin in that directory (see [Creating Custom Template Plugins](#creating-custom-template-plugins))
179
+
180
+ 4. Your template will now appear in the template selection:
181
+ ```bash
182
+ lb-scaffold create
183
+ ```
184
+
95
185
  ## Creating Custom Template Plugins
96
186
 
97
187
  The scaffold CLI uses a plugin system powered by `@libria/plugin-loader`. Each template is a self-contained plugin.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libria/scaffold",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "A pluggable CLI that transforms blank directories into production-ready codebases in seconds",
5
5
  "main": "dist/cli/index.cjs",
6
6
  "module": "dist/cli/index.mjs",