Skip to content

feat(export): export consistent yarn project#89

Open
gashcrumb wants to merge 1 commit intoredhat-developer:mainfrom
gashcrumb:RHIDP-12902
Open

feat(export): export consistent yarn project#89
gashcrumb wants to merge 1 commit intoredhat-developer:mainfrom
gashcrumb:RHIDP-12902

Conversation

@gashcrumb
Copy link
Copy Markdown
Member

@gashcrumb gashcrumb commented Mar 26, 2026

This change updates the CLI's frontend script to create a yarn.lock based on the exported plugin package in a similar fashion to backend plugins. This makes the exported plugin package for frontend plugins more consistent with backend plugins and allows another means for security scanners to inspect the plugin's dependencies. This change also moves functions that are shared between the backend and frontend commands into a shared utils file so it's more obvious which functions are common to each command. The .yarnrc.yml from the containing workspace is also retrieved, or a new one is created to ensure consistency when running "yarn install" during plugin export. Also workspace resolutions are taken from the adjacent package.json file when the yarn lockfile is discovered and applied to the derived exported package. This change also adds some documents that summarize the plugin export process. Finally this change adds a prepare script so that it's possible to run this command with changes from a pull request without having to perform a release for testing purposes.

Also opted to retroactively add some of the previous changes into the CHANGELOG.md along with this one as it doesn't appear to have been updated in awhile.

Fixes RHIDP-12902

Assisted-By: Cursor Desktop

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED

@gashcrumb gashcrumb force-pushed the RHIDP-12902 branch 3 times, most recently from fa07083 to f0e5eeb Compare March 26, 2026 17:32
This change updates the CLI's frontend script to create a yarn.lock
based on the exported plugin package in a similar fashion to backend
plugins.  This makes the exported plugin package for frontend plugins
more consistent with backend plugins and allows another means for
security scanners to inspect the plugin's dependencies.  This change
also moves functions that are shared between the backend and frontend
commands into a shared utils file so it's more obvious which functions
are common to each command.  A new .yarnrc.yml is created in the
exported plugin package to ensure consistency when running "yarn
install" during plugin export.  Also workspace resolutions are taken
from the adjacent package.json file when the yarn lockfile is discovered
and applied to the derived exported package.  This change also adds some
documents that summarize the plugin export process.  Finally this change
adds a prepare script so that it's possible to run this command with
changes from a pull request without having to perform a release for
testing purposes.

Assisted-By: Cursor Desktop

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@sonarqubecloud
Copy link
Copy Markdown

@gashcrumb
Copy link
Copy Markdown
Member Author

This PR can easily be tested locally via npx now, just have to be patient as it builds on the fly, but you can run npx -y github:redhat-developer/rhdh-cli#refs/pull/89/head plugin export on a plugin project and examine the resulting dist-dynamic folder.

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.

1 participant