8000 fix(angular): keep extra target metadata when needed in `convert-to-rspack` generator by leosvelperez · Pull Request #31309 · nrwl/nx · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(angular): keep extra target metadata when needed in convert-to-rspack generator #31309

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

Merged
merged 1 commit into from
Jun 2, 2025

Conversation

leosvelperez
Copy link
Member

Current Behavior

When converting an Angular project to use Rspack with the @nx/angular:convert-to-rspack generator, some target top-level options can be lost (e.g. custom dependsOn, outputs, etc.).

Expected Behavior

When converting an Angular project to use Rspack with the @nx/angular:convert-to-rspack generator, relevant target top-level options that wouldn't be inferred need to be kept in the converted project.

Related Issue(s)

Fixes #

@leosvelperez leosvelperez self-assigned this May 22, 2025
@leosvelperez leosvelperez requested a review from a team as a code owner May 22, 2025 15:05
@leosvelperez leosvelperez requested a review from Coly010 May 22, 2025 15:05
Copy link
vercel bot commented May 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview May 30, 2025 11:04am

Copy link
nx-cloud bot commented May 22, 2025

View your CI Pipeline Execution ↗ for commit 4e51933.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 25m 24s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 17s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 6s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 5s View ↗
nx documentation ✅ Succeeded 2m 37s View ↗

☁️ Nx Cloud last updated this comment at 2025-05-30 11:34:54 UTC

@leosvelperez leosvelperez requested a review from Copilot May 22, 2025 15:17
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes conversion issues when migrating Angular projects to Rspack by preserving extra target metadata such as custom dependsOn, outputs, and other options that would otherwise be lost. Key changes include reordering and adding new imports, consolidating target removal into a single targetsToRemove array, and enhancing the logic to selectively override or preserve build and serve target configurations.

Comments suppressed due to low confidence (1)

packages/angular/src/generators/convert-to-rspack/convert-to-rspack.ts:541

  • [nitpick] The logic for overriding target inputs appears duplicated with similar patterns later in the file; extracting this into a helper function might improve readability and reduce potential maintenance issues.
buildTarget.config.inputs = [ ...buildTarget.config.inputs, { externalDependencies: ['@rspack/cli'] } ];

@leosvelperez leosvelperez force-pushed the angular/fix-convert-to-rspack-target-metadata branch 2 times, most recently from ea86e19 to 543c117 Compare May 27, 2025 07:38
@leosvelperez leosvelperez force-pushed the angular/fix-convert-to-rspack-target-metadata branch from 543c117 to 4e51933 Compare May 30, 2025 11:01
@leosvelperez leosvelperez merged commit 2cf519a into master Jun 2, 2025
7 checks passed
@leosvelperez leosvelperez deleted the angular/fix-convert-to-rspack-target-metadata branch June 2, 2025 10:58
FrozenPandaz pushed a commit that referenced this pull request Jun 3, 2025
…spack` generator (#31309)

## Current Behavior

When converting an Angular project to use Rspack with the
`@nx/angular:convert-to-rspack` generator, some target top-level options
can be lost (e.g. custom `dependsOn`, `outputs`, etc.).

## Expected Behavior

When converting an Angular project to use Rspack with the
`@nx/angular:convert-to-rspack` generator, relevant target top-level
options that wouldn't be inferred need to be kept in the converted
project.

(cherry picked from commit 2cf519a)
Copy link
github-actions bot commented Jun 8, 2025

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0