veryfront/platform

Import

TypeScript
import {  createDependencySnapshotStoreHandle,  createEscapeBuffer,  createFileSystem,  createFSAdapter,  createInMemoryHostRuntime,  createKVStore,} from "veryfront/platform";

Examples

Inspect the current runtime

TypeScript
import { getOsType, getRuntimeVersion } from "veryfront/platform"; console.log(`${getOsType()} ${getRuntimeVersion()}`);

Pin project dependencies

TypeScript
import { VeryfrontApiClient } from "veryfront/platform"; const client = new VeryfrontApiClient({  apiBaseUrl: "https://api.veryfront.com",  apiToken: "<API_KEY>",  projectSlug: "<PROJECT_SLUG>",}); const { pins, persisted, skipped } = await client.dependencies.resolve({  specifiers: ["react@^19", "zod"],  branch: "main",});console.log(pins, persisted, skipped); await client.initialize();const history = await client.dependencies.getHistory({ branch: "main" });console.log(history.entries.length);

Read the files an environment serves

TypeScript
import { VeryfrontApiClient } from "veryfront/platform"; const client = new VeryfrontApiClient({  apiBaseUrl: "https://api.veryfront.com",  apiToken: "<API_KEY>",  projectSlug: "<PROJECT_SLUG>",}); const files = await client.listAllEnvironmentFiles("production");console.log(files.map((file) => file.path)); const page = await client.getEnvironmentFile("production", "app/page.tsx");console.log(page.release_version); const lookup = await client.lookupProjectByDomain("www.example.com");console.log(lookup?.project_slug, lookup?.environment?.name);

Exports

Functions

NameDescriptionSource
createDependencySnapshotStoreHandleCapture a provider for RuntimeAdapter without placing its methods in renderer state.source
createEscapeBufferCreate an escape sequence buffer.source
createFileSystemCreate the runtime-native filesystem implementation.source
createFSAdaptersource
createInMemoryHostRuntimeThe test adapter: an isolated env map, a fixed cwd and argv, recorded exits, and signal subscribers a test fires with emitSignal. Two instances never share state, and nothing here reads or writes the real process.source
createKVStoreCreate a cross-runtime KV store.source
createMockAdaptersource
cwdReturn the current working directory.source
enhanceAdapterWithFSsource
execPathGet the executable path of the current runtimesource
existsReturn false for a missing path and propagate every other filesystem error.source
getArgsGet command-line arguments (cross-runtime: Deno.args or process.argv).source
getEnvRead an environment variable from the active project scope.source
getOsTypeGet the operating system type Returns: "darwin" (macOS), "linux", "windows", or the raw platform stringsource
getRuntimeVersionGet runtime version stringsource
getStdinReaderGet a reader for stdin (for raw mode character reading) Returns an object with read() and releaseLock() methodssource
getStdoutGet stdout stream for writing Returns null if not available (e.g., in browser/workers)source
getTerminalSizeGet terminal size (columns and rows) Returns default fallback values if terminal size cannot be determinedsource
isExtendedFSAdaptersource
isHostExitReturn whether a value is an exit raised by an in-memory host.source
isInteractiveCheck if stdin is a TTY (terminal)source
isNotFoundErrorsource
isStdoutTTYCheck if stdout is a TTY (terminal)source
lookupMimeTypesource
mkdirCreate a directory.source
promptSyncSynchronous prompt function that works across Deno and Bun. Displays a message and reads user input from stdin.source
readDirRead directory entries.source
readStdinByteSyncRead a single byte from stdin synchronously. Requires raw mode to be enabled for character-by-character reading. Returns null on EOF or if stdin is not available.source
readStdinLineRead one line from stdin and release the reader when complete.source
readTextFileRead a file as text.source
removeRemove a file or directory, rejecting when the path does not exist.source
resolveHostAddressessource
setRawModeSet raw mode on stdin (enables character-by-character input)source
writeStdoutWrite text directly to stdout (sync) No-op if stdout is not availablesource
writeStdoutAsyncWrite data to stdout asynchronously Returns a promise that resolves when the write is completesource
writeTextFileWrite text to a file.source

Classes

NameDescriptionSource
HostExitThrown by an in-memory host's exit so the calling code stops where the real process would have ended. Identify it with isHostExit.source
MemoryKvsource
VeryfrontApiClientTyped client for the Veryfront API. dependencies.getHistory() and dependencies.resolve() read and pin a project's npm dependencies; readDependencyMetadataHistory() is a deprecated alias of dependencies.getHistory(). styleArtifacts.get(), styleArtifacts.update() and styleArtifacts.startBuild() manage the compiled-CSS record that the Veryfront runtime uses; resolveStyleArtifact(), upsertStyleArtifact() and ensureStyleArtifactBuild() are their deprecated aliases. listReleaseFiles(), listAllReleaseFiles() and getReleaseFile() read the files a release pins; the release is an ID, a version or latest, and the results keep their snake_case fields. startReleaseAssetManifestBuild(), writeReleaseAsset(), writeReleaseAssetManifest() and updateReleaseAssetManifestState() build a release's asset manifest; beginReleaseAssetManifestBuild(), uploadReleaseAsset(), putReleaseAssetManifest() and reportReleaseAssetManifestState() are their deprecated aliases. listEnvironmentFiles(), listAllEnvironmentFiles() and getEnvironmentFile() read the files an environment serves, addressed by environment name; lookupProjectByDomain() finds the project and environment behind a custom domain. See https://veryfront.com/docs/cloud/apis/environments.source
VeryfrontFSAdaptersource

