You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support TypeScript-solution workspaces in the application generator #219
The application generator only supports classic Nx workspaces, where projects use project.json and libraries resolve through tsconfig.base.json path aliases. In a TypeScript-solution workspace (project references, workspace packages, nodenext resolution), generated Forge apps don't build.
New Nx workspaces are increasingly TypeScript-solution workspaces. For example, when create-nx-workspace 24 runs inside an AI agent, it ignores --preset=apps and creates one from the nrwl/empty-template template. This also means the e2e suite tests a different workspace layout depending on whether an agent runs it.
Proposed solution
Support both layouts, following the upstream @nx/node application generator (packages/node/src/generators/application):
Detection: use isUsingTsSolutionSetup(tree) from @nx/js/internal in normalizeOptions.
Project definition: in TypeScript-solution workspaces, write the app's package.json (with an nx section) instead of project.json, add a useProjectJson option like upstream, and register the app in the workspace with addProjectToTsSolutionWorkspace.
TypeScript config: set module and moduleResolution to nodenext in tsconfig.app.json and add project references with updateTsconfigFiles.
Output path: use upstream's <projectRoot>/dist convention in getForgeOutputPath, so the build output and the Forge targets still agree.
Graph plugin:createNodes only creates a Forge project if there's a project.json next to manifest.yml. It also needs to accept a project defined by package.json.
Package executor: check that package.json generation for the Forge bundle works when the app has its own package.json and depends on workspace libraries through workspace:*.
E2E: run application.generator.spec.ts against both layouts, with the workspace layout chosen explicitly rather than depending on the environment.
Activity