jsii-diff 1.130.0 → 1.132.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.
package/lib/util.js CHANGED
@@ -34,11 +34,16 @@ function showDownloadFailure(f) {
34
34
  }
35
35
  }
36
36
  async function downloadNpmPackage(pkg, block) {
37
+ validateValidPackageSpecifier(pkg);
37
38
  return inTempDir(async () => {
38
39
  LOG.info(`Fetching NPM package ${pkg}`);
39
40
  try {
40
41
  // Need to install package and dependencies in order for jsii-reflect
41
42
  // to not bork when it can find the dependencies.
43
+ //
44
+ // This executes the shell, which is necessary: on Windows, npm is a .cmd file,
45
+ // and only the shell and execute .bat/.cmd files. We have validated the package
46
+ // name already to make sure it contains only safe characters.
42
47
  await exec(`npm install --silent --prefix . ${pkg}`);
43
48
  }
44
49
  catch (e) {
@@ -68,6 +73,9 @@ function isSubprocesFailedError(e) {
68
73
  async function npmPackageExists(pkg) {
69
74
  try {
70
75
  LOG.info(`Checking existence of ${pkg}`);
76
+ // This executes the shell, which is necessary: on Windows, npm is a .cmd file,
77
+ // and only the shell and execute .bat/.cmd files. We have validated the package
78
+ // name already to make sure it contains only safe characters.
71
79
  await exec(`npm show --silent ${pkg}`);
72
80
  return true;
73
81
  }
@@ -86,6 +94,18 @@ function trimVersionString(pkg) {
86
94
  // string.
87
95
  return pkg.replace(/(.)@.*$/, '$1');
88
96
  }
97
+ /**
98
+ * Validate a package name against a list of allowed characters
99
+ *
100
+ * If we are too strict here, that's not a biggy: script writers are always
101
+ * able to download their exotically-named NPM package themselves before running
102
+ * jsii-diff on it.
103
+ */
104
+ function validateValidPackageSpecifier(pkg) {
105
+ if (pkg.match(/[^a-z0-9@/:._-]/i)) {
106
+ throw new Error(`Invalid package name, only 'a-z0-9@/:._-' are allowed: ${JSON.stringify(pkg)}`);
107
+ }
108
+ }
89
109
  function flatMap(xs, fn) {
90
110
  const ret = new Array();
91
111
  for (const x of xs) {
package/lib/version.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  /** The qualified version number for this JSII compiler. */
2
- export declare const VERSION = "1.130.0 (build 048a5ee)";
2
+ export declare const VERSION = "1.132.0 (build c736b3b)";
3
3
  //# sourceMappingURL=version.d.ts.map
package/lib/version.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
- // Generated at 2026-05-14T18:29:11Z by generate.sh
2
+ // Generated at 2026-05-22T09:28:12Z by generate.sh
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.VERSION = void 0;
5
5
  /** The qualified version number for this JSII compiler. */
6
- exports.VERSION = '1.130.0 (build 048a5ee)';
6
+ exports.VERSION = '1.132.0 (build c736b3b)';
7
7
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsii-diff",
3
- "version": "1.130.0",
3
+ "version": "1.132.0",
4
4
  "description": "Assembly comparison for jsii",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -31,10 +31,10 @@
31
31
  "package": "package-js"
32
32
  },
33
33
  "dependencies": {
34
- "@jsii/check-node": "1.130.0",
35
- "@jsii/spec": "1.130.0",
34
+ "@jsii/check-node": "1.132.0",
35
+ "@jsii/spec": "1.132.0",
36
36
  "fs-extra": "^10.1.0",
37
- "jsii-reflect": "^1.130.0",
37
+ "jsii-reflect": "^1.132.0",
38
38
  "log4js": "^6.9.1",
39
39
  "yargs": "^17.7.2"
40
40
  },
@@ -43,10 +43,10 @@
43
43
  "@types/tar-fs": "^2.0.4",
44
44
  "@types/yargs": "^17.0.33",
45
45
  "eslint": "^9.39.4",
46
- "jest": "^30.3.0",
46
+ "jest": "^30.4.2",
47
47
  "jest-expect-message": "^1.1.3",
48
48
  "jsii": "^5.9.28",
49
- "jsii-build-tools": "^1.130.0",
49
+ "jsii-build-tools": "^1.132.0",
50
50
  "typescript": "5.9.x"
51
51
  }
52
52
  }