Skip to content

Commit

Permalink
chore(deps): bump (#5035)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Feb 12, 2024
1 parent 975c719 commit b453380
Show file tree
Hide file tree
Showing 39 changed files with 4,834 additions and 2,991 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Install dependencies for Node.js@18
run: |
npm i p-retry@^4.5.0 open@^8.0.9
node ./scripts/prepare-test-for-old-node.js
if: matrix.node-version == '18.x'

- name: Setup firefox
if: matrix.os != 'windows-latest'
uses: browser-actions/setup-firefox@latest
Expand All @@ -99,13 +105,18 @@ jobs:
- name: Link webpack-dev-server
run: |
cp -R client tmp-client
npm link --ignore-scripts
npm link webpack-dev-server --ignore-scripts
npm link --ignore-scripts || true
npm link webpack-dev-server --ignore-scripts || true
rm -r client
cp -R tmp-client client
- name: Run tests for webpack version ${{ matrix.webpack-version }}
run: node_modules/.bin/jest --coverage --ci --shard=${{ matrix.shard }}
if: matrix.node-version == '18.x'

- name: Run tests for webpack version ${{ matrix.webpack-version }}
run: npm run test:coverage -- --ci --shard=${{ matrix.shard }}
if: matrix.node-version != '18.x'

- name: Submit coverage data to codecov
uses: codecov/codecov-action@v3
Expand Down
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
28 changes: 14 additions & 14 deletions lib/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ class Server {
static async internalIP(family) {
try {
const { gateway } = await require("default-gateway")[family]();

return Server.findIp(gateway);
} catch {
// ignore
Expand All @@ -369,6 +370,7 @@ class Server {
static internalIPSync(family) {
try {
const { gateway } = require("default-gateway")[family].sync();

return Server.findIp(gateway);
} catch {
// ignore
Expand Down Expand Up @@ -405,7 +407,7 @@ class Server {
return port;
}

const pRetry = require("p-retry");
const pRetry = (await import("p-retry")).default;
const getPort = require("./getPort");
const basePort =
typeof process.env.WEBPACK_DEV_SERVER_BASE_PORT !== "undefined"
Expand Down Expand Up @@ -1115,15 +1117,13 @@ class Server {

// cert is more than 30 days old, kill it with fire
if ((now - Number(certificateStat.ctime)) / certificateTtl > 30) {
const { promisify } = require("util");
const rimraf = require("rimraf");
const del = promisify(rimraf);
const { rimraf } = require("rimraf");

this.logger.info(
"SSL certificate is more than 30 days old. Removing...",
);

await del(certificatePath);
await rimraf(certificatePath);

certificateExists = false;
}
Expand Down Expand Up @@ -2480,10 +2480,10 @@ class Server {
/**
* @private
* @param {string} defaultOpenTarget
* @returns {void}
* @returns {Promise<void>}
*/
openBrowser(defaultOpenTarget) {
const open = require("open");
async openBrowser(defaultOpenTarget) {
const open = (await import("open")).default;

Promise.all(
/** @type {NormalizedOpen[]} */
Expand Down Expand Up @@ -2568,9 +2568,9 @@ class Server {

/**
* @private
* @returns {void}
* @returns {Promise<void>}
*/
logStatus() {
async logStatus() {
const { isColorSupported, cyan, red } = require("colorette");

/**
Expand Down Expand Up @@ -2680,13 +2680,13 @@ class Server {
if (parsedIP.range() === "unspecified") {
localhost = prettyPrintURL("localhost");

const networkIPv4 = Server.internalIPSync("v4");
const networkIPv4 = await Server.internalIP("v4");

if (networkIPv4) {
networkUrlIPv4 = prettyPrintURL(networkIPv4);
}

const networkIPv6 = Server.internalIPSync("v6");
const networkIPv6 = await Server.internalIP("v6");

if (networkIPv6) {
networkUrlIPv6 = prettyPrintURL(networkIPv6);
Expand Down Expand Up @@ -2758,7 +2758,7 @@ class Server {
: this.options.host,
);

this.openBrowser(openTarget);
await this.openBrowser(openTarget);
}
}

Expand Down Expand Up @@ -3139,7 +3139,7 @@ class Server {
this.runBonjour();
}

this.logStatus();
await this.logStatus();

if (typeof this.options.onListening === "function") {
this.options.onListening(this);
Expand Down

0 comments on commit b453380

Please sign in to comment.