@matra/cli 0.5.0 → 0.5.2-preview.0
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/package.json +3 -3
- package/src/cli.mjs +1 -0
- package/src/dev.mjs +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matra/cli",
|
|
3
|
-
"version": "0.5.0",
|
|
3
|
+
"version": "0.5.2-preview.0",
|
|
4
4
|
"description": "Matra project initialization and HTML build tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
],
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@matra/command": "0.2.0",
|
|
15
|
-
"@matra/core": "0.4.
|
|
15
|
+
"@matra/core": "0.4.1",
|
|
16
16
|
"@matra/html": "0.4.1",
|
|
17
|
-
"@matra/site-generation": "0.4.0",
|
|
17
|
+
"@matra/site-generation": "0.4.1-preview.0",
|
|
18
18
|
"@matra/styles": "0.2.1",
|
|
19
19
|
"mime-types": "^3.0.2"
|
|
20
20
|
},
|
package/src/cli.mjs
CHANGED
|
@@ -29,6 +29,7 @@ install Install both ecosystems (default document: index.md); alias of deps ins
|
|
|
29
29
|
|
|
30
30
|
matra build executes selected JavaScript and Python in index.md.
|
|
31
31
|
matra site build executes .matra.md pages/layouts and explicitly configured .matra components.
|
|
32
|
+
Configured site hooks execute trusted JavaScript during site build and dev.
|
|
32
33
|
matra deps install prompts before network access; npm lifecycle scripts are disabled.
|
|
33
34
|
Only build trusted programs; JavaScript and Python execution has no OS sandbox or timeout.`
|
|
34
35
|
|
package/src/dev.mjs
CHANGED
|
@@ -144,12 +144,12 @@ export async function startDev(
|
|
|
144
144
|
return
|
|
145
145
|
}
|
|
146
146
|
const asset = snapshot?.get(!site && path === "/" ? "/index.html" : path)
|
|
147
|
-
if (site && !asset && snapshot?.has(`${path}/`)) {
|
|
147
|
+
if (site && !failure && !asset && snapshot?.has(`${path}/`)) {
|
|
148
148
|
response.writeHead(308, { Location: `${url}/${request.url.slice(url.length)}` })
|
|
149
149
|
response.end()
|
|
150
150
|
return
|
|
151
151
|
}
|
|
152
|
-
const status =
|
|
152
|
+
const status = failure ? 503 : !asset ? 404 : 200
|
|
153
153
|
const content = asset ?? fallback
|
|
154
154
|
const body = status === 503 ? `Build failed: ${failure}\n` : (content?.body ?? "Not found\n")
|
|
155
155
|
response.writeHead(status, {
|