Closed tw4l closed 3 months ago
Hi @tw4l -- thanks for the PR!
I'm on board with the idea 🏄
Here are two things I would suggest:
--pages-dir
should be a replacement of --pages
, so we don't have two features behaving in almost identical ways. I'd suggest replacing the current --pages
option with your feature.copyPagesFilesToZip()
so we don't accidentally copy over an invalid pages.jsonl
/ extraPages.jsonl
file. For example, I'd want to be "sure" it's a series of JSON objects, and that they match the spec. What do you think?
Hi @tw4l -- thanks for the PR!
I'm on board with the idea 🏄
Here are two things I would suggest:
* `--pages-dir` should be a replacement of `--pages`, so we don't have two features behaving in almost identical ways. I'd suggest replacing the current `--pages` option with your feature. * I would add some data validation in `copyPagesFilesToZip()` so we don't accidentally copy over an invalid `pages.jsonl` / `extraPages.jsonl` file. For example, I'd want to be "sure" it's a series of JSON objects, and that they match the spec.
What do you think?
Those both make sense to me! Happy to push these changes tomorrow morning :)
Good morning @matteocargnelutti !
I've gone ahead and made the changes, as well as checking for a .jsonl
extension (case-insensitive) rather than checking for pages.jsonl
and extraPages.jsonl
specifically, to allow for future flexibility with pages filenames.
Let me know if anything!
Thanks again for a great PR, @tw4l
Fixes #91
Adds tests as well. Happy to make any changes you see fit. Thanks for the review!