primate 0.26.3 → 0.26.4
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 +2 -2
- package/src/handlers/view.js +1 -1
- package/src/hooks/register.js +1 -1
- package/src/hooks/stage.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "primate",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.4",
|
|
4
4
|
"description": "Expressive, minimal and extensible web framework",
|
|
5
5
|
"homepage": "https://primatejs.com",
|
|
6
6
|
"bugs": "https://github.com/primatejs/primate/issues",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"directory": "packages/primate"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"rcompat": "^0.
|
|
21
|
+
"rcompat": "^0.4.1"
|
|
22
22
|
},
|
|
23
23
|
"engines": {
|
|
24
24
|
"node": ">=18"
|
package/src/handlers/view.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import errors from "../errors.js";
|
|
2
2
|
|
|
3
3
|
export default (name, props, options) => async (app, ...rest) => {
|
|
4
|
-
const extension = name.slice(name.lastIndexOf(".")
|
|
4
|
+
const extension = name.slice(name.lastIndexOf("."));
|
|
5
5
|
return app.handlers[extension]?.(name, props, options)(app, ...rest)
|
|
6
6
|
?? errors.NoHandlerForExtension.throw(extension, name);
|
|
7
7
|
};
|
package/src/hooks/register.js
CHANGED
|
@@ -39,7 +39,7 @@ const post = async app => {
|
|
|
39
39
|
await Promise.all(imports.map(async file => {
|
|
40
40
|
const code = await file.text();
|
|
41
41
|
const src = file.debase(path.static);
|
|
42
|
-
const type = file.extension === "css" ? "style" : "module";
|
|
42
|
+
const type = file.extension === ".css" ? "style" : "module";
|
|
43
43
|
// already copied in `app.stage`
|
|
44
44
|
await app.publish({ src, code, type, copy: false });
|
|
45
45
|
type === "style" && app.export({ type,
|
package/src/hooks/stage.js
CHANGED
|
@@ -21,7 +21,7 @@ const post = async app => {
|
|
|
21
21
|
await app.runpath(location.routes).create();
|
|
22
22
|
const double = doubled((await app.path.routes.collect())
|
|
23
23
|
.map(path => path.debase(app.path.routes))
|
|
24
|
-
.map(path => `${path}`.slice(1, -path.extension.length
|
|
24
|
+
.map(path => `${path}`.slice(1, -path.extension.length)));
|
|
25
25
|
double && errors.DoubleRoute.throw(double);
|
|
26
26
|
|
|
27
27
|
await app.stage(app.path.routes, location.routes);
|