Skip to content

Run an app's build only when its package.json defines one - #469

Merged
tnkuehne merged 3 commits into
mainfrom
optional-app-build
Nov 28, 2026
Merged

tnkuehne merged 3 commits into
mainfrom
optional-app-build

Conversation

@tnkuehne

@tnkuehne tnkuehne commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

An app without a framework build, such as a plain Worker with static assets, still has a package.json for its development tools. widefleet deploy ran pnpm run build whenever package.json existed, so such apps had to deploy with --skip-build, and server builds, which run widefleet deploy, failed with "Missing script: build".

Changes

  • widefleet deploy and widefleet preview run the project's build script when package.json defines one. Without it they print No build script in package.json; bundling the Worker entry as is. and bundle the configured entry. The check accepts a byte order mark and script values of any type, as pnpm does; an invalid package.json fails with its parse error.
  • --skip-build is removed.
  • Server builds are unchanged: they run pnpm install --frozen-lockfile for every project with package.json, so pnpm finds a workspace's root lockfile and reports a missing one.
  • Tests no longer pass --skip-build. A CLI test covers a project whose package.json has no build script.
  • The SvelteKit starter README describes the build step instead of the flag.

Documentation: #471 (draft until a release includes this).

Checks

  • cargo test -p platform-cli, cargo fmt --check, cargo clippy --all-targets -D warnings
  • pnpm typecheck, pnpm lint, pnpm format:check
  • CLI tests (cli.test.ts, service-documentation.test.ts, organization-selection.integration.test.ts) and CLI package tests with a packaged debug binary
  • runtime/deployment.test.ts needs Docker and runs in CI.

widefleet deploy and preview run the project's build script when
package.json declares it and otherwise bundle the Worker entry directly,
so --skip-build is gone. Server builds install only from a committed
pnpm-lock.yaml, skip the install for a project without dependencies, and
fail with the missing file named when dependencies have no lockfile.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
widefleet-docs ee457f4 Nov 28 2026, 04:57 PM

…cepts

pnpm already reports a missing lockfile and finds a workspace's root
lockfile, so server builds keep running pnpm install --frozen-lockfile for
every project with package.json. Build script detection accepts a byte
order mark and script values of any type. The documentation moves to its
own pull request until a release includes this change.
The CLI reads package.json as a JSON value and checks only scripts.build,
so a scripts field of another type or a repeated scripts key no longer
stops a deploy that pnpm would run.
@tnkuehne
tnkuehne merged commit 45b68cc into main Nov 28, 2026
5 checks passed
@tnkuehne
tnkuehne deleted the optional-app-build branch November 28, 2026 16:59
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