112dev / phunt

Set of tools to organize digital media such as photos and images.
1 stars 0 forks source link

Improve phunt-cli dist bundle #6

Closed jelovac closed 3 days ago

jelovac commented 1 week ago

Description

Currently we use Rollup to build and bundle phunt-cli.

The build produces the following structure in dist directory:

dist
  node_modules/
    better-sqlite3/
  bundle.js

I would like to rename bundle.js to phunt-cli.js to avoid the need for renaming during release packaging in GitHub Actions.

Additionally, I am considering including the better-sqlite3 package in the generated bundle. Currently, it is excluded because Rollup cannot bundle native bindings used by this dependency. The plan is to copy the native bindings to a directory within dist and bundle everything else as usual. I believe that this can be done using the following rollup plugin https://github.com/danielgindi/rollup-plugin-natives or at least give us some pointers from where to start.

TODO