@dudousxd/nestjs-codegen 0.6.0 → 0.6.1
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.
- package/CHANGELOG.md +11 -0
- package/dist/cli/main.cjs +6 -3
- package/dist/cli/main.cjs.map +1 -1
- package/dist/cli/main.js +6 -3
- package/dist/cli/main.js.map +1 -1
- package/dist/index.cjs +6 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/nest/index.cjs +5 -2
- package/dist/nest/index.cjs.map +1 -1
- package/dist/nest/index.js +5 -2
- package/dist/nest/index.js.map +1 -1
- package/package.json +1 -1
package/dist/nest/index.js
CHANGED
|
@@ -4278,6 +4278,7 @@ async function watch(config, onChange) {
|
|
|
4278
4278
|
return NO_OP_WATCHER;
|
|
4279
4279
|
}
|
|
4280
4280
|
let discovery = null;
|
|
4281
|
+
let lastRoutes = [];
|
|
4281
4282
|
async function getDiscovery() {
|
|
4282
4283
|
if (discovery === null) {
|
|
4283
4284
|
discovery = await PersistentDiscovery.create({
|
|
@@ -4291,13 +4292,14 @@ async function watch(config, onChange) {
|
|
|
4291
4292
|
}
|
|
4292
4293
|
try {
|
|
4293
4294
|
const initialRoutes = (await getDiscovery()).discover();
|
|
4295
|
+
lastRoutes = initialRoutes;
|
|
4294
4296
|
await generate(config, initialRoutes);
|
|
4295
4297
|
} catch (err) {
|
|
4296
4298
|
console.warn(
|
|
4297
4299
|
`[nestjs-codegen] Initial route discovery failed, falling back to pages-only: ${err instanceof Error ? err.message : String(err)}`
|
|
4298
4300
|
);
|
|
4299
4301
|
try {
|
|
4300
|
-
await generate(config);
|
|
4302
|
+
await generate(config, lastRoutes);
|
|
4301
4303
|
} catch {
|
|
4302
4304
|
}
|
|
4303
4305
|
}
|
|
@@ -4315,7 +4317,7 @@ async function watch(config, onChange) {
|
|
|
4315
4317
|
pagesDebounceTimer = setTimeout(async () => {
|
|
4316
4318
|
pagesDebounceTimer = void 0;
|
|
4317
4319
|
try {
|
|
4318
|
-
await generate(config);
|
|
4320
|
+
await generate(config, lastRoutes);
|
|
4319
4321
|
} catch (err) {
|
|
4320
4322
|
console.error(
|
|
4321
4323
|
"[nestjs-codegen] Pages generation failed:",
|
|
@@ -4346,6 +4348,7 @@ async function watch(config, onChange) {
|
|
|
4346
4348
|
pendingChangedPaths.clear();
|
|
4347
4349
|
try {
|
|
4348
4350
|
const routes = await (await getDiscovery()).rediscover(changed);
|
|
4351
|
+
lastRoutes = routes;
|
|
4349
4352
|
await generate(config, routes);
|
|
4350
4353
|
} catch (err) {
|
|
4351
4354
|
console.error(
|