-
Notifications
You must be signed in to change notification settings - Fork 203
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
exclude single file from --path ? #987
Comments
Can you use a tsconfig file to load only the files you want? |
Yes, I could have a separate tsconfig for the schema gen. Thanks. |
Didn't quite work, I must be missing something: {
"extends": "./tsconfig.json",
"exclude": ["node_modules", "dist", "src/app.ts"]
} $ npx ts-json-schema-generator --tsconfig tsconfig-genschemata.json --path src/*.ts --no-type-check --out src/schemata.json
Error: Unknown node "(err: NodeJS.ErrnoException) => {" (ts.SyntaxKind = 212) at src/app.ts(99,2)
$ npx ts-json-schema-generator -f tsconfig-genschemata.json --no-type-check --out src/schemata.json
NoRootNamesError: No source files found |
Could be. Can you try the release from #979? |
Oh cool, I didnt realize there was a released canary. You made getting some feedback super easy. The canary works with path but not with the custom tsconfig. $ npx ts-json-schema-generator@v0.96.1--canary.979.fe4869a.0 --tsconfig tsconfig-genschemata.json --no-type-check --out src/schemata.json
Error: Unknown node "() => {" (ts.SyntaxKind = 212) at /home/tom/Documents/affrim-take-home/src/offer.spec.ts(4,29)
$ npx ts-json-schema-generator@v0.96.1--canary.979.fe4869a.0 --path src/*.ts --no-type-check --out src/schemata.json But now the schema looks like this with exported functions, not types: "definitions": {
"NamedParameters<typeof writeAssignments>": {
"additionalProperties": false,
"properties": {
"filePath": {
"type": "string"
}
},
"required": [
"filePath"
],
"type": "object"
} Rather than the actual types such as: "definitions": {
"Rate": {
"description": "Rate 0-1",
"maximum": 1,
"minimum": 0,
"type": "number"
}, |
Thanks for the canaries goes to @hydrosquall for setting it up. If you could debug the issue, that would be great. I won't have the cycles to dig into it unfortunately. |
Hello and thank you!
I'd like to do something along the lines of
--path 'src/!(app)*.ts'
but am not figuring out a negate option.Any options to include
*.ts
but leave outapp.ts
?Its a different issue, but the reason I need to exclude
app.ts
is due to:Error: Unknown node "() => {" (ts.SyntaxKind = 212)
on
err
in (with our without the explicit type):The text was updated successfully, but these errors were encountered: