lambda-live-debugger 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
Binary file
|
|
@@ -21,6 +21,6 @@ export declare class SlsFramework implements IFramework {
|
|
|
21
21
|
* @returns Lambda functions
|
|
22
22
|
*/
|
|
23
23
|
getLambdas(config: LldConfigBase): Promise<LambdaResource[]>;
|
|
24
|
-
protected getEsBuildOptions(serverless: Serverless): EsBuildOptions | undefined;
|
|
24
|
+
protected getEsBuildOptions(serverless: Serverless, config: LldConfigBase): EsBuildOptions | undefined;
|
|
25
25
|
}
|
|
26
26
|
export declare const slsFramework: SlsFramework;
|
|
@@ -47,6 +47,9 @@ export class SlsFramework {
|
|
|
47
47
|
process.argv = [];
|
|
48
48
|
let resolveConfigurationPath;
|
|
49
49
|
let readConfiguration;
|
|
50
|
+
let resolveVariables;
|
|
51
|
+
let resolveVariablesMeta;
|
|
52
|
+
let sources;
|
|
50
53
|
let Serverless;
|
|
51
54
|
try {
|
|
52
55
|
// lazy load modules
|
|
@@ -56,11 +59,43 @@ export class SlsFramework {
|
|
|
56
59
|
readConfiguration = (await import(
|
|
57
60
|
//@ts-ignore
|
|
58
61
|
'serverless/lib/configuration/read.js')).default;
|
|
62
|
+
resolveVariables = (await import(
|
|
63
|
+
//@ts-ignore
|
|
64
|
+
'serverless/lib/configuration/variables/resolve.js')).default;
|
|
65
|
+
resolveVariablesMeta = (await import(
|
|
66
|
+
//@ts-ignore
|
|
67
|
+
'serverless/lib/configuration/variables/resolve-meta.js')).default;
|
|
68
|
+
const env = await import(
|
|
69
|
+
//@ts-ignore
|
|
70
|
+
'serverless/lib/configuration/variables/sources/env.js');
|
|
71
|
+
const file = await import(
|
|
72
|
+
//@ts-ignore
|
|
73
|
+
'serverless/lib/configuration/variables/sources/file.js');
|
|
74
|
+
const opt = await import(
|
|
75
|
+
//@ts-ignore
|
|
76
|
+
'serverless/lib/configuration/variables/sources/opt.js');
|
|
77
|
+
const self = await import(
|
|
78
|
+
//@ts-ignore
|
|
79
|
+
'serverless/lib/configuration/variables/sources/self.js');
|
|
80
|
+
const strToBool = await import(
|
|
81
|
+
//@ts-ignore
|
|
82
|
+
'serverless/lib/configuration/variables/sources/str-to-bool.js');
|
|
83
|
+
const sls = await import(
|
|
84
|
+
//@ts-ignores
|
|
85
|
+
'serverless/lib/configuration/variables/sources/instance-dependent/get-sls.js');
|
|
86
|
+
sources = {
|
|
87
|
+
env: env.default,
|
|
88
|
+
file: file.default,
|
|
89
|
+
opt: opt.default,
|
|
90
|
+
self: self.default,
|
|
91
|
+
strToBool: strToBool.default,
|
|
92
|
+
sls: sls.default(),
|
|
93
|
+
};
|
|
59
94
|
Serverless = (await import('serverless')).default;
|
|
60
95
|
}
|
|
61
96
|
catch (error) {
|
|
62
97
|
Logger.error('Error loading serverless modules', error);
|
|
63
|
-
Logger.log('If you are running Lambda Live Debugger from a global installation, install Serverless Framework globally as well.');
|
|
98
|
+
Logger.log('If you are running Lambda Live Debugger from a global installation, install Serverless Framework globally as well. If you are using monorepo, install Serverless Framework also in the project root folder.');
|
|
64
99
|
throw new Error(`Error loading serverless modules. ${error.message}`, {
|
|
65
100
|
cause: error,
|
|
66
101
|
});
|
|
@@ -83,7 +118,15 @@ export class SlsFramework {
|
|
|
83
118
|
if (config.profile) {
|
|
84
119
|
options.profile = config.profile;
|
|
85
120
|
}
|
|
86
|
-
const variablesMeta =
|
|
121
|
+
const variablesMeta = resolveVariablesMeta(configuration);
|
|
122
|
+
await resolveVariables({
|
|
123
|
+
serviceDir,
|
|
124
|
+
configuration,
|
|
125
|
+
variablesMeta,
|
|
126
|
+
sources,
|
|
127
|
+
options,
|
|
128
|
+
fulfilledSources: new Set(),
|
|
129
|
+
});
|
|
87
130
|
let serverless;
|
|
88
131
|
try {
|
|
89
132
|
serverless = new Serverless({
|
|
@@ -117,7 +160,7 @@ export class SlsFramework {
|
|
|
117
160
|
});
|
|
118
161
|
}
|
|
119
162
|
const lambdasDiscovered = [];
|
|
120
|
-
const esBuildOptions = this.getEsBuildOptions(serverless);
|
|
163
|
+
const esBuildOptions = this.getEsBuildOptions(serverless, config);
|
|
121
164
|
const lambdas = serverless.service.functions;
|
|
122
165
|
Logger.verbose(`[SLS] Found Lambdas:`, JSON.stringify(lambdas, null, 2));
|
|
123
166
|
for (const func in lambdas) {
|
|
@@ -165,7 +208,8 @@ export class SlsFramework {
|
|
|
165
208
|
}
|
|
166
209
|
return lambdasDiscovered;
|
|
167
210
|
}
|
|
168
|
-
|
|
211
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
212
|
+
getEsBuildOptions(serverless, config) {
|
|
169
213
|
// 1) Get from from LLD specific options in custom.lldEsBuild
|
|
170
214
|
let esBuildOptions = serverless.service.custom?.lldEsBuild;
|
|
171
215
|
// 2) Get from serverless-esbuild plugin
|
|
@@ -189,7 +233,7 @@ export class SlsFramework {
|
|
|
189
233
|
const settings = serverless.service.custom?.serverlessPluginTypescript;
|
|
190
234
|
if (settings) {
|
|
191
235
|
esBuildOptions = {
|
|
192
|
-
tsconfig: settings.tsConfigFileLocation,
|
|
236
|
+
tsconfig: path.resolve(settings.tsConfigFileLocation),
|
|
193
237
|
};
|
|
194
238
|
}
|
|
195
239
|
}
|