Skip to content

Fix/prod deployment#1

Open
priom wants to merge 2 commits intoprodfrom
fix/prod-deployment
Open

Fix/prod deployment#1
priom wants to merge 2 commits intoprodfrom
fix/prod-deployment

Conversation

@priom
Copy link
Member

@priom priom commented Mar 17, 2026

No description provided.

priom and others added 2 commits March 16, 2026 22:28
…ndle

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gemini-code-assist
Copy link

Summary of Changes

Hello, 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 addresses issues related to production deployment, likely targeting Cloudflare Pages, by refining the build process. It introduces a post-build cleanup step for worker static files, adjusts the Vite/Rollup configuration for dynamic imports, and adds a local development command for Cloudflare Pages, aiming to ensure a more robust and efficient deployment.

Highlights

  • Deployment Script: A new script scripts/clean-worker-statics.mjs was introduced to clean up unnecessary static files in the dist/_worker.js directory after a build, keeping only essential files like index.js, wrangler.json, and chunks.
  • Build Process Integration: The package.json's build script was updated to execute this new cleanup script (node scripts/clean-worker-statics.mjs) immediately after the vite build command, ensuring a cleaner worker deployment.
  • Development Environment Configuration: The .claude/settings.local.json file was updated to include a new allowed Bash command: timeout 12 npx wrangler pages dev ., likely for local development and testing of Cloudflare Pages.
  • Vite/Rollup Configuration: The vite.config.ts file was modified to add inlineDynamicImports: true to the Rollup output configuration, which can be crucial for how modules are bundled and loaded, potentially resolving issues with dynamic imports in certain deployment environments.
Changelog
  • .claude/settings.local.json
    • Added a new wrangler pages dev command to the allowed Bash scripts.
  • package.json
    • Modified the build script to include a call to node scripts/clean-worker-statics.mjs.
  • scripts/clean-worker-statics.mjs
    • Created a new Node.js script to remove non-essential files from the dist/_worker.js directory.
  • vite.config.ts
    • Configured Rollup output to inlineDynamicImports: true.
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.

@cloudflare-workers-and-pages
Copy link

Deploying hyperterminal with  Cloudflare Pages  Cloudflare Pages

Latest commit: 70a01eb
Status: ✅  Deploy successful!
Preview URL: https://4fbf18ea.hyperterminal.pages.dev
Branch Preview URL: https://fix-prod-deployment.hyperterminal.pages.dev

View logs

Copy link

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

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 aims to fix the production deployment, likely for an environment like Cloudflare Pages. It adjusts the build process by inlining dynamic imports for the server and adds a script to clean up the output directory. The changes are logical and consistent. I have one suggestion to make the new cleanup script more robust.

Comment on lines +7 to +11
for (const entry of readdirSync(workerDir)) {
if (!keep.has(entry)) {
rmSync(join(workerDir, entry), { recursive: true, force: true })
}
}

Choose a reason for hiding this comment

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

medium

The script currently assumes the dist/_worker.js directory exists when readdirSync is called. If the directory is not created for any reason (e.g., a preceding build step fails), the script will throw an error and cause the entire build to fail. It would be more robust to handle this case gracefully, for instance by wrapping the file operations in a try...catch block to check for an ENOENT error.

Suggested change
for (const entry of readdirSync(workerDir)) {
if (!keep.has(entry)) {
rmSync(join(workerDir, entry), { recursive: true, force: true })
}
}
try {
for (const entry of readdirSync(workerDir)) {
if (!keep.has(entry)) {
rmSync(join(workerDir, entry), { recursive: true, force: true })
}
}
} catch (error) {
if (error.code === 'ENOENT') {
console.log(`Worker directory '${workerDir}' not found, skipping cleanup.`)
} else {
throw error
}
}

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