🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@site-index/vite-runtime

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@site-index/vite-runtime

Vite-backed runtime for executing site-index pipelines.

latest
Source
npmnpm
Version
0.1.5
Version published
Weekly downloads
587
Maintainers
1
Weekly downloads
 
Created
Source

@site-index/vite-runtime

Vite-backed runtime for executing site-index pipelines through Vite SSR module loading.

npm version Code Quality Code Coverage Socket

Repository README

Install

npm install @site-index/vite-runtime

Requirements:

  • Node.js >=22
  • peer dependency: vite ^8.0.10

When to use

Use this package when building adapters or integrations that need direct Vite-backed pipeline execution.

When not to use

Public exports

export { createRuntimeService } from "./domains/runtime/factory.js";
export { RuntimeServiceBuilder } from "./domains/runtime/builder.js";
export { RuntimeService } from "./domains/runtime/service.js";
export type { Options, RuntimeViteConfig } from "./types.js";

Public API

Factory:

createRuntimeService(): RuntimeServiceBuilder

Builder:

class RuntimeServiceBuilder {
  withOptions(options: Options): this;
  withViteConfig(config: RuntimeViteConfig): this;
  withViteServer(server: Vite.ViteDevServer): this;
  build(): RuntimeService;
}

Runtime service:

class RuntimeService {
  buildArtifacts(): Promise<SiteIndex.Result<SiteIndex.Artifact[]>>;
  getArtifacts(): readonly SiteIndex.Artifact[];
  getWatchedFiles(): ReadonlySet<string>;
  close(): Promise<void>;
}

Options:

type Options = Pick<SiteIndex.Options, "siteUrl" | "extensions">;

Runtime Vite config:

type RuntimeViteConfig = {
  root: Vite.ResolvedConfig["root"];
  mode: Vite.ResolvedConfig["mode"];
  configFile?: Vite.ResolvedConfig["configFile"];
};

Behavior

  • uses Vite SSR loading for executing discovered site-index modules
  • can run with an existing Vite dev server
  • can create its own middleware-mode Vite server from config
  • tracks watched files through Vite's SSR module graph
  • serializes buildArtifacts() calls through an internal queue
  • snapshots latest artifacts and watched files
  • clears snapshots and closes internally created server resources on close()
  • does not close externally provided Vite dev servers

Example

import { createRuntimeService } from "@site-index/vite-runtime";

const runtime = createRuntimeService()
  .withOptions({
    siteUrl: "https://example.com",
  })
  .withViteConfig({
    root: process.cwd(),
    mode: "production",
  })
  .build();

try {
  const result = await runtime.buildArtifacts();
  // use result.data and result.warnings
} finally {
  await runtime.close();
}

Keywords

site-index

FAQs

Package last updated on 15 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts