-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(jsii): Tag the jsii compiler version in the .jsii assemblies
By default, the fully qualified version number (including the commit SHA prefix) is written in the new `jsiiVersion` field of the assembly, however in order to make this friendlier to tests, there is an option to turn over to a *short* format by setting the new `jsii.versionFormat` key in `package.json` to `'short'`. Also, slightly altered the generation of the fully qualified version name to distinguish between cases where the commit SHA was provided by the CodeBuild environment variable, versus parsed using `git rev-parse`, denoting the later is indicative of an "unreleased" version. Fixes #412
- Loading branch information
1 parent
8ff9137
commit a2f32ad
Showing
19 changed files
with
87 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,7 @@ Edit your `package.json`: | |
```js | ||
{ | ||
// ... | ||
|
||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"scripts": { | ||
|
@@ -97,14 +97,14 @@ Edit your `package.json`: | |
|
||
So, what's going on here? | ||
|
||
* The `jsii` section in your `package.json` is the [jsii configuration](#configuration) for your module. | ||
* The `jsii` section in your `package.json` is the [jsii configuration](#configuration) for your module. | ||
It tells jsii which target languages to package, and includes additional required information for the | ||
jsii packager. | ||
* `npm run build` uses `jsii` to compile your code. It invokes the TypeScript compiler (`tsc`) and will compile | ||
* `npm run build` uses `jsii` to compile your code. It invokes the TypeScript compiler (`tsc`) and will compile | ||
your .ts files into .js files. | ||
* `npm run watch` will invoke `tsc -w` which will monitor your filesystem for changes and recompile | ||
* `npm run watch` will invoke `tsc -w` which will monitor your filesystem for changes and recompile | ||
your .ts files to .js (note that jsii errors will not be reported in this mode) | ||
* `npm run package` invokes `jsii-pacmak`, which is the __jsii packager__. It will generate _and compile_ your | ||
* `npm run package` invokes `jsii-pacmak`, which is the __jsii packager__. It will generate _and compile_ your | ||
package to all target languages. The output packages will be emitted to `outdir` (in the above case `dist`). | ||
* Other required `package.json` fields: `license`, `main`, `types`. | ||
|
||
|
@@ -198,30 +198,30 @@ Now, if you check out the contents of `dist`, you'll find: | |
|
||
``` | ||
├── dotnet | ||
│ └── Acme.Hello.nupkg | ||
│ └── Acme.Hello.nupkg | ||
├── java | ||
│ └── com | ||
│ └── acme | ||
│ └── hello | ||
│ └── hello-jsii | ||
│ ├── 1.0.0 | ||
│ │ ├── hello-jsii-1.0.0-javadoc.jar | ||
│ │ ├── hello-jsii-1.0.0-javadoc.jar.md5 | ||
│ │ ├── hello-jsii-1.0.0-javadoc.jar.sha1 | ||
│ │ ├── hello-jsii-1.0.0-sources.jar | ||
│ │ ├── hello-jsii-1.0.0-sources.jar.md5 | ||
│ │ ├── hello-jsii-1.0.0-sources.jar.sha1 | ||
│ │ ├── hello-jsii-1.0.0.jar | ||
│ │ ├── hello-jsii-1.0.0.jar.md5 | ||
│ │ ├── hello-jsii-1.0.0.jar.sha1 | ||
│ │ ├── hello-jsii-1.0.0.pom | ||
│ │ ├── hello-jsii-1.0.0.pom.md5 | ||
│ │ └── hello-jsii-1.0.0.pom.sha1 | ||
│ ├── maven-metadata.xml | ||
│ ├── maven-metadata.xml.md5 | ||
│ └── maven-metadata.xml.sha1 | ||
│ └── com | ||
│ └── acme | ||
│ └── hello | ||
│ └── hello-jsii | ||
│ ├── 1.0.0 | ||
│ │ ├── hello-jsii-1.0.0-javadoc.jar | ||
│ │ ├── hello-jsii-1.0.0-javadoc.jar.md5 | ||
│ │ ├── hello-jsii-1.0.0-javadoc.jar.sha1 | ||
│ │ ├── hello-jsii-1.0.0-sources.jar | ||
│ │ ├── hello-jsii-1.0.0-sources.jar.md5 | ||
│ │ ├── hello-jsii-1.0.0-sources.jar.sha1 | ||
│ │ ├── hello-jsii-1.0.0.jar | ||
│ │ ├── hello-jsii-1.0.0.jar.md5 | ||
│ │ ├── hello-jsii-1.0.0.jar.sha1 | ||
│ │ ├── hello-jsii-1.0.0.pom | ||
│ │ ├── hello-jsii-1.0.0.pom.md5 | ||
│ │ └── hello-jsii-1.0.0.pom.sha1 | ||
│ ├── maven-metadata.xml | ||
│ ├── maven-metadata.xml.md5 | ||
│ └── maven-metadata.xml.sha1 | ||
├── js | ||
│ └── [email protected] | ||
│ └── [email protected] | ||
└── sphinx | ||
└── hello-jsii.rst | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters