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): enforce peer dependencies #294

Merged
merged 2 commits into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions packages/jsii-calc-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
"dependencies": {
"@scope/jsii-calc-base-of-base": "^0.7.8"
},
"peerDependencies": {
"@scope/jsii-calc-base-of-base": "^0.7.8"
},
"author": {
"name": "Amazon Web Services",
"url": "https://aws.amazon.com",
Expand Down
3 changes: 2 additions & 1 deletion packages/jsii-calc-base/test/assembly.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"dependencies": {
"@scope/jsii-calc-base-of-base": {
"peer": true,
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace",
Expand Down Expand Up @@ -102,5 +103,5 @@
}
},
"version": "0.7.8",
"fingerprint": "G+ZeFV6LQWFdp9ZuDgqN4rS10q/JBHuy0Wo8qaTK/t8="
"fingerprint": "K1rAUs6WiQ5lF08T46B8v/5UL8T8Ot59e0Nc8rh2jiQ="
}
3 changes: 3 additions & 0 deletions packages/jsii-calc-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
"dependencies": {
"@scope/jsii-calc-base": "^0.7.8"
},
"peerDependencies": {
"@scope/jsii-calc-base": "^0.7.8"
},
"author": {
"name": "Amazon Web Services",
"url": "https://aws.amazon.com",
Expand Down
4 changes: 3 additions & 1 deletion packages/jsii-calc-lib/test/assembly.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@scope/jsii-calc-base": {
"dependencies": {
"@scope/jsii-calc-base-of-base": {
"peer": true,
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace",
Expand All @@ -30,6 +31,7 @@
"version": "0.7.8"
}
},
"peer": true,
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace",
Expand Down Expand Up @@ -351,5 +353,5 @@
}
},
"version": "0.7.8",
"fingerprint": "HzcyHys0b9gFmP4dogeIJmGE6GVtrSo/P0S54Vd/X8U="
"fingerprint": "ENH00UDSeTnXKpvD3/vp0k8zyd+KCHzc9QWB151/gM8="
}
4 changes: 4 additions & 0 deletions packages/jsii-calc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
"@scope/jsii-calc-lib": "^0.7.8",
"jsii-calc-bundled": "^0.7.8"
},
"peerDependencies": {
"@scope/jsii-calc-base": "^0.7.8",
"@scope/jsii-calc-lib": "^0.7.8"
},
"devDependencies": {
"@types/node": "^8.10.37",
"jsii": "^0.7.8",
Expand Down
19 changes: 9 additions & 10 deletions packages/jsii-calc/test/assembly.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@scope/jsii-calc-base": {
"dependencies": {
"@scope/jsii-calc-base-of-base": {
"peer": true,
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace",
Expand All @@ -56,6 +57,7 @@
"version": "0.7.8"
}
},
"peer": true,
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace",
Expand All @@ -79,6 +81,7 @@
"@scope/jsii-calc-base": {
"dependencies": {
"@scope/jsii-calc-base-of-base": {
"peer": true,
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace",
Expand All @@ -98,6 +101,7 @@
"version": "0.7.8"
}
},
"peer": true,
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace",
Expand All @@ -117,6 +121,7 @@
"version": "0.7.8"
}
},
"peer": true,
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.LibNamespace",
Expand Down Expand Up @@ -436,7 +441,7 @@
"type": {
"collection": {
"elementtype": {
"fqn": "@scope/jsii-calc-lib.Number"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a regression !

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, just merge issue. Fixing.

"primitive": "number"
},
"kind": "map"
}
Expand Down Expand Up @@ -486,9 +491,6 @@
},
{
"primitive": "number"
},
{
"fqn": "@scope/jsii-calc-lib.Number"
}
]
}
Expand All @@ -510,9 +512,6 @@
},
{
"fqn": "jsii-calc.Multiply"
},
{
"fqn": "@scope/jsii-calc-lib.Number"
}
]
}
Expand Down Expand Up @@ -1565,7 +1564,7 @@
"abstract": true,
"name": "obtainNumber",
"returns": {
"fqn": "@scope/jsii-calc-lib.IDoublable"
"primitive": "number"
}
}
],
Expand All @@ -1576,7 +1575,7 @@
"immutable": true,
"name": "numberProp",
"type": {
"fqn": "@scope/jsii-calc-lib.Number"
"primitive": "number"
}
}
]
Expand Down Expand Up @@ -3407,5 +3406,5 @@
}
},
"version": "0.7.8",
"fingerprint": "jHSXTzCSZbwYMvLKpeZB6SE8hNgYgt9/2JF1ihM41SI="
"fingerprint": "6C8tdqFzq/f4vOKx4UbCkGYriU4I7jeOQ2gsOsgC3cE="
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"dependencies": {
"@scope/jsii-calc-base-of-base": {
"peer": true,
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace",
Expand Down Expand Up @@ -102,5 +103,5 @@
}
},
"version": "0.7.8",
"fingerprint": "G+ZeFV6LQWFdp9ZuDgqN4rS10q/JBHuy0Wo8qaTK/t8="
"fingerprint": "K1rAUs6WiQ5lF08T46B8v/5UL8T8Ot59e0Nc8rh2jiQ="
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@scope/jsii-calc-base": {
"dependencies": {
"@scope/jsii-calc-base-of-base": {
"peer": true,
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace",
Expand All @@ -30,6 +31,7 @@
"version": "0.7.8"
}
},
"peer": true,
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace",
Expand Down Expand Up @@ -351,5 +353,5 @@
}
},
"version": "0.7.8",
"fingerprint": "HzcyHys0b9gFmP4dogeIJmGE6GVtrSo/P0S54Vd/X8U="
"fingerprint": "ENH00UDSeTnXKpvD3/vp0k8zyd+KCHzc9QWB151/gM8="
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@scope/jsii-calc-base": {
"dependencies": {
"@scope/jsii-calc-base-of-base": {
"peer": true,
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace",
Expand All @@ -56,6 +57,7 @@
"version": "0.7.8"
}
},
"peer": true,
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace",
Expand All @@ -79,6 +81,7 @@
"@scope/jsii-calc-base": {
"dependencies": {
"@scope/jsii-calc-base-of-base": {
"peer": true,
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace",
Expand All @@ -98,6 +101,7 @@
"version": "0.7.8"
}
},
"peer": true,
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace",
Expand All @@ -117,6 +121,7 @@
"version": "0.7.8"
}
},
"peer": true,
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.LibNamespace",
Expand Down Expand Up @@ -436,7 +441,7 @@
"type": {
"collection": {
"elementtype": {
"fqn": "@scope/jsii-calc-lib.Number"
"primitive": "number"
},
"kind": "map"
}
Expand Down Expand Up @@ -486,9 +491,6 @@
},
{
"primitive": "number"
},
{
"fqn": "@scope/jsii-calc-lib.Number"
}
]
}
Expand All @@ -510,9 +512,6 @@
},
{
"fqn": "jsii-calc.Multiply"
},
{
"fqn": "@scope/jsii-calc-lib.Number"
}
]
}
Expand Down Expand Up @@ -1565,7 +1564,7 @@
"abstract": true,
"name": "obtainNumber",
"returns": {
"fqn": "@scope/jsii-calc-lib.IDoublable"
"primitive": "number"
}
}
],
Expand All @@ -1576,7 +1575,7 @@
"immutable": true,
"name": "numberProp",
"type": {
"fqn": "@scope/jsii-calc-lib.Number"
"primitive": "number"
}
}
]
Expand Down Expand Up @@ -3407,5 +3406,5 @@
}
},
"version": "0.7.8",
"fingerprint": "jHSXTzCSZbwYMvLKpeZB6SE8hNgYgt9/2JF1ihM41SI="
"fingerprint": "6C8tdqFzq/f4vOKx4UbCkGYriU4I7jeOQ2gsOsgC3cE="
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Amazon.JSII.Runtime.Deputy;
using Amazon.JSII.Tests.CalculatorNamespace.composition;
using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -81,10 +80,10 @@ public virtual JObject JsonProperty
set => SetInstanceProperty(value);
}

