Comparing version 0.8.2 to 0.9.0
@@ -6,2 +6,22 @@ # Change Log | ||
# [0.9.0](https://github.com/awslabs/jsii/compare/v0.8.2...v0.9.0) (2019-04-04) | ||
### Features | ||
* **jsii:** Enforce use of peerDependencies ([#421](https://github.com/awslabs/jsii/issues/421)) ([e72fea5](https://github.com/awslabs/jsii/commit/e72fea5)), closes [#361](https://github.com/awslabs/jsii/issues/361) | ||
* **jsii:** record source locations in assembly ([#429](https://github.com/awslabs/jsii/issues/429)) ([e601c0c](https://github.com/awslabs/jsii/commit/e601c0c)) | ||
* **jsii:** Tag the jsii compiler version in the .jsii assemblies ([#420](https://github.com/awslabs/jsii/issues/420)) ([42dece1](https://github.com/awslabs/jsii/commit/42dece1)), closes [#412](https://github.com/awslabs/jsii/issues/412) | ||
* **jsii-diff:** standardize doc comments, add API compatibility tool ([#415](https://github.com/awslabs/jsii/issues/415)) ([9cfd867](https://github.com/awslabs/jsii/commit/9cfd867)) | ||
### BREAKING CHANGES | ||
* **jsii:** All direct dependencies must be duplicated in | ||
peerDependencies unless they are in bundledDependencies. | ||
## [0.8.2](https://github.com/awslabs/jsii/compare/v0.8.1...v0.8.2) (2019-03-28) | ||
@@ -8,0 +28,0 @@ |
@@ -57,2 +57,7 @@ export declare const SPEC_FILE_NAME = ".jsii"; | ||
/** | ||
* The version of the jsii compiler that was used to produce this Assembly. | ||
* @minLength 1 | ||
*/ | ||
jsiiVersion: string; | ||
/** | ||
* The SPDX name of the license this assembly is distributed on. | ||
@@ -90,2 +95,10 @@ */ | ||
}; | ||
/** | ||
* Source directory of the module root, relative to the repository root. | ||
* | ||
* If undefined or the empty string, no source location information is | ||
* available. If the module root is equal to the root of the repository, | ||
* the value is '.'. | ||
*/ | ||
locationInRepository?: string; | ||
} | ||
@@ -145,3 +158,4 @@ /** | ||
/** | ||
* Indicates if this dependency is a peer dependency or a normal dependency. | ||
* Indicates if this dependency is a direct (peer) dependency or a | ||
* transitive dependency. | ||
* | ||
@@ -151,8 +165,8 @@ * Peer dependencies are expected to be explicitly defined by the user of | ||
* | ||
* jsii enforces that if this module exports a type from a dependency, this | ||
* dependency must be defined as a peer and not as a normal dependency. | ||
* Otherwise, it would be impossible to safely use two versions of this | ||
* dependency in a closure. | ||
* jsii enforces that any direct dependency on another jsii module is also | ||
* defined as a peerDependency. Otherwise, it would be impossible to safely | ||
* use two versions of this dependency in a closure. | ||
* | ||
* @see https://github.com/awslabs/aws-cdk/issues/979 | ||
* @see https://github.com/awslabs/jsii/issues/361 | ||
* @see https://nodejs.org/en/blog/npm/peer-dependencies/ | ||
@@ -163,8 +177,83 @@ */ | ||
/** | ||
* Where in the module source the definition for this API item was found | ||
*/ | ||
export interface SourceLocation { | ||
/** | ||
* Relative filename | ||
*/ | ||
filename: string; | ||
/** | ||
* 1-based line number in the indicated file | ||
*/ | ||
line: number; | ||
} | ||
/** | ||
* Key value pairs of documentation nodes. | ||
* Based on JSDoc. | ||
* Based on TSDoc. | ||
*/ | ||
export interface Docs { | ||
[key: string]: string; | ||
/** | ||
* Summary documentation for an API item. | ||
* | ||
* The first part of the documentation before hitting a `@remarks` tags, or the first | ||
* line of the doc comment block if there is no `@remarks` tag. | ||
*/ | ||
summary?: string; | ||
/** | ||
* Detailed information about an API item. | ||
* | ||
* Either the explicitly tagged `@remarks` section, otherwise everything past the | ||
* first paragraph if there is no `@remarks` tag. | ||
*/ | ||
remarks?: string; | ||
/** | ||
* If present, this block indicates that an API item is no longer supported and may be | ||
* removed in a future release. The `@deprecated` tag must be followed by a sentence | ||
* describing the recommended alternative. Deprecation recursively applies to members | ||
* of a container. For example, if a class is deprecated, then so are all of its members. | ||
*/ | ||
deprecated?: string; | ||
/** | ||
* The `@returns` block for this doc comment, or undefined if there is not one. | ||
*/ | ||
returns?: string; | ||
/** | ||
* Whether the API item is beta/experimental quality | ||
*/ | ||
stability?: Stability; | ||
/** | ||
* Example showing the usage of this API item | ||
* | ||
* Starts off in running text mode, may switch to code using fenced code | ||
* blocks. | ||
*/ | ||
example?: string; | ||
/** | ||
* A `@see` link with more information | ||
*/ | ||
see?: string; | ||
/** | ||
* Whether this class or interface was intended to be subclassed/implemented by library users. | ||
* | ||
* Classes intended for subclassing, and interfaces intended to be implemented | ||
* by consumers, are held to stricter standards of API compatibility. | ||
* | ||
* @default false | ||
*/ | ||
subclassable?: boolean; | ||
/** | ||
* Description of the default | ||
*/ | ||
default?: string; | ||
/** | ||
* Custom tags that are not any of the default ones | ||
*/ | ||
custom?: { | ||
[tag: string]: string; | ||
}; | ||
} | ||
export declare enum Stability { | ||
Experimental = "experimental", | ||
Stable = "stable" | ||
} | ||
/** | ||
@@ -177,2 +266,15 @@ * Indicates that an entity is documentable. | ||
/** | ||
* Indicates that an entity has a source location | ||
*/ | ||
export interface SourceLocatable { | ||
/** | ||
* Where in the module this definition was found | ||
* | ||
* Why is this not `locationInAssembly`? Because the assembly is the JSII | ||
* file combining compiled code and its manifest, whereas this is referring | ||
* to the location of the source in the module the assembly was built from. | ||
*/ | ||
locationInModule?: SourceLocation; | ||
} | ||
/** | ||
* Kinds of collections. | ||
@@ -287,3 +389,3 @@ */ | ||
*/ | ||
export interface Property extends Documentable, Overridable { | ||
export interface Property extends Documentable, Overridable, SourceLocatable { | ||
/** | ||
@@ -343,3 +445,3 @@ * The name of the property. | ||
*/ | ||
export interface Method extends Documentable, Overridable { | ||
export interface Method extends Documentable, Overridable, SourceLocatable { | ||
/** | ||
@@ -386,3 +488,3 @@ * The name of the method. Undefined if this method is a initializer. | ||
*/ | ||
export interface TypeBase extends Documentable { | ||
export interface TypeBase extends Documentable, SourceLocatable { | ||
/** | ||
@@ -389,0 +491,0 @@ * The fully qualified name of the type (``<assembly>.<namespace>.<name>``) |
@@ -11,2 +11,7 @@ "use strict"; | ||
})(SchemaVersion = exports.SchemaVersion || (exports.SchemaVersion = {})); | ||
var Stability; | ||
(function (Stability) { | ||
Stability["Experimental"] = "experimental"; | ||
Stability["Stable"] = "stable"; | ||
})(Stability = exports.Stability || (exports.Stability = {})); | ||
/** | ||
@@ -13,0 +18,0 @@ * Kinds of collections. |
{ | ||
"name": "jsii-spec", | ||
"version": "0.8.2", | ||
"version": "0.9.0", | ||
"description": "Specification for jsii assemblies", | ||
@@ -8,4 +8,4 @@ "main": "lib/index.js", | ||
"scripts": { | ||
"watch": "tsc -w", | ||
"build": "tsc && bash generate-json-schema.sh", | ||
"build": "tsc --build && bash generate-json-schema.sh", | ||
"watch": "tsc --build -w", | ||
"test": "nodeunit test/test.*.js", | ||
@@ -17,3 +17,3 @@ "package": "package-js" | ||
"@types/nodeunit": "^0.0.30", | ||
"jsii-build-tools": "^0.8.2", | ||
"jsii-build-tools": "^0.9.0", | ||
"nodeunit": "^0.11.3", | ||
@@ -20,0 +20,0 @@ "typescript": "^3.3.3333", |
@@ -39,3 +39,3 @@ { | ||
"$ref": "#/definitions/Docs", | ||
"description": "Key value pairs of documentation nodes.\nBased on JSDoc." | ||
"description": "Key value pairs of documentation nodes.\nBased on TSDoc." | ||
}, | ||
@@ -51,2 +51,7 @@ "fingerprint": { | ||
}, | ||
"jsiiVersion": { | ||
"description": "The version of the jsii compiler that was used to produce this Assembly.", | ||
"minLength": 1, | ||
"type": "string" | ||
}, | ||
"license": { | ||
@@ -56,2 +61,6 @@ "description": "The SPDX name of the license this assembly is distributed on.", | ||
}, | ||
"locationInRepository": { | ||
"description": "Source directory of the module root, relative to the repository root.\n\nIf undefined or the empty string, no source location information is\navailable. If the module root is equal to the root of the repository,\nthe value is '.'.", | ||
"type": "string" | ||
}, | ||
"name": { | ||
@@ -152,2 +161,3 @@ "description": "The name of the assembly", | ||
"homepage", | ||
"jsiiVersion", | ||
"license", | ||
@@ -188,3 +198,3 @@ "name", | ||
"$ref": "#/definitions/Docs", | ||
"description": "Key value pairs of documentation nodes.\nBased on JSDoc." | ||
"description": "Key value pairs of documentation nodes.\nBased on TSDoc." | ||
}, | ||
@@ -214,2 +224,6 @@ "fqn": { | ||
}, | ||
"locationInModule": { | ||
"$ref": "#/definitions/SourceLocation", | ||
"description": "Where in the module this definition was found\n\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\nfile combining compiled code and its manifest, whereas this is referring\nto the location of the source in the module the assembly was built from." | ||
}, | ||
"methods": { | ||
@@ -331,6 +345,53 @@ "description": "List of methods.", | ||
"Docs": { | ||
"additionalProperties": { | ||
"type": "string" | ||
"description": "Key value pairs of documentation nodes.\nBased on TSDoc.", | ||
"properties": { | ||
"custom": { | ||
"additionalProperties": { | ||
"type": "string" | ||
}, | ||
"description": "Custom tags that are not any of the default ones", | ||
"type": "object" | ||
}, | ||
"default": { | ||
"description": "Description of the default", | ||
"type": "string" | ||
}, | ||
"deprecated": { | ||
"description": "If present, this block indicates that an API item is no longer supported and may be\nremoved in a future release. The `@deprecated` tag must be followed by a sentence\ndescribing the recommended alternative. Deprecation recursively applies to members\nof a container. For example, if a class is deprecated, then so are all of its members.", | ||
"type": "string" | ||
}, | ||
"example": { | ||
"description": "Example showing the usage of this API item\n\nStarts off in running text mode, may switch to code using fenced code\nblocks.", | ||
"type": "string" | ||
}, | ||
"remarks": { | ||
"description": "Detailed information about an API item.\n\nEither the explicitly tagged `@remarks` section, otherwise everything past the\nfirst paragraph if there is no `@remarks` tag.", | ||
"type": "string" | ||
}, | ||
"returns": { | ||
"description": "The `@returns` block for this doc comment, or undefined if there is not one.", | ||
"type": "string" | ||
}, | ||
"see": { | ||
"description": "A `@see` link with more information", | ||
"type": "string" | ||
}, | ||
"stability": { | ||
"description": "Whether the API item is beta/experimental quality", | ||
"enum": [ | ||
"experimental", | ||
"stable" | ||
], | ||
"type": "string" | ||
}, | ||
"subclassable": { | ||
"default": false, | ||
"description": "Whether this class or interface was intended to be subclassed/implemented by library users.\n\nClasses intended for subclassing, and interfaces intended to be implemented\nby consumers, are held to stricter standards of API compatibility.", | ||
"type": "boolean" | ||
}, | ||
"summary": { | ||
"description": "Summary documentation for an API item.\n\nThe first part of the documentation before hitting a `@remarks` tags, or the first\nline of the doc comment block if there is no `@remarks` tag.", | ||
"type": "string" | ||
} | ||
}, | ||
"description": "Key value pairs of documentation nodes.\nBased on JSDoc.", | ||
"type": "object" | ||
@@ -343,3 +404,3 @@ }, | ||
"$ref": "#/definitions/Docs", | ||
"description": "Key value pairs of documentation nodes.\nBased on JSDoc." | ||
"description": "Key value pairs of documentation nodes.\nBased on TSDoc." | ||
}, | ||
@@ -366,3 +427,3 @@ "name": { | ||
"$ref": "#/definitions/Docs", | ||
"description": "Key value pairs of documentation nodes.\nBased on JSDoc." | ||
"description": "Key value pairs of documentation nodes.\nBased on TSDoc." | ||
}, | ||
@@ -381,2 +442,6 @@ "fqn": { | ||
}, | ||
"locationInModule": { | ||
"$ref": "#/definitions/SourceLocation", | ||
"description": "Where in the module this definition was found\n\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\nfile combining compiled code and its manifest, whereas this is referring\nto the location of the source in the module the assembly was built from." | ||
}, | ||
"members": { | ||
@@ -421,3 +486,3 @@ "description": "Members of the enum.", | ||
"$ref": "#/definitions/Docs", | ||
"description": "Key value pairs of documentation nodes.\nBased on JSDoc." | ||
"description": "Key value pairs of documentation nodes.\nBased on TSDoc." | ||
}, | ||
@@ -443,2 +508,6 @@ "fqn": { | ||
}, | ||
"locationInModule": { | ||
"$ref": "#/definitions/SourceLocation", | ||
"description": "Where in the module this definition was found\n\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\nfile combining compiled code and its manifest, whereas this is referring\nto the location of the source in the module the assembly was built from." | ||
}, | ||
"methods": { | ||
@@ -485,3 +554,3 @@ "description": "List of methods.", | ||
"$ref": "#/definitions/Docs", | ||
"description": "Key value pairs of documentation nodes.\nBased on JSDoc." | ||
"description": "Key value pairs of documentation nodes.\nBased on TSDoc." | ||
}, | ||
@@ -492,2 +561,6 @@ "initializer": { | ||
}, | ||
"locationInModule": { | ||
"$ref": "#/definitions/SourceLocation", | ||
"description": "Where in the module this definition was found\n\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\nfile combining compiled code and its manifest, whereas this is referring\nto the location of the source in the module the assembly was built from." | ||
}, | ||
"name": { | ||
@@ -601,3 +674,3 @@ "description": "The name of the method. Undefined if this method is a initializer.", | ||
"peer": { | ||
"description": "Indicates if this dependency is a peer dependency or a normal dependency.\n\nPeer dependencies are expected to be explicitly defined by the user of\nthis library instead of brought in as transitive dependencies.\n\njsii enforces that if this module exports a type from a dependency, this\ndependency must be defined as a peer and not as a normal dependency.\nOtherwise, it would be impossible to safely use two versions of this\ndependency in a closure.", | ||
"description": "Indicates if this dependency is a direct (peer) dependency or a\ntransitive dependency.\n\nPeer dependencies are expected to be explicitly defined by the user of\nthis library instead of brought in as transitive dependencies.\n\njsii enforces that any direct dependency on another jsii module is also\ndefined as a peerDependency. Otherwise, it would be impossible to safely\nuse two versions of this dependency in a closure.", | ||
"type": "boolean" | ||
@@ -625,3 +698,3 @@ }, | ||
"$ref": "#/definitions/Docs", | ||
"description": "Key value pairs of documentation nodes.\nBased on JSDoc." | ||
"description": "Key value pairs of documentation nodes.\nBased on TSDoc." | ||
}, | ||
@@ -768,3 +841,3 @@ "name": { | ||
"$ref": "#/definitions/Docs", | ||
"description": "Key value pairs of documentation nodes.\nBased on JSDoc." | ||
"description": "Key value pairs of documentation nodes.\nBased on TSDoc." | ||
}, | ||
@@ -775,2 +848,6 @@ "immutable": { | ||
}, | ||
"locationInModule": { | ||
"$ref": "#/definitions/SourceLocation", | ||
"description": "Where in the module this definition was found\n\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\nfile combining compiled code and its manifest, whereas this is referring\nto the location of the source in the module the assembly was built from." | ||
}, | ||
"name": { | ||
@@ -846,2 +923,20 @@ "description": "The name of the property.", | ||
}, | ||
"SourceLocation": { | ||
"description": "Where in the module source the definition for this API item was found", | ||
"properties": { | ||
"filename": { | ||
"description": "Relative filename", | ||
"type": "string" | ||
}, | ||
"line": { | ||
"description": "1-based line number in the indicated file", | ||
"type": "number" | ||
} | ||
}, | ||
"required": [ | ||
"filename", | ||
"line" | ||
], | ||
"type": "object" | ||
}, | ||
"TypeBase": { | ||
@@ -857,3 +952,3 @@ "description": "Common attributes of a type definition.", | ||
"$ref": "#/definitions/Docs", | ||
"description": "Key value pairs of documentation nodes.\nBased on JSDoc." | ||
"description": "Key value pairs of documentation nodes.\nBased on TSDoc." | ||
}, | ||
@@ -869,2 +964,6 @@ "fqn": { | ||
}, | ||
"locationInModule": { | ||
"$ref": "#/definitions/SourceLocation", | ||
"description": "Where in the module this definition was found\n\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\nfile combining compiled code and its manifest, whereas this is referring\nto the location of the source in the module the assembly was built from." | ||
}, | ||
"name": { | ||
@@ -871,0 +970,0 @@ "description": "The simple name of the type (MyClass).", |
@@ -25,2 +25,3 @@ "use strict"; | ||
version: '0.0.1', | ||
jsiiVersion: 'TEST', | ||
license: 'NONE', | ||
@@ -27,0 +28,0 @@ fingerprint: '<no-fingerprint>', |
@@ -51,5 +51,6 @@ { | ||
/* Experimental Options */ | ||
"experimentalDecorators": true /* Enables experimental support for ES7 decorators. */ | ||
"experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ | ||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ | ||
"composite": true | ||
} | ||
} |
99565
2072