Skip to main content

Nx generators

postman-app has custom Nx generators for scaffolding new packages. Always use these instead of creating packages manually — manual creation causes tsconfig drift and incorrect Nx tags.

Available generators

Create a new library

npx nx generate @postman/app-generator:library \
--type=<type> \
--name=<package-name> \
--scope=<squad>

Types: ui-feature | view | data | platform-lib | lib | reusable-ui-lib

Example:

npx nx generate @postman/app-generator:library \
--type=ui-feature \
--name=workspace-activity-feed \
--scope=collaboration

Mark a package as monolith-coupled

Run after extracting code from src/renderer/ but before full decoupling:

npx nx generate @postman/app-generator:mark-lib-coupled --name=my-package

Mark a package as monolith-decoupled

Run after removing all @postman-app-monolith/* imports:

npx nx generate @postman/app-generator:mark-lib-decoupled --name=my-package

Scaffold a v12 sidebar ui-feature

Special generator for sidebar-style ui-features that follow the v12 sidebar pattern:

npx nx generate @postman/app-generator:scaffold-v12-sidebar --name=my-sidebar

What generators create

Running the library generator with --type=ui-feature creates:

ui-features/my-feature/
├── src/
│ ├── components/
│ │ └── MyFeature.tsx
│ └── index.ts
├── package.json ← name: @postman-app/my-feature
├── project.json ← Nx config, tags: ["type:ui-feature", "scope:<squad>"]
├── tsconfig.json ← extends tsconfig.base.json
└── tsconfig.spec.json ← test config

It also automatically updates:

  • tsconfig.json at repo root (adds path mapping)
  • .github/CODEOWNERS (adds squad ownership)