jsii-diff 1.116.0 → 1.118.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.
@@ -49,7 +49,9 @@ const d = new Dog({ name: 'Fido' });
49
49
  console.log(d.name.toLowerCase());
50
50
 
51
51
  // Not valid anymore after the type of `d.name` has changed into `string | undefined`.
52
- // 'd.name' can be undefined, and we have to account for that with an `if`!
52
+ // 'd.name' can be undefined, and calling `undefined.toLowerCase()` would throw an error.
53
+ // The user will have to account for that with an `if`, which means changing their code,
54
+ // which means a breaking change.
53
55
  ```
54
56
 
55
57
  ### Optional properties: how to solve
@@ -83,6 +85,30 @@ This doesn't break any existing users: all their Dogs will have names, so they w
83
85
 
84
86
  For new users that fail to give their Dog a name, presumably they will be aware that their Dog doesn't have a name, so they can avoid trying to read it. If you want to give them a way to avoid the exception, add a `public get hasName(): boolean` field so they can test for the existence of the name before accessing it.
85
87
 
88
+ ### Optional properties: what about structs?
89
+
90
+ In the above example, we said that `DogOptions#name` was an *input* and `Dog#name` was an *output*. Does that mean it's
91
+ always okay to change struct (data interface) fields to optional?
92
+
93
+ Not necessarily! It depends on how the struct is used. If the struct is used as the return value of a method or the
94
+ type of a class proeprty somewhere, it is in *output position* and all of its fields are as well. So if you have the following
95
+ class:
96
+
97
+ ```ts
98
+ class Dog {
99
+ public readonly options: DogOptions; // DogOptions is an OUTPUT
100
+
101
+ constructor(options: DogOptions) { // DogOptions is an INPUT
102
+ this.options = options;
103
+ }
104
+ }
105
+ ```
106
+
107
+ Then `DogOptions` is now both in input as well as output position, and you're not allowed to make anything optional anymore!
108
+
109
+ (That's why using the same struct name to represent both input and output data is best avoided, because it limits
110
+ evolvability).
111
+
86
112
  ## Changing types to superclass/subclass
87
113
 
88
114
  When changing types involved in an operation, you run into a similar issue as with changing the optionality of a property:
package/bin/jsii-diff.js CHANGED
@@ -11,7 +11,10 @@ const diagnostics_1 = require("../lib/diagnostics");
11
11
  const util_1 = require("../lib/util");
12
12
  const version_1 = require("../lib/version");
13
13
  const LOG = log4js.getLogger('jsii-diff');
14
- const ASSEMBLY_SUPPORTED_FEATURES = ['intersection-types'];
14
+ const ASSEMBLY_SUPPORTED_FEATURES = [
15
+ 'intersection-types',
16
+ 'class-covariant-overrides',
17
+ ];
15
18
  async function main() {
16
19
  const argv = await yargs
17
20
  .env('JSII_DIFF')
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.116.0 (build 0eddcff)";
2
+ export declare const VERSION = "1.118.0 (build 02eec31)";
3
3
  //# sourceMappingURL=version.d.ts.map
package/lib/version.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
- // Generated at 2025-10-14T11:48:39Z by generate.sh
2
+ // Generated at 2025-10-29T09:49:48Z 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.116.0 (build 0eddcff)';
6
+ exports.VERSION = '1.118.0 (build 02eec31)';
7
7
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsii-diff",
3
- "version": "1.116.0",
3
+ "version": "1.118.0",
4
4
  "description": "Assembly comparison for jsii",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -26,17 +26,17 @@
26
26
  "scripts": {
27
27
  "build": "bash ./generate.sh && tsc --build && yarn lint",
28
28
  "watch": "bash ./generate.sh && tsc --build -w",
29
- "lint": "ESLINT_USE_FLAT_CONFIG=false eslint . --ext .js,.ts --ignore-path=.gitignore",
29
+ "lint": "ESLINT_USE_FLAT_CONFIG=false NODE_OPTIONS='--disable-warning=ESLintRCWarning' eslint . --ext .js,.ts --ignore-path=.gitignore",
30
30
  "lint:fix": "yarn lint --fix",
31
31
  "test": "jest",
32
32
  "test:update": "jest -u",
33
33
  "package": "package-js"
34
34
  },
35
35
  "dependencies": {
36
- "@jsii/check-node": "1.116.0",
37
- "@jsii/spec": "1.116.0",
36
+ "@jsii/check-node": "1.118.0",
37
+ "@jsii/spec": "1.118.0",
38
38
  "fs-extra": "^10.1.0",
39
- "jsii-reflect": "^1.116.0",
39
+ "jsii-reflect": "^1.118.0",
40
40
  "log4js": "^6.9.1",
41
41
  "yargs": "^17.7.2"
42
42
  },
@@ -45,7 +45,7 @@
45
45
  "@types/tar-fs": "^2.0.4",
46
46
  "@types/yargs": "^17.0.33",
47
47
  "jest-expect-message": "^1.1.3",
48
- "jsii": "^5.9.6",
49
- "jsii-build-tools": "^1.116.0"
48
+ "jsii": "^5.9.10",
49
+ "jsii-build-tools": "^1.118.0"
50
50
  }
51
51
  }