@contrast/rewriter 1.27.0 → 1.29.0

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.
Files changed (2) hide show
  1. package/lib/index.js +5 -4
  2. package/package.json +8 -8
package/lib/index.js CHANGED
@@ -100,6 +100,7 @@ class Rewriter {
100
100
  */
101
101
  rewriteConfig(opts) {
102
102
  const nodeCfg = this.core.config.agent.node;
103
+ const sourceMaps = nodeCfg.source_maps.enable;
103
104
  const minify = opts.minify && nodeCfg.source_maps.enable && nodeCfg.rewrite.minify;
104
105
 
105
106
  return {
@@ -124,7 +125,7 @@ class Rewriter {
124
125
  minify: minify ? { compress: { defaults: false } } : undefined
125
126
  },
126
127
  minify,
127
- sourceMaps: nodeCfg.source_maps.enable,
128
+ sourceMaps,
128
129
  };
129
130
  }
130
131
 
@@ -201,9 +202,9 @@ module.exports = function init(core) {
201
202
  // @ts-expect-error TS hates errors.
202
203
  throw cause.message === 'Bindings not found.'
203
204
  ? new Error(
204
- `Contrast cannot detect the correct precompiled dependencies for the current environment: ${platform()}-${arch()}. This typically occurs when deploying an installation from one environment to a different execution environment.`,
205
- // @ts-expect-error `cause` requires ts to target es2022 or above, which corresponds to Node 17+, despite being added to Node in 16.9.
206
- { cause },
205
+ `Contrast cannot detect the correct precompiled dependencies for the current environment: ${platform()}-${arch()}. This typically occurs when deploying an installation from one environment to a different execution environment.`,
206
+ // @ts-expect-error `cause` requires ts to target es2022 or above, which corresponds to Node 17+, despite being added to Node in 16.9.
207
+ { cause },
207
208
  )
208
209
  : cause;
209
210
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/rewriter",
3
- "version": "1.27.0",
3
+ "version": "1.29.0",
4
4
  "description": "A transpilation tool mainly used for instrumentation",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
@@ -17,14 +17,14 @@
17
17
  "node": ">= 16.9.1"
18
18
  },
19
19
  "scripts": {
20
- "test": "../scripts/test.sh"
20
+ "test": "bash ../scripts/test.sh"
21
21
  },
22
22
  "dependencies": {
23
- "@contrast/agent-swc-plugin": "^2.0.0",
24
- "@contrast/common": "1.32.0",
25
- "@contrast/config": "1.46.0",
26
- "@contrast/core": "1.51.0",
27
- "@contrast/logger": "1.24.0",
28
- "@swc/core": "1.5.29"
23
+ "@contrast/agent-swc-plugin": "3.0.0",
24
+ "@contrast/common": "1.33.0",
25
+ "@contrast/config": "1.48.0",
26
+ "@contrast/core": "1.53.0",
27
+ "@contrast/logger": "1.26.0",
28
+ "@swc/core": "1.11.24"
29
29
  }
30
30
  }