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

remove main field from package.json #114

Merged
merged 1 commit into from
Mar 10, 2021
Merged

remove main field from package.json #114

merged 1 commit into from
Mar 10, 2021

Conversation

huozhi
Copy link
Contributor

@huozhi huozhi commented Mar 10, 2021

  • prism-themes is a pure css package, doesn't have to contain a main field
  • there's issue when prism-themes as dependency. like bundler might traverse dependency and pre-bundle/pre-compile it.

e.g. browserless is depending on prism-themes. when I use pkg to bundle a script using browserless. prism-themes is failed to be bundled

@RunDevelopment
Copy link
Member

I can see that main: README.md doesn't make much sense but will removing the main field help? From my understanding, a missing main field is roughly equivalent to main: index.js.

@huozhi
Copy link
Contributor Author

huozhi commented Mar 10, 2021

@RunDevelopment I'm not sure how bundler handle package with any entry. If it's required to have one, do you feel it's proper to change the main entry to a empty one, like fbjs/index.js ?

// index.js
throw new Error('This package should not be required without a full path.');

@RunDevelopment
Copy link
Member

Hmmm, I don't really like having a useless JS file just work around this.

Question: Have you checked that removing the main field actually fixes your problem? If it works with the bundler you use, it'll probably also work with others.

@huozhi
Copy link
Contributor Author

huozhi commented Mar 10, 2021

yeah I've tested locally with removing main field from package.json in node_modules, problem solved. I'd expect regular css imports with absolute path won't cause this issue.

@RunDevelopment
Copy link
Member

If it works for you, it'll probably also work for others. Right now, it just can't work, so let's merge this.

@RunDevelopment RunDevelopment merged commit 3671771 into PrismJS:master Mar 10, 2021
@huozhi
Copy link
Contributor Author

huozhi commented Mar 10, 2021

Thank you @RunDevelopment

bors bot referenced this pull request in aDotInTheVoid/xmark-js Mar 15, 2021
98: fix(deps): bump prism-themes from 1.5.0 to 1.6.0 r=aDotInTheVoid a=dependabot[bot]

Bumps [prism-themes](https://github.com/prismjs/prism-themes) from 1.5.0 to 1.6.0.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/PrismJS/prism-themes/commit/f84f75916c8c192bbf102cdb622ffda319f9061a"><code>f84f759</code></a> 1.6.0</li>
<li><a href="https://github.com/PrismJS/prism-themes/commit/367177199c23d5d0f8ab1421435a87d41a5f4c10"><code>3671771</code></a> Removed incorrect <code>main</code> field in <code>package.json</code> (<a href="https://github.com/prismjs/prism-themes/issues/114">#114</a>)</li>
<li><a href="https://github.com/PrismJS/prism-themes/commit/07e8d2546601fd7e8aabbcb5f406d04abec8ad2c"><code>07e8d25</code></a> Adding Lucario theme (<a href="https://github.com/prismjs/prism-themes/issues/112">#112</a>)</li>
<li><a href="https://github.com/PrismJS/prism-themes/commit/295bc134135c37d802b6d545dd95a6e8dde40600"><code>295bc13</code></a> Added Gruvbox Dark theme (<a href="https://github.com/prismjs/prism-themes/issues/110">#110</a>)</li>
<li><a href="https://github.com/PrismJS/prism-themes/commit/c24ddffde2737293d9b2df7dc59939d527648863"><code>c24ddff</code></a> Updated Coldark Themes - Minor color change (<a href="https://github.com/prismjs/prism-themes/issues/109">#109</a>)</li>
<li><a href="https://github.com/PrismJS/prism-themes/commit/e12fcfcd61bae382469b61ee61c9a8a23c30994c"><code>e12fcfc</code></a> Update Coldark Themes (<a href="https://github.com/prismjs/prism-themes/issues/107">#107</a>)</li>
<li>See full diff in <a href="https://github.com/prismjs/prism-themes/compare/v1.5.0...v1.6.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=prism-themes&package-manager=npm_and_yarn&previous-version=1.5.0&new-version=1.6.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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