What the deploy zip holds #

View this page as Markdown

On this page

The deployment ZIP contains your application's runnable files, with package.json at its root. The turnzero CLI builds it from the application folder. Turn Zero Cloud installs runtime dependencies, builds the hosting image, and runs npm start on Node.js 24.

Run turnzero hash --list in the application folder to preview every file in the ZIP (What the command leaves out).

What the zip contains #

The zip contains:

  • the backend as ordinary Node.js code exposing one server that honors PORT;
  • the web client's built files under client/, where there is one, every one of them public;
  • the migrations/ folder, where the application has a database;
  • the lib/ folder with the library packages the application declares as file: dependencies;
  • an optional manifest.json copy. Deployment uses the manifest previously recorded by submit_manifest. A copy that differs gets manifest_notice, a warning that the deploy runs under the recorded manifest, listing the members that differ, the application member left out of the comparison. The notice also lists each lib/<name>/package.json whose turnzero.entry and version match no entry of the recorded packages, and each the deploy left unread or could not compare, even without manifest.json in the zip. A manifest.json copy larger than 1 MiB or nested deeper than 64 levels is refused (below);
  • the package manifests, package.json and its lockfile, where there is one.

Any other file in the zip, such as a test/ folder, is still deployed: the image build copies it into the image unchanged, and it runs only where your code loads it.

The zip's root is the folder containing package.json. Where there is anything to install, the image build runs npm install --omit=dev there and links the copied library packages among the dependencies. It then runs npm start, so the start script is the entry point.

A lockfile is optional, for turnzero deploy and deploy_files alike. Where the zip holds package-lock.json, the install takes the versions it records wherever they still meet the ranges in package.json. Without one, the install resolves each dependency from its range in package.json at each build, so two deploys can install different versions. The build can skip installation when there are no runtime dependencies or workspaces and no other npm checks to perform; see What the image build installs.

A missing lockfile does not prevent deployment. The deploy_files response asks you to include the folder's package-lock.json if it exists. Where package.json declares something to install and no lockfile was sent, the answer says the deploy still works but each build resolves the ranges again. A tool with no shell cannot make the lockfile; it can pin its direct dependencies by writing exact versions, such as "1.3.0" in place of "^1.3.0", in package.json.

The engines field in package.json does not select the runtime. Both CLI and MCP deployments use Node.js 24 (What the application runs under).

What the command leaves out #

The command leaves out every node_modules and .git entry and every .env and .env.* file, wherever it stands and whatever the case of its name. So dependencies and environment files stay on your machine. Apart from the AI coding tools' files and the .deployignore paths below, it leaves out nothing else, because a file left out may be one your code loads at run time. It refuses a symbolic link by name.

The command reads a .deployignore file at the folder's top, written in .gitignore's syntax, and leaves out each path it lists. It never leaves out the top package.json or manifest.json. It never applies .gitignore, because a project often lists its build output there, and the platform runs no build script. Where the zip holds a file the top .gitignore lists, a note: line names it and its pattern. An ignore file in a lower folder is not read.

deploy_files builds the zip from the files your AI tool names alone, leaving out the same names as the command, so it never asks for a file the command always leaves out. It reads no .deployignore: your AI tool sends only the files it means to deploy.

deploy_files puts each file in the zip as the platform received it, changing no byte: a file's text, or the bytes a base64 file decodes to. A sha256 your AI tool computes matches only where its copy holds the same bytes. Line endings, a trailing newline, or a byte-order mark most often make the two differ.

A value your code reads from a .env file reaches a deployed copy another way. A secret is stored with store_secret and bound in the manifest's settings. A value that is not secret, such as a page title, goes in the manifest's settings as {"value": "<text>"} (Bound settings).

The CLI also excludes the AI coding tools' own files and folders: .claude, .mcp.json, .codex, .cursor, .gemini, .continue, .roo, .kiro, .amazonq, and .aider.conf.yml. These files can contain AI-tool credentials.

turnzero hash --list lists each file the zip would hold, and turnzero hash and turnzero deploy print the paths left out. They warn of a .zip file at the folder's top, which the zip includes, so keep a build's zip elsewhere. They also warn of a file that looks like a key or a credential. What it prints gives those lines.

The two project layouts #

Run the deployment command from the folder containing the application's package.json:

  • With an app/ folder. Where the application sits in app/ beside the project's library folder, system/, run the command's lines in app/, so the zip contains the contents of app/ alone and leaves system/ out.
  • With no app/ folder. If system/ sits beside the root package.json, it is included in the ZIP. The image build installs from package.json and the copies under lib/, never from system/.

Either way, the zip includes the application's own copy of each package under lib/, which package.json declares as a file: dependency (Use the library).

In this database-backed service, run the command from app/. Its contents become the ZIP's root:

notes-service/
  system/                      the library entries as taken, never zipped
  app/                         the zip's root
    package.json
    package-lock.json
    manifest.json
    .gitignore
    AGENTS.md
    migrations/0001_notes.sql
    src/db.mjs
    src/server.mjs
    src/main.mjs
    test/notes.test.mjs
    lib/database/              the package's package.json and lib/, copied from system/

