diff --git a/package.json b/package.json index 2287254d..fd67f23c 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "patch-package": "^8.0.0", "postinstall-postinstall": "^2.1.0", "syncpack": "^9.8.4", - "typescript": "^5.0.4" + "typescript": "^5.2.2" }, "lint-staged": { "*.{ts,tsx}": [ diff --git a/packages/cli-common/package.json b/packages/cli-common/package.json index 63b2991d..342d0da7 100644 --- a/packages/cli-common/package.json +++ b/packages/cli-common/package.json @@ -18,8 +18,8 @@ "@jest/globals": "29.7.0", "@types/lodash": "^4.14.192", "@types/node": "18", - "@typescript-eslint/eslint-plugin": "6.7.4", - "@typescript-eslint/parser": "6.7.4", + "@typescript-eslint/eslint-plugin": "6.10.0", + "@typescript-eslint/parser": "6.10.0", "eslint": "^8.36.0", "eslint-config-airbnb": "^19.0.4", "eslint-plugin-import": "^2.27.5", @@ -29,7 +29,7 @@ "jest": "29.7.0", "shx": "^0.3.3", "tslib": "^2.5.0", - "typescript": "^5.0.4" + "typescript": "^5.2.2" }, "scripts": { "lint": "eslint . --ext .ts,.tsx --cache", diff --git a/packages/cli/bin/dev b/packages/cli/bin/dev index 8d64835a..21908218 100755 --- a/packages/cli/bin/dev +++ b/packages/cli/bin/dev @@ -1,5 +1,6 @@ #!/usr/bin/env node +require('disposablestack/auto') const oclif = require('@oclif/core') const path = require('path') diff --git a/packages/cli/bin/run b/packages/cli/bin/run index c44179b9..44a97010 100755 --- a/packages/cli/bin/run +++ b/packages/cli/bin/run @@ -1,5 +1,6 @@ #!/usr/bin/env node require('source-map-support').install() +require('disposablestack/auto') const oclif = require('@oclif/core') diff --git a/packages/cli/package.json b/packages/cli/package.json index fab0a67b..5b34cb23 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -30,6 +30,7 @@ "@preevy/driver-kube-pod": "0.0.56", "@preevy/driver-lightsail": "0.0.56", "@preevy/plugin-github-pr-link": "0.0.56", + "disposablestack": "^1.1.2", "inquirer": "^8.0.0", "iter-tools-es": "^7.5.3", "lodash": "^4.17.21", @@ -42,8 +43,8 @@ "@types/lodash": "^4.14.192", "@types/node": "18", "@types/shell-escape": "^0.2.1", - "@typescript-eslint/eslint-plugin": "6.7.4", - "@typescript-eslint/parser": "6.7.4", + "@typescript-eslint/eslint-plugin": "6.10.0", + "@typescript-eslint/parser": "6.10.0", "eslint": "^8.36.0", "eslint-config-airbnb": "^19.0.4", "eslint-config-oclif": "^4", @@ -59,7 +60,7 @@ "ts-node": "^10.9.1", "tsconfig-paths": "^4.2.0", "tslib": "^2.5.0", - "typescript": "^5.0.4" + "typescript": "^5.2.2" }, "oclif": { "bin": "preevy", diff --git a/packages/cli/src/commands/up.ts b/packages/cli/src/commands/up.ts index b24fbe3b..4dcfbb52 100644 --- a/packages/cli/src/commands/up.ts +++ b/packages/cli/src/commands/up.ts @@ -22,6 +22,14 @@ export default class Up extends MachineCreationDriverCommand { static flags = { ...envIdFlags, ...tunnelServerFlags, + 'split-build': Flags.custom({ + description: 'Build locally and deploy remotely using an image registry', + required: false, + parse: async input => { + const pairs = input.split(',') + return commands.splitBuildSpecSchema.parse(Object.fromEntries(pairs.map(pair => pair.split('=')))) + }, + })(), 'skip-unchanged-files': Flags.boolean({ description: 'Detect and skip unchanged files when copying (default: true)', default: true, @@ -144,6 +152,7 @@ export default class Up extends MachineCreationDriverCommand { cwd: process.cwd(), skipUnchangedFiles: flags['skip-unchanged-files'], version: this.config.version, + splitBuildSpec: flags['split-build'], }) this.log(`Preview environment ${envId} provisioned at: ${machine.locationDescription}`) diff --git a/packages/common/package.json b/packages/common/package.json index 2f3f4a77..00e5d29e 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -24,8 +24,8 @@ "@types/node": "18", "@types/shell-escape": "^0.2.1", "@types/ssh2": "^1.11.8", - "@typescript-eslint/eslint-plugin": "6.7.4", - "@typescript-eslint/parser": "6.7.4", + "@typescript-eslint/eslint-plugin": "6.10.0", + "@typescript-eslint/parser": "6.10.0", "esbuild": "^0.17.14", "eslint": "^8.36.0", "husky": "^8.0.0", @@ -33,7 +33,7 @@ "lint-staged": "^14.0.1", "ts-jest": "29.1.1", "tsx": "^3.12.3", - "typescript": "^5.0.4", + "typescript": "^5.2.2", "yaml": "^2.3.2" }, "scripts": { diff --git a/packages/compose-tunnel-agent/package.json b/packages/compose-tunnel-agent/package.json index 69e0ae2c..3d367174 100644 --- a/packages/compose-tunnel-agent/package.json +++ b/packages/compose-tunnel-agent/package.json @@ -38,8 +38,8 @@ "@types/node-fetch": "^2.6.3", "@types/shell-escape": "^0.2.1", "@types/ssh2": "^1.11.8", - "@typescript-eslint/eslint-plugin": "6.7.4", - "@typescript-eslint/parser": "6.7.4", + "@typescript-eslint/eslint-plugin": "6.10.0", + "@typescript-eslint/parser": "6.10.0", "esbuild": "^0.17.14", "eslint": "^8.36.0", "husky": "^8.0.0", @@ -49,7 +49,7 @@ "shx": "^0.3.3", "strip-ansi": "6.0.0", "tsx": "^3.12.3", - "typescript": "^5.0.4", + "typescript": "^5.2.2", "wait-for-expect": "^3.0.2" }, "scripts": { diff --git a/packages/core/package.json b/packages/core/package.json index c3a425ec..dacae6e3 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -52,8 +52,8 @@ "@types/sshpk": "^1.17.1", "@types/tar": "^6.1.4", "@types/tar-stream": "^2.2.2", - "@typescript-eslint/eslint-plugin": "6.7.4", - "@typescript-eslint/parser": "6.7.4", + "@typescript-eslint/eslint-plugin": "6.10.0", + "@typescript-eslint/parser": "6.10.0", "eslint": "^8.36.0", "eslint-config-airbnb": "^19.0.4", "eslint-plugin-import": "^2.27.5", @@ -65,7 +65,7 @@ "ts-jest": "29.1.1", "ts-node": "^10.9.1", "tslib": "^2.5.0", - "typescript": "^5.0.4" + "typescript": "^5.2.2" }, "scripts": { "test": "yarn jest", diff --git a/packages/core/src/commands/index.ts b/packages/core/src/commands/index.ts index baeae5f8..0e253629 100644 --- a/packages/core/src/commands/index.ts +++ b/packages/core/src/commands/index.ts @@ -1,7 +1,6 @@ -import up from './up' -import ls from './ls' -import shell from './shell' +export { SplitBuildSpec, splitBuildSpecSchema, default as up } from './up' +export { default as ls } from './ls' +export { default as shell } from './shell' -export { up, ls, shell } export { urls } from './urls' export * as proxy from './proxy' diff --git a/packages/core/src/commands/up/index.ts b/packages/core/src/commands/up/index.ts index 6742b973..dedc4472 100644 --- a/packages/core/src/commands/up/index.ts +++ b/packages/core/src/commands/up/index.ts @@ -3,8 +3,11 @@ import fs from 'fs' import path from 'path' import { rimraf } from 'rimraf' import yaml from 'yaml' +import { spawn } from 'child_process' +import { mapValues, pickBy } from 'lodash' +import { childProcessPromise } from '../../child-process' import { TunnelOpts } from '../../ssh' -import { composeModelFilename, fixModelForRemote, localComposeClient, addScriptInjectionsToModel } from '../../compose' +import { composeModelFilename, fixModelForRemote, localComposeClient, addScriptInjectionsToModel, ComposeBuild, ComposeService } from '../../compose' import { ensureCustomizedMachine } from './machine' import { wrapWithDockerSocket } from '../../docker' import { addComposeTunnelAgentService } from '../../compose-tunnel-agent-client' @@ -14,6 +17,11 @@ import { Logger } from '../../log' import { FileToCopy, uploadWithSpinner } from '../../upload-files' import { envMetadata } from '../../env-metadata' import { EnvId } from '../../env-id' +import { SplitBuildSpec } from './split-build' +import { gitContext } from '../../git' +import { randomString } from '../../strings' + +export { splitBuildSpecSchema, SplitBuildSpec } from './split-build' const createCopiedFileInDataDir = ( { projectLocalDataDir, filesToCopy } : { @@ -35,10 +43,11 @@ const createCopiedFileInDataDir = ( return result } -const calcComposeUpArgs = ({ userSpecifiedServices, debug, cwd } : { +const calcComposeUpArgs = ({ userSpecifiedServices, debug, cwd, build } : { userSpecifiedServices: string[] debug: boolean cwd: string + build: boolean }) => { const upServices = userSpecifiedServices.length ? userSpecifiedServices.concat(COMPOSE_TUNNEL_AGENT_SERVICE_NAME) @@ -47,7 +56,8 @@ const calcComposeUpArgs = ({ userSpecifiedServices, debug, cwd } : { return [ ...debug ? ['--verbose'] : [], '--project-directory', cwd, - 'up', '-d', '--remove-orphans', '--build', + 'up', '-d', '--remove-orphans', + ...build ? ['--build'] : [], ...upServices, ] } @@ -59,6 +69,20 @@ const serviceLinkEnvVars = ( .map(({ name, port, url }) => [`PREEVY_BASE_URI_${name.replace(/[^a-zA-Z0-9_]/g, '_')}_${port}`.toUpperCase(), url]) ) +const isEcr = (registry: string) => Boolean(registry.match(/^[0-9]+\.dkr\.ecr\.[^.]+\.*\.amazonaws\.com\/.+/)) + +const registryImageName = ( + { registry, image, tag }: { + registry: string + image: string + tag: string + }, + { ecrFormat }: { ecrFormat?: boolean } = {}, +) => { + const formatForEcr = ecrFormat === undefined ? isEcr(registry) : ecrFormat + return formatForEcr ? `${registry}:${image}-${tag}` : `${registry}/${image}:${tag}` +} + const up = async ({ debug, machineDriver, @@ -79,6 +103,7 @@ const up = async ({ envId, expectedServiceUrls, projectName, + splitBuildSpec, }: { debug: boolean machineDriver: MachineDriver @@ -99,6 +124,7 @@ const up = async ({ envId: EnvId expectedServiceUrls: { name: string; port: number; url: string }[] projectName: string + splitBuildSpec?: SplitBuildSpec }): Promise<{ machine: MachineBase }> => { const remoteDir = remoteProjectDir(projectName) @@ -110,6 +136,14 @@ const up = async ({ projectName: userSpecifiedProjectName, }) + await using cleanup = new AsyncDisposableStack() + + const { machine, connection, userAndGroup, dockerPlatform } = await ensureCustomizedMachine({ + machineDriver, machineCreationDriver, machineDriverName, envId, log, debug, + }) + + cleanup.defer(() => connection.close()) + const { model: fixedModel, filesToCopy } = await fixModelForRemote( { cwd, remoteBaseDir: remoteDir }, await composeClientWithInjectedArgs.getModel() @@ -124,10 +158,6 @@ const up = async ({ createCopiedFile('tunnel_server_public_key', formatPublicKey(hostKey)), ]) - const { machine, connection, userAndGroup } = await ensureCustomizedMachine({ - machineDriver, machineCreationDriver, machineDriverName, envId, log, debug, - }) - let remoteModel = addComposeTunnelAgentService({ envId, debug, @@ -150,32 +180,70 @@ const up = async ({ ) } - try { - const { exec } = connection + if (splitBuildSpec) { + const tagSuffix = await gitContext(cwd)?.commit({ short: true }) ?? randomString.lowercaseNumeric(8) + const serviceImage = (service: string, tag: string) => registryImageName( + { + registry: splitBuildSpec.registry, + image: `preevy-${envId}-${service}`, + tag, + }, + { ecrFormat: splitBuildSpec.ecrFormat }, + ) - const modelStr = yaml.stringify(remoteModel) - log.debug('model', modelStr) - const composeFilePath = await createCopiedFile(composeModelFilename, modelStr) + const buildServices = mapValues( + pickBy(remoteModel.services, ({ build }) => build), + ({ build }: { build: ComposeBuild}, service) => { + const latestImage = serviceImage(service, 'latest') + const thisImage = serviceImage(service, tagSuffix) + return ({ + build: Object.assign(build, { + tags: (build.tags ?? []).concat(thisImage, latestImage), + cache_from: (build.cache_from ?? []).concat(latestImage), + }), + }) + }, + ) - await exec(`mkdir -p "${remoteDir}"`) + const buildFilename = path.join(projectLocalDataDir, 'build.yaml') + await fs.promises.writeFile(buildFilename, yaml.stringify({ services: buildServices })) + + await childProcessPromise(spawn('docker', [ + 'buildx', 'bake', + '-f', buildFilename, + `--set=*.platform=${splitBuildSpec.platform ?? dockerPlatform}`, + '--push', + ], { + stdio: 'inherit', + })) + + for (const serviceName of Object.keys(buildServices)) { + (remoteModel.services as Record)[serviceName].image = serviceImage(serviceName, tagSuffix) + } + } - log.debug('Files to copy', filesToCopy) + const modelStr = yaml.stringify(remoteModel) + log.debug('model', modelStr) + const composeFilePath = await createCopiedFile(composeModelFilename, modelStr) - await uploadWithSpinner(exec, remoteDir, filesToCopy, skipUnchangedFiles) + const { exec } = connection - const compose = localComposeClient({ - composeFiles: [composeFilePath.local], - projectName: userSpecifiedProjectName, - }) - const composeArgs = calcComposeUpArgs({ userSpecifiedServices, debug, cwd }) + await exec(`mkdir -p "${remoteDir}"`) - const withDockerSocket = wrapWithDockerSocket({ connection, log }) + log.debug('Files to copy', filesToCopy) - log.info(`Running: docker compose up ${composeArgs.join(' ')}`) - await withDockerSocket(() => compose.spawnPromise(composeArgs, { stdio: 'inherit' })) - } finally { - await connection.close() - } + await uploadWithSpinner(exec, remoteDir, filesToCopy, skipUnchangedFiles) + + const compose = localComposeClient({ + composeFiles: [composeFilePath.local], + projectName: userSpecifiedProjectName, + }) + const composeArgs = calcComposeUpArgs({ userSpecifiedServices, debug, cwd, build: !splitBuildSpec }) + + const withDockerSocket = wrapWithDockerSocket({ connection, log }) + + log.info(`Running: docker compose up ${composeArgs.join(' ')}`) + await withDockerSocket(() => compose.spawnPromise(composeArgs, { stdio: 'inherit' })) return { machine } } diff --git a/packages/core/src/commands/up/machine.ts b/packages/core/src/commands/up/machine.ts index 6b09a689..e7d9d6b9 100644 --- a/packages/core/src/commands/up/machine.ts +++ b/packages/core/src/commands/up/machine.ts @@ -98,12 +98,17 @@ const writeMetadata = async ( }) } -const getUserAndGroup = async (connection: MachineConnection) => ( +const getUserAndGroup = async (connection: Pick) => ( await connection.exec('echo "$(id -u):$(stat -c %g /var/run/docker.sock)"') ).stdout .trim() .split(':') as [string, string] +const getDockerPlatform = async (connection: Pick) => { + const arch = (await connection.exec('docker info -f "{{.Architecture}}"')).stdout.trim() + return arch === 'aarch64' ? 'linux/arm64' : 'linux/amd64' +} + const customizeNewMachine = ({ log, debug, @@ -150,6 +155,7 @@ const customizeNewMachine = ({ spinner.text = 'Finalizing...' const userAndGroup = await getUserAndGroup(connection) + const dockerPlatform = await getDockerPlatform(connection) await Promise.all([ writeMetadata(machine, machineDriverName, machineCreationDriver.metadata, connection, userAndGroup), @@ -160,7 +166,7 @@ const customizeNewMachine = ({ }), ]) - return { connection, userAndGroup, machine } + return { connection, userAndGroup, machine, dockerPlatform } } export const ensureCustomizedMachine = async ({ @@ -177,10 +183,16 @@ export const ensureCustomizedMachine = async ({ envId: string log: Logger debug: boolean -}): Promise<{ machine: MachineBase; connection: MachineConnection; userAndGroup: [string, string] }> => { +}): Promise<{ + machine: MachineBase + connection: MachineConnection + userAndGroup: [string, string] + dockerPlatform: string +}> => { const { machine, connection: connectionPromise, origin } = await ensureMachine( { machineDriver, machineCreationDriver, envId, log, debug }, ) + return await withSpinner(async spinner => { spinner.text = `Connecting to machine at ${machine.locationDescription}` const connection = await connectionPromise @@ -200,12 +212,14 @@ export const ensureCustomizedMachine = async ({ } const userAndGroup = await getUserAndGroup(connection) + const dockerPlatform = await getDockerPlatform(connection) + if (origin === 'new-from-snapshot') { spinner.text = 'Finalizing...' await writeMetadata(machine, machineDriverName, machineCreationDriver.metadata, connection, userAndGroup) } - return { machine, connection, userAndGroup } + return { machine, connection, userAndGroup, dockerPlatform } } catch (e) { await connection.close() throw e diff --git a/packages/core/src/commands/up/split-build.ts b/packages/core/src/commands/up/split-build.ts new file mode 100644 index 00000000..fbd364bc --- /dev/null +++ b/packages/core/src/commands/up/split-build.ts @@ -0,0 +1,9 @@ +import z from 'zod' + +export const splitBuildSpecSchema = z.object({ + registry: z.string(), + platform: z.string().optional(), + ecrFormat: z.boolean().optional(), +}) + +export type SplitBuildSpec = z.infer diff --git a/packages/core/src/compose/model.ts b/packages/core/src/compose/model.ts index 57c0791e..4a021a3b 100644 --- a/packages/core/src/compose/model.ts +++ b/packages/core/src/compose/model.ts @@ -27,10 +27,13 @@ export type ComposeBindVolume = { export type ComposeVolume = { type: 'volume' | 'tmpfs' | 'npipe' } | ComposeBindVolume -type ComposeBuild = { +export type ComposeBuild = { context: string target?: string dockerfile?: string + tags?: string[] + cache_from?: string[] + cache_to?: string[] } type ComposePort = { @@ -52,6 +55,8 @@ export type ComposeService = { environment?: Record | EnvString[] user?: string labels?: Record + image?: string + platform?: string } export type ComposeModel = { diff --git a/packages/core/src/git.ts b/packages/core/src/git.ts index 3fe923d4..47103a87 100644 --- a/packages/core/src/git.ts +++ b/packages/core/src/git.ts @@ -5,7 +5,9 @@ export function gitContext(cwd: string = process.cwd()) { const branchName = async () => await execGit('rev-parse --abbrev-ref HEAD') .catch(() => undefined) - const head = async () => await execGit('rev-parse HEAD') + const head = async ( + { short }: { short?: boolean } = { short: false }, + ) => await execGit(`rev-parse ${short ? '--short ' : ''}HEAD`) .catch(() => undefined) const author = async (commit?: string) => { diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 478b3eac..df196378 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "declaration": true, - "lib": ["ES2022"], + "lib": ["ES2022", "ESNext.Disposable"], "module": "CommonJS", "target": "ES2019", "moduleResolution": "node", diff --git a/packages/driver-azure/package.json b/packages/driver-azure/package.json index 566ed2fe..d3f9cfd6 100644 --- a/packages/driver-azure/package.json +++ b/packages/driver-azure/package.json @@ -27,8 +27,8 @@ "@types/azure": "^0.9.20", "@types/lodash": "^4.14.192", "@types/node": "18", - "@typescript-eslint/eslint-plugin": "6.7.4", - "@typescript-eslint/parser": "6.7.4", + "@typescript-eslint/eslint-plugin": "6.10.0", + "@typescript-eslint/parser": "6.10.0", "eslint": "^8.36.0", "eslint-config-airbnb": "^19.0.4", "eslint-config-oclif": "^4", @@ -41,7 +41,7 @@ "shx": "^0.3.3", "ts-node": "^10.9.1", "tslib": "^2.5.0", - "typescript": "^5.0.4" + "typescript": "^5.2.2" }, "scripts": { "lint": "eslint . --ext .ts,.tsx --cache", diff --git a/packages/driver-gce/package.json b/packages/driver-gce/package.json index ded09d88..47edb4da 100644 --- a/packages/driver-gce/package.json +++ b/packages/driver-gce/package.json @@ -23,8 +23,8 @@ "devDependencies": { "@types/lodash": "^4.14.192", "@types/node": "18", - "@typescript-eslint/eslint-plugin": "6.7.4", - "@typescript-eslint/parser": "6.7.4", + "@typescript-eslint/eslint-plugin": "6.10.0", + "@typescript-eslint/parser": "6.10.0", "eslint": "^8.36.0", "eslint-config-airbnb": "^19.0.4", "eslint-config-oclif": "^4", @@ -37,7 +37,7 @@ "shx": "^0.3.3", "ts-node": "^10.9.1", "tslib": "^2.5.0", - "typescript": "^5.0.4" + "typescript": "^5.2.2" }, "scripts": { "lint": "eslint . --ext .ts,.tsx --cache", diff --git a/packages/driver-kube-pod/package.json b/packages/driver-kube-pod/package.json index a8438c3d..35b89281 100644 --- a/packages/driver-kube-pod/package.json +++ b/packages/driver-kube-pod/package.json @@ -28,8 +28,8 @@ "@types/lodash": "^4.14.192", "@types/node": "18", "@types/stream-buffers": "^3.0.4", - "@typescript-eslint/eslint-plugin": "6.7.4", - "@typescript-eslint/parser": "6.7.4", + "@typescript-eslint/eslint-plugin": "6.10.0", + "@typescript-eslint/parser": "6.10.0", "eslint": "^8.36.0", "eslint-config-airbnb": "^19.0.4", "eslint-config-oclif": "^4", @@ -42,7 +42,7 @@ "shx": "^0.3.3", "ts-node": "^10.9.1", "tslib": "^2.5.0", - "typescript": "^5.0.4" + "typescript": "^5.2.2" }, "scripts": { "test": "yarn jest", diff --git a/packages/driver-lightsail/package.json b/packages/driver-lightsail/package.json index a4a69154..5ca3cf55 100644 --- a/packages/driver-lightsail/package.json +++ b/packages/driver-lightsail/package.json @@ -23,8 +23,8 @@ "devDependencies": { "@types/lodash": "^4.14.192", "@types/node": "18", - "@typescript-eslint/eslint-plugin": "6.7.4", - "@typescript-eslint/parser": "6.7.4", + "@typescript-eslint/eslint-plugin": "6.10.0", + "@typescript-eslint/parser": "6.10.0", "eslint": "^8.36.0", "eslint-config-airbnb": "^19.0.4", "eslint-config-oclif": "^4", @@ -37,7 +37,7 @@ "shx": "^0.3.3", "ts-node": "^10.9.1", "tslib": "^2.5.0", - "typescript": "^5.0.4" + "typescript": "^5.2.2" }, "scripts": { "lint": "eslint . --ext .ts,.tsx --cache", diff --git a/packages/plugin-github-pr-link/package.json b/packages/plugin-github-pr-link/package.json index b373f27e..20b35b2a 100644 --- a/packages/plugin-github-pr-link/package.json +++ b/packages/plugin-github-pr-link/package.json @@ -17,11 +17,11 @@ }, "devDependencies": { "@types/nunjucks": "^3.2.2", - "@typescript-eslint/eslint-plugin": "6.7.4", - "@typescript-eslint/parser": "6.7.4", + "@typescript-eslint/eslint-plugin": "6.10.0", + "@typescript-eslint/parser": "6.10.0", "eslint": "^8.36.0", "shx": "^0.3.3", - "typescript": "^5.0.4" + "typescript": "^5.2.2" }, "scripts": { "lint": "eslint . --ext .ts,.tsx --cache", diff --git a/tunnel-server/package.json b/tunnel-server/package.json index 18696123..25977f95 100644 --- a/tunnel-server/package.json +++ b/tunnel-server/package.json @@ -38,13 +38,13 @@ "@types/node": "18", "@types/node-fetch": "^2.6.4", "@types/ssh2": "^1.11.8", - "@typescript-eslint/eslint-plugin": "6.7.4", - "@typescript-eslint/parser": "6.7.4", + "@typescript-eslint/eslint-plugin": "6.10.0", + "@typescript-eslint/parser": "6.10.0", "eslint": "^8.36.0", "jest": "29.7.0", "nodemon": "^2.0.20", "ts-jest": "29.1.1", - "typescript": "^5.0.4", + "typescript": "^5.2.2", "wait-for-expect": "^3.0.2" }, "scripts": { diff --git a/yarn.lock b/yarn.lock index ce0bbb06..71ea24f0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4069,16 +4069,16 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@6.7.4": - version "6.7.4" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.4.tgz#057338df21b6062c2f2fc5999fbea8af9973ac6d" - integrity sha512-DAbgDXwtX+pDkAHwiGhqP3zWUGpW49B7eqmgpPtg+BKJXwdct79ut9+ifqOFPJGClGKSHXn2PTBatCnldJRUoA== +"@typescript-eslint/eslint-plugin@6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.10.0.tgz#cfe2bd34e26d2289212946b96ab19dcad64b661a" + integrity sha512-uoLj4g2OTL8rfUQVx2AFO1hp/zja1wABJq77P6IclQs6I/m9GLrm7jCdgzZkvWdDCQf1uEvoa8s8CupsgWQgVg== dependencies: "@eslint-community/regexpp" "^4.5.1" - "@typescript-eslint/scope-manager" "6.7.4" - "@typescript-eslint/type-utils" "6.7.4" - "@typescript-eslint/utils" "6.7.4" - "@typescript-eslint/visitor-keys" "6.7.4" + "@typescript-eslint/scope-manager" "6.10.0" + "@typescript-eslint/type-utils" "6.10.0" + "@typescript-eslint/utils" "6.10.0" + "@typescript-eslint/visitor-keys" "6.10.0" debug "^4.3.4" graphemer "^1.4.0" ignore "^5.2.4" @@ -4112,15 +4112,15 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/parser@6.7.4": - version "6.7.4" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.7.4.tgz#23d1dd4fe5d295c7fa2ab651f5406cd9ad0bd435" - integrity sha512-I5zVZFY+cw4IMZUeNCU7Sh2PO5O57F7Lr0uyhgCJmhN/BuTlnc55KxPonR4+EM3GBdfiCyGZye6DgMjtubQkmA== +"@typescript-eslint/parser@6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.10.0.tgz#578af79ae7273193b0b6b61a742a2bc8e02f875a" + integrity sha512-+sZwIj+s+io9ozSxIWbNB5873OSdfeBEH/FR0re14WLI6BaKuSOnnwCJ2foUiu8uXf4dRp1UqHP0vrZ1zXGrog== dependencies: - "@typescript-eslint/scope-manager" "6.7.4" - "@typescript-eslint/types" "6.7.4" - "@typescript-eslint/typescript-estree" "6.7.4" - "@typescript-eslint/visitor-keys" "6.7.4" + "@typescript-eslint/scope-manager" "6.10.0" + "@typescript-eslint/types" "6.10.0" + "@typescript-eslint/typescript-estree" "6.10.0" + "@typescript-eslint/visitor-keys" "6.10.0" debug "^4.3.4" "@typescript-eslint/parser@^4.31.2": @@ -4149,21 +4149,21 @@ "@typescript-eslint/types" "5.54.0" "@typescript-eslint/visitor-keys" "5.54.0" -"@typescript-eslint/scope-manager@6.7.4": - version "6.7.4" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.7.4.tgz#a484a17aa219e96044db40813429eb7214d7b386" - integrity sha512-SdGqSLUPTXAXi7c3Ob7peAGVnmMoGzZ361VswK2Mqf8UOYcODiYvs8rs5ILqEdfvX1lE7wEZbLyELCW+Yrql1A== +"@typescript-eslint/scope-manager@6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.10.0.tgz#b0276118b13d16f72809e3cecc86a72c93708540" + integrity sha512-TN/plV7dzqqC2iPNf1KrxozDgZs53Gfgg5ZHyw8erd6jd5Ta/JIEcdCheXFt9b1NYb93a1wmIIVW/2gLkombDg== dependencies: - "@typescript-eslint/types" "6.7.4" - "@typescript-eslint/visitor-keys" "6.7.4" + "@typescript-eslint/types" "6.10.0" + "@typescript-eslint/visitor-keys" "6.10.0" -"@typescript-eslint/type-utils@6.7.4": - version "6.7.4" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.7.4.tgz#847cd3b59baf948984499be3e0a12ff07373e321" - integrity sha512-n+g3zi1QzpcAdHFP9KQF+rEFxMb2KxtnJGID3teA/nxKHOVi3ylKovaqEzGBbVY2pBttU6z85gp0D00ufLzViQ== +"@typescript-eslint/type-utils@6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.10.0.tgz#1007faede067c78bdbcef2e8abb31437e163e2e1" + integrity sha512-wYpPs3hgTFblMYwbYWPT3eZtaDOjbLyIYuqpwuLBBqhLiuvJ+9sEp2gNRJEtR5N/c9G1uTtQQL5AhV0fEPJYcg== dependencies: - "@typescript-eslint/typescript-estree" "6.7.4" - "@typescript-eslint/utils" "6.7.4" + "@typescript-eslint/typescript-estree" "6.10.0" + "@typescript-eslint/utils" "6.10.0" debug "^4.3.4" ts-api-utils "^1.0.1" @@ -4177,10 +4177,10 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.54.0.tgz#7d519df01f50739254d89378e0dcac504cab2740" integrity sha512-nExy+fDCBEgqblasfeE3aQ3NuafBUxZxgxXcYfzYRZFHdVvk5q60KhCSkG0noHgHRo/xQ/BOzURLZAafFpTkmQ== -"@typescript-eslint/types@6.7.4": - version "6.7.4" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.7.4.tgz#5d358484d2be986980c039de68e9f1eb62ea7897" - integrity sha512-o9XWK2FLW6eSS/0r/tgjAGsYasLAnOWg7hvZ/dGYSSNjCh+49k5ocPN8OmG5aZcSJ8pclSOyVKP2x03Sj+RrCA== +"@typescript-eslint/types@6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.10.0.tgz#f4f0a84aeb2ac546f21a66c6e0da92420e921367" + integrity sha512-36Fq1PWh9dusgo3vH7qmQAj5/AZqARky1Wi6WpINxB6SkQdY5vQoT2/7rW7uBIsPDcvvGCLi4r10p0OJ7ITAeg== "@typescript-eslint/typescript-estree@4.33.0": version "4.33.0" @@ -4208,30 +4208,30 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@6.7.4": - version "6.7.4" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.4.tgz#f2baece09f7bb1df9296e32638b2e1130014ef1a" - integrity sha512-ty8b5qHKatlNYd9vmpHooQz3Vki3gG+3PchmtsA4TgrZBKWHNjWfkQid7K7xQogBqqc7/BhGazxMD5vr6Ha+iQ== +"@typescript-eslint/typescript-estree@6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.10.0.tgz#667381eed6f723a1a8ad7590a31f312e31e07697" + integrity sha512-ek0Eyuy6P15LJVeghbWhSrBCj/vJpPXXR+EpaRZqou7achUWL8IdYnMSC5WHAeTWswYQuP2hAZgij/bC9fanBg== dependencies: - "@typescript-eslint/types" "6.7.4" - "@typescript-eslint/visitor-keys" "6.7.4" + "@typescript-eslint/types" "6.10.0" + "@typescript-eslint/visitor-keys" "6.10.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/utils@6.7.4": - version "6.7.4" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.7.4.tgz#2236f72b10e38277ee05ef06142522e1de470ff2" - integrity sha512-PRQAs+HUn85Qdk+khAxsVV+oULy3VkbH3hQ8hxLRJXWBEd7iI+GbQxH5SEUSH7kbEoTp6oT1bOwyga24ELALTA== +"@typescript-eslint/utils@6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.10.0.tgz#4d76062d94413c30e402c9b0df8c14aef8d77336" + integrity sha512-v+pJ1/RcVyRc0o4wAGux9x42RHmAjIGzPRo538Z8M1tVx6HOnoQBCX/NoadHQlZeC+QO2yr4nNSFWOoraZCAyg== dependencies: "@eslint-community/eslint-utils" "^4.4.0" "@types/json-schema" "^7.0.12" "@types/semver" "^7.5.0" - "@typescript-eslint/scope-manager" "6.7.4" - "@typescript-eslint/types" "6.7.4" - "@typescript-eslint/typescript-estree" "6.7.4" + "@typescript-eslint/scope-manager" "6.10.0" + "@typescript-eslint/types" "6.10.0" + "@typescript-eslint/typescript-estree" "6.10.0" semver "^7.5.4" "@typescript-eslint/utils@^5.10.0": @@ -4264,12 +4264,12 @@ "@typescript-eslint/types" "5.54.0" eslint-visitor-keys "^3.3.0" -"@typescript-eslint/visitor-keys@6.7.4": - version "6.7.4" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.4.tgz#80dfecf820fc67574012375859085f91a4dff043" - integrity sha512-pOW37DUhlTZbvph50x5zZCkFn3xzwkGtNoJHzIM3svpiSkJzwOYr/kVBaXmf+RAQiUDs1AHEZVNPg6UJCJpwRA== +"@typescript-eslint/visitor-keys@6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.10.0.tgz#b9eaf855a1ac7e95633ae1073af43d451e8f84e3" + integrity sha512-xMGluxQIEtOM7bqFCo+rCMh5fqI+ZxV5RUUOa29iVPz1OgCZrtc7rFnz5cLUazlkPKYqX+75iuDq7m0HQ48nCg== dependencies: - "@typescript-eslint/types" "6.7.4" + "@typescript-eslint/types" "6.10.0" eslint-visitor-keys "^3.4.1" "@ungap/structured-clone@^1.2.0": @@ -5852,6 +5852,15 @@ define-data-property@^1.0.1: gopd "^1.0.1" has-property-descriptors "^1.0.0" +define-data-property@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.1.tgz#c35f7cd0ab09883480d12ac5cb213715587800b3" + integrity sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ== + dependencies: + get-intrinsic "^1.2.1" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + define-lazy-prop@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" @@ -5958,6 +5967,20 @@ dir-glob@^3.0.1: dependencies: path-type "^4.0.0" +disposablestack@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/disposablestack/-/disposablestack-1.1.2.tgz#aa5e1713ee584f8fc936bc3b3227ffcbc2857bd8" + integrity sha512-th2rg6l1iN8YC0KiVjOImq7MEmCaAaJlIOPSlw5S1Ee2iCeFJ2NZbwHt14X3mu2sFlOkDkSzlVlZD+kL97ZtsQ== + dependencies: + define-properties "^1.2.1" + es-abstract "^1.22.1" + es-set-tostringtag "^2.0.1" + get-intrinsic "^1.2.1" + globalthis "^1.0.3" + has-symbols "^1.0.3" + internal-slot "^1.0.5" + suppressed-error "^1.0.2" + docker-modem@^3.0.0: version "3.0.6" resolved "https://registry.yarnpkg.com/docker-modem/-/docker-modem-3.0.6.tgz#8c76338641679e28ec2323abb65b3276fb1ce597" @@ -12810,6 +12833,20 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== +suppressed-error@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/suppressed-error/-/suppressed-error-1.0.2.tgz#743ae974535b9ce6eb79c0f0b17c6db659b8baf5" + integrity sha512-DRCmKxbAr3MPoluOCMYsvTabZ3l1RsLCWELW/siVrWqDthyW4gq1vA5O87iCXJQYrcxgFTOJU125JAlDwmgPiw== + dependencies: + define-data-property "^1.1.0" + define-properties "^1.2.1" + es-abstract "^1.22.1" + function-bind "^1.1.1" + get-intrinsic "^1.2.1" + globalthis "^1.0.3" + has-property-descriptors "^1.0.0" + set-function-name "^2.0.1" + syncpack@^9.8.4: version "9.8.6" resolved "https://registry.yarnpkg.com/syncpack/-/syncpack-9.8.6.tgz#edc06ea03295773165fb5086bb2655be03e5f094" @@ -13272,7 +13309,7 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== -typescript@^5.0.4: +typescript@^5.2.2: version "5.2.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78" integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==