isaacs / tshy

Other
894 stars 18 forks source link

Fix tshy.project being a package #95

Closed SBoudrias closed 1 month ago

SBoudrias commented 2 months ago

In a monorepo, I think it is fairly common for the base tsconfig.json file to be contained within an internal package.

It is for example how turborepo recommend creating TS monorepos.

import.meta.resolve is a Release candidate. Let me know if you'd prefer like:

const require = createRequire(import.meta.url);
const pathName = require.resolve(p);
isaacs commented 1 month ago

This won't work if you do "tshy": { "project": "blah.tsconfig.json" } in your package.json file, which is the intent, because you can't import.meta.resolve() a JSON file.

SBoudrias commented 1 month ago

Ah, too bad. Reflecting on this, I don't think it's a necessary feature anyway. The ts-server doesn't work well without tsconfig.json files at the root, so I ended up keeping the boilerplate I was hoping to remove 😅 (it was tsconfig.json boilerplate vs extra configs elsewhere)

Thanks for the answer, I'll close.