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

Add support for named exports #4606

Merged
merged 27 commits into from
Oct 4, 2024

Conversation

timotheeguerin
Copy link
Member

fix #4562

@azure-sdk
Copy link
Collaborator

azure-sdk commented Oct 4, 2024

All changed packages have been documented.

  • @typespec/compiler
  • @typespec/playground
Show changes

@typespec/compiler - feature ✏️

Add support for node exports field. Specific typespec exports can be provided with the typespec field,> ,> json,> "exports": {,> ".": {,> "typespec": "./lib/main.tsp",,> },,> "./named": {,> "typespec": "./lib/named.tsp",,> },> },>

@typespec/playground - fix ✏️

Do not treat path as relative internally

@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs

@timotheeguerin timotheeguerin added this pull request to the merge queue Oct 4, 2024
Merged via the queue into microsoft:main with commit 77edf34 Oct 4, 2024
22 checks passed
@timotheeguerin timotheeguerin deleted the resolve-module-exports branch October 4, 2024 23:26
if (pkg.name === name) {
return loadPackage(dir, pkg);
} else {
return undefined;
Copy link
Member

@MaryGao MaryGao Oct 11, 2024

Choose a reason for hiding this comment

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

here is a bug which caused not found module issue. it should continue foreach not return directly.

https://dev.azure.com/azure-sdk/public/_build/results?buildId=4218379&view=logs&j=aa4563e2-7f5a-5a88-019c-341451fd8a67&t=3351c2db-8046-5507-7e56-867b3895d138&l=38

error import-not-found: Couldn't resolve import "@azure-tools/typespec-ts"

@timotheeguerin could you help review this fix #4689?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the way it is done now is the correct way according the the node resolution spec, you only lookup to the first parent package.json for resolving self. What is the use case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:core Issues for @typespec/compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow Import of Specific Files from a TypeSpec Library, Not Only main.tsp
5 participants