-
-
Notifications
You must be signed in to change notification settings - Fork 342
Create Rslib executor for Nx #3876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: rslib-executor
Are you sure you want to change the base?
Create Rslib executor for Nx #3876
Conversation
|
- Configure rslib to generate TypeScript declaration files (.d.ts) - Add missing entry points (helpers, core, global) to rslib config - Update runtime-core package.json exports to use generated declarations - Fix import patterns in runtime package to use namespace imports - Exclude dist directories from TypeScript compilation to prevent conflicts - Add global variable definitions for build-time replacement - Update multiple package tsconfigs to prevent dual type resolution This enables proper TypeScript declaration generation via rslib while maintaining compatibility with existing build processes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
The tools/scripts/publish.mjs file was not referenced anywhere in the codebase and appears to be legacy/template code that was never integrated into the actual publishing workflow. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Replace @nx/rollup executor with rslib for runtime-core package - Add @rslib/core as devDependency and create rslib.config.ts - Update package.json exports to match rslib output format (.js/.cjs) - Add TypeScript declaration generation with proper env.d.ts - Update tsconfig.lib.json for correct output paths - Remove duplicate global.d.ts file - Add build script to package.json for direct rslib execution This migration enables better TypeScript declaration generation and aligns with modern build tooling standards. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Move global declarations from src/global.ts to separate global-types.d.ts - This prevents conflicts between source and generated .d.ts files - Resolves TypeScript errors where packages saw both src and dist types - Enhanced package now builds successfully without type conflicts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Configure project.json to use ../../tools/rslib-plugin:build executor - Fix rslib.config.ts import to use JSON import instead of fs.readFileSync - Add @rslib/core devDependency to package.json - Ensure proper rslib configuration for TypeScript declaration generation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Description
This PR introduces a comprehensive Nx plugin for Rslib, providing dedicated executors for building and developing Rslib-based libraries within an Nx workspace.
Key Changes:
tools/rslib-plugin
):rslib:build
executor: Integratesrslib build
for production and development builds, including watch mode.rslib:dev
executor: Integratesrslib mf-dev
for Module Federation development andrslib build --watch
for general watch mode.rslib:echo
executor: A simple executor for testing plugin functionality.package.json
exports andpnpm-workspace.yaml
inclusion for local resolution.runtime-core
Migration: Thepackages/runtime-core
project has been migrated from@nx/rollup
to use the newrslib:build
executor. This migration demonstrated significant performance improvements (build time reduced from ~2.6s to ~50ms).tools/rslib-old
directory and all associated references, along with temporary markdown files and test files created during development.../../tools/rslib-plugin:build
) inproject.json
files.rslib v0.10.4
(e.g., removed unsupported--mode
option).Why these changes?
To integrate Rslib as a first-class build tool within the Nx monorepo, leveraging its performance benefits, especially for Module Federation projects. This provides a streamlined and faster alternative to existing build processes.
Related Issue
N/A
Types of changes
Checklist