edgedb-js icon indicating copy to clipboard operation
edgedb-js copied to clipboard

Detection for generation target in monorepos

Open Sikarii opened this issue 2 years ago • 0 comments

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.

Sikarii avatar Jul 01 '23 17:07 Sikarii