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

Regression - Fix export of latest #905

Merged
merged 2 commits into from
Nov 17, 2024

Conversation

birkskyum
Copy link
Member

it's necessary to also have a default export on latest, otherwise it's not in index.d.ts

@birkskyum birkskyum changed the title Fix export of latest Fix export of latest Nov 17, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.77%. Comparing base (14ecbdf) to head (bd3abea).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #905   +/-   ##
=======================================
  Coverage   92.77%   92.77%           
=======================================
  Files         105      105           
  Lines        4677     4678    +1     
  Branches     1323     1323           
=======================================
+ Hits         4339     4340    +1     
  Misses        338      338           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@HarelM HarelM left a comment

Choose a reason for hiding this comment

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

Does this needs a test to cover this regression?

@birkskyum birkskyum changed the title Fix export of latest Regression - Fix export of latest Nov 17, 2024
@birkskyum
Copy link
Member Author

birkskyum commented Nov 17, 2024

@HarelM I did try to make a test for this, in he build suite.

Made a ticket #907

In style-spec.test.ts I added

import {latest as latestInBundle} from '../../dist/index';

test('"latest" entry point should be defined', async () => {        
    expect(latestInBundle).toBeDefined();
});

The problem here is that it's a test of the index.d.ts file, which uses standard ESM import/export, and Jest doesn't support that, so I get:

"unexpected token 'export'"

Screenshot 2024-11-17 at 11 54 51

I'm of the opinion that a complete lack of ESM support is very problematic in 2024. We have two options - we can swap for Vitest now, or just make a reminder-ticket to enable this test when Jest 30 is out, which is in progress - there's a decent chance it'll be able to run it too.

@birkskyum birkskyum merged commit f91416f into maplibre:main Nov 17, 2024
6 checks passed
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.

3 participants