carlin 1.36.2 → 1.36.4
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/dist/index.js +17 -13
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -20,8 +20,12 @@ import deepmerge from 'deepmerge';
|
|
|
20
20
|
import { hideBin } from 'yargs/helpers';
|
|
21
21
|
import yargs from 'yargs';
|
|
22
22
|
import * as esbuild from 'esbuild';
|
|
23
|
-
import { builtinModules } from 'module';
|
|
23
|
+
import { builtinModules } from 'node:module';
|
|
24
24
|
import { typescriptConfig } from '@ttoss/config';
|
|
25
|
+
import * as fs4 from 'node:fs';
|
|
26
|
+
import fs4__default from 'node:fs';
|
|
27
|
+
import * as path3 from 'node:path';
|
|
28
|
+
import path3__default from 'node:path';
|
|
25
29
|
import AdmZip from 'adm-zip';
|
|
26
30
|
import importSync from 'import-sync';
|
|
27
31
|
import semver from 'semver';
|
|
@@ -2413,11 +2417,11 @@ var buildLambdaCode = async ({
|
|
|
2413
2417
|
lambdaOutdir
|
|
2414
2418
|
}) => {
|
|
2415
2419
|
log5.info(logPrefix5, "Building Lambda single file...");
|
|
2416
|
-
if (
|
|
2417
|
-
|
|
2420
|
+
if (fs4__default.existsSync(lambdaOutdir)) {
|
|
2421
|
+
fs4__default.rmSync(lambdaOutdir, { recursive: true });
|
|
2418
2422
|
}
|
|
2419
2423
|
const entryPoints = lambdaEntryPoints.map((entryPoint) => {
|
|
2420
|
-
return
|
|
2424
|
+
return path3__default.resolve(process.cwd(), lambdaEntryPointsBaseDir, entryPoint);
|
|
2421
2425
|
});
|
|
2422
2426
|
const { errors } = esbuild.buildSync({
|
|
2423
2427
|
banner: {
|
|
@@ -2445,8 +2449,8 @@ var buildLambdaCode = async ({
|
|
|
2445
2449
|
minifySyntax: true,
|
|
2446
2450
|
platform: "node",
|
|
2447
2451
|
splitting: lambdaFormat === "esm",
|
|
2448
|
-
outbase:
|
|
2449
|
-
outdir:
|
|
2452
|
+
outbase: path3__default.join(process.cwd(), lambdaEntryPointsBaseDir),
|
|
2453
|
+
outdir: path3__default.join(process.cwd(), lambdaOutdir),
|
|
2450
2454
|
outExtension: { ".js": lambdaFormat === "esm" ? ".mjs" : ".cjs" },
|
|
2451
2455
|
target: typescriptConfig.target,
|
|
2452
2456
|
treeShaking: true
|
|
@@ -2648,8 +2652,8 @@ var uploadCodeToS3 = async ({
|
|
|
2648
2652
|
log5.info(logPrefix8, `Uploading code to S3...`);
|
|
2649
2653
|
const zip = new AdmZip();
|
|
2650
2654
|
const zipFile = `${lambdaOutdir}/${zipFileName}`;
|
|
2651
|
-
if (
|
|
2652
|
-
await
|
|
2655
|
+
if (fs4__default.existsSync(zipFile)) {
|
|
2656
|
+
await fs4__default.promises.rm(zipFile);
|
|
2653
2657
|
}
|
|
2654
2658
|
zip.addLocalFolder(lambdaOutdir);
|
|
2655
2659
|
zip.writeZip(`${lambdaOutdir}/${zipFileName}`);
|
|
@@ -2679,8 +2683,8 @@ var deployLambdaCode = async ({
|
|
|
2679
2683
|
}
|
|
2680
2684
|
log5.info(logPrefix9, "Deploying Lambda code...");
|
|
2681
2685
|
for (const entryPoint of lambdaEntryPoints) {
|
|
2682
|
-
const entryPointPath =
|
|
2683
|
-
if (!
|
|
2686
|
+
const entryPointPath = path3__default.resolve(lambdaEntryPointsBaseDir, entryPoint);
|
|
2687
|
+
if (!fs4__default.existsSync(entryPointPath)) {
|
|
2684
2688
|
throw new Error(`Entry point ${entryPointPath} does not exist.`);
|
|
2685
2689
|
}
|
|
2686
2690
|
}
|
|
@@ -2960,7 +2964,7 @@ var readCloudFormationYamlTemplate = ({
|
|
|
2960
2964
|
var loadConfig = (entryPoint) => {
|
|
2961
2965
|
const lastEntryPointName = entryPoint.split("/").pop();
|
|
2962
2966
|
const filename = lastEntryPointName?.split(".")[0];
|
|
2963
|
-
const outfile =
|
|
2967
|
+
const outfile = path3__default.resolve(process.cwd(), "out", filename + ".js");
|
|
2964
2968
|
const result = esbuild.buildSync({
|
|
2965
2969
|
bundle: true,
|
|
2966
2970
|
entryPoints: [entryPoint],
|
|
@@ -3043,7 +3047,7 @@ var findAndReadCloudFormationTemplate = async ({
|
|
|
3043
3047
|
if (acc) {
|
|
3044
3048
|
return acc;
|
|
3045
3049
|
}
|
|
3046
|
-
return
|
|
3050
|
+
return fs4.existsSync(path3.resolve(process.cwd(), cur)) ? cur : acc;
|
|
3047
3051
|
}, "");
|
|
3048
3052
|
if (!templatePath) {
|
|
3049
3053
|
throw new Error("Cannot find a CloudFormation template.");
|
|
@@ -3052,7 +3056,7 @@ var findAndReadCloudFormationTemplate = async ({
|
|
|
3052
3056
|
if (["yaml", "yml"].includes(extension)) {
|
|
3053
3057
|
return readCloudFormationYamlTemplate({ templatePath });
|
|
3054
3058
|
}
|
|
3055
|
-
const configFilePath =
|
|
3059
|
+
const configFilePath = path3.resolve(process.cwd(), templatePath);
|
|
3056
3060
|
return readConfigFile({ configFilePath, options: options9 });
|
|
3057
3061
|
};
|
|
3058
3062
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carlin",
|
|
3
|
-
"version": "1.36.
|
|
3
|
+
"version": "1.36.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"author": "Pedro Arantes <arantespp@gmail.com> (https://twitter.com/arantespp)",
|
|
@@ -31,23 +31,23 @@
|
|
|
31
31
|
"deep-equal": "^2.2.3",
|
|
32
32
|
"deepmerge": "^4.3.1",
|
|
33
33
|
"dotenv": "^16.4.5",
|
|
34
|
-
"esbuild": "^0.
|
|
34
|
+
"esbuild": "^0.23.1",
|
|
35
35
|
"findup-sync": "^5.0.0",
|
|
36
36
|
"glob": "^10.3.15",
|
|
37
37
|
"import-sync": "^2.2.2",
|
|
38
38
|
"js-yaml": "^4.1.0",
|
|
39
39
|
"mime-types": "^2.1.35",
|
|
40
40
|
"npmlog": "^7.0.1",
|
|
41
|
-
"prettier": "^3.3.
|
|
41
|
+
"prettier": "^3.3.3",
|
|
42
42
|
"semver": "^7.6.2",
|
|
43
43
|
"simple-git": "^3.24.0",
|
|
44
44
|
"ts-node": "^10.9.2",
|
|
45
45
|
"uglify-js": "^3.17.4",
|
|
46
46
|
"vercel": "^34.2.0",
|
|
47
47
|
"yargs": "^17.7.2",
|
|
48
|
-
"@ttoss/cloudformation": "^0.10.
|
|
49
|
-
"@ttoss/config": "^1.32.
|
|
50
|
-
"@ttoss/read-config-file": "^1.1.
|
|
48
|
+
"@ttoss/cloudformation": "^0.10.4",
|
|
49
|
+
"@ttoss/config": "^1.32.7",
|
|
50
|
+
"@ttoss/read-config-file": "^1.1.4"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/adm-zip": "^0.5.5",
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
"@types/jest": "^29.5.12",
|
|
59
59
|
"@types/js-yaml": "^4.0.9",
|
|
60
60
|
"@types/mime-types": "^2.1.4",
|
|
61
|
-
"@types/node": "^
|
|
61
|
+
"@types/node": "^22.4.1",
|
|
62
62
|
"@types/npmlog": "^7.0.0",
|
|
63
63
|
"@types/semver": "^7.5.8",
|
|
64
64
|
"@types/uglify-js": "^3.17.5",
|
|
65
65
|
"@types/yargs": "^17.0.32",
|
|
66
66
|
"jest": "^29.7.0",
|
|
67
|
-
"tsup": "^8.
|
|
68
|
-
"typescript": "~5.4
|
|
69
|
-
"@ttoss/test-utils": "^2.1.
|
|
67
|
+
"tsup": "^8.2.4",
|
|
68
|
+
"typescript": "~5.5.4",
|
|
69
|
+
"@ttoss/test-utils": "^2.1.11"
|
|
70
70
|
},
|
|
71
71
|
"keywords": [],
|
|
72
72
|
"publishConfig": {
|