carlin 1.33.0 → 1.34.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.
Files changed (2) hide show
  1. package/dist/index.js +12 -1
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -2409,6 +2409,7 @@ var buildLambdaCode = async ({
2409
2409
  lambdaEntryPoints,
2410
2410
  lambdaEntryPointsBaseDir = ".",
2411
2411
  lambdaExternal = [],
2412
+ lambdaFormat = "esm",
2412
2413
  lambdaOutdir
2413
2414
  }) => {
2414
2415
  log5.info(logPrefix5, "Building Lambda single file...");
@@ -2434,14 +2435,16 @@ var buildLambdaCode = async ({
2434
2435
  * Some packages as `graphql` are not compatible with ESM yet.
2435
2436
  * https://github.com/graphql/graphql-js/issues/3603
2436
2437
  */
2437
- format: "cjs",
2438
+ format: lambdaFormat,
2438
2439
  /**
2439
2440
  * https://esbuild.github.io/api/#minify
2440
2441
  */
2441
2442
  minifySyntax: true,
2442
2443
  platform: "node",
2444
+ splitting: lambdaFormat === "esm",
2443
2445
  outbase: path__default.join(process.cwd(), lambdaEntryPointsBaseDir),
2444
2446
  outdir: path__default.join(process.cwd(), lambdaOutdir),
2447
+ outExtension: { ".js": lambdaFormat === "esm" ? ".mjs" : ".cjs" },
2445
2448
  target: typescriptConfig.target,
2446
2449
  treeShaking: true
2447
2450
  });
@@ -2664,6 +2667,7 @@ var deployLambdaCode = async ({
2664
2667
  lambdaImage,
2665
2668
  lambdaEntryPoints,
2666
2669
  lambdaEntryPointsBaseDir = "src",
2670
+ lambdaFormat,
2667
2671
  lambdaOutdir = "dist",
2668
2672
  stackName
2669
2673
  }) => {
@@ -2681,6 +2685,7 @@ var deployLambdaCode = async ({
2681
2685
  lambdaExternal,
2682
2686
  lambdaEntryPoints,
2683
2687
  lambdaEntryPointsBaseDir,
2688
+ lambdaFormat,
2684
2689
  lambdaOutdir
2685
2690
  });
2686
2691
  const { bucket, key, versionId } = await uploadCodeToS3({
@@ -4055,6 +4060,12 @@ var options5 = {
4055
4060
  describe: "This is an array of files that each serve as an input to the bundling algorithm for Lambda functions.",
4056
4061
  type: "string"
4057
4062
  },
4063
+ "lambda-format": {
4064
+ choices: ["esm", "cjs"],
4065
+ default: "esm",
4066
+ describe: "Lambda code format.",
4067
+ type: "string"
4068
+ },
4058
4069
  "lambda-outdir": {
4059
4070
  default: "dist",
4060
4071
  describe: "Output directory for built Lambda code.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carlin",
3
- "version": "1.33.0",
3
+ "version": "1.34.0",
4
4
  "description": "",
5
5
  "license": "GPL-3.0",
6
6
  "author": "Pedro Arantes <arantespp@gmail.com> (https://twitter.com/arantespp)",
@@ -47,8 +47,8 @@
47
47
  "vercel": "^34.1.3",
48
48
  "yargs": "^17.7.2",
49
49
  "@ttoss/cloudformation": "^0.9.7",
50
- "@ttoss/config": "^1.32.3",
51
- "@ttoss/read-config-file": "^1.0.2"
50
+ "@ttoss/read-config-file": "^1.0.2",
51
+ "@ttoss/config": "^1.32.3"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/adm-zip": "^0.5.5",