@lenne.tech/cli 1.15.0 → 1.16.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.
|
@@ -472,6 +472,39 @@ const NewCommand = {
|
|
|
472
472
|
serverSpinner.fail(`Failed to set up API: ${apiResult.path}`);
|
|
473
473
|
return;
|
|
474
474
|
}
|
|
475
|
+
// Auto-run `bun run rename <projectDir>` for the experimental nest-base
|
|
476
|
+
// template. The template ships with hard-coded `nest-base` references in
|
|
477
|
+
// four files (package.json, README.md, portless.yml, docker-compose.yml).
|
|
478
|
+
// The rename script patches all four idempotently. Since the consumer
|
|
479
|
+
// already gave us --name, doing this for them is strictly less
|
|
480
|
+
// friction-prone than relying on a manual follow-up step (which agents
|
|
481
|
+
// and humans both forget). Failure is non-fatal: the workspace is still
|
|
482
|
+
// usable, the user can re-run `bun run rename <name>` manually.
|
|
483
|
+
//
|
|
484
|
+
// Note: setupServerForFullstack already patched projects/api/package.json
|
|
485
|
+
// to set `name = projectDir`. The rename planner reads that name as the
|
|
486
|
+
// "old" slug, which would short-circuit the README/portless/compose
|
|
487
|
+
// rewrites because they still say `nest-base`. We restore the canonical
|
|
488
|
+
// `name = "nest-base"` first so the planner has a coherent starting
|
|
489
|
+
// state across all four files; the rename then writes the project name
|
|
490
|
+
// into every spot consistently.
|
|
491
|
+
if (experimental && apiResult.method !== 'link') {
|
|
492
|
+
const apiPackageJsonPath = `${apiDest}/package.json`;
|
|
493
|
+
if (filesystem.exists(apiPackageJsonPath)) {
|
|
494
|
+
yield patching.update(apiPackageJsonPath, (config) => {
|
|
495
|
+
config.name = 'nest-base';
|
|
496
|
+
return config;
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
const renameSpinner = spin(`Rename nest-base → ${projectDir}`);
|
|
500
|
+
try {
|
|
501
|
+
yield system.run(`cd ${apiDest} && bun run rename ${projectDir}`);
|
|
502
|
+
renameSpinner.succeed(`Renamed nest-base → ${projectDir} in projects/api`);
|
|
503
|
+
}
|
|
504
|
+
catch (err) {
|
|
505
|
+
renameSpinner.warn(`Auto-rename failed (${err.message}). Run \`bun run rename ${projectDir}\` manually inside projects/api.`);
|
|
506
|
+
}
|
|
507
|
+
}
|
|
475
508
|
// Create lt.config.json for API
|
|
476
509
|
// Note: frameworkMode is persisted under meta so that subsequent `lt
|
|
477
510
|
// server module` / `addProp` / `permissions` calls can detect the mode
|