[JsiiProperty("mapProperty", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Number\"}}}")]
public virtual IDictionary<string, Number> MapProperty
[JsiiProperty("mapProperty", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"primitive\":\"number\"}}}")]
public virtual IDictionary<string, double> MapProperty
{
get => GetInstanceProperty<IDictionary<string, Number>>();
get => GetInstanceProperty<IDictionary<string, double>>();
set => SetInstanceProperty(value);
}

Expand All @@ -109,14 +108,14 @@ public virtual object[] UnionArrayProperty
set => SetInstanceProperty(value);
}

[JsiiProperty("unionMapProperty", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"},{\"fqn\":\"@scope/jsii-calc-lib.Number\"}]}}}}")]
[JsiiProperty("unionMapProperty", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"}]}}}}")]
public virtual IDictionary<string, object> UnionMapProperty
{
get => GetInstanceProperty<IDictionary<string, object>>();
set => SetInstanceProperty(value);
}

[JsiiProperty("unionProperty", "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"},{\"fqn\":\"jsii-calc.Multiply\"},{\"fqn\":\"@scope/jsii-calc-lib.Number\"}]}}")]
[JsiiProperty("unionProperty", "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"},{\"fqn\":\"jsii-calc.Multiply\"}]}}")]
public virtual object UnionProperty
{
get => GetInstanceProperty<object>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
using Amazon.JSII.Runtime.Deputy;
using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace;

namespace Amazon.JSII.Tests.CalculatorNamespace
{
[JsiiInterface(typeof(IIReturnsNumber), "jsii-calc.IReturnsNumber")]
public interface IIReturnsNumber
{
[JsiiProperty("numberProp", "{\"fqn\":\"@scope/jsii-calc-lib.Number\"}")]
Number NumberProp
[JsiiProperty("numberProp", "{\"primitive\":\"number\"}")]
double NumberProp
{
get;
}

[JsiiMethod("obtainNumber", "{\"fqn\":\"@scope/jsii-calc-lib.IDoublable\"}", "[]")]
IIDoublable ObtainNumber();
[JsiiMethod("obtainNumber", "{\"primitive\":\"number\"}", "[]")]
double ObtainNumber();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Amazon.JSII.Runtime.Deputy;
using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace;

namespace Amazon.JSII.Tests.CalculatorNamespace
{
Expand All @@ -10,16 +9,16 @@ private IReturnsNumberProxy(ByRefValue reference): base(reference)
{
}

[JsiiProperty("numberProp", "{\"fqn\":\"@scope/jsii-calc-lib.Number\"}")]
public Number NumberProp
[JsiiProperty("numberProp", "{\"primitive\":\"number\"}")]
public double NumberProp
{
get => GetInstanceProperty<Number>();
get => GetInstanceProperty<double>();
}

[JsiiMethod("obtainNumber", "{\"fqn\":\"@scope/jsii-calc-lib.IDoublable\"}", "[]")]
public IIDoublable ObtainNumber()
[JsiiMethod("obtainNumber", "{\"primitive\":\"number\"}", "[]")]
public double ObtainNumber()
{
return InvokeInstanceMethod<IIDoublable>(new object[]{});
return InvokeInstanceMethod<double>(new object[]{});
}
}
}
Loading