From 3a31275b20968b5bfcd603eb88af579b31856363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ot=C3=A1vio=20Jacobi?= Date: Wed, 11 Oct 2023 15:47:52 -0300 Subject: [PATCH] **BREAKING**: Drop support to node < 18 Update balena-request from 12.0.4 to 13.0.0 Update balena-register-device from 8.0.7 to 9.0.1 Change-type: major --- .eslintrc.js | 3 +++ .github/actions/test/action.yml | 2 +- README.md | 2 +- mjs_tests/index.mjs | 1 - package.json | 10 +++++----- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 300d4188e..178c20965 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -4,6 +4,9 @@ module.exports = { project: 'tsconfig.dev.json', sourceType: 'module', }, + env: { + jest: true, + }, root: true, rules: { 'no-restricted-imports': ['error', 'date-fns', 'lodash'], diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index dfa679a40..1d1686850 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -12,7 +12,7 @@ inputs: runs: using: "composite" steps: - - name: Setup Node.js 16 + - name: Setup Node.js 18 if: ${{ env.os_value == 'ubuntu-20.04' }} uses: actions/setup-node@v3 with: diff --git a/README.md b/README.md index 7de206652..74e0e1ef8 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ $ npm install --save balena-sdk ## Platforms -We currently support NodeJS (16+) and the browser. +We currently support NodeJS (18+) and the browser. The following features are node-only: - OS image streaming download (`balena.models.os.download`), diff --git a/mjs_tests/index.mjs b/mjs_tests/index.mjs index ea5221edf..879d99f01 100644 --- a/mjs_tests/index.mjs +++ b/mjs_tests/index.mjs @@ -2,7 +2,6 @@ import 'mjs-mocha'; import chai from 'chai'; const { expect } = chai; -// TODO: Make `npm run test:mjs-imports` part of `npm test` once we bump to node 16. describe('mjs imports', function () { it('should support using default imports', async function () { await import('./import_default.mjs'); diff --git a/package.json b/package.json index 596782e69..a71038d81 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "clean": "rimraf es2015 es2018", "test:fast": "npm run lint:fix && npm run build-es2015:fast && npm run test:node", "test": "([ \"$GITHUB_WORKFLOW\" = 'Flowzone' ] && [ \"$GITHUB_JOB\" = 'npm_test' ] && echo \"Skipping 'npm test' in flowzone in favor of the custom test action!\") || (npm run build && npm run test:all)", - "test:all": "npm run test:ts-compatibility && npm run test:dev && npm run test:ts-js && npm run test:typings && npm run test:node && npm run test:browser", + "test:all": "npm run test:ts-compatibility && npm run test:dev && npm run test:ts-js && npm run test:typings && npm run test:mjs-imports && npm run test:node && npm run test:browser", "test:node": "gulp test", "test:browser": "mockttp -c karma start", "test:dev": "tsc --noEmit --project ./tsconfig.dev.json", @@ -61,7 +61,7 @@ "author": "Juan Cruz Viotti ", "license": "Apache-2.0", "engines": { - "node": ">=16.0" + "node": ">=18.0" }, "devDependencies": { "@balena/lint": "^7.2.0", @@ -119,13 +119,13 @@ "dependencies": { "@balena/es-version": "^1.0.0", "@types/json-schema": "^7.0.9", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "abortcontroller-polyfill": "^1.7.1", "balena-auth": "^5.1.0", "balena-errors": "^4.8.0", "balena-hup-action-utils": "~5.0.0", - "balena-register-device": "^8.0.7", - "balena-request": "^12.0.4", + "balena-register-device": "^9.0.1", + "balena-request": "^13.0.0", "balena-semver": "^2.3.0", "balena-settings-client": "^5.0.0", "date-fns": "^2.29.3",