Skip to content

Commit 6e9108a

Browse files
committed
add support for ECR remote cache, fix docs build
1 parent eb4e403 commit 6e9108a

File tree

66 files changed

+1595
-1599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1595
-1599
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ scripts/simon
3434
docs/node_modules
3535
docs/.next
3636
docs/public/_timestamps.json
37+
docs/out
3738

3839
# Ignore Gradle project-specific cache directory
3940
.gradle

@generated/schemas/enhanced-config-schema.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"lockfileVersion": 1,
3+
"workspaces": {
4+
"": {
5+
"dependencies": {
6+
"hono": "^4.10.7",
7+
},
8+
},
9+
},
10+
"packages": {
11+
"hono": ["[email protected]", "", {}, "sha512-icXIITfw/07Q88nLSkB9aiUrd8rYzSweK681Kjo/TSggaGbOX4RRyxxm71v+3PC8C/j+4rlxGeoTRxQDkaJkUw=="],
12+
}
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"dependencies": {
3+
"hono": "^4.10.7"
4+
}
5+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* eslint-disable antfu/no-top-level-await */
2+
const triggerEvent = JSON.parse(process.env.STP_TRIGGER_EVENT_DATA!);
3+
4+
await new Promise((resolve) => setTimeout(resolve, 5000));
5+
6+
console.log(triggerEvent);
7+
8+
throw new Error('Test error');
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { Hono } from 'hono';
2+
3+
const app = new Hono();
4+
app.get('/', (c) => c.text('Hello Bun!'));
5+
6+
export default app;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type { Handler } from 'aws-lambda';
2+
3+
const handler: Handler = async (event, context) => {
4+
console.log(event, context);
5+
throw new Error('Test error');
6+
return {
7+
statusCode: 200,
8+
body: JSON.stringify({
9+
message: 'Hello, World!'
10+
})
11+
};
12+
};
13+
14+
export default handler;
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import {
2+
BatchJob,
3+
defineConfig,
4+
LambdaFunction,
5+
MultiContainerWorkload,
6+
StacktapeImageBuildpackPackaging,
7+
StacktapeLambdaBuildpackPackaging,
8+
WebService
9+
} from '../../__release-npm';
10+
11+
export default defineConfig(() => {
12+
const lambda = new LambdaFunction({
13+
packaging: new StacktapeLambdaBuildpackPackaging({
14+
entryfilePath: './src/lambda.ts'
15+
}),
16+
url: {
17+
enabled: true,
18+
cors: {
19+
enabled: true
20+
}
21+
}
22+
});
23+
24+
const webService = new WebService({
25+
packaging: new StacktapeImageBuildpackPackaging({
26+
entryfilePath: './src/container.ts',
27+
// Fastify uses dynamic requires that don't work when bundled to ESM
28+
languageSpecificConfig: {
29+
dependenciesToExcludeFromBundle: ['fastify']
30+
}
31+
}),
32+
resources: {
33+
cpu: 0.25,
34+
memory: 512
35+
}
36+
});
37+
38+
const batchJob = new BatchJob({
39+
container: {
40+
packaging: new StacktapeImageBuildpackPackaging({
41+
entryfilePath: './src/batch-job.ts'
42+
})
43+
},
44+
resources: {
45+
cpu: 1,
46+
memory: 2048
47+
}
48+
});
49+
50+
const multiContainerWorkload = new MultiContainerWorkload({
51+
containers: [
52+
{
53+
name: 'mcw',
54+
packaging: new StacktapeImageBuildpackPackaging({
55+
entryfilePath: './src/container.ts',
56+
languageSpecificConfig: {
57+
dependenciesToExcludeFromBundle: ['fastify']
58+
}
59+
})
60+
}
61+
],
62+
resources: {
63+
cpu: 0.25,
64+
memory: 512
65+
}
66+
});
67+
68+
return {
69+
resources: { lambda, webService, batchJob, multiContainerWorkload }
70+
};
71+
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import type { Handler } from 'aws-lambda';
2+
3+
const handler: Handler = async (event, context) => {
4+
console.log(event, context);
5+
return {
6+
statusCode: 200,
7+
body: JSON.stringify({
8+
message: 'Hello, World!'
9+
})
10+
};
11+
};
12+
13+
export default handler;

_test-stacks/simple-lambda/stacktape.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { defineConfig, LambdaFunction, StacktapeLambdaBuildpackPackaging } from
33
export default defineConfig(() => {
44
const lambda = new LambdaFunction({
55
packaging: new StacktapeLambdaBuildpackPackaging({
6-
entryfilePath: './src/throwing.ts'
6+
entryfilePath: './src/simple-lambda.ts'
77
}),
88
url: {
99
enabled: true,
@@ -16,8 +16,8 @@ export default defineConfig(() => {
1616
return {
1717
...props,
1818
MemorySize: (props.MemorySize ?? 128) * 2,
19-
Description: 'This is a test lambda',
20-
}
19+
Description: 'This is a test lambda'
20+
};
2121
}
2222
}
2323
});

0 commit comments

Comments
 (0)