-
Notifications
You must be signed in to change notification settings - Fork 18
Typescript deprecated jsdoc #149
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
Merged
bulldozer-bot
merged 5 commits into
palantir:develop
from
rhysbrettbowen:typescript-deprecated-jsdoc
Oct 14, 2020
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| type: improvement | ||
| improvement: | ||
| description: jsdoc has @deprecated added reason provided in definition | ||
| links: | ||
| - https://github.com/palantir/conjure-typescript/pull/149 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
20 changes: 20 additions & 0 deletions
20
...ds/generate/__tests__/resources/test-cases/example-types/product/deprecatedEnumExample.ts
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| export enum DeprecatedEnumExample { | ||
| ONE = "ONE", | ||
| /** | ||
| * @deprecated use ONE | ||
| */ | ||
| OLD_ONE = "OLD_ONE", | ||
| /** | ||
| * You should no longer use this | ||
| * | ||
| * @deprecated use ONE | ||
| */ | ||
| OLD_DEPRECATED_ONE = "OLD_DEPRECATED_ONE", | ||
| /** | ||
| * You should no longer use this | ||
| * | ||
| * @deprecated should use ONE | ||
| * | ||
| */ | ||
| OLD_DOCUMENTED_ONE = "OLD_DOCUMENTED_ONE" | ||
| } |
20 changes: 20 additions & 0 deletions
20
...s/generate/__tests__/resources/test-cases/example-types/product/deprecatedFieldExample.ts
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| export interface IDeprecatedFieldExample { | ||
| 'one': string; | ||
| /** | ||
| * @deprecated use ONE | ||
| */ | ||
| 'deprecatedOne': string; | ||
| /** | ||
| * You should no longer use this | ||
| * | ||
| * @deprecated use ONE | ||
| */ | ||
| 'documentedDeprecatedOne': string; | ||
| /** | ||
| * You should no longer use this | ||
| * | ||
| * @deprecated should use ONE | ||
| * | ||
| */ | ||
| 'deprecatedWithinDocumentOne': string; | ||
| } |
92 changes: 92 additions & 0 deletions
92
...commands/generate/__tests__/resources/test-cases/example-types/product/deprecatedUnion.ts
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| export interface IDeprecatedUnion_Good { | ||
| 'good': string; | ||
| 'type': "good"; | ||
| } | ||
|
|
||
| /** | ||
| * @deprecated use good | ||
| */ | ||
| export interface IDeprecatedUnion_NoGood { | ||
| 'noGood': string; | ||
| 'type': "noGood"; | ||
| } | ||
|
|
||
| /** | ||
| * this is no good | ||
| * @deprecated use good | ||
| */ | ||
| export interface IDeprecatedUnion_NoGoodDoc { | ||
| 'noGoodDoc': string; | ||
| 'type': "noGoodDoc"; | ||
| } | ||
|
|
||
| function isGood(obj: IDeprecatedUnion): obj is IDeprecatedUnion_Good { | ||
| return (obj.type === "good"); | ||
| } | ||
|
|
||
| function good(obj: string): IDeprecatedUnion_Good { | ||
| return { | ||
| good: obj, | ||
| type: "good", | ||
| }; | ||
| } | ||
|
|
||
| function isNoGood(obj: IDeprecatedUnion): obj is IDeprecatedUnion_NoGood { | ||
| return (obj.type === "noGood"); | ||
| } | ||
|
|
||
| /** | ||
| * @deprecated use good | ||
| */ | ||
| function noGood(obj: string): IDeprecatedUnion_NoGood { | ||
| return { | ||
| noGood: obj, | ||
| type: "noGood", | ||
| }; | ||
| } | ||
|
|
||
| function isNoGoodDoc(obj: IDeprecatedUnion): obj is IDeprecatedUnion_NoGoodDoc { | ||
| return (obj.type === "noGoodDoc"); | ||
| } | ||
|
|
||
| /** | ||
| * @deprecated use good | ||
| */ | ||
| function noGoodDoc(obj: string): IDeprecatedUnion_NoGoodDoc { | ||
| return { | ||
| noGoodDoc: obj, | ||
| type: "noGoodDoc", | ||
| }; | ||
| } | ||
|
|
||
| export type IDeprecatedUnion = IDeprecatedUnion_Good | IDeprecatedUnion_NoGood | IDeprecatedUnion_NoGoodDoc; | ||
|
|
||
| export interface IDeprecatedUnionVisitor<T> { | ||
| 'good': (obj: string) => T; | ||
| 'noGood': (obj: string) => T; | ||
| 'noGoodDoc': (obj: string) => T; | ||
| 'unknown': (obj: IDeprecatedUnion) => T; | ||
| } | ||
|
|
||
| function visit<T>(obj: IDeprecatedUnion, visitor: IDeprecatedUnionVisitor<T>): T { | ||
| if (isGood(obj)) { | ||
| return visitor.good(obj.good); | ||
| } | ||
| if (isNoGood(obj)) { | ||
| return visitor.noGood(obj.noGood); | ||
| } | ||
| if (isNoGoodDoc(obj)) { | ||
| return visitor.noGoodDoc(obj.noGoodDoc); | ||
| } | ||
| return visitor.unknown(obj); | ||
| } | ||
|
|
||
| export const IDeprecatedUnion = { | ||
| isGood: isGood, | ||
| good: good, | ||
| isNoGood: isNoGood, | ||
| noGood: noGood, | ||
| isNoGoodDoc: isNoGoodDoc, | ||
| noGoodDoc: noGoodDoc, | ||
| visit: visit | ||
| }; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| # User versions.props so that excavator can automatically keep our version up to date | ||
| com.palantir.conjure.verification:* = 0.18.5 | ||
| com.palantir.conjure:conjure = 4.6.1 | ||
| com.palantir.conjure:conjure = 4.13.0 |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did we need to bump the conjure API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old one did not contain the "deprecated" key