Skip to content
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

feat(cli): add flags to handle native deps #2567

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

gashcrumb
Copy link
Member

@gashcrumb gashcrumb commented Nov 26, 2024

This change introduces two new flags to the CLI to handle transitive dependencies on packages containing native modules. --allow-native-package [package-name...] to selectively allow native packages when exporting a dynamic plugin and allowing it's installation into the exported dynamic plugin and --suppress-native-package [package-name..] which replaces the native package with an empty package during export, preventing the native package's inclusion into the exported dynamic plugin's private dependencies.

Copy link

changeset-bot bot commented Nov 26, 2024

🦋 Changeset detected

Latest commit: d283433

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@janus-idp/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gashcrumb gashcrumb marked this pull request as draft November 26, 2024 13:24
@gashcrumb gashcrumb force-pushed the RHIDP-5062 branch 2 times, most recently from 854b560 to 439c962 Compare November 26, 2024 18:11
@gashcrumb gashcrumb changed the title feat(cli): add a flag to allow native packages feat(cli): add flags to handle native deps Nov 26, 2024
@gashcrumb gashcrumb marked this pull request as ready for review November 26, 2024 18:12
@gashcrumb gashcrumb requested a review from a team as a code owner November 26, 2024 18:12
@gashcrumb gashcrumb marked this pull request as draft November 26, 2024 18:34
@gashcrumb gashcrumb marked this pull request as ready for review November 26, 2024 19:24
@gashcrumb gashcrumb force-pushed the RHIDP-5062 branch 2 times, most recently from 8be7a10 to 1eccb58 Compare November 26, 2024 20:05
This change introduces two new flags to the CLI to handle transitive
dependencies on packages containing native modules.
`--allow-native-package [package-name...]` to selectively allow native
packages when exporting a dynamic plugin and allowing it's installation
into the exported dynamic plugin and `--suppress-native-package
[package-name..]` which replaces the native package with an empty
package during export, preventing the native package's inclusion into
the exported dynamic plugin's private dependencies.

Signed-off-by: Stan Lewis <[email protected]>
Copy link
Member

@davidfestal davidfestal left a comment

Choose a reason for hiding this comment

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

Only one comment about possibly completing the error message.
Buy apart from that it's very nice !

path.join(target, 'embedded', toSuppress, 'index.js'),
`
throw new Error(
'The package "${toSuppress}" has been marked as a native module and removed from this dynamic plugin package "${derivedPackageName}"'
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add the fact that it is throwing an error because loading native modules from a dynamic backend plugin is currently not supported ?

@openshift-ci openshift-ci bot added the lgtm label Nov 27, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 2ef4806 into janus-idp:main Nov 27, 2024
8 checks passed
schultzp2020 pushed a commit that referenced this pull request Nov 27, 2024
This change introduces two new flags to the CLI to handle transitive
dependencies on packages containing native modules.
`--allow-native-package [package-name...]` to selectively allow native
packages when exporting a dynamic plugin and allowing it's installation
into the exported dynamic plugin and `--suppress-native-package
[package-name..]` which replaces the native package with an empty
package during export, preventing the native package's inclusion into
the exported dynamic plugin's private dependencies.

Signed-off-by: Stan Lewis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants