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

SQL transform mode including node_modules files #534

Open
oste opened this issue Jul 3, 2023 · 0 comments
Open

SQL transform mode including node_modules files #534

oste opened this issue Jul 3, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@oste
Copy link

oste commented Jul 3, 2023

Describe the bug
I am running pgtyped in SQL mode and noticing extra files unrelated to the include config is being parsed.

Expected behavior
Only files within the srcDir that match the include pattern should be parsed.

Test case

I can't provide a test case but I am using the following config.json

{
  "transforms": [
    {
      "mode": "sql",
      "include": "**/*.sql",
      "emitTemplate": "{{dir}}/{{name}}.queries.ts"
    }
  ],
  "srcDir": "./packages/sql/",
  "failOnError": false,
  "camelCaseColumnNames": false,
  "dbUrl": "postgres://postgres:postgres@localhost/target-db"
}

With the following output npx pgtyped -w -c config.json:

Using a pool of 5 threads.
Processing packages/sql/test.sql
Processing packages/sql/node_modules/.bin/tsc
Processing packages/sql/node_modules/.bin/tsserver

Parsed file:
1 > #!/usr/bin/env node
2 | require('../lib/tsserver.js')
3 |
Errors:
- (1:0) Parse error: mismatched input '#' expecting '/*'

Parsed file:
1 > #!/usr/bin/env node
2 | require('../lib/tsc.js')
3 |
Errors:
- (1:0) Parse error: mismatched input '#' expecting '/*'
- 
Skipped packages/sql/node_modules/.bin/tsserver: no changes or no queries detected
Skipped packages/sql/node_modules/.bin/tsc: no changes or no queries detected
Skipped packages/sql/test.sql: no changes or no queries detected
@oste oste added the bug Something isn't working label Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant