From 817ce5dc9612c7b75c138090c0dca14c4987a5f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ot=C3=A1vio=20Jacobi?= Date: Thu, 24 Aug 2023 21:19:09 -0300 Subject: [PATCH] Update to Node 18 Change-type: major --- .github/actions/publish/action.yml | 2 +- .github/actions/test/action.yml | 2 +- INSTALL-ADVANCED.md | 10 +- lib/utils/remote-build.ts | 4 +- npm-shrinkwrap.json | 98 ++++++++++--------- package.json | 4 +- .../pkg/expected-warnings-darwin-x64.txt | 10 +- .../pkg/expected-warnings-linux-arm64.txt | 8 +- .../pkg/expected-warnings-linux-x64.txt | 8 +- 9 files changed, 78 insertions(+), 68 deletions(-) diff --git a/.github/actions/publish/action.yml b/.github/actions/publish/action.yml index 173720b7..19c56779 100644 --- a/.github/actions/publish/action.yml +++ b/.github/actions/publish/action.yml @@ -18,7 +18,7 @@ inputs: default: 'accounts+apple@balena.io' NODE_VERSION: type: string - default: '16.x' + default: '18.x' VERBOSE: type: string default: 'true' diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index c407bdc9..85c97820 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -15,7 +15,7 @@ inputs: # --- custom environment NODE_VERSION: type: string - default: '16.x' + default: '18.x' VERBOSE: type: string default: "true" diff --git a/INSTALL-ADVANCED.md b/INSTALL-ADVANCED.md index b78cb8b4..9b4f2e02 100644 --- a/INSTALL-ADVANCED.md +++ b/INSTALL-ADVANCED.md @@ -78,8 +78,8 @@ If you are a Node.js developer, you may wish to install the balena CLI via [npm] The npm installation involves building native (platform-specific) binary modules, which require some development tools to be installed first, as follows. -> **The balena CLI currently requires Node.js version 16.** -> **Versions 17 and later are not yet fully supported.** +> **The balena CLI currently requires Node.js version 18.** +> **Versions 19 and later are not yet fully supported.** ### Install development tools @@ -89,7 +89,7 @@ some development tools to be installed first, as follows. $ sudo apt-get update && sudo apt-get -y install curl python3 git make g++ $ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash $ . ~/.bashrc -$ nvm install 16 +$ nvm install 18 ``` The `curl` command line above uses @@ -106,7 +106,7 @@ recommended. ```sh $ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash $ . ~/.bashrc -$ nvm install 16 +$ nvm install 18 ``` #### **Windows** (not WSL) @@ -114,7 +114,7 @@ $ nvm install 16 Install: * If you'd like the ability to switch between Node.js versions, install -- Node.js v16 from the [Nodejs.org releases page](https://nodejs.org/en/download/releases/). +- Node.js v18 from the [Nodejs.org releases page](https://nodejs.org/en/download/releases/). [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) instead. * The [MSYS2 shell](https://www.msys2.org/), which provides `git`, `make`, `g++` and more: diff --git a/lib/utils/remote-build.ts b/lib/utils/remote-build.ts index f8526ab1..5c62db66 100644 --- a/lib/utils/remote-build.ts +++ b/lib/utils/remote-build.ts @@ -167,7 +167,7 @@ async function handleHeadlessBuildStream( // been started let message: HeadlessBuilderMessage; try { - const response = await streamToPromise(stream as NodeJS.ReadWriteStream); + const response = await streamToPromise(stream as NodeJS.ReadStream); message = JSON.parse(response.toString()); } catch (e) { if (e.code === 'SIGINT') { @@ -419,7 +419,7 @@ async function getRemoteBuildStream( if (build.opts.headless) { stream = buildRequest; } else { - stream = buildRequest.pipe(JSONStream.parse('*')); + stream = buildRequest.pipe(JSONStream.parse('*')) as NodeJS.ReadStream; } stream = stream .once('error', () => uploadSpinner.stop()) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index e9ec9e8c..a0fc604d 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -135,7 +135,7 @@ "@types/ndjson": "^2.0.1", "@types/net-keepalive": "^0.4.1", "@types/nock": "^11.1.0", - "@types/node": "^16.18.25", + "@types/node": "^18.17.6", "@types/node-cleanup": "^2.1.2", "@types/parse-link-header": "^1.0.1", "@types/prettyjson": "^0.0.30", @@ -181,7 +181,7 @@ "typescript": "^5.1.3" }, "engines": { - "node": ">=16 <18" + "node": ">=18 <20" }, "optionalDependencies": { "windosu": "^0.3.0" @@ -1118,9 +1118,9 @@ } }, "node_modules/@babel/generator/node_modules/@babel/types": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.10.tgz", - "integrity": "sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg==", + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.11.tgz", + "integrity": "sha512-siazHiGuZRz9aB9NpHy9GOs9xiQPKnMzgdr493iI1M67vRXpnEq8ZOOKzezC5q7zwuQ6sDhdSp4SD9ixKSqKZg==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.22.5", @@ -1154,9 +1154,9 @@ } }, "node_modules/@babel/helper-function-name/node_modules/@babel/types": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.10.tgz", - "integrity": "sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg==", + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.11.tgz", + "integrity": "sha512-siazHiGuZRz9aB9NpHy9GOs9xiQPKnMzgdr493iI1M67vRXpnEq8ZOOKzezC5q7zwuQ6sDhdSp4SD9ixKSqKZg==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.22.5", @@ -1296,9 +1296,9 @@ } }, "node_modules/@babel/template/node_modules/@babel/parser": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.10.tgz", - "integrity": "sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.13.tgz", + "integrity": "sha512-3l6+4YOvc9wx7VlCSw4yQfcBo01ECA8TicQfbnCPuCEpRQrf+gTUyGdxNw+pyTUyywp6JRD1w0YQs9TpBXYlkw==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -1308,9 +1308,9 @@ } }, "node_modules/@babel/template/node_modules/@babel/types": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.10.tgz", - "integrity": "sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg==", + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.11.tgz", + "integrity": "sha512-siazHiGuZRz9aB9NpHy9GOs9xiQPKnMzgdr493iI1M67vRXpnEq8ZOOKzezC5q7zwuQ6sDhdSp4SD9ixKSqKZg==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.22.5", @@ -1343,9 +1343,9 @@ } }, "node_modules/@babel/traverse/node_modules/@babel/parser": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.10.tgz", - "integrity": "sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.13.tgz", + "integrity": "sha512-3l6+4YOvc9wx7VlCSw4yQfcBo01ECA8TicQfbnCPuCEpRQrf+gTUyGdxNw+pyTUyywp6JRD1w0YQs9TpBXYlkw==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -1355,9 +1355,9 @@ } }, "node_modules/@babel/traverse/node_modules/@babel/types": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.10.tgz", - "integrity": "sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg==", + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.11.tgz", + "integrity": "sha512-siazHiGuZRz9aB9NpHy9GOs9xiQPKnMzgdr493iI1M67vRXpnEq8ZOOKzezC5q7zwuQ6sDhdSp4SD9ixKSqKZg==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.22.5", @@ -3082,9 +3082,9 @@ } }, "node_modules/@types/node": { - "version": "16.18.43", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.43.tgz", - "integrity": "sha512-YFpgPKPRcwYbeNOimfu70B+TVJe6tr88WiW/TzEldkwGxQXrmabpU+lDjrFlNqdqIi3ON0o69EQBW62VH4MIxw==" + "version": "18.17.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.12.tgz", + "integrity": "sha512-d6xjC9fJ/nSnfDeU0AMDsaJyb1iHsqCSOdi84w4u+SlN/UgQdY5tRhpMzaFYsI4mnpvgTivEaQd0yOUhAtOnEQ==" }, "node_modules/@types/node-cleanup": { "version": "2.1.2", @@ -4217,6 +4217,11 @@ "node": ">=16.0" } }, + "node_modules/balena-sdk/node_modules/@types/node": { + "version": "16.18.46", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.46.tgz", + "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==" + }, "node_modules/balena-sdk/node_modules/date-fns": { "version": "2.30.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", @@ -23103,9 +23108,9 @@ }, "dependencies": { "@babel/types": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.10.tgz", - "integrity": "sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg==", + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.11.tgz", + "integrity": "sha512-siazHiGuZRz9aB9NpHy9GOs9xiQPKnMzgdr493iI1M67vRXpnEq8ZOOKzezC5q7zwuQ6sDhdSp4SD9ixKSqKZg==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.22.5", @@ -23132,9 +23137,9 @@ }, "dependencies": { "@babel/types": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.10.tgz", - "integrity": "sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg==", + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.11.tgz", + "integrity": "sha512-siazHiGuZRz9aB9NpHy9GOs9xiQPKnMzgdr493iI1M67vRXpnEq8ZOOKzezC5q7zwuQ6sDhdSp4SD9ixKSqKZg==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.22.5", @@ -23242,15 +23247,15 @@ }, "dependencies": { "@babel/parser": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.10.tgz", - "integrity": "sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.13.tgz", + "integrity": "sha512-3l6+4YOvc9wx7VlCSw4yQfcBo01ECA8TicQfbnCPuCEpRQrf+gTUyGdxNw+pyTUyywp6JRD1w0YQs9TpBXYlkw==", "dev": true }, "@babel/types": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.10.tgz", - "integrity": "sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg==", + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.11.tgz", + "integrity": "sha512-siazHiGuZRz9aB9NpHy9GOs9xiQPKnMzgdr493iI1M67vRXpnEq8ZOOKzezC5q7zwuQ6sDhdSp4SD9ixKSqKZg==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.22.5", @@ -23279,15 +23284,15 @@ }, "dependencies": { "@babel/parser": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.10.tgz", - "integrity": "sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.13.tgz", + "integrity": "sha512-3l6+4YOvc9wx7VlCSw4yQfcBo01ECA8TicQfbnCPuCEpRQrf+gTUyGdxNw+pyTUyywp6JRD1w0YQs9TpBXYlkw==", "dev": true }, "@babel/types": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.10.tgz", - "integrity": "sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg==", + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.11.tgz", + "integrity": "sha512-siazHiGuZRz9aB9NpHy9GOs9xiQPKnMzgdr493iI1M67vRXpnEq8ZOOKzezC5q7zwuQ6sDhdSp4SD9ixKSqKZg==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.22.5", @@ -24782,9 +24787,9 @@ } }, "@types/node": { - "version": "16.18.43", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.43.tgz", - "integrity": "sha512-YFpgPKPRcwYbeNOimfu70B+TVJe6tr88WiW/TzEldkwGxQXrmabpU+lDjrFlNqdqIi3ON0o69EQBW62VH4MIxw==" + "version": "18.17.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.12.tgz", + "integrity": "sha512-d6xjC9fJ/nSnfDeU0AMDsaJyb1iHsqCSOdi84w4u+SlN/UgQdY5tRhpMzaFYsI4mnpvgTivEaQd0yOUhAtOnEQ==" }, "@types/node-cleanup": { "version": "2.1.2", @@ -25738,6 +25743,11 @@ "tslib": "^2.1.0" }, "dependencies": { + "@types/node": { + "version": "16.18.46", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.46.tgz", + "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==" + }, "date-fns": { "version": "2.30.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", diff --git a/package.json b/package.json index 238cd919..174fcb02 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "author": "Balena Inc. (https://balena.io/)", "license": "Apache-2.0", "engines": { - "node": ">=16 <18" + "node": ">=18 <20" }, "husky": { "hooks": { @@ -147,7 +147,7 @@ "@types/ndjson": "^2.0.1", "@types/net-keepalive": "^0.4.1", "@types/nock": "^11.1.0", - "@types/node": "^16.18.25", + "@types/node": "^18.17.6", "@types/node-cleanup": "^2.1.2", "@types/parse-link-header": "^1.0.1", "@types/prettyjson": "^0.0.30", diff --git a/tests/test-data/pkg/expected-warnings-darwin-x64.txt b/tests/test-data/pkg/expected-warnings-darwin-x64.txt index 48a30001..c695be1f 100644 --- a/tests/test-data/pkg/expected-warnings-darwin-x64.txt +++ b/tests/test-data/pkg/expected-warnings-darwin-x64.txt @@ -84,8 +84,8 @@ The file must be distributed with executable as %2. %1: node_modules/opn/xdg-open %2: path-to-executable/xdg-open -prebuild-install warn install No prebuilt binaries found (target=v16.16.0 runtime=node arch=x64 libc= platform=darwin) -prebuild-install warn install No prebuilt binaries found (target=v16.16.0 runtime=node arch=x64 libc= platform=darwin) -prebuild-install warn install No prebuilt binaries found (target=v16.16.0 runtime=node arch=x64 libc= platform=darwin) -prebuild-install warn install No prebuilt binaries found (target=v16.16.0 runtime=node arch=x64 libc= platform=darwin) -prebuild-install warn install No prebuilt binaries found (target=v16.16.0 runtime=node arch=x64 libc= platform=darwin) +prebuild-install warn install No prebuilt binaries found (target=v18.5.0 runtime=node arch=x64 libc= platform=darwin) +prebuild-install warn install No prebuilt binaries found (target=v18.5.0 runtime=node arch=x64 libc= platform=darwin) +prebuild-install warn install No prebuilt binaries found (target=v18.5.0 runtime=node arch=x64 libc= platform=darwin) +prebuild-install warn install No prebuilt binaries found (target=v18.5.0 runtime=node arch=x64 libc= platform=darwin) +prebuild-install warn install No prebuilt binaries found (target=v18.5.0 runtime=node arch=x64 libc= platform=darwin) diff --git a/tests/test-data/pkg/expected-warnings-linux-arm64.txt b/tests/test-data/pkg/expected-warnings-linux-arm64.txt index 0cbe60ab..bd5e85c2 100644 --- a/tests/test-data/pkg/expected-warnings-linux-arm64.txt +++ b/tests/test-data/pkg/expected-warnings-linux-arm64.txt @@ -84,7 +84,7 @@ The file must be distributed with executable as %2. %1: node_modules/opn/xdg-open %2: path-to-executable/xdg-open -prebuild-install warn install No prebuilt binaries found (target=v16.16.0 runtime=node arch=arm64 libc= platform=linux) -prebuild-install warn install No prebuilt binaries found (target=v16.16.0 runtime=node arch=arm64 libc= platform=linux) -prebuild-install warn install No prebuilt binaries found (target=v16.16.0 runtime=node arch=arm64 libc= platform=linux) -prebuild-install warn install No prebuilt binaries found (target=v16.16.0 runtime=node arch=arm64 libc= platform=linux) +prebuild-install warn install No prebuilt binaries found (target=v18.5.0 runtime=node arch=arm64 libc= platform=linux) +prebuild-install warn install No prebuilt binaries found (target=v18.5.0 runtime=node arch=arm64 libc= platform=linux) +prebuild-install warn install No prebuilt binaries found (target=v18.5.0 runtime=node arch=arm64 libc= platform=linux) +prebuild-install warn install No prebuilt binaries found (target=v18.5.0 runtime=node arch=arm64 libc= platform=linux) diff --git a/tests/test-data/pkg/expected-warnings-linux-x64.txt b/tests/test-data/pkg/expected-warnings-linux-x64.txt index 168ef3fb..3bbada47 100644 --- a/tests/test-data/pkg/expected-warnings-linux-x64.txt +++ b/tests/test-data/pkg/expected-warnings-linux-x64.txt @@ -84,7 +84,7 @@ The file must be distributed with executable as %2. %1: node_modules/opn/xdg-open %2: path-to-executable/xdg-open -prebuild-install warn install No prebuilt binaries found (target=v16.16.0 runtime=node arch=x64 libc= platform=linux) -prebuild-install warn install No prebuilt binaries found (target=v16.16.0 runtime=node arch=x64 libc= platform=linux) -prebuild-install warn install No prebuilt binaries found (target=v16.16.0 runtime=node arch=x64 libc= platform=linux) -prebuild-install warn install No prebuilt binaries found (target=v16.16.0 runtime=node arch=x64 libc= platform=linux) +prebuild-install warn install No prebuilt binaries found (target=v18.5.0 runtime=node arch=x64 libc= platform=linux) +prebuild-install warn install No prebuilt binaries found (target=v18.5.0 runtime=node arch=x64 libc= platform=linux) +prebuild-install warn install No prebuilt binaries found (target=v18.5.0 runtime=node arch=x64 libc= platform=linux) +prebuild-install warn install No prebuilt binaries found (target=v18.5.0 runtime=node arch=x64 libc= platform=linux)