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

rootDir is expected to contain all source files #80

Closed
caseyWebb opened this issue Sep 25, 2020 · 6 comments · Fixed by #117
Closed

rootDir is expected to contain all source files #80

caseyWebb opened this issue Sep 25, 2020 · 6 comments · Fixed by #117

Comments

@caseyWebb
Copy link

tsd blows up when using compilerOptions.rootDir in tsconfig.json

tsconfig.json

{
  "compilerOptions": {
    "incremental": true,
    "target": "es5",
    "lib": ["es2015", "es2019.array"],
    "declaration": true,
    "sourceMap": true,
    "inlineSources": true,
    "rootDir": "./src",
    "importHelpers": true,
    "strict": true,
    "alwaysStrict": true,
    "moduleResolution": "node",
    "esModuleInterop": true
  },
  "exclude": ["**/dist/**", "**/test/**"]
}
 src/utils.ts:6:7
  ✖  6:7   File /home/casey/code/badbadnotgood/src/validators.ts is not under rootDir tsconfig.json/src. rootDir is expected to contain all source files. 
@caseyWebb caseyWebb changed the title rootDir is expected tot contain all source files rootDir is expected to contain all source files Sep 25, 2020
@BendingBender
Copy link
Collaborator

@caseyWebb @rivy @hoeck I've tried to reproduce this issue with the current version of tsd (0.16.0) without success. Could you please provide additional information? I'd need the tsd config from your package.json. And it would be great if you could try to reproduce the issue with your setup and give feedback this problem still occurs with the current version of tsd?

@hoeck
Copy link

hoeck commented Jun 3, 2021

I've pushed a failing case to https://github.com/hoeck/simple-runtypes/tree/tsd-root-dir-test

It contains the tsd configuration in package.json and is using 0.16. When installing everything (using still yarn1) and then running node_modules/.bin/tsd I get lots of errors such as

  ✖  14:60  File /home/erik/src/simple-runtypes/src/custom.ts is not under rootDir tsconfig.json/src. rootDir is expected to contain all source files.
  The file is in the program because:
    Imported via ./custom from file /home/erik/src/simple-runtypes/src/index.ts
    Imported via ./custom from file /home/erik/src/simple-runtypes/src/json.ts      

I need the rootDir setting so the package is assembled correctly with tsdx.

Please ping me if you need any help.

Thanks for looking into it!

@BendingBender
Copy link
Collaborator

@hoeck Thank you, it was very helpful. Would you mind to test my PR #117 in your project?

@hoeck
Copy link

hoeck commented Jun 3, 2021

Great, of course I'll do that! It might take me until tomorrow to send you any feedback though bc. my schedule is full.

@hoeck
Copy link

hoeck commented Jun 4, 2021

@BendingBender just tried the master branch of tsd, the error is gone, it is working as expected yay 💯 😄. Thanks for fixing this will make my package builds a little bit less complex.

@BendingBender
Copy link
Collaborator

Good to hear that. The patch is now part of the 0.17.0 release, you can simply upgradetsd to get this fix.

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

Successfully merging a pull request may close this issue.

3 participants