Skip to content

Commit 2887295

Browse files
committed
1.6.2: Add --copy and --link parameters for local template usage in server, frontend, and fullstack commands
1 parent 1e31bfe commit 2887295

File tree

15 files changed

+1125
-208
lines changed

15 files changed

+1125
-208
lines changed

docs/commands.md

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ lt server create [name] [options]
7272
|--------|-------------|
7373
| `--description <text>` | Project description |
7474
| `--author <name>` | Author name |
75+
| `--branch <branch>` / `-b` | Branch of nest-server-starter to use as template |
76+
| `--copy <path>` / `-c` | Copy from local template directory instead of cloning |
77+
| `--link <path>` | Symlink to local template directory (fastest, changes affect original) |
7578
| `--git` | Initialize git repository |
7679
| `--noConfirm` | Skip confirmation prompts |
7780

@@ -426,10 +429,18 @@ lt fullstack init [options]
426429
|--------|-------------|
427430
| `--name <name>` | Project name |
428431
| `--frontend <type>` | Frontend framework: `angular` or `nuxt` |
432+
| `--api-branch <branch>` | Branch of nest-server-starter to use for API |
433+
| `--api-copy <path>` | Copy API from local template directory |
434+
| `--api-link <path>` | Symlink API to local template (fastest, changes affect original) |
435+
| `--frontend-branch <branch>` | Branch of frontend starter to use (ng-base-starter or nuxt-base-starter) |
436+
| `--frontend-copy <path>` | Copy frontend from local template directory |
437+
| `--frontend-link <path>` | Symlink frontend to local template (fastest, changes affect original) |
429438
| `--git` | Initialize git repository |
430439
| `--git-link <url>` | Git repository URL |
431440
| `--noConfirm` | Skip confirmation prompts |
432441

442+
**Note:** For Nuxt frontends with `--frontend-copy` or `--frontend-link`, specify the path to the `nuxt-base-template/` subdirectory, not the repository root.
443+
433444
**Configuration:** `commands.fullstack.*`, `defaults.noConfirm`
434445

435446
---
@@ -495,24 +506,51 @@ lt npm update
495506

496507
### `lt frontend angular`
497508

498-
Creates a new Angular workspace.
509+
Creates a new Angular workspace using ng-base-starter.
499510

500511
**Usage:**
501512
```bash
502-
lt frontend angular [name]
513+
lt frontend angular [name] [options]
503514
```
504515

516+
**Options:**
517+
| Option | Description |
518+
|--------|-------------|
519+
| `--branch <branch>` / `-b` | Branch of ng-base-starter to use as template |
520+
| `--copy <path>` / `-c` | Copy from local template directory instead of cloning |
521+
| `--link <path>` | Symlink to local template directory (fastest, changes affect original) |
522+
| `--localize` | Enable Angular localize |
523+
| `--noLocalize` | Disable Angular localize |
524+
| `--gitLink <url>` | Git repository URL to link |
525+
| `--noConfirm` / `-y` | Skip confirmation prompts |
526+
527+
**Configuration:** `commands.frontend.angular.*`, `defaults.noConfirm`
528+
505529
---
506530

507531
### `lt frontend nuxt`
508532

509-
Creates a new Nuxt workspace.
533+
Creates a new Nuxt workspace using nuxt-base-starter.
510534

511535
**Usage:**
512536
```bash
513-
lt frontend nuxt
537+
lt frontend nuxt [options]
538+
```
539+
540+
**Options:**
541+
| Option | Description |
542+
|--------|-------------|
543+
| `--branch <branch>` / `-b` | Branch of nuxt-base-starter to use (uses git clone instead of create-nuxt-base) |
544+
| `--copy <path>` / `-c` | Copy from local template directory instead of cloning |
545+
| `--link <path>` | Symlink to local template directory (fastest, changes affect original) |
546+
547+
**Note:** For `--copy` and `--link`, specify the path to the `nuxt-base-template/` subdirectory, not the repository root:
548+
```bash
549+
lt frontend nuxt --copy /path/to/nuxt-base-starter/nuxt-base-template
514550
```
515551

552+
**Configuration:** `commands.frontend.nuxt.*`
553+
516554
---
517555

