-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
refactor: cleanup dependencies and reduce bundle size #99
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SuperchupuDev Thanks for your PR! I'm +1 for this, just please make test pass :)
the test error seems to be because of a very specific |
@SuperchupuDev saw it but seems still not working |
yep, it looks like this new failure is related to |
@SuperchupuDev could it be because of nodejs version? |
i don't think so, i'm using node 20.17.0. i think i can manually set whether color support is enabled in |
i've used the implementation |
i can see that before my last commit i could get the tests to fail if i set |
okay i have no idea why that fails. it seems to detect |
@SuperchupuDev Never seen such issue, it's really weird! That's happening when running a compiled binary, right? Seems like for some reason the compiled binary try to use picocolor that is a dep of pkg and that's happening on |
it makes it somehow work
@robertsLando importing |
Yeah the reason is that common is imported in prelude/bootstrap, see https://github.com/yao-pkg/pkg/blob/main/prelude/bootstrap.js#L37 |
I think picocolors output something on console and this makes some tests fail as they rely on output |
if the reason the tests purposefully fail if they have colors is so output matching isn't buggy, i could easily set |
@SuperchupuDev Ok try |
hi @robertsLando do you mind rerunning ci? |
@SuperchupuDev I'm sorry I have been super busy, done now. Let's see how it goes 🤞🏼 |
ok this is getting hard to debug, i'll just separate it into two or more prs |
Pull request was converted to draft
@robertsLando i've separated this pr into #102 #103 #104 #105, one for each depencency change, so that one dep change breaking tests doesn't block the other ones |
Replaces some bloated dependencies with well known alternatives that are both lighter and faster.
@yao-pkg/pkg-fetch
needs a cleanup too which I'll try to do if this PR gets acceptedfs-extra
- (3 dependencies) ->node:fs
(native)globby@11
(23 dependencies) ->tinyglobby
(2 dependencies)minimatch
- (3 dependencies) ->picomatch
(0 dependencies) which doesn't have catastrophic backtrackingchalk@4
- (5 dependencies) ->picocolors
(0 dependencies)For more info on module replacements, check out https://github.com/es-tooling/module-replacements/tree/main/docs/modules, some more optimizations might be possible
Package size report: (using https://github.com/TheDevMinerTV/package-size-calculator)