webanvil 0.0.6 → 0.0.8
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/LICENSE +21 -21
- package/README.md +549 -38
- package/bin/webanvil +6 -0
- package/bin/webanvil.cmd +2 -0
- package/dist/_chunks/commands.mjs +1890 -0
- package/dist/_chunks/config.mjs +140 -0
- package/dist/_chunks/project-vite.mjs +9 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +30 -0
- package/dist/index.d.mts +668 -0
- package/dist/index.mjs +6 -0
- package/dist/storybook/react/index.d.mts +3 -0
- package/dist/storybook/react/index.mjs +4 -0
- package/dist/storybook/react/preset +8 -0
- package/dist/storybook/react/preset.d.mts +5 -0
- package/dist/storybook/react/preset.mjs +8 -0
- package/dist/storybook/svelte/index.d.mts +3 -0
- package/dist/storybook/svelte/index.mjs +4 -0
- package/dist/storybook/svelte/preset +8 -0
- package/dist/storybook/svelte/preset.d.mts +5 -0
- package/dist/storybook/svelte/preset.mjs +8 -0
- package/dist/storybook/test/preset +2 -0
- package/dist/storybook/test/preset.d.mts +1 -0
- package/dist/storybook/test/preset.mjs +2 -0
- package/dist/storybook/vue/index.d.mts +3 -0
- package/dist/storybook/vue/index.mjs +4 -0
- package/dist/storybook/vue/preset +8 -0
- package/dist/storybook/vue/preset.d.mts +5 -0
- package/dist/storybook/vue/preset.mjs +8 -0
- package/dist/storybook/web-components/index.d.mts +3 -0
- package/dist/storybook/web-components/index.mjs +4 -0
- package/dist/storybook/web-components/preset +7 -0
- package/dist/storybook/web-components/preset.d.mts +4 -0
- package/dist/storybook/web-components/preset.mjs +7 -0
- package/package.json +151 -60
- package/bin/run +0 -3
- package/bin/run.cmd +0 -3
- package/lib/commands/build.d.ts +0 -3
- package/lib/commands/build.d.ts.map +0 -1
- package/lib/commands/build.js +0 -34
- package/lib/commands/serve.d.ts +0 -3
- package/lib/commands/serve.d.ts.map +0 -1
- package/lib/commands/serve.js +0 -44
- package/lib/commons/io/core/File.d.ts +0 -11
- package/lib/commons/io/core/File.d.ts.map +0 -1
- package/lib/commons/io/core/File.js +0 -23
- package/lib/commons/io/core/Path.d.ts +0 -30
- package/lib/commons/io/core/Path.d.ts.map +0 -1
- package/lib/commons/io/core/Path.js +0 -122
- package/lib/commons/io/sync/fs.d.ts +0 -11
- package/lib/commons/io/sync/fs.d.ts.map +0 -1
- package/lib/commons/io/sync/fs.js +0 -46
- package/lib/commons/io/sync/index.d.ts +0 -5
- package/lib/commons/io/sync/index.d.ts.map +0 -1
- package/lib/commons/io/sync/index.js +0 -9
- package/lib/commons/io/sync/path.d.ts +0 -4
- package/lib/commons/io/sync/path.d.ts.map +0 -1
- package/lib/commons/io/sync/path.js +0 -13
- package/lib/core/Configuration.d.ts +0 -37
- package/lib/core/Configuration.d.ts.map +0 -1
- package/lib/core/Configuration.js +0 -56
- package/lib/core/EventEmitter.d.ts +0 -14
- package/lib/core/EventEmitter.d.ts.map +0 -1
- package/lib/core/EventEmitter.js +0 -42
- package/lib/core/Page.d.ts +0 -14
- package/lib/core/Page.d.ts.map +0 -1
- package/lib/core/Page.js +0 -34
- package/lib/core/Plugin.d.ts +0 -13
- package/lib/core/Plugin.d.ts.map +0 -1
- package/lib/core/Plugin.js +0 -12
- package/lib/core/Renderer/Renderer.d.ts +0 -8
- package/lib/core/Renderer/Renderer.d.ts.map +0 -1
- package/lib/core/Renderer/Renderer.js +0 -9
- package/lib/core/Renderer/index.d.ts +0 -8
- package/lib/core/Renderer/index.d.ts.map +0 -1
- package/lib/core/Renderer/index.js +0 -18
- package/lib/index.d.ts +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -1
- package/lib/main.d.ts +0 -2
- package/lib/main.d.ts.map +0 -1
- package/lib/main.js +0 -36
- package/lib/plugins/outlinecss.d.ts +0 -4
- package/lib/plugins/outlinecss.d.ts.map +0 -1
- package/lib/plugins/outlinecss.js +0 -34
- package/lib/renderers/EJSRenderer.d.ts +0 -7
- package/lib/renderers/EJSRenderer.d.ts.map +0 -1
- package/lib/renderers/EJSRenderer.js +0 -34
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const Renderer_1 = require("../core/Renderer/Renderer");
|
|
4
|
-
const index_1 = require("../commons/io/sync/index");
|
|
5
|
-
class EJSRenderer extends Renderer_1.default {
|
|
6
|
-
static engine = "ejs";
|
|
7
|
-
render(page) {
|
|
8
|
-
const { directories, renderer } = this._configuration;
|
|
9
|
-
const ejs = require(EJSRenderer.engine);
|
|
10
|
-
const [, ext] = page.layout.split(".");
|
|
11
|
-
const layout = index_1.fs.read(index_1.path.join(directories.layouts, page.layout)
|
|
12
|
-
.replace({ ext: ext ?? renderer.extension }));
|
|
13
|
-
const include = (pathname, data) => {
|
|
14
|
-
const [, ext] = pathname.split(".");
|
|
15
|
-
const file = index_1.fs.read(index_1.path.join(directories.partials, pathname)
|
|
16
|
-
.replace({ ext: ext ?? renderer.extension }));
|
|
17
|
-
return ejs.render(file.content, { ...page.data, ...data, include });
|
|
18
|
-
};
|
|
19
|
-
return ejs.render(layout.content, {
|
|
20
|
-
title: page.data.title ?? "",
|
|
21
|
-
body: ejs.render(page.content, { ...page.data, include }, {
|
|
22
|
-
views: [
|
|
23
|
-
String(directories.partials)
|
|
24
|
-
]
|
|
25
|
-
}),
|
|
26
|
-
include
|
|
27
|
-
}, {
|
|
28
|
-
views: [
|
|
29
|
-
String(directories.partials)
|
|
30
|
-
]
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.default = EJSRenderer;
|