Skip to content

fix(cli): restore update notifications - #3524

Merged
kojiwakayama merged 2 commits into
mainfrom
fix/issue-438-cli-update-notifier
Aug 10, 2026
Merged

fix(cli): restore update notifications#3524
kojiwakayama merged 2 commits into
mainfrom
fix/issue-438-cli-update-notifier

Conversation

@kojiwakayama

@kojiwakayama kojiwakayama commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Closes veryfront/veryfront-issue-inbox#438

Summary

  • query the npm latest endpoint and parse its version field
  • cache successful update checks and expose sanitized failures in verbose diagnostics
  • select npm, Homebrew, or install-script update guidance from the active runtime
  • pin repository-owned npx examples to veryfront@latest so stale global binaries cannot shadow them
  • regenerate the CLI API reference and template manifest

Verification

  • deno test --no-check --allow-all cli/shared/update-check.test.ts
  • deno test --no-check --allow-all tests/docs/guide-contracts.test.ts tests/docs/guide-content.test.ts tests/docs/guide-code-examples.test.ts
  • deno test --no-check --allow-all cli/commands/init/init.integration.test.ts
  • deno check cli/shared/update-check.ts cli/shared/update-check.test.ts
  • deno task verify:quick
  • deno task build:npm
  • generated Node package reports the npm endpoint and npm update command
  • live npm latest endpoint returned version 0.1.1225
  • git diff --check

Summary by CodeRabbit

  • New Features

    • Improved update checks using the npm registry.
    • Added installation commands tailored to the installation method.
    • Added clearer diagnostics when update checks encounter registry errors.
  • Documentation

    • Updated CLI, setup, deployment, integration, and template examples to use npx veryfront@latest.
  • Tests

    • Expanded coverage for update detection, installation guidance, caching, error handling, and version-qualified command examples.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The update checker now queries npm, validates stable versions, supports injectable dependencies, and reports failures. CLI examples, templates, scripts, and documentation now use npx veryfront@latest. Tests cover the update flow and command expectations.

Changes

CLI update and command versioning

Layer / File(s) Summary
npm-backed update checker
cli/shared/update-check.ts, cli/shared/update-check.test.ts
The update checker uses npm registry responses, selects installation commands by installation type, supports injectable cache and runtime dependencies, validates stable semver versions, and reports failures through debug hooks.
Versioned CLI command examples
README.md, cli/main.ts, cli/templates/..., docs/..., scripts/postinstall.js, tests/docs/..., cli/commands/init/init.integration.test.ts
CLI commands in documentation, templates, post-install output, and related tests now use npx veryfront@latest without changing command arguments.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant checkForUpdates
  participant npmRegistry
  participant UpdateCheckFileSystem
  participant notice
  checkForUpdates->>UpdateCheckFileSystem: read cached version
  checkForUpdates->>npmRegistry: fetch package version
  npmRegistry-->>checkForUpdates: return stable semver version
  checkForUpdates->>UpdateCheckFileSystem: write cached version and timestamp
  checkForUpdates->>notice: display update notification
Loading

Possibly related PRs

Suggested reviewers: kwakayama, ariskemper

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: restoring CLI update notifications.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-438-cli-update-notifier

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9e53f035d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cli/shared/update-check.ts

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cli/commands/init/init.integration.test.ts`:
- Line 190: The negative assertion in
cli/commands/init/init.integration.test.ts:190-190 should also reject the legacy
“npx veryfront deploy” command alongside the existing `@latest` check. Add the
corresponding assertion in tests/docs/guide-content.test.ts:168-168 so
documentation is verified not to contain the unversioned command.

In `@cli/shared/update-check.ts`:
- Around line 161-177: Separate cache persistence from the successful fetch flow
in the update-check logic: after fetchLatestVersion returns, evaluate
compareVersions and call notice regardless of fs.mkdir or fs.writeTextFile
failures. Handle cache persistence errors independently through the existing
debug behavior, and add coverage verifying a rejected writeTextFile still sends
the fetched version to printNotice.

In `@docs/guides/deploying.md`:
- Around line 77-84: Update the remaining open-command examples in the
deployment guide to use the version-qualified CLI: replace veryfront open with
npx veryfront@latest open and veryfront open --json with npx veryfront@latest
open --json, preserving their existing arguments and behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6263ff98-93fa-4341-8395-634350489abd

📥 Commits

Reviewing files that changed from the base of the PR and between bc9d253 and 9e53f03.

📒 Files selected for processing (19)
  • README.md
  • cli/commands/init/init.integration.test.ts
  • cli/main.ts
  • cli/shared/update-check.test.ts
  • cli/shared/update-check.ts
  • cli/templates/files/docs-agent/README.md
  • cli/templates/integrations/figma/README.md
  • cli/templates/manifest.json
  • docs/api-reference/veryfront/cli.md
  • docs/getting-started/deploy-project.md
  • docs/getting-started/installation.md
  • docs/getting-started/quickstart.md
  • docs/guides/build-a-rag-app.md
  • docs/guides/deploying.md
  • docs/rfcs/0001-ui-primitive-adapters.md
  • scripts/postinstall.js
  • tests/docs/guide-code-examples.test.ts
  • tests/docs/guide-content.test.ts
  • tests/docs/guide-contracts.test.ts

Comment thread cli/commands/init/init.integration.test.ts
Comment thread cli/shared/update-check.ts
Comment thread docs/guides/deploying.md

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cli/shared/update-check.test.ts`:
- Line 195: Remove the duplicate const notices declaration in the affected test
block, retaining a single Array<{ current: string; latest: string }> declaration
so the file compiles without a block-scoped redeclaration.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: adffc5d6-f69c-47f7-a472-8163ab9ff561

📥 Commits

Reviewing files that changed from the base of the PR and between 9e53f03 and 61f10af.

📒 Files selected for processing (5)
  • cli/commands/init/init.integration.test.ts
  • cli/shared/update-check.test.ts
  • cli/shared/update-check.ts
  • docs/guides/deploying.md
  • tests/docs/guide-content.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • tests/docs/guide-content.test.ts
  • docs/guides/deploying.md
  • cli/commands/init/init.integration.test.ts

Comment thread cli/shared/update-check.test.ts
@kojiwakayama
kojiwakayama added this pull request to the merge queue Aug 10, 2026
Merged via the queue into main with commit ed7e4b4 Aug 10, 2026
31 checks passed
@kojiwakayama
kojiwakayama deleted the fix/issue-438-cli-update-notifier branch August 10, 2026 04:26
@kwakayama kwakayama mentioned this pull request Aug 10, 2026
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