From c6fc0f1f637ef5e3cf3d603fb0f3c442cd174448 Mon Sep 17 00:00:00 2001 From: Ajay Ghanwat Date: Wed, 22 Jul 2026 01:53:18 +0530 Subject: [PATCH] release: WRNexusJS 0.2.78 --- .publish/ai/package.json | 2 +- .publish/authz/package.json | 2 +- .publish/cli/package.json | 22 ++++++------ .publish/compiler/package.json | 2 +- .publish/core/package.json | 2 +- .publish/csr/package.json | 4 +-- .publish/db/package.json | 2 +- .publish/dev-server/package.json | 28 +++++++-------- .publish/dev-toolbar/package.json | 2 +- .publish/encryption/package.json | 2 +- .publish/helpers/package.json | 4 +-- .publish/i18n/package.json | 4 +-- .publish/jwt/package.json | 2 +- .publish/mobile/package.json | 4 +-- .publish/native/package.json | 2 +- .publish/oauth/package.json | 2 +- .publish/pubsub/package.json | 2 +- .publish/queue/package.json | 2 +- .publish/reactive/package.json | 2 +- .publish/router/package.json | 6 ++-- .publish/ssr/package.json | 4 +-- .publish/styles/package.json | 4 +-- .publish/test/package.json | 2 +- .publish/tracking/package.json | 2 +- .publish/ui/package.json | 4 +-- .publish/uploader/package.json | 4 +-- .publish/validation/package.json | 2 +- packages/ai/package.json | 2 +- packages/authz/package.json | 2 +- packages/cli/package.json | 2 +- packages/cli/src/update.ts | 31 ++++++++++++++--- packages/cli/test/update.test.ts | 20 ++++++++++- packages/compiler/package.json | 2 +- packages/compiler/src/codegen.ts | 46 ++++++++++++++++++++++++- packages/compiler/test/compiler.test.ts | 27 +++++++++++++++ packages/core/package.json | 2 +- packages/csr/package.json | 2 +- packages/db/package.json | 2 +- packages/dev-server/package.json | 2 +- packages/dev-toolbar/package.json | 2 +- packages/encryption/package.json | 2 +- packages/helpers/package.json | 2 +- packages/i18n/package.json | 2 +- packages/jwt/package.json | 2 +- packages/mobile/package.json | 2 +- packages/native/package.json | 2 +- packages/oauth/package.json | 2 +- packages/pubsub/package.json | 2 +- packages/queue/package.json | 2 +- packages/reactive/package.json | 2 +- packages/router/package.json | 2 +- packages/ssr/package.json | 2 +- packages/styles/package.json | 2 +- packages/test/package.json | 2 +- packages/tracking/package.json | 2 +- packages/ui/package.json | 2 +- packages/uploader/package.json | 2 +- packages/validation/package.json | 2 +- scripts/publish-packages.ts | 24 ++++++++++++- update-package-versions.mjs | 2 +- 60 files changed, 228 insertions(+), 96 deletions(-) diff --git a/.publish/ai/package.json b/.publish/ai/package.json index f801aaf4..9a6f0303 100644 --- a/.publish/ai/package.json +++ b/.publish/ai/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/ai", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "Zero-dependency Claude (Anthropic) client for WrNexus apps.", "license": "MIT", diff --git a/.publish/authz/package.json b/.publish/authz/package.json index 58a4bc89..6b40e911 100644 --- a/.publish/authz/package.json +++ b/.publish/authz/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/authz", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/authz — part of the WrNexus framework.", "license": "MIT", diff --git a/.publish/cli/package.json b/.publish/cli/package.json index 03870f73..d23754ed 100644 --- a/.publish/cli/package.json +++ b/.publish/cli/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/cli", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/cli — part of the WrNexus framework.", "license": "MIT", @@ -28,16 +28,16 @@ "wrnexus": "./dist/index.js" }, "dependencies": { - "@wrnexus/core": "^0.2.77", - "@wrnexus/router": "^0.2.77", - "@wrnexus/csr": "^0.2.77", - "@wrnexus/compiler": "^0.2.77", - "@wrnexus/styles": "^0.2.77", - "@wrnexus/dev-server": "^0.2.77", - "@wrnexus/ui": "^0.2.77", - "@wrnexus/validation": "^0.2.77", - "@wrnexus/i18n": "^0.2.77", - "@wrnexus/db": "^0.2.77" + "@wrnexus/core": "^0.2.78", + "@wrnexus/router": "^0.2.78", + "@wrnexus/csr": "^0.2.78", + "@wrnexus/compiler": "^0.2.78", + "@wrnexus/styles": "^0.2.78", + "@wrnexus/dev-server": "^0.2.78", + "@wrnexus/ui": "^0.2.78", + "@wrnexus/validation": "^0.2.78", + "@wrnexus/i18n": "^0.2.78", + "@wrnexus/db": "^0.2.78" }, "files": [ "dist" diff --git a/.publish/compiler/package.json b/.publish/compiler/package.json index e735abd1..8e384727 100644 --- a/.publish/compiler/package.json +++ b/.publish/compiler/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/compiler", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/compiler — part of the WrNexus framework.", "license": "MIT", diff --git a/.publish/core/package.json b/.publish/core/package.json index 849e2784..a58c03d5 100644 --- a/.publish/core/package.json +++ b/.publish/core/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/core", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/core — part of the WrNexus framework.", "license": "MIT", diff --git a/.publish/csr/package.json b/.publish/csr/package.json index 90f84eb9..2372e414 100644 --- a/.publish/csr/package.json +++ b/.publish/csr/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/csr", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/csr — part of the WrNexus framework.", "license": "MIT", @@ -21,7 +21,7 @@ } }, "dependencies": { - "@wrnexus/core": "^0.2.77" + "@wrnexus/core": "^0.2.78" }, "files": [ "dist" diff --git a/.publish/db/package.json b/.publish/db/package.json index 621f8a42..bd049bd1 100644 --- a/.publish/db/package.json +++ b/.publish/db/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/db", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/db — part of the WrNexus framework.", "license": "MIT", diff --git a/.publish/dev-server/package.json b/.publish/dev-server/package.json index 721ffa08..64995dd3 100644 --- a/.publish/dev-server/package.json +++ b/.publish/dev-server/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/dev-server", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/dev-server — part of the WrNexus framework.", "license": "MIT", @@ -25,19 +25,19 @@ } }, "dependencies": { - "@wrnexus/core": "^0.2.77", - "@wrnexus/dev-toolbar": "^0.2.77", - "@wrnexus/router": "^0.2.77", - "@wrnexus/ssr": "^0.2.77", - "@wrnexus/csr": "^0.2.77", - "@wrnexus/compiler": "^0.2.77", - "@wrnexus/styles": "^0.2.77", - "@wrnexus/ui": "^0.2.77", - "@wrnexus/validation": "^0.2.77", - "@wrnexus/i18n": "^0.2.77", - "@wrnexus/db": "^0.2.77", - "@wrnexus/pubsub": "^0.2.77", - "@wrnexus/uploader": "^0.2.77" + "@wrnexus/core": "^0.2.78", + "@wrnexus/dev-toolbar": "^0.2.78", + "@wrnexus/router": "^0.2.78", + "@wrnexus/ssr": "^0.2.78", + "@wrnexus/csr": "^0.2.78", + "@wrnexus/compiler": "^0.2.78", + "@wrnexus/styles": "^0.2.78", + "@wrnexus/ui": "^0.2.78", + "@wrnexus/validation": "^0.2.78", + "@wrnexus/i18n": "^0.2.78", + "@wrnexus/db": "^0.2.78", + "@wrnexus/pubsub": "^0.2.78", + "@wrnexus/uploader": "^0.2.78" }, "files": [ "dist" diff --git a/.publish/dev-toolbar/package.json b/.publish/dev-toolbar/package.json index c901fe7b..5325f55f 100644 --- a/.publish/dev-toolbar/package.json +++ b/.publish/dev-toolbar/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/dev-toolbar", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/dev-toolbar — part of the WrNexus framework.", "license": "MIT", diff --git a/.publish/encryption/package.json b/.publish/encryption/package.json index c1a7acc9..142d41bd 100644 --- a/.publish/encryption/package.json +++ b/.publish/encryption/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/encryption", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/encryption — part of the WrNexus framework.", "license": "MIT", diff --git a/.publish/helpers/package.json b/.publish/helpers/package.json index bf26905e..8daa63ee 100644 --- a/.publish/helpers/package.json +++ b/.publish/helpers/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/helpers", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "Safe convenience helpers for WrNexus request contexts and common application flows.", "license": "MIT", @@ -21,7 +21,7 @@ } }, "dependencies": { - "@wrnexus/core": "^0.2.77" + "@wrnexus/core": "^0.2.78" }, "files": [ "dist" diff --git a/.publish/i18n/package.json b/.publish/i18n/package.json index 44e3f9f7..5db6cc74 100644 --- a/.publish/i18n/package.json +++ b/.publish/i18n/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/i18n", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/i18n — part of the WrNexus framework.", "license": "MIT", @@ -21,7 +21,7 @@ } }, "dependencies": { - "@wrnexus/core": "^0.2.77" + "@wrnexus/core": "^0.2.78" }, "files": [ "dist" diff --git a/.publish/jwt/package.json b/.publish/jwt/package.json index 0ee96555..a9ea4ac8 100644 --- a/.publish/jwt/package.json +++ b/.publish/jwt/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/jwt", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/jwt — part of the WrNexus framework.", "license": "MIT", diff --git a/.publish/mobile/package.json b/.publish/mobile/package.json index 1808fb0c..7b8d36ac 100644 --- a/.publish/mobile/package.json +++ b/.publish/mobile/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/mobile", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/mobile — part of the WrNexus framework.", "license": "MIT", @@ -21,7 +21,7 @@ } }, "dependencies": { - "@wrnexus/native": "^0.2.77" + "@wrnexus/native": "^0.2.78" }, "files": [ "dist" diff --git a/.publish/native/package.json b/.publish/native/package.json index ded164b2..0be51423 100644 --- a/.publish/native/package.json +++ b/.publish/native/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/native", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/native — part of the WrNexus framework.", "license": "MIT", diff --git a/.publish/oauth/package.json b/.publish/oauth/package.json index e6298d54..4e1501e9 100644 --- a/.publish/oauth/package.json +++ b/.publish/oauth/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/oauth", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/oauth — part of the WrNexus framework.", "license": "MIT", diff --git a/.publish/pubsub/package.json b/.publish/pubsub/package.json index c2383458..41a0e2a7 100644 --- a/.publish/pubsub/package.json +++ b/.publish/pubsub/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/pubsub", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/pubsub — part of the WrNexus framework.", "license": "MIT", diff --git a/.publish/queue/package.json b/.publish/queue/package.json index 4423f6e6..3833b202 100644 --- a/.publish/queue/package.json +++ b/.publish/queue/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/queue", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/queue — part of the WrNexus framework.", "license": "MIT", diff --git a/.publish/reactive/package.json b/.publish/reactive/package.json index cd3a6151..79585d07 100644 --- a/.publish/reactive/package.json +++ b/.publish/reactive/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/reactive", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/reactive — part of the WrNexus framework.", "license": "MIT", diff --git a/.publish/router/package.json b/.publish/router/package.json index 4f25c087..b7801f02 100644 --- a/.publish/router/package.json +++ b/.publish/router/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/router", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/router — part of the WrNexus framework.", "license": "MIT", @@ -21,8 +21,8 @@ } }, "dependencies": { - "@wrnexus/compiler": "^0.2.77", - "@wrnexus/core": "^0.2.77" + "@wrnexus/compiler": "^0.2.78", + "@wrnexus/core": "^0.2.78" }, "files": [ "dist" diff --git a/.publish/ssr/package.json b/.publish/ssr/package.json index e6e1e6f4..6b137bb7 100644 --- a/.publish/ssr/package.json +++ b/.publish/ssr/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/ssr", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/ssr — part of the WrNexus framework.", "license": "MIT", @@ -21,7 +21,7 @@ } }, "dependencies": { - "@wrnexus/core": "^0.2.77" + "@wrnexus/core": "^0.2.78" }, "files": [ "dist" diff --git a/.publish/styles/package.json b/.publish/styles/package.json index 870dccf6..cd26e784 100644 --- a/.publish/styles/package.json +++ b/.publish/styles/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/styles", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/styles — part of the WrNexus framework.", "license": "MIT", @@ -21,7 +21,7 @@ } }, "dependencies": { - "@wrnexus/uploader": "^0.2.77" + "@wrnexus/uploader": "^0.2.78" }, "files": [ "dist" diff --git a/.publish/test/package.json b/.publish/test/package.json index d9650f1a..0e2ff6cf 100644 --- a/.publish/test/package.json +++ b/.publish/test/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/test", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/test — part of the WrNexus framework.", "license": "MIT", diff --git a/.publish/tracking/package.json b/.publish/tracking/package.json index 20753a77..fb9a440f 100644 --- a/.publish/tracking/package.json +++ b/.publish/tracking/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/tracking", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/tracking — part of the WrNexus framework.", "license": "MIT", diff --git a/.publish/ui/package.json b/.publish/ui/package.json index 9feb8abc..938e690f 100644 --- a/.publish/ui/package.json +++ b/.publish/ui/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/ui", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/ui — part of the WrNexus framework.", "license": "MIT", @@ -25,7 +25,7 @@ "./ui.css": "./ui.css" }, "dependencies": { - "@wrnexus/core": "^0.2.77" + "@wrnexus/core": "^0.2.78" }, "files": [ "dist", diff --git a/.publish/uploader/package.json b/.publish/uploader/package.json index 0491323d..c755b08b 100644 --- a/.publish/uploader/package.json +++ b/.publish/uploader/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/uploader", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/uploader — part of the WrNexus framework.", "license": "MIT", @@ -21,7 +21,7 @@ } }, "dependencies": { - "@wrnexus/core": "^0.2.77" + "@wrnexus/core": "^0.2.78" }, "files": [ "dist" diff --git a/.publish/validation/package.json b/.publish/validation/package.json index 488d833e..17887e97 100644 --- a/.publish/validation/package.json +++ b/.publish/validation/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/validation", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "description": "@wrnexus/validation — part of the WrNexus framework.", "license": "MIT", diff --git a/packages/ai/package.json b/packages/ai/package.json index 9ac8bbb1..df04223c 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/ai", - "version": "0.2.77", + "version": "0.2.78", "private": true, "type": "module", "description": "Zero-dependency Claude (Anthropic) client for WrNexus apps.", diff --git a/packages/authz/package.json b/packages/authz/package.json index 2abfe54c..6d7b9aa7 100644 --- a/packages/authz/package.json +++ b/packages/authz/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/authz", - "version": "0.2.77", + "version": "0.2.78", "private": true, "type": "module", "main": "src/index.ts", diff --git a/packages/cli/package.json b/packages/cli/package.json index 531563bc..6e985324 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/cli", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "main": "src/index.ts", "exports": { diff --git a/packages/cli/src/update.ts b/packages/cli/src/update.ts index 0fd49be1..5758b2eb 100644 --- a/packages/cli/src/update.ts +++ b/packages/cli/src/update.ts @@ -767,6 +767,14 @@ const MIGRATIONS: Migration[] = [ // Language and shared UI behavior improve automatically after updating. }, }, + { + version: "0.2.78", + id: "ui-components-fix", + description: "Dev toolbar for optimization and developer.", + apply() { + // Language and shared UI behavior improve automatically after updating. + }, + }, ]; /** Release tooling uses this to require an explicit migration entry per version. */ @@ -893,6 +901,20 @@ export function updateApp(appRoot: string, target: string, dryRun: boolean): Upd return { root: appRoot, packagePath: pkgPath, pkg }; } +export function verificationCommands(scripts: Record): string[][] { + const commands: string[][] = []; + + // Update migrations can rewrite TypeScript, JSON, and framework configuration + // files. Normalize those edits with the project's own formatter before running + // the read-only format check. This prevents a successful migration from failing + // only because wrnexus.config.ts or another touched file needs Prettier output. + if (scripts.format) commands.push(["run", "format"]); + if (scripts.check) commands.push(["run", "check"]); + if (scripts.build) commands.push(["run", "build"]); + + return commands; +} + function verifyApp(app: UpdatedApp): boolean { const health = inspectProject(app.root); const failed = health.filter((check) => !check.ok && check.name !== "configuration"); @@ -900,12 +922,11 @@ function verifyApp(app: UpdatedApp): boolean { for (const check of failed) console.error(` ✗ ${check.name}: ${check.detail}`); return false; } + const scripts = (app.pkg.scripts ?? {}) as Record; - const commands: string[][] = []; - if (scripts.check) commands.push(["run", "check"]); - if (scripts.build) commands.push(["run", "build"]); - for (const args of commands) { - console.log(`\n Verifying ${app.pkg.name ?? app.root}: bun ${args.join(" ")}…`); + for (const args of verificationCommands(scripts)) { + const action = args[1] === "format" ? "Formatting" : "Verifying"; + console.log(`\n ${action} ${app.pkg.name ?? app.root}: bun ${args.join(" ")}…`); const result = spawnSync(process.execPath, args, { cwd: app.root, stdio: "inherit" }); if (result.status !== 0) return false; } diff --git a/packages/cli/test/update.test.ts b/packages/cli/test/update.test.ts index 2e152a00..5468055a 100644 --- a/packages/cli/test/update.test.ts +++ b/packages/cli/test/update.test.ts @@ -2,7 +2,7 @@ import { expect, test } from "bun:test"; import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { updateApp } from "../src/update.ts"; +import { updateApp, verificationCommands } from "../src/update.ts"; test("updateApp migrates project files without marking an unverified update complete", () => { const root = mkdtempSync(join(tmpdir(), "wrnexus-update-")); @@ -150,3 +150,21 @@ test("0.2.20 migration repairs only the legacy generated recommendations layout" rmSync(root, { recursive: true, force: true }); } }); + +test("update verification formats before checking and building", () => { + expect( + verificationCommands({ + format: "prettier . --write", + check: "bun run lint && bun run format:check", + build: "wrnexus build .", + }), + ).toEqual([ + ["run", "format"], + ["run", "check"], + ["run", "build"], + ]); +}); + +test("update verification skips unavailable scripts", () => { + expect(verificationCommands({ check: "bun run lint" })).toEqual([["run", "check"]]); +}); diff --git a/packages/compiler/package.json b/packages/compiler/package.json index 74d42dce..5d2654b0 100644 --- a/packages/compiler/package.json +++ b/packages/compiler/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/compiler", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "main": "src/index.ts", "exports": { diff --git a/packages/compiler/src/codegen.ts b/packages/compiler/src/codegen.ts index dd6d776c..110e892c 100644 --- a/packages/compiler/src/codegen.ts +++ b/packages/compiler/src/codegen.ts @@ -1144,6 +1144,50 @@ function serverLoopLocalsAttribute(ctx: CompCtx): string { return ` data-wrn-loop-locals="\${__wrnexusEncodeLoopLocals({ ${entries} })}"`; } +function unwrapDirectiveExpression(raw: string): string { + const value = raw.trim(); + + if (!value.startsWith("{") || !value.endsWith("}")) { + return value; + } + + let depth = 0; + let quote: '"' | "'" | "`" | null = null; + let escaped = false; + + for (let index = 0; index < value.length; index++) { + const char = value[index]!; + + if (escaped) { + escaped = false; + continue; + } + + if (quote) { + if (char === "\\") { + escaped = true; + } else if (char === quote) { + quote = null; + } + continue; + } + + if (char === '"' || char === "'" || char === "`") { + quote = char; + continue; + } + + if (char === "{") depth++; + if (char === "}") depth--; + + if (depth === 0 && index < value.length - 1) { + return value; + } + } + + return depth === 0 ? value.slice(1, -1).trim() : value; +} + /** Render a component view node into template-literal-ready source. */ function renderComponentNode(node: ViewNode, ctx: CompCtx): string { if (node.type === "text") return compileText(node.value, ctx); @@ -1185,7 +1229,7 @@ function renderComponentNode(node: ViewNode, ctx: CompCtx): string { if (!attr.event && attr.name.startsWith("class:")) { conditionalClasses.push({ className: attr.name.slice("class:".length), - expression: attr.value, + expression: unwrapDirectiveExpression(attr.value), }); } } diff --git a/packages/compiler/test/compiler.test.ts b/packages/compiler/test/compiler.test.ts index 8e2fb685..a87e4bd0 100644 --- a/packages/compiler/test/compiler.test.ts +++ b/packages/compiler/test/compiler.test.ts @@ -788,6 +788,33 @@ component PageHeader { expect(output).toContain("dark:bg-white/10"); }); +test("class directives accept single-quoted brace expressions", () => { + const output = generate( + parse(` +component MarketingSectionHeader { + props { + align = "start" + } + + view { +
+ Header +
+ } +} +`), + ); + + expect(output).toContain('${(align === "center") ? " mx-auto" : ""}'); + expect(output).toContain('${(align === "center") ? " text-center" : ""}'); + expect(output).not.toContain('({align === "center"})'); + expect(output).toContain(""align === \\\\"center\\\\"""); +}); + test("components support each blocks", () => { const output = generate( parse(` diff --git a/packages/core/package.json b/packages/core/package.json index 8aedcc2c..2dfbf81c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/core", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "main": "src/index.ts", "exports": { diff --git a/packages/csr/package.json b/packages/csr/package.json index 3759f919..0ca45c2e 100644 --- a/packages/csr/package.json +++ b/packages/csr/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/csr", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "main": "src/index.ts", "exports": { diff --git a/packages/db/package.json b/packages/db/package.json index 8adbe26f..f014aff8 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/db", - "version": "0.2.77", + "version": "0.2.78", "private": true, "type": "module", "main": "src/index.ts", diff --git a/packages/dev-server/package.json b/packages/dev-server/package.json index a5a9b9ad..dcd17e86 100644 --- a/packages/dev-server/package.json +++ b/packages/dev-server/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/dev-server", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "main": "src/index.ts", "exports": { diff --git a/packages/dev-toolbar/package.json b/packages/dev-toolbar/package.json index 552e2656..775da7f1 100644 --- a/packages/dev-toolbar/package.json +++ b/packages/dev-toolbar/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/dev-toolbar", - "version": "0.2.77", + "version": "0.2.78", "private": true, "type": "module", "sideEffects": false, diff --git a/packages/encryption/package.json b/packages/encryption/package.json index 538baa54..2b260ae1 100644 --- a/packages/encryption/package.json +++ b/packages/encryption/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/encryption", - "version": "0.2.77", + "version": "0.2.78", "private": true, "type": "module", "main": "src/index.ts", diff --git a/packages/helpers/package.json b/packages/helpers/package.json index 69853472..520cce5a 100644 --- a/packages/helpers/package.json +++ b/packages/helpers/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/helpers", - "version": "0.2.77", + "version": "0.2.78", "private": true, "type": "module", "description": "Safe convenience helpers for WrNexus request contexts and common application flows.", diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 0ffd42e9..37eb552c 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/i18n", - "version": "0.2.77", + "version": "0.2.78", "private": true, "type": "module", "main": "src/index.ts", diff --git a/packages/jwt/package.json b/packages/jwt/package.json index c34a09b7..dea05cf2 100644 --- a/packages/jwt/package.json +++ b/packages/jwt/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/jwt", - "version": "0.2.77", + "version": "0.2.78", "private": true, "type": "module", "main": "src/index.ts", diff --git a/packages/mobile/package.json b/packages/mobile/package.json index d776ee80..559dd4f9 100644 --- a/packages/mobile/package.json +++ b/packages/mobile/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/mobile", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "main": "src/index.ts", "exports": { diff --git a/packages/native/package.json b/packages/native/package.json index 927f1c81..22d15895 100644 --- a/packages/native/package.json +++ b/packages/native/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/native", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "main": "src/index.ts", "exports": { diff --git a/packages/oauth/package.json b/packages/oauth/package.json index c71d089c..a853c91e 100644 --- a/packages/oauth/package.json +++ b/packages/oauth/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/oauth", - "version": "0.2.77", + "version": "0.2.78", "private": true, "type": "module", "main": "src/index.ts", diff --git a/packages/pubsub/package.json b/packages/pubsub/package.json index 04868265..393146af 100644 --- a/packages/pubsub/package.json +++ b/packages/pubsub/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/pubsub", - "version": "0.2.77", + "version": "0.2.78", "private": true, "type": "module", "main": "src/index.ts", diff --git a/packages/queue/package.json b/packages/queue/package.json index 5bd1d9eb..5a180c09 100644 --- a/packages/queue/package.json +++ b/packages/queue/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/queue", - "version": "0.2.77", + "version": "0.2.78", "private": true, "type": "module", "main": "src/index.ts", diff --git a/packages/reactive/package.json b/packages/reactive/package.json index 30eb191b..80782a34 100644 --- a/packages/reactive/package.json +++ b/packages/reactive/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/reactive", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "main": "src/index.ts", "exports": { diff --git a/packages/router/package.json b/packages/router/package.json index f8008f53..d11eccf3 100644 --- a/packages/router/package.json +++ b/packages/router/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/router", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "main": "src/index.ts", "exports": { diff --git a/packages/ssr/package.json b/packages/ssr/package.json index 220a5788..6bc5ea27 100644 --- a/packages/ssr/package.json +++ b/packages/ssr/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/ssr", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "main": "src/index.ts", "exports": { diff --git a/packages/styles/package.json b/packages/styles/package.json index ef014886..5b0a430c 100644 --- a/packages/styles/package.json +++ b/packages/styles/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/styles", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "main": "src/index.ts", "exports": { diff --git a/packages/test/package.json b/packages/test/package.json index c25ac1df..3712f96d 100644 --- a/packages/test/package.json +++ b/packages/test/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/test", - "version": "0.2.77", + "version": "0.2.78", "private": true, "type": "module", "main": "src/index.ts", diff --git a/packages/tracking/package.json b/packages/tracking/package.json index 5c65dce9..e6a19f2f 100644 --- a/packages/tracking/package.json +++ b/packages/tracking/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/tracking", - "version": "0.2.77", + "version": "0.2.78", "private": true, "type": "module", "main": "src/index.ts", diff --git a/packages/ui/package.json b/packages/ui/package.json index 64a422f2..ba203a7f 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/ui", - "version": "0.2.77", + "version": "0.2.78", "private": true, "type": "module", "main": "src/index.ts", diff --git a/packages/uploader/package.json b/packages/uploader/package.json index 45e79b18..dd24140f 100644 --- a/packages/uploader/package.json +++ b/packages/uploader/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/uploader", - "version": "0.2.77", + "version": "0.2.78", "private": true, "type": "module", "main": "src/index.ts", diff --git a/packages/validation/package.json b/packages/validation/package.json index 8199cbf5..32115d35 100644 --- a/packages/validation/package.json +++ b/packages/validation/package.json @@ -1,6 +1,6 @@ { "name": "@wrnexus/validation", - "version": "0.2.77", + "version": "0.2.78", "private": true, "type": "module", "main": "src/index.ts", diff --git a/scripts/publish-packages.ts b/scripts/publish-packages.ts index 55420868..af5cc1fb 100644 --- a/scripts/publish-packages.ts +++ b/scripts/publish-packages.ts @@ -106,6 +106,28 @@ function entriesOf(dir: string, m: Record): Record return map; } +function removeDirectoryWithRetry(path: string): void { + try { + rmSync(path, { + recursive: true, + force: true, + maxRetries: 10, + retryDelay: 300, + }); + } catch (error) { + const code = error && typeof error === "object" && "code" in error ? String(error.code) : ""; + + if (code === "EBUSY" || code === "EPERM") { + throw new Error( + `Unable to clean ${path}. Close any Explorer window, editor, terminal, antivirus scan, or process using this directory, then retry.`, + { cause: error }, + ); + } + + throw error; + } +} + /** Rewrite the manifest for publishing. */ function publishManifest(m: Record, version: string): Record { const js = (ts: string) => "./dist/" + ts.replace(/^\.?\/?src\//, "").replace(/\.ts$/, ".js"); @@ -165,7 +187,7 @@ async function main() { console.error("No @wrnexus packages matched."); process.exit(1); } - rmSync(stageRoot, { recursive: true, force: true }); + removeDirectoryWithRetry(stageRoot); mkdirSync(stageRoot, { recursive: true }); const order: string[] = []; diff --git a/update-package-versions.mjs b/update-package-versions.mjs index aaa113a1..da767a77 100644 --- a/update-package-versions.mjs +++ b/update-package-versions.mjs @@ -1,7 +1,7 @@ import { existsSync, readdirSync, readFileSync, writeFileSync } from "node:fs"; import { join } from "node:path"; -const version = "0.2.77"; +const version = "0.2.78"; const dependencyGroups = [ "dependencies",