@stacksjs/stx 0.2.164 → 0.2.165
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +352 -352
- package/dist/craft.js +194 -194
- package/dist/render.js +4 -0
- package/dist/stx-virtual-ts.d.ts +1 -1
- package/dist/stx-virtual-ts.js +1 -0
- package/package.json +5 -5
package/dist/render.js
CHANGED
|
@@ -120,6 +120,10 @@ export async function renderTemplateString(content, filePath, renderOptions = {}
|
|
|
120
120
|
if (Number.isInteger(status) && status >= 100 && status <= 599)
|
|
121
121
|
recordOn(renderOptions.context, "__stxResponseStatus", status);
|
|
122
122
|
},
|
|
123
|
+
notFound: (status = 404) => {
|
|
124
|
+
const code = Number.isInteger(status) && status >= 400 && status <= 599 ? status : 404;
|
|
125
|
+
recordOn(renderOptions.context, "__stxResponseStatus", code);
|
|
126
|
+
},
|
|
123
127
|
setResponseHeader: (name, value) => {
|
|
124
128
|
if (!name)
|
|
125
129
|
return;
|
package/dist/stx-virtual-ts.d.ts
CHANGED
|
@@ -103,7 +103,7 @@ export declare const UNWRAP_HELPER: '__StxTemplateValue';
|
|
|
103
103
|
* Mirrors what `serve.ts` puts in scope. Declaring these is what lets the
|
|
104
104
|
* checker report a genuine typo instead of suppressing every unresolved name.
|
|
105
105
|
*/
|
|
106
|
-
export declare const STX_SERVER_CONTEXT: readonly ['params', 'query', 'cookies', 'host', 'ip', 'setResponseStatus', 'setResponseHeader', 'request', 'url', 'definePageMeta'];
|
|
106
|
+
export declare const STX_SERVER_CONTEXT: readonly ['params', 'query', 'cookies', 'host', 'ip', 'setResponseStatus', 'setResponseHeader', 'notFound', 'request', 'url', 'definePageMeta'];
|
|
107
107
|
/**
|
|
108
108
|
* Names the template engine puts in scope for every page.
|
|
109
109
|
*
|
package/dist/stx-virtual-ts.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/stx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.165",
|
|
5
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -117,12 +117,12 @@
|
|
|
117
117
|
"dependencies": {
|
|
118
118
|
"@cwcss/crosswind": "^0.2.14",
|
|
119
119
|
"@stacksjs/clapp": "^0.2.0",
|
|
120
|
-
"@stacksjs/desktop": "0.2.
|
|
121
|
-
"@stacksjs/sanitizer": "0.2.
|
|
120
|
+
"@stacksjs/desktop": "0.2.165",
|
|
121
|
+
"@stacksjs/sanitizer": "0.2.165",
|
|
122
122
|
"@stacksjs/ts-i18n": "^0.1.11",
|
|
123
|
-
"bun-plugin-stx": "0.2.
|
|
123
|
+
"bun-plugin-stx": "0.2.165",
|
|
124
124
|
"bunfig": "^0.15.17",
|
|
125
|
-
"stx-router": "0.2.
|
|
125
|
+
"stx-router": "0.2.165",
|
|
126
126
|
"ts-broadcasting": "^0.0.9",
|
|
127
127
|
"ts-images": "^0.1.9",
|
|
128
128
|
"ts-syntax-highlighter": "^0.2.1"
|