-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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: Validate "exports" field in package.json #5350
chore: Validate "exports" field in package.json #5350
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit f3a83cc. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 2 targetsSent with 💌 from NxCloud. |
@TkDodo any idea why these checks failed? |
Yeah alpha is broken currently since I merged main back to it, where we added distributed task execution in nx. @ZackDeRose is looking into it. Sorry for the inconvenience 🙈 |
@TkDodo no stress! The Nx distributed agents speed gains are 💯. Are checks on main also broken? |
@lachlancollins upgrade to node18 fixed the issue |
build validation fails now with:
|
I'm on it! |
Hi @TkDodo , could you please review my changes to validate-packages.ts? I've added a check to make sure packages have |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit f3a83cc:
|
Codecov ReportPatch coverage has no change and project coverage change:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #5350 +/- ##
==========================================
- Coverage 92.27% 88.39% -3.89%
==========================================
Files 112 24 -88
Lines 4271 491 -3780
Branches 1114 152 -962
==========================================
- Hits 3941 434 -3507
+ Misses 309 52 -257
+ Partials 21 5 -16 ☔ View full report in Codecov by Sentry. |
@lachlancollins I don't think the eslint-plugin needs an
for most packages, but leave it out for the eslint one? |
@TkDodo I'd have to do something like Is there any harm in adding exports to the eslint package? It is the "replacement" to main/module/types and is used by all the other packages. I could do something like Also, I'm happy to add back module and types to svelte-query, but I don't think it's even possible to build svelte with a bundler that doesn't support exports :P |
I suppose not.
Alright, just wanted to double check 👍 |
not sure why codesandbox build is failing now and I can't re-trigger that. can you add an empty commit to re-run it? |
@TkDodo what gets run on codesandbox? It seems like EDIT: nvm, it was just the old flaky tests which were only fixed on alpha. |
@TkDodo I saw webpack mentioned on the svelte subreddit so I panicked and added back the non-exports fields 😅 |
According to publint:
This entrypoint has types at build/lib/index.d.ts but it is not exported from pkg.exports. Consider adding it to pkg.exports["."].types to be compatible with TypeScript's "moduleResolution": "bundler" compiler option. ([More info](https://publint.dev/rules.html#types_not_exported))
This was actually working with bundler mode because the
.d.ts
files are adjacent to the.js
files. However, this is obviously more correct, and the other query packages do this already.I've added a check to validate-packages.ts to look for exports['.']['default'], and also moved the entries logic into config.ts. In the future, it might be possible to add publint to this file - however I ran into a CJS/ESM error which I will investigate at a later time.