Skip to Content
Puppi
Concepts

Bundle

Build the two files a deployment is made of.

puppi build writes the two files a deployment is made of: bundle.js and manifest.json.

The manifest lists assets, dependencies, schemas, checks, schedules, and connection declarations. A connection declaration carries a type and a config shape. It does not carry a password. Any connector client the config registered is included in bundle.js.

Build the project

puppi build

The files go in the directory named by out in puppi.config.ts. When out is omitted, that directory is dist. The npm scaffold used in the Quickstart sets out to out, so puppi build writes out/bundle.js and out/manifest.json. The command also writes puppi-env.d.ts next to puppi.config.ts. That file maps each asset key to its row type, so ctx.input("typo/key") is a type error after the first build. The build then runs the project’s tsc --noEmit, and a type error fails the command. Keep puppi-env.d.ts out of version control. The project’s tsconfig.json has to include it, or the editor ignores it.

The build prints each asset, its role, and the assets it reads.

What the build records

Code at the top of the pipeline runs during the build. A loop that calls source() is fine. A network request at the top level runs during the build. The run functions are not called.

A ctx.input("demo/customers") or ctx.connection("warehouse") whose argument is a string literal is recorded. A key built in a variable is not. Put that key in the asset’s deps or connections array. Those arrays are added to the literals. Leaving a literal out of deps does not remove it.

Changing one asset’s code marks that asset stale. The other assets keep the stored result. See Staleness.

What the engine keeps

The engine stores the bundle by its content hash. A second deploy of the same bytes uploads nothing. The manifest points at sha256:<hash>, which is sha256: followed by 64 lowercase hex characters. A deployment that names a hash the engine does not have is rejected. Any other bundle_ref is rejected and no deployment row is stored.

The same bundle can be deployed to more than one environment. Each environment gets its own deployment row and its own pointer. See Deploy and rollback.