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

[Feature Request] tsp init shall generate package.json which contains all necessary packages for users #5703

Open
msyyc opened this issue Jan 22, 2025 · 5 comments
Assignees
Labels
needs-area needs-info Mark an issue that needs reply from the author or it will be closed automatically

Comments

@msyyc
Copy link
Contributor

msyyc commented Jan 22, 2025

When I run tsp init tsp init https://aka.ms/typespec/azure-init, then choose (rest-api-spec repo) Azure Resource Manager Service Project min compiler ver: 0.45.2. After files generated, I open main.tsp but find that import error hint from vscode:

Image

I think tsp init shall also generate a pacakge.json which contains all the necessary packages (including @typespec/http / ... so that users could install them more conveniently.

@msyyc msyyc changed the title [bug] tsp init shall install all necessary packages for users [Feature Request] tsp init shall install all necessary packages for users Jan 22, 2025
@msyyc msyyc changed the title [Feature Request] tsp init shall install all necessary packages for users [Feature Request] tsp init shall generate package.json which contains all necessary packages for users Jan 22, 2025
@timotheeguerin
Copy link
Member

tsp init follows what the template said, if you picked this template it explicitly decided to not include the package.json because it is meant to be used in the spec repo.

@timotheeguerin timotheeguerin added the needs-info Mark an issue that needs reply from the author or it will be closed automatically label Jan 22, 2025
@msyyc msyyc removed their assignment Jan 23, 2025
@msyyc
Copy link
Contributor Author

msyyc commented Jan 23, 2025

@microsoft-github-policy-service microsoft-github-policy-service bot removed the needs-info Mark an issue that needs reply from the author or it will be closed automatically label Jan 23, 2025
@timotheeguerin
Copy link
Member

no but the template does by design not do that. You have to pick standalone version to include the package.json

@msyyc
Copy link
Contributor Author

msyyc commented Jan 23, 2025

no but the template does by design not do that. You have to pick standalone version to include the package.json

no but the template does by design not do that.
-> Is there more context abut why it is by design? I think it will be more friendly for users if we could generate a package.json including all necessary dependencies.

@timotheeguerin
Copy link
Member

Then you pick the standalone option. If it were to generate the package.json for that template it would result in people including it in the spec repo

@timotheeguerin timotheeguerin added the needs-info Mark an issue that needs reply from the author or it will be closed automatically label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-area needs-info Mark an issue that needs reply from the author or it will be closed automatically
Projects
None yet
Development

No branches or pull requests

2 participants