Skip to content

jiayang.json schema

jiayang.json lives in the directory you deploy. Every field is optional except version. Every section refuses a field it doesn’t know, including $schema, so a typo is an error. jiayang.json shows it in use.

{
"version": 1,
"kind": "worker",
"build": {
"install": "pnpm install --frozen-lockfile",
"command": "pnpm build",
"output": "dist"
},
"worker": {
"main": "src/worker.ts",
"compatibility_date": "2026-09-01",
"compatibility_flags": ["nodejs_compat"],
"include": ["dist"],
"wrangler_config": "wrangler.production.jsonc"
},
"container": {
"runtime": "python",
"start": "uvicorn api.main:app --host 0.0.0.0 --port $PORT",
"port": 8080,
"instance_type": "lite"
}
}

A real file has only the sections its kind uses. A flag on jiayang deploy beats the file, and the file beats the project’s wrangler config and detection.

Nothing in it opens a public path or sets a webhook verifier. Those are set in the dashboard only, so no deploy, an agent’s included, can put an app on the open internet.

  • Type: integer. Required.
  • Value: 1.

A file with main, compatibility_date, include, port or instance_type at the top level is in the old flat format, and is refused with the rewrite printed. Any other file without version is refused with jiayang.json needs "version": 1. Any other number is refused: jiayang.json says version 2; this jiayang understands version 1.

  • Type: string: static, worker or container.
  • Default: what detection decides.
  • Overridden by: --kind.

static and worker run on Workers, and container on Containers. An app can’t move between the two after it’s created.

How to turn the source into something deployable, run on your machine before anything goes up.

  • Type: string, a shell command.
  • Default: the frozen install for your lockfile: npm ci, pnpm install --frozen-lockfile, yarn install --immutable or bun install --frozen-lockfile. With no lockfile in the app, the one at the root of the workspace it belongs to. Otherwise none.

Runs only when there’s a package.json and no node_modules where it runs: the app’s directory, or the workspace’s root when the install comes from the root’s lockfile.

  • Type: string, a shell command, run in the app’s directory.
  • Default: npm run build when package.json has a build script. For Next.js with @opennextjs/cloudflare, ./node_modules/.bin/opennextjs-cloudflare build. For a container, none.

A container builds inside its image, so it runs nothing on your machine unless this is set. The command runs with the app’s environment variables and without Cloudflare credentials. It runs with sh -c, or cmd on Windows.

  • Type: string, a directory relative to the app.
  • Default: the first of dist, build, out, _site, .output/public, .vitepress/dist and docs/.vitepress/dist that exists after the build. public only when nothing is built. The app’s directory itself when there’s nothing to build.

Static sites only: the directory whose files are served. A build that ran and wrote none of the defaults stops the deploy and asks for this.

For a Worker. Ignored for the other kinds.

  • Type: string, a path relative to the app.
  • Default: the wrangler config’s main when the project has a wrangler config. Otherwise the first of src/index.ts, index.ts, src/worker.ts and worker.ts, built with wrangler. Otherwise the first of index.js, index.mjs, src/index.js, src/index.mjs, dist/index.js and dist/index.mjs.
  • Overridden by: --main.

The entry module. A .ts entry in a project with no wrangler config is built with wrangler. Without a build, it must be a .js or .mjs ES module.

  • Type: string, YYYY-MM-DD.
  • Default: the wrangler config’s, else 2026-09-01.
  • Overridden by: --compatibility-date.

A real date, and not one in the future.

  • Type: array of strings.
  • Default: the wrangler config’s flags, else none.
  • Allowed: nodejs_compat, nodejs_compat_v2, nodejs_als, global_fetch_strictly_public.

When set, the list replaces the wrangler config’s. Any other flag is refused before the build.

  • Type: array of strings, directories relative to the app.
  • Default: the whole app.

The directories to take modules from, for a Worker that goes up without a build. Each has to be a real directory inside the app. A symlink, a missing directory or one that leads outside the app is refused.

  • Type: string, a file name.
  • Default: whichever config wrangler finds itself, including one a build tool generated.

The wrangler config to build with, when the project has more than one or one with an unusual name. It must be a file beside the app ending in .json, .jsonc or .toml. Naming it passes it to wrangler with --config, so wrangler builds from that file rather than from a config a build tool generated.

For a container. Ignored for the other kinds.

  • Type: string: node, python, go or rust.
  • Default: from the project’s files: node with a package.json, python with requirements.txt, pyproject.toml or Pipfile, go with go.mod, rust with Cargo.toml.

Which Dockerfile to write when the project has none. A project with its own Dockerfile builds from that, whatever this says.

  • Type: string, one line.
  • Default: npm start for Node, the binary for Go and Rust, and for Python a command chosen from the framework (table).

The command the written Dockerfile runs. A plain program and its arguments run as they are. A command using shell syntax, such as $PORT or &&, runs through sh -c. Go’s image has no shell, so a Go start command has to be a plain one. A project with its own Dockerfile ignores this.

  • Type: integer, 1 to 65535.
  • Default: the live version’s port, else 8080.
  • Overridden by: --port.

The port the container listens on. It’s also in the container’s PORT variable.

  • Type: string: lite, basic, standard-1, standard-2, standard-3 or standard-4.
  • Default: the live version’s size, else basic.
  • Overridden by: --instance-type.

The size the container runs at: Cloudflare Containers’ instance types, smallest first. The workspace’s plan decides which it can use: Team and Business run lite and basic, and a size the plan doesn’t run is refused before anything is built. See Limits.