fix(cli): restore update notifications - #3524
Conversation
📝 WalkthroughWalkthroughThe update checker now queries npm, validates stable versions, supports injectable dependencies, and reports failures. CLI examples, templates, scripts, and documentation now use ChangesCLI update and command versioning
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
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
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
📒 Files selected for processing (19)
README.mdcli/commands/init/init.integration.test.tscli/main.tscli/shared/update-check.test.tscli/shared/update-check.tscli/templates/files/docs-agent/README.mdcli/templates/integrations/figma/README.mdcli/templates/manifest.jsondocs/api-reference/veryfront/cli.mddocs/getting-started/deploy-project.mddocs/getting-started/installation.mddocs/getting-started/quickstart.mddocs/guides/build-a-rag-app.mddocs/guides/deploying.mddocs/rfcs/0001-ui-primitive-adapters.mdscripts/postinstall.jstests/docs/guide-code-examples.test.tstests/docs/guide-content.test.tstests/docs/guide-contracts.test.ts
There was a problem hiding this comment.
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
📒 Files selected for processing (5)
cli/commands/init/init.integration.test.tscli/shared/update-check.test.tscli/shared/update-check.tsdocs/guides/deploying.mdtests/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
Closes veryfront/veryfront-issue-inbox#438
Summary
Verification
Summary by CodeRabbit
New Features
Documentation
npx veryfront@latest.Tests