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

fix: ensure browser compatibility #150

Merged
merged 19 commits into from
Jul 10, 2022
Merged

fix: ensure browser compatibility #150

merged 19 commits into from
Jul 10, 2022

Conversation

imranbarbhuiya
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Jul 7, 2022

Codecov Report

Merging #150 (ad3ef28) into main (ebc46de) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #150   +/-   ##
=======================================
  Coverage   99.31%   99.31%           
=======================================
  Files          56       56           
  Lines        3230     3230           
  Branches      801      801           
=======================================
  Hits         3208     3208           
  Misses         13       13           
  Partials        9        9           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ebc46de...ad3ef28. Read the comment docs.

package.json Show resolved Hide resolved
.github/workflows/continuous-integration.yml Show resolved Hide resolved
Copy link
Member

@favna favna left a comment

Choose a reason for hiding this comment

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

I would like to see

  • A browser test using vitest jsdom.
  • A test for which new directory is created, a fresh node_modules is installed with only shapeshift and then an assert test is ran similar to the one deleted. Add a dependency which is a relative path to a .tgz file which is created with yarn pack in the pipeline. Then run yarn install in that directory and run the test file. Run this locally to make sure no node_modes from the root directory are loaded, I.e. by deleting it and then installing in the subdirectory. The test has to test both CJS and ESM so use .cjs and .mjs file extensions.

tsup.config.ts Show resolved Hide resolved
tsup.config.ts Show resolved Hide resolved
@favna favna changed the title chore: maybe we are now 100% browser compatible? fix: ensure browser compatibility Jul 7, 2022
@imranbarbhuiya
Copy link
Contributor Author

imranbarbhuiya commented Jul 7, 2022

I would like to see

  • A browser test using vitest happy-dom. This means excluding it from the normal test suite and creating a folder browser-tests then creating a separate vitest config and including only that folder.
  • A test for which new directory is created, a fresh node_modules is installed with only shapeshift and then an assert test is ran similar to the one deleted. Add a dependency which is a relative path to a .tgz file which is created with yarn pack in the pipeline. Then run yarn install in that directory and run the test file. Run this locally to make sure no node_modes from the root directory are loaded, I.e. by deleting it and then installing in the subdirectory. The test has to test both CJS and ESM so use .cjs and .mjs file extensions.

for the 2nd point, I've removed bundling for cjs and mjs. Now it only bundles iife. So do u still need this test? it won't work without the other 2 deps

@imranbarbhuiya
Copy link
Contributor Author

finally green ci 😄

@imranbarbhuiya imranbarbhuiya requested a review from favna July 7, 2022 17:07
package.json Show resolved Hide resolved
tsconfig.typecheck.json Outdated Show resolved Hide resolved
@imranbarbhuiya imranbarbhuiya marked this pull request as draft July 8, 2022 15:12
@favna
Copy link
Member

favna commented Jul 8, 2022

for the 2nd point, I've removed bundling for cjs and mjs. Now it only bundles iife. So do u still need this test? it won't work without the other 2 deps

No more need indeed because their compatibility now gets covered again by vitest.

@imranbarbhuiya imranbarbhuiya marked this pull request as ready for review July 9, 2022 12:49
favna
favna previously approved these changes Jul 9, 2022
@imranbarbhuiya imranbarbhuiya requested a review from favna July 10, 2022 11:16
@favna favna merged commit 92d05d8 into sapphiredev:main Jul 10, 2022
@imranbarbhuiya imranbarbhuiya deleted the chore/bundle-util branch July 10, 2022 17: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.

5 participants