Skip to content
VaelJS Blog

vael.jsonc Manifest Spec

This specification documents vaeljs-manifest, the strict manifest and workspace foundation wired into vaeljs / vaeljs-core (V8) and vaeljs-lite / vaeljs-lite-core (QuickJS, behind the manifest Cargo feature).

The format is inspired by Deno’s deno.json, not compatible with it: unknown keys, duplicate keys, and explicit null values fail closed rather than being silently ignored.

  • Conventional filename: vael.jsonc (MANIFEST_FILE_NAME).
  • Bounded upward discovery: discover_manifest searches upward from the entry file’s directory up to MAX_DISCOVERY_DEPTH = 64 directories, tracking canonicalized visited directories and honoring an optional stop_dir.
  • Size-bounded reads: Manifest::from_path reads at most MAX_MANIFEST_BYTES + 1 bytes so oversized files fail without unbounded allocation.
  • CLI vs Embedding: Both vjs and vjs-lite run automatic discovery by default (unless --no-config or explicit --config <path> is passed; combining both exits with code 2). Embedders using Runtime::new() in vaeljs-core or vaeljs-lite-core get zero implicit discovery unless opting in with ImportResolver.
  • Remote isolation: Only local file: referrers consult vael.jsonc imports and workspaces. Remote (https:, jsr:) referrers cannot resolve into local file: paths through a local manifest.
  • Runtime gates preserved: In both vjs and vjs-lite (since 0.0.0-alpha.1), remote targets inside imports (https:, gh:, jsr:) remain gated by --allow-remote / VAELJS_ALLOW_REMOTE=1, and npm: targets follow vaeljs-npm policy (--offline, --frozen-lockfile, --no-npm). vael:* and node:* schemes are never intercepted by imports.

vaeljs-manifest parses standard JSON plus:

  • // line comments and non-nesting /* ... */ block comments outside strings.
  • At most one trailing comma per object or array ({"a": 1,}, ["a",]).
  • An optional leading UTF-8 BOM (skipped as syntax, counted toward the byte limit and byte columns).

Single quotes, unquoted keys, NaN, Infinity, hexadecimal numbers, multiple top-level values, and duplicate keys at any depth are rejected.

Bound Constant Limit
Document size MAX_JSONC_BYTES / MAX_MANIFEST_BYTES 1 MiB (1,048,576 bytes)
Nesting depth MAX_JSONC_DEPTH 128 levels
Discovery depth MAX_DISCOVERY_DEPTH 64 parent directories
Workspace members MAX_WORKSPACE_MEMBERS 256 members
Workspace glob entries MAX_WORKSPACE_GLOB_ENTRIES 4,096 filesystem entries

Errors report line and byte column without echoing document text, field values, unknown keys, paths, or specifiers.

Only name is required. Absent optional fields must be omitted; explicit null is rejected.

  • Must use @scope/name format, total length <= 214 bytes.
  • Scope and name are each 1..=213 bytes of lowercase ASCII letters, digits, -, _, and ., starting with a letter or digit, separated by a single /.
  • Optional exact SemVer string (e.g., 1.2.3 or 1.2.3-alpha.1). Ranges and tags are rejected.
  • description: optional string up to 4,096 bytes (only \t, \n, \r control chars allowed).
  • authors: optional array of up to 64 non-empty strings (1..=256 bytes each, no leading/trailing whitespace). Order is preserved.
  • Single string or non-empty object mapping . or ./subpath keys to ./... targets ending in .ts, .mts, .js, or .mjs (max 1,024 entries; keys <= 512 bytes, targets <= 1,024 bytes).
  • Rejects *, ?, . / .. segments, escaping paths, .tsx, .jsx, .cts, .cjs, .d.ts, JSON, Wasm, conditional export objects, and null exclusions.
  • No main fallback: "main" is explicitly rejected with a message pointing to exports.
  • Object mapping exact specifiers or trailing-/ prefixes to local paths or canonical schemes (max 1,024 entries; keys <= 1,024 bytes, no whitespace/control chars/\).
  • Trailing-/ prefix keys must map to targets ending in / (./.../ , https://.../ , file:///.../ , gh:owner/repo@ref/[sub/], jsr:@scope/name@version/[sub/], npm:name@version/[sub/], or node:module/).
  • Bare targets (e.g., "react") and http:, data:, blob: targets are rejected.
  • npm:[@scope/]name@version[/subpath]: Requires an explicit @version token (^1.2.3, 1.2.3, latest); complex ranges with spaces are rejected by vael.jsonc normalization.
  • jsr:@scope/name@version[/subpath]: Requires @scope/name (scope 2..=20 bytes, name 2..=58 bytes, lowercase ASCII/digits/-) and an explicit version token.
  • gh:owner/repo@reference/path (and github: alias, plus legacy gh:owner/repo/path/@reference): Normalizes to https://raw.githubusercontent.com/<owner>/<repo>/<ref>/<path>. Rejects \, %, ?, #, empty/./.. segments.
  • Optional arrays of up to 256 relative glob strings (<= 1,024 bytes each, / separators, no leading ! negation). Syntax-checked only; reserved for future packaging steps.
  • Optional array of up to 256 relative directory patterns (*, ?, [...], **; {...} brace expansion is rejected).
  • Workspace::load expands globs deterministically, checks canonical workspace-root containment on symlinks before descending, rejects missing member manifests, duplicate @scope/name names, and nested workspaces, and indexes members for ImportResolver.
  • Singular "workspace" is explicitly rejected (deliberate incompatibility with deno.json).

db (Non-Secret Database & Migration Metadata)

Section titled “db (Non-Secret Database & Migration Metadata)”
  • Optional object consumed by vjs db migrate (vaeljs-manifest::DbConfig). Unknown keys inside db are rejected.
  • Secret hygiene (Error::SecretInManifest): "password", "url", and any string field containing inline URL credentials (://user:pass@) are strictly rejected so secrets are never committed in vael.jsonc. Use "passwordEnv" (an environment variable name matching [A-Za-z_][A-Za-z0-9_]*), VAELJS_DB_PASSWORD, or --password-file.
  • Connection fields: driver ("sqlite" | "postgres" | "mysql" | "mariadb" | "mssql"), host, port (1..=65535), database, user, passwordEnv, tls (boolean), tlsMode ("verifyFull" | "insecure" | "plaintext"), and caFile (requires verifyFull TLS mode; tls and tlsMode must not conflict).
  • Migration fields: migrationsDir, table ([a-z_][a-z0-9_]*, <= 55 bytes), schema ([a-z_][a-z0-9_]*, <= 63 bytes), module, managedObjects (up to 1,024 table or schema.table entries), lockTimeoutMs (1..=i32::MAX), baselineVersion (1..=i64::MAX), and bindings (up to 256 unique key -> [a-z_][a-z0-9_]* identifier mappings).
Key Rejection Reason
node Node compatibility transform not configured here
nodeModulesDir node_modules layout is not supported
type Package exports are strict ESM
main Use exports; no main fallback
workspace Use workspaces
importMap Use imports
tasks Task runner not implemented
compilerOptions Erasable TypeScript stripping only
lint Lint configuration not implemented
fmt Format configuration not implemented
lock Lockfile configuration not implemented