Skip to content

Commit 86f0734

Browse files
committed
chore: upgraded Node version to 22 and removed dependency to node-fetch
1 parent a8bf379 commit 86f0734

File tree

10 files changed

+14
-145
lines changed

10 files changed

+14
-145
lines changed

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ runs:
1313
with:
1414
cache: npm
1515
registry-url: "https://registry.npmjs.org"
16-
node-version: "18.20.1"
16+
node-version-file: "package.json"
1717
# https://github.com/npm/cli/issues/7308
1818
- if: runner.os == 'Windows'
1919
run: npm install -g [email protected]

integration-test/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"test:record": "AUTIFY_POLLY_RECORD=1 jest --testMatch **/dist/test/**/*.test.js --updateSnapshot"
5252
},
5353
"engines": {
54-
"node": ">=20.15.0"
54+
"node": ">=22.4.0"
5555
},
5656
"bugs": {
5757
"url": "https://github.com/autifyhq/autify-cli/issues"

integration-test/src/bin/autify-cli-integration-test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ const testPathPattern =
1313

1414
execSync(`npm run ${command} -- ${testPathPattern}`, {
1515
stdio: "inherit",
16+
env: { ...process.env, NODE_OPTIONS: "--no-deprecation" },
1617
cwd: rootDir,
1718
});

integration-test/src/bin/autify-with-proxy.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const createPolly = async (args: string[]) => {
7878
"..",
7979
"..",
8080
"__recordings__",
81-
encodeURIComponent(args.join(" "))
81+
encodeURIComponent(args.map((arg) => arg.replaceAll(/"+/g, "")).join(" "))
8282
);
8383
const polly = new Polly("polly-proxy", {
8484
mode,
@@ -133,6 +133,7 @@ const autifyWithProxy = async (originalArgs: string[]) => {
133133
AUTIFY_WEB_BASE_PATH: `http://127.0.0.1:${webProxy.port}/api/v1/`,
134134
AUTIFY_MOBILE_BASE_PATH: `http://127.0.0.1:${mobileProxy.port}/api/v1/`,
135135
},
136+
shell: process.platform === "win32",
136137
stdio: "inherit",
137138
});
138139
return new Promise<ProcStatus>((resolve, reject) => {

integration-test/src/test/helpers/execAutifyCli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const normalize = (stdout: string) =>
2727
export const execAutifyCli = async (
2828
args: string
2929
): Promise<{ stdout: string; stderr: string }> => {
30-
const command = `autify-with-proxy ${args}`;
30+
const command = `autify-with-proxy ${process.platform === "win32" ? args.replaceAll(/"([^"]+)"/g, '""""$1""') : args}`;
3131
const { stdout, stderr } = await promisify(exec)(command, { env });
3232
return {
3333
stdout: normalize(stripAnsi(stdout)),

integration-test/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outDir": "dist",
77
"rootDir": "src",
88
"strict": true,
9-
"target": "es2019",
9+
"target": "es2021",
1010
"esModuleInterop": true,
1111
"types": ["express", "jest", "node", "which"]
1212
},

package-lock.json

Lines changed: 2 additions & 134 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"inquirer": "^8.2.6",
3232
"listr": "^0.14.3",
3333
"node-emoji": "^1.11.0",
34-
"node-fetch": "^2.7.0",
3534
"node-stream-zip": "^1.15.0",
3635
"per-env": "^1.0.2",
3736
"shell-quote": "^1.8.1",
@@ -50,7 +49,6 @@
5049
"@types/listr": "^0.14.9",
5150
"@types/node": "^20.14.9",
5251
"@types/node-emoji": "^1.8.2",
53-
"@types/node-fetch": "^2.6.11",
5452
"@types/shell-quote": "^1.7.5",
5553
"@types/tar": "^6.1.13",
5654
"@types/unzip-stream": "^0.3.4",
@@ -171,7 +169,7 @@
171169
]
172170
},
173171
"engines": {
174-
"node": ">=20.15.0"
172+
"node": ">=22.4.0"
175173
},
176174
"bugs": "https://github.com/autifyhq/autify-cli/issues",
177175
"keywords": [

src/autify/connect/client-manager/DebugServerClient.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* eslint-disable unicorn/filename-case */
22
import { CLIError } from "@oclif/errors";
3-
import fetch from "node-fetch";
43
import { ClientEvents } from "./ClientManager";
54
import AbortController from "abort-controller";
65

src/autify/connect/installClient.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint-disable unicorn/filename-case */
22
import { CLIError } from "@oclif/errors";
33
import { arch, env, platform } from "node:process";
4-
import fetch from "node-fetch";
54
import {
65
createReadStream,
76
createWriteStream,
@@ -83,7 +82,10 @@ const download = async (workspaceDir: string, url: URL) => {
8382
if (!response.ok)
8483
throw new CLIError(`Failed to fetch ${url}: ${response.status}`);
8584
const streamPipeline = promisify(pipeline);
86-
await streamPipeline(response.body, createWriteStream(downloadPath));
85+
if (response.body) {
86+
await streamPipeline(response.body, createWriteStream(downloadPath));
87+
}
88+
8789
return downloadPath;
8890
};
8991

0 commit comments

Comments
 (0)