Skip to content

ci: test MapLibre v4/v5 and export GlobeControl - #2600

Merged
chrisgervang merged 5 commits into
masterfrom
chr/test-maplibre-v4-v5
Jul 28, 2026
Merged

ci: test MapLibre v4/v5 and export GlobeControl#2600
chrisgervang merged 5 commits into
masterfrom
chr/test-maplibre-v4-v5

Conversation

@chrisgervang

@chrisgervang chrisgervang commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Adds a non-fail-fast CI matrix for MapLibre ^4.0.0 and ^5.0.0, with Coveralls uploading only from v5. Makes GlobeControl typing version-aware so v4 remains supported, exports GlobeControl and its props publicly, and documents its v5+ requirement. Adds an export regression test and corrects the helper so it checks each endpoint. Validated build, lint, and node tests against MapLibre 4.7.1 and 5.0.1.

Fixes #2592


Note

Low Risk
Changes are CI matrix expansion, public exports, optional typing, and test fixes—no auth, security, or core map runtime behavior beyond explicit GlobeControl version checks.

Overview
CI now runs lint and tests against MapLibre ^4.0.0 and ^5.0.0 in a non-fail-fast matrix; Coveralls uploads only from the v5 job, and a gate job fails the workflow if any matrix leg fails.

GlobeControl is exported from the public MapLibre entry (component + GlobeControlProps), with docs noting maplibre-gl v5+. Types treat GlobeControl on MapLib as optional and define GlobeControlInstance conditionally so v4 consumers still compile; runtime throws a clear error if the control class is missing.

Export regression tests now check each endpoint against the right component list (including Terrain, Logo, and Globe for MapLibre), and the helper compares the passed module instead of always using legacy exports.

Reviewed by Cursor Bugbot for commit 4363759. Bugbot is set up for automated code reviews on this repo. Configure here.

({mapLib}) => {
const GlobeControl = mapLib.GlobeControl;
if (!GlobeControl) {
throw new Error('GlobeControl is not supported by this version of MapLibre GL JS');

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

GlobeControl exists only in MapLibre v5+

TerrainControl as TerrainControlInstance,
LogoControl as LogoControlInstance,
LogoControlOptions,
GlobeControl as GlobeControlInstance,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Building against v4 produced three TypeScript errors: these two GlobeControl exports don't exist, and one incompatible MapLib assignment. The fix preserves v4 support while making GlobeControl explicitly optional and unavailable at runtime on versions that don’t provide it.

Wdyt, @Pessimistress? This was previously undetected since we don't run CI on v4 anymore

@chrisgervang chrisgervang changed the title ci: test MapLibre v4 and v5 ci: test MapLibre v4/v5 and export GlobeControl Jul 28, 2026
Comment thread test/src/exports.ts
): null | string[] {
const missingExports: string[] = [];
for (const key of Components) {
if (!legacyComponents[key]) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this seems to be an old typo. the module param was not used. Also expanded this to cover Maplibre-specific components

@chrisgervang
chrisgervang merged commit 0ca881f into master Jul 28, 2026
5 checks passed
@chrisgervang
chrisgervang deleted the chr/test-maplibre-v4-v5 branch July 28, 2026 23:48
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.

[Bug] GlobeControl was added in v8.1.1 but not exported from index

2 participants