@@ -41,7 +41,7 @@ function toPascalCase(filename) {
4141 */
4242function getExampleFiles ( ) {
4343 const examplesDir = path . join ( __dirname , '../src/examples' ) ;
44-
44+
4545 if ( ! fs . existsSync ( examplesDir ) ) {
4646 throw new Error ( `Examples directory not found: ${ examplesDir } ` ) ;
4747 }
@@ -58,7 +58,7 @@ function getExampleFiles() {
5858function createFunctionResource ( filename ) {
5959 const resourceName = toPascalCase ( filename ) ;
6060 const config = EXAMPLE_CONFIGS [ filename ] || DEFAULT_CONFIG ;
61-
61+
6262 const functionResource = {
6363 Type : 'AWS::Serverless::Function' ,
6464 Properties : {
@@ -69,11 +69,14 @@ function createFunctionResource(filename) {
6969 Architectures : [ 'x86_64' ] ,
7070 MemorySize : config . memorySize ,
7171 Timeout : config . timeout ,
72+ DurableConfig : {
73+ ExecutionTimeout : 3600 ,
74+ RetentionPeriodInDays : 7
75+ } ,
7276 Environment : {
7377 Variables : {
7478 DEX_ENDPOINT : 'http://host.docker.internal:5000' ,
7579 DURABLE_VERBOSE_MODE : 'true' ,
76- DURABLE_RECORD_DEFINITION_MODE : 'true'
7780 }
7881 }
7982 } ,
@@ -95,7 +98,7 @@ function createFunctionResource(filename) {
9598 */
9699function generateTemplate ( ) {
97100 const exampleFiles = getExampleFiles ( ) ;
98-
101+
99102 if ( exampleFiles . length === 0 ) {
100103 throw new Error ( 'No TypeScript example files found in src/examples' ) ;
101104 }
@@ -122,10 +125,10 @@ function generateTemplate() {
122125function main ( ) {
123126 try {
124127 console . log ( '🔍 Scanning src/examples for TypeScript files...' ) ;
125-
128+
126129 const template = generateTemplate ( ) ;
127130 const exampleCount = Object . keys ( template . Resources ) . length ;
128-
131+
129132 console . log ( `📝 Found ${ exampleCount } example files:` ) ;
130133 Object . keys ( template . Resources ) . forEach ( resourceName => {
131134 const handler = template . Resources [ resourceName ] . Properties . Handler ;
@@ -143,10 +146,10 @@ function main() {
143146 // Write to template.yml
144147 const templatePath = path . join ( __dirname , '../template.yml' ) ;
145148 fs . writeFileSync ( templatePath , yamlContent , 'utf8' ) ;
146-
149+
147150 console . log ( `✅ Generated template.yml with ${ exampleCount } Lambda functions` ) ;
148151 console . log ( `📄 Template written to: ${ templatePath } ` ) ;
149-
152+
150153 } catch ( error ) {
151154 console . error ( '❌ Error generating template.yml:' , error . message ) ;
152155 process . exit ( 1 ) ;
0 commit comments