release: WRNexusJS 0.5.0

This commit is contained in:
2026-07-29 12:51:10 +05:30
parent 76c768099d
commit 6afe32f63f
456 changed files with 40879 additions and 8850 deletions
+4 -8
View File
@@ -74,14 +74,10 @@ const components = readdirSync(componentsDir)
),
),
];
const events =
declaredEvents.length > 0
? declaredEvents
: (entry?.events ?? [
...new Set(
[...source.matchAll(/@([A-Za-z][A-Za-z0-9_-]*)=/g)].map((match) => match[1]),
),
]);
// Only `@event` declarations form the public component contract. Native
// handlers in a component's implementation are private wiring and must not
// leak into the generated consumer-facing reference.
const events = declaredEvents;
return {
name,
mount: name,
+24
View File
@@ -0,0 +1,24 @@
/* global console */
import { spawnSync } from "node:child_process";
import process from "node:process";
const root = process.cwd();
const bun = process.platform === "win32" ? "bun.exe" : "bun";
function run(command, args) {
console.log(`\n> ${command} ${args.join(" ")}`);
const result = spawnSync(command, args, {
cwd: root,
stdio: "inherit",
env: process.env,
});
if (result.error) throw result.error;
if (result.status !== 0) process.exit(result.status ?? 1);
}
run(process.execPath, ["scripts/verify-auth.mjs"]);
run(bun, ["run", "typecheck"]);
run(bun, ["test", "packages/auth"]);
run(bun, ["run", "--cwd", "examples/auth-showcase", "check"]);
console.log("\n✓ @wrnexus/auth validation passed.\n");
+43
View File
@@ -0,0 +1,43 @@
/* global console */
import { existsSync, readFileSync, readdirSync } from "node:fs";
import { join } from "node:path";
import process from "node:process";
const root = process.cwd();
const required = [
"packages/auth/package.json",
"packages/auth/src/engine.ts",
"packages/auth/src/plugin.ts",
"packages/auth/src/routes/api.ts",
"packages/auth/src/stores/memory.ts",
"packages/auth/src/stores/sql.ts",
"packages/auth/assets/client/auth.js",
"packages/auth/migrations/001_auth.sql",
"examples/auth-showcase/package.json",
];
for (const file of required) {
if (!existsSync(join(root, file))) throw new Error(`Missing authentication file: ${file}`);
}
const manifest = JSON.parse(readFileSync(join(root, "packages/auth/package.json"), "utf8"));
if (manifest.name !== "@wrnexus/auth") throw new Error("Invalid authentication package name");
if (manifest.version !== "0.5.0") throw new Error("Invalid authentication package version");
const components = readdirSync(join(root, "packages/auth/components")).filter((file) =>
file.endsWith(".wrn"),
);
if (components.length < 16)
throw new Error(`Expected at least 16 auth components, received ${components.length}`);
const plugin = readFileSync(join(root, "packages/auth/src/plugin.ts"), "utf8");
for (const expected of [
"clientRuntimes",
"routeEntries",
"middleware",
"migrations",
"devToolbarPanels",
]) {
if (!plugin.includes(expected)) throw new Error(`Auth plugin is missing ${expected}`);
}
const runtime = readFileSync(join(root, "packages/auth/assets/client/auth.js"), "utf8");
if (!runtime.includes("navigator.credentials")) throw new Error("Passkey runtime is incomplete");
if (runtime.includes("document.write"))
throw new Error("Passkey runtime contains unsafe document.write");
console.log(`@wrnexus/auth structural verification passed (${components.length} components).`);