@terajs/router-manifest
v1.0.5
Published
Route-manifest builders for Terajs.
Readme
@terajs/router-manifest
Route-manifest builders for Terajs.
Most applications reach this layer through @terajs/app, @terajs/app/vite, or @terajs/vite-plugin. Use @terajs/router-manifest directly when you are assembling routes in custom tooling, tests, or alternative build flows.
Install
npm install @terajs/router-manifestWhat it exports
inferPathFromFile(filePath)for converting.teraroute-file paths into route pathsbuildRouteFromSFC(parsedSfc)for turning a parsed SFC into aRouteDefinitionbuildRouteManifest(inputs, options?)for assembling an ordered route manifestRouteConfigInput,RouteManifestOptions, andRouteSourceInputtypes
Minimal example
import { buildRouteManifest } from "@terajs/router-manifest";
const routes = buildRouteManifest([
{
filePath: "/src/pages/index.tera",
source: `<template><h1>Hello</h1></template>`
}
]);Notes
- Route-path inference converts
[param].terasegments into:paramroute parameters. <route>overrides,meta, andaidata from parsed SFCs are preserved in the resulting route definitions.- This package is the direct route-manifest layer underneath the app-facing facade helpers.
