carlin 1.38.2 → 1.38.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 +15 -23
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -13,19 +13,15 @@ import { stdout } from 'process';
|
|
|
13
13
|
import childProcess from 'child_process';
|
|
14
14
|
import * as path from 'path';
|
|
15
15
|
import path__default from 'path';
|
|
16
|
-
import { ValidateTemplateCommand, CloudFormationClient,
|
|
16
|
+
import { ValidateTemplateCommand, DeleteStackCommand, CloudFormationClient, UpdateStackCommand, CreateStackCommand, UpdateTerminationProtectionCommand, DescribeStacksCommand, DescribeStackEventsCommand, DescribeStackResourceCommand } from '@aws-sdk/client-cloudformation';
|
|
17
17
|
import { glob } from 'glob';
|
|
18
18
|
import mime from 'mime-types';
|
|
19
19
|
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 '
|
|
23
|
+
import { builtinModules } from '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';
|
|
29
25
|
import AdmZip from 'adm-zip';
|
|
30
26
|
import importSync from 'import-sync';
|
|
31
27
|
import semver from 'semver';
|
|
@@ -2465,11 +2461,11 @@ var buildLambdaCode = async ({
|
|
|
2465
2461
|
lambdaOutdir
|
|
2466
2462
|
}) => {
|
|
2467
2463
|
log5.info(logPrefix5, "Building Lambda single file...");
|
|
2468
|
-
if (
|
|
2469
|
-
|
|
2464
|
+
if (fs3__default.existsSync(lambdaOutdir)) {
|
|
2465
|
+
fs3__default.rmSync(lambdaOutdir, { recursive: true });
|
|
2470
2466
|
}
|
|
2471
2467
|
const entryPoints = lambdaEntryPoints.map((entryPoint) => {
|
|
2472
|
-
return
|
|
2468
|
+
return path__default.resolve(process.cwd(), lambdaEntryPointsBaseDir, entryPoint);
|
|
2473
2469
|
});
|
|
2474
2470
|
const { errors } = esbuild.buildSync({
|
|
2475
2471
|
banner: {
|
|
@@ -2497,8 +2493,8 @@ var buildLambdaCode = async ({
|
|
|
2497
2493
|
minifySyntax: true,
|
|
2498
2494
|
platform: "node",
|
|
2499
2495
|
splitting: lambdaFormat === "esm",
|
|
2500
|
-
outbase:
|
|
2501
|
-
outdir:
|
|
2496
|
+
outbase: path__default.join(process.cwd(), lambdaEntryPointsBaseDir),
|
|
2497
|
+
outdir: path__default.join(process.cwd(), lambdaOutdir),
|
|
2502
2498
|
outExtension: { ".js": lambdaFormat === "esm" ? ".mjs" : ".cjs" },
|
|
2503
2499
|
target: typescriptConfig.target,
|
|
2504
2500
|
treeShaking: true
|
|
@@ -2700,8 +2696,8 @@ var uploadCodeToS3 = async ({
|
|
|
2700
2696
|
log5.info(logPrefix8, `Uploading code to S3...`);
|
|
2701
2697
|
const zip = new AdmZip();
|
|
2702
2698
|
const zipFile = `${lambdaOutdir}/${zipFileName}`;
|
|
2703
|
-
if (
|
|
2704
|
-
await
|
|
2699
|
+
if (fs3__default.existsSync(zipFile)) {
|
|
2700
|
+
await fs3__default.promises.rm(zipFile);
|
|
2705
2701
|
}
|
|
2706
2702
|
zip.addLocalFolder(lambdaOutdir);
|
|
2707
2703
|
zip.writeZip(`${lambdaOutdir}/${zipFileName}`);
|
|
@@ -2731,8 +2727,8 @@ var deployLambdaCode = async ({
|
|
|
2731
2727
|
}
|
|
2732
2728
|
log5.info(logPrefix9, "Deploying Lambda code...");
|
|
2733
2729
|
for (const entryPoint of lambdaEntryPoints) {
|
|
2734
|
-
const entryPointPath =
|
|
2735
|
-
if (!
|
|
2730
|
+
const entryPointPath = path__default.resolve(lambdaEntryPointsBaseDir, entryPoint);
|
|
2731
|
+
if (!fs3__default.existsSync(entryPointPath)) {
|
|
2736
2732
|
throw new Error(`Entry point ${entryPointPath} does not exist.`);
|
|
2737
2733
|
}
|
|
2738
2734
|
}
|
|
@@ -2754,7 +2750,6 @@ var deployLambdaCode = async ({
|
|
|
2754
2750
|
const { imageUri } = await uploadCodeToECR({
|
|
2755
2751
|
bucket,
|
|
2756
2752
|
key,
|
|
2757
|
-
versionId,
|
|
2758
2753
|
lambdaDockerfile,
|
|
2759
2754
|
lambdaExternal
|
|
2760
2755
|
});
|
|
@@ -3012,7 +3007,7 @@ var readCloudFormationYamlTemplate = ({
|
|
|
3012
3007
|
var loadConfig = (entryPoint) => {
|
|
3013
3008
|
const lastEntryPointName = entryPoint.split("/").pop();
|
|
3014
3009
|
const filename = lastEntryPointName?.split(".")[0];
|
|
3015
|
-
const outfile =
|
|
3010
|
+
const outfile = path__default.resolve(process.cwd(), "out", filename + ".js");
|
|
3016
3011
|
const result = esbuild.buildSync({
|
|
3017
3012
|
bundle: true,
|
|
3018
3013
|
entryPoints: [entryPoint],
|
|
@@ -3095,7 +3090,7 @@ var findAndReadCloudFormationTemplate = async ({
|
|
|
3095
3090
|
if (acc) {
|
|
3096
3091
|
return acc;
|
|
3097
3092
|
}
|
|
3098
|
-
return
|
|
3093
|
+
return fs3.existsSync(path.resolve(process.cwd(), cur)) ? cur : acc;
|
|
3099
3094
|
}, "");
|
|
3100
3095
|
if (!templatePath) {
|
|
3101
3096
|
throw new Error("Cannot find a CloudFormation template.");
|
|
@@ -3104,7 +3099,7 @@ var findAndReadCloudFormationTemplate = async ({
|
|
|
3104
3099
|
if (["yaml", "yml"].includes(extension)) {
|
|
3105
3100
|
return readCloudFormationYamlTemplate({ templatePath });
|
|
3106
3101
|
}
|
|
3107
|
-
const configFilePath =
|
|
3102
|
+
const configFilePath = path.resolve(process.cwd(), templatePath);
|
|
3108
3103
|
return readConfigFile({ configFilePath, options: options9 });
|
|
3109
3104
|
};
|
|
3110
3105
|
|
|
@@ -3796,11 +3791,8 @@ var getStaticAppTemplate = ({
|
|
|
3796
3791
|
acm,
|
|
3797
3792
|
aliases,
|
|
3798
3793
|
appendIndexHtml,
|
|
3799
|
-
cloudfront,
|
|
3800
3794
|
spa,
|
|
3801
|
-
hostedZoneName
|
|
3802
|
-
region
|
|
3803
|
-
});
|
|
3795
|
+
hostedZoneName});
|
|
3804
3796
|
}
|
|
3805
3797
|
return getBucketStaticWebsiteTemplate({ spa });
|
|
3806
3798
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carlin",
|
|
3
|
-
"version": "1.38.
|
|
3
|
+
"version": "1.38.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
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.25.5",
|
|
35
35
|
"findup-sync": "^5.0.0",
|
|
36
36
|
"glob": "^11.0.0",
|
|
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.
|
|
41
|
+
"prettier": "^3.5.3",
|
|
42
42
|
"semver": "^7.6.3",
|
|
43
43
|
"simple-git": "^3.27.0",
|
|
44
44
|
"ts-node": "^10.9.2",
|
|
45
45
|
"uglify-js": "^3.19.3",
|
|
46
46
|
"vercel": "^39.1.1",
|
|
47
47
|
"yargs": "^17.7.2",
|
|
48
|
-
"@ttoss/cloudformation": "^0.10.
|
|
49
|
-
"@ttoss/config": "^1.35.
|
|
50
|
-
"@ttoss/read-config-file": "^2.0.
|
|
48
|
+
"@ttoss/cloudformation": "^0.10.18",
|
|
49
|
+
"@ttoss/config": "^1.35.4",
|
|
50
|
+
"@ttoss/read-config-file": "^2.0.10"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/adm-zip": "^0.5.6",
|
|
@@ -55,18 +55,18 @@
|
|
|
55
55
|
"@types/deep-equal": "^1.0.4",
|
|
56
56
|
"@types/findup-sync": "^4.0.5",
|
|
57
57
|
"@types/glob": "^8.1.0",
|
|
58
|
-
"@types/jest": "^
|
|
58
|
+
"@types/jest": "^30.0.0",
|
|
59
59
|
"@types/js-yaml": "^4.0.9",
|
|
60
60
|
"@types/mime-types": "^2.1.4",
|
|
61
|
-
"@types/node": "^22.
|
|
61
|
+
"@types/node": "^22.15.32",
|
|
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.33",
|
|
66
|
-
"jest": "^
|
|
67
|
-
"tsup": "^8.
|
|
66
|
+
"jest": "^30.0.2",
|
|
67
|
+
"tsup": "^8.5.0",
|
|
68
68
|
"typescript": "~5.7.2",
|
|
69
|
-
"@ttoss/test-utils": "^2.1.
|
|
69
|
+
"@ttoss/test-utils": "^2.1.24"
|
|
70
70
|
},
|
|
71
71
|
"keywords": [],
|
|
72
72
|
"publishConfig": {
|