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.
File Discovery & Boundaries
Section titled “File Discovery & Boundaries”- Conventional filename:
vael.jsonc(MANIFEST_FILE_NAME). - Bounded upward discovery:
discover_manifestsearches upward from the entry file’s directory up toMAX_DISCOVERY_DEPTH = 64directories, tracking canonicalized visited directories and honoring an optionalstop_dir. - Size-bounded reads:
Manifest::from_pathreads at mostMAX_MANIFEST_BYTES + 1bytes so oversized files fail without unbounded allocation. - CLI vs Embedding: Both
vjsandvjs-literun automatic discovery by default (unless--no-configor explicit--config <path>is passed; combining both exits with code2). Embedders usingRuntime::new()invaeljs-coreorvaeljs-lite-coreget zero implicit discovery unless opting in withImportResolver. - Remote isolation: Only local
file:referrers consultvael.jsoncimportsandworkspaces. Remote (https:,jsr:) referrers cannot resolve into localfile:paths through a local manifest. - Runtime gates preserved: In both
vjsandvjs-lite(since0.0.0-alpha.1), remote targets insideimports(https:,gh:,jsr:) remain gated by--allow-remote/VAELJS_ALLOW_REMOTE=1, andnpm:targets followvaeljs-npmpolicy (--offline,--frozen-lockfile,--no-npm).vael:*andnode:*schemes are never intercepted byimports.
Strict JSONC Dialect
Section titled “Strict JSONC Dialect”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.
Schema Fields
Section titled “Schema Fields”Only name is required. Absent optional fields must be omitted; explicit null is rejected.
name (Required)
Section titled “name (Required)”- Must use
@scope/nameformat, total length<= 214bytes. - Scope and name are each
1..=213bytes of lowercase ASCII letters, digits,-,_, and., starting with a letter or digit, separated by a single/.
version
Section titled “version”- Optional exact SemVer string (e.g.,
1.2.3or1.2.3-alpha.1). Ranges and tags are rejected.
description & authors
Section titled “description & authors”description: optional string up to4,096bytes (only\t,\n,\rcontrol chars allowed).authors: optional array of up to64non-empty strings (1..=256bytes each, no leading/trailing whitespace). Order is preserved.
exports
Section titled “exports”- Single string or non-empty object mapping
.or./subpathkeys to./...targets ending in.ts,.mts,.js, or.mjs(max1,024entries; keys<= 512bytes, targets<= 1,024bytes). - Rejects
*,?,./..segments, escaping paths,.tsx,.jsx,.cts,.cjs,.d.ts, JSON, Wasm, conditional export objects, andnullexclusions. - No
mainfallback:"main"is explicitly rejected with a message pointing toexports.
imports
Section titled “imports”- Object mapping exact specifiers or trailing-
/prefixes to local paths or canonical schemes (max1,024entries; keys<= 1,024bytes, 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/], ornode:module/). - Bare targets (e.g.,
"react") andhttp:,data:,blob:targets are rejected.
Specifier Normalization Grammars
Section titled “Specifier Normalization Grammars”npm:[@scope/]name@version[/subpath]: Requires an explicit@versiontoken (^1.2.3,1.2.3,latest); complex ranges with spaces are rejected byvael.jsoncnormalization.jsr:@scope/name@version[/subpath]: Requires@scope/name(scope2..=20bytes, name2..=58bytes, lowercase ASCII/digits/-) and an explicit version token.gh:owner/repo@reference/path(andgithub:alias, plus legacygh:owner/repo/path/@reference): Normalizes tohttps://raw.githubusercontent.com/<owner>/<repo>/<ref>/<path>. Rejects\,%,?,#, empty/./..segments.
include & exclude
Section titled “include & exclude”- Optional arrays of up to
256relative glob strings (<= 1,024bytes each,/separators, no leading!negation). Syntax-checked only; reserved for future packaging steps.
workspaces
Section titled “workspaces”- Optional array of up to
256relative directory patterns (*,?,[...],**;{...}brace expansion is rejected). Workspace::loadexpands globs deterministically, checks canonical workspace-root containment on symlinks before descending, rejects missing member manifests, duplicate@scope/namenames, and nested workspaces, and indexes members forImportResolver.- Singular
"workspace"is explicitly rejected (deliberate incompatibility withdeno.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 insidedbare 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 invael.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"), andcaFile(requiresverifyFullTLS mode;tlsandtlsModemust not conflict). - Migration fields:
migrationsDir,table([a-z_][a-z0-9_]*,<= 55bytes),schema([a-z_][a-z0-9_]*,<= 63bytes),module,managedObjects(up to1,024tableorschema.tableentries),lockTimeoutMs(1..=i32::MAX),baselineVersion(1..=i64::MAX), andbindings(up to256uniquekey -> [a-z_][a-z0-9_]*identifier mappings).
Reserved Keys
Section titled “Reserved Keys”| 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 |
