-
Notifications
You must be signed in to change notification settings - Fork 5
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
[bundling] Change bundling #106
Conversation
4ce56a2
to
7296030
Compare
@@ -20,7 +20,12 @@ export const BUNDLER_VERSIONS: Record<BundlerFullName, string> = { | |||
webpack5: require('webpack5').version, | |||
}; | |||
|
|||
export const NO_CLEANUP = process.argv.includes('--no-cleanup'); | |||
export const NO_CLEANUP = process.argv.includes('--cleanup=0'); |
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.
Apparently Jest doesn't allow custom flags without values.
--no-cleanup
was automatically transformed into --cleanup=0
by Jest's dependency yargs
so it passed through the validation because it has a value in the end.
So I transformed it to --cleanup=0
to have continuity with --build=1
because simply --build
wasn't possible, Jest was flagging it.
88751f2
to
1af1d4c
Compare
e8b08c3
to
c768a61
Compare
// @ts-expect-error PQueue's default isn't typed. | ||
const Queue = PQueue.default ? PQueue.default : PQueue; | ||
const queue = new Queue({ concurrency: options.maxConcurrency }); |
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.
This is the usual mess of highly opinionated Sindre Sorhus' packages.
And I can't use the latest version (yet) because it's ESM only.
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.
bummer :(
exports.default = PQueue;
await fs.remove(target); | ||
await fs.mkdir(target); | ||
await rm(target); | ||
await fs.mkdir(target, { recursive: true }); |
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.
Nit: shouldn't you make a helper for this too?
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.
That's fair.
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.
(no need to be done in this PR)
// @ts-expect-error PQueue's default isn't typed. | ||
const Queue = PQueue.default ? PQueue.default : PQueue; | ||
const queue = new Queue({ concurrency: options.maxConcurrency }); |
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.
bummer :(
exports.default = PQueue;
Co-authored-by: Julien Elbaz <[email protected]>
What and why?
We should not bundle external dependencies in our published packages.
We still need to bundle though, because we have shared internal dependencies cross workspaces.
Also update our dependencies.
How?
rollup
(+ plugins),vite
,unplugin
andesbuild
.fs-extra
and replace it with helpers and nativefs
.fs
in@dd/core/helpers
specifically).a. Move the setup files in a dedicated folder, and apply an eslint rule on it to avoid any internal imports in it.
esbuild
.yarn cli integrity
to verify that we have all the necessary dependencies in the published package.--cleanup=0
and--build=1
flags for running tests.a. Jest actually does not support custom empty parameters and threw when I tried to add
--build
. It didn't throw with--no-cleanup
because it's usingyargs
that automatically changed it to--cleanup=0
behind the scene, which passed Jest's validation of accepting custom params with values. So I changed it to--cleanup=0
for consistency with the new--build=1
.b.
--build=1
will build all the bundlers' packages necessary prior to the test run.Warning