fix(deps): remove encodable dependency and pin query-string to fix Dependabot CI failures#37450
Conversation
…issues When npm regenerates the lockfile (e.g., during Dependabot updates), peer dependencies can be resolved to different versions: - query-string >=5.1.1 was resolving to 9.x (ESM-only) instead of 6.x - global-box was being dropped entirely from the dependency tree This caused CI failures: - Jest: SyntaxError: Cannot use import statement outside a module - Storybook: Module not found: Error: Can't resolve 'global-box' Fix by adding these as explicit dependencies with pinned versions: - query-string: 6.14.1 (CommonJS version) - global-box: 2.0.2 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Bito Automatic Review Skipped - Files Excluded |
Sequence DiagramThis PR pins query-string and global-box in package.json to force compatible CommonJS versions and reintroduce a missing transitive dependency, preventing CI failures caused by npm lockfile regenerations during dependency updates. sequenceDiagram
participant Dependabot
participant npm
participant CI
participant Repo
Dependabot->>npm: Run dependency update (regenerate lockfile)
npm-->>Repo: Resolve deps (query-string -> 9.x (ESM), global-box dropped)
Repo->>CI: Run tests (Jest/Storybook)
CI-->>Dependabot: Fail (SyntaxError / Module not found)
Repo->>Repo: Add pinned deps (query-string@6.14.1, global-box@2.0.2) in package.json
Repo->>npm: Install & regenerate lockfile
npm-->>CI: Resolved compatible deps
CI-->>Dependabot: Tests pass (Dependabot PRs can be rebased)
Generated by CodeAnt AI |
There was a problem hiding this comment.
Pull request overview
This PR pins query-string and global-box as top-level frontend dependencies to stabilize transitive resolution and prevent ESM/peer-dependency issues that were breaking Jest and Storybook in Dependabot PRs.
Changes:
- Add
global-box@2.0.2tosuperset-frontenddependencies so it remains present in the dependency tree for@encodable/registryand Storybook. - Add
query-string@6.14.1(CommonJS) tosuperset-frontenddependencies so Jest no longer resolves to the ESM-only9.xline. - Regenerate
package-lock.jsonto reflect the new direct dependencies and their dependency metadata (removing obsolete"peer": trueflags where these are now regular deps).
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
superset-frontend/package.json |
Adds pinned global-box and query-string as explicit runtime dependencies to control resolution. |
superset-frontend/package-lock.json |
Updates lockfile to align with the new direct dependencies and their transitive packages, ensuring consistent installs in CI. |
Files not reviewed (1)
- superset-frontend/package-lock.json: Language not supported
Replace the unmaintained encodable library with a simple inline encoder implementation. This eliminates the transitive dependency on global-box which was causing npm resolution issues in Dependabot PRs. Changes: - Remove encodable from plugin-chart-word-cloud dependencies - Remove @encodable/color from superset-ui-demo (was unused) - Delete configureEncodable.ts (no longer needed) - Implement SimpleEncoder class with d3-scale for fontSize scaling - Remove global-box pin from main package.json (no longer needed) - Keep query-string pinned at 6.14.1 to prevent ESM resolution issues The SimpleEncoder provides the same functionality: - Field-based data mapping for text, color, fontSize, fontFamily, fontWeight - Linear scale for fontSize with configurable range and zero option - Default values when fields are not specified This unblocks multiple Dependabot PRs that were failing due to global-box going missing during lockfile regeneration. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The echarts plugin uses d3-array but was relying on @types/d3-array being hoisted from encodable's transitive dependencies. Now that encodable is removed, we need to declare the type dependency directly. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code Review Agent Run #16cd60Actionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
…pendabot CI failures (apache#37450) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…pendabot CI failures (apache#37450) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…pendabot CI failures (apache#37450) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…pendabot CI failures (apache#37450) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Summary
This PR fixes transitive dependency resolution issues that were causing multiple Dependabot PRs to fail CI, by removing the root cause rather than just pinning versions.
The Problem
When npm regenerates the lockfile (during dependency updates), peer dependencies were resolving differently:
query-string >=5.1.1was resolving to 9.x (ESM-only) instead of 6.x (CommonJS)global-boxwas being dropped entirely from the dependency treeThis caused CI failures:
SyntaxError: Cannot use import statement outside a moduleModule not found: Error: Can't resolve 'global-box'Root Cause
The
global-boxdependency came fromencodable, an unmaintained library (last updated 2021) used only by the word-cloud plugin. Rather than pinglobal-box, we removed the dependency chain entirely.Solution
Refactored word-cloud plugin to remove
encodabledependencySimpleEncoderclass (~90 lines)d3-scale(already a dependency) for fontSize scalingconfigureEncodable.ts(no longer needed)Removed unused
@encodable/colorfromsuperset-ui-demoPinned
query-stringat 6.14.1 to prevent ESM resolution issuesChanges
plugins/plugin-chart-word-cloud/src/chart/WordCloud.tsxplugins/plugin-chart-word-cloud/src/configureEncodable.tsplugins/plugin-chart-word-cloud/src/index.tsplugins/plugin-chart-word-cloud/src/plugin/index.tsplugins/plugin-chart-word-cloud/package.jsonpackages/superset-ui-demo/package.jsonpackage.jsonpackage-lock.jsonAffected Dependabot PRs
Once this PR is merged, these PRs can be rebased and should pass CI:
Test Plan
🤖 Generated with Claude Code