Skip to content

feat(package): compress artifact size#160

Merged
hazeone merged 2 commits intomainfrom
feat/compress_artifact_size
Feb 25, 2026
Merged

feat(package): compress artifact size#160
hazeone merged 2 commits intomainfrom
feat/compress_artifact_size

Conversation

@hazeone
Copy link
Copy Markdown
Contributor

@hazeone hazeone commented Feb 25, 2026

Note

Medium Risk
Build/packaging logic now deletes files and prunes platform-specific native binaries, which could accidentally remove a runtime-required asset for a given OS/arch. Changes are isolated to release artifacts but may surface as missing-module failures only after packaging.

Overview
Packaging now prioritizes smaller artifacts. electron-builder.yml switches to compression: maximum and excludes resources/screenshot/** from extraResources.

OpenClaw bundling/packing is tightened to remove non-runtime payload. scripts/bundle-openclaw.mjs skips known dev-only packages/scopes during dependency BFS and adds a size-reduction cleanup pass (removing maps/type defs/tests/docs plus large unused subtrees like pdfjs-dist/legacy and node-llama-cpp/llama). scripts/after-pack.cjs expands cleanup to the entire openclaw/ resource and adds platform/arch-aware pruning of koffi prebuilds and wrong-platform native packages under @napi-rs, @img, and @mariozechner.

Also bumps app version to 0.1.17-beta.0 and reclassifies some packages between dependencies and devDependencies (lockfile updated).

Written by Cursor Bugbot for commit 4c65e5e. This will update automatically on new commits. Configure here.

hazeone and others added 2 commits February 25, 2026 11:23
- Updated compression setting to maximum in electron-builder configuration.
- Excluded screenshot directory from extra resources during packaging.
- Added new dependencies: electron-store, electron-updater, and ws.
- Improved cleanup scripts to remove unnecessary files and directories, optimizing the bundle size.
- Implemented logic to skip dev-only packages during the bundling process.
Co-authored-by: Haze <hazeone@users.noreply.github.com>
@hazeone hazeone merged commit 5d1d704 into main Feb 25, 2026
9 checks passed
@hazeone hazeone deleted the feat/compress_artifact_size branch February 25, 2026 06:07
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on March 19

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

const NM_REMOVE_FILE_NAMES = new Set([
'.DS_Store', 'README.md', 'CHANGELOG.md', 'LICENSE.md', 'CONTRIBUTING.md',
'tsconfig.json', '.npmignore', '.eslintrc', '.prettierrc', '.editorconfig',
]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Identical cleanup constants duplicated within same function

Low Severity

Inside cleanupBundle, NM_REMOVE_DIRS/NM_REMOVE_FILE_EXTS/NM_REMOVE_FILE_NAMES and REMOVE_DIRS/REMOVE_FILE_EXTS/REMOVE_FILE_NAMES are byte-for-byte identical constant definitions declared in two separate blocks of the same function. If one copy is updated (e.g., adding a new directory or extension) without updating the other, the extensions cleanup and node_modules cleanup will silently diverge. These could be defined once at the top of cleanupBundle and shared.

Additional Locations (1)

Fix in Cursor Fix in Web

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.

1 participant