Skip to content
Standard library

velt/package#

import type { Package } from "velt/package". The type of the package manifest, package.vlt, and of the workspace manifest, velt.workspace.vlt. The module contains only types; nothing imports it at run time.

ts
import type { Package } from "velt/package";

export const pkg: Package = {
  name: "todo-api",
  version: "0.3.0",
  velt: "0.1",
  dependencies: { sqlite: "^0.1", util: { path: "../util" } },
  paths: { "@app/*": "src/*" },
};

velt never compiles package.vlt: it reads it as data. The language server does the same, so the editor's completion, hover and errors in a manifest come from the manifest's rules, not from type-checking the file; these types document the same fields (a test keeps them in line).

TypeWhat it describes
Packagethe manifest: name, version, and the optional velt, description, keywords, entry, registry, dependencies, paths, jsx, define, native, tsCompat, build
Dependencystring (a semver requirement, or "workspace" in a workspace member) or a DependencySource
DependencySource{ version?: string; path?: string; git?: string; branch?: string; tag?: string; rev?: string }
Jsx{ importSource?: string }
Native{ path?: string; targets?: string[]; wasm?: boolean }
Build{ cpu?: string } (CPU)
Workspacea velt.workspace.vlt: members (globs), and the optional velt, registry, dependencies the members share (workspaces)

The fields and their rules are in package.vlt.

Edit this page on GitHub