518556
## Config Commands

docs/lt.config.md

Lines changed: 96 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,12 @@ Creates a new server project.
360360
| Field | Type | Default | Description |
361361
|-------|------|---------|-------------|
362362
| `commands.server.create.author` | `string` | - | Default author for new projects |
363+
| `commands.server.create.branch` | `string` | - | Branch of nest-server-starter to use as template |
363364
| `commands.server.create.controller` | `'Rest'` \| `'GraphQL'` \| `'Both'` \| `'auto'` | `'Both'` | Default controller type for new projects |
365+
| `commands.server.create.copy` | `string` | - | Path to local template directory to copy instead of cloning |
364366
| `commands.server.create.description` | `string` | - | Default description (use `{name}` as placeholder) |
365367
| `commands.server.create.git` | `boolean` | - | Initialize git repository |
368+
| `commands.server.create.link` | `string` | - | Path to local template directory to symlink (fastest, changes affect original) |
366369
| `commands.server.create.noConfirm` | `boolean` | `false` | Skip confirmation prompts |
367370

368371
**Example:**
@@ -374,7 +377,9 @@ Creates a new server project.
374377
"controller": "Both",
375378
"git": true,
376379
"author": "lenne.Tech Team <[email protected]>",
377-
"description": "{name} Server"
380+
"description": "{name} Server",
381+
"branch": "feature/new-auth",
382+
"copy": "/path/to/local/nest-server-starter"
378383
}
379384
}
380385
}
@@ -383,7 +388,9 @@ Creates a new server project.
383388

384389
**CLI Override:**
385390
```bash
386-
lt server create --name MyServer --git true --author "John Doe" --description "My Server"
391+
lt server create --name MyServer --git true --author "John Doe" --description "My Server" --branch feature/new-auth
392+
lt server create --copy /path/to/local/nest-server-starter
393+
lt server create --link /path/to/local/nest-server-starter # Fastest, but changes affect original
387394
```
388395

389396
---
@@ -424,6 +431,79 @@ lt deployment create --domain myproject.example.com --gitLab true --testRunner d
424431

425432
---
426433

434+
### Frontend Commands
435+
436+
#### `lt frontend angular`
437+
438+
Creates a new Angular frontend project using ng-base-starter.
439+
440+
| Field | Type | Default | Description |
441+
|-------|------|---------|-------------|
442+
| `commands.frontend.angular.branch` | `string` | - | Branch of ng-base-starter to use as template |
443+
| `commands.frontend.angular.copy` | `string` | - | Path to local template directory to copy instead of cloning |
444+
| `commands.frontend.angular.link` | `string` | - | Path to local template directory to symlink (fastest, changes affect original) |
445+
| `commands.frontend.angular.localize` | `boolean` | - | Enable Angular localize by default |
446+
| `commands.frontend.angular.noConfirm` | `boolean` | `false` | Skip confirmation prompts |
447+
448+
**Example:**
449+
```json
450+
{
451+
"commands": {
452+
"frontend": {
453+
"angular": {
454+
"branch": "feature/new-design",
455+
"localize": true,
456+
"copy": "/path/to/local/ng-base-starter"
457+
}
458+
}
459+
}
460+
}
461+
```
462+
463+
**CLI Override:**
464+
```bash
465+
lt frontend angular --branch feature/new-design
466+
lt frontend angular --copy /path/to/local/ng-base-starter
467+
lt frontend angular --link /path/to/local/ng-base-starter # Fastest, changes affect original
468+
```
469+
470+
---
471+
472+
#### `lt frontend nuxt`
473+
474+
Creates a new Nuxt frontend project using nuxt-base-starter.
475+
476+
| Field | Type | Default | Description |
477+
|-------|------|---------|-------------|
478+
| `commands.frontend.nuxt.branch` | `string` | - | Branch of nuxt-base-starter to use. When specified, uses git clone instead of create-nuxt-base |
479+
| `commands.frontend.nuxt.copy` | `string` | - | Path to the `nuxt-base-template/` subdirectory to copy |
480+
| `commands.frontend.nuxt.link` | `string` | - | Path to the `nuxt-base-template/` subdirectory to symlink (fastest, changes affect original) |
481+
482+
**Note:** For `copy` and `link`, specify the path to the `nuxt-base-template/` subdirectory within the nuxt-base-starter repository, not the repository root.
483+
484+
**Example:**
485+
```json
486+
{
487+
"commands": {
488+
"frontend": {
489+
"nuxt": {
490+
"branch": "feature/new-design",
491+
"copy": "/path/to/nuxt-base-starter/nuxt-base-template"
492+
}
493+
}
494+
}
495+
}
496+
```
497+
498+
**CLI Override:**
499+
```bash
500+
lt frontend nuxt --branch feature/new-design
501+
lt frontend nuxt --copy /path/to/nuxt-base-starter/nuxt-base-template
502+
lt frontend nuxt --link /path/to/nuxt-base-starter/nuxt-base-template # Fastest, changes affect original
503+
```
504+
505+
---
506+
427507
### Fullstack Commands
428508

