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

feat: Register module-level stability #515

Merged
merged 9 commits into from
Jun 5, 2019
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
4 changes: 3 additions & 1 deletion packages/jsii-calc-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"name": "@scope/jsii-calc-lib",
"version": "0.11.0",
"description": "A simple calcuator library built on JSII.",
"stability": "deprecated",
"deprecated": "Really just deprecated for shows...",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"private": true,
Expand Down Expand Up @@ -51,4 +53,4 @@
"type": "git",
"url": "https://github.com/awslabs/jsii.git"
}
}
}
6 changes: 5 additions & 1 deletion packages/jsii-calc-lib/test/assembly.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@
}
},
"description": "A simple calcuator library built on JSII.",
"docs": {
"deprecated": "Really just deprecated for shows...",
"stability": "deprecated"
},
"homepage": "https://github.com/awslabs/jsii.git",
"jsiiVersion": "0.11.0",
"license": "Apache-2.0",
Expand Down Expand Up @@ -496,5 +500,5 @@
}
},
"version": "0.11.0",
"fingerprint": "EtAUzTnV+hmz9yrXilnsS0MhQuQ/qmpmbwxvdLu561k="
"fingerprint": "x/BbPdAJTYB6QY83ucqo0CNLa2NoLebqPMbMY7BsyR4="
}
1 change: 0 additions & 1 deletion packages/jsii-calc/lib/compliance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1631,7 +1631,6 @@ export interface OptionalStruct {
*
* @see https://aws.amazon.com/
* @customAttribute hasAValue
* @deprecated Use something else please
* @stable
*/
export class ClassWithDocs {
Expand Down
1 change: 1 addition & 0 deletions packages/jsii-calc/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from './calculator';
export * from './compliance';
export * from './documented';
export * from './erasures';
export * from './stability';
104 changes: 104 additions & 0 deletions packages/jsii-calc/lib/stability.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
// The following tests validate emission of stability markers

/** @experimental */
export interface ExperimentalStruct {
/** @experimental */
readonly readonlyProperty: string;
}
/** @experimental */
export interface IExperimentalInterface {
/** @experimental */
mutableProperty?: number;
/** @experimental */
method(): void;
}
/** @experimental */
export class ExperimentalClass {
/** @experimental */
public readonly readonlyProperty: string;
/** @experimental */
public mutableProperty?: number;
/** @experimental */
constructor(readonlyString: string, mutableNumber?: number) {
this.readonlyProperty = readonlyString;
this.mutableProperty = mutableNumber;
}

/** @experimental */
public method(): void { return; }
}
/** @experimental */
export enum ExperimentalEnum {
/** @experimental */
OptionA,
/** @experimental */
OptionB
}

/** @stable */
export interface StableStruct {
/** @stable */
readonly readonlyProperty: string;
}
/** @stable */
export interface IStableInterface {
/** @stable */
mutableProperty?: number;
/** @stable */
method(): void;
}
/** @stable */
export class StableClass {
/** @stable */
public readonly readonlyProperty: string = 'wazoo';
/** @stable */
public mutableProperty?: number;
/** @stable */
constructor(readonlyString: string, mutableNumber?: number) {
this.readonlyProperty = readonlyString;
this.mutableProperty = mutableNumber;
}
/** @stable */
public method(): void { return; }
}
/** @stable */
export enum StableEnum {
/** @stable */
OptionA,
/** @stable */
OptionB
}

/** @deprecated it just wraps a string */
export interface DeprecatedStruct {
/** @deprecated well, yeah */
readonly readonlyProperty: string;
}
/** @deprecated useless interface */
export interface IDeprecatedInterface {
/** @deprecated could be better */
mutableProperty?: number;
/** @deprecated services no purpose */
method(): void;
}
/** @deprecated a pretty boring class */
export class DeprecatedClass {
/** @deprecated this is not always "wazoo", be ready to be disappointed */
public readonly readonlyProperty: string;
/** @deprecated shouldn't have been mutable */
public mutableProperty?: number;
/** @deprecated this constructor is "just" okay */
constructor(readonlyString: string, mutableNumber?: number) {
this.readonlyProperty = readonlyString;
this.mutableProperty = mutableNumber;
}
/** @deprecated it was a bad idea */
public method(): void { return; }
}
/** @deprecated your deprecated selection of bad options */
export enum DeprecatedEnum {
/** @deprecated option A is not great */
OptionA,
/** @deprecated option B is kinda bad, too */
OptionB
}
1 change: 1 addition & 0 deletions packages/jsii-calc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"private": true,
"stability": "experimental",
RomainMuller marked this conversation as resolved.
Show resolved Hide resolved
"jsii": {
"outdir": "dist",
"targets": {
Expand Down
Loading