-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
🌨 Feature Request: Export TypeScript Schema Definitions in package.json for Better DX
🧩 Description
Nx 21.0.0 introduced stricter package exports that block direct imports of TypeScript schema definitions.
These schema types are essential for creating custom executors, generators, and workspace tooling.
Exporting them officially in package.json would greatly improve the developer experience (DX) and maintain type safety.
Problem
With Nx 21.0.0, the stricter package exports prevent importing TypeScript schema definitions that are needed for creating custom executors and generators. This forces developers to either:
-
Copy entire schema files into their workspace (high maintenance burden)
-
Define local interfaces (current workaround)
-
Use
anytypes (loses type safety)
Current Behavior
// This fails in Nx 21.0.0+
import { Schema } from '@nx/angular/src/builders/webpack-browser/schema';
import { Schema } from '@nx/react/src/generators/application/schema';
Files Affected:
-
@nx/angular/src/builders/*/schema.d.ts
-
@nx/react/src/generators/*/schema.d.ts
-
@nx/workspace/src/generators/*/schema.d.ts
-
And other packages with schema definitions
Environment:
Nx version: 21.0.0
Affected packages: @nx/angular, @nx/react, @nx/workspace, etc.