A TypeScript bundle is one file per entrypoint, bundled in the toolchain (hq ADR 0193); a toolchain follows the SDK it stands on (hq issue 212)
Every served bundle is its own process now, so each carries its own copy of what it imports: after the compile and the launchers, the toolchain image's esbuild bundles every entrypoint in place and every launcher under its own name into one ES module file, the SDK inlined, require provided to inlined CommonJS, the launcher's shebang kept and its mode 0755. The toolchain's node_modules is copied only for packages an artifact names external. An image without the bundler is refused by name. Issue 212: build.on already passes a published package by its exact version and plans the toolchain after it; tests say so.
This commit is contained in:
@@ -757,6 +757,11 @@ type Artifact struct {
|
||||
// list twice. A module declaring no tools has nothing the runtime loads, whatever it compiles.
|
||||
Loads []string `json:"loads,omitempty"`
|
||||
|
||||
// External are packages a TypeScript bundle keeps as imports rather than inlining — a native
|
||||
// addon, a package that reads its own files — and so carries the toolchain's node_modules for
|
||||
// (novox/hq ADR 0193). Absent for nearly every bundle, which is then one file per entrypoint.
|
||||
External []string `json:"external,omitempty"`
|
||||
|
||||
// Env is what a tools bundle is given on a machine (novox/hq ADR 0192): words and their values,
|
||||
// paths and constants composed with ${dir:…} and ${port:…} exactly as a container's environment
|
||||
// is, never a secret's content. The node's runtime hands it to this bundle and to no other.
|
||||
|
||||
Reference in New Issue
Block a user