carlin 1.30.0 → 1.30.2
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/cli.js +1 -0
- package/dist/deploy/command.js +0 -1
- package/dist/deploy/stackName.js +3 -2
- package/dist/generateEnv/generateEnv.js +13 -8
- package/package.json +17 -17
package/dist/cli.js
CHANGED
|
@@ -27,6 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.cli = exports.options = void 0;
|
|
30
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
30
31
|
/* eslint-disable no-param-reassign */
|
|
31
32
|
const yargs = __importStar(require("yargs"));
|
|
32
33
|
const config_1 = require("./config");
|
package/dist/deploy/command.js
CHANGED
package/dist/deploy/stackName.js
CHANGED
|
@@ -11,9 +11,10 @@ const setPreDefinedStackName = (stackName) => {
|
|
|
11
11
|
};
|
|
12
12
|
exports.setPreDefinedStackName = setPreDefinedStackName;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* We use stackName as the name of appsync api, so we need to limit the length of stackName.
|
|
15
|
+
* It is limited to 100 characters, as from "https://github.com/ttoss/ttoss/issues/353".
|
|
15
16
|
*/
|
|
16
|
-
exports.STACK_NAME_MAX_LENGTH =
|
|
17
|
+
exports.STACK_NAME_MAX_LENGTH = 100;
|
|
17
18
|
const limitStackName = (stackName) => {
|
|
18
19
|
return `${stackName}`.substring(0, exports.STACK_NAME_MAX_LENGTH);
|
|
19
20
|
};
|
|
@@ -41,7 +41,6 @@ const readEnvFile = async ({ envFileName }) => {
|
|
|
41
41
|
return content;
|
|
42
42
|
}
|
|
43
43
|
catch {
|
|
44
|
-
npmlog_1.default.info(logPrefix, "Env file %s doesn't exist.", envFileName);
|
|
45
44
|
return undefined;
|
|
46
45
|
}
|
|
47
46
|
};
|
|
@@ -50,20 +49,26 @@ const writeEnvFile = async ({ envFileName, content, }) => {
|
|
|
50
49
|
};
|
|
51
50
|
/**
|
|
52
51
|
* Generate environment for packages using `carlin`. If [environment](/docs/CLI#environment)
|
|
53
|
-
* isn't
|
|
54
|
-
* additional environment variables and write the result to `.env.local` file. If it's `
|
|
55
|
-
* it'll read `.env.
|
|
52
|
+
* isn't defined, `carlin` will read `.env` file if exists, merge with
|
|
53
|
+
* additional environment variables and write the result to `.env.local` file. If it's `Environment`,
|
|
54
|
+
* it'll read `.env.Environment` file instead.
|
|
56
55
|
*
|
|
57
56
|
* We chose the name `.env.local` because it works for [Next.js](https://nextjs.org/docs/basic-features/environment-variables)
|
|
58
57
|
* and [CRA](https://create-react-app.dev/docs/adding-custom-environment-variables/#what-other-env-files-can-be-used) projects.
|
|
59
58
|
*/
|
|
60
59
|
const generateEnv = async () => {
|
|
61
60
|
const environment = (0, utils_1.getEnvironment)();
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
const envFile = await readEnvFile({ envFileName });
|
|
61
|
+
const envFileName = environment ? `.env.${environment}` : '.env';
|
|
62
|
+
let envFile = await readEnvFile({ envFileName });
|
|
65
63
|
if (!envFile) {
|
|
66
|
-
|
|
64
|
+
if (environment) {
|
|
65
|
+
npmlog_1.default.info(logPrefix, "Env file %s doesn't exist, reading .env.", envFileName);
|
|
66
|
+
}
|
|
67
|
+
envFile = await readEnvFile({ envFileName: '.env' });
|
|
68
|
+
if (!envFile) {
|
|
69
|
+
npmlog_1.default.info(logPrefix, "Env file %s doesn't exist.", '.env');
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
67
72
|
}
|
|
68
73
|
await writeEnvFile({ content: envFile, envFileName: '.env.local' });
|
|
69
74
|
npmlog_1.default.info(logPrefix, 'Generate env file %s from %s successfully.', '.env.local', envFileName);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carlin",
|
|
3
|
-
"version": "1.30.
|
|
3
|
+
"version": "1.30.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"author": "Pedro Arantes <arantespp@gmail.com> (https://twitter.com/arantespp)",
|
|
@@ -22,34 +22,34 @@
|
|
|
22
22
|
"dist/"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@aws-sdk/client-cloudformation": "^3.
|
|
26
|
-
"@octokit/webhooks": "^
|
|
25
|
+
"@aws-sdk/client-cloudformation": "^3.391.0",
|
|
26
|
+
"@octokit/webhooks": "^12.0.3",
|
|
27
27
|
"@slack/webhook": "^6.1.0",
|
|
28
28
|
"adm-zip": "^0.5.10",
|
|
29
|
-
"aws-sdk": "^2.
|
|
29
|
+
"aws-sdk": "^2.1438.0",
|
|
30
30
|
"builtin-modules": "^3.3.0",
|
|
31
31
|
"change-case": "^4.1.2",
|
|
32
|
-
"deep-equal": "^2.2.
|
|
32
|
+
"deep-equal": "^2.2.2",
|
|
33
33
|
"deepmerge": "^4.3.1",
|
|
34
|
-
"dotenv": "^16.
|
|
35
|
-
"esbuild": "^0.18.
|
|
34
|
+
"dotenv": "^16.3.1",
|
|
35
|
+
"esbuild": "^0.18.20",
|
|
36
36
|
"findup-sync": "^5.0.0",
|
|
37
|
-
"glob": "^10.
|
|
37
|
+
"glob": "^10.3.3",
|
|
38
38
|
"js-yaml": "^4.1.0",
|
|
39
39
|
"mime-types": "^2.1.35",
|
|
40
40
|
"npmlog": "^7.0.1",
|
|
41
|
-
"prettier": "^3.0.
|
|
42
|
-
"semver": "^7.5.
|
|
43
|
-
"simple-git": "^3.
|
|
41
|
+
"prettier": "^3.0.2",
|
|
42
|
+
"semver": "^7.5.4",
|
|
43
|
+
"simple-git": "^3.19.1",
|
|
44
44
|
"ts-node": "^10.9.1",
|
|
45
45
|
"uglify-js": "^3.17.4",
|
|
46
|
-
"vercel": "^
|
|
46
|
+
"vercel": "^31.3.1",
|
|
47
47
|
"yargs": "^17.7.2",
|
|
48
|
-
"@ttoss/cloudformation": "^0.7.
|
|
48
|
+
"@ttoss/cloudformation": "^0.7.8"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/adm-zip": "^0.5.0",
|
|
52
|
-
"@types/aws-lambda": "^8.10.
|
|
52
|
+
"@types/aws-lambda": "^8.10.119",
|
|
53
53
|
"@types/deep-equal": "^1.0.1",
|
|
54
54
|
"@types/findup-sync": "^4.0.2",
|
|
55
55
|
"@types/glob": "^8.1.0",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"@types/semver": "^7.5.0",
|
|
62
62
|
"@types/uglify-js": "^3.17.1",
|
|
63
63
|
"@types/yargs": "^17.0.24",
|
|
64
|
-
"jest": "^29.6.
|
|
65
|
-
"typescript": "^5.
|
|
66
|
-
"@ttoss/test-utils": "^1.23.
|
|
64
|
+
"jest": "^29.6.2",
|
|
65
|
+
"typescript": "^5.1.6",
|
|
66
|
+
"@ttoss/test-utils": "^1.23.7"
|
|
67
67
|
},
|
|
68
68
|
"keywords": [],
|
|
69
69
|
"publishConfig": {
|