-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
chore: Allow external extensions to include their own package.json files #26004
Conversation
@kgabryje how do we perceive handling dependencies conflicts (due to custom extensions) with Superset dependencies? CC: @justinpark |
@john-bodley The way we do it in Preset is we use Superset's dependencies as extension's peer dependencies and generate a package-lock.json. That ensures that there are no new deps added. |
@justinpark and @michael-s-molina you're probably better suited for processing @kgabryje's #26004 (comment). |
@kgabryje I noticed that we have many setup files in |
I agree that extensions deserve their own folder, but I'm afraid that such change of structure might be a breaking change for some orgs. For example, Preset's build process assumes that extension-related files are in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
SUMMARY
Superset supports external frontend extensions by registering them in
superset-frontend/src/setup/setupExtensions.ts
. However, the extensions could not easily add their own dependencies to superset's dependencies. This PR allows external extensions to install new dependencies by includingpackage.json
file withinsuperset-frontend/src/setup
tree (not necessarily root level, it will work with path such assuperset-frontend/src/setup/my-cool-extension-dir/package.json
).BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
npm install
ornpm ci
when there is nopackage.json
file undersrc/setup
dir - there should be no changes tonode_modules
norpackage-lock.json
src/setup
and create apackage.json
file in it, e.g.src/setup/my-extension/package.json
. Add some dependencies to it and runnpm install
ornpm ci
. Verify that the new dependencies were installed correctlyADDITIONAL INFORMATION