Skip to content

Conversation

@rhysbrettbowen
Copy link
Contributor

@rhysbrettbowen rhysbrettbowen commented Oct 14, 2020

fixes #120

Before this PR

deprecated keyword is not added to typescript in any way

After this PR

==COMMIT_MSG==
deprecated message is added with a @deprecated jsdoc to the comments
==COMMIT_MSG==

Possible downsides?

  • if you already added deprecated to jsdocs we will favour that over the new one.
  • Will add extra docs in js code
  • updates conjur, so need to update that as well

@changelog-app
Copy link

changelog-app bot commented Oct 14, 2020

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

deprecated message is added with a @deprecated` jsdoc to the comments

Check the box to generate changelog(s)

  • Generate changelog entry

@policy-bot policy-bot bot requested a review from dansanduleac October 14, 2020 20:33
@rhysbrettbowen
Copy link
Contributor Author

@ferozco

version "4.3.0"
resolved "https://registry.yarnpkg.com/conjure-api/-/conjure-api-4.3.0.tgz#c778736f369e7c749a86118e14dab83deb698ace"
integrity sha512-AnZe6qkiCRSsfuQMgA556dFs+/DbXpCK2uuhq9bHn36dSbKi+6HUDntpc9jkVPzWOecLXGqy+JAD6IKV8c9Sqw==
conjure-api@^4.13.0:
Copy link
Contributor

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?

Copy link
Contributor Author

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

]);

type DeprecatableDefinitions = IFieldDefinition | IEnumValueDefinition | IEndpointDefinition;
export function addDeprecatedToDocs<T extends DeprecatableDefinitions>(typeDefintion: T): T {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we avoid mutating objects and instead construct a better doc string when creating the object?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed so it doesn't mutate. It is a little weird how before though the docs were being put on as a JSDocStructure when a string will do. I also saw it took an array so tried to pass it in with 2 strings, but the second would not be picked up. I'm guessing it's just old code so just changed to pass back a string[] or undefined.

Copy link
Contributor

@ferozco ferozco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ferozco
Copy link
Contributor

ferozco commented Oct 14, 2020

Looks good, you'll need to manually add a changelog since the automation doesn't work across forks

@rhysbrettbowen
Copy link
Contributor Author

changelog added

@bulldozer-bot bulldozer-bot bot merged commit 9c0ba8e into palantir:develop Oct 14, 2020
@svc-autorelease
Copy link
Collaborator

Released 4.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generated typescript has no reference to deprecated service messages

3 participants