Skip to content

Enforce that the main/module/browser/umd:main fields are not present when using the "type": "module" mode - #615

Merged
emmatown merged 1 commit into
mainfrom
remove-main-module-fields-when-using-type-module
Feb 25, 2025
Merged

Enforce that the main/module/browser/umd:main fields are not present when using the "type": "module" mode#615
emmatown merged 1 commit into
mainfrom
remove-main-module-fields-when-using-type-module

Conversation

@emmatown

Copy link
Copy Markdown
Member

@changeset-bot

changeset-bot Bot commented Feb 24, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6a08217

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@preconstruct/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov

codecov Bot commented Feb 24, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.55%. Comparing base (b10b747) to head (6a08217).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #615      +/-   ##
==========================================
+ Coverage   92.53%   92.55%   +0.02%     
==========================================
  Files          39       39              
  Lines        2089     2096       +7     
  Branches      645      661      +16     
==========================================
+ Hits         1933     1940       +7     
  Misses        145      145              
  Partials       11       11              

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

Comment thread packages/cli/src/fix.ts
if (pkg.isTypeModule()) {
keys(fields).forEach((field) => {
if (fields[field]) {
delete (pkg.json as any)[field];

@emmatown emmatown Feb 24, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note this is done on pkg instead of the pkg.entrypoints since the entrypoint package.jsons(besides the package's one itself) are removed automatically already elsewhere

@emmatown
emmatown merged commit e3e7067 into main Feb 25, 2025
@emmatown
emmatown deleted the remove-main-module-fields-when-using-type-module branch February 25, 2025 03:41
@github-actions github-actions Bot mentioned this pull request Feb 25, 2025
@emmatown
emmatown restored the remove-main-module-fields-when-using-type-module branch November 22, 2025 01:17
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.

2 participants