fix: include UI style imports in package
This commit is contained in:
@@ -617,7 +617,7 @@
|
|||||||
},
|
},
|
||||||
"packages/ui": {
|
"packages/ui": {
|
||||||
"name": "@wrnexus/ui",
|
"name": "@wrnexus/ui",
|
||||||
"version": "0.8.12",
|
"version": "0.8.13",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@wrnexus/core": "workspace:*",
|
"@wrnexus/core": "workspace:*",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/ui",
|
"name": "@wrnexus/ui",
|
||||||
"version": "0.8.12",
|
"version": "0.8.13",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { createHash } from "node:crypto";
|
import { createHash } from "node:crypto";
|
||||||
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
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 {
|
export interface StagedFileIntegrity {
|
||||||
path: string;
|
path: string;
|
||||||
@@ -122,6 +122,15 @@ export function validateAndHashStage(
|
|||||||
if (highConfidenceSecret.test(source)) {
|
if (highConfidenceSecret.test(source)) {
|
||||||
throw new Error(`${name} staged content matching a high-confidence secret in ${path}.`);
|
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({
|
integrity.push({
|
||||||
path,
|
path,
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ const HOMEPAGE = "https://wrnexusjs.dev";
|
|||||||
const ASSETS: Record<string, string[]> = {
|
const ASSETS: Record<string, string[]> = {
|
||||||
"@wrnexus/ui": [
|
"@wrnexus/ui": [
|
||||||
"components",
|
"components",
|
||||||
|
"styles",
|
||||||
"ui.css",
|
"ui.css",
|
||||||
"component-catalog.json",
|
"component-catalog.json",
|
||||||
"component-migrations.json",
|
"component-migrations.json",
|
||||||
|
|||||||
@@ -89,6 +89,23 @@ try {
|
|||||||
writeFileSync(join(keyHandlingSource, "dist", "index.d.ts"), "export {};\n");
|
writeFileSync(join(keyHandlingSource, "dist", "index.d.ts"), "export {};\n");
|
||||||
validateAndHashStage(keyHandlingSource, manifest);
|
validateAndHashStage(keyHandlingSource, manifest);
|
||||||
|
|
||||||
|
const missingWrnImport = join(root, "missing-wrn-import");
|
||||||
|
mkdirSync(join(missingWrnImport, "dist"), { recursive: true });
|
||||||
|
mkdirSync(join(missingWrnImport, "components"), { recursive: true });
|
||||||
|
writeFileSync(join(missingWrnImport, "dist", "index.js"), "export {};\n");
|
||||||
|
writeFileSync(join(missingWrnImport, "dist", "index.d.ts"), "export {};\n");
|
||||||
|
writeFileSync(
|
||||||
|
join(missingWrnImport, "components", "Select.wrn"),
|
||||||
|
'import Styles from "../styles/SelectStyles.wrn"\ncomponent Select {}\n',
|
||||||
|
);
|
||||||
|
rejected = false;
|
||||||
|
try {
|
||||||
|
validateAndHashStage(missingWrnImport, manifest);
|
||||||
|
} catch {
|
||||||
|
rejected = true;
|
||||||
|
}
|
||||||
|
if (!rejected) throw new Error("Missing relative WRN import was not rejected.");
|
||||||
|
|
||||||
console.log("Package staging integrity probes passed.");
|
console.log("Package staging integrity probes passed.");
|
||||||
} finally {
|
} finally {
|
||||||
rmSync(root, { recursive: true, force: true });
|
rmSync(root, { recursive: true, force: true });
|
||||||
|
|||||||
Reference in New Issue
Block a user