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

chore: set type to module in package.json #3280

Merged
merged 2 commits into from Jan 10, 2022

Conversation

vursen
Copy link
Contributor

@vursen vursen commented Jan 10, 2022

Description

The type property of a package.json is commonly used by frontend tooling for detecting whether the package's entry point is a CJS or ES module. If no property is specified, the entry point may be treated as a CJS module according to Node.js docs which is not true in the case of Vaadin web components. To illustrate the situation, here is a warning that Vite shows when you import a Vaadin web component:

@vaadin/vaadin-time-picker doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix.

This PR explicitly sets the type property to module to avoid possible misinterpretation.

Related to vaadin/flow#12574

Type of change

  • Internal

Copy link
Member

@web-padawan web-padawan left a comment

Choose a reason for hiding this comment

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

LGTM. Rebased the PR, also formatted package.json files using Prettier:

npx prettier packages/**/package.json --write

BTW, this isn't currently covered by precommit hook, I'll fix that separately.

@sonarcloud
Copy link

sonarcloud bot commented Jan 10, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@web-padawan web-padawan merged commit cacc51c into master Jan 10, 2022
@web-padawan web-padawan deleted the chore/specify-type-property branch January 10, 2022 19:07
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.

None yet

2 participants