Skip to content

Modernize download and bundle scripts#217

Merged
benoit74 merged 6 commits into
openzim:mainfrom
achou11:ac/modernize-scripts
Jul 24, 2026
Merged

Modernize download and bundle scripts#217
benoit74 merged 6 commits into
openzim:mainfrom
achou11:ac/modernize-scripts

Conversation

@achou11

@achou11 achou11 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Updates the download and bundle scripts to make use of Node built-ins instead of various dependencies. These changes are based on my own experience with modernizing Node code, as well as knowledge obtained through efforts like https://e18e.dev/ (especially https://e18e.dev/docs/replacements/).

Behavior and outputs should generally stay the same. The only notable difference will be slightly more verbose logs due to the usage of absolute paths instead of relative paths. I also made sure to check that the used built-in APIs align with the supported versions stated in the package.json (>=22 <27)

@achou11

achou11 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

There's a follow-up piece to fix up some of the deps declarations (many of them should just be dev deps instead of direct deps), which should significantly help the install footprint of this module :)

@achou11

achou11 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

If it helps, deps graph before and after this PR (when installing as consumer):

@benoit74

Copy link
Copy Markdown
Contributor

There's a follow-up piece to fix up some of the deps declarations (many of them should just be dev deps instead of direct deps), which should significantly help the install footprint of this module :)

Looking at the graph, I can only agree. Especially when you now that typescript is used only as a typechecker, i.e. we do not even use it to compile the final JS file.

Thanks a lot for this first PR already, looking forward for the next one ^^

@benoit74 benoit74 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@achou11

achou11 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Any updates on being able to merge this? I have a branch ready for the follow-up I mentioned but it's stacked on this branch and GitHub doesn't seem to allow stacking PRs coming from a fork 😅 Can do the work to isolate it if preferable.

@benoit74

Copy link
Copy Markdown
Contributor

Thank you for the ping, I was waiting for other reviewers input but looks like it is not coming, so I will merge this to unblock you, and they can always comment in the aftermath.

@benoit74
benoit74 merged commit ab7f31f into openzim:main Jul 24, 2026
28 checks passed
@kelson42

Copy link
Copy Markdown
Contributor

@achou11 Thank you very much for this valuable PR. To me it sounds, this should help to implement #113 ?

@achou11
achou11 deleted the ac/modernize-scripts branch July 24, 2026 13:10
@achou11

achou11 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

@achou11 Thank you very much for this valuable PR. To me it sounds, this should help to implement #113 ?

I don't think this gets things any closer to Windows support. From what I gather, there would need to be a couple of updates to these scripts, mainly:

  • downloading the windows build of libzim
  • updating the direct shell calls to tools to be more portable, whether it's using equivalent cross-platform modules (e.g. tar) or figuring out the relevant platform tools to use.

Can definitely look into getting that working when I find time though! I do have a Windows machine to work with and like the person who created the issue, my main interest in libzim was exploring usage for it in an Electron-based application 😄

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.

3 participants