weiran-zsd / dts-cli

Zero-config CLI for TypeScript package development
MIT License
442 stars 23 forks source link

tsdx would generate cjs and types in source hierarchy, dts only does types #172

Open heath-freenome opened 2 years ago

heath-freenome commented 2 years ago

Current Behavior

Before I converted to using dts-cls, I was using tsdx. When I ran the build command it transpiled all of the CJS into the same directory structure as the source, along side the types.

Now with the dts-cli, the transpiled CJS is only ever rolled up and not output to the same directory structure where as the types are still being done in the hierarchy.

Our library has users that want to access elements of the library directly, including elements that aren't published directly to the main index.js file. So now they cannot access those elements

Expected behavior

dts-cli generates the same directory structure as tsdx did

Suggested solution(s)

I tried the --entries src/**/*.ts hoping that it would do the transpiling to each file but that did not work

Additional context

Your environment


  System:
    OS: macOS 12.5.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 50.27 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm
  Browsers:
    Firefox: 103.0.2
    Safari: 15.6.1
  npmPackages:
    dts-cli: ^1.6.0 => 1.6.0 
aladdin-add commented 2 years ago

if don't want to bundle, so why not using tsc directly?

also, IMHO, it's not a good practice to import something like my-awesome-lib/dist/foo.js - it's not a public api, and be likely to be changed in any releases (even in patch). I'd suggest put all the exported things in a index.js.