Lines 204-244javascript
206import path3 from "path";
207import { pathToFileURL } from "url";
208import { createJiti } from "jiti";
209import { z as z3 } from "zod";
210var commandSchema = z3.union([z3.string().min(1), z3.array(z3.string().min(1))]);
211var uiReviewConfigSchema = z3.object({
212 install: commandSchema.optional(),
213 setup: commandSchema.optional(),
214 start: z3.string().min(1),
215 ready: z3.string().url(),
216 stop: commandSchema.optional(),
217 timeoutMs: z3.number().int().positive().default(12e4)
219function defineConfig(config) {
222async function loadConfig(cwd, configPath) {
223 const absolutePath = path3.resolve(cwd, configPath ?? "revuiw.config.ts");
224 const jiti = createJiti(pathToFileURL(import.meta.url).href);
225 const loaded = await jiti.import(absolutePath, { default: true });
226 return uiReviewConfigSchema.parse(loaded);
MediumDynamic Require
Package source references dynamic require/import behavior.
dist/chunk-TY5FUPRN.jsView on unpkg · L224 230import { mkdir, writeFile as writeFile2 } from "fs/promises";
231import path4 from "path";
234import { spawn as spawn2 } from "child_process";
235import { createWriteStream } from "fs";
236async function runCommand(command, cwd, logPath) {
237 const running = startCommand(command, cwd, logPath, true);
238 await running.completion.finally(() => running.log.end());
240function startCommand(command, cwd, logPath, inheritOutput = false) {
241 const log = createWriteStream(logPath, { flags: "a" });