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

Make serve.js generate kaitaiFsFiles like serve.py did. #117

Merged
merged 1 commit into from
Jun 27, 2020

Conversation

jchv
Copy link
Contributor

@jchv jchv commented Jun 27, 2020

This fixes an issue caused by #95 where kaitaiFsFiles never gets updated/generated in the root, causing the app to not load in serve mode when it is freshly cloned and no kaitaiFsFiles file exists yet. In the original serve.py implementation, it was generated regardless of whether or not the --compile flag was passed, so I've taken this route as well.

It should be possible to reproduce this issue by simply cloning and running node serve.js --compile.

@jchv jchv requested a review from generalmimon June 27, 2020 21:33
Copy link
Member

@generalmimon generalmimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jchv Thanks for the fix. I actually noticed this change compared to the original script, but then rejected it as a problem, because the build script executes the genKaitaiFsFiles manually.

But I agree that it makes sense to execute it in the development environment along with node serve.js --compile as well, given that the Python script has worked this way.

LGTM, merging in.

@generalmimon generalmimon merged commit 44825a6 into kaitai-io:master Jun 27, 2020
@jchv
Copy link
Contributor Author

jchv commented Jun 27, 2020

@generalmimon It's actually worse: the build script only generates it into the out folder. So afaict, if you clone fresh, you would never get a kaitaiFsFiles.js that would be served by node serve.js, even if you did run build, since serve.js serves from the root. Whether there really needs to be a separate out folder or not is another question. I think I missed this subtlety when I was originally working on this somehow, probably because I was more focused on making sure the out folder was outputting the same thing.

@jchv jchv deleted the fix-gen-kaitai-serve branch June 27, 2020 21:52
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

Successfully merging this pull request may close these issues.

2 participants