Repository navigation
fix(generate): declare @apso/crud deps in v1-template projects - #142
Merged
Merged
Conversation
Generated TypeScript code imports @apso/crud, crud-core, crud-request and crud-typeorm. Projects created from the v1 template (@nestjsx/crud), which is still the prod starter zip, don't declare them, so nest build failed with 117 errors on a 9-entity schema (TS2307 on @apso/crud*, then TS2339 repo/getOne/ createOne). generate now adds any missing ones to package.json and says to run npm install. @nestjsx deps are left in place. Also adds the failing prod schema as a fixture: a drift test asserts every @apso import in generated code is a declared dep, and scaffold-smoke gets an APSORC_FIXTURE option plus a typescript+fixture leg.
cultron
force-pushed
the
fix/svc52-compile
branch
from
October 4, 2026 17:59
0fe921c to
ab4b602
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Prod service 52 (Inventory Management, 9 entities) passes schema lint but the in-browser Build fails. The schema is fine. The cause is a template mismatch:
apso-workspaces-prod/starter/template/code.zip, dated 2025-12-01) is still the v1 template with@nestjsx/crud4.5.0. Staging's starter was moved to v2 on 2026-08-12; prod was not.@apso/crud*.Result on the prod starter: 117 errors, 13 per entity, regardless of schema shape:
TS2307: Cannot find module '@apso/crud'(36),'@apso/crud-request'(9),'@apso/crud-typeorm'(9)TS2339: Property 'repo' does not exist on type 'XService'(45),'getOne'(9),'createOne'(9)The same schema compiles cleanly (0 errors) on template v2.0.0 with both 0.38.4 and 0.39.2.
Fix
apso generate(TypeScript) now adds any missing@apso/crud,crud-core,crud-request,crud-typeorm(^1.0.1, matching template v2.0.0) to package.json and prints a line saying to runnpm install. Existing@nestjsxdeps stay because hand-written code may import them.Verified: prod starter + this branch + svc52 schema, then
npm install && npm run buildexits 0.Tests
test/lib/utils/crud-deps.test.ts: v1 project gets the deps, v2 project untouched, no package.json is a no-op, and a drift guard that generates the svc52 fixture and asserts every@apso/*import is inAPSO_CRUD_DEPS.scaffold-smoke: newAPSORC_FIXTUREoption and atypescript + fixtureleg usingtest/fixtures/inventory-multi-fk.apsorc. Passes locally.Note: scaffold-smoke clones template v2.0.0, so it could not have caught this; the gap was the prod starter zip, not codegen.
Companion: client PR runs
npm installafter scaffold when package.json gained deps.