E529 Support ambient types in dev environment by default by FossPrime · Pull Request #2473 · feathersjs/feathers · GitHub
[go: up one dir, main page]

Skip to content

Support ambient types in dev environment by default#2473

Merged
daffl merged 4 commits intofeathersjs:hygen-clifrom
FossPrime:patch-11
Oct 21, 2021
Merged

Support ambient types in dev environment by default#2473
daffl merged 4 commits intofeathersjs:hygen-clifrom
FossPrime:patch-11

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.

2 participants

0