jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.28k stars 507 forks source link

feat/types: add main and types fields #823

Open cncolder opened 4 years ago

cncolder commented 4 years ago
vercel[bot] commented 4 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/formium/tsdx/l67cmftp5
✅ Preview: https://tsdx-git-types.formium.vercel.app

cncolder commented 4 years ago

I copy TsdxOptions into externalTypes.ts. So user cannot explore more types in editor. e.g. Cmd+Click in vscode.

Update comments to JSDoc. So comments will emit into externalTypes.d.ts

I'm not sure if we need exclude another .d.ts files from npm. I wish leave there. It's cool if someone find code suggestions when require('tsdx/dist/createJestConfig')

截屏2020-08-23 17 39 54
cncolder commented 4 years ago

So now. What's your favor @agilgur5 ?

  1. Active "declaration" in tsconfig.json. Then re-export TsdxOptions from types.ts.
  2. Disable "declaration". And add a new file to npm like types/index.d.ts. But we still need main field in package.json