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

chore(release): 1.79.0 #4027

Merged
merged 10 commits into from
Mar 23, 2023
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -1558,6 +1558,15 @@
"contributions": [
"code"
]
},
{
"login": "a-h",
"name": "Adrian Hesketh",
"avatar_url": "https://avatars.githubusercontent.com/u/1029947?v=4",
"profile": "http://adrianhesketh.com/",
"contributions": [
"code"
]
}
],
"repoType": "github",
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
with:
dotnet-version: '6.0.x'
- name: Set up Go 1.18
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: '1.18'
- name: Set up Java 8
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
with:
dotnet-version: '6.0.x'
- name: Set up Go 1.18
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: '1.18'
- name: Set up Java 8
Expand Down Expand Up @@ -312,7 +312,7 @@ jobs:
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Set up Java ${{ matrix.java }}
Expand Down Expand Up @@ -432,7 +432,7 @@ jobs:
with:
dotnet-version: '6.0.x'
- name: Set up Go 1.18
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: '1.18'
- name: Set up Java 8
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.79.0](https://github.com/aws/jsii/compare/v1.78.1...v1.79.0) (2023-03-23)


### Features

* add configurable pack command ([#4021](https://github.com/aws/jsii/issues/4021)) ([6b2fd18](https://github.com/aws/jsii/commit/6b2fd186bd77416a9b341c5544a101f50793076d))
* enable Go generics for jsii Go CDK code ([#4009](https://github.com/aws/jsii/issues/4009)) ([f653b31](https://github.com/aws/jsii/commit/f653b3173760679562648710b08907bfe2c7c748))
* **runtimes:** support JSII_NODE setting ([#4024](https://github.com/aws/jsii/issues/4024)) ([f8f2f13](https://github.com/aws/jsii/commit/f8f2f13780f805cd41cb9945ad8febce9aec5900)), closes [#4009](https://github.com/aws/jsii/issues/4009)

## [1.78.1](https://github.com/aws/jsii/compare/v1.78.0...v1.78.1) (2023-03-16)


Expand Down
45 changes: 23 additions & 22 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"rejectCycles": true
}
},
"version": "1.78.1"
"version": "1.79.0"
}
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@
},
"devDependencies": {
"@jest/types": "^28.1.3",
"@types/jest": "^29.4.0",
"@types/node": "^14.18.37",
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"@types/jest": "^29.5.0",
"@types/node": "^14.18.40",
"@typescript-eslint/eslint-plugin": "^5.56.0",
"@typescript-eslint/parser": "^5.56.0",
"all-contributors-cli": "^6.24.0",
"eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0",
"eslint": "^8.36.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-node": "^0.3.7",
"eslint-import-resolver-typescript": "^3.5.3",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-prettier": "^4.2.1",
"jest": "^29.4.3",
"jest": "^29.5.0",
"jest-circus": "^28.1.3",
"jest-config": "^28.1.3",
"jest-expect-message": "^1.1.3",
"lerna": "^6.5.1",
"prettier": "^2.8.4",
"prettier": "^2.8.6",
"standard-version": "^9.5.0",
"ts-node": "^10.9.1",
"typescript": "~4.7.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/@jsii/benchmarks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"devDependencies": {
"@types/glob": "^8.1.0",
"glob": "^9.2.1"
"glob": "^9.3.1"
},
"scripts": {
"build": "yarn --silent tsc --build && npm run lint",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ internal sealed class NodeProcess : INodeProcess
readonly ILogger _logger;

private const string JsiiRuntime = "JSII_RUNTIME";
private const string JsiiNode = "JSII_NODE";
private const string JsiiDebug = "JSII_DEBUG";
private const string JsiiAgent = "JSII_AGENT";
private const string JsiiAgentVersionString = "DotNet/{0}/{1}/{2}";
Expand All @@ -34,10 +35,14 @@ public NodeProcess(IJsiiRuntimeProvider jsiiRuntimeProvider, ILoggerFactory logg
if (string.IsNullOrWhiteSpace(runtimePath))
runtimePath = jsiiRuntimeProvider.JsiiRuntimePath;

var node = Environment.GetEnvironmentVariable(JsiiNode);
if (string.IsNullOrWhiteSpace(node))
node = "node";

var utf8 = new UTF8Encoding(false /* no BOM */);
var startInfo = new ProcessStartInfo
{
FileName = "node",
FileName = node,
Arguments = $"--max-old-space-size=4096 {runtimePath}",
RedirectStandardInput = true,
StandardInputEncoding = utf8,
Expand All @@ -61,7 +66,7 @@ public NodeProcess(IJsiiRuntimeProvider jsiiRuntimeProvider, ILoggerFactory logg
_logger.LogDebug($"{startInfo.FileName} {startInfo.Arguments}");

// Registering shutdown hook to have JS process gracefully terminate.
AppDomain.CurrentDomain.ProcessExit += (snd, evt) => { ((IDisposable) this).Dispose(); };
AppDomain.CurrentDomain.ProcessExit += (snd, evt) => { ((IDisposable)this).Dispose(); };

_process = Process.Start(startInfo)!;

Expand Down
66 changes: 40 additions & 26 deletions packages/@jsii/go-runtime/jsii-runtime-go/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,64 @@ package jsii

import "time"

// Bool obtains a pointer to the provided bool.
func Bool(v bool) *bool { return &v }
type basicType interface {
bool | string | float64 | time.Time
}

// Bools obtains a pointer to a slice of pointers to all the provided booleans.
func Bools(v ...bool) *[]*bool {
slice := make([]*bool, len(v))
// Ptr returns a pointer to the provided value.
func Ptr[T basicType](v T) *T {
return &v
}

// PtrSlice returns a pointer to a slice of pointers to all of the provided values.
func PtrSlice[T basicType](v ...T) *[]*T {
slice := make([]*T, len(v))
for i := 0; i < len(v); i++ {
slice[i] = Bool(v[i])
slice[i] = Ptr(v[i])
}
return &slice
}

// Number obtains a pointer to the provided float64.
func Number(v float64) *float64 { return &v }
// Bool returns a pointer to the provided bool.
func Bool(v bool) *bool { return Ptr(v) }

// Bools returns a pointer to a slice of pointers to all of the provided booleans.
func Bools(v ...bool) *[]*bool {
return PtrSlice(v...)
}

type numberType interface {
~float32 | ~float64 |
~int | ~int8 | ~int16 | ~int32 | ~int64 |
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

// Numbers obtains a pointer to a slice of pointers to all the provided numbers.
func Numbers(v ...float64) *[]*float64 {
// Number returns a pointer to the provided float64.
func Number[T numberType](v T) *float64 {
return Ptr(float64(v))
}

// Numbers returns a pointer to a slice of pointers to all of the provided numbers.
func Numbers[T numberType](v ...T) *[]*float64 {
slice := make([]*float64, len(v))
for i := 0; i < len(v); i++ {
slice[i] = Number(v[i])
}
return &slice
}

// String obtains a pointer to the provided string.
func String(v string) *string { return &v }
// String returns a pointer to the provided string.
func String(v string) *string { return Ptr(v) }

// Strings obtains a pointer to a slice of pointers to all the provided strings.
// Strings returns a pointer to a slice of pointers to all of the provided strings.
func Strings(v ...string) *[]*string {
slice := make([]*string, len(v))
for i := 0; i < len(v); i++ {
slice[i] = String(v[i])
}
return &slice
return PtrSlice(v...)
}

// Time obtains a pointer to the provided time.Time.
func Time(v time.Time) *time.Time { return &v }
// Time returns a pointer to the provided time.Time.
func Time(v time.Time) *time.Time { return Ptr(v) }

// Times obtains a pointer to a slice of pointers to all the provided time.Time.
// Times returns a pointer to a slice of pointers to all of the provided time.Time values.
func Times(v ...time.Time) *[]*time.Time {
slice := make([]*time.Time, len(v))
for i := 0; i < len(v); i++ {
slice[i] = Time(v[i])
}
return &slice
return PtrSlice(v...)
}
35 changes: 35 additions & 0 deletions packages/@jsii/go-runtime/jsii-runtime-go/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@ import (
"github.com/stretchr/testify/assert"
)

func TestV(t *testing.T) {
// Bool
assert.Equal(t, true, *Ptr(true))
assert.Equal(t, false, *Ptr(false))
// Bools
assert.Equal(t, []*bool{Bool(true), Bool(false), Bool(false), Bool(true)}, *PtrSlice(true, false, false, true))
// Float64 is supported because it doesn't require conversion.
assert.Equal(t, 123.45, *Ptr(123.45))
assert.Equal(t, float64(123.45), *Ptr(float64(123.45)))
// String
assert.Equal(t, "Hello", *String("Hello"))
// Strings
assert.Equal(t, []*string{String("Hello"), String("World")}, *Strings("Hello", "World"))
// Time
now := time.Now()
assert.Equal(t, now, *Time(now))
// Times
assert.Equal(t, []*time.Time{Time(now)}, *Times(now))
}

func TestBool(t *testing.T) {
assert.Equal(t, true, *Bool(true))
assert.Equal(t, false, *Bool(false))
Expand All @@ -19,6 +39,21 @@ func TestBools(t *testing.T) {
func TestNumber(t *testing.T) {
assert.Equal(t, 123.45, *Number(123.45))
assert.Equal(t, 1337.0, *Number(1337))
// Floats.
assert.Equal(t, float64(float32(123.45)), *Number(float32(123.45)))
assert.Equal(t, float64(123.45), *Number(float64(123.45)))
// Ints.
assert.Equal(t, float64(1337), *Number(int(1337)))
// Signed.
assert.Equal(t, float64(127), *Number(int8(127)))
assert.Equal(t, float64(1337), *Number(int16(1337)))
assert.Equal(t, float64(1337), *Number(int32(1337)))
assert.Equal(t, float64(1337), *Number(int64(1337)))
// Unsigned.
assert.Equal(t, float64(127), *Number(uint8(127)))
assert.Equal(t, float64(1337), *Number(uint16(1337)))
assert.Equal(t, float64(1337), *Number(uint32(1337)))
assert.Equal(t, float64(1337), *Number(uint64(1337)))
}

func TestNumbers(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions packages/@jsii/java-runtime-test/project/.mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--settings=user.xml
1 change: 1 addition & 0 deletions packages/@jsii/java-runtime/project/.mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--settings=user.xml
Loading