lambda-live-debugger 1.2.6 → 1.4.0
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.
- package/.vitepress/config.mts +6 -0
- package/.vitepress/markdown-it-youtube-embed.ts +45 -0
- package/.vitepress/theme/custom.css +17 -0
- package/README.md +4 -1
- package/dist/extension/extension.zip +0 -0
- package/dist/extension/nodejs/node_modules/interceptor.js +21 -11
- package/dist/extension/nodejs/node_modules/interceptor.js.map +2 -2
- package/dist/frameworks/slsFramework.mjs +77 -43
- package/package.json +12 -1
- package/prepareForTest.js +33 -0
package/.vitepress/config.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineConfig } from 'vitepress';
|
|
2
|
+
import markdownItYouTubeEmbed from './markdown-it-youtube-embed.js';
|
|
2
3
|
|
|
3
4
|
// https://vitepress.dev/reference/site-config
|
|
4
5
|
export default defineConfig({
|
|
@@ -106,4 +107,9 @@ export default defineConfig({
|
|
|
106
107
|
},
|
|
107
108
|
],
|
|
108
109
|
},
|
|
110
|
+
markdown: {
|
|
111
|
+
config: (md) => {
|
|
112
|
+
md.use(markdownItYouTubeEmbed);
|
|
113
|
+
},
|
|
114
|
+
},
|
|
109
115
|
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { PluginWithOptions } from 'markdown-it';
|
|
2
|
+
import { RuleCore } from 'markdown-it/lib/parser_core.mjs';
|
|
3
|
+
|
|
4
|
+
const markdownItYouTubeEmbed: PluginWithOptions<void> = (md) => {
|
|
5
|
+
const youtubeEmbedRule: RuleCore = (state) => {
|
|
6
|
+
const tokens = state.tokens;
|
|
7
|
+
|
|
8
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
9
|
+
const token = tokens[i];
|
|
10
|
+
|
|
11
|
+
if (
|
|
12
|
+
token.type === 'inline' &&
|
|
13
|
+
token.children &&
|
|
14
|
+
token.children.length >= 1 &&
|
|
15
|
+
token.children[0].type === 'link_open'
|
|
16
|
+
) {
|
|
17
|
+
const linkToken = token.children[0];
|
|
18
|
+
const href = linkToken.attrGet('href');
|
|
19
|
+
|
|
20
|
+
if (href && href.startsWith('https://www.youtube.com/watch?v=')) {
|
|
21
|
+
const videoId = href.split('v=')[1];
|
|
22
|
+
const iframeHtml = `
|
|
23
|
+
<div class="responsive-video">
|
|
24
|
+
<iframe
|
|
25
|
+
src="https://www.youtube.com/embed/${videoId}"
|
|
26
|
+
frameborder="0"
|
|
27
|
+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
|
28
|
+
allowfullscreen>
|
|
29
|
+
</iframe>
|
|
30
|
+
</div>
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
// Replace current token with a new HTML block token
|
|
34
|
+
const newToken = new state.Token('html_block', '', 0);
|
|
35
|
+
newToken.content = iframeHtml;
|
|
36
|
+
tokens[i] = newToken;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
md.core.ruler.push('youtube_embed', youtubeEmbedRule);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default markdownItYouTubeEmbed;
|
|
@@ -25,3 +25,20 @@
|
|
|
25
25
|
.VPSidebar {
|
|
26
26
|
padding-bottom: 20px !important;
|
|
27
27
|
}
|
|
28
|
+
|
|
29
|
+
.responsive-video {
|
|
30
|
+
position: relative;
|
|
31
|
+
padding-bottom: 56.25%; /* 16:9 aspect ratio */
|
|
32
|
+
height: 0;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
max-width: 100%;
|
|
35
|
+
background: #000;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.responsive-video iframe {
|
|
39
|
+
position: absolute;
|
|
40
|
+
top: 0;
|
|
41
|
+
left: 0;
|
|
42
|
+
width: 100%;
|
|
43
|
+
height: 100%;
|
|
44
|
+
}
|
package/README.md
CHANGED
|
@@ -7,12 +7,14 @@ This tool offers similar functionality to [SST](https://sst.dev/) and [Serverles
|
|
|
7
7
|
It supports the following frameworks:
|
|
8
8
|
|
|
9
9
|
- AWS CDK v2
|
|
10
|
-
- Serverless Framework v3 (SLS)
|
|
10
|
+
- Serverless Framework v3 (SLS) and [`osls` fork](https://github.com/oss-serverless/serverless)
|
|
11
11
|
- AWS Serverless Application Model (SAM)
|
|
12
12
|
- Terraform
|
|
13
13
|
- Any other framework or setup by implementing a simple function in TypeScript
|
|
14
14
|
- ... (Need support for another framework? Let me know!)
|
|
15
15
|
|
|
16
|
+
[](https://www.youtube.com/watch?v=BrhybwyDM0I)
|
|
17
|
+
|
|
16
18
|
## Why?
|
|
17
19
|
|
|
18
20
|
Serverless is amazing and solves many issues with traditional systems. However, writing code for Lambda functions can be challenging. The cycle of writing, deploying, running, fixing, and redeploying is time-consuming and tedious. You could use tools to run Lambda locally or use unit/integration tests; those approaches often don't replicate the actual environment closely enough.
|
|
@@ -328,6 +330,7 @@ If you have a new feature idea, please create and issue.
|
|
|
328
330
|
|
|
329
331
|
- [Kristian Dreher](https://www.linkedin.com/in/kristiandreher)
|
|
330
332
|
- [Roger Chi](https://rogerchi.com/)
|
|
333
|
+
- [Sebastian / avocadomaster](https://github.com/avocadomaster)
|
|
331
334
|
- [Sebastian Bille](https://blog.sebastianbille.com)
|
|
332
335
|
- ⭐ Your name here for notable code or documentation contributions or sample projects submitted with a bug report that resulted in tool improvement.
|
|
333
336
|
|
|
Binary file
|
|
@@ -53804,7 +53804,11 @@ async function regularMode(context, event) {
|
|
|
53804
53804
|
}, 5 * 1e3);
|
|
53805
53805
|
const ioTService = await IoTService.connect({
|
|
53806
53806
|
onMessage: async (message) => {
|
|
53807
|
-
Logger.
|
|
53807
|
+
if (Logger.isVerbose()) {
|
|
53808
|
+
Logger.verbose("IoT message", message);
|
|
53809
|
+
} else {
|
|
53810
|
+
Logger.log("IoT message", message.type);
|
|
53811
|
+
}
|
|
53808
53812
|
if (message.type === "PING") {
|
|
53809
53813
|
if (message.data.workerId === workerId) {
|
|
53810
53814
|
Logger.log("Pinged by the debugger");
|
|
@@ -53841,11 +53845,14 @@ async function regularMode(context, event) {
|
|
|
53841
53845
|
env: process.env
|
|
53842
53846
|
}
|
|
53843
53847
|
};
|
|
53844
|
-
Logger.
|
|
53845
|
-
|
|
53846
|
-
|
|
53847
|
-
|
|
53848
|
-
|
|
53848
|
+
if (Logger.isVerbose()) {
|
|
53849
|
+
Logger.verbose(
|
|
53850
|
+
`Publishing to IoT ${process.env.LLD_DEBUGGER_ID}/events`,
|
|
53851
|
+
payload
|
|
53852
|
+
);
|
|
53853
|
+
} else {
|
|
53854
|
+
Logger.log(`Publishing to IoT ${process.env.LLD_DEBUGGER_ID}/events`);
|
|
53855
|
+
}
|
|
53849
53856
|
await ioTService.publish(payload, `${process.env.LLD_DEBUGGER_ID}/events`);
|
|
53850
53857
|
return promise;
|
|
53851
53858
|
}
|
|
@@ -53914,11 +53921,14 @@ async function observableMode(context, event) {
|
|
|
53914
53921
|
env: process.env
|
|
53915
53922
|
}
|
|
53916
53923
|
};
|
|
53917
|
-
Logger.
|
|
53918
|
-
|
|
53919
|
-
|
|
53920
|
-
|
|
53921
|
-
|
|
53924
|
+
if (Logger.isVerbose()) {
|
|
53925
|
+
Logger.verbose(
|
|
53926
|
+
`Publishing to IoT ${process.env.LLD_DEBUGGER_ID}/events`,
|
|
53927
|
+
payload
|
|
53928
|
+
);
|
|
53929
|
+
} else {
|
|
53930
|
+
Logger.log(`Publishing to IoT ${process.env.LLD_DEBUGGER_ID}/events`);
|
|
53931
|
+
}
|
|
53922
53932
|
await ioTService.publish(payload, `${process.env.LLD_DEBUGGER_ID}/events`);
|
|
53923
53933
|
};
|
|
53924
53934
|
const regularHandlerPromise = regularHandler();
|