@breadstone-infrastructure/nx-tasks
v0.0.201
Published
Common nx tasks
Downloads
4,570
Readme
@breadstone-infrastructure/nx-tasks
A collection of advanced, reusable task executors for Nx workspaces, designed to streamline and automate common build, transform, and CI/CD operations across Breadstone projects.
Motivation
The legacy tasks package from Microsoft is no longer maintained and does not support modern Nx or ESM modules. This package provides a robust, extensible alternative, leveraging Nx's executor system for better integration, caching, and developer experience.
Features
- Reusable Nx Executors: For build, clean, copy, docs, style, proxy transforms, localization, and more.
- Framework Integration: Supports Angular, React, Vue, Svelte, Lit, and custom elements.
- Resource & Localization Tools: Integrates with localizator for i18n extraction, analysis, and AI-powered translation.
- Style Processing: SCSS/SASS/Lit style transforms, autoprefixing, and bundling.
- API & Docs Generation: OpenAPI codegen, API Extractor, and markdown documentation tools.
- Icon Management: Download and bundle icon collections from remote sources.
- CI/CD Friendly: All tasks are designed for automation and can be used in pipelines.
- TypeScript-first: All code is written in modern TypeScript.
Installation
yarn add -D @breadstone-infrastructure/nx-tasks
# or
npm install --save-dev @breadstone-infrastructure/nx-tasksUsage
Add executors to your project.json or use them directly via Nx CLI:
{
"targets": {
"build": {
"executor": "nx:run-commands",
"options": {
"commands": [
"tsc",
"nx _build:copy-package"
]
}
},
"release": {
"executor": "@breadstone-infrastructure/nx-tasks:release-package"
},
"localize": {
"executor": "@breadstone-infrastructure/nx-tasks:localizator",
"options": {
"actions": {
"analyze": {},
"sort": {},
"transform": {},
"generate": {},
"detect": {}
},
}
}
}
}Or run directly:
nx run my-lib:release
nx run my-lib:localize --mode=analyzeAvailable Executors
| Executor Name | Description |
|------------------------------|---------------------------------------------|
| alias-replace | Replace aliases and env vars in JS output |
| clean | Clean folders/files |
| copy | Copy files or directories |
| docs | Generate markdown docs from templates |
| doppler-config-sync | Sync secrets from Doppler to .env |
| icon-collection-builder | Build icon collections from SVGs |
| icon-collection-downloader | Download icon sets from remote repos |
| lit-style-transform | Transform SCSS to Lit-compatible TS |
| lit-docs | Analyze Lit component docs and JSDoc |
| localizator | Extract, analyze, sort, and generate i18n |
| markdown-to-typescript-transform | Convert markdown to TypeScript modules |
| ng-packagr-build | Build Angular packages with ng-packagr |
| ng-proxy-transform | Generate Angular proxies for web components |
| openapi-generator | Generate API clients from OpenAPI specs |
| react-proxy-transform | Generate React proxies for web components |
| release-package | Publish package to npm |
| release-package-json | Prepare/copy package.json for publishing |
| scss-style-bundle | Bundle SCSS files |
| scss-style-transform | Transform SCSS to CSS |
| svelte-proxy-transform | Generate Svelte proxies for web components |
| unrelease-package | Unpublish package from npm |
| vercel-edge-config-sync | Sync Vercel Edge Config to local app.json |
| vue-proxy-transform | Generate Vue proxies for web components |
See executors.json for the full list and schema for each executor.
Example: Localization Workflow
{
"targets": {
"localize": {
"executor": "@breadstone-infrastructure/nx-tasks:localizator",
"options": {
"mode": "detect",
"output": "./locales",
"detect": {
"preset": "angular",
"root": "./src",
"type": "json"
}
}
}
}
}Run with:
nx run my-lib:localize --mode=analyze
nx run my-lib:localize --mode=generate --generate.apiKey=$OPENAI_API_KEYDevelopment
- Written in TypeScript, using modern ES modules.
- Uses @breadstone-infrastructure/utilities for file, path, and logging utilities.
- Each executor is in
src/executors/<name>/. - Add new executors by creating a new folder and updating
executors.json. - Build with
yarn buildornx run nx-tasks:build.
License
MIT © Breadstone
