Skip to content

Migrate to Vite+.#1697

Open
cpojer wants to merge 1 commit into
cloudflare:mainfrom
cpojer:main
Open

Migrate to Vite+.#1697
cpojer wants to merge 1 commit into
cloudflare:mainfrom
cpojer:main

Conversation

@cpojer

@cpojer cpojer commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

This PR moves the agents repo to Vite+. Please see https://viteplus.dev/ for how to set up Vite+.

  • Package management is done through vp install, using pnpm under the hood.
  • Oxlint and Oxfmt configs were moved into vite.config.ts, and should be used via vp check --fix.
  • Nx was replaced by Vite Task.
  • Use vite-plus/pack instead of tsdown.
  • Use vite-plus/test instead of vitest.
  • Replaced hsuky/lint-staged with Vite+.

In a follow-up I'd like to also add type checking to vp check to simplify further.

@cpojer cpojer requested a review from threepointone June 8, 2026 03:40
@changeset-bot

changeset-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 50cd281

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@pkg-pr-new

pkg-pr-new Bot commented Jun 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@1697

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@1697

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@1697

create-think

npm i https://pkg.pr.new/create-think@1697

hono-agents

npm i https://pkg.pr.new/hono-agents@1697

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@1697

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@1697

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@1697

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@1697

commit: 50cd281

@cpojer cpojer force-pushed the main branch 2 times, most recently from de9e591 to a2064dc Compare June 8, 2026 07:41
@cpojer

cpojer commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

Updated all GitHub Actions to use pinned actions for security.

Comment thread pnpm-workspace.yaml Outdated
@cpojer cpojer force-pushed the main branch 2 times, most recently from 24ddb43 to 3f8f3d7 Compare June 10, 2026 00:25
@cpojer

cpojer commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

Rebased and resolved conflicts.

@cpojer cpojer force-pushed the main branch 3 times, most recently from 7bf82ad to 091d475 Compare June 10, 2026 01:23
@fengmk2

fengmk2 commented Jun 10, 2026

Copy link
Copy Markdown

LGTM 👍

@cpojer cpojer force-pushed the main branch 3 times, most recently from 2bff637 to 81d5ba9 Compare June 12, 2026 09:48

@threepointone threepointone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

some questions for my understanding

steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why are we pinning these versions? is that better? won't we miss updates?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Security.

We did this for all VoidZero projects to avoid hacked actions from taking over our projects. We should frequently update actions (manually, or through renovate), but keep them pinned.

// This is a workaround until this is handled automatically by `changeset version`.
// See https://github.com/changesets/changesets/issues/421.
execSync("pnpm exec changeset version", {
execSync("vp exec changeset version", {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is theree a vpx command? could be nice.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes there is!

{ default: tailwindcss },
{ default: react },
{ think }
] = await Promise.all([

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why is this better?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

With Vite+, vite.config.ts is loaded in many workflows such as vp lint or vp fmt. Some plugins take a lot of time to load, making all tool invocations slower. We added support for "lazy plugins" so we don't have to wait on the ecosystem to optimize their plugin init times.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ideally, plugins would be an async function but the Vite team thought it wasn't worth adding that API surface at this time.

"build": "vite build",
"deploy": "vite build && wrangler deploy",
"start": "vp dev",
"build": "vp run build:vite",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we don't have a build:vite command here? why is this not vp build?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

oh I see it's in the vite config. but then should it be vp run? not vp?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It is vp run.

Comment thread package.json Outdated
"packageManager": "pnpm@11.5.2"
"packageManager": "pnpm@11.5.2",
"overrides": {
"esbuild": "^0.25.1"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why this override?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Removed. Sorry that was a leftover.

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.

3 participants