jaredpalmer / tsdx

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

Refactor/Improve some typings #909

Open agilgur5 opened 3 years ago

agilgur5 commented 3 years ago

Description

Commits

types: add remaining external typings

refactor/fix: consistently use capital TSDX everywhere

refactor/types: explicitly name "at least one" types

refactor/types: add a type for RollupOptionsWithOutput

refactor/types: add a TSDXConfig type

Tags

Review Notes

The passPerPreset augmentation for @rollup/plugin-babel / @types/babel__core that is mentioned above is pretty confusing. I decided to leave it as is for now so as to potentially change anything, but my logs seem to show it isn't used 😕 🤔 :

Babel log output: ```ts PartialConfig { options: { sourceMaps: true, caller: { name: '@rollup/plugin-babel', supportsStaticESM: true, supportsDynamicImport: true, supportsTopLevelAwait: true }, filename: '[redacted]/tsdx/stage-build-default/src/syntax/jsx-import/JSX-B.jsx', babelrc: false, configFile: false, passPerPreset: false, envName: 'test', cwd: '[redacted]/tsdx/stage-build-default', root: '[redacted]/tsdx/stage-build-default', plugins: [], presets: [] }, babelignore: undefined, babelrc: undefined, config: undefined } { sourceMaps: true, caller: { name: '@rollup/plugin-babel', supportsStaticESM: true, supportsDynamicImport: true, supportsTopLevelAwait: true }, filename: '[redacted]/tsdx/stage-build-default/src/syntax/jsx-import/JSX-B.jsx', babelrc: false, configFile: false, passPerPreset: false, envName: 'test', cwd: '[redacted]/tsdx/stage-build-default', root: '[redacted]/tsdx/stage-build-default', plugins: [ ConfigItem { value: [Function], options: {}, dirname: '[redacted]/tsdx/stage-build-default', name: undefined, file: [Object] }, ConfigItem { value: [Function: _default], options: {}, dirname: '[redacted]/tsdx/stage-build-default', name: undefined, file: [Object] }, ConfigItem { value: [Function], options: {}, dirname: '[redacted]/tsdx/stage-build-default', name: undefined, file: [Object] }, ConfigItem { value: [Function], options: [Object], dirname: '[redacted]/tsdx/stage-build-default', name: undefined, file: [Object] }, ConfigItem { value: [Function], options: [Object], dirname: '[redacted]/tsdx/stage-build-default', name: undefined, file: [Object] } ], presets: [ ConfigItem { value: [Function], options: [Object], dirname: '[redacted]/tsdx/stage-build-default', name: undefined, file: [Object] } ] } PartialConfig { options: { sourceMaps: true, caller: { name: '@rollup/plugin-babel', supportsStaticESM: true, supportsDynamicImport: true, supportsTopLevelAwait: true }, filename: '[redacted]/tsdx/stage-build-default/src/syntax/jsx-import/JSX-B.jsx', babelrc: false, configFile: false, passPerPreset: false, envName: 'test', cwd: '[redacted]/tsdx/stage-build-default', root: '[redacted]/tsdx/stage-build-default', plugins: [], presets: [] }, babelignore: undefined, babelrc: undefined, config: undefined } ```

Misc

This will be rebased in as each commit is independent and some have some lengthy messages.

vercel[bot] commented 3 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/nrywlnc8b
✅ Preview: https://tsdx-git-typings-refactor.formium.vercel.app