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

Support ambient types in dev environment by default #2473

Merged
merged 4 commits into from Oct 21, 2021
Merged

Support ambient types in dev environment by default #2473

merged 4 commits into from Oct 21, 2021

Conversation

FossPrime
Copy link
Member

@FossPrime FossPrime commented Oct 19, 2021

ts-node and by dependency, ts-node-dev, will ignore ambient types without the files flag. Meanwhile tsc, which we use to build... will load ambient types. This is unexpected for most people.

This PR fixes that and has few if any ramifications.

Side effects

  • New projects would use the latest ts-node v10, rather than ts-node v8, which is currently a sub-dependency in ts-node-dev
  • Having ts-node or nodemon in package.json triggers the node template in codesandbox... so feathers projects would load in a Node container, rather than a ReactJS playground.

Notes

  • This does nothing about our lack of Module support... that's being resolved upstream in a matter of weeks TS's new node ESM support TypeStrong/ts-node#1414
  • There are some incompatibilities between 16.10 and previous versions of Node that make the loader approach to supporting Node ESM with typescript difficult. Though something like the following is currently, 2021-10-17 the only option, aside from using the unpublished ts-node@next nodemon -x 'node --loader ts-node/esm' src/index.ts

ts-node and by dependency, ts-node-dev, will ignore ambient types without the files flag. Meanwhile tsc, which we use to build... will load ambient types. This is unexpected for most people.

This PR fixes that and has few if any ramifications.
@daffl
Copy link
Member

daffl commented Oct 21, 2021

This looks nicer anyway. Thanks!

@daffl daffl merged commit 5a57ab4 into feathersjs:hygen-cli Oct 21, 2021
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

2 participants