Skip to content

Commit a06af68

Browse files
authored
chore(ssh-tunnel): move package into monorepo COMPASS-5157 (#2670)
Move the ssh-tunnel package from https://github.com/mongodb-js/ssh-tunnel into the monorepo. This is not a full 1:1 copy of the original: - The workspace was created with the create-workspace script - Source and test files were copied over, with two modifications: - Source files were only amended to add necessary linting overrides - Test files were amended to account for using chai instead of jest - Test fixtures were put into test/fixtures - No other files were copied - Downstream package usage was amended to fix TS compilation errors
1 parent 5979713 commit a06af68

File tree

18 files changed

+1210
-20
lines changed

18 files changed

+1210
-20
lines changed

package-lock.json

Lines changed: 682 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/connection-model/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"mongodb": "^4.2.2"
3737
},
3838
"dependencies": {
39-
"@mongodb-js/ssh-tunnel": "^1.2.1",
39+
"@mongodb-js/ssh-tunnel": "^1.2.2",
4040
"ampersand-model": "^8.0.1",
4141
"ampersand-rest-collection": "^6.0.0",
4242
"debug": "4.3.0",

packages/data-service/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
},
5959
"dependencies": {
6060
"@mongodb-js/compass-logging": "^0.6.0",
61-
"@mongodb-js/ssh-tunnel": "^1.2.1",
61+
"@mongodb-js/ssh-tunnel": "^1.2.2",
6262
"async": "^3.2.0",
6363
"debug": "4.3.0",
6464
"get-port": "^5.1.1",

packages/data-service/src/redact.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ export function redactConnectionOptions(
3030
return redacted;
3131
}
3232

33-
export function redactSshTunnelOptions(
34-
options: SshTunnelConfig
35-
): SshTunnelConfig {
33+
export function redactSshTunnelOptions<T extends Partial<SshTunnelConfig>>(
34+
options: T
35+
): T {
3636
const redacted = { ...options };
3737

3838
if (redacted.password) {

packages/data-service/src/ssh-tunnel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export async function openSshTunnel(
3838
forwardTimeout: 20000,
3939
keepaliveInterval: 20000,
4040
srcAddr: '127.0.0.1', // OS should figure out an ephemeral srcPort.
41-
dstPort: dstPort,
41+
dstPort: +dstPort,
4242
dstAddr: dstHost,
4343
localPort: localPort,
4444
localAddr: '127.0.0.1',

packages/ssh-tunnel/.depcheckrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ignores:
2+
- "@mongodb-js/prettier-config-compass"
3+
- "@mongodb-js/tsconfig-compass"
4+
- "@types/chai"
5+
- "@types/sinon-chai"
6+
- "sinon"

packages/ssh-tunnel/.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.nyc-output
2+
dist

packages/ssh-tunnel/.eslintrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
root: true,
3+
extends: ['@mongodb-js/eslint-config-compass'],
4+
parserOptions: {
5+
tsconfigRootDir: __dirname,
6+
project: ['./tsconfig-lint.json'],
7+
},
8+
};

packages/ssh-tunnel/.mocharc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@mongodb-js/mocha-config-compass');
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.nyc-output
2+
dist

0 commit comments

Comments
 (0)