Add pkg configuration for building standalone executable#151
Add pkg configuration for building standalone executable#151vxpyy9 wants to merge 1 commit intoRationAI:release/v3from
Conversation
Summary of ChangesHello @vxpyy9, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces the necessary configuration to enable the creation of a standalone executable for the xopat project. It involves updating the project's primary entry points and explicitly listing all required assets for packaging, ensuring that the application can be bundled and distributed as a single executable. The changes also include routine updates to the dependency lockfile. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces configuration for pkg to enable building a standalone executable version of the application. The changes to package.json correctly update the main entry point to index.js and add the necessary bin and pkg fields. My review focuses on refining the pkg asset configuration to prevent bloating the executable with unnecessary files, such as workspace node_modules, and to optimize the build by excluding source maps in production.
| "plugins/**/*", | ||
| "modules/**/*", |
There was a problem hiding this comment.
The glob patterns plugins/**/* and modules/**/* are too broad. Since this project uses workspaces for plugins and modules, these patterns will include their node_modules directories in the packaged executable. This will significantly increase the executable's size and bundle many unnecessary files.
Consider using more specific glob patterns to include only the necessary assets. For example, if you only need to bundle specific file types, you could do something like this:
"plugins/**/*.{html,css,svg,json}",
"modules/**/*.{html,css,svg,json}"Please adjust the patterns to match the actual asset files required by your application.
There was a problem hiding this comment.
I would say that modules and plugins contain explicitly only things we want, except when plugin/module specifies otherwise (like copying assets manually from the root node_modules folder). For now I am afraid we have no stable way of telling which files to include and which not.
| "src/**/*", | ||
| "ui/**/*", | ||
| "openseadragon.js", | ||
| "openseadragon.js.map", |
There was a problem hiding this comment.
Including the source map file openseadragon.js.map in the assets is not recommended for production builds. It increases the size of the final executable and exposes information about the source code structure.
If this configuration is for creating production executables, it's best to remove this line. If source maps are needed for debugging purposes, you might consider creating a separate build configuration or script for development builds.
There was a problem hiding this comment.
Moreover, OpenSeadragon should not in my opinion be included at all - OSD was at least originally dynamically added by users. However I agree that providing a default might be desirable.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I added the OSD deps to the release/v3, you can pull the changes |
No description provided.