tplant
tplant copied to clipboard
How to use project option?
Hi! I have tried using project option, but cannot get it to work.
I always get "Missing input file"
Any clues? I have tested with a simplified tsconfig (just files, one path). No joy.
BR! /marcus
What was the command you ran when project option failed?
Not the OP, but I got the same error with:
tplant --project ./common/tsconfig.json --output ./testStore.svg
Also failed with
tplant --input common/**.*.ts --project common/tsconfig.json --output ./testStore.svg
@BillyBobFry what error did you get with:
tplant --input common/**.*.ts --project common/tsconfig.json --output ./testStore.svg
Since the input
option was provided I wouldn't expect to see Missing input file
.
https://github.com/bafolts/tplant/blob/master/src/index.ts#L34
I can't see how the project
option is used. There is definitely some bug here. This is where we look for the tsconfig.json
Ah sorry, I was perhaps a bit unclear. The first command gives me the error Missing input file
.
I wasn't sure if I also needed an input glob with the --project
option, so I tried the second command to see if I could get it working with a tsconfig AND an input glob. In that case there was no error message, but it only generated UML from the first file that matched the glob.
I've found a solution to my problem (if not to the issue of --project
not working).
If I wrap my input glob in single quotes then the resulting output file contains models from all matching file paths - for some reason without the quotes it only processes the first match. Something to do with my shell perhaps? I'm using zsh.
tplant --input 'common/**/*.ts' --output ./testStore.svg
^^^ This does what I need.
I was using tplant -i src/index.js
because the glob was only grabbing the first file but this produced a diagram with a syntax error. After passing in the glob in a string like above it began to work.