diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 142f0e84..cbde6314 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -17,9 +17,9 @@ "@oclif/core": "^4.1.0", "@sentry/node": "^6.16.1", "balena-config-json": "^4.2.0", - "balena-device-init": "^8.1.0", + "balena-device-init": "^8.1.3", "balena-errors": "^4.7.3", - "balena-image-fs": "^7.0.6", + "balena-image-fs": "^7.3.0", "balena-preload": "^17.0.0", "balena-sdk": "^20.8.0", "balena-semver": "^2.3.0", @@ -2304,6 +2304,78 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@grpc/grpc-js": { + "version": "1.12.5", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.12.5.tgz", + "integrity": "sha512-d3iiHxdpg5+ZcJ6jnDSOT8Z0O0VMVGy34jAnYLUX8yd36b1qn8f1TwOA/Lc7TsOh03IkPJ38eGI5qD2EjNkoEA==", + "license": "Apache-2.0", + "dependencies": { + "@grpc/proto-loader": "^0.7.13", + "@js-sdsl/ordered-map": "^4.4.2" + }, + "engines": { + "node": ">=12.10.0" + } + }, + "node_modules/@grpc/proto-loader": { + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz", + "integrity": "sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==", + "license": "Apache-2.0", + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.2.5", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@grpc/proto-loader/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@grpc/proto-loader/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@grpc/proto-loader/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/@humanfs/core": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", @@ -2560,10 +2632,11 @@ } }, "node_modules/@inquirer/core/node_modules/@types/node": { - "version": "22.10.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.2.tgz", - "integrity": "sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==", + "version": "22.10.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.5.tgz", + "integrity": "sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ==", "dev": true, + "license": "MIT", "dependencies": { "undici-types": "~6.20.0" } @@ -3826,6 +3899,16 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@js-sdsl/ordered-map": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", + "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, "node_modules/@kwsites/file-exists": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz", @@ -4179,6 +4262,70 @@ "node": ">=12" } }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "license": "BSD-3-Clause" + }, "node_modules/@resin.io/types-hidepath": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@resin.io/types-hidepath/-/types-hidepath-1.0.1.tgz", @@ -5532,9 +5679,10 @@ } }, "node_modules/@types/node": { - "version": "20.17.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.10.tgz", - "integrity": "sha512-/jrvh5h6NXhEauFFexRin69nA0uHJ5gwk4iDivp/DeoEua3uwCUto6PC86IpRITBOs4+6i2I56K5x5b6WYGXHA==", + "version": "20.17.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.12.tgz", + "integrity": "sha512-vo/wmBgMIiEA23A/knMfn/cf37VnuF52nZh5ZoW0GWt4e4sxNquibrMRJ7UQsA06+MBx9r/H1jsI9grYjQCQlw==", + "license": "MIT", "dependencies": { "undici-types": "~6.19.2" } @@ -6538,10 +6686,11 @@ } }, "node_modules/archiver-utils/node_modules/readable-stream": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.6.0.tgz", - "integrity": "sha512-cbAdYt0VcnpN2Bekq7PU+k363ZRsPwJoEEJOEtSJQlJXzwaxt3FIo/uL+KeDSGIjJqtkwyge4KQgD2S2kd+CQw==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", + "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", "dev": true, + "license": "MIT", "dependencies": { "abort-controller": "^3.0.0", "buffer": "^6.0.3", @@ -6622,10 +6771,11 @@ } }, "node_modules/archiver/node_modules/readable-stream": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.6.0.tgz", - "integrity": "sha512-cbAdYt0VcnpN2Bekq7PU+k363ZRsPwJoEEJOEtSJQlJXzwaxt3FIo/uL+KeDSGIjJqtkwyge4KQgD2S2kd+CQw==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", + "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", "dev": true, + "license": "MIT", "dependencies": { "abort-controller": "^3.0.0", "buffer": "^6.0.3", @@ -7063,13 +7213,13 @@ } }, "node_modules/balena-device-init": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/balena-device-init/-/balena-device-init-8.1.0.tgz", - "integrity": "sha512-nOtrzTcLHhn8uDvZxRRGRGcH9Ry1IoQA86wFB9qK9xEii29f6sl+bti9fOvnDyPCZ1n3pLFFSStE8yN0fNKJQQ==", + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/balena-device-init/-/balena-device-init-8.1.3.tgz", + "integrity": "sha512-aOwS4ALvPIHl0ylaWDueezR9dvS736M056PfZ0sSHpz3cQjBYQ0hUdeh4P3KL7aObdvebnefpnOhFYGBbqIx/w==", "license": "Apache-2.0", "dependencies": { "balena-config-json": "^4.2.0", - "balena-image-fs": "^7.0.6", + "balena-image-fs": "^7.3.0", "balena-semver": "^2.2.0", "lodash": "^4.17.15", "reconfix": "1.0.0-v0-1-0-fork-46760acff4d165f5238bfac5e464256ef1944476", @@ -7116,9 +7266,10 @@ } }, "node_modules/balena-image-fs": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/balena-image-fs/-/balena-image-fs-7.2.0.tgz", - "integrity": "sha512-CRY0NEvpaueMK2dlRG5WJJxyTRMmCdPlg92kOru2nCNhOLg1pQ1LXSrcRVPcserUVGx7HRRwXSCoZ7XcehW9QQ==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/balena-image-fs/-/balena-image-fs-7.3.0.tgz", + "integrity": "sha512-EjdxwcrehXBMuKOYESx5sgXAJhWvPOPLV1UxnSmJ04G91zhzpYJMxUxgFEIMUNpXGcTw2uHMUL6ROnUA38W7hA==", + "license": "Apache-2.0", "dependencies": { "ext2fs": "^4.2.1", "fatfs": "^0.10.8", @@ -7221,9 +7372,10 @@ } }, "node_modules/balena-sdk/node_modules/@types/node": { - "version": "18.19.68", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.68.tgz", - "integrity": "sha512-QGtpFH1vB99ZmTa63K4/FU8twThj4fuVSBkGddTp7uIL/cuoLWIUSL2RcOaigBhfR+hg5pgGkBnkoOxrTVBMKw==", + "version": "18.19.70", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.70.tgz", + "integrity": "sha512-RE+K0+KZoEpDUbGGctnGdkrLFwi1eYKTlIHNl2Um98mUkGsm1u2Ff6Ltd0e8DktTtC98uy7rSj+hO8t/QuLoVQ==", + "license": "MIT", "dependencies": { "undici-types": "~5.26.4" } @@ -8278,10 +8430,11 @@ } }, "node_modules/compress-commons/node_modules/readable-stream": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.6.0.tgz", - "integrity": "sha512-cbAdYt0VcnpN2Bekq7PU+k363ZRsPwJoEEJOEtSJQlJXzwaxt3FIo/uL+KeDSGIjJqtkwyge4KQgD2S2kd+CQw==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", + "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", "dev": true, + "license": "MIT", "dependencies": { "abort-controller": "^3.0.0", "buffer": "^6.0.3", @@ -9149,9 +9302,10 @@ "integrity": "sha512-6+VnnhZpxwWvvKwjkRnuqlTtlBRJuM+3cCSXmZoYhyXcdgxx6l/3lwYpqmJ9qmhzgWVeATkpVsTua92BsObJjw==" }, "node_modules/docker-modem": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/docker-modem/-/docker-modem-5.0.3.tgz", - "integrity": "sha512-89zhop5YVhcPEt5FpUFGr3cDyceGhq/F9J+ZndQ4KfqNvfbJpPMfgeixFgUj5OjCYAboElqODxY5Z1EBsSa6sg==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/docker-modem/-/docker-modem-5.0.5.tgz", + "integrity": "sha512-Cxw8uEcvNTRmsQuGqzzfiCnfGgf96tVJItLh8taOX0miTcIBALKH5TckCSuZbpbjP7uhAl81dOL9sxfa6HgCIg==", + "license": "Apache-2.0", "dependencies": { "debug": "^4.1.1", "readable-stream": "^3.5.0", @@ -9197,13 +9351,18 @@ } }, "node_modules/dockerode": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/dockerode/-/dockerode-4.0.2.tgz", - "integrity": "sha512-9wM1BVpVMFr2Pw3eJNXrYYt6DT9k0xMcsSCjtPvyQ+xa1iPg/Mo3T/gUcwI0B2cczqCeCYRPF8yFYDwtFXT0+w==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/dockerode/-/dockerode-4.0.3.tgz", + "integrity": "sha512-QSXJFcBQNaGZO6U3qWW4B7p8yRIJn/dWmvL2AQWfO/bjptBBO6QYdVkYSYFz9qoivP2jsOHZfmXMAfrK0BMKyg==", + "license": "Apache-2.0", "dependencies": { "@balena/dockerignore": "^1.0.2", - "docker-modem": "^5.0.3", - "tar-fs": "~2.0.1" + "@grpc/grpc-js": "^1.11.1", + "@grpc/proto-loader": "^0.7.13", + "docker-modem": "^5.0.5", + "protobufjs": "^7.3.2", + "tar-fs": "~2.0.1", + "uuid": "^10.0.0" }, "engines": { "node": ">= 8.0" @@ -9220,6 +9379,19 @@ "tar-stream": "^2.0.0" } }, + "node_modules/dockerode/node_modules/uuid": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz", + "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -9717,7 +9889,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true, "engines": { "node": ">=6" } @@ -11305,7 +11476,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -13776,6 +13946,12 @@ "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", "dev": true }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "license": "MIT" + }, "node_modules/lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", @@ -13880,6 +14056,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", + "license": "Apache-2.0" + }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -16396,6 +16578,30 @@ "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=" }, + "node_modules/protobufjs": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz", + "integrity": "sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -16901,7 +17107,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -19890,7 +20095,6 @@ "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, "engines": { "node": ">=10" } @@ -20079,10 +20283,11 @@ } }, "node_modules/zip-stream/node_modules/readable-stream": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.6.0.tgz", - "integrity": "sha512-cbAdYt0VcnpN2Bekq7PU+k363ZRsPwJoEEJOEtSJQlJXzwaxt3FIo/uL+KeDSGIjJqtkwyge4KQgD2S2kd+CQw==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", + "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", "dev": true, + "license": "MIT", "dependencies": { "abort-controller": "^3.0.0", "buffer": "^6.0.3", diff --git a/package.json b/package.json index ab9562ad..01607e2b 100644 --- a/package.json +++ b/package.json @@ -196,9 +196,9 @@ "@oclif/core": "^4.1.0", "@sentry/node": "^6.16.1", "balena-config-json": "^4.2.0", - "balena-device-init": "^8.1.0", + "balena-device-init": "^8.1.3", "balena-errors": "^4.7.3", - "balena-image-fs": "^7.0.6", + "balena-image-fs": "^7.3.0", "balena-preload": "^17.0.0", "balena-sdk": "^20.8.0", "balena-semver": "^2.3.0", diff --git a/repo.yml b/repo.yml index ed599b7b..c777c1eb 100644 --- a/repo.yml +++ b/repo.yml @@ -6,6 +6,8 @@ upstream: url: 'https://github.com/balena-io/balena-sdk' - repo: 'balena-config-json' url: 'https://github.com/balena-io-modules/balena-config-json' + - repo: 'balena-image-fs' + url: 'https://github.com/balena-io-modules/balena-image-fs' - repo: 'balena-device-init' url: 'https://github.com/balena-io-modules/balena-device-init' - repo: 'balena-image-manager' diff --git a/src/commands/local/configure.ts b/src/commands/local/configure.ts index 1206edef..691bc28d 100644 --- a/src/commands/local/configure.ts +++ b/src/commands/local/configure.ts @@ -16,7 +16,6 @@ */ import { Args, Command } from '@oclif/core'; -import { promisify } from 'util'; import { stripIndent } from '../../utils/lazy'; export default class LocalConfigureCmd extends Command { @@ -237,7 +236,7 @@ export default class LocalConfigureCmd extends Command { const bootPartition = await getBootPartition(target); const files = await imagefs.interact(target, bootPartition, async (_fs) => { - return await promisify(_fs.readdir)(this.CONNECTIONS_FOLDER); + return await _fs.promises.readdir(this.CONNECTIONS_FOLDER); }); let connectionFileName; @@ -246,13 +245,14 @@ export default class LocalConfigureCmd extends Command { } else if (_.includes(files, 'resin-sample.ignore')) { // Fresh image, new mode, accoding to https://github.com/balena-os/meta-balena/pull/770/files await imagefs.interact(target, bootPartition, async (_fs) => { - const readFileAsync = promisify(_fs.readFile); - const writeFileAsync = promisify(_fs.writeFile); - const contents = await readFileAsync( + const contents = await _fs.promises.readFile( `${this.CONNECTIONS_FOLDER}/resin-sample.ignore`, { encoding: 'utf8' }, ); - await writeFileAsync(`${this.CONNECTIONS_FOLDER}/resin-wifi`, contents); + await _fs.promises.writeFile( + `${this.CONNECTIONS_FOLDER}/resin-wifi`, + contents, + ); }); } else if (_.includes(files, 'resin-sample')) { // Legacy mode, to be removed later @@ -266,7 +266,7 @@ export default class LocalConfigureCmd extends Command { } else { // In case there's no file at all (shouldn't happen normally, but the file might have been removed) await imagefs.interact(target, bootPartition, async (_fs) => { - await promisify(_fs.writeFile)( + await _fs.promises.writeFile( `${this.CONNECTIONS_FOLDER}/resin-wifi`, this.CONNECTION_FILE, ); diff --git a/src/commands/os/configure.ts b/src/commands/os/configure.ts index c3157c9a..3d9640ce 100644 --- a/src/commands/os/configure.ts +++ b/src/commands/os/configure.ts @@ -18,7 +18,6 @@ import { Flags, Args, Command } from '@oclif/core'; import type { Interfaces } from '@oclif/core'; import type * as BalenaSdk from 'balena-sdk'; -import { promisify } from 'util'; import * as _ from 'lodash'; import { ExpectedError } from '../../errors'; import * as cf from '../../utils/common-flags'; @@ -292,7 +291,7 @@ export default class OsConfigureCmd extends Command { for (const { name, content } of files) { await imagefs.interact(image, bootPartition, async (_fs) => { - await promisify(_fs.writeFile)( + await _fs.promises.writeFile( path.join(CONNECTIONS_FOLDER, name), content, ); diff --git a/tests/commands/os/configure.spec.ts b/tests/commands/os/configure.spec.ts index 3d356ba1..14be6518 100644 --- a/tests/commands/os/configure.spec.ts +++ b/tests/commands/os/configure.spec.ts @@ -62,20 +62,22 @@ if (process.platform !== 'win32') { tmpNonMatchingDtJsonPartitionPath, 12, async (_fs) => { - const readFileAsync = promisify(_fs.readFile); - const writeFileAsync = promisify(_fs.writeFile); - const dtJson = JSON.parse( - await readFileAsync('/device-type.json', { encoding: 'utf8' }), + await _fs.promises.readFile('/device-type.json', { + encoding: 'utf8', + }), ); expect(dtJson).to.have.nested.property( 'configuration.config.partition', 12, ); dtJson.configuration.config.partition = 999; - await writeFileAsync('/device-type.json', JSON.stringify(dtJson)); + await _fs.promises.writeFile( + '/device-type.json', + JSON.stringify(dtJson), + ); - await writeFileAsync( + await _fs.promises.writeFile( '/os-release', stripIndent` ID="balena-os" @@ -133,16 +135,17 @@ if (process.platform !== 'win32') { tmpMatchingDtJsonPartitionPath, 12, async (_fs) => { - const readFileAsync = promisify(_fs.readFile); const dtJson = JSON.parse( - await readFileAsync('/device-type.json', { encoding: 'utf8' }), + await _fs.promises.readFile('/device-type.json', { + encoding: 'utf8', + }), ); // confirm that the device-type.json mentions the expected partition expect(dtJson).to.have.nested.property( 'configuration.config.partition', 12, ); - return await readFileAsync('/config.json'); + return await _fs.promises.readFile('/config.json'); }, ); expect(config).to.not.be.empty; @@ -180,16 +183,17 @@ if (process.platform !== 'win32') { tmpNonMatchingDtJsonPartitionPath, 12, async (_fs) => { - const readFileAsync = promisify(_fs.readFile); const dtJson = JSON.parse( - await readFileAsync('/device-type.json', { encoding: 'utf8' }), + await _fs.promises.readFile('/device-type.json', { + encoding: 'utf8', + }), ); // confirm that the device-type.json mentions the expected partition expect(dtJson).to.have.nested.property( 'configuration.config.partition', 999, ); - return await readFileAsync('/config.json'); + return await _fs.promises.readFile('/config.json'); }, ); expect(config).to.not.be.empty; @@ -240,7 +244,7 @@ if (process.platform !== 'win32') { // confirm the image contains a config.json... const config = await imagefs.interact(tmpDummyPath, 1, async (_fs) => { - return await promisify(_fs.readFile)('/config.json'); + return await _fs.promises.readFile('/config.json'); }); expect(config).to.not.be.empty;