mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-19 21:57:51 +00:00
Update to Node 16
This also drops support for Node 14 Change-type: major
This commit is contained in:
parent
6ee0b48c9a
commit
7dfb7474f5
2
.github/actions/publish/action.yml
vendored
2
.github/actions/publish/action.yml
vendored
@ -15,7 +15,7 @@ inputs:
|
||||
default: "accounts+apple@balena.io"
|
||||
NODE_VERSION:
|
||||
type: string
|
||||
default: "14.x"
|
||||
default: '16.x'
|
||||
VERBOSE:
|
||||
type: string
|
||||
default: "true"
|
||||
|
2
.github/actions/test/action.yml
vendored
2
.github/actions/test/action.yml
vendored
@ -12,7 +12,7 @@ inputs:
|
||||
# --- custom environment
|
||||
NODE_VERSION:
|
||||
type: string
|
||||
default: "14.x"
|
||||
default: '16.x'
|
||||
VERBOSE:
|
||||
type: string
|
||||
default: "true"
|
||||
|
@ -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 14.**
|
||||
> **Versions 15 and later are not yet fully supported.**
|
||||
> **The balena CLI currently requires Node.js version 16.**
|
||||
> **Versions 17 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 14
|
||||
$ nvm install 16
|
||||
```
|
||||
|
||||
The `curl` command line above uses
|
||||
@ -106,15 +106,15 @@ recommended.
|
||||
```sh
|
||||
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
|
||||
$ . ~/.bashrc
|
||||
$ nvm install 14
|
||||
$ nvm install 16
|
||||
```
|
||||
|
||||
#### **Windows** (not WSL)
|
||||
|
||||
Install:
|
||||
|
||||
* Node.js v14 from the [Nodejs.org releases page](https://nodejs.org/en/download/releases/).
|
||||
* 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/).
|
||||
[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:
|
||||
|
@ -153,19 +153,19 @@ export default class TunnelCmd extends Command {
|
||||
try {
|
||||
await handler(client);
|
||||
logConnection(
|
||||
client.remoteAddress || '',
|
||||
client.remotePort || 0,
|
||||
client.localAddress,
|
||||
client.localPort,
|
||||
client.remoteAddress ?? '',
|
||||
client.remotePort ?? 0,
|
||||
client.localAddress ?? '',
|
||||
client.localPort ?? 0,
|
||||
uuid,
|
||||
remotePort,
|
||||
);
|
||||
} catch (err) {
|
||||
logConnection(
|
||||
client.remoteAddress || '',
|
||||
client.remotePort || 0,
|
||||
client.localAddress,
|
||||
client.localPort,
|
||||
client.remoteAddress ?? '',
|
||||
client.remotePort ?? 0,
|
||||
client.localAddress ?? '',
|
||||
client.localPort ?? 0,
|
||||
uuid,
|
||||
remotePort,
|
||||
err,
|
||||
|
@ -249,7 +249,7 @@ export class LivepushManager {
|
||||
cwd: serviceContext,
|
||||
followSymlinks: true,
|
||||
ignoreInitial: true,
|
||||
ignored: (filePath: string, stats: fs.Stats | undefined) => {
|
||||
ignored: (filePath: string, stats?: fs.Stats) => {
|
||||
if (!stats) {
|
||||
try {
|
||||
// sync because chokidar defines a sync interface
|
||||
|
25524
npm-shrinkwrap.json
generated
25524
npm-shrinkwrap.json
generated
File diff suppressed because it is too large
Load Diff
@ -89,7 +89,7 @@
|
||||
"author": "Balena Inc. (https://balena.io/)",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=14 <16"
|
||||
"node": ">=16 <18"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
@ -145,7 +145,7 @@
|
||||
"@types/ndjson": "^2.0.1",
|
||||
"@types/net-keepalive": "^0.4.1",
|
||||
"@types/nock": "^11.1.0",
|
||||
"@types/node": "^14.18.36",
|
||||
"@types/node": "^16.18.25",
|
||||
"@types/node-cleanup": "^2.1.2",
|
||||
"@types/parse-link-header": "^1.0.1",
|
||||
"@types/prettyjson": "^0.0.30",
|
||||
@ -200,7 +200,6 @@
|
||||
"@sentry/node": "^6.16.1",
|
||||
"@types/fast-levenshtein": "0.0.1",
|
||||
"@types/update-notifier": "^4.1.1",
|
||||
"JSONStream": "^1.0.3",
|
||||
"balena-config-json": "^4.2.0",
|
||||
"balena-device-init": "^6.0.0",
|
||||
"balena-errors": "^4.7.3",
|
||||
@ -242,6 +241,7 @@
|
||||
"is-elevated": "^3.0.0",
|
||||
"is-root": "^2.1.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"JSONStream": "^1.0.3",
|
||||
"klaw": "^3.0.0",
|
||||
"livepush": "^3.5.1",
|
||||
"lodash": "^4.17.21",
|
||||
|
@ -1,24 +1,24 @@
|
||||
diff --git a/node_modules/@oclif/parser/lib/errors.js b/node_modules/@oclif/parser/lib/errors.js
|
||||
index 0c93a81..95d06be 100644
|
||||
index 39936e3..23e3925 100644
|
||||
--- a/node_modules/@oclif/parser/lib/errors.js
|
||||
+++ b/node_modules/@oclif/parser/lib/errors.js
|
||||
@@ -13,7 +13,8 @@ const m = deps_1.default()
|
||||
@@ -14,7 +14,8 @@ const m = deps_1.default()
|
||||
.add('list', () => require('./list'));
|
||||
class CLIParseError extends errors_1.CLIError {
|
||||
constructor(options) {
|
||||
- options.message += '\nSee more help with --help';
|
||||
+ const help = options.command ? `\`${options.command} --help\`` : '--help';
|
||||
+ options.message += `\nSee more help with ${help}`;
|
||||
+ const help = options.command ? `\`${options.command} --help\`` : '--help';
|
||||
+ options.message += `\nSee more help with ${help}`;
|
||||
super(options.message);
|
||||
this.parse = options.parse;
|
||||
}
|
||||
@@ -34,22 +35,24 @@ class InvalidArgsSpecError extends CLIParseError {
|
||||
@@ -35,22 +36,24 @@ class InvalidArgsSpecError extends CLIParseError {
|
||||
exports.InvalidArgsSpecError = InvalidArgsSpecError;
|
||||
class RequiredArgsError extends CLIParseError {
|
||||
constructor({ args, parse }) {
|
||||
- let message = `Missing ${args.length} required arg${args.length === 1 ? '' : 's'}`;
|
||||
+ const command = 'balena ' + parse.input.context.id.replace(/:/g, ' ');
|
||||
+ let message = `Missing ${args.length} required argument${args.length === 1 ? '' : 's'}`;
|
||||
+ const command = 'balena ' + parse.input.context.id.replace(/:/g, ' ');
|
||||
+ let message = `Missing ${args.length} required argument${args.length === 1 ? '' : 's'}`;
|
||||
const namedArgs = args.filter(a => a.name);
|
||||
if (namedArgs.length > 0) {
|
||||
const list = m.list.renderList(namedArgs.map(a => [a.name, a.description]));
|
||||
@ -32,7 +32,7 @@ index 0c93a81..95d06be 100644
|
||||
exports.RequiredArgsError = RequiredArgsError;
|
||||
class RequiredFlagError extends CLIParseError {
|
||||
constructor({ flag, parse }) {
|
||||
+ const command = 'balena ' + parse.input.context.id.replace(/:/g, ' ');
|
||||
+ const command = 'balena ' + parse.input.context.id.replace(/:/g, ' ');
|
||||
const usage = m.list.renderList(m.help.flagUsages([flag], { displayRequired: false }));
|
||||
const message = `Missing required flag:\n${usage}`;
|
||||
- super({ parse, message });
|
||||
@ -41,15 +41,15 @@ index 0c93a81..95d06be 100644
|
||||
}
|
||||
}
|
||||
diff --git a/node_modules/@oclif/parser/lib/list.js b/node_modules/@oclif/parser/lib/list.js
|
||||
index 3907cc0..b689ca1 100644
|
||||
index 9d020b7..6ea9eb9 100644
|
||||
--- a/node_modules/@oclif/parser/lib/list.js
|
||||
+++ b/node_modules/@oclif/parser/lib/list.js
|
||||
@@ -21,7 +21,7 @@ function renderList(items) {
|
||||
@@ -22,7 +22,7 @@ function renderList(items) {
|
||||
}
|
||||
left = left.padEnd(maxLength);
|
||||
right = linewrap(maxLength + 2, right);
|
||||
- return `${left} ${right}`;
|
||||
+ return `${left} : ${right}`;
|
||||
+ return `${left} : ${right}`;
|
||||
});
|
||||
return lines.join('\n');
|
||||
}
|
@ -1,15 +1,16 @@
|
||||
diff --git a/node_modules/open/index.js b/node_modules/open/index.js
|
||||
index 3bf5373..e042b64 100644
|
||||
index 13147d0..ff161dd 100644
|
||||
--- a/node_modules/open/index.js
|
||||
+++ b/node_modules/open/index.js
|
||||
@@ -11,7 +11,9 @@ const pAccess = promisify(fs.access);
|
||||
const pExecFile = promisify(childProcess.execFile);
|
||||
@@ -10,7 +10,10 @@ const pAccess = promisify(fs.access);
|
||||
const pReadFile = promisify(fs.readFile);
|
||||
|
||||
// Path to included `xdg-open`.
|
||||
-const localXdgOpenPath = path.join(__dirname, 'xdg-open');
|
||||
+const localXdgOpenPath = process.pkg
|
||||
+ ? path.join(path.dirname(process.execPath), 'xdg-open')
|
||||
+ : path.join(__dirname, 'xdg-open');
|
||||
+
|
||||
|
||||
// Convert a path from WSL format to Windows format:
|
||||
// `/mnt/c/Program Files/Example/MyApp.exe` → `C:\Program Files\Example\MyApp.exe`
|
||||
/**
|
||||
Get the mount point for fixed drives in WSL.
|
@ -178,7 +178,7 @@ async function startMockSshServer(): Promise<[Server, number]> {
|
||||
});
|
||||
|
||||
return await new Promise<[Server, number]>((resolve, reject) => {
|
||||
// TODO: remove 'as any' below. According to @types/node v14.18.36, the
|
||||
// TODO: remove 'as any' below. According to @types/node v16.18.25, the
|
||||
// callback type is `() => void`, but our code assumes `(err: Error) => void`
|
||||
const listener = (server.listen as any)(0, '127.0.0.1', (err: Error) => {
|
||||
// this callback is called for the 'listening' event
|
||||
|
@ -113,7 +113,7 @@ async function createProxyServer(): Promise<[number, number]> {
|
||||
let proxyPort = 0; // TCP port number, 0 means automatic allocation
|
||||
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
// TODO: remove 'as any' below. According to @types/node v14.18.36, the
|
||||
// TODO: remove 'as any' below. According to @types/node v16.18.25, the
|
||||
// callback type is `() => void`, but our code assumes `(err: Error) => void`
|
||||
const listener = (server.listen as any)(0, '127.0.0.1', (err: Error) => {
|
||||
if (err) {
|
||||
@ -197,7 +197,7 @@ async function createInterceptorServer(): Promise<number> {
|
||||
let interceptorPort = 0;
|
||||
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
// TODO: remove 'as any' below. According to @types/node v14.18.36, the
|
||||
// TODO: remove 'as any' below. According to @types/node v16.18.25, the
|
||||
// callback type is `() => void`, but our code assumes `(err: Error) => void`
|
||||
const listener = (server.listen as any)(0, '127.0.0.1', (err: Error) => {
|
||||
if (err) {
|
||||
|
@ -38,14 +38,6 @@
|
||||
The file must be distributed with executable as %2.
|
||||
%1: node_modules\etcher-sdk\node_modules\drivelist\scripts\win32.bat
|
||||
%2: path-to-executable/drivelist/win32.bat
|
||||
> Warning Cannot include file %1 into executable.
|
||||
The file must be distributed with executable as %2.
|
||||
%1: node_modules\patch-package\node_modules\open\xdg-open
|
||||
%2: path-to-executable/xdg-open
|
||||
> Warning Cannot include file %1 into executable.
|
||||
The file must be distributed with executable as %2.
|
||||
%1: node_modules\patch-package\node_modules\open\xdg-open
|
||||
%2: path-to-executable/xdg-open
|
||||
> Warning Cannot resolve 'path'
|
||||
node_modules\@balena\compose\dist\parse\schemas\index.js
|
||||
Dynamic require may fail at run time, because the requested file
|
||||
|
Loading…
Reference in New Issue
Block a user