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 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");
@@ -96,7 +96,6 @@ exports.options = {
96
96
  alias: 'p',
97
97
  default: [],
98
98
  describe: 'A list of parameters that will be passed to CloudFormation Parameters when deploying.',
99
- type: 'array',
100
99
  },
101
100
  'skip-deploy': {
102
101
  alias: 'skip',
@@ -11,9 +11,10 @@ const setPreDefinedStackName = (stackName) => {
11
11
  };
12
12
  exports.setPreDefinedStackName = setPreDefinedStackName;
13
13
  /**
14
- * https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html
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 = 128;
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 production, `carlin` will read `.env` file if exists, merge with
54
- * additional environment variables and write the result to `.env.local` file. If it's `Production`,
55
- * it'll read `.env.production` file instead.
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 isProduction = (environment === null || environment === void 0 ? void 0 : environment.toLocaleLowerCase()) === 'production';
63
- const envFileName = isProduction ? '.env.production' : '.env';
64
- const envFile = await readEnvFile({ envFileName });
61
+ const envFileName = environment ? `.env.${environment}` : '.env';
62
+ let envFile = await readEnvFile({ envFileName });
65
63
  if (!envFile) {
66
- return;
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.0",
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.329.0",
26
- "@octokit/webhooks": "^11.0.0",
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.1374.0",
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.1",
32
+ "deep-equal": "^2.2.2",
33
33
  "deepmerge": "^4.3.1",
34
- "dotenv": "^16.0.3",
35
- "esbuild": "^0.18.12",
34
+ "dotenv": "^16.3.1",
35
+ "esbuild": "^0.18.20",
36
36
  "findup-sync": "^5.0.0",
37
- "glob": "^10.2.2",
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.0",
42
- "semver": "^7.5.0",
43
- "simple-git": "^3.18.0",
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": "^29.1.1",
46
+ "vercel": "^31.3.1",
47
47
  "yargs": "^17.7.2",
48
- "@ttoss/cloudformation": "^0.7.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.115",
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.1",
65
- "typescript": "^5.0.4",
66
- "@ttoss/test-utils": "^1.23.6"
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": {