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

Should @pgtyped/query depend on Typescript? #87

Closed
silasdavis opened this issue May 28, 2020 · 2 comments
Closed

Should @pgtyped/query depend on Typescript? #87

silasdavis opened this issue May 28, 2020 · 2 comments

Comments

@silasdavis
Copy link
Contributor

silasdavis commented May 28, 2020

I was producing a production build with yarn install --production and noticed @pgtyped/query pulls in Typescript https://github.com/adelsz/pgtyped/blob/master/packages/query/src/index.ts#L13.

This seems odd given query is the runtime dependency. If it really is needed then it should be added to the dependencies of @pgtyped/query currently it's only available because it's in devDependencies of the root project.

It looks like the generator is the only thing that uses parseTypescriptFile abd parseSQLFile. Perhaps they should be refactored out of query?

@adelsz
Copy link
Owner

adelsz commented May 28, 2020

Good point, query is currently both a runtime and a compile-time dependency for PgTyped.

query/loader parsing routines are used both in the query package (in the preprocessor) and in the cli package (in generators). That is why I initially had to move loaders and parsers to query.

I have added TS as a peer dep for @pgtyped/query here #88, but we should definitely plan to split the runtime and compile-time components of it at some point.

@adelsz
Copy link
Owner

adelsz commented May 30, 2020

Closing, planned refactoring in #91

@adelsz adelsz closed this as completed May 30, 2020
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

No branches or pull requests

2 participants