From 66fa8d68ed8e783aebc9696578147901caf09e73 Mon Sep 17 00:00:00 2001 From: Pascal Klesse <54418919+pascal-klesse@users.noreply.github.com> Date: Wed, 29 Apr 2026 22:42:51 +0200 Subject: [PATCH] docs(using-lt-cli): document experimental --next flag (nest-base) Updates the using-lt-cli skill to reference the new experimental --next flag added to lt CLI in lenneTech/cli#. - SKILL.md: gotcha + parameter table entry + lt server create synopsis - examples.md: new "Experimental: --next (nest-base)" section under Fullstack Project Initialization - reference.md: detailed reference block for --next The flag swaps the API template from nest-server-starter (MongoDB) to nest-base (Bun + Prisma 7 + Postgres + Better-Auth). Documented as incompatible with the downstream lt server module/object/addProp/test/ permissions generators so future skill activations don't suggest those on a --next project. See: https://github.com/lenneTech/cli/pull/new/feat/next-experimental-nest-base Co-Authored-By: Claude Opus 4.7 (1M context) --- plugins/lt-dev/skills/using-lt-cli/SKILL.md | 14 +++-- .../lt-dev/skills/using-lt-cli/examples.md | 60 ++++++++++++++++++- .../lt-dev/skills/using-lt-cli/reference.md | 36 +++++++++++ 3 files changed, 103 insertions(+), 7 deletions(-) diff --git a/plugins/lt-dev/skills/using-lt-cli/SKILL.md b/plugins/lt-dev/skills/using-lt-cli/SKILL.md index 9f183b3..c32f345 100644 --- a/plugins/lt-dev/skills/using-lt-cli/SKILL.md +++ b/plugins/lt-dev/skills/using-lt-cli/SKILL.md @@ -12,6 +12,7 @@ description: 'Provides reference for the lenne.tech CLI tool (lt command). Cover - **`lt git reset` is DESTRUCTIVE and irreversible** — Lives next to the safe `lt git get` in the CLI menu. `reset` does `git reset --hard` followed by force-pull, destroying ALL local changes without confirmation. Never run it on a branch with unpushed work. Prefer `git stash` + `lt git get`. - **`lt server object X --controller` generates REST, NOT GraphQL** — Default is REST. For GraphQL projects, use `--resolver`. The CLI does not auto-detect from existing project patterns — you must specify explicitly. - **`lt fullstack convert-mode` rewrites the source tree** — Switching between `npm` and `vendor` mode moves framework code in/out of `src/core/` (API) or `app/core/` (App). The operation is reversible but NOT idempotent mid-run — always commit before starting, so a failed conversion can be rolled back via `git reset`. +- **`--next` is experimental and incompatible with `lt server module/object/addProp/test/permissions`** — When `lt server create --next` or `lt fullstack init --next` is used, the API is cloned from [`nest-base`](https://github.com/lenneTech/nest-base) (Bun + Prisma 7 + Postgres + Better-Auth) instead of `nest-server-starter`. The downstream generators target the classic nest-server layout (Mongoose models, src/server/modules/, etc.) and will not work on a nest-base project. Use it for greenfield prototyping only; for production work prefer the default template. ## Skill Boundaries @@ -54,7 +55,7 @@ Fetches latest from remote, resets current branch to `origin/`. **Destru ```bash # Non-interactive lt fullstack init --name --frontend --git --noConfirm \ - [--git-link ] [--api-link ] [--frontend-link ] + [--git-link ] [--api-link ] [--frontend-link ] [--next] ``` | Parameter | Required | Description | @@ -68,6 +69,7 @@ lt fullstack init --name --frontend --git --n | `--frontend-branch` | No | Branch of frontend starter | | `--api-copy` / `--api-link` | No | Local API template (copy / symlink) | | `--frontend-copy` / `--frontend-link` | No | Local frontend template (copy / symlink) | +| `--next` | No | **Experimental** — clone [`nest-base`](https://github.com/lenneTech/nest-base) (Bun + Prisma 7 + Postgres + Better-Auth) for the API. Forces `apiMode = Rest`, `frameworkMode = npm`, and skips the workspace install (run `pnpm install` for app and `bun install` for api manually). Downstream `lt server module/object/addProp/test` are NOT compatible with the resulting layout. | **Priority:** `--*-link` > `--*-copy` > `--*-branch` > default (GitHub clone) @@ -75,7 +77,7 @@ lt fullstack init --name --frontend --git --n ``` / ├── projects/ -│ ├── api/ ← nest-server-starter +│ ├── api/ ← nest-server-starter (or nest-base with --next) │ └── app/ ← nuxt-base-starter (or ng-base-starter) ├── package.json └── .gitignore @@ -86,15 +88,19 @@ lt fullstack init --name --frontend --git --n cd && pnpm install cd projects/api && pnpm start # Port 3000 cd projects/app && pnpm start # Port 3001 + +# With --next: install per subproject, no workspace install +cd /projects/app && pnpm install +cd /projects/api && bun install ``` ### lt server create — Scaffold New Server ```bash -lt server create --noConfirm [--branch ] [--copy ] [--link ] +lt server create --noConfirm [--branch ] [--copy ] [--link ] [--next] ``` -Creates a standalone NestJS project from nest-server-starter. For module/object/property commands, see `generating-nest-servers` skill. +Creates a standalone NestJS project from nest-server-starter. With `--next`, clones [`nest-base`](https://github.com/lenneTech/nest-base) (Bun + Prisma 7 + Postgres + Better-Auth) instead and skips API-mode / vendor-mode / install / `lt.config.json` processing. For module/object/property commands, see `generating-nest-servers` skill — those are NOT compatible with `--next` projects. ## Best Practices diff --git a/plugins/lt-dev/skills/using-lt-cli/examples.md b/plugins/lt-dev/skills/using-lt-cli/examples.md index 466e814..2cb423f 100644 --- a/plugins/lt-dev/skills/using-lt-cli/examples.md +++ b/plugins/lt-dev/skills/using-lt-cli/examples.md @@ -345,7 +345,61 @@ lt fullstack init --name TestApp --frontend nuxt --git false \ --- -### 4. Project Types (Examples) +### 4. Experimental: `--next` (nest-base) + +`--next` is an experimental flag that swaps the API template from +[`nest-server-starter`](https://github.com/lenneTech/nest-server-starter) +(MongoDB) to [`nest-base`](https://github.com/lenneTech/nest-base) +(Bun + Prisma 7 + Postgres + Better-Auth). + +#### Standalone API +```bash +lt server create my-next-api --description "Experimental nest-base API" \ + --author "Pascal" --next --noConfirm +``` + +**What happens:** +1. Clones `https://github.com/lenneTech/nest-base.git` into `./my-next-api/` +2. Patches `package.json` (name/description/version) — universal fields only +3. Skips API mode / vendor mode / install / `lt.config.json` (incompatible) + +**Next steps (printed by the CLI):** +```bash +cd my-next-api +bun install +# Configure .env (see .env.example) and start Postgres +bun run dev +``` + +#### Fullstack Workspace (nuxt + nest-base) +```bash +lt fullstack init --name MyNextApp --frontend nuxt --next --noConfirm +``` + +**What happens:** +1. Clones `lt-monorepo` workspace +2. Sets up Nuxt frontend in `projects/app/` +3. Clones `nest-base` into `projects/api/` (instead of `nest-server-starter`) +4. Skips workspace install — install per subproject manually + +**Next steps:** +```bash +cd MyNextApp +cd projects/app && pnpm install +cd ../api && bun install +# Configure projects/api/.env, start Postgres, run prisma generate / migrate +``` + +**Limitations of `--next`:** +- `lt server module / object / addProp / test / permissions` target the + classic nest-server layout (Mongoose, `src/server/modules/`) and will + not work on the resulting `nest-base` project. +- Vendor mode is forced off — `--framework-mode vendor` is ignored. +- API mode is forced to `Rest` — `--api-mode GraphQL/Both` is ignored. +- Use for greenfield prototyping; for production builds prefer the + default template. + +### 5. Project Types (Examples) #### Client Project (Angular + NestJS) ```bash @@ -390,7 +444,7 @@ lt fullstack init \ --- -### 5. Post-Creation Workflows +### 6. Post-Creation Workflows #### After Angular Fullstack Init ```bash @@ -433,7 +487,7 @@ pnpm run dev --- -### 6. Common Initialization Patterns +### 7. Common Initialization Patterns #### Team Project Setup ```bash diff --git a/plugins/lt-dev/skills/using-lt-cli/reference.md b/plugins/lt-dev/skills/using-lt-cli/reference.md index 0721793..b60fefd 100644 --- a/plugins/lt-dev/skills/using-lt-cli/reference.md +++ b/plugins/lt-dev/skills/using-lt-cli/reference.md @@ -58,6 +58,42 @@ lt fullstack init --name MyApp --frontend angular --git true --noConfirm \ --frontend-copy ``` +## lt server create / lt fullstack init — `--next` (experimental) + +`--next` swaps the API template from +[`nest-server-starter`](https://github.com/lenneTech/nest-server-starter) +(MongoDB) to [`nest-base`](https://github.com/lenneTech/nest-base) +(Bun + Prisma 7 + Postgres + Better-Auth). + +```bash +# Standalone API +lt server create my-next-api --description "x" --author "y" --next --noConfirm + +# Fullstack +lt fullstack init --name MyNextApp --frontend nuxt --next --noConfirm +``` + +**Effects when `--next` is set:** +- Clones `https://github.com/lenneTech/nest-base.git` instead of `nest-server-starter`. +- Forces `apiMode = Rest` and `frameworkMode = npm`. +- Skips nest-server-starter-specific patching (`config.env.ts`, + `main.ts` Swagger, `meta.json`, README EJS template, `lt.config.json`, + CLAUDE.md API mode). +- Skips vendor-mode transformation. +- Skips workspace install in fullstack mode (Bun ≠ pnpm). + +**Limitations:** +- `lt server module / object / addProp / test / permissions` are NOT + compatible with the `nest-base` layout. +- Use for greenfield prototyping; production work should still use the + default template. + +**Post-creation install (fullstack):** +```bash +cd /projects/app && pnpm install +cd /projects/api && bun install +``` + ## Troubleshooting ### Git