cdk-booster 1.1.4 → 1.2.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/README.md +20 -0
- package/dist/cdk-booster.mjs +3 -1
- package/dist/getConfigFromCliArgs.mjs +1 -0
- package/dist/types/cbConfig.d.ts +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,6 +73,26 @@ To enable verbose logging for debugging purposes, add the `-v` parameter:
|
|
|
73
73
|
}
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
+
#### TypeScript Configuration (`--tsconfig`)
|
|
77
|
+
|
|
78
|
+
Specifies the path to a custom `tsconfig.json` file for bundling CDK code.
|
|
79
|
+
|
|
80
|
+
**Default:** Uses the default TypeScript configuration discovery
|
|
81
|
+
|
|
82
|
+
**When to use:**
|
|
83
|
+
|
|
84
|
+
- When your project uses a custom tsconfig location
|
|
85
|
+
- When you need specific TypeScript compiler options for CDK code
|
|
86
|
+
|
|
87
|
+
**Example:**
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"app": "npx cdk-booster bin/your_app.ts --tsconfig tsconfig.build.json",
|
|
92
|
+
...
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
76
96
|
#### Batch Size (`-b`, `--batch`)
|
|
77
97
|
|
|
78
98
|
Controls the number of Lambda functions bundled together in a single ESBuild batch. This is particularly useful for large projects with many Lambda functions (100+).
|
package/dist/cdk-booster.mjs
CHANGED
|
@@ -41,6 +41,7 @@ async function run() {
|
|
|
41
41
|
const compileCodeFile = await compileCdk({
|
|
42
42
|
rootDir,
|
|
43
43
|
entryFile: config.entryFile,
|
|
44
|
+
tsconfig: config.tsconfig,
|
|
44
45
|
});
|
|
45
46
|
Logger.verbose(` Running the CDK code ${compileCodeFile} to extract Lambda functions.`);
|
|
46
47
|
const secondRun = await isSecondRun();
|
|
@@ -369,7 +370,7 @@ async function recreateBundlingTempFolders(lambdasEsBuildCommands) {
|
|
|
369
370
|
* @param options - Compilation options including root directory and entry file
|
|
370
371
|
* @returns Path to the compiled CDK code file
|
|
371
372
|
*/
|
|
372
|
-
async function compileCdk({ rootDir, entryFile, }) {
|
|
373
|
+
async function compileCdk({ rootDir, entryFile, tsconfig, }) {
|
|
373
374
|
const isESM = await isEsm(entryFile);
|
|
374
375
|
// Plugin that:
|
|
375
376
|
// - Fixes __dirname issues in bundled code
|
|
@@ -532,6 +533,7 @@ async function compileCdk({ rootDir, entryFile, }) {
|
|
|
532
533
|
outfile: compileCodeFile,
|
|
533
534
|
sourcemap: false,
|
|
534
535
|
plugins: [injectCodePlugin],
|
|
536
|
+
tsconfig: tsconfig,
|
|
535
537
|
...(isESM
|
|
536
538
|
? {
|
|
537
539
|
format: 'esm',
|
|
@@ -12,6 +12,7 @@ export async function getConfigFromCliArgs() {
|
|
|
12
12
|
program.option('-v, --verbose', 'Verbose logging');
|
|
13
13
|
program.option('-b, --batch <number>', 'Number of Lambdas bundled in a batch with ESBuild', parseInteger);
|
|
14
14
|
program.option('-p, --parallel <number>', 'Number of parallel ESBuild processes. You usually do not need to change this.', parseInteger);
|
|
15
|
+
program.option('--tsconfig <path>', 'Path to tsconfig.json file for bundling CDK code');
|
|
15
16
|
program.arguments('<string>');
|
|
16
17
|
program.parse(process.argv);
|
|
17
18
|
const args = program.opts();
|
package/dist/types/cbConfig.d.ts
CHANGED