Types

NameDescriptionSource
CommandResultsource
DependencyMetadataHistorysource
DependencyMetadataHistoryEntrysource
DependencyResolutionResult of client.dependencies.resolve(). A requested package that is in neither pins nor skipped did not resolve (unknown package or registry failure) and was not written.source
DependencySkipReasonWhy a requested package was not written to package.json.source
DependencySnapshotRecordSerialized immutable snapshot and its acknowledged retention deadline.source
DependencySnapshotStoreHost-owned shared snapshot storage. Implementations must authorize access, bound reads to 1 MiB, and reject publication unless retention is acknowledged. A node-local cache does not satisfy this capability for replicated runtimes.source
DependencySnapshotStoreHandleOpaque host storage reference. It exposes no privileged read or publish methods.source
FileSystemRuntime-neutral filesystem contract.source
GetDependencyHistoryInputInput for client.dependencies.getHistory().source
GetStyleArtifactInputInput for client.styleArtifacts.get().source
HostRuntimeThe process a unit of framework code runs in, as seen by that code.source
HostRuntimeEnvEnvironment access through a host. Structurally a superset of EnvironmentAdapter in platform/adapters/base.ts, so a host env satisfies that contract too.source
HostSignalSignals a host can deliver to a subscriber.source
InMemoryHostRuntimeThe in-memory adapter, with the hooks a test needs to observe and drive it.source
InMemoryHostRuntimeInitInitial state for createInMemoryHostRuntime. Everything is optional.source
ResolveDependenciesInputInput for client.dependencies.resolve().source
ResolveHostAddressesOptionssource
RuntimeAdapterCore runtime adapter interfacesource
StartStyleArtifactBuildInputInput for client.styleArtifacts.startBuild().source
StdinReaderStdin reader interface for cross-runtime compatibilitysource
StyleArtifactCurrent compiled-CSS record for one style profile and one branch, environment or release. A missing record has status: "missing".source
StyleArtifactSelectorSelects the style artifact record. Set exactly one of branch, environmentName or releaseId. The type does not enforce this: the API rejects any other combination with a validation error.source
UpdateStyleArtifactInputInput for client.styleArtifacts.update().source
VeryfrontApiDependenciesDependency operations of a VeryfrontApiClient.source
VeryfrontApiStyleArtifactsStyle artifact operations of a VeryfrontApiClient. A style artifact is the compiled-CSS record for one style profile and one branch, environment or release. The Veryfront runtime uses these operations; the project reference defaults to the client's project.source

Constants

NameDescriptionSource
isDenoTrue if running in the real Deno runtime rather than a dnt shim.source

Deep imports

These import paths group focused functionality under this module. Each is a separate barrel; import only what you need.

veryfront/platform/env

Public environment facade for the veryfront/platform/env subpath. Exposes only project-scoped readers. Privileged or mutating accessors (getHostEnv, env, setEnv, deleteEnv) stay internal so a tenant project cannot read or alter the host process environment through a supported package export.

TypeScript
import { getEnv, getEnvBoolean, getEnvNumber } from "veryfront/platform/env";

Functions

NameDescriptionSource
getEnvRead an environment variable from the active project scope.source
getEnvBooleansource
getEnvNumbersource
getEnvStringsource

Types

NameDescriptionSource
EnvBooleanOptionssource

veryfront/platform/path

Compat - Path

TypeScript
import { basename, dirname, extname } from "veryfront/platform/path";

Components

NameDescriptionSource
SEPARATORsource

Functions

NameDescriptionSource
basenameReturn the last path segment.source
dirnameReturn the parent directory path.source
extnameReturn the file extension for a path.source
formatsource
fromFileUrlConvert a file URL to a runtime-native filesystem path.source
isAbsolutesource
joinJoin and normalize path segments using their detected path flavor.source
normalizesource
parsesource
relativesource
resolveResolve path segments to an absolute, normalized path.source
toFileUrlsource
validatePathSecuritysource

Types

NameDescriptionSource
NodePathModulesource
PathObjectsource
PosixPathDependency-free POSIX path operations for every supported runtime.source

Constants

NameDescriptionSource
delimitersource
hasNodePathsource
isDenosource
nodePathsource
posixsource
sepsource