htmv 0.0.56 → 0.0.58
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/views-registry.js +3 -1
- package/dist/views.js +0 -2
- package/package.json +1 -1
package/dist/views-registry.js
CHANGED
|
@@ -4,13 +4,15 @@ import { viewsPath } from "./views";
|
|
|
4
4
|
export const viewRegistry = {};
|
|
5
5
|
export function addToViewRegistry(name, code) {
|
|
6
6
|
viewRegistry[name] = code;
|
|
7
|
+
console.log("Registered view", name, "with code:");
|
|
8
|
+
console.log(code);
|
|
7
9
|
}
|
|
8
10
|
export async function registerViews() {
|
|
9
11
|
const files = await deepReadDir(viewsPath);
|
|
10
12
|
for (const file of files) {
|
|
11
13
|
if (file.endsWith(".html")) {
|
|
12
14
|
const name = file.slice(0, -".html".length);
|
|
13
|
-
const code = await fs.readFile(
|
|
15
|
+
const code = await fs.readFile(file, "utf-8");
|
|
14
16
|
addToViewRegistry(name, code);
|
|
15
17
|
}
|
|
16
18
|
}
|
package/dist/views.js
CHANGED