Lines 138-178javascript
140import path2 from "path";
141import { pathToFileURL } from "url";
142import { createJiti } from "jiti";
143import { z as z3 } from "zod";
144var commandSchema = z3.union([z3.string().min(1), z3.array(z3.string().min(1))]);
145var uiReviewConfigSchema = z3.object({
146 install: commandSchema.optional(),
147 setup: commandSchema.optional(),
148 start: z3.string().min(1),
149 ready: z3.string().url(),
150 stop: commandSchema.optional(),
151 timeoutMs: z3.number().int().positive().default(12e4)
153function defineConfig(config) {
156async function loadConfig(cwd, configPath) {
157 const absolutePath = path2.resolve(cwd, configPath ?? "revuiw.config.ts");
158 const jiti = createJiti(pathToFileURL(import.meta.url).href);
159 const loaded = await jiti.import(absolutePath, { default: true });
160 return uiReviewConfigSchema.parse(loaded);
MediumDynamic Require
Package source references dynamic require/import behavior.
dist/chunk-GWWOWMK3.jsView on unpkg · L158 164import { mkdir, writeFile as writeFile2 } from "fs/promises";
165import path3 from "path";
168import { spawn as spawn2 } from "child_process";
169import { createWriteStream } from "fs";
170async function runCommand(command, cwd, logPath) {
171 const running = startCommand(command, cwd, logPath, true);
172 await running.completion.finally(() => running.log.end());
174function startCommand(command, cwd, logPath, inheritOutput = false) {
175 const log = createWriteStream(logPath, { flags: "a" });