serverless-vpc-discovery 3.1.2 → 4.0.2

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [4.0.2] - 2022-04-11
8
+ ### Changed
9
+ - Add integration with serverless 3 logging
10
+ - Change Github workflows to run tests both with sls 2 and 3
11
+
12
+ ## [4.0.1] - 2022-04-08
13
+ ### Changed
14
+ - Fixed audit issues. Added dependabot config
15
+
16
+ ## [4.0.0] - 2022-04-08
17
+ ### Changed
18
+ - Added compability with serverless 3
19
+
7
20
  ## [3.1.2] - 2021-09-01
8
21
  ### Changed
9
22
  - Fixed y18n vulnerability
package/README.md CHANGED
@@ -157,18 +157,20 @@ npm test
157
157
  ```
158
158
  All tests should pass.
159
159
 
160
- If there is an error update the node_module inside the serverless-vpc-discovery folder:
161
- ```
162
- npm install
163
- ```
164
-
165
160
  To run integration tests, set an environment variable TEST_VPC_NAME to the VPC you will be testing for. Then,
166
161
  ```
167
162
  export AWS_PROFILE=your_profile
168
163
  export TEST_VPC_NAME=vpc_name
164
+ npm build
169
165
  npm run integration-test
170
166
  ```
171
167
 
168
+ If there is an error build and install the node_module inside the serverless-vpc-discovery folder:
169
+ ```
170
+ npm build
171
+ npm install .
172
+ ```
173
+
172
174
  ## Deploying with the plugin
173
175
  When deploying run:
174
176
  ```
@@ -5,39 +5,36 @@ class Globals {
5
5
  Globals.serverless.cli.log(`${prefix} ${message}`, Globals.pluginName);
6
6
  }
7
7
  /**
8
- * Logs info message
9
- * @param message: message to be printed
10
- * @param debug: if true then show log only if SLS_DEBUG enabled on else anytime.
11
- * By default debug mode off and a message printed for each call.
8
+ * Logs error message
12
9
  */
13
- static logInfo(message, debug = false) {
14
- const canLog = (debug && process.env.SLS_DEBUG) || !debug;
15
- if (canLog) {
16
- Globals.cliLog("Info:", message);
10
+ static logError(message) {
11
+ if (Globals.v3Utils) {
12
+ Globals.v3Utils.log.error(message);
13
+ }
14
+ else {
15
+ Globals.cliLog("[Error]", message);
17
16
  }
18
17
  }
19
18
  /**
20
- * Logs warning message
21
- * @param message: message to be printed
22
- * @param debug: if true then show log only if SLS_DEBUG enabled on else anytime.
23
- * By default debug mode off and a message printed for each call.
19
+ * Logs info message
24
20
  */
25
- static logWarning(message, debug = false) {
26
- const canLog = (debug && process.env.SLS_DEBUG) || !debug;
27
- if (canLog) {
28
- Globals.cliLog("WARNING:", message);
21
+ static logInfo(message) {
22
+ if (Globals.v3Utils) {
23
+ Globals.v3Utils.log.verbose(message);
24
+ }
25
+ else {
26
+ Globals.cliLog("[Info]", message);
29
27
  }
30
28
  }
31
29
  /**
32
- * Logs error message
33
- * @param message: message to be printed
34
- * @param debug: if true then show log only if SLS_DEBUG enabled on else anytime.
35
- * By default debug mode off and a message printed for each call.
30
+ * Logs warning message
36
31
  */
37
- static logError(message, debug = false) {
38
- const canLog = (debug && process.env.SLS_DEBUG) || !debug;
39
- if (canLog) {
40
- Globals.cliLog("Error:", message);
32
+ static logWarning(message) {
33
+ if (Globals.v3Utils) {
34
+ Globals.v3Utils.log.warning(message);
35
+ }
36
+ else {
37
+ Globals.cliLog("[WARNING]", message);
41
38
  }
42
39
  }
43
40
  }
package/dist/src/index.js CHANGED
@@ -16,9 +16,12 @@ const globals_1 = __importDefault(require("./globals"));
16
16
  const validation_1 = require("./validation");
17
17
  const schema_1 = require("./schema");
18
18
  class VPCPlugin {
19
- constructor(serverless) {
19
+ constructor(serverless, options, v3Utils) {
20
20
  this.serverless = serverless;
21
21
  globals_1.default.serverless = serverless;
22
+ if (v3Utils) {
23
+ globals_1.default.v3Utils = v3Utils;
24
+ }
22
25
  /* hooks are the actual code that will run when called */
23
26
  this.hooks = {
24
27
  "before:package:initialize": this.hookWrapper.bind(this, this.updateFunctionsVpcConfig)