edgedb-js
edgedb-js copied to clipboard
Detection for generation target in monorepos
Currently, within monorepos the detection of the generation target can be highly inaccurate if edgedb.toml does not reside with package.json and/or tsconfig.json. This becomes problematic because the monorepo's package.json is not taken into consideration as the generator considers the directory where edgedb.toml as root and looks up package.json and tsconfig.json from there.
Take the following as an example:
my-monorepo/
├── package.json # Includes "type": "module"
├── tsconfig.json
└── app/
├── src
└── edgedb.toml # This is considered "project root" by the generator
Using the generator from app will incorrectly generate CommonJS when ESM is actually the desired target here.