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

Support auto-inferred index files #79

Open
Juice10 opened this issue Apr 13, 2024 · 2 comments
Open

Support auto-inferred index files #79

Juice10 opened this issue Apr 13, 2024 · 2 comments

Comments

@Juice10
Copy link

Juice10 commented Apr 13, 2024

In rrweb we are using directories with an index.ts file inside them and importing them in the following manner:

import { replay } from './replay';

In typescript this autocompletes to ./replay/index.*.

Unfortunately dts-buddy gives the following error whenever an import like this gets encountered:

yarn dts-buddy dist/index.d.ts -m rrweb:dist/rrweb.js -m rrweb-replay:dist/rrweb-replay.js
yarn run v1.23.0-20220130.1630
$ /Users/justin/repos/rrweb-monorepo/node_modules/.bin/dts-buddy dist/index.d.ts -m rrweb:dist/rrweb.js -m rrweb-replay:dist/rrweb-replay.js
node:internal/fs/sync:25
  return binding.readFileUtf8(path, stringToFlags(flag));
                 ^

Error: ENOENT: no such file or directory, open '/Users/justin/repos/rrweb-monorepo/packages/rrweb/dist/replay.d.ts'
    at Object.readFileUtf8 (node:internal/fs/sync:25:18)
    at Object.readFileSync (node:fs:441:19)
    at get_dts (file:///Users/justin/repos/rrweb-monorepo/node_modules/dts-buddy/src/utils.js:184:34)
    at create_module_declaration (file:///Users/justin/repos/rrweb-monorepo/node_modules/dts-buddy/src/create-module-declaration.js:59:19)
    at createBundle (file:///Users/justin/repos/rrweb-monorepo/node_modules/dts-buddy/src/index.js:228:43)
    at file:///Users/justin/repos/rrweb-monorepo/node_modules/dts-buddy/src/cli.js:75:9
    at o.parse (/Users/justin/repos/rrweb-monorepo/node_modules/dts-buddy/node_modules/sade/lib/index.js:1:3402)
    at file:///Users/justin/repos/rrweb-monorepo/node_modules/dts-buddy/src/cli.js:86:9
    at ModuleJob.run (node:internal/modules/esm/module_job:217:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/justin/repos/rrweb-monorepo/packages/rrweb/dist/replay.d.ts'
}
@mstade
Copy link

mstade commented Oct 11, 2024

Hi @Juice10! I'm running into this when setting "strict": true in my jsconfig.json, but not when it's set to false. Where you ever able to resolve this?

@Juice10
Copy link
Author

Juice10 commented Oct 11, 2024

@mstade unfortunately not I ended up switching out dts-buddy for another project

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