fix: include UI style imports in package
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { createHash } from "node:crypto";
|
||||
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
||||
import { basename, join, relative } from "node:path";
|
||||
import { basename, dirname, join, relative, resolve } from "node:path";
|
||||
|
||||
export interface StagedFileIntegrity {
|
||||
path: string;
|
||||
@@ -122,6 +122,15 @@ export function validateAndHashStage(
|
||||
if (highConfidenceSecret.test(source)) {
|
||||
throw new Error(`${name} staged content matching a high-confidence secret in ${path}.`);
|
||||
}
|
||||
if (path.endsWith(".wrn")) {
|
||||
for (const match of source.matchAll(/\bfrom\s+["'](\.{1,2}\/[^"']+)["']/g)) {
|
||||
const target = resolve(dirname(file), match[1]!);
|
||||
const targetPath = relative(stage, target);
|
||||
if (targetPath.startsWith("..") || !existsSync(target)) {
|
||||
throw new Error(`${name} staged WRN import does not exist: ${path} -> ${match[1]}.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
integrity.push({
|
||||
path,
|
||||
|
||||
Reference in New Issue
Block a user