Skip to content

feat(cli): Add check-client command to verify bundle freshness #7517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

JerryWu1234
Copy link
Contributor

@JerryWu1234 JerryWu1234 commented Apr 15, 2025

What is it?

fixes: #7479
This commit adds a new CLI command that checks if the client bundle is up-to-date by:

  • Comparing source file modification times with the manifest file
  • Running a build if source files are newer than the manifest
  • Providing interactive prompts for user confirmation
  • Integrating with the existing Qwik CLI system

Description

Checklist

  • My code follows the developer guidelines of this project
  • I performed a self-review of my own code
  • I added a changeset with pnpm change
  • I made corresponding changes to the Qwik docs
  • I added new tests to cover the fix / functionality

Copy link

changeset-bot bot commented Apr 15, 2025

🦋 Changeset detected

Latest commit: 1075962

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@builder.io/qwik-city Patch
@builder.io/qwik Patch
eslint-plugin-qwik Patch
create-qwik Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

pkg-pr-new bot commented Apr 15, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@builder.io/qwik@7517
npm i https://pkg.pr.new/@builder.io/qwik-city@7517
npm i https://pkg.pr.new/eslint-plugin-qwik@7517
npm i https://pkg.pr.new/create-qwik@7517

commit: 1075962

Copy link
Contributor

github-actions bot commented Apr 15, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview 1075962

@JerryWu1234 JerryWu1234 marked this pull request as ready for review April 16, 2025 09:16
@JerryWu1234 JerryWu1234 requested a review from a team as a code owner April 16, 2025 09:16
@JerryWu1234 JerryWu1234 self-assigned this Apr 17, 2025
Copy link
Member

@wmertens wmertens left a comment

Choose a reason for hiding this comment

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

Ok, good start, but it needs to be quiet and fast, and not fancy in any way.

// Handle errors accessing the source directory
if (err.code === 'ENOENT') {
log.error(`Source directory '${SRC_DIR}' not found! Build might fail.`);
// Decide whether to force build or exit if source directory access fails
Copy link
Member

Choose a reason for hiding this comment

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

it should exit, and also please remove all these extra comments.

Comments should only be used when the code does something difficult or unexpected. At other times, the code itself should be enough.

if (needsBuild) {
log.step(yellow('Client build detected as necessary'));
// Log reasons why a build is needed
reasonsForBuild.forEach((reason) => log.info(` - ${reason}`));
Copy link
Member

Choose a reason for hiding this comment

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

not needed

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.

[🐞] server build should detect when client build is missing or out of date
2 participants