Skip to content

feat: adds support for detecting NX monorepos #263

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 5 commits into from
Mar 11, 2025

Conversation

Cephyric-gh
Copy link
Contributor

Adds support for detecting NX monorepo structures, allows angular SSR detection to overwrite the generated server.ts and deploy appropriate edge functions for them.

It's not fully clean as it currently requires the ANGULAR_PROJECT environment variable to pick up the correct project.json. This could have much better DX if packagePath was exposed to the runtime, which as far as I could tell it is not passed through. When creating projects in a user's account it already automatically detects NX and asks for the project to prefill this value, so should be available.

Resolves #156

@Cephyric-gh Cephyric-gh requested a review from a team as a code owner February 26, 2025 22:47
@Cephyric-gh Cephyric-gh mentioned this pull request Feb 26, 2025
@pieh
Copy link
Contributor

pieh commented Mar 10, 2025

This could have much better DX if packagePath was exposed to the runtime, which as far as I could tell it is not passed through.

packagePath should be set under constants.PACKAGE_PATH (constants being passed to build step hooks in src/index.js) when monorepo scenarios are detected (or it will be undefined otherwise). We use that for example in https://github.com/opennextjs/opennextjs-netlify/blob/23b1f37ad2e7cc0afc7901937796ac87597ab6e1/src/build/plugin-context.ts#L217

Copy link

netlify bot commented Mar 11, 2025

Deploy Preview for plugin-angular-universal-demo ready!

Name Link
🔨 Latest commit b0f577d
🔍 Latest deploy log https://app.netlify.com/sites/plugin-angular-universal-demo/deploys/67d03a770a9ea200080c8e8a
😎 Deploy Preview https://deploy-preview-263--plugin-angular-universal-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

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

This is great, thanks!

Before merging - please let me know if you want to make additional changes (I don't see anything missing at this point) or if it's good to be merged from your perspective

@Cephyric-gh
Copy link
Contributor Author

Nope, everything looks good from my end too!

@pieh pieh merged commit 52b8c59 into netlify:main Mar 11, 2025
11 checks passed
@Cephyric-gh Cephyric-gh deleted the nx-support branch March 11, 2025 14:59
@pieh
Copy link
Contributor

pieh commented Mar 11, 2025

This was released in 2.3.0 - https://github.com/netlify/angular-runtime/releases/tag/v2.3.0 and I also updated runtime auto-installation rules to use it automatically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nx compatibility
2 participants