-
Notifications
You must be signed in to change notification settings - Fork 28
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: use type PackageJson from type-fest #117
Conversation
2d360fd
to
67b22ac
Compare
I think there is no need to import this dependency. Is there any use? |
It mainly utilizes the type |
Introducing additional packages will cause that if we provide a public js API in the future, its type will not be bundled since we use bundleless DTS. We need to avoid relying on this type in our public API, this creates an extra mental burden. |
We want Rslib's dependencies to be as minimal as possible, and type-fest is only used for type imports here, so we don't want it to be included in dep. Ideally, we should be able to specify type-fest as a devDep without mental burden, and then bundle in the bundled dts. However, currently, there's no battle-tested dts bundle method available, so Rslib still uses bundleless types for now, and we might switch to bundle in the future. Copying the usable code (like https://github.com/sindresorhus/type-fest/blob/main/source/package-json.d.ts#L221-L225) seems to be the best solution for now. |
67b22ac
to
fc9c343
Compare
Is it okay to do this? |
Overall it looks good, because we have copied the d.ts code, so we can do some further optimization here
|
I will complete the rest in PR #88 |
Summary
The preparatory work for PR #88 is to avoid endless resolution of branch conflicts.
Checklist