Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Use '@thundra/slsdebugger' for lambda debugger process #368

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
},
"dependencies": {
"@thundra/instrumenter": "^1.3.6",
"@thundra/slsdebugger": "^0.0.1",
"@thundra/warmup": "^1.1.2",
"fast-copy": "^2.1.0",
"isomorphic-git": "^1.11.1",
Expand Down
22 changes: 0 additions & 22 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,28 +49,6 @@ module.exports = [
})
]
},
{
input: './src/debugBridge.ts',
output: {
file: 'dist/debugBridge.js',
format: 'cjs',
},
plugins: [
typescript(),
terser({
warnings: 'verbose',
compress: {
warnings: 'verbose',
},
mangle: {
keep_fnames: true,
},
output: {
beautify: false,
},
}),
],
},
{
input: './src/handler.ts',
output: {
Expand Down
1 change: 0 additions & 1 deletion src/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,6 @@ export const StdErrorLogContext = 'STDERR';

export const DefaultMongoCommandSizeLimit = 128 * 1024;

export const DEBUG_BRIDGE_FILE_NAME = 'debugBridge.js';
export const BROKER_WS_PROTOCOL = 'ws://';
export const BROKER_WSS_PROTOCOL = 'wss://';
export const BROKER_WS_HTTP_ERROR_PATTERN = /:\s*\D*(\d+)/;
Expand Down
19 changes: 19 additions & 0 deletions src/adaptor/slsdebugger/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const SLSDebugger = require('@thundra/slsdebugger');

let initiated = false;
export const initiate = async () => {
if (!initiated) {
SLSDebugger.init();
initiated = true;
}
}

export const get = (additionalInfo : { [key: string]: any }) => {
if (!initiated) {
initiate();
}

return SLSDebugger._getSLSDebuggerInstance(additionalInfo);
}


20 changes: 2 additions & 18 deletions src/config/ConfigNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,24 +227,8 @@ class ConfigNames {

/////////////////////////////////////////////////////////////////////////////

public static readonly THUNDRA_LAMBDA_DEBUGGER_ENABLE: string =
'thundra.agent.lambda.debugger.enable';
public static readonly THUNDRA_LAMBDA_DEBUGGER_PORT: string =
'thundra.agent.lambda.debugger.port';
public static readonly THUNDRA_LAMBDA_DEBUGGER_LOGS_ENABLE: string =
'thundra.agent.lambda.debugger.logs.enable';
public static readonly THUNDRA_LAMBDA_DEBUGGER_WAIT_MAX: string =
'thundra.agent.lambda.debugger.wait.max';
public static readonly THUNDRA_LAMBDA_DEBUGGER_IO_WAIT: string =
'thundra.agent.lambda.debugger.io.wait';
public static readonly THUNDRA_LAMBDA_DEBUGGER_BROKER_PORT: string =
'thundra.agent.lambda.debugger.broker.port';
public static readonly THUNDRA_LAMBDA_DEBUGGER_BROKER_HOST: string =
'thundra.agent.lambda.debugger.broker.host';
public static readonly THUNDRA_LAMBDA_DEBUGGER_SESSION_NAME: string =
'thundra.agent.lambda.debugger.session.name';
public static readonly THUNDRA_LAMBDA_DEBUGGER_AUTH_TOKEN: string =
'thundra.agent.lambda.debugger.auth.token';
public static readonly SLSDEBUGGER_AUTH_TOKEN: string =
'SLSDEBUGGER_AUTH_TOKEN';

/////////////////////////////////////////////////////////////////////////////

Expand Down
110 changes: 0 additions & 110 deletions src/debugBridge.ts

This file was deleted.

Loading