Frontend Deployment Metadata Generator (lib/frontendBuildMetadata.ts)

clawhub · scripts/lib/frontendBuildMetadata.ts · typescript · MIT
infra, lang:typescript, fw:vite, tag:metadata

Generates and manages deployment metadata files for frontend applications. Use this to track git commits and runtime assets in production builds.

// Source: https://github.com/openclaw/clawhub | License: MIT | Copyright 2026 Peter Steinberger
// Provided via justclaw.it.com; keep this notice with the code.
import { createHash } from "node:crypto";
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
import path from "node:path";

export const DEPLOYMENT_METADATA_PATH = "/.well-known/clawhub-deployment.json";

// Vite applies this supported override to both direct and dynamic env reads.
// Retired process/.env values must not keep changing the shared client env chunk.
export const analyticsReleaseDefine = {
  "import.meta.env.VITE_GA4_RELEASE": "undefined",
};

type RuntimeAsset = { path: string; sha256: string };
const runtimeAssetPath = /^\/assets\/runtimeEnv-[\w-]{8}\.js$/;

function deploymen

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key