Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(jsii-spec): Model parameter optionality #432

Merged
merged 8 commits into from
Apr 10, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,794 changes: 1,401 additions & 1,393 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"lerna": "^3.13.1",
"nodeunit": "^0.11.3",
"nyc": "^13.3.0",
"tslint": "^5.13.0",
"typescript": "^3.3.3333"
"tslint": "^5.15.0",
"typescript": "^3.4.1"
}
}
8 changes: 4 additions & 4 deletions packages/codemaker/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/codemaker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@types/node": "^8.10.43",
"@types/nodeunit": "^0.0.30",
"nodeunit": "^0.11.3",
"typescript": "^3.3.3333"
"typescript": "^3.4.1"
},
"dependencies": {
"camelcase": "^5.2.0",
Expand Down
14 changes: 9 additions & 5 deletions packages/jsii-calc-base-of-base/test/assembly.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"type": "git",
"url": "https://github.com/awslabs/jsii.git"
},
"schema": "jsii/1.0",
"schema": "jsii/0.9.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waitaminit! I don't like how this is version number is going backwards, and we already have a jsiiVersion field that encodes the JSII version. Why can't we just discretely bump the schema versions 1 -> 2 -> 3 etc? Saves us having to do the whole "what's the next release version" dance, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really care. I kinda felt it was nice to correlate that with the jsii version so you can, from an error (like "Whoosh the version is jsii/0.9.0, but I expected to find jsii/0.42.12), determine what you need to do. I however would only update that version number if/when the spec gets a breaking change (so it acts as a "minimum required version" of sorts.

"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace",
Expand Down Expand Up @@ -57,7 +57,9 @@
},
"name": "hey",
"returns": {
"primitive": "number"
"type": {
"primitive": "number"
}
}
}
],
Expand All @@ -82,13 +84,15 @@
"line": 2
},
"name": "foo",
"type": {
"fqn": "@scope/jsii-calc-base-of-base.Very"
"value": {
"type": {
"fqn": "@scope/jsii-calc-base-of-base.Very"
}
}
}
]
}
},
"version": "0.9.0",
"fingerprint": "tvV+QeaiensaQM3kSC1xTy0VR+VsxkqujFF65n0AnCA="
"fingerprint": "XseEpPuOI5iVW/qmIg+RZnV5JNRO0Nwz4u3CZoaaoH4="
}
15 changes: 10 additions & 5 deletions packages/jsii-calc-base/test/assembly.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"type": "git",
"url": "https://github.com/awslabs/jsii.git"
},
"schema": "jsii/1.0",
"schema": "jsii/0.9.0",
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace",
Expand Down Expand Up @@ -90,7 +90,10 @@
},
"name": "typeName",
"returns": {
"primitive": "any"
"optional": true,
"type": {
"primitive": "any"
}
}
}
],
Expand Down Expand Up @@ -120,13 +123,15 @@
"line": 16
},
"name": "bar",
"type": {
"primitive": "string"
"value": {
"type": {
"primitive": "string"
}
}
}
]
}
},
"version": "0.9.0",
"fingerprint": "kY67AXY3VfrjDTcaGA947JNHQsShp1+YEr9p0JkgKW4="
"fingerprint": "WfOk+muZma5/YlmUhypFauh/hDFDzfNRSUmRtfVTMcE="
}
96 changes: 63 additions & 33 deletions packages/jsii-calc-lib/test/assembly.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"type": "git",
"url": "https://github.com/awslabs/jsii.git"
},
"schema": "jsii/1.0",
"schema": "jsii/0.9.0",
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.LibNamespace",
Expand Down Expand Up @@ -132,8 +132,10 @@
"line": 24
},
"name": "doubleValue",
"type": {
"primitive": "number"
"value": {
"type": {
"primitive": "number"
}
}
}
]
Expand Down Expand Up @@ -162,7 +164,9 @@
},
"name": "hello",
"returns": {
"primitive": "string"
"type": {
"primitive": "string"
}
}
}
],
Expand Down Expand Up @@ -193,8 +197,10 @@
"line": 77
},
"name": "anumber",
"type": {
"primitive": "number"
"value": {
"type": {
"primitive": "number"
}
}
},
{
Expand All @@ -208,8 +214,10 @@
"line": 72
},
"name": "astring",
"type": {
"primitive": "string"
"value": {
"type": {
"primitive": "string"
}
}
},
{
Expand All @@ -220,14 +228,18 @@
"line": 78
},
"name": "firstOptional",
"type": {
"collection": {
"elementtype": {
"primitive": "string"
},
"kind": "array"
},
"optional": true
"value": {
"optional": true,
"type": {
"collection": {
"elementtype": {
"type": {
"primitive": "string"
}
},
"kind": "array"
}
}
}
}
]
Expand All @@ -252,8 +264,10 @@
"summary": "The number."
},
"name": "value",
"type": {
"primitive": "number"
"value": {
"type": {
"primitive": "number"
}
}
}
]
Expand Down Expand Up @@ -283,8 +297,10 @@
"overrides": {
"fqn": "@scope/jsii-calc-lib.IDoublable"
},
"type": {
"primitive": "number"
"value": {
"type": {
"primitive": "number"
}
}
},
{
Expand All @@ -300,8 +316,10 @@
"overrides": {
"fqn": "@scope/jsii-calc-lib.Value"
},
"type": {
"primitive": "number"
"value": {
"type": {
"primitive": "number"
}
}
}
]
Expand Down Expand Up @@ -339,7 +357,9 @@
"fqn": "@scope/jsii-calc-lib.Value"
},
"returns": {
"primitive": "string"
"type": {
"primitive": "string"
}
}
}
],
Expand Down Expand Up @@ -370,9 +390,11 @@
"line": 88
},
"name": "optional1",
"type": {
"value": {
"optional": true,
"primitive": "string"
"type": {
"primitive": "string"
}
}
},
{
Expand All @@ -383,9 +405,11 @@
"line": 89
},
"name": "optional2",
"type": {
"value": {
"optional": true,
"primitive": "number"
"type": {
"primitive": "number"
}
}
},
{
Expand All @@ -396,9 +420,11 @@
"line": 90
},
"name": "optional3",
"type": {
"value": {
"optional": true,
"primitive": "boolean"
"type": {
"primitive": "boolean"
}
}
}
]
Expand Down Expand Up @@ -432,7 +458,9 @@
},
"name": "toString",
"returns": {
"primitive": "string"
"type": {
"primitive": "string"
}
}
}
],
Expand All @@ -449,13 +477,15 @@
"line": 10
},
"name": "value",
"type": {
"primitive": "number"
"value": {
"type": {
"primitive": "number"
}
}
}
]
}
},
"version": "0.9.0",
"fingerprint": "LOjIAgmz/zd3aDBrJaHLXGI+I49sXkgLvihvuzZDPAY="
"fingerprint": "Pb6GUIxMB5/TVXJJy/1JR2PnWIrRPPtu3ukQFIn3GDo="
}
Loading