mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-18 13:26:26 +00:00
Update typescript to v5
This also updates code to use the default import syntax instead of `import * as` when the imported module exposes a default. This is needed with the latest typescript version. Change-type: patch
This commit is contained in:
parent
3c546aa199
commit
6217546894
72
package-lock.json
generated
72
package-lock.json
generated
@ -28,6 +28,7 @@
|
||||
"@types/event-stream": "^3.3.34",
|
||||
"@types/express": "^4.17.14",
|
||||
"@types/json-mask": "2.0.3",
|
||||
"@types/JSONStream": "npm:@types/jsonstream@^0.8.33",
|
||||
"@types/lodash": "^4.14.186",
|
||||
"@types/memoizee": "^0.4.8",
|
||||
"@types/mocha": "^8.2.3",
|
||||
@ -73,6 +74,7 @@
|
||||
"io-ts": "^2.2.10",
|
||||
"io-ts-reporters": "^1.2.2",
|
||||
"json-mask": "^0.3.9",
|
||||
"JSONStream": "^1.3.5",
|
||||
"knex": "^2.5.1",
|
||||
"lint-staged": "^13.0.3",
|
||||
"livepush": "^3.5.1",
|
||||
@ -108,7 +110,7 @@
|
||||
"ts-node": "^8.10.2",
|
||||
"tsconfig-paths": "^4.1.0",
|
||||
"typed-error": "^3.2.1",
|
||||
"typescript": "^4.8.4",
|
||||
"typescript": "^5.3.3",
|
||||
"webpack": "^5.74.0",
|
||||
"webpack-cli": "^4.10.0",
|
||||
"winston": "^3.3.3",
|
||||
@ -1105,19 +1107,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/@balena/lint/node_modules/typescript": {
|
||||
"version": "5.3.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
|
||||
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/@balena/lint/node_modules/y18n": {
|
||||
"version": "5.0.8",
|
||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
|
||||
@ -2079,10 +2068,11 @@
|
||||
"integrity": "sha512-vuL/tG01yKO//gmCmnV3OZhx2hs538t+7FpQq//sUV1sF6xiKi5V8F60dvAxe/HkC4+QaMCHqrm/akqlppTAkQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/jsonstream": {
|
||||
"version": "0.8.30",
|
||||
"resolved": "https://registry.npmjs.org/@types/jsonstream/-/jsonstream-0.8.30.tgz",
|
||||
"integrity": "sha512-KqHs2eAapKL7ZKUiKI/giUYPVgkoDXkVGFehk3goo+3Q8qwxVVRC3iwg+hK/THORbcri4RRxTtlm3JoSY1KZLQ==",
|
||||
"node_modules/@types/JSONStream": {
|
||||
"name": "@types/jsonstream",
|
||||
"version": "0.8.33",
|
||||
"resolved": "https://registry.npmjs.org/@types/jsonstream/-/jsonstream-0.8.33.tgz",
|
||||
"integrity": "sha512-yhg1SNOgJ8y2nOkvAQ1zZ1Z2xibxgFs7984+EeBPuWgo/TbuYo79+rj2wUVch3KF4GhhcwAi/AlJcehmLCXb3g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
@ -12785,6 +12775,15 @@
|
||||
"tar-stream": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/resin-docker-build/node_modules/@types/jsonstream": {
|
||||
"version": "0.8.33",
|
||||
"resolved": "https://registry.npmjs.org/@types/jsonstream/-/jsonstream-0.8.33.tgz",
|
||||
"integrity": "sha512-yhg1SNOgJ8y2nOkvAQ1zZ1Z2xibxgFs7984+EeBPuWgo/TbuYo79+rj2wUVch3KF4GhhcwAi/AlJcehmLCXb3g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/resin-docker-build/node_modules/@types/node": {
|
||||
"version": "10.17.28",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.28.tgz",
|
||||
@ -15031,16 +15030,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "4.8.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
|
||||
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
|
||||
"version": "5.3.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
|
||||
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.2.0"
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/uglify-js": {
|
||||
@ -16969,12 +16968,6 @@
|
||||
"integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
|
||||
"dev": true
|
||||
},
|
||||
"typescript": {
|
||||
"version": "5.3.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
|
||||
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
|
||||
"dev": true
|
||||
},
|
||||
"y18n": {
|
||||
"version": "5.0.8",
|
||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
|
||||
@ -17748,10 +17741,10 @@
|
||||
"integrity": "sha512-vuL/tG01yKO//gmCmnV3OZhx2hs538t+7FpQq//sUV1sF6xiKi5V8F60dvAxe/HkC4+QaMCHqrm/akqlppTAkQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/jsonstream": {
|
||||
"version": "0.8.30",
|
||||
"resolved": "https://registry.npmjs.org/@types/jsonstream/-/jsonstream-0.8.30.tgz",
|
||||
"integrity": "sha512-KqHs2eAapKL7ZKUiKI/giUYPVgkoDXkVGFehk3goo+3Q8qwxVVRC3iwg+hK/THORbcri4RRxTtlm3JoSY1KZLQ==",
|
||||
"@types/JSONStream": {
|
||||
"version": "npm:@types/jsonstream@0.8.33",
|
||||
"resolved": "https://registry.npmjs.org/@types/jsonstream/-/jsonstream-0.8.33.tgz",
|
||||
"integrity": "sha512-yhg1SNOgJ8y2nOkvAQ1zZ1Z2xibxgFs7984+EeBPuWgo/TbuYo79+rj2wUVch3KF4GhhcwAi/AlJcehmLCXb3g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": "*"
|
||||
@ -26014,6 +26007,15 @@
|
||||
"tar-stream": "^2.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/jsonstream": {
|
||||
"version": "0.8.33",
|
||||
"resolved": "https://registry.npmjs.org/@types/jsonstream/-/jsonstream-0.8.33.tgz",
|
||||
"integrity": "sha512-yhg1SNOgJ8y2nOkvAQ1zZ1Z2xibxgFs7984+EeBPuWgo/TbuYo79+rj2wUVch3KF4GhhcwAi/AlJcehmLCXb3g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "10.17.28",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.28.tgz",
|
||||
@ -27734,9 +27736,9 @@
|
||||
}
|
||||
},
|
||||
"typescript": {
|
||||
"version": "4.8.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
|
||||
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
|
||||
"version": "5.3.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
|
||||
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
|
||||
"dev": true
|
||||
},
|
||||
"uglify-js": {
|
||||
|
@ -54,6 +54,7 @@
|
||||
"@types/event-stream": "^3.3.34",
|
||||
"@types/express": "^4.17.14",
|
||||
"@types/json-mask": "2.0.3",
|
||||
"@types/JSONStream": "npm:@types/jsonstream@^0.8.33",
|
||||
"@types/lodash": "^4.14.186",
|
||||
"@types/memoizee": "^0.4.8",
|
||||
"@types/mocha": "^8.2.3",
|
||||
@ -99,6 +100,7 @@
|
||||
"io-ts": "^2.2.10",
|
||||
"io-ts-reporters": "^1.2.2",
|
||||
"json-mask": "^0.3.9",
|
||||
"JSONStream": "^1.3.5",
|
||||
"knex": "^2.5.1",
|
||||
"lint-staged": "^13.0.3",
|
||||
"livepush": "^3.5.1",
|
||||
@ -134,7 +136,7 @@
|
||||
"ts-node": "^8.10.2",
|
||||
"tsconfig-paths": "^4.1.0",
|
||||
"typed-error": "^3.2.1",
|
||||
"typescript": "^4.8.4",
|
||||
"typescript": "^5.3.3",
|
||||
"webpack": "^5.74.0",
|
||||
"webpack-cli": "^4.10.0",
|
||||
"winston": "^3.3.3",
|
||||
|
@ -1,10 +1,10 @@
|
||||
import * as Bluebird from 'bluebird';
|
||||
import Bluebird from 'bluebird';
|
||||
import { stripIndent } from 'common-tags';
|
||||
import { isLeft } from 'fp-ts/lib/Either';
|
||||
import * as t from 'io-ts';
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import { PinejsClientRequest } from 'pinejs-client-request';
|
||||
import * as url from 'url';
|
||||
import url from 'url';
|
||||
|
||||
import * as config from '../config';
|
||||
import * as deviceConfig from '../device-config';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as url from 'url';
|
||||
import url from 'url';
|
||||
import type { CoreOptions } from 'request';
|
||||
import { performance } from 'perf_hooks';
|
||||
import { setTimeout } from 'timers/promises';
|
||||
|
@ -3,7 +3,7 @@ import { set } from '@balena/es-version';
|
||||
set('es2019');
|
||||
|
||||
import { NOTFOUND } from 'dns';
|
||||
import * as mdnsResolver from 'mdns-resolver';
|
||||
import mdnsResolver from 'mdns-resolver';
|
||||
|
||||
class DnsLookupError extends Error {
|
||||
public constructor(public code: string = NOTFOUND) {
|
||||
@ -144,7 +144,7 @@ async function mdnsLookup(
|
||||
|
||||
import '@balena/happy-eyeballs/eye-patch';
|
||||
import Supervisor from './supervisor';
|
||||
import * as process from 'process';
|
||||
import process from 'process';
|
||||
import log from './lib/supervisor-console';
|
||||
|
||||
// Register signal handlers before starting the supervisor service
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import { promises as fs } from 'fs';
|
||||
import type { ImageInspectInfo } from 'dockerode';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import { EventEmitter } from 'events';
|
||||
import type StrictEventEmitter from 'strict-event-emitter-types';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import * as config from '../config';
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type * as Docker from 'dockerode';
|
||||
import type Docker from 'dockerode';
|
||||
import { EventEmitter } from 'events';
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import type StrictEventEmitter from 'strict-event-emitter-types';
|
||||
|
||||
import * as config from '../config';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import * as constants from '../lib/constants';
|
||||
import { docker } from '../lib/docker-utils';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as _ from 'lodash';
|
||||
import type * as dockerode from 'dockerode';
|
||||
import _ from 'lodash';
|
||||
import type dockerode from 'dockerode';
|
||||
|
||||
import { docker } from '../lib/docker-utils';
|
||||
import logTypes = require('../lib/log-types');
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import { TypedError } from 'typed-error';
|
||||
|
||||
// Adapted from https://github.com/docker/docker-py/blob/master/docker/utils/ports.py#L3
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import type { ConfigMap, ServiceComposeConfig } from './types/service';
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import type * as Dockerode from 'dockerode';
|
||||
import type Dockerode from 'dockerode';
|
||||
import { EventEmitter } from 'events';
|
||||
import { isLeft } from 'fp-ts/lib/Either';
|
||||
import * as JSONStream from 'JSONStream';
|
||||
import * as _ from 'lodash';
|
||||
import JSONStream from 'JSONStream';
|
||||
import _ from 'lodash';
|
||||
import { promises as fs } from 'fs';
|
||||
import type StrictEventEmitter from 'strict-event-emitter-types';
|
||||
|
||||
@ -390,7 +390,7 @@ export function listenToEvents() {
|
||||
stream.on('error', (e) => {
|
||||
log.error(`Error on docker events stream:`, e);
|
||||
});
|
||||
const parser = JSONStream.parse();
|
||||
const parser = JSONStream.parse(true);
|
||||
parser.on('data', async (data: { status: string; id: string }) => {
|
||||
if (data != null) {
|
||||
const status = data.status;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { detailedDiff as diff } from 'deep-object-diff';
|
||||
import type * as Dockerode from 'dockerode';
|
||||
import type Dockerode from 'dockerode';
|
||||
import Duration = require('duration-js');
|
||||
import * as _ from 'lodash';
|
||||
import * as path from 'path';
|
||||
import _ from 'lodash';
|
||||
import path from 'path';
|
||||
|
||||
import type { DockerPortOptions } from './ports';
|
||||
import { PortMap } from './ports';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type * as Dockerode from 'dockerode';
|
||||
import * as t from 'io-ts';
|
||||
import type Dockerode from 'dockerode';
|
||||
import { isAbsolute } from 'path';
|
||||
|
||||
import type { PortMap } from '../ports';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type * as Dockerode from 'dockerode';
|
||||
import type Dockerode from 'dockerode';
|
||||
import Duration = require('duration-js');
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import { parse as parseCommand } from 'shell-quote';
|
||||
|
||||
import * as constants from '../lib/constants';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as _ from 'lodash';
|
||||
import * as path from 'path';
|
||||
import _ from 'lodash';
|
||||
import path from 'path';
|
||||
import type { VolumeInspectInfo } from 'dockerode';
|
||||
|
||||
import { isNotFoundError, InternalInconsistencyError } from '../lib/errors';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type * as Docker from 'dockerode';
|
||||
import type Docker from 'dockerode';
|
||||
import isEqual = require('lodash/isEqual');
|
||||
import omitBy = require('lodash/omitBy');
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import { promises as fs } from 'fs';
|
||||
import * as path from 'path';
|
||||
import path from 'path';
|
||||
|
||||
import type { ConfigOptions } from './backend';
|
||||
import { ConfigBackend } from './backend';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import type { ConfigOptions } from './backend';
|
||||
import { ConfigBackend } from './backend';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import type { ConfigOptions } from './backend';
|
||||
import {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as _ from 'lodash';
|
||||
import * as semver from 'semver';
|
||||
import _ from 'lodash';
|
||||
import semver from 'semver';
|
||||
|
||||
import type { ConfigOptions } from './backend';
|
||||
import { ConfigBackend } from './backend';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import type { ConfigOptions } from './backend';
|
||||
import { ConfigBackend } from './backend';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import { promises as fs } from 'fs';
|
||||
|
||||
import type { ConfigOptions } from './backend';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import { promises as fs } from 'fs';
|
||||
import * as path from 'path';
|
||||
import path from 'path';
|
||||
|
||||
import * as constants from '../../lib/constants';
|
||||
import { exists } from '../../lib/fs-utils';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as Bluebird from 'bluebird';
|
||||
import * as _ from 'lodash';
|
||||
import Bluebird from 'bluebird';
|
||||
import _ from 'lodash';
|
||||
|
||||
import * as constants from '../lib/constants';
|
||||
import * as hostUtils from '../lib/host-utils';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as _ from 'lodash';
|
||||
import * as memoizee from 'memoizee';
|
||||
import _ from 'lodash';
|
||||
import memoizee from 'memoizee';
|
||||
|
||||
import supervisorVersion = require('../lib/supervisor-version');
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { EventEmitter } from 'events';
|
||||
import type { Knex } from 'knex';
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import type StrictEventEmitter from 'strict-event-emitter-types';
|
||||
import { inspect } from 'util';
|
||||
import { generateUniqueKey } from '../lib/register-device';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { either, isRight } from 'fp-ts/lib/Either';
|
||||
import * as t from 'io-ts';
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import { InternalInconsistencyError } from '../lib/errors';
|
||||
import { checkBooleanish, checkTruthy } from '../lib/validation';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as _ from 'lodash';
|
||||
import * as Bluebird from 'bluebird';
|
||||
import _ from 'lodash';
|
||||
import Bluebird from 'bluebird';
|
||||
|
||||
import * as config from '../config';
|
||||
import * as constants from '../lib/constants';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import type { Knex } from 'knex';
|
||||
import { knex } from 'knex';
|
||||
import * as path from 'path';
|
||||
import * as _ from 'lodash';
|
||||
import path from 'path';
|
||||
import _ from 'lodash';
|
||||
|
||||
import * as constants from './lib/constants';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import { getGlobalApiKey, refreshKey } from '.';
|
||||
import * as messages from './messages';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as _ from 'lodash';
|
||||
import type * as express from 'express';
|
||||
import * as memoizee from 'memoizee';
|
||||
import _ from 'lodash';
|
||||
import type express from 'express';
|
||||
import memoizee from 'memoizee';
|
||||
import { TypedError } from 'typed-error';
|
||||
|
||||
import * as db from '../db';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as express from 'express';
|
||||
import express from 'express';
|
||||
|
||||
import * as middleware from './middleware';
|
||||
import * as apiKeys from './api-keys';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import { UpdatesLockedError } from '../../lib/errors';
|
||||
import log from '../../lib/supervisor-console';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as morgan from 'morgan';
|
||||
import morgan from 'morgan';
|
||||
import type { Request } from 'express';
|
||||
|
||||
import log from '../../lib/supervisor-console';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as express from 'express';
|
||||
import express from 'express';
|
||||
import type { Response } from 'express';
|
||||
|
||||
import * as actions from './actions';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as express from 'express';
|
||||
import express from 'express';
|
||||
import type { Response, NextFunction } from 'express';
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import * as deviceState from '../device-state';
|
||||
import * as apiBinder from '../api-binder';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import { inspect } from 'util';
|
||||
import { promises as fs } from 'fs';
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
import * as Bluebird from 'bluebird';
|
||||
import Bluebird from 'bluebird';
|
||||
import { stripIndent } from 'common-tags';
|
||||
import { EventEmitter } from 'events';
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import type StrictEventEmitter from 'strict-event-emitter-types';
|
||||
import { isRight } from 'fp-ts/lib/Either';
|
||||
import Reporter from 'io-ts-reporters';
|
||||
import prettyMs = require('pretty-ms');
|
||||
import prettyMs from 'pretty-ms';
|
||||
|
||||
import * as config from './config';
|
||||
import * as db from './db';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import type * as db from '../db';
|
||||
import * as targetStateCache from './target-state-cache';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import type { TargetAppsV2 } from '../lib/legacy';
|
||||
import { fromV2TargetApps } from '../lib/legacy';
|
||||
import type { AppsJsonFormat, TargetApp, TargetRelease } from '../types';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import { promises as fs } from 'fs';
|
||||
|
||||
import type { Image } from '../compose/images';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import * as config from '../config';
|
||||
import * as db from '../db';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { EventEmitter } from 'events';
|
||||
import * as url from 'url';
|
||||
import url from 'url';
|
||||
import { setTimeout } from 'timers/promises';
|
||||
import * as Bluebird from 'bluebird';
|
||||
import Bluebird from 'bluebird';
|
||||
import type StrictEventEmitter from 'strict-event-emitter-types';
|
||||
|
||||
import type { TargetState } from '../types/state';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { EventEmitter } from 'events';
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import type StrictEventEmitter from 'strict-event-emitter-types';
|
||||
import type { TargetState } from './types/state';
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { stripIndent } from 'common-tags';
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import { promises as fs } from 'fs';
|
||||
import * as path from 'path';
|
||||
import path from 'path';
|
||||
|
||||
import * as config from './config';
|
||||
import * as applicationManager from './compose/application-manager';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { PinejsClientRequest } from 'pinejs-client-request';
|
||||
|
||||
import * as Bluebird from 'bluebird';
|
||||
import Bluebird from 'bluebird';
|
||||
import * as config from '../config';
|
||||
import * as eventTracker from '../event-tracker';
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import * as config from '../config';
|
||||
import * as dbus from './dbus';
|
||||
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import log from './supervisor-console';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as path from 'path';
|
||||
import path from 'path';
|
||||
import { checkString } from './validation';
|
||||
|
||||
const supervisorNetworkInterface = 'supervisor0';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { isLeft } from 'fp-ts/lib/Either';
|
||||
import * as t from 'io-ts';
|
||||
import Reporter from 'io-ts-reporters';
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import { Blueprint, Contract, ContractObject } from '@balena/contrato';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import type { EnvVarObject } from '../types';
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import type { ProgressCallback } from 'docker-progress';
|
||||
import { DockerProgress } from 'docker-progress';
|
||||
import * as Dockerode from 'dockerode';
|
||||
import * as _ from 'lodash';
|
||||
import * as memoizee from 'memoizee';
|
||||
import Dockerode from 'dockerode';
|
||||
import _ from 'lodash';
|
||||
import memoizee from 'memoizee';
|
||||
|
||||
import { applyDelta, OutOfSyncError } from 'docker-delta';
|
||||
import DockerToolbelt = require('docker-toolbelt');
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import * as config from '../config/index';
|
||||
import * as constants from './constants';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { promises as fs } from 'fs';
|
||||
import * as path from 'path';
|
||||
import path from 'path';
|
||||
import { exec as execSync } from 'child_process';
|
||||
import { promisify } from 'util';
|
||||
import { uptime } from 'os';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { spawn } from 'child_process';
|
||||
import * as path from 'path';
|
||||
import path from 'path';
|
||||
import * as constants from './constants';
|
||||
import { exec, exists } from './fs-utils';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import { spawn } from 'child_process';
|
||||
import { Readable } from 'stream';
|
||||
import { TypedError } from 'typed-error';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { promises as fs, unlinkSync, rmdirSync } from 'fs';
|
||||
import * as os from 'os';
|
||||
import os from 'os';
|
||||
import { dirname } from 'path';
|
||||
|
||||
import { exec } from './fs-utils';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import { promises as fs } from 'fs';
|
||||
import * as path from 'path';
|
||||
import path from 'path';
|
||||
import { TypedError } from 'typed-error';
|
||||
|
||||
import log from './supervisor-console';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { promises as fs } from 'fs';
|
||||
import * as path from 'path';
|
||||
import path from 'path';
|
||||
|
||||
import * as volumeManager from '../compose/volume-manager';
|
||||
import * as deviceState from '../device-state';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import { promises as fs } from 'fs';
|
||||
|
||||
import { InternalInconsistencyError } from './errors';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import * as Bluebird from 'bluebird';
|
||||
import Bluebird from 'bluebird';
|
||||
import once = require('lodash/once');
|
||||
import * as requestLib from 'request';
|
||||
import * as resumableRequestLib from 'resumable-request';
|
||||
import requestLib from 'request';
|
||||
import resumableRequestLib from 'resumable-request';
|
||||
|
||||
import * as constants from './constants';
|
||||
import * as osRelease from './os-release';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import type { TransformableInfo } from 'logform';
|
||||
import * as winston from 'winston';
|
||||
import winston from 'winston';
|
||||
|
||||
const levels = {
|
||||
error: 0,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import * as packageJson from '../../package.json';
|
||||
let version = packageJson.version;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as systeminformation from 'systeminformation';
|
||||
import * as _ from 'lodash';
|
||||
import * as memoizee from 'memoizee';
|
||||
import systeminformation from 'systeminformation';
|
||||
import _ from 'lodash';
|
||||
import memoizee from 'memoizee';
|
||||
import { promises as fs } from 'fs';
|
||||
|
||||
import { exec } from './fs-utils';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import * as Bluebird from 'bluebird';
|
||||
import Bluebird from 'bluebird';
|
||||
import { promises as fs } from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as Lock from 'rwlock';
|
||||
import path from 'path';
|
||||
import Lock from 'rwlock';
|
||||
import { isRight } from 'fp-ts/lib/Either';
|
||||
|
||||
import {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { isRight } from 'fp-ts/lib/Either';
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import { DeviceName } from '../types';
|
||||
export interface CheckIntOptions {
|
||||
positive?: boolean;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import * as config from './config';
|
||||
import * as db from './db';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as Bluebird from 'bluebird';
|
||||
import * as _ from 'lodash';
|
||||
import Bluebird from 'bluebird';
|
||||
import _ from 'lodash';
|
||||
|
||||
import * as config from './config';
|
||||
import * as db from './db';
|
||||
|
@ -1,9 +1,9 @@
|
||||
import type { ClientRequest } from 'http';
|
||||
import * as https from 'https';
|
||||
import * as _ from 'lodash';
|
||||
import * as stream from 'stream';
|
||||
import * as url from 'url';
|
||||
import * as zlib from 'zlib';
|
||||
import https from 'https';
|
||||
import _ from 'lodash';
|
||||
import stream from 'stream';
|
||||
import url from 'url';
|
||||
import zlib from 'zlib';
|
||||
|
||||
import type { LogMessage } from './log-backend';
|
||||
import { LogBackend } from './log-backend';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import { Readable } from 'stream';
|
||||
import { checkInt } from '../lib/validation';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as JSONstream from 'JSONStream';
|
||||
import JSONstream from 'JSONStream';
|
||||
|
||||
import * as db from '../db';
|
||||
import { spawnJournalctl, toJournalDate } from '../lib/journald';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as Bluebird from 'bluebird';
|
||||
import * as _ from 'lodash';
|
||||
import Bluebird from 'bluebird';
|
||||
import _ from 'lodash';
|
||||
|
||||
const tryParse = function (obj) {
|
||||
try {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as fs from 'fs';
|
||||
import fs from 'fs';
|
||||
const configJsonPath = process.env.CONFIG_MOUNT_POINT;
|
||||
|
||||
exports.up = function (knex) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as Bluebird from 'bluebird';
|
||||
import * as fs from 'fs';
|
||||
import Bluebird from 'bluebird';
|
||||
import fs from 'fs';
|
||||
const configJsonPath = process.env.CONFIG_MOUNT_POINT;
|
||||
|
||||
exports.up = function (knex) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
// We take legacy deviceConfig targets and store them without the RESIN_ prefix
|
||||
// (we also strip the BALENA_ prefix for completeness, even though no supervisors
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as fs from 'fs';
|
||||
import fs from 'fs';
|
||||
const configJsonPath = process.env.CONFIG_MOUNT_POINT;
|
||||
|
||||
import { checkTruthy } from '../lib/validation';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as fs from 'fs';
|
||||
import fs from 'fs';
|
||||
const configJsonPath = process.env.CONFIG_MOUNT_POINT;
|
||||
|
||||
import { checkTruthy } from '../lib/validation';
|
||||
|
@ -1,8 +1,8 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import { promises as fs, watch } from 'fs';
|
||||
import * as networkCheck from 'network-checker';
|
||||
import * as os from 'os';
|
||||
import * as url from 'url';
|
||||
import networkCheck from 'network-checker';
|
||||
import os from 'os';
|
||||
import url from 'url';
|
||||
|
||||
import * as constants from './lib/constants';
|
||||
import { EEXIST } from './lib/errors';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { expect } from 'chai';
|
||||
import * as sinon from 'sinon';
|
||||
import * as Docker from 'dockerode';
|
||||
import Docker from 'dockerode';
|
||||
import * as applicationManager from '~/src/compose/application-manager';
|
||||
import * as imageManager from '~/src/compose/images';
|
||||
import * as serviceManager from '~/src/compose/service-manager';
|
||||
|
@ -4,7 +4,7 @@ import * as imageManager from '~/src/compose/images';
|
||||
import { createImage, withMockerode } from '~/test-lib/mockerode';
|
||||
import { createDockerImage } from '~/test-lib/docker-helper';
|
||||
|
||||
import * as Docker from 'dockerode';
|
||||
import Docker from 'dockerode';
|
||||
import * as db from '~/src/db';
|
||||
|
||||
// TODO: this code is duplicated in multiple tests
|
||||
|
@ -3,7 +3,7 @@ import { expect } from 'chai';
|
||||
import { Network } from '~/src/compose/network';
|
||||
import { createNetwork, withMockerode } from '~/test-lib/mockerode';
|
||||
|
||||
import * as Docker from 'dockerode';
|
||||
import Docker from 'dockerode';
|
||||
|
||||
describe('compose/network: integration tests', () => {
|
||||
const docker = new Docker();
|
||||
|
@ -5,7 +5,7 @@ import * as volumeManager from '~/src/compose/volume-manager';
|
||||
import Volume from '~/src/compose/volume';
|
||||
import { createDockerImage } from '~/test-lib/docker-helper';
|
||||
|
||||
import * as Docker from 'dockerode';
|
||||
import Docker from 'dockerode';
|
||||
|
||||
describe('compose/volume-manager', () => {
|
||||
const docker = new Docker();
|
||||
|
@ -5,7 +5,7 @@ import Volume from '~/src/compose/volume';
|
||||
import * as logTypes from '~/lib/log-types';
|
||||
import * as logger from '~/src/logger';
|
||||
|
||||
import * as Docker from 'dockerode';
|
||||
import Docker from 'dockerode';
|
||||
|
||||
import { createVolume, withMockerode } from '~/test-lib/mockerode';
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { expect } from 'chai';
|
||||
import type { SinonStub } from 'sinon';
|
||||
import { stub } from 'sinon';
|
||||
import * as Docker from 'dockerode';
|
||||
import * as request from 'supertest';
|
||||
import Docker from 'dockerode';
|
||||
import request from 'supertest';
|
||||
import { setTimeout } from 'timers/promises';
|
||||
|
||||
import * as deviceState from '~/src/device-state';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as express from 'express';
|
||||
import * as request from 'supertest';
|
||||
import express from 'express';
|
||||
import request from 'supertest';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import * as config from '~/src/config';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type * as express from 'express';
|
||||
import * as request from 'supertest';
|
||||
import request from 'supertest';
|
||||
|
||||
import * as deviceApi from '~/src/device-api';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as express from 'express';
|
||||
import * as request from 'supertest';
|
||||
import express from 'express';
|
||||
import request from 'supertest';
|
||||
|
||||
import * as config from '~/src/config';
|
||||
import * as testDb from '~/src/db';
|
||||
|
@ -2,7 +2,7 @@ import { expect } from 'chai';
|
||||
import type * as express from 'express';
|
||||
import type { SinonStub } from 'sinon';
|
||||
import { stub } from 'sinon';
|
||||
import * as request from 'supertest';
|
||||
import request from 'supertest';
|
||||
|
||||
import * as config from '~/src/config';
|
||||
import * as db from '~/src/db';
|
||||
|
@ -2,7 +2,7 @@ import { expect } from 'chai';
|
||||
import type * as express from 'express';
|
||||
import type { SinonStub } from 'sinon';
|
||||
import { stub } from 'sinon';
|
||||
import * as request from 'supertest';
|
||||
import request from 'supertest';
|
||||
|
||||
import * as config from '~/src/config';
|
||||
import * as db from '~/src/db';
|
||||
|
@ -12,7 +12,7 @@ import { initializeContractRequirements } from '~/lib/contracts';
|
||||
|
||||
import { testfs } from 'mocha-pod';
|
||||
import { createDockerImage } from '~/test-lib/docker-helper';
|
||||
import * as Docker from 'dockerode';
|
||||
import Docker from 'dockerode';
|
||||
import { setTimeout } from 'timers/promises';
|
||||
|
||||
describe('device-state', () => {
|
||||
|
@ -3,7 +3,7 @@ import { stub } from 'sinon';
|
||||
|
||||
import * as dockerUtils from '~/lib/docker-utils';
|
||||
import { createDockerImage, cleanupDocker } from '~/test-lib/docker-helper';
|
||||
import * as Docker from 'dockerode';
|
||||
import Docker from 'dockerode';
|
||||
|
||||
describe('lib/docker-utils', () => {
|
||||
const docker = new Docker();
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import { expect } from 'chai';
|
||||
import * as sinon from 'sinon';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import * as config from '~/src/config';
|
||||
import * as logger from '~/src/logger';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { expect } from 'chai';
|
||||
import { isRight } from 'fp-ts/lib/Either';
|
||||
import * as nock from 'nock';
|
||||
import nock from 'nock';
|
||||
|
||||
import { TargetState } from '~/src/types';
|
||||
import * as legacy from '~/lib/legacy';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { expect } from 'chai';
|
||||
import * as Docker from 'dockerode';
|
||||
import Docker from 'dockerode';
|
||||
import type { TargetStateV2 } from '~/lib/legacy';
|
||||
import * as request from 'supertest';
|
||||
import request from 'supertest';
|
||||
import { setTimeout as delay } from 'timers/promises';
|
||||
import { exec } from '~/lib/fs-utils';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as request from 'supertest';
|
||||
import request from 'supertest';
|
||||
|
||||
const BALENA_SUPERVISOR_ADDRESS =
|
||||
process.env.BALENA_SUPERVISOR_ADDRESS || 'http://balena-supervisor:48484';
|
||||
|
@ -1,8 +1,8 @@
|
||||
import type { SinonStub, SinonSpy } from 'sinon';
|
||||
import { stub, spy } from 'sinon';
|
||||
import * as Bluebird from 'bluebird';
|
||||
import * as _ from 'lodash';
|
||||
import rewire = require('rewire');
|
||||
import Bluebird from 'bluebird';
|
||||
import _ from 'lodash';
|
||||
import rewire from 'rewire';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import * as TargetState from '~/src/device-state/target-state';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { expect } from 'chai';
|
||||
import type { SinonStub, SinonSpy } from 'sinon';
|
||||
import { stub, spy } from 'sinon';
|
||||
import * as supertest from 'supertest';
|
||||
import supertest from 'supertest';
|
||||
|
||||
import sampleResponses = require('~/test-data/device-api-responses.json');
|
||||
import mockedAPI = require('~/test-lib/mocked-device-api');
|
||||
|
@ -1,8 +1,8 @@
|
||||
import * as chai from 'chai';
|
||||
import * as chaiAsPromised from 'chai-as-promised';
|
||||
import * as sinonChai from 'sinon-chai';
|
||||
import * as chaiThings from 'chai-things';
|
||||
import * as chaiLike from 'chai-like';
|
||||
import chai from 'chai';
|
||||
import chaiAsPromised from 'chai-as-promised';
|
||||
import sinonChai from 'sinon-chai';
|
||||
import chaiThings from 'chai-things';
|
||||
import chaiLike from 'chai-like';
|
||||
|
||||
/**
|
||||
* Mocha runs this EXACTLY ONCE before all tests to set up globals that
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user