Get the generator infrastructure running locally.
| Tool | Version | Purpose |
|---|---|---|
| Node.js | 18+ | Runtime |
| pnpm | 8+ | Package manager |
| just | 1.0+ | Task runner |
| Python | 3.11+ | Type sync |
1
2
3
4
5
6
7
# Install dependencies
just setup
# This runs:
# - pnpm install
# - Nx workspace initialization
# - VibesProâ„¢ configuration
1
2
3
4
5
6
7
8
9
# List all installed generators
pnpm exec nx list
# List generators from specific plugin
pnpm exec nx list @nx/js
pnpm exec nx list @nx/react
# Get help for specific generator
pnpm exec nx g @nx/js:library --help
1
2
3
4
5
6
7
8
9
10
11
12
13
# Generate a TypeScript library
pnpm exec nx g @nx/js:library my-utils \
--directory=libs/shared \
--bundler=tsc \
--unitTestRunner=jest
# Output:
# CREATE libs/shared/my-utils/src/index.ts
# CREATE libs/shared/my-utils/src/lib/my-utils.ts
# CREATE libs/shared/my-utils/package.json
# CREATE libs/shared/my-utils/tsconfig.json
# CREATE libs/shared/my-utils/tsconfig.lib.json
# CREATE libs/shared/my-utils/jest.config.ts
1
2
3
4
5
# Test the generated library
pnpm exec nx test my-utils
# Build the library
pnpm exec nx build my-utils
1
2
3
4
5
6
7
8
# Recommended: Use just for common operations
just ai-scaffold name=@nx/js:library
# List all generators
just generator-list
# Create new custom generator
just generator-new my-generator --type=custom
1
2
3
4
5
6
# Always preview with --dry-run
pnpm exec nx g @nx/react:component Button \
--project=ui \
--dry-run
# Shows what would be created without writing files
| Issue | Solution |
|---|---|
Cannot find generator |
Install plugin: pnpm add -D @nx/<plugin> |
Project already exists |
Choose different name or remove existing |
Missing parameter |
Check --help for required options |