Names and limits #

Every entry of the zip is a relative path inside its root, with / between its segments, and a folder entry such as zip -r writes becomes a folder. A deploy refuses an entry that is absolute, contains a backslash or a NUL, names a drive, or leaves the root through .., since the image build cannot write it.

A deploy also refuses a zip that uses the same path for both a file and a folder. It refuses an entry name longer than 4,096 bytes or with more than 128 segments in its path. Each is refused artifact_layout_invalid, with a detail naming the entry, and for a backslash a pointer to the tar.exe command of step 3 (Build and upload the artifact) of Deploy from your computer.

A zip is also refused with artifact_layout_invalid if it has more than 65,535 entries, or its entry names have more than 500,000 path segments in total.

The total declared size must not exceed 128 MiB. For each entry, count the larger of its compressed and uncompressed sizes, including folder entries. The same refusal applies if the root manifest.json nests objects or lists deeper than 64 levels. For these, the detail names the bound.

Bytes that are not a zip are refused artifact_unreadable. A zip with no package.json at its root, or whose package.json is not a JSON object, is refused artifact_layout_invalid. So is one with neither a start script nor a root server.js, since npm start then has nothing to run, and one whose root package.json or manifest.json is larger than 1 MiB. Where exactly one top-level folder of the zip contains a package.json, the detail names that folder: zip its contents instead.

A web client's files have bounds of their own, after the zip's. A zip whose client/ folder holds more than 2,000 files the platform serves, one over 25 MiB, or more than 50 MiB together is refused artifact_layout_invalid. The detail names the bound. A name the platform does not serve, such as .DS_Store, is skipped and counts toward none (Serve a web client).

A zip whose root package.json or manifest.json, or a nested package.json the deploy reads, inflates past the size its entry declares is refused artifact_unreadable too. The image build stops at any entry that does, naming it.

The deploy reads the zip before it adds a version, so none of these refusals counts against the day's deploys. Windows PowerShell's Compress-Archive writes \ between segments, which these rules refuse, so a zip you build yourself on Windows comes from tar.exe.

What the image build installs #

The image build installs runtime dependencies with npm install --omit=dev. It excludes development dependencies even if .npmrc says otherwise. Other npm settings, such as a private registry, still apply.

The image build removes the install scripts, such as postinstall and prepare, from your root package.json and from each workspace member's, one whose folder your root package.json's workspaces match. The image contains those copies. Every other dependency runs its own install scripts as npm runs them, a lib/ package declared as a file: dependency among them. The shell those scripts run under is the build's own.

A workspaces pattern may use literal segments, * within a segment, and ** segments, with each ! pattern after every other and none matching a positive pattern's own text. A * never matches a folder name's leading ., and a ** never passes through a folder whose name opens with ., so packages/* and ** skip .cache. A segment that spells the dot itself, such as .c*, still matches it.

A deploy refuses any other pattern by name, such as one using ?, braces, brackets, parentheses, a backslash, a leading #, more than one leading !, or a .. segment. It also refuses a pattern longer than 4,096 bytes or deeper than 128 segments, the bound on an entry's name, and more than 256 patterns or 5,000,000 matching steps.

The image build skips npm install where it would install and run nothing: package.json declares no dependencies other than devDependencies, and no workspaces. The skip also needs a zip root containing no node_modules or .npmrc, and a package.json with no os, cpu, libc, or devEngines field, which npm's install checks. Its scripts, where present, must be an object. A skipped install changes nothing else: the image still starts with npm start.

Native modules #

Native modules in the root or a workspace member must ship prebuilt; the image build does not run their binding.gyp files. A deploy refuses one that ships no .node file, as artifact_layout_invalid, naming the first such entry. A native module in the root ships its .node file anywhere in the zip outside node_modules and the workspace members' folders. A native module in a workspace member ships its .node file in that member's folder, excluding any nested workspace member's folder. A lib/ package's binding.gyp builds on the platform's Linux builders, as npm builds it.

Build each .node file your zip ships for Linux, the platform's target. The deploy checks only that it exists; one built for Windows or macOS fails when your application loads it.

The notices a deploy returns #

A deploy returns artifact_notice, listing each install script and binding.gyp of the root's or a workspace member's that the build will not run or rebuild. The deploy reads a package.json below the root only up to 64 KiB, and at most 50 of them. The notice lists each workspace member's it left unread, which the build strips all the same. Where one builds something your application needs, run it locally and ship its output in the zip.

A deploy returns client_notice where client/ holds a file beyond the page's shell, index.html, app.js, and styles.css, or a name the platform skips. It counts the files the platform will serve, and names up to twenty beyond the shell. It then names up to twenty skipped files, and counts the rest of each list. Every file it counts is public from that deploy on, so read it after each deploy (Serve a web client).

Notices do not block deployment. See manifest_notice under What the zip contains.