Skip to content

Commit 6259d60

Browse files
Merge pull request #83 from ServerlessLife/81-fix-config-transpile
fix: #81 Transpiling LLD config issue
2 parents e748db9 + 3f99ba5 commit 6259d60

File tree

6 files changed

+29
-3
lines changed

6 files changed

+29
-3
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ getLambdas: async (foundLambdas, config) => {
246246
.replace('.js', '.ts');
247247
}
248248
}
249+
return foundLambdas;
249250
};
250251
```
251252

@@ -264,6 +265,7 @@ export default {
264265
};
265266
}
266267
}
268+
return foundLambdas;
267269
}
268270
} satisfies LldConfigTs;
269271
```

fix-imports.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ async function processFiles(directory) {
2020
const updatedData = data
2121
.split('\n')
2222
.map((line) => {
23-
if (line.trim().startsWith('import')) {
23+
if (
24+
line.trim().startsWith('import') ||
25+
line.trim().startsWith('export')
26+
) {
2427
return line.replace(/\.js"/g, '.mjs"').replace(/\.js'/g, ".mjs'");
2528
}
2629
return line;

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"email": "[email protected]",
1414
"organization": false
1515
},
16+
"exports": {
17+
".": "./dist/index.mjs"
18+
},
1619
"keywords": [
1720
"aws",
1821
"lambda",

src/configuration/getConfigFromTsConfigFile.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@ export async function getConfigTsFromConfigFile(
3535
outfile: compileOutput,
3636
sourcemap: true,
3737
treeShaking: true,
38+
tsconfigRaw: {
39+
compilerOptions: {
40+
esModuleInterop: true,
41+
skipLibCheck: true,
42+
target: 'esnext',
43+
allowJs: true,
44+
resolveJsonModule: true,
45+
moduleDetection: 'force',
46+
isolatedModules: true,
47+
verbatimModuleSyntax: true,
48+
strict: true,
49+
noUncheckedIndexedAccess: true,
50+
noImplicitOverride: true,
51+
module: 'NodeNext',
52+
sourceMap: true,
53+
lib: ['esnext'],
54+
},
55+
},
3856
banner: {
3957
js: [
4058
`import { createRequire as topLevelCreateRequire } from 'module';`,

src/configuration/getConfigFromWizard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export async function getConfigFromWizard({
5151
},
5252
]);
5353

54-
if (answers.framework === 'other') {
54+
if (answers.framework === 'other' || answers.framework === 'none') {
5555
answers.framework = undefined;
5656
}
5757

src/types/lldConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export type LldConfigBase = {
3232
interval: number;
3333

3434
/**
35-
* Framework
35+
* Framework (cdk, sls, sam, terraform, none)
3636
*/
3737
framework?: string;
3838

0 commit comments

Comments
 (0)