mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-18 13:26:24 +00:00
Update @balena/lint to 8.0.0
Change-type: patch
This commit is contained in:
parent
6ebeb97917
commit
634ad156ce
@ -22,7 +22,7 @@ import * as archiver from 'archiver';
|
||||
import * as Bluebird from 'bluebird';
|
||||
import { exec, execFile } from 'child_process';
|
||||
import * as filehound from 'filehound';
|
||||
import { Stats } from 'fs';
|
||||
import type { Stats } from 'fs';
|
||||
import * as fs from 'fs-extra';
|
||||
import * as klaw from 'klaw';
|
||||
import * as path from 'path';
|
||||
|
2
automation/capitanodoc/doc-types.d.ts
vendored
2
automation/capitanodoc/doc-types.d.ts
vendored
@ -14,7 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { Command as OclifCommandClass } from '@oclif/core';
|
||||
import type { Command as OclifCommandClass } from '@oclif/core';
|
||||
|
||||
type OclifCommand = typeof OclifCommandClass;
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
import * as path from 'path';
|
||||
import { getCapitanoDoc } from './capitanodoc';
|
||||
import { Category, Document, OclifCommand } from './doc-types';
|
||||
import type { Category, Document, OclifCommand } from './doc-types';
|
||||
import * as markdown from './markdown';
|
||||
import { stripIndent } from '../../lib/utils/lazy';
|
||||
|
||||
|
@ -20,7 +20,7 @@ import * as _ from 'lodash';
|
||||
|
||||
import { getManualSortCompareFunction } from '../../lib/utils/helpers';
|
||||
import { capitanoizeOclifUsage } from '../../lib/utils/oclif-utils';
|
||||
import { Category, Document, OclifCommand } from './doc-types';
|
||||
import type { Category, Document, OclifCommand } from './doc-types';
|
||||
|
||||
function renderOclifCommand(command: OclifCommand): string[] {
|
||||
const result = [`## ${ent.encode(command.usage || '')}`];
|
||||
|
@ -107,11 +107,11 @@ async function $main() {
|
||||
|
||||
const changeType = process.argv[4]
|
||||
? // if the caller specified a change type, use that one
|
||||
validateChangeType(process.argv[4])
|
||||
validateChangeType(process.argv[4])
|
||||
: // use the same change type as in the dependency, but avoid major bumps
|
||||
semverChangeType && semverChangeType !== 'major'
|
||||
? semverChangeType
|
||||
: 'minor';
|
||||
semverChangeType && semverChangeType !== 'major'
|
||||
? semverChangeType
|
||||
: 'minor';
|
||||
console.log(`Using Change-type: ${changeType}`);
|
||||
|
||||
let { stdout: currentBranch } = await run('git rev-parse --abbrev-ref HEAD');
|
||||
|
@ -76,8 +76,8 @@ export function diffLines(str1: string, str2: string): string {
|
||||
return part.added
|
||||
? prefix(part.value, '+')
|
||||
: part.removed
|
||||
? prefix(part.value, '-')
|
||||
: prefix(part.value, ' ');
|
||||
? prefix(part.value, '-')
|
||||
: prefix(part.value, ' ');
|
||||
})
|
||||
.join('\n');
|
||||
return diffStr;
|
||||
|
@ -16,8 +16,8 @@
|
||||
*/
|
||||
|
||||
import * as packageJSON from '../package.json';
|
||||
import type { AppOptions } from './preparser';
|
||||
import {
|
||||
AppOptions,
|
||||
checkDeletedCommand,
|
||||
preparseArgs,
|
||||
unsupportedFlag,
|
||||
|
@ -52,7 +52,7 @@ export default class ApiKeysCmd extends Command {
|
||||
await getApplication(getBalenaSdk(), options.fleet, {
|
||||
$select: 'actor',
|
||||
})
|
||||
).actor
|
||||
).actor
|
||||
: await getBalenaSdk().auth.getActorId();
|
||||
const keys = await getBalenaSdk().pine.get({
|
||||
resource: 'api_key',
|
||||
@ -65,7 +65,7 @@ export default class ApiKeysCmd extends Command {
|
||||
name: {
|
||||
$ne: null,
|
||||
},
|
||||
}
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
$orderby: 'name asc',
|
||||
|
@ -91,7 +91,7 @@ export default class DeviceCmd extends Command {
|
||||
},
|
||||
...expandForAppName.$expand,
|
||||
},
|
||||
}
|
||||
}
|
||||
: {
|
||||
$select: [
|
||||
'device_name',
|
||||
@ -118,7 +118,7 @@ export default class DeviceCmd extends Command {
|
||||
'is_undervolted',
|
||||
],
|
||||
...expandForAppName,
|
||||
},
|
||||
},
|
||||
)) as ExtendedDevice;
|
||||
|
||||
if (options.view) {
|
||||
|
@ -132,7 +132,7 @@ export default class DeviceInitCmd extends Command {
|
||||
$select: 'slug',
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
: await (await import('../../utils/patterns')).selectApplication();
|
||||
|
||||
// Register new device
|
||||
|
@ -126,7 +126,7 @@ export default class EnvsCmd extends Command {
|
||||
let fleetSlug: string | undefined = options.fleet
|
||||
? await (
|
||||
await import('../../utils/sdk')
|
||||
).getFleetSlug(balena, options.fleet)
|
||||
).getFleetSlug(balena, options.fleet)
|
||||
: undefined;
|
||||
let fullUUID: string | undefined; // as oppposed to the short, 7-char UUID
|
||||
|
||||
|
@ -19,7 +19,7 @@ import { Flags, Args } from '@oclif/core';
|
||||
import Command from '../../command';
|
||||
import * as cf from '../../utils/common-flags';
|
||||
import { getBalenaSdk, stripIndent } from '../../utils/lazy';
|
||||
import { LogMessage } from 'balena-sdk';
|
||||
import type { LogMessage } from 'balena-sdk';
|
||||
|
||||
const MAX_RETRY = 1000;
|
||||
|
||||
|
@ -173,7 +173,7 @@ Can be repeated to add multiple certificates.\
|
||||
const fleetSlug: string | undefined = options.fleet
|
||||
? await (
|
||||
await import('../../utils/sdk')
|
||||
).getFleetSlug(balena, options.fleet)
|
||||
).getFleetSlug(balena, options.fleet)
|
||||
: undefined;
|
||||
|
||||
const progressBars: {
|
||||
|
@ -23,7 +23,7 @@ import { getBalenaSdk, stripIndent } from '../../utils/lazy';
|
||||
import { dockerignoreHelp, registrySecretsHelp } from '../../utils/messages';
|
||||
import type { BalenaSDK } from 'balena-sdk';
|
||||
import { ExpectedError, instanceOf } from '../../errors';
|
||||
import { RegistrySecrets } from '@balena/compose/dist/multibuild';
|
||||
import type { RegistrySecrets } from '@balena/compose/dist/multibuild';
|
||||
import { lowercaseIfSlug } from '../../utils/normalization';
|
||||
import {
|
||||
applyReleaseTagKeysAndValues,
|
||||
|
@ -78,7 +78,7 @@ export default class ReleasesCmd extends Command {
|
||||
$select: ['tag_key', 'value'],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
: { $select: fields },
|
||||
);
|
||||
|
||||
|
@ -88,7 +88,7 @@ async function outputDataSet(
|
||||
...(options.json
|
||||
? {
|
||||
output: 'json',
|
||||
}
|
||||
}
|
||||
: {}),
|
||||
columns: options.fields,
|
||||
printLine,
|
||||
@ -147,7 +147,7 @@ function getLongestObjectKeyLength(o: any): number {
|
||||
return Object.keys(o).length >= 1
|
||||
? Object.keys(o).reduce((a, b) => {
|
||||
return a.length > b.length ? a : b;
|
||||
}).length
|
||||
}).length
|
||||
: 0;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ import type {
|
||||
} from './compose-types';
|
||||
import { getChalk } from './lazy';
|
||||
import Logger = require('./logger');
|
||||
import { ProgressCallback } from 'docker-progress';
|
||||
import type { ProgressCallback } from 'docker-progress';
|
||||
|
||||
export function generateOpts(options: {
|
||||
source?: string;
|
||||
|
@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { Flags } from '@oclif/core';
|
||||
import { BalenaSDK } from 'balena-sdk';
|
||||
import type { BalenaSDK } from 'balena-sdk';
|
||||
import type { TransposeOptions } from '@balena/compose/dist/emulate';
|
||||
import type * as Dockerode from 'dockerode';
|
||||
import { promises as fs } from 'fs';
|
||||
@ -32,7 +32,7 @@ import * as semver from 'semver';
|
||||
import type { Duplex, Readable } from 'stream';
|
||||
import type { Pack } from 'tar-stream';
|
||||
import { ExpectedError } from '../errors';
|
||||
import {
|
||||
import type {
|
||||
BuiltImage,
|
||||
ComposeOpts,
|
||||
ComposeProject,
|
||||
|
@ -18,13 +18,13 @@
|
||||
import * as semver from 'balena-semver';
|
||||
import * as Docker from 'dockerode';
|
||||
import * as _ from 'lodash';
|
||||
import { Composition } from '@balena/compose/dist/parse';
|
||||
import {
|
||||
import type { Composition } from '@balena/compose/dist/parse';
|
||||
import type {
|
||||
BuildTask,
|
||||
getAuthConfigObj,
|
||||
LocalImage,
|
||||
RegistrySecrets,
|
||||
} from '@balena/compose/dist/multibuild';
|
||||
import { getAuthConfigObj } from '@balena/compose/dist/multibuild';
|
||||
import type { Readable } from 'stream';
|
||||
|
||||
import { BALENA_ENGINE_TMP_PATH } from '../../config';
|
||||
@ -37,7 +37,8 @@ import {
|
||||
makeImageName,
|
||||
} from '../compose_ts';
|
||||
import Logger = require('../logger');
|
||||
import { DeviceAPI, DeviceInfo } from './api';
|
||||
import type { DeviceInfo } from './api';
|
||||
import { DeviceAPI } from './api';
|
||||
import * as LocalPushErrors from './errors';
|
||||
import LivepushManager from './live';
|
||||
import { displayBuildLog } from './logs';
|
||||
|
@ -30,11 +30,8 @@ import Logger = require('../logger');
|
||||
import { Dockerfile } from 'livepush';
|
||||
import type DeviceAPI from './api';
|
||||
import type { DeviceInfo, Status } from './api';
|
||||
import {
|
||||
DeviceDeployOptions,
|
||||
generateTargetState,
|
||||
rebuildSingleTask,
|
||||
} from './deploy';
|
||||
import type { DeviceDeployOptions } from './deploy';
|
||||
import { generateTargetState, rebuildSingleTask } from './deploy';
|
||||
import { BuildError } from './errors';
|
||||
import { getServiceColourFn } from './logs';
|
||||
import { delay } from '../helpers';
|
||||
|
@ -17,11 +17,11 @@ limitations under the License.
|
||||
import { ExpectedError } from '../../errors';
|
||||
import { stripIndent } from '../lazy';
|
||||
|
||||
import type { SshRemoteCommandOpts } from '../ssh';
|
||||
import {
|
||||
findBestUsernameForDevice,
|
||||
getRemoteCommandOutput,
|
||||
runRemoteCommand,
|
||||
SshRemoteCommandOpts,
|
||||
} from '../ssh';
|
||||
|
||||
export interface DeviceSSHOpts extends SshRemoteCommandOpts {
|
||||
|
@ -85,13 +85,13 @@ export function getVarResourceName(
|
||||
? isConfig
|
||||
? 'device_config_variable'
|
||||
: isService
|
||||
? 'device_service_environment_variable'
|
||||
: 'device_environment_variable'
|
||||
? 'device_service_environment_variable'
|
||||
: 'device_environment_variable'
|
||||
: isConfig
|
||||
? 'application_config_variable'
|
||||
: isService
|
||||
? 'service_environment_variable'
|
||||
: 'application_environment_variable';
|
||||
? 'application_config_variable'
|
||||
: isService
|
||||
? 'service_environment_variable'
|
||||
: 'application_environment_variable';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -15,7 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import * as _ from 'lodash';
|
||||
import { promises as fs, Stats } from 'fs';
|
||||
import type { Stats } from 'fs';
|
||||
import { promises as fs } from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
import type { Ignore } from '@balena/dockerignore';
|
||||
|
@ -18,7 +18,7 @@
|
||||
import type { Options as GlobalTunnelNgConfig } from 'global-tunnel-ng';
|
||||
export type { GlobalTunnelNgConfig };
|
||||
|
||||
import { CliSettings } from './bootstrap';
|
||||
import type { CliSettings } from './bootstrap';
|
||||
|
||||
type ProxyConfig = string | GlobalTunnelNgConfig;
|
||||
|
||||
|
@ -17,7 +17,7 @@ import type { BalenaSDK } from 'balena-sdk';
|
||||
import * as JSONStream from 'JSONStream';
|
||||
import * as readline from 'readline';
|
||||
import * as request from 'request';
|
||||
import { RegistrySecrets } from '@balena/compose/dist/multibuild';
|
||||
import type { RegistrySecrets } from '@balena/compose/dist/multibuild';
|
||||
import type * as Stream from 'stream';
|
||||
import streamToPromise = require('stream-to-promise');
|
||||
import type { Pack } from 'tar-stream';
|
||||
|
@ -14,7 +14,8 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { spawn, StdioOptions } from 'child_process';
|
||||
import type { StdioOptions } from 'child_process';
|
||||
import { spawn } from 'child_process';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { ExpectedError } from '../errors';
|
||||
|
@ -15,7 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ChildProcess, spawn, SpawnOptions } from 'child_process';
|
||||
import type { ChildProcess, SpawnOptions } from 'child_process';
|
||||
import { spawn } from 'child_process';
|
||||
import { stripIndent } from './lazy';
|
||||
|
||||
/**
|
||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
import type { BalenaSDK } from 'balena-sdk';
|
||||
import { Socket } from 'net';
|
||||
import type { Socket } from 'net';
|
||||
import * as tls from 'tls';
|
||||
import { TypedError } from 'typed-error';
|
||||
import { ExpectedError } from '../errors';
|
||||
|
1485
npm-shrinkwrap.json
generated
1485
npm-shrinkwrap.json
generated
File diff suppressed because it is too large
Load Diff
@ -117,7 +117,7 @@
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@balena/lint": "^7.2.1",
|
||||
"@balena/lint": "^8.0.0",
|
||||
"@electron/notarize": "^2.0.0",
|
||||
"@octokit/plugin-throttling": "^3.5.1",
|
||||
"@octokit/rest": "^18.6.7",
|
||||
|
@ -26,9 +26,11 @@ import { BalenaAPIMock } from '../nock/balena-api-mock';
|
||||
import { expectStreamNoCRLF, testDockerBuildStream } from '../docker-build';
|
||||
import { DockerMock, dockerResponsePath } from '../nock/docker-mock';
|
||||
import { cleanOutput, runCommand } from '../helpers';
|
||||
import {
|
||||
import type {
|
||||
ExpectedTarStreamFiles,
|
||||
ExpectedTarStreamFilesByService,
|
||||
} from '../projects';
|
||||
import {
|
||||
getDockerignoreWarn1,
|
||||
getDockerignoreWarn2,
|
||||
getDockerignoreWarn3,
|
||||
|
@ -20,7 +20,7 @@ import type { Request as ReleaseRequest } from '@balena/compose/dist/release';
|
||||
import { expect } from 'chai';
|
||||
import { promises as fs } from 'fs';
|
||||
import * as _ from 'lodash';
|
||||
import * as nock from 'nock';
|
||||
import type * as nock from 'nock';
|
||||
import * as path from 'path';
|
||||
import * as sinon from 'sinon';
|
||||
|
||||
@ -28,12 +28,11 @@ import { BalenaAPIMock } from '../nock/balena-api-mock';
|
||||
import { expectStreamNoCRLF, testDockerBuildStream } from '../docker-build';
|
||||
import { DockerMock, dockerResponsePath } from '../nock/docker-mock';
|
||||
import { cleanOutput, runCommand, switchSentry } from '../helpers';
|
||||
import {
|
||||
import type {
|
||||
ExpectedTarStreamFiles,
|
||||
ExpectedTarStreamFilesByService,
|
||||
getDockerignoreWarn1,
|
||||
getDockerignoreWarn3,
|
||||
} from '../projects';
|
||||
import { getDockerignoreWarn1, getDockerignoreWarn3 } from '../projects';
|
||||
|
||||
const repoPath = path.normalize(path.join(__dirname, '..', '..'));
|
||||
const projectsPath = path.join(repoPath, 'tests', 'test-data', 'projects');
|
||||
|
@ -23,10 +23,10 @@ import { BalenaAPIMock } from '../nock/balena-api-mock';
|
||||
import { BuilderMock, builderResponsePath } from '../nock/builder-mock';
|
||||
import { expectStreamNoCRLF, testPushBuildStream } from '../docker-build';
|
||||
import { cleanOutput, runCommand } from '../helpers';
|
||||
import type { ExpectedTarStreamFiles } from '../projects';
|
||||
import {
|
||||
addRegSecretsEntries,
|
||||
exists,
|
||||
ExpectedTarStreamFiles,
|
||||
getDockerignoreWarn1,
|
||||
getDockerignoreWarn2,
|
||||
getDockerignoreWarn3,
|
||||
|
@ -17,7 +17,8 @@
|
||||
|
||||
import { expect } from 'chai';
|
||||
import mock = require('mock-require');
|
||||
import { createServer, Server } from 'net';
|
||||
import type { Server } from 'net';
|
||||
import { createServer } from 'net';
|
||||
|
||||
import { BalenaAPIMock } from '../nock/balena-api-mock';
|
||||
import { cleanOutput, runCommand } from '../helpers';
|
||||
|
@ -23,13 +23,12 @@ import * as semver from 'semver';
|
||||
import * as sinon from 'sinon';
|
||||
|
||||
import * as packageJSON from '../package.json';
|
||||
import {
|
||||
DeprecationChecker,
|
||||
ReleaseTimestampsByVersion,
|
||||
} from '../build/deprecation';
|
||||
import type { ReleaseTimestampsByVersion } from '../build/deprecation';
|
||||
import { DeprecationChecker } from '../build/deprecation';
|
||||
import { BalenaAPIMock } from './nock/balena-api-mock';
|
||||
import { NpmMock } from './nock/npm-mock';
|
||||
import { runCommand, TestOutput } from './helpers';
|
||||
import type { TestOutput } from './helpers';
|
||||
import { runCommand } from './helpers';
|
||||
|
||||
// "itSS" means "it() Skip Standalone"
|
||||
const itSS = process.env.BALENA_CLI_TEST_TYPE === 'standalone' ? it.skip : it;
|
||||
|
@ -29,15 +29,15 @@ import { URL } from 'url';
|
||||
|
||||
import { makeImageName } from '../build/utils/compose_ts';
|
||||
import { stripIndent } from '../build/utils/lazy';
|
||||
import { BuilderMock } from './nock/builder-mock';
|
||||
import { DockerMock } from './nock/docker-mock';
|
||||
import type { BuilderMock } from './nock/builder-mock';
|
||||
import type { DockerMock } from './nock/docker-mock';
|
||||
import {
|
||||
cleanOutput,
|
||||
deepJsonParse,
|
||||
deepTemplateReplace,
|
||||
runCommand,
|
||||
} from './helpers';
|
||||
import {
|
||||
import type {
|
||||
ExpectedTarStreamFile,
|
||||
ExpectedTarStreamFiles,
|
||||
ExpectedTarStreamFilesByService,
|
||||
|
@ -18,7 +18,8 @@
|
||||
import * as _ from 'lodash';
|
||||
import * as path from 'path';
|
||||
|
||||
import { NockMock, ScopeOpts } from './nock-mock';
|
||||
import type { ScopeOpts } from './nock-mock';
|
||||
import { NockMock } from './nock-mock';
|
||||
|
||||
export const apiResponsePath = path.normalize(
|
||||
path.join(__dirname, '..', 'test-data', 'api-response'),
|
||||
|
@ -18,7 +18,8 @@
|
||||
import * as path from 'path';
|
||||
import * as qs from 'querystring';
|
||||
|
||||
import { NockMock, ScopeOpts } from './nock-mock';
|
||||
import type { ScopeOpts } from './nock-mock';
|
||||
import { NockMock } from './nock-mock';
|
||||
|
||||
export const dockerResponsePath = path.normalize(
|
||||
path.join(__dirname, '..', 'test-data', 'docker-response'),
|
||||
|
@ -17,7 +17,8 @@
|
||||
import * as path from 'path';
|
||||
import { Readable } from 'stream';
|
||||
|
||||
import { NockMock, ScopeOpts } from './nock-mock';
|
||||
import type { ScopeOpts } from './nock-mock';
|
||||
import { NockMock } from './nock-mock';
|
||||
|
||||
export const dockerResponsePath = path.normalize(
|
||||
path.join(__dirname, '..', 'test-data', 'docker-response'),
|
||||
|
@ -17,10 +17,8 @@
|
||||
|
||||
import { expect } from 'chai';
|
||||
|
||||
import {
|
||||
GlobalTunnelNgConfig,
|
||||
makeUrlFromTunnelNgConfig,
|
||||
} from '../build/utils/proxy';
|
||||
import type { GlobalTunnelNgConfig } from '../build/utils/proxy';
|
||||
import { makeUrlFromTunnelNgConfig } from '../build/utils/proxy';
|
||||
|
||||
describe('makeUrlFromTunnelNgConfig() function', function () {
|
||||
it('should return a URL given a GlobalTunnelNgConfig object', () => {
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { expect } from 'chai';
|
||||
import * as chokidar from 'chokidar';
|
||||
import type * as chokidar from 'chokidar';
|
||||
import { promises as fs } from 'fs';
|
||||
import * as path from 'path';
|
||||
import { promisify } from 'util';
|
||||
|
@ -17,8 +17,8 @@
|
||||
|
||||
import { expect } from 'chai';
|
||||
|
||||
import type { DockerConnectionCliFlags } from '../../build/utils/docker';
|
||||
import {
|
||||
DockerConnectionCliFlags,
|
||||
generateConnectOpts,
|
||||
getDefaultDockerModemOpts,
|
||||
} from '../../build/utils/docker';
|
||||
|
2
typings/balena-device-init/index.d.ts
vendored
2
typings/balena-device-init/index.d.ts
vendored
@ -17,7 +17,7 @@
|
||||
|
||||
declare module 'balena-device-init' {
|
||||
import { DeviceTypeJson } from 'balena-sdk';
|
||||
import * as Bluebird from 'bluebird';
|
||||
import type * as Bluebird from 'bluebird';
|
||||
|
||||
interface OperationState {
|
||||
operation:
|
||||
|
2
typings/global.d.ts
vendored
2
typings/global.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
import { Application, DeviceType, Device } from 'balena-sdk';
|
||||
import type { Application, DeviceType, Device } from 'balena-sdk';
|
||||
|
||||
declare global {
|
||||
type ApplicationWithDeviceTypeSlug = Omit<
|
||||
|
Loading…
Reference in New Issue
Block a user