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

[Bug]: Library templates do not follow guide and result in non-working tests #3647

Open
4 tasks done
stefan-schweiger opened this issue Jun 24, 2024 · 1 comment
Open
4 tasks done
Labels
bug Something isn't working docs Improvements or additions to documentation triaged:core
Milestone

Comments

@stefan-schweiger
Copy link

stefan-schweiger commented Jun 24, 2024

Describe the bug

When you initialize a new library as described here and try to run the tests it fails with Error: Cannot find module '~/source/typespec-test/dist/test'. Also overall the code produces by the tsp init --template library-ts command is not very similar to the one described in the documentation. For example there is no vitest installed and no config files for it produced. And even when trying to adapt it to the code described in the docs it still does not work.

I think it's important to have a working base template or example project how to create libraries and it's a pity that trying to extend typespec immediately throws such roadblocks in your way.

Environment:

TypeSpec compiler v0.57.0
macOS 14.5
npm 10.5.2
node 22.3.0

Reproduction

  1. tsp init --template library-ts
  2. npm install
  3. npm run build
  4. npm run test

Checklist

@stefan-schweiger stefan-schweiger added the bug Something isn't working label Jun 24, 2024
@bterlson
Copy link
Member

That is a pity. The templates are a bit stale, will update them!

@bterlson bterlson added the docs Improvements or additions to documentation label Jun 24, 2024
@markcowl markcowl added this to the [2024] July milestone Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docs Improvements or additions to documentation triaged:core
Projects
None yet
Development

No branches or pull requests

3 participants