You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we build our projects, the zapatos/schema.d.ts file isn't being copied over into the "build" folder.
I am referring to the output of a command like: tsc -d --outDir lib/exports --project src/exports/. (lib is our build output folder)
In the repo containing the zapatos generated schema (Say db-schema-repo):
👍 All good. I make the code understand the schema using /// <reference path="./zapatos/schema.d.ts" /> at the top of the main-entrypoint.ts file.
For the repos that use db-schema-repo as a dependency via some npm repository (Say api-layer-repo):
👎 Until zapatos 2.x things were ok, as the outputs were .ts file. Now after 3.x however, because everything except d.ts files get copied over in the lib folder, typescript check fails with error like the following:
Thanks for the helpful and complete report! I just tried renaming all the .d.ts files to .ts files in one of my projects, and nothing seems to break, so I agree this seems like a good candidate for a config option.
jawj
changed the title
d.ts files aren't copied over in build
Add a config option for generate to write .ts instead of d.ts files (so that they're copied during build)
Dec 17, 2020
When we build our projects, the zapatos/schema.d.ts file isn't being copied over into the "build" folder.
I am referring to the output of a command like:
tsc -d --outDir lib/exports --project src/exports/
. (lib
is our build output folder)In the repo containing the zapatos generated schema (Say db-schema-repo):
👍 All good. I make the code understand the schema using
/// <reference path="./zapatos/schema.d.ts" />
at the top of the main-entrypoint.ts file.For the repos that use db-schema-repo as a dependency via some npm repository (Say api-layer-repo):
![Screenshot from 2020-12-04 17-33-11](https://user-images.githubusercontent.com/9037064/101161474-d72bee80-3656-11eb-86c1-19345625d623.png)
👎 Until zapatos 2.x things were ok, as the outputs were .ts file. Now after 3.x however, because everything except d.ts files get copied over in the lib folder, typescript check fails with error like the following:
Refer: https://stackoverflow.com/a/56440335/1233476
My current workaround is to rename the schema.d.ts file to schema.ts manually. (Maybe expose this as a config option in zg.generate() ?)
The text was updated successfully, but these errors were encountered: