Skip to content

build: add bytecode compilation and minification to package generation#63

Merged
amondnet merged 2 commits into
mainfrom
feat/bytecode-minification-build-optimization
Dec 23, 2025
Merged

build: add bytecode compilation and minification to package generation#63
amondnet merged 2 commits into
mainfrom
feat/bytecode-minification-build-optimization

Conversation

@amondnet

Copy link
Copy Markdown
Contributor

Summary

Improves the build output and performance of the generated @pleaseai/code CLI packages:

  • Bytecode compilation enabled for 2x faster CLI startup time
  • Minification enabled for smaller binary distribution size
  • Enhanced output formatting with progress indicators and visual feedback
  • Performance timing measurement for build duration tracking
  • Updated documentation to reference @pleaseai/code package correctly
  • Simplified CLI output with checkmark indicators and build summary

Changes

  • Enable bytecode: true in Bun.build() for compiled binaries
  • Enable minify: true in Bun.build() for package generation
  • Add sourcemap: 'none' for production build
  • Improve console output with formatted headers and progress indicators
  • Add performance timing measurement using performance.now()
  • Update package name references from dora to @pleaseai/code
  • Enhance error/success messages with visual indicators (✓ ✗)
  • Include build feature summary in initialization output

Test plan

  • Verify build script runs without errors: bun scripts/generate-packages.ts
  • Confirm compiled binaries are generated in npm/ directory
  • Check that output includes formatted headers and timing information
  • Verify lint/format hooks pass
  • Confirm generated packages are smaller (minification working)
  • Test startup performance improvement with bytecode compilation

- Enable bytecode compilation for 2x faster CLI startup
- Add minification for smaller binary size
- Improve build output formatting with progress indicators
- Add performance timing measurement
- Update documentation to reflect @pleaseai/code package
- Include build feature summary in output
- Simplify launcher publication command

This improves the generated npm packages performance and distribution
size for the @pleaseai/code CLI tool.
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @amondnet, 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 significantly upgrades the build process for the @pleaseai/code CLI packages. The primary goal is to enhance both the performance and efficiency of the generated binaries by introducing bytecode compilation for faster startup and minification for reduced size. Concurrently, the changes improve the developer experience by providing clearer, more informative console output during the build, including progress indicators and build timing. The update also ensures consistency by aligning package naming conventions.

Highlights

  • Performance Enhancements: Enabled bytecode compilation for native binaries, resulting in a 2x faster CLI startup time, and activated minification to reduce the binary distribution size.
  • Build Output Improvements: The build script now features enhanced console output with formatted headers, progress indicators (checkmark/cross), and a summary of build features and timing.
  • Package Naming Update: All references to the CLI package name have been updated from 'dora' to '@pleaseai/code' across the build script and documentation.
  • Sourcemap Exclusion: Sourcemaps are now explicitly disabled ('none') for production builds to further optimize binary size and security.
  • Build Duration Tracking: Integrated performance timing using performance.now() to measure and display the total duration of the package generation process.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@amondnet amondnet self-assigned this Dec 23, 2025
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Dec 23, 2025

Copy link
Copy Markdown

Deploying code-please with  Cloudflare Pages  Cloudflare Pages

Latest commit: 504646e
Status:🚫  Build failed.

View logs

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request enhances the build process for the @pleaseai/code CLI by introducing bytecode compilation and minification, which should improve startup performance and reduce the binary size. The changes also include significant improvements to the build script's console output, making it more informative and user-friendly with progress indicators and performance timing. My review focuses on the correctness of the new build options and the implementation of the new UI features. I've identified a formatting issue in the new summary box and suggested an opportunity to parallelize the build process for better performance. Overall, this is a solid set of improvements.

Comment thread scripts/generate-packages.ts Outdated
@codecov

codecov Bot commented Dec 23, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.35%. Comparing base (7e60438) to head (504646e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #63      +/-   ##
==========================================
+ Coverage   38.71%   39.35%   +0.64%     
==========================================
  Files          59       59              
  Lines        6515     6489      -26     
==========================================
+ Hits         2522     2554      +32     
+ Misses       3993     3935      -58     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Use dynamic padding for summary line to prevent UI misalignment
@amondnet
amondnet merged commit 6cbe828 into main Dec 23, 2025
9 of 10 checks passed
@amondnet
amondnet deleted the feat/bytecode-minification-build-optimization branch December 23, 2025 12:05
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