429509
#### `lt fullstack init`
@@ -432,7 +512,13 @@ Creates a new fullstack workspace with API and frontend.
432512

433513
| Field | Type | Default | Description |
434514
|-------|------|---------|-------------|
515+
| `commands.fullstack.apiBranch` | `string` | - | Branch of nest-server-starter to use for API |
516+
| `commands.fullstack.apiCopy` | `string` | - | Path to local API template directory to copy instead of cloning |
517+
| `commands.fullstack.apiLink` | `string` | - | Path to local API template directory to symlink (fastest, changes affect original) |
435518
| `commands.fullstack.frontend` | `'angular'` \| `'nuxt'` | - | Default frontend framework |
519+
| `commands.fullstack.frontendBranch` | `string` | - | Branch of frontend starter to use (ng-base-starter or nuxt-base-starter) |
520+
| `commands.fullstack.frontendCopy` | `string` | - | Path to local frontend template directory to copy instead of cloning |
521+
| `commands.fullstack.frontendLink` | `string` | - | Path to local frontend template directory to symlink (fastest, changes affect original) |
436522
| `commands.fullstack.git` | `boolean` | - | Initialize git repository |
437523
| `commands.fullstack.gitLink` | `string` | - | Git repository URL |
438524

@@ -443,15 +529,21 @@ Creates a new fullstack workspace with API and frontend.
443529
"fullstack": {
444530
"frontend": "nuxt",
445531
"git": true,
446-
"gitLink": "https://github.com/myorg/myproject.git"
532+
"gitLink": "https://github.com/myorg/myproject.git",
533+
"apiBranch": "feature/new-auth",
534+
"frontendBranch": "feature/new-design",
535+
"apiCopy": "/path/to/local/nest-server-starter",
536+
"frontendCopy": "/path/to/local/nuxt-base-starter"
447537
}
448538
}
449539
}
450540
```
451541

452542
**CLI Override:**
453543
```bash
454-
lt fullstack init --name MyProject --frontend angular --git true --git-link https://...
544+
lt fullstack init --name MyProject --frontend angular --git true --git-link https://... --api-branch feature/new-auth --frontend-branch feature/new-design
545+
lt fullstack init --api-copy /path/to/api --frontend-copy /path/to/frontend
546+
lt fullstack init --api-link /path/to/api --frontend-link /path/to/frontend # Fastest, changes affect original
455547
```
456548

457549
---

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lenne.tech/cli",
3-
"version": "1.6.1",
3+
"version": "1.6.2",
44
"description": "lenne.Tech CLI: lt",
55
"keywords": [
66
"lenne.Tech",

schemas/lt.config.schema.json

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,21 @@
178178
"type": "object",
179179
"description": "Configuration for 'lt frontend angular' command",
180180
"properties": {
181+
"branch": {
182+
"type": "string",
183+
"description": "Branch of ng-base-starter to use as template",
184+
"examples": ["feature/new-auth"]
185+
},
186+
"copy": {
187+
"type": "string",
188+
"description": "Path to local template directory to copy instead of cloning",
189+
"examples": ["/path/to/local/ng-base-starter"]
190+
},
191+
"link": {
192+
"type": "string",
193+
"description": "Path to local template directory to symlink instead of cloning (fastest, changes affect original)",
194+
"examples": ["/path/to/local/ng-base-starter"]
195+
},
181196
"localize": {
182197
"type": "boolean",
183198
"description": "Enable Angular localize by default"
@@ -188,6 +203,28 @@
188203
}
189204
},
190205
"additionalProperties": false
206+
},
207+
"nuxt": {
208+
"type": "object",
209+
"description": "Configuration for 'lt frontend nuxt' command",
210+
"properties": {
211+
"branch": {
212+
"type": "string",
213+
"description": "Branch of nuxt-base-starter to use as template. When specified, uses git clone instead of create-nuxt-base",
214+
"examples": ["feature/new-auth"]
215+
},
216+
"copy": {
217+
"type": "string",
218+
"description": "Path to local template directory to copy instead of cloning",
219+
"examples": ["/path/to/local/nuxt-base-starter"]
220+
},
221+
"link": {
222+
"type": "string",
223+
"description": "Path to local template directory to symlink instead of cloning (fastest, changes affect original)",
224+
"examples": ["/path/to/local/nuxt-base-starter"]
225+
}
226+
},
227+
"additionalProperties": false
191228
}
192229
},
193230
"additionalProperties": false
@@ -196,11 +233,41 @@
196233
"type": "object",
197234
"description": "Configuration for 'lt fullstack init' command",
198235
"properties": {
236+
"apiBranch": {
237+
"type": "string",
238+
"description": "Branch of nest-server-starter to use for API",
239+
"examples": ["feature/new-auth"]
240+
},
241+
"apiCopy": {
242+
"type": "string",
243+
"description": "Path to local API template directory to copy instead of cloning",
244+
"examples": ["/path/to/local/nest-server-starter"]
245+
},
246+
"apiLink": {
247+
"type": "string",
248+
"description": "Path to local API template directory to symlink instead of cloning (fastest, changes affect original)",
249+
"examples": ["/path/to/local/nest-server-starter"]
250+
},
199251
"frontend": {
200252
"type": "string",
201253
"enum": ["angular", "nuxt"],
202254
"description": "Default frontend framework"
203255
},
256+
"frontendBranch": {
257+
"type": "string",
258+
"description": "Branch of frontend starter to use (ng-base-starter or nuxt-base-starter)",
259+
"examples": ["feature/new-design"]
260+
},
261+
"frontendCopy": {
262+
"type": "string",
263+
"description": "Path to local frontend template directory to copy instead of cloning",
264+
"examples": ["/path/to/local/ng-base-starter"]
265+
},
266+
"frontendLink": {
267+
"type": "string",
268+
"description": "Path to local frontend template directory to symlink instead of cloning (fastest, changes affect original)",
269+
"examples": ["/path/to/local/ng-base-starter"]
270+
},
204271
"git": {
205272
"type": "boolean",
206273
"description": "Initialize git by default"
@@ -427,11 +494,21 @@
427494
"type": "string",
428495
"description": "Default author for new server projects"
429496
},
497+
"branch": {
498+
"type": "string",
499+
"description": "Branch of nest-server-starter to use as template",
500+
"examples": ["feature/new-auth"]
501+
},
430502
"controller": {
431503
"type": "string",
432504
"enum": ["Rest", "GraphQL", "Both", "auto"],
433505
"description": "Default controller type for new server projects"
434506
},
507+
"copy": {
508+
"type": "string",
509+
"description": "Path to local template directory to copy instead of cloning",
510+
"examples": ["/path/to/local/nest-server-starter"]
511+
},
435512
"description": {
436513
"type": "string",
437514
"description": "Default description for new server projects"
@@ -440,6 +517,11 @@
440517
"type": "boolean",
441518
"description": "Initialize git for new server projects"
442519
},
520+
"link": {
521+
"type": "string",
522+
"description": "Path to local template directory to symlink instead of cloning (fastest, changes affect original)",
523+
"examples": ["/path/to/local/nest-server-starter"]
524+
},
443525
"noConfirm": {
444526
"type": "boolean",
445527
"description": "Skip confirmation prompts"

0 commit comments

Comments
 (0)