Skip to content

Commit

Permalink
chore(release): 1.19.0 (#2513)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Feb 2, 2021
2 parents 4595dab + 7614c96 commit 4fa7f5a
Show file tree
Hide file tree
Showing 29 changed files with 595 additions and 154 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

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.19.0](https://github.com/aws/jsii/compare/v1.18.0...v1.19.0) (2021-02-02)


### Features

* add runtime type info (fqn and version) to compiled sources ([481e7a4](https://github.com/aws/jsii/commit/481e7a47a8f4dd7348ba4aba683902b869d11c84)), closes [/github.com/aws/aws-cdk-rfcs/blob/master/text/0253-cdk-metadata-v2.md#appendix-1](https://github.com/aws//github.com/aws/aws-cdk-rfcs/blob/master/text/0253-cdk-metadata-v2.md/issues/appendix-1)
* **go:** version file in the generated module directory ([#2492](https://github.com/aws/jsii/issues/2492)) ([da3ea25](https://github.com/aws/jsii/commit/da3ea25330a8a73f3102db1dfc8f94ea1d6eca3c))


### Bug Fixes

* **go:** major version suffix is missing in module names for >=v2 ([#2507](https://github.com/aws/jsii/issues/2507)) ([32c0add](https://github.com/aws/jsii/commit/32c0add5edd0ed57d535241b483168e2b7e731ce)), closes [#2509](https://github.com/aws/jsii/issues/2509)

## [1.18.0](https://github.com/aws/jsii/compare/v1.17.1...v1.18.0) (2021-01-28)


Expand Down
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.18.0"
"version": "1.19.0"
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
},
"devDependencies": {
"@jest/types": "^26.6.2",
"@typescript-eslint/eslint-plugin": "^4.14.1",
"@typescript-eslint/parser": "^4.14.1",
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"all-contributors-cli": "^6.19.0",
"eslint": "^7.18.0",
"eslint": "^7.19.0",
"eslint-config-prettier": "^7.2.0",
"eslint-import-resolver-node": "^0.3.4",
"eslint-import-resolver-typescript": "^2.3.0",
Expand All @@ -30,7 +30,7 @@
"lerna": "^3.22.1",
"prettier": "^2.2.1",
"standard-version": "^9.1.0",
"ts-jest": "^26.4.4",
"ts-jest": "^26.5.0",
"ts-node": "^9.1.1",
"typescript": "~3.9.7"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@jsii/go-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@types/fs-extra": "^8.1.1",
"@types/node": "^10.17.51",
"codemaker": "^0.0.0",
"eslint": "^7.18.0",
"eslint": "^7.19.0",
"fs-extra": "^9.1.0",
"jsii-calc": "^0.0.0",
"jsii-pacmak": "^0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@jsii/integ-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@types/jest": "^26.0.20",
"@types/node": "^10.17.51",
"@types/tar": "^4.0.4",
"eslint": "^7.18.0",
"eslint": "^7.19.0",
"prettier": "^2.2.1",
"typescript": "~3.9.7"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/@jsii/kernel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
"@types/jest-expect-message": "^1.0.3",
"@types/node": "^10.17.51",
"@types/tar": "^4.0.4",
"eslint": "^7.18.0",
"eslint": "^7.19.0",
"jest": "^26.6.3",
"jest-expect-message": "^1.0.2",
"jsii-build-tools": "^0.0.0",
"jsii-calc": "^0.0.0",
"prettier": "^2.2.1",
"ts-jest": "^26.4.4",
"ts-jest": "^26.5.0",
"typescript": "~3.9.7"
}
}
6 changes: 3 additions & 3 deletions packages/@jsii/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@
"@scope/jsii-calc-lib": "^0.0.0",
"@types/jest": "^26.0.20",
"@types/node": "^10.17.51",
"eslint": "^7.18.0",
"eslint": "^7.19.0",
"jest": "^26.6.3",
"jsii-build-tools": "^0.0.0",
"jsii-calc": "^0.0.0",
"prettier": "^2.2.1",
"source-map-loader": "^2.0.0",
"ts-jest": "^26.4.4",
"ts-jest": "^26.5.0",
"typescript": "~3.9.7",
"wasm-loader": "^1.3.0",
"webpack": "^5.18.0",
"webpack": "^5.19.0",
"webpack-cli": "^4.4.0"
}
}
2 changes: 1 addition & 1 deletion packages/@jsii/spec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"devDependencies": {
"@types/jest": "^26.0.20",
"@types/node": "^10.17.51",
"eslint": "^7.18.0",
"eslint": "^7.19.0",
"jest": "^26.6.3",
"jsii-build-tools": "^0.0.0",
"prettier": "^2.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/codemaker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@types/fs-extra": "^8.1.1",
"@types/jest": "^26.0.20",
"@types/node": "^10.17.51",
"eslint": "^7.18.0",
"eslint": "^7.19.0",
"jest": "^26.6.3",
"prettier": "^2.2.1",
"typescript": "~3.9.7"
Expand Down
2 changes: 1 addition & 1 deletion packages/jsii-calc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
},
"devDependencies": {
"@types/node": "^10.17.51",
"eslint": "^7.18.0",
"eslint": "^7.19.0",
"jsii": "^0.0.0",
"jsii-build-tools": "^0.0.0",
"jsii-rosetta": "^0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/jsii-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@types/jest-expect-message": "^1.0.3",
"@types/node": "^10.17.51",
"@types/yargs": "^15.0.12",
"eslint": "^7.18.0",
"eslint": "^7.19.0",
"jest": "^26.6.3",
"jest-expect-message": "^1.0.2",
"prettier": "^2.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/jsii-diff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@types/node": "^10.17.51",
"@types/tar-fs": "^2.0.0",
"@types/yargs": "^15.0.12",
"eslint": "^7.18.0",
"eslint": "^7.19.0",
"jest": "^26.6.3",
"jest-expect-message": "^1.0.2",
"jsii": "^0.0.0",
Expand Down
6 changes: 4 additions & 2 deletions packages/jsii-pacmak/lib/targets/go.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ export class Golang extends Target {
// run `go build` with local.go.mod
await go('build', ['-modfile', localGoMod], { cwd: pkgDir });

// delete local.go.mod from the output directory so it doesn't get published
await fs.unlink(path.join(pkgDir, localGoMod));
// delete local.go.mod and local.go.sum from the output directory so it doesn't get published
const localGoSum = `${path.basename(localGoMod, '.mod')}.sum`;
await fs.remove(path.join(pkgDir, localGoMod));
await fs.remove(path.join(pkgDir, localGoSum));
}

/**
Expand Down
43 changes: 41 additions & 2 deletions packages/jsii-pacmak/lib/targets/go/package.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { CodeMaker } from 'codemaker';
import { Assembly, Type, Submodule as JsiiSubmodule } from 'jsii-reflect';
import { join } from 'path';
import * as semver from 'semver';

import { EmitContext } from './emit-context';
import { ReadmeFile } from './readme-file';
Expand All @@ -13,6 +14,7 @@ import {
} from './runtime';
import { GoClass, GoType, Enum, Interface, Struct } from './types';
import { findTypeInTree, goPackageName, flatMap } from './util';
import { VersionFile } from './version-file';

export const GOMOD_FILENAME = 'go.mod';
export const GO_VERSION = '1.15';
Expand All @@ -32,6 +34,7 @@ export abstract class Package {
public readonly packageName: string,
public readonly filePath: string,
public readonly moduleName: string,
public readonly version: string,
// If no root is provided, this module is the root
root?: Package,
) {
Expand Down Expand Up @@ -77,7 +80,8 @@ export abstract class Package {
const prefix = moduleName !== '' ? `${moduleName}/` : '';
const rootPackageName = this.root.packageName;
const suffix = this.filePath !== '' ? `/${this.filePath}` : ``;
return `${prefix}${rootPackageName}${suffix}`;
const versionSuffix = determineMajorVersionSuffix(this.version);
return `${prefix}${rootPackageName}${suffix}${versionSuffix}`;
}

/*
Expand Down Expand Up @@ -181,6 +185,7 @@ export class RootPackage extends Package {
public readonly assembly: Assembly;
public readonly version: string;
private readonly readme?: ReadmeFile;
private readonly versionFile: VersionFile;

public constructor(assembly: Assembly) {
const packageName = goPackageName(assembly.name);
Expand All @@ -193,10 +198,12 @@ export class RootPackage extends Package {
packageName,
filePath,
moduleName,
assembly.version,
);

this.assembly = assembly;
this.version = assembly.version;
this.versionFile = new VersionFile(this.version);

if (this.assembly.readme?.markdown) {
this.readme = new ReadmeFile(
Expand All @@ -212,6 +219,7 @@ export class RootPackage extends Package {
this.readme?.emit(context);

this.emitGomod(context.code);
this.versionFile.emit(context.code);
}

private emitGomod(code: CodeMaker) {
Expand Down Expand Up @@ -285,7 +293,7 @@ export class RootPackage extends Package {
code.line('// Initialization endpoints of dependencies');
for (const pkg of dependencies) {
code.line(
`${pkg.packageName} "${pkg.root.moduleName}/${pkg.root.packageName}/${JSII_INIT_PACKAGE}"`,
`${pkg.packageName} "${pkg.root.goModuleName}/${JSII_INIT_PACKAGE}"`,
);
}
}
Expand Down Expand Up @@ -336,9 +344,40 @@ export class InternalPackage extends Package {
packageName,
filePath,
root.moduleName,
root.version,
root,
);

this.parent = parent;
}
}

/**
* Go requires that when a module major version is v2.0 and above, the module
* name will have a `/vNN` suffix (where `NN` is the major version).
*
* > Starting with major version 2, module paths must have a major version
* > suffix like /v2 that matches the major version. For example, if a module
* > has the path example.com/mod at v1.0.0, it must have the path
* > example.com/mod/v2 at version v2.0.0.
*
* @see https://golang.org/ref/mod#major-version-suffixes
* @param version The module version (e.g. `2.3.0`)
* @returns a suffix to append to the module name in the form (`/vNN`). If the
* module version is `0.x` or `1.x`, returns an empty string.
*/
function determineMajorVersionSuffix(version: string) {
const sv = semver.parse(version);
if (!sv) {
throw new Error(
`Unable to parse version "${version}" as a semantic version`,
);
}

// suffix is only needed for 2.0 and above
if (sv.major <= 1) {
return '';
}

return `/v${sv.major}`;
}
17 changes: 17 additions & 0 deletions packages/jsii-pacmak/lib/targets/go/version-file.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { CodeMaker } from 'codemaker';

/**
* Represents the version of the go module. This is needed because the version is not
* available in standard go module files.
*/
export class VersionFile {
private static readonly NAME = 'version';

public constructor(private readonly version: string) {}

public emit(code: CodeMaker) {
code.openFile(VersionFile.NAME);
code.line(this.version);
code.closeFile(VersionFile.NAME);
}
}
4 changes: 2 additions & 2 deletions packages/jsii-pacmak/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@
"@types/node": "^10.17.51",
"@types/semver": "^7.3.4",
"@types/yargs": "^15.0.12",
"eslint": "^7.18.0",
"eslint": "^7.19.0",
"jest": "^26.6.3",
"jsii-build-tools": "^0.0.0",
"jsii-calc": "^0.0.0",
"prettier": "^2.2.1",
"ts-jest": "^26.4.4",
"ts-jest": "^26.5.0",
"typescript": "~3.9.7"
},
"keywords": [
Expand Down
Loading

0 comments on commit 4fa7f5a

Please sign in to comment.