Skip to content

Commit

Permalink
chore(release): 1.57.0 (#3492)
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-cdk-automation authored Apr 19, 2022
1 parent 55e7d15 commit f614666
Show file tree
Hide file tree
Showing 13 changed files with 98 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/close-stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
name: Stale issue job
steps:
- uses: aws-actions/stale-issue-cleanup@v4
- uses: aws-actions/stale-issue-cleanup@v5
with:
# Setting messages to an empty string will cause the automation to skip
# that category
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
--site-dir ${{ runner.temp }}/site
working-directory: gh-pages
- name: Upload Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: doc-site
path: ${{ runner.temp }}/site/
Expand All @@ -63,7 +63,7 @@ jobs:
ref: gh-pages
token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
- name: Download Artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: doc-site
path: ${{ runner.temp }}/site
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ jobs:
with:
dotnet-version: '5.0.x'
- name: Set up Go 1.16
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: '1.16'
- name: Set up Java 8
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'zulu'
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
.
# Upload artifact (we'll tar it up to save time)
- name: 'Upload Artifact: built-tree'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: built-tree
path: ${{ runner.temp }}/built-tree.tgz
Expand Down Expand Up @@ -126,11 +126,11 @@ jobs:
with:
dotnet-version: '5.0.x'
- name: Set up Go 1.16
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: '1.16'
- name: Set up Java 8
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'zulu'
Expand Down Expand Up @@ -198,7 +198,7 @@ jobs:
yarn package
# Upload artifacts
- name: 'Upload Artifact: release-package'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: release-package
path: ${{ github.workspace }}/dist/
Expand Down Expand Up @@ -277,7 +277,7 @@ jobs:
steps:
# Check out the code
- name: Download Artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: built-tree
- name: Extract Artifact
Expand All @@ -294,11 +294,11 @@ jobs:
dotnet-version: ${{ matrix.dotnet }}
include-prerelease: ${{ matrix.dotnet-prerelease }}
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Set up Java ${{ matrix.java }}
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/yarn-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
git add .
git diff --patch --staged > ${{ runner.temp }}/upgrade.patch
- name: Upload Patch
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: upgrade.patch
path: ${{ runner.temp }}/upgrade.patch
Expand All @@ -118,7 +118,7 @@ jobs:
uses: actions/checkout@v3

- name: Download patch
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: upgrade.patch
path: ${{ runner.temp }}
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.57.0](https://github.com/aws/jsii/compare/v1.56.0...v1.57.0) (2022-04-19)


### Bug Fixes

* **go:** object type not recognized ([#3485](https://github.com/aws/jsii/issues/3485)) ([fe2fa94](https://github.com/aws/jsii/commit/fe2fa947891ab5d517efbec37998b9b57203aa8d)), closes [#2880](https://github.com/aws/jsii/issues/2880)
* **jsii:** some submodules are not exported from `aws-cdk-lib` ([#3491](https://github.com/aws/jsii/issues/3491)) ([47f70a2](https://github.com/aws/jsii/commit/47f70a26383f401a8b3df700787d6ce7934f66f9))
* make jsii --watch work ([#3487](https://github.com/aws/jsii/issues/3487)) ([4a46f7d](https://github.com/aws/jsii/commit/4a46f7d7db3e6f9f1cf2730b02f4af0c1da9f237)), closes [#3467](https://github.com/aws/jsii/issues/3467)

## [1.56.0](https://github.com/aws/jsii/compare/v1.55.1...v1.56.0) (2022-04-08)


Expand Down
2 changes: 1 addition & 1 deletion gh-pages/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mkdocs~=1.3.0
mkdocs-awesome-pages-plugin~=2.7.0
mkdocs-material~=8.2.8
mkdocs-material~=8.2.9
mkdocs-git-revision-date-plugin~=0.3.2
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.56.0"
"version": "1.57.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (c *Client) castAndSetToPtr(ptr reflect.Value, data reflect.Value) {

targetType := ptr.Type()
if typ, ok := c.Types().FindType(ref.TypeFQN()); ok && typ.AssignableTo(ptr.Type()) {
// Specialize the return type to be the dynamic value type
// Specialize the return type to be the dynamic value type
targetType = typ
}

Expand Down Expand Up @@ -191,6 +191,11 @@ func (c *Client) CastPtrToRef(dataVal reflect.Value) interface{} {
},
}
}
} else if dataVal.Elem().Kind() == reflect.Ptr {
// Typically happens when a struct pointer is passed into an interface{}
// typed API (such as a place where a union is accepted).
elemVal := dataVal.Elem()
return c.CastPtrToRef(elemVal)
}

if ref, err := c.ManageObject(dataVal); err != nil {
Expand Down
37 changes: 36 additions & 1 deletion packages/jsii-pacmak/lib/targets/python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1637,7 +1637,21 @@ class PythonModule implements PythonType {
}

// Whatever names we've exported, we'll write out our __all__ that lists them.
const exportedMembers = this.members.map((m) => `"${m.pythonName}"`);
//
// __all__ is normally used for when users write `from library import *`, but we also
// use it with the `publication` module to hide everything that's NOT in the list.
//
// Normally adding submodules to `__all__` has the (negative?) side-effect
// that all submodules get loaded when the user does `import *`, but we
// already load submodules anyway so it doesn't make a difference, and in combination
// with the `publication` module NOT having them in this list hides any submodules
// we import as part of typechecking.
const exportedMembers = [
...this.members.map((m) => `"${m.pythonName}"`),
...this.modules
.filter((m) => this.isDirectChild(m))
.map((m) => `"${lastComponent(m.pythonName)}"`),
];
if (this.loadAssembly) {
exportedMembers.push('"__jsii_assembly__"');
}
Expand Down Expand Up @@ -1747,6 +1761,19 @@ class PythonModule implements PythonType {
return scripts;
}

private isDirectChild(pyMod: PythonModule) {
if (
this.pythonName === pyMod.pythonName ||
!pyMod.pythonName.startsWith(`${this.pythonName}.`)
) {
return false;
}
// Must include only one more component
return !pyMod.pythonName
.substring(this.pythonName.length + 1)
.includes('.');
}

/**
* Emit the README as module docstring if this is the entry point module (it loads the assembly)
*/
Expand Down Expand Up @@ -3114,3 +3141,11 @@ function nestedContext(
}

const isDeprecated = (x: PythonBase) => x.docs?.deprecated !== undefined;

/**
* Last component of a .-separated name
*/
function lastComponent(n: string) {
const parts = n.split('.');
return parts[parts.length - 1];
}

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

9 changes: 6 additions & 3 deletions packages/jsii/bin/jsii.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { enabledWarnings } from '../lib/warnings';

const warningTypes = Object.keys(enabledWarnings);

(() => {
(async () => {
const argv = yargs
.env('JSII')
.command(
Expand Down Expand Up @@ -117,7 +117,7 @@ const warningTypes = Object.keys(enabledWarnings);
generateTypeScriptConfig: argv['generate-tsconfig'],
});

const emitResult = argv.watch ? compiler.watch() : compiler.emit();
const emitResult = argv.watch ? await compiler.watch() : compiler.emit();

const allDiagnostics = [...projectInfoDiagnostics, ...emitResult.diagnostics];

Expand All @@ -127,7 +127,10 @@ const warningTypes = Object.keys(enabledWarnings);
if (emitResult.emitSkipped) {
process.exitCode = 1;
}
})();
})().catch((e) => {
console.error(`Error: ${e.stack}`);
process.exitCode = -1;
});

function _configureLog4js(verbosity: number) {
const stderrColor = !!process.stderr.isTTY;
Expand Down
12 changes: 7 additions & 5 deletions packages/jsii/lib/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,17 @@ export class Compiler implements Emitter {
*
* @internal
*/
public watch(opts: NonBlockingWatchOptions): ts.Watch<ts.BuilderProgram>;
public async watch(
opts: NonBlockingWatchOptions,
): Promise<ts.Watch<ts.BuilderProgram>>;
/**
* Watches for file-system changes and dynamically recompiles the project as needed. In blocking mode, this results
* in a never-resolving promise.
*/
public watch(): never;
public watch(
public async watch(): Promise<never>;
public async watch(
opts?: NonBlockingWatchOptions,
): ts.Watch<ts.BuilderProgram> | never {
): Promise<ts.Watch<ts.BuilderProgram> | never> {
this._prepareForBuild();

const pi = this.options.projectInfo;
Expand Down Expand Up @@ -184,7 +186,7 @@ export class Compiler implements Emitter {
return watch;
}
// In blocking mode, returns a never-resolving promise.
return undefined as never;
return new Promise<never>(() => null);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/jsii/test/compiler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe(Compiler, () => {
onWatchClosed = ok;
onWatchFailed = ko;
});
const watch = compiler.watch({
const watch = await compiler.watch({
nonBlocking: true,
// Ignore diagnostics reporting (not to pollute test console output)
reportDiagnostics: () => null,
Expand Down

0 comments on commit f614666

Please sign in to comment.