-
Notifications
You must be signed in to change notification settings - Fork 63
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
speed up the installation of dependencies #1030
Conversation
3aa57fa
to
8c8a112
Compare
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const bundle = require("./cjs"); |
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.
Can we not use require here?
If import does not work here, i think const bundle = import("./cjs")
would.
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.
I can use import
, but then typescript build this file and store it inside build
folder. And it's not a big problem, but it will not be used in production code. In production code only final bundle file is used. So because of this, I use require
here.
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.
And now typescript wouldn't build this file?
"@vitest/spy": "2.1.4", | ||
"@wdio/globals": "8.39.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.
Do not used anymore, so I remove it
"@wdio/utils": "8.39.0", | ||
"@wdio/utils-cjs": "npm:@wdio/[email protected]", |
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.
Move to dev deps, because now I bundle this package using esbuild
@@ -73,10 +68,8 @@ | |||
"fs-extra": "5.0.0", | |||
"gemini-configparser": "1.4.1", | |||
"get-port": "5.1.1", | |||
"glob-extra": "5.0.2", |
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.
Move to dev deps. This package now also bundled
@@ -54,14 +54,9 @@ | |||
"@babel/code-frame": "7.24.2", | |||
"@gemini-testing/commander": "2.15.4", | |||
"@jspm/core": "2.0.1", | |||
"@types/debug": "4.1.12", | |||
"@types/yallist": "4.0.4", |
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.
All these types packages should be declared in dev deps
@@ -1,7 +1,5 @@ | |||
import crypto from "crypto"; | |||
import { RequestOptions } from "https"; | |||
|
|||
import { RemoteCapability } from "@wdio/types/build/Capabilities"; |
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.
Found solution how to remove this hack
); | ||
} | ||
export const setupTransformHook: (opts?: { removeNonJsImports?: boolean }) => VoidFunction = bundle.setupTransformHook; | ||
export const TRANSFORM_EXTENSIONS: string[] = bundle.TRANSFORM_EXTENSIONS; |
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.
Now here I just reexport necessary methods
@@ -110,14 +104,15 @@ | |||
"@commitlint/config-conventional": "^19.0.3", | |||
"@cspotcode/source-map-support": "0.8.0", | |||
"@sinonjs/fake-timers": "10.3.0", | |||
"@swc/core": "1.3.40", | |||
"@swc/core": "1.9.2", |
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.
Install fresh version of swc/core. Because with old version I got errors in CI builds.
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const bundle = require("./cjs"); |
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.
I can use import
, but then typescript build this file and store it inside build
folder. And it's not a big problem, but it will not be used in production code. In production code only final bundle file is used. So because of this, I use require
here.
Oh, I forgot to send comments, which I wrote when publish this PR =( |
8c8a112
to
3e7dc91
Compare
What is done:
glob-extra
and@wdio/utils-cjs
in order to reduce weight of packages and do not install them from npmAs a result:
time npm i --production
andrm -rf node_modules && npm cache clean -f
before each install