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

Typescript support for foundry init #126

Open
oglu opened this issue Oct 13, 2020 · 2 comments
Open

Typescript support for foundry init #126

oglu opened this issue Oct 13, 2020 · 2 comments

Comments

@oglu
Copy link

oglu commented Oct 13, 2020

Suggested feature

I used init to create a project, where I selected typescript as the language of choice. In the same time, I selected browser and node as execution environments.

When I tried to execute yarn lint, first I got an error about typescript missing and after I fixed that I got the error that tsconfig is not present.

From a short discussion with @felixjung, I got that this is not a bug, but it nevertheless breaks expectations. When I used yarn init the expectations were that foundry would set up everything.

Alternatives

Type the commands by hand.

Potential downsides

No

@felixjung
Copy link
Collaborator

Thanks for opening the issue. I share the sentiment that this breaks expectations. In certain contexts I would expect Foundry to set up TypeScript to some degree (i.e., a Node.js service). I'm not sure we want to bundle TypeScript with foundry like we do with other tooling dependencies. If we do so, then this also means we need to run tsc through Foundry.

I see several options of dealing with this. From just putting out helpful messages in the logs to installing and running everything through Foundry and taking care of potential conflicts with Next.js etc.. Will need a bit of time to put together a proposal.

@connor-baer, thoughts?

@connor-baer
Copy link
Member

connor-baer commented Oct 15, 2020

Foundry currently doesn’t handle build configs (such as tsconfig.json webpack.config.js, .babelrc) because these are usually provided by the framework (e.g. Next.js, Create React App) and tend to be quite specific to a project.

@felixjung makes a good point that "vanilla" projects could benefit from a default/base TypeScript config. We could make use of TypeScript's extends config option.

Installing TypeScript (or webpack, babel) is something I don't believe Foundry should do because it ties you to the preinstalled version. Next.js takes a similar approach in that it requires users to install TypeScript themselves.

My main takeaway from this issue is that as a first step we need to manage expectations through better documentation and logs. Thank you for the feedback! 🙌

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

No branches or pull requests

3 participants