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

CLI (MariaDB/MySQL>tbls>liam) only generates a schema.json in dist/ #751

Open
2 tasks done
ATroschke opened this issue Feb 18, 2025 · 8 comments · Fixed by #754
Open
2 tasks done

CLI (MariaDB/MySQL>tbls>liam) only generates a schema.json in dist/ #751

ATroschke opened this issue Feb 18, 2025 · 8 comments · Fixed by #754
Assignees
Labels
bug Something isn't working

Comments

@ATroschke
Copy link

Self Checks

Cloud or Self Hosted

Self Hosted

Version (only for Self Hosted)

0.4.1

Steps to reproduce

  1. Have any MariaDB DB
  2. Generate a tbls schema.json
  3. Run npx @liam-hq/cli erd build --format tbls --input docs/schema.json

Expected Behavior

A proper static page in dist/

Actual Behavior

Only a single schema.json in dist/ - without any webpage code to host. I should note both the tbls docs and schema.json are indeed valid.

Additional Context

For the sake of company guidelines, I am unable to share any schema specifics. At most I could reproduce the issue with a quick docker-compose setup, but as this fails after the tbls step (as said the tbls documentation is valid) - this should be easily reproducible.

@ATroschke ATroschke added the bug Something isn't working label Feb 18, 2025
@toddsmith-adsk
Copy link

Same results. The generated schema.json looks correct but no HTML/CSS/Javascript is generated.

npx @liam-hq/cli erd build --format=tbls --input schema.json

ERD has been generated successfully in the `dist/` directory.
Note: You cannot open this file directly using `file://`.
Please serve the `dist/` directory with an HTTP server and access it via `http://`.
Example:
    $ npx http-server dist/
Docs\tbls\dist> ls 


    Directory: C:\Dev\ecs-carbon-tool\Docs\tbls\dist


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----   Tuesday 2 18 2025  10:18          223419 schema.json
                                AM

@hoshinotsuyoshi
Copy link
Member

Thank you for your feedback!

Have you tested this on Windows? @ATroschke @toddsmith-adsk

The reason I ask is that this part of the CLI is still in its initial implementation, and I suspect that some naive assumptions in the code might be affecting the outcome.

@mtsmith
Copy link

mtsmith commented Feb 18, 2025

Yes on windows

@ATroschke
Copy link
Author

Indeed, on Windows. I will be checking this in WSL again tomorrow.

@hoshinotsuyoshi
Copy link
Member

@mtsmith @ATroschke Thank you both for your responses!

The code at

execFile(
'cp',
['-R', `${cliHtmlPath}/.`, outDir],

might not work on Windows. It could behave differently in WSL.

I plan to recheck this by tonight, Tokyo time.

@toddsmith-adsk
Copy link

FYI If I run in a bash terminal it will work on Windows. A WSL, Powershell or Command Prompt terminal will fail.

@hoshinotsuyoshi
Copy link
Member

The issue should be resolved in @liam-hq/[email protected] (release page)

I just verified it using PowerShell on my Windows PC.
Please give it a try! @ATroschke @toddsmith-adsk @mtsmith

@ATroschke
Copy link
Author

It now properly generates the other files as well, thanks for the fix on windows!

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

Successfully merging a pull request may close this issue.

5 participants