@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.cjs
CHANGED
|
@@ -4299,6 +4299,7 @@ async function watch(config, onChange) {
|
|
|
4299
4299
|
return NO_OP_WATCHER;
|
|
4300
4300
|
}
|
|
4301
4301
|
let discovery = null;
|
|
4302
|
+
let lastRoutes = [];
|
|
4302
4303
|
async function getDiscovery() {
|
|
4303
4304
|
if (discovery === null) {
|
|
4304
4305
|
discovery = await PersistentDiscovery.create({
|
|
@@ -4312,13 +4313,14 @@ async function watch(config, onChange) {
|
|
|
4312
4313
|
}
|
|
4313
4314
|
try {
|
|
4314
4315
|
const initialRoutes = (await getDiscovery()).discover();
|
|
4316
|
+
lastRoutes = initialRoutes;
|
|
4315
4317
|
await generate(config, initialRoutes);
|
|
4316
4318
|
} catch (err) {
|
|
4317
4319
|
console.warn(
|
|
4318
4320
|
`[nestjs-codegen] Initial route discovery failed, falling back to pages-only: ${err instanceof Error ? err.message : String(err)}`
|
|
4319
4321
|
);
|
|
4320
4322
|
try {
|
|
4321
|
-
await generate(config);
|
|
4323
|
+
await generate(config, lastRoutes);
|
|
4322
4324
|
} catch {
|
|
4323
4325
|
}
|
|
4324
4326
|
}
|
|
@@ -4336,7 +4338,7 @@ async function watch(config, onChange) {
|
|
|
4336
4338
|
pagesDebounceTimer = setTimeout(async () => {
|
|
4337
4339
|
pagesDebounceTimer = void 0;
|
|
4338
4340
|
try {
|
|
4339
|
-
await generate(config);
|
|
4341
|
+
await generate(config, lastRoutes);
|
|
4340
4342
|
} catch (err) {
|
|
4341
4343
|
console.error(
|
|
4342
4344
|
"[nestjs-codegen] Pages generation failed:",
|
|
@@ -4367,6 +4369,7 @@ async function watch(config, onChange) {
|
|
|
4367
4369
|
pendingChangedPaths.clear();
|
|
4368
4370
|
try {
|
|
4369
4371
|
const routes = await (await getDiscovery()).rediscover(changed);
|
|
4372
|
+
lastRoutes = routes;
|
|
4370
4373
|
await generate(config, routes);
|
|
4371
4374
|
} catch (err) {
|
|
4372
4375
|
console.error(
|