Compare commits

..
2 Commits
Author SHA1 Message Date
Clintchiz 4230de7065 release: WRNexusJS 0.2.41 2026-07-15 14:52:56 +05:30
Clintchiz 0006aef2c4 release: WRNexusJS 0.2.40 2026-07-15 14:02:27 +05:30
57 changed files with 328 additions and 183 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/ai", "name": "@wrnexus/ai",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "Zero-dependency Claude (Anthropic) client for WrNexus apps.", "description": "Zero-dependency Claude (Anthropic) client for WrNexus apps.",
"license": "MIT", "license": "MIT",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/authz", "name": "@wrnexus/authz",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/authz — part of the WrNexus framework.", "description": "@wrnexus/authz — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
+11 -11
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/cli", "name": "@wrnexus/cli",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/cli — part of the WrNexus framework.", "description": "@wrnexus/cli — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
@@ -28,16 +28,16 @@
"wrnexus": "./dist/index.js" "wrnexus": "./dist/index.js"
}, },
"dependencies": { "dependencies": {
"@wrnexus/core": "^0.2.39", "@wrnexus/core": "^0.2.41",
"@wrnexus/router": "^0.2.39", "@wrnexus/router": "^0.2.41",
"@wrnexus/csr": "^0.2.39", "@wrnexus/csr": "^0.2.41",
"@wrnexus/compiler": "^0.2.39", "@wrnexus/compiler": "^0.2.41",
"@wrnexus/styles": "^0.2.39", "@wrnexus/styles": "^0.2.41",
"@wrnexus/dev-server": "^0.2.39", "@wrnexus/dev-server": "^0.2.41",
"@wrnexus/ui": "^0.2.39", "@wrnexus/ui": "^0.2.41",
"@wrnexus/validation": "^0.2.39", "@wrnexus/validation": "^0.2.41",
"@wrnexus/i18n": "^0.2.39", "@wrnexus/i18n": "^0.2.41",
"@wrnexus/db": "^0.2.39" "@wrnexus/db": "^0.2.41"
}, },
"files": [ "files": [
"dist" "dist"
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/compiler", "name": "@wrnexus/compiler",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/compiler — part of the WrNexus framework.", "description": "@wrnexus/compiler — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/core", "name": "@wrnexus/core",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/core — part of the WrNexus framework.", "description": "@wrnexus/core — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/csr", "name": "@wrnexus/csr",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/csr — part of the WrNexus framework.", "description": "@wrnexus/csr — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
@@ -21,7 +21,7 @@
} }
}, },
"dependencies": { "dependencies": {
"@wrnexus/core": "^0.2.39" "@wrnexus/core": "^0.2.41"
}, },
"files": [ "files": [
"dist" "dist"
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/db", "name": "@wrnexus/db",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/db — part of the WrNexus framework.", "description": "@wrnexus/db — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
+13 -13
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/dev-server", "name": "@wrnexus/dev-server",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/dev-server — part of the WrNexus framework.", "description": "@wrnexus/dev-server — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
@@ -25,18 +25,18 @@
} }
}, },
"dependencies": { "dependencies": {
"@wrnexus/core": "^0.2.39", "@wrnexus/core": "^0.2.41",
"@wrnexus/router": "^0.2.39", "@wrnexus/router": "^0.2.41",
"@wrnexus/ssr": "^0.2.39", "@wrnexus/ssr": "^0.2.41",
"@wrnexus/csr": "^0.2.39", "@wrnexus/csr": "^0.2.41",
"@wrnexus/compiler": "^0.2.39", "@wrnexus/compiler": "^0.2.41",
"@wrnexus/styles": "^0.2.39", "@wrnexus/styles": "^0.2.41",
"@wrnexus/ui": "^0.2.39", "@wrnexus/ui": "^0.2.41",
"@wrnexus/validation": "^0.2.39", "@wrnexus/validation": "^0.2.41",
"@wrnexus/i18n": "^0.2.39", "@wrnexus/i18n": "^0.2.41",
"@wrnexus/db": "^0.2.39", "@wrnexus/db": "^0.2.41",
"@wrnexus/pubsub": "^0.2.39", "@wrnexus/pubsub": "^0.2.41",
"@wrnexus/uploader": "^0.2.39" "@wrnexus/uploader": "^0.2.41"
}, },
"files": [ "files": [
"dist" "dist"
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/encryption", "name": "@wrnexus/encryption",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/encryption — part of the WrNexus framework.", "description": "@wrnexus/encryption — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/helpers", "name": "@wrnexus/helpers",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "Safe convenience helpers for WrNexus request contexts and common application flows.", "description": "Safe convenience helpers for WrNexus request contexts and common application flows.",
"license": "MIT", "license": "MIT",
@@ -21,7 +21,7 @@
} }
}, },
"dependencies": { "dependencies": {
"@wrnexus/core": "^0.2.39" "@wrnexus/core": "^0.2.41"
}, },
"files": [ "files": [
"dist" "dist"
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/i18n", "name": "@wrnexus/i18n",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/i18n — part of the WrNexus framework.", "description": "@wrnexus/i18n — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
@@ -21,7 +21,7 @@
} }
}, },
"dependencies": { "dependencies": {
"@wrnexus/core": "^0.2.39" "@wrnexus/core": "^0.2.41"
}, },
"files": [ "files": [
"dist" "dist"
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/jwt", "name": "@wrnexus/jwt",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/jwt — part of the WrNexus framework.", "description": "@wrnexus/jwt — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/mobile", "name": "@wrnexus/mobile",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/mobile — part of the WrNexus framework.", "description": "@wrnexus/mobile — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
@@ -21,7 +21,7 @@
} }
}, },
"dependencies": { "dependencies": {
"@wrnexus/native": "^0.2.39" "@wrnexus/native": "^0.2.41"
}, },
"files": [ "files": [
"dist" "dist"
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/native", "name": "@wrnexus/native",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/native — part of the WrNexus framework.", "description": "@wrnexus/native — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/oauth", "name": "@wrnexus/oauth",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/oauth — part of the WrNexus framework.", "description": "@wrnexus/oauth — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/pubsub", "name": "@wrnexus/pubsub",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/pubsub — part of the WrNexus framework.", "description": "@wrnexus/pubsub — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/queue", "name": "@wrnexus/queue",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/queue — part of the WrNexus framework.", "description": "@wrnexus/queue — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/reactive", "name": "@wrnexus/reactive",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/reactive — part of the WrNexus framework.", "description": "@wrnexus/reactive — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
+3 -3
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/router", "name": "@wrnexus/router",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/router — part of the WrNexus framework.", "description": "@wrnexus/router — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
@@ -21,8 +21,8 @@
} }
}, },
"dependencies": { "dependencies": {
"@wrnexus/compiler": "^0.2.39", "@wrnexus/compiler": "^0.2.41",
"@wrnexus/core": "^0.2.39" "@wrnexus/core": "^0.2.41"
}, },
"files": [ "files": [
"dist" "dist"
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/ssr", "name": "@wrnexus/ssr",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/ssr — part of the WrNexus framework.", "description": "@wrnexus/ssr — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
@@ -21,7 +21,7 @@
} }
}, },
"dependencies": { "dependencies": {
"@wrnexus/core": "^0.2.39" "@wrnexus/core": "^0.2.41"
}, },
"files": [ "files": [
"dist" "dist"
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/styles", "name": "@wrnexus/styles",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/styles — part of the WrNexus framework.", "description": "@wrnexus/styles — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
@@ -21,7 +21,7 @@
} }
}, },
"dependencies": { "dependencies": {
"@wrnexus/uploader": "^0.2.39" "@wrnexus/uploader": "^0.2.41"
}, },
"files": [ "files": [
"dist" "dist"
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/test", "name": "@wrnexus/test",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/test — part of the WrNexus framework.", "description": "@wrnexus/test — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/tracking", "name": "@wrnexus/tracking",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/tracking — part of the WrNexus framework.", "description": "@wrnexus/tracking — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/ui", "name": "@wrnexus/ui",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/ui — part of the WrNexus framework.", "description": "@wrnexus/ui — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
@@ -22,7 +22,7 @@
"./ui.css": "./ui.css" "./ui.css": "./ui.css"
}, },
"dependencies": { "dependencies": {
"@wrnexus/core": "^0.2.39" "@wrnexus/core": "^0.2.41"
}, },
"files": [ "files": [
"dist", "dist",
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/uploader", "name": "@wrnexus/uploader",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/uploader — part of the WrNexus framework.", "description": "@wrnexus/uploader — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
@@ -21,7 +21,7 @@
} }
}, },
"dependencies": { "dependencies": {
"@wrnexus/core": "^0.2.39" "@wrnexus/core": "^0.2.41"
}, },
"files": [ "files": [
"dist" "dist"
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/validation", "name": "@wrnexus/validation",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"description": "@wrnexus/validation — part of the WrNexus framework.", "description": "@wrnexus/validation — part of the WrNexus framework.",
"license": "MIT", "license": "MIT",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/ai", "name": "@wrnexus/ai",
"version": "0.2.39", "version": "0.2.41",
"private": true, "private": true,
"type": "module", "type": "module",
"description": "Zero-dependency Claude (Anthropic) client for WrNexus apps.", "description": "Zero-dependency Claude (Anthropic) client for WrNexus apps.",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/authz", "name": "@wrnexus/authz",
"version": "0.2.39", "version": "0.2.41",
"private": true, "private": true,
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/cli", "name": "@wrnexus/cli",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
"exports": { "exports": {
+9
View File
@@ -438,6 +438,15 @@ const MIGRATIONS: Migration[] = [
// No generated application files require automatic migration. // No generated application files require automatic migration.
}, },
}, },
{
version: "0.2.41",
id: "conditions-bug",
description:
"Adds server-rendered component each/if blocks and fixes dynamic component rendering.",
apply() {
// No generated application files require automatic migration.
},
},
]; ];
/** Release tooling uses this to require an explicit migration entry per version. */ /** Release tooling uses this to require an explicit migration entry per version. */
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/compiler", "name": "@wrnexus/compiler",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
"exports": { "exports": {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/core", "name": "@wrnexus/core",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
"exports": { "exports": {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/csr", "name": "@wrnexus/csr",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
"exports": { "exports": {
+191 -98
View File
@@ -816,45 +816,81 @@ export const REACTIVE_RUNTIME = String.raw`
expression || "", expression || "",
).trim(); ).trim();
// Array literals containing spread: // Remove an optional trailing semicolon.
// if (
// [...items, value] source.charAt(
// [first, ...others] source.length - 1,
// ) === ";"
) {
source = source
.slice(0, -1)
.trim();
}
/*
* Array literals containing spreads:
*
* [...openIndexes, index]
* [first, ...otherItems]
*/
if ( if (
source.charAt(0) === "[" && source.charAt(0) === "[" &&
source.charAt(source.length - 1) === "]" && source.charAt(
source.length - 1,
) === "]" &&
source.indexOf("...") !== -1 source.indexOf("...") !== -1
) { ) {
var inner = source.slice(1, -1); var arraySource = source.slice(
var parts = splitTopLevel(inner, ","); 1,
var result = []; -1,
);
parts.forEach(function (part) { var arrayParts = splitTopLevel(
var valueSource = part.trim(); arraySource,
",",
);
var arrayResult = [];
arrayParts.forEach(function (
part,
) {
var partSource =
part.trim();
if (!partSource) {
return;
}
if ( if (
valueSource.indexOf("...") === 0 partSource.slice(0, 3) ===
"..."
) { ) {
var spreadValue = var spreadResult =
evaluateExpression( evaluateExpression(
valueSource.slice(3), partSource
.slice(3)
.trim(),
read, read,
); );
if (Array.isArray(spreadValue)) { if (
Array.isArray(
spreadResult,
)
) {
Array.prototype.push.apply( Array.prototype.push.apply(
result, arrayResult,
spreadValue, spreadResult,
); );
} }
return; return;
} }
result.push( arrayResult.push(
evaluateExpression( evaluateExpression(
valueSource, partSource,
read, read,
), ),
); );
@@ -862,100 +898,151 @@ export const REACTIVE_RUNTIME = String.raw`
return { return {
matched: true, matched: true,
value: result, value: arrayResult,
}; };
} }
// Array callback methods: /*
// * First recognize the array method call without
// items.filter((item) => item !== value) * trying to parse the callback in the same regex.
// items.map((item, index) => item.title) */
// items.some((item) => item.active) var methodMatch =
// /^([\s\S]+)\.(filter|map|some|every|find|findIndex)\(\s*([\s\S]*)\s*\)$/.exec(
var callbackMatch =
/^([\s\S]+)\.(filter|map|some|every|find|findIndex)\(\s*\(\s*([A-Za-z_$][A-Za-z0-9_$]*)\s*(?:,\s*([A-Za-z_$][A-Za-z0-9_$]*))?\s*\)\s*=>\s*([\s\S]+)\s*\)$/.exec(
source, source,
); );
if (!callbackMatch) { if (!methodMatch) {
callbackMatch = return {
/^([\s\S]+)\.(filter|map|some|every|find|findIndex)\(\s*([A-Za-z_$][A-Za-z0-9_$]*)\s*=>\s*([\s\S]+)\s*\)$/.exec( matched: false,
source, value: undefined,
); };
if (callbackMatch) {
callbackMatch = [
callbackMatch[0],
callbackMatch[1],
callbackMatch[2],
callbackMatch[3],
undefined,
callbackMatch[4],
];
}
} }
if (callbackMatch) { var collectionSource =
var collection = methodMatch[1].trim();
evaluateExpression(
callbackMatch[1],
read,
);
var method = callbackMatch[2]; var method =
var itemName = callbackMatch[3]; methodMatch[2];
var indexName = callbackMatch[4];
var body = callbackMatch[5];
if (!Array.isArray(collection)) { var callbackSource =
collection = []; methodMatch[3].trim();
}
var callback = function ( /*
item, * Supported callbacks:
index, *
) { * item => item.active
return evaluateExpression( * (item) => item.active
body, * (item, index) => index > 0
function (name) { */
if (name === itemName) { var callbackMatch =
return item; /^(?:\(\s*([A-Za-z_$][A-Za-z0-9_$]*)\s*(?:,\s*([A-Za-z_$][A-Za-z0-9_$]*)\s*)?\)|([A-Za-z_$][A-Za-z0-9_$]*))\s*=>\s*([\s\S]+)$/.exec(
} callbackSource,
);
if (
indexName &&
name === indexName
) {
return index;
}
return read(name);
},
);
};
if (!callbackMatch) {
return { return {
matched: true, matched: false,
value: value: undefined,
method === "filter"
? collection.filter(callback)
: method === "map"
? collection.map(callback)
: method === "some"
? collection.some(callback)
: method === "every"
? collection.every(callback)
: method === "find"
? collection.find(callback)
: collection.findIndex(
callback,
),
}; };
} }
var itemName =
callbackMatch[1] ||
callbackMatch[3];
var indexName =
callbackMatch[2];
var callbackBody =
callbackMatch[4].trim();
/*
* Support expression bodies wrapped in parentheses:
*
* item => (
* item.active
* )
*/
if (
callbackBody.charAt(0) ===
"(" &&
callbackBody.charAt(
callbackBody.length - 1,
) === ")"
) {
callbackBody = callbackBody
.slice(1, -1)
.trim();
}
var collection =
evaluateExpression(
collectionSource,
read,
);
if (!Array.isArray(collection)) {
collection = [];
}
var callback = function (
itemValue,
itemIndex,
) {
return evaluateExpression(
callbackBody,
function (name) {
if (name === itemName) {
return itemValue;
}
if (
indexName &&
name === indexName
) {
return itemIndex;
}
return read(name);
},
);
};
var result;
if (method === "filter") {
result =
collection.filter(callback);
} else if (
method === "map"
) {
result =
collection.map(callback);
} else if (
method === "some"
) {
result =
collection.some(callback);
} else if (
method === "every"
) {
result =
collection.every(callback);
} else if (
method === "find"
) {
result =
collection.find(callback);
} else {
result =
collection.findIndex(
callback,
);
}
return { return {
matched: false, matched: true,
value: undefined, value: result,
}; };
} }
@@ -963,8 +1050,13 @@ export const REACTIVE_RUNTIME = String.raw`
// 'unsafe-eval'). Supports: literals, identifiers, member access (a.b, a[b]), // 'unsafe-eval'). Supports: literals, identifiers, member access (a.b, a[b]),
// function/method calls, arrays, objects, arithmetic, comparison, equality, // function/method calls, arrays, objects, arithmetic, comparison, equality,
// logical (&& ||), unary (! - +), and the ternary operator. // logical (&& ||), unary (! - +), and the ternary operator.
function evaluateExpression(expr, read) { function evaluateExpression(
expr = String(expr || "").trim(); expr,
read,
) {
expr = String(
expr || "",
).trim();
var special = var special =
evaluateSpecialExpression( evaluateSpecialExpression(
@@ -978,6 +1070,7 @@ export const REACTIVE_RUNTIME = String.raw`
var tokens = var tokens =
tokenizeExpression(expr); tokenizeExpression(expr);
var index = 0; var index = 0;
function peek() { return tokens[index]; } function peek() { return tokens[index]; }
function next() { return tokens[index++]; } function next() { return tokens[index++]; }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/db", "name": "@wrnexus/db",
"version": "0.2.39", "version": "0.2.41",
"private": true, "private": true,
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/dev-server", "name": "@wrnexus/dev-server",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
"exports": { "exports": {
+36
View File
@@ -0,0 +1,36 @@
import { existsSync, rmSync } from "node:fs";
import { resolve } from "node:path";
export interface ResetDevCacheOptions {
rootDir?: string;
cacheDir?: string;
enabled?: boolean;
}
export function resetDevCache(options: ResetDevCacheOptions = {}): string {
const rootDir = resolve(options.rootDir ?? process.cwd());
const cacheDir = resolve(rootDir, options.cacheDir ?? ".wrnexus");
if (options.enabled === false) {
return cacheDir;
}
// Safety: never allow deleting the project root.
if (cacheDir === rootDir) {
throw new Error("Refusing to remove the project root as the WRNexus cache directory.");
}
if (existsSync(cacheDir)) {
rmSync(cacheDir, {
recursive: true,
force: true,
maxRetries: 3,
retryDelay: 100,
});
console.log(`[wrnexus] cleared generated cache: ${cacheDir}`);
}
return cacheDir;
}
+7
View File
@@ -29,6 +29,7 @@ import { createDevAssetServer } from "./assets.ts";
import { HmrHub } from "./hmr.ts"; import { HmrHub } from "./hmr.ts";
import { startWatcher } from "./watch.ts"; import { startWatcher } from "./watch.ts";
export { RESTART_EXIT_CODE } from "./restart.ts"; export { RESTART_EXIT_CODE } from "./restart.ts";
import { resetDevCache } from "./cache.ts";
export interface ServeOptions { export interface ServeOptions {
appDir: string; appDir: string;
@@ -122,6 +123,12 @@ export async function startServer(opts: ServeOptions): Promise<RunningServer> {
const router = buildRouter(appDir, { componentDirs: [uiComponentsDir()] }); const router = buildRouter(appDir, { componentDirs: [uiComponentsDir()] });
const styleEntry = opts.styleEntry ?? null; const styleEntry = opts.styleEntry ?? null;
const appRoot = dirname(appDir); const appRoot = dirname(appDir);
resetDevCache({
rootDir: appRoot,
enabled: process.env.WRNEXUS_PRESERVE_CACHE !== "1",
});
// Compile every `.wrn` into ONE cache dir at the project root, instead of a // Compile every `.wrn` into ONE cache dir at the project root, instead of a
// `.wrnexus/` next to each source file (and inside node_modules UI dirs). // `.wrnexus/` next to each source file (and inside node_modules UI dirs).
setCompileCacheDir(join(appRoot, ".wrnexus")); setCompileCacheDir(join(appRoot, ".wrnexus"));
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/encryption", "name": "@wrnexus/encryption",
"version": "0.2.39", "version": "0.2.41",
"private": true, "private": true,
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/helpers", "name": "@wrnexus/helpers",
"version": "0.2.39", "version": "0.2.41",
"private": true, "private": true,
"type": "module", "type": "module",
"description": "Safe convenience helpers for WrNexus request contexts and common application flows.", "description": "Safe convenience helpers for WrNexus request contexts and common application flows.",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/i18n", "name": "@wrnexus/i18n",
"version": "0.2.39", "version": "0.2.41",
"private": true, "private": true,
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/jwt", "name": "@wrnexus/jwt",
"version": "0.2.39", "version": "0.2.41",
"private": true, "private": true,
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/mobile", "name": "@wrnexus/mobile",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
"exports": { "exports": {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/native", "name": "@wrnexus/native",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
"exports": { "exports": {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/oauth", "name": "@wrnexus/oauth",
"version": "0.2.39", "version": "0.2.41",
"private": true, "private": true,
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/pubsub", "name": "@wrnexus/pubsub",
"version": "0.2.39", "version": "0.2.41",
"private": true, "private": true,
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/queue", "name": "@wrnexus/queue",
"version": "0.2.39", "version": "0.2.41",
"private": true, "private": true,
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/reactive", "name": "@wrnexus/reactive",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
"exports": { "exports": {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/router", "name": "@wrnexus/router",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
"exports": { "exports": {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/ssr", "name": "@wrnexus/ssr",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
"exports": { "exports": {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/styles", "name": "@wrnexus/styles",
"version": "0.2.39", "version": "0.2.41",
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
"exports": { "exports": {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/test", "name": "@wrnexus/test",
"version": "0.2.39", "version": "0.2.41",
"private": true, "private": true,
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/tracking", "name": "@wrnexus/tracking",
"version": "0.2.39", "version": "0.2.41",
"private": true, "private": true,
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/ui", "name": "@wrnexus/ui",
"version": "0.2.39", "version": "0.2.41",
"private": true, "private": true,
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/uploader", "name": "@wrnexus/uploader",
"version": "0.2.39", "version": "0.2.41",
"private": true, "private": true,
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/validation", "name": "@wrnexus/validation",
"version": "0.2.39", "version": "0.2.41",
"private": true, "private": true,
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
+1 -1
View File
@@ -1,7 +1,7 @@
import { existsSync, readdirSync, readFileSync, writeFileSync } from "node:fs"; import { existsSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
import { join } from "node:path"; import { join } from "node:path";
const version = "0.2.39"; const version = "0.2.41";
const dependencyGroups = [ const dependencyGroups = [
"dependencies", "dependencies",