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

Generate TypeScript decorator signatures from extern dec #2122

Merged
merged 60 commits into from
Mar 19, 2024

Conversation

timotheeguerin
Copy link
Member

@timotheeguerin timotheeguerin commented Jun 27, 2023

Note this is added to tspd which is not published yet so this can be iterated over without any issues.

Adds a decorator signature generator. Generates 2 files:

  • <namespace>.ts : Contains the decorator signatures that can be imported and when declaring the decorators functions
  • <namespace>.ts-test.ts: Contains some test using typescript type system to make sure the package does reexport the right $<name> for each decorator

@github-actions
Copy link
Contributor

Changes in this PR will be published to the following url to try(check status of TypeSpec Pull Request Try It pipeline for publish status):
Playground: https://cadlplayground.z22.web.core.windows.net/prs/2122/

Website: https://cadlwebsite.z1.web.core.windows.net/prs/2122/

@timotheeguerin timotheeguerin changed the title [POC] Generate TypeScript decorator signatures from extern dec Generate TypeScript decorator signatures from extern dec Jun 28, 2023
@azure-sdk
Copy link
Collaborator

azure-sdk commented Mar 7, 2024

All changed packages have been documented.

@azure-sdk
Copy link
Collaborator

You can try these changes at https://cadlplayground.z22.web.core.windows.net/prs/2122/

Check the website changes at https://tspwebsitepr.z22.web.core.windows.net/prs/2122/

Copy link
Member

@bterlson bterlson left a comment

Choose a reason for hiding this comment

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

I did not examine the changes to the decorators in detail, as we discussed these changes offline and I am assuming that all of the changes to types (to bring the typescript-side types inline with the declared signature) are all generally widenings.

CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
packages/compiler/generated-defs/TypeSpec.ts Show resolved Hide resolved
timotheeguerin and others added 2 commits March 19, 2024 15:50
Co-authored-by: Brian Terlson <brian.terlson@microsoft.com>
Co-authored-by: Brian Terlson <brian.terlson@microsoft.com>
@timotheeguerin timotheeguerin enabled auto-merge (squash) March 19, 2024 22:50
@timotheeguerin timotheeguerin merged commit 077db13 into microsoft:main Mar 19, 2024
14 checks passed
@timotheeguerin timotheeguerin deleted the feature/dec-ts-sig branch March 19, 2024 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants