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

How to use project option? #86

Open
chipbite opened this issue Nov 19, 2021 · 6 comments
Open

How to use project option? #86

chipbite opened this issue Nov 19, 2021 · 6 comments

Comments

@chipbite
Copy link

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

@bafolts
Copy link
Owner

bafolts commented Nov 20, 2021

What was the command you ran when project option failed?

@BillyBobFry
Copy link

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

@bafolts
Copy link
Owner

bafolts commented Feb 22, 2022

@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

@BillyBobFry
Copy link

BillyBobFry commented Feb 25, 2022

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.

@BillyBobFry
Copy link

BillyBobFry commented Feb 25, 2022

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.

@zinefer
Copy link

zinefer commented Oct 31, 2023

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.

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

4 participants