chore: explicit "type" field in package.json and alignment for "exports"#2430
chore: explicit "type" field in package.json and alignment for "exports"#2430andrii-bodnar merged 11 commits intolingui:nextfrom
Conversation
|
@yslpn is attempting to deploy a commit to the Crowdin Team on Vercel. A member of the Team first needs to authorize it. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #2430 +/- ##
===========================================
+ Coverage 76.66% 88.74% +12.07%
===========================================
Files 81 117 +36
Lines 2083 3297 +1214
Branches 532 972 +440
===========================================
+ Hits 1597 2926 +1329
+ Misses 375 333 -42
+ Partials 111 38 -73 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ingui-macro, metro-transformer, and remote-loader
packages/conf/package.json
Outdated
| ".": { | ||
| "types": "./dist/index.d.ts", | ||
| "default": "./dist/index.mjs" | ||
| } |
There was a problem hiding this comment.
Basically you don't need to specify a types condition for typescript. It will infer typings perfectly fine automatically.
In all places where i changed recently i did not use that, just for simplicity. So for consistency please simplify it to just:
".": "./dist/index.mjs"here in all other places
There was a problem hiding this comment.
I've been reading the documentation, and it's true. Thanks
ref
https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-exports
There was a problem hiding this comment.
If you don't specify types in exports, Ubuild won't generate them. I'll look at it in more detail later.
There was a problem hiding this comment.
Yes, i explicitly ask it to generate types with:
"unbuild": {
"declaration": "node16"
}
There was a problem hiding this comment.
I was thinking about creating the config as a separate file in each package. It has type checking, and you can go to the source code and read the comments in the ts types. Plus, this adds consistency, as currently in some places there are separate configs (React), while in others you need to go to package json.
There was a problem hiding this comment.
don't spend too much time on this, it's likely possible that build pipeline would be replaced to nx in the near future.
This reverts commit 168ed76.
…" and simplify exports structure
|
@yslpn i fixed verdaccio script. but tests in the CRA is failing, better to know why that happend because the error looks weird to me. |
I removed the old files needed by Jest 27 but I didn't notice that CRA uses Jest. Do we support Jest 27? If so, I'll revert the removed files. If not, I'll add moduleNameMapper to CRA's package.json. I previously proposed removing CRA from example maps. #2411 We can do that later. |
timofei-iatsenko
left a comment
There was a problem hiding this comment.
LGTM, could be merged
Thank you |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Description
ESM migration: added
"type": "module"to root and several packages. Removed unused Jest files, replacedstrip-ansiwithnode:util.Added explicit
"type": "commonjs"tobabel-plugin-lingui-macro,metro-transformerandremote-loader. Publint recommends explicitly specifying the type, for example https://publint.dev/@lingui/react@5.9.0Note:
website/without ESM due to Docusaurus limitation facebook/docusaurus#6520Removed legacy workarounds for older React Native versions that didn't support the
"exports"field. Lingui supports React Native >= 0.73 (@lingui/metro-transformerpeerDependencies). React Native 0.72+ supports"exports"Types of changes
Checklist