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

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

Open
heath-freenome opened this issue Aug 31, 2022 · 1 comment

Comments

@heath-freenome
Copy link

heath-freenome commented Aug 31, 2022

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
Copy link

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.

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

No branches or pull requests

2 participants