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 all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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.2"
}
}
14 changes: 7 additions & 7 deletions packages/codemaker/package-lock.json

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

4 changes: 2 additions & 2 deletions packages/codemaker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
"@types/node": "^8.10.43",
"@types/nodeunit": "^0.0.30",
"nodeunit": "^0.11.3",
"typescript": "^3.3.3333"
"typescript": "^3.4.2"
},
"dependencies": {
"camelcase": "^5.2.0",
"camelcase": "^5.3.1",
"decamelize": "^1.2.0",
"fs-extra": "^7.0.1"
},
Expand Down
15 changes: 8 additions & 7 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.10.0",
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace",
Expand All @@ -35,15 +35,14 @@
"python": {
"distName": "scope.jsii-calc-base-of-base",
"module": "scope.jsii_calc_base_of_base"
}
},
"sphinx": {}
},
"types": {
"@scope/jsii-calc-base-of-base.Very": {
"assembly": "@scope/jsii-calc-base-of-base",
"fqn": "@scope/jsii-calc-base-of-base.Very",
"initializer": {
"initializer": true
},
"initializer": {},
Copy link
Contributor

Choose a reason for hiding this comment

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

What happened here? We shouldn't use an empty object to represent something...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Empty object here is the default initializer (no parameters, public). I thought of also modeling that as "true" or the literal string "default" instead... but the empty object actually describes what I want, based on its default values... so I figured I wouldn't overthink it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand where this is coming from, but still don't like this as a general modeling principle. Can we do better?

"kind": "class",
"locationInModule": {
"filename": "lib/index.ts",
Expand All @@ -57,7 +56,9 @@
},
"name": "hey",
"returns": {
"primitive": "number"
"type": {
"primitive": "number"
}
}
}
],
Expand Down Expand Up @@ -90,5 +91,5 @@
}
},
"version": "0.9.0",
"fingerprint": "tvV+QeaiensaQM3kSC1xTy0VR+VsxkqujFF65n0AnCA="
"fingerprint": "1O+di7RZanglLmeCs57JLdO5m98kRnkL4uLPnDbm/z4="
}
23 changes: 11 additions & 12 deletions packages/jsii-calc-base/test/assembly.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
},
"dependencies": {
"@scope/jsii-calc-base-of-base": {
"peer": true,
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace",
Expand All @@ -28,7 +27,8 @@
"python": {
"distName": "scope.jsii-calc-base-of-base",
"module": "scope.jsii_calc_base_of_base"
}
},
"sphinx": {}
},
"version": "0.9.0"
}
Expand All @@ -42,7 +42,7 @@
"type": "git",
"url": "https://github.com/awslabs/jsii.git"
},
"schema": "jsii/1.0",
"schema": "jsii/0.10.0",
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace",
Expand All @@ -61,7 +61,8 @@
"python": {
"distName": "scope.jsii-calc-base",
"module": "scope.jsii_calc_base"
}
},
"sphinx": {}
},
"types": {
"@scope/jsii-calc-base.Base": {
Expand All @@ -71,9 +72,7 @@
"summary": "A base class."
},
"fqn": "@scope/jsii-calc-base.Base",
"initializer": {
"initializer": true
},
"initializer": {},
"kind": "class",
"locationInModule": {
"filename": "lib/index.ts",
Expand All @@ -90,7 +89,9 @@
},
"name": "typeName",
"returns": {
"primitive": "any"
"type": {
"primitive": "any"
}
}
}
],
Expand All @@ -101,9 +102,7 @@
"datatype": true,
"fqn": "@scope/jsii-calc-base.BaseProps",
"interfaces": [
{
"fqn": "@scope/jsii-calc-base-of-base.VeryBaseProps"
}
"@scope/jsii-calc-base-of-base.VeryBaseProps"
],
"kind": "interface",
"locationInModule": {
Expand All @@ -128,5 +127,5 @@
}
},
"version": "0.9.0",
"fingerprint": "kY67AXY3VfrjDTcaGA947JNHQsShp1+YEr9p0JkgKW4="
"fingerprint": "iWT7GmFaVPERM/zg8WXtKv7ydudD28ixjJDVfms7DJ4="
}
3 changes: 0 additions & 3 deletions packages/jsii-calc-bundled/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
"name": "Amazon Web Services",
"url": "https://aws.amazon.com"
},
"scripts": {
"build": "true"
},
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down
Loading