@lenne.tech/cli 1.16.0 → 1.18.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.
@@ -27,7 +27,7 @@ const NewCommand = {
27
27
  // Info
28
28
  info('Create a new fullstack workspace');
29
29
  // Hint for non-interactive callers (e.g. Claude Code)
30
- toolbox.tools.nonInteractiveHint('lt fullstack init --name <name> --frontend <nuxt|angular> --api-mode <Rest|GraphQL|Both> --framework-mode <npm|vendor> [--framework-upstream-branch <ref>] [--next] [--dry-run] --noConfirm');
30
+ toolbox.tools.nonInteractiveHint('lt fullstack init --name <name> --frontend <nuxt|angular> --api-mode <Rest|GraphQL|Both> --framework-mode <npm|vendor> [--framework-upstream-branch <ref>] [--next: implies nuxt-base-starter#next unless --frontend-branch overrides] [--dry-run] --noConfirm');
31
31
  // Check git
32
32
  if (!(yield git.gitInstalled())) {
33
33
  return;
@@ -264,7 +264,12 @@ const NewCommand = {
264
264
  }
265
265
  // Determine branches and copy/link paths with priority: CLI > config
266
266
  const apiBranch = cliApiBranch || configApiBranch;
267
- const frontendBranch = cliFrontendBranch || configFrontendBranch;
267
+ // Under `--next`, default the nuxt-base-starter ref to the `next`
268
+ // branch — that branch ships an auth basePath (`/api/auth`) that
269
+ // matches the experimental nest-base API. Explicit
270
+ // `--frontend-branch` (or lt.config) still wins so consumers can
271
+ // target a custom branch on either line.
272
+ const frontendBranch = cliFrontendBranch || configFrontendBranch || (experimental ? 'next' : undefined);
268
273
  const apiCopy = cliApiCopy || configApiCopy;
269
274
  const apiLink = cliApiLink || configApiLink;
270
275
  const frontendCopy = cliFrontendCopy || configFrontendCopy;
@@ -63,6 +63,70 @@ class FrontendHelper {
63
63
  content = content.replace(/^(NUXT_PUBLIC_STORAGE_PREFIX=).*$/m, `$1${projectName}-local`);
64
64
  filesystem.write(envPath, content);
65
65
  }
66
+ /**
67
+ * Flatten the cloned nuxt-base-starter wrapper layout so the project's
68
+ * `projects/app/` directory IS the Nuxt app.
69
+ *
70
+ * `lenneTech/nuxt-base-starter` ships a wrapper repo: the root
71
+ * `package.json` is the `create-nuxt-base` scaffolder (a separate npm
72
+ * package — `bin/create-nuxt-base` lives at `index.js`), and the
73
+ * actual Nuxt app lives one level deeper at `nuxt-base-template/`.
74
+ * Without this flatten, the generated monorepo's `pnpm-workspace.yaml`
75
+ * and the README's `cd projects/app && pnpm install && pnpm dev`
76
+ * point at the wrapper, not the app, so `pnpm install` resolves the
77
+ * wrong dependencies and `pnpm dev` has nothing to run
78
+ * (LLM-test 2026-05-03 friction #3 entry 20:30).
79
+ *
80
+ * Defense-in-depth: only mutate the layout if extraction succeeds.
81
+ * If `nuxt-base-template/` is missing or isn't a directory (corrupt
82
+ * clone, future repo reshape that drops the wrapper), we return
83
+ * `{ flattened: false, reason }` and leave the original tree alone.
84
+ * The pre-flatten layout is annoying but functional — better than
85
+ * wiping a user's clone over an unexpected layout.
86
+ *
87
+ * @param dest - The cloned `projects/app/` directory.
88
+ * @returns Whether the flatten ran, plus a reason if it didn't.
89
+ */
90
+ flattenNuxtBaseTemplate(dest) {
91
+ return __awaiter(this, void 0, void 0, function* () {
92
+ const { filesystem } = this.toolbox;
93
+ const subdir = filesystem.path(dest, 'nuxt-base-template');
94
+ if (!filesystem.exists(subdir)) {
95
+ return { flattened: false, reason: 'no nuxt-base-template subdirectory' };
96
+ }
97
+ if (!filesystem.isDirectory(subdir)) {
98
+ // Stray file at the path we'd flatten — abort to avoid clobbering
99
+ // the user's tree on a corrupt clone.
100
+ return { flattened: false, reason: 'nuxt-base-template path exists but is not a directory' };
101
+ }
102
+ // Stage the template into a sibling directory before touching `dest`,
103
+ // so a copy failure leaves the original layout intact.
104
+ const parent = filesystem.path(dest, '..');
105
+ const stage = filesystem.path(parent, `.nuxt-base-template-staging-${Date.now()}-${process.pid}`);
106
+ try {
107
+ filesystem.copy(subdir, stage, { overwrite: true });
108
+ }
109
+ catch (err) {
110
+ // Couldn't stage — leave `dest` untouched and bubble the reason up.
111
+ filesystem.remove(stage);
112
+ return { flattened: false, reason: `failed to stage template: ${err.message}` };
113
+ }
114
+ try {
115
+ // Wipe the cloned root (wrapper package.json, index.js, lock file,
116
+ // README, etc.) and replace it with the staged template contents.
117
+ // gluegun's `filesystem.remove(dest)` removes the directory, so
118
+ // we re-create it before copying back so dotfiles land at the
119
+ // right level.
120
+ filesystem.remove(dest);
121
+ filesystem.dir(dest);
122
+ filesystem.copy(stage, dest, { overwrite: true });
123
+ }
124
+ finally {
125
+ filesystem.remove(stage);
126
+ }
127
+ return { flattened: true };
128
+ });
129
+ }
66
130
  /**
67
131
  * Setup Nuxt frontend
68
132
  * Handles template setup (link/copy/clone) and optional npm install
@@ -87,6 +151,14 @@ class FrontendHelper {
87
151
  if (!result.success) {
88
152
  return { method: result.method, path: result.path, success: false };
89
153
  }
154
+ // After a clone, flatten the wrapper layout so `projects/app/`
155
+ // IS the Nuxt app (the cloned root is the `create-nuxt-base`
156
+ // scaffolder, not the app — see flattenNuxtBaseTemplate).
157
+ // Skip on link mode: a symlink points at the user's local
158
+ // checkout and must not have its template subdir torn out.
159
+ if (result.method === 'clone') {
160
+ yield this.flattenNuxtBaseTemplate(dest);
161
+ }
90
162
  // Run install if not skipped and not a symlink
91
163
  if (!skipInstall && result.method !== 'link') {
92
164
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lenne.tech/cli",
3
- "version": "1.16.0",
3
+ "version": "1.18.0",
4
4
  "description": "lenne.Tech CLI: lt",
5
5
  "keywords": [
6
6
  "lenne.Tech",