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.
Files changed (88) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +549 -38
  3. package/bin/webanvil +6 -0
  4. package/bin/webanvil.cmd +2 -0
  5. package/dist/_chunks/commands.mjs +1890 -0
  6. package/dist/_chunks/config.mjs +140 -0
  7. package/dist/_chunks/project-vite.mjs +9 -0
  8. package/dist/cli.d.mts +1 -0
  9. package/dist/cli.mjs +30 -0
  10. package/dist/index.d.mts +668 -0
  11. package/dist/index.mjs +6 -0
  12. package/dist/storybook/react/index.d.mts +3 -0
  13. package/dist/storybook/react/index.mjs +4 -0
  14. package/dist/storybook/react/preset +8 -0
  15. package/dist/storybook/react/preset.d.mts +5 -0
  16. package/dist/storybook/react/preset.mjs +8 -0
  17. package/dist/storybook/svelte/index.d.mts +3 -0
  18. package/dist/storybook/svelte/index.mjs +4 -0
  19. package/dist/storybook/svelte/preset +8 -0
  20. package/dist/storybook/svelte/preset.d.mts +5 -0
  21. package/dist/storybook/svelte/preset.mjs +8 -0
  22. package/dist/storybook/test/preset +2 -0
  23. package/dist/storybook/test/preset.d.mts +1 -0
  24. package/dist/storybook/test/preset.mjs +2 -0
  25. package/dist/storybook/vue/index.d.mts +3 -0
  26. package/dist/storybook/vue/index.mjs +4 -0
  27. package/dist/storybook/vue/preset +8 -0
  28. package/dist/storybook/vue/preset.d.mts +5 -0
  29. package/dist/storybook/vue/preset.mjs +8 -0
  30. package/dist/storybook/web-components/index.d.mts +3 -0
  31. package/dist/storybook/web-components/index.mjs +4 -0
  32. package/dist/storybook/web-components/preset +7 -0
  33. package/dist/storybook/web-components/preset.d.mts +4 -0
  34. package/dist/storybook/web-components/preset.mjs +7 -0
  35. package/package.json +151 -60
  36. package/bin/run +0 -3
  37. package/bin/run.cmd +0 -3
  38. package/lib/commands/build.d.ts +0 -3
  39. package/lib/commands/build.d.ts.map +0 -1
  40. package/lib/commands/build.js +0 -34
  41. package/lib/commands/serve.d.ts +0 -3
  42. package/lib/commands/serve.d.ts.map +0 -1
  43. package/lib/commands/serve.js +0 -44
  44. package/lib/commons/io/core/File.d.ts +0 -11
  45. package/lib/commons/io/core/File.d.ts.map +0 -1
  46. package/lib/commons/io/core/File.js +0 -23
  47. package/lib/commons/io/core/Path.d.ts +0 -30
  48. package/lib/commons/io/core/Path.d.ts.map +0 -1
  49. package/lib/commons/io/core/Path.js +0 -122
  50. package/lib/commons/io/sync/fs.d.ts +0 -11
  51. package/lib/commons/io/sync/fs.d.ts.map +0 -1
  52. package/lib/commons/io/sync/fs.js +0 -46
  53. package/lib/commons/io/sync/index.d.ts +0 -5
  54. package/lib/commons/io/sync/index.d.ts.map +0 -1
  55. package/lib/commons/io/sync/index.js +0 -9
  56. package/lib/commons/io/sync/path.d.ts +0 -4
  57. package/lib/commons/io/sync/path.d.ts.map +0 -1
  58. package/lib/commons/io/sync/path.js +0 -13
  59. package/lib/core/Configuration.d.ts +0 -37
  60. package/lib/core/Configuration.d.ts.map +0 -1
  61. package/lib/core/Configuration.js +0 -56
  62. package/lib/core/EventEmitter.d.ts +0 -14
  63. package/lib/core/EventEmitter.d.ts.map +0 -1
  64. package/lib/core/EventEmitter.js +0 -42
  65. package/lib/core/Page.d.ts +0 -14
  66. package/lib/core/Page.d.ts.map +0 -1
  67. package/lib/core/Page.js +0 -34
  68. package/lib/core/Plugin.d.ts +0 -13
  69. package/lib/core/Plugin.d.ts.map +0 -1
  70. package/lib/core/Plugin.js +0 -12
  71. package/lib/core/Renderer/Renderer.d.ts +0 -8
  72. package/lib/core/Renderer/Renderer.d.ts.map +0 -1
  73. package/lib/core/Renderer/Renderer.js +0 -9
  74. package/lib/core/Renderer/index.d.ts +0 -8
  75. package/lib/core/Renderer/index.d.ts.map +0 -1
  76. package/lib/core/Renderer/index.js +0 -18
  77. package/lib/index.d.ts +0 -1
  78. package/lib/index.d.ts.map +0 -1
  79. package/lib/index.js +0 -1
  80. package/lib/main.d.ts +0 -2
  81. package/lib/main.d.ts.map +0 -1
  82. package/lib/main.js +0 -36
  83. package/lib/plugins/outlinecss.d.ts +0 -4
  84. package/lib/plugins/outlinecss.d.ts.map +0 -1
  85. package/lib/plugins/outlinecss.js +0 -34
  86. package/lib/renderers/EJSRenderer.d.ts +0 -7
  87. package/lib/renderers/EJSRenderer.d.ts.map +0 -1
  88. package/lib/renderers/EJSRenderer.js +0 -34
@@ -1,122 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const nodepath = require("path");
4
- const nodeutil = require("util");
5
- class Path {
6
- _dir;
7
- _name;
8
- _ext;
9
- static from(path, ...segments) {
10
- if (path instanceof Path) {
11
- return segments.reduce((pathname, segment) => pathname.join(segment), path);
12
- }
13
- else if (typeof path === "string") {
14
- return new Path(nodepath.join(path, ...segments.map(String)));
15
- }
16
- else if (typeof path === "object") {
17
- return new Path(nodepath.join(path.dir ?? "", `${path.name ?? ""}${path.ext ?? ""}`));
18
- }
19
- else {
20
- throw new TypeError("[TODO] Invalid pathname");
21
- }
22
- }
23
- constructor(pathname) {
24
- const { dir, name, ext } = nodepath.parse(pathname);
25
- this._dir = dir;
26
- this._name = name;
27
- this._ext = ext;
28
- }
29
- replace(path, replaceValue) {
30
- if (path instanceof Path || typeof path === "string") {
31
- return new Path(String(this.full)
32
- .replace(String(path), replaceValue ?? ""));
33
- }
34
- else {
35
- let { dir, name, ext } = path;
36
- if (ext?.charAt(0) === ".") {
37
- ext = ext.slice(1);
38
- }
39
- return new Path(nodepath.join(dir ?? this._dir, `${name ?? this._name}.${ext ?? this._ext}`));
40
- }
41
- }
42
- join(...segments) {
43
- return new Path(nodepath.join(this.full, ...segments.map(String)));
44
- }
45
- from(to) {
46
- return new Path(nodepath.relative(String(this), String(to)));
47
- }
48
- to(from) {
49
- return new Path(nodepath.relative(String(from), String(this)));
50
- }
51
- get full() {
52
- return nodepath.join(this._dir, this.base);
53
- }
54
- get base() {
55
- return `${this._name}${this._ext}`;
56
- }
57
- get name() {
58
- return this._name;
59
- }
60
- set name(value) {
61
- this.replace({ name: value });
62
- }
63
- get ext() {
64
- return this._ext;
65
- }
66
- set ext(value) {
67
- this.replace({ ext: value });
68
- }
69
- get dir() {
70
- return this._dir;
71
- }
72
- set dir(value) {
73
- this.replace({ dir: value });
74
- }
75
- // public path(): string {
76
- // return nodepath.join(this._dir, this.base())
77
- // }
78
- //
79
- // public base(): string {
80
- // return `${this._name}${this._ext}`
81
- // }
82
- //
83
- // public name(): string
84
- // public name(value: string): Path
85
- // public name(value?: string): PathLike {
86
- // if (value) {
87
- // return this.replace({ name: value })
88
- // } else {
89
- // return this._name
90
- // }
91
- // }
92
- //
93
- // public ext(): string
94
- // public ext(value: string): Path
95
- // public ext(value?: string): PathLike {
96
- // if (value) {
97
- // return this.replace({ ext: value })
98
- // } else {
99
- // return this._ext
100
- // }
101
- // }
102
- //
103
- // public dir(): string
104
- // public dir(value: string): Path
105
- // public dir(value?: string): PathLike {
106
- // if (value) {
107
- // return this.replace({ dir: value })
108
- // } else {
109
- // return this._dir
110
- // }
111
- // }
112
- toString() {
113
- return this.full;
114
- }
115
- valueOf() {
116
- return this.toString();
117
- }
118
- [nodeutil.inspect.custom]() {
119
- return this.valueOf();
120
- }
121
- }
122
- exports.default = Path;
@@ -1,11 +0,0 @@
1
- import Path, { PathLike } from "../core/Path";
2
- import File from "../core/File";
3
- export declare const dir: (path: PathLike) => Path[];
4
- export declare const deepdir: (path: PathLike) => Path[];
5
- export declare const mkdir: (path: PathLike) => void;
6
- export declare const exists: (path: PathLike) => boolean;
7
- export declare const read: (path: PathLike) => File;
8
- export declare const write: (path: PathLike, content: string) => void;
9
- export declare const rm: (path: PathLike) => void;
10
- export declare const cp: (source: PathLike, destination: PathLike) => void;
11
- //# sourceMappingURL=fs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["fs.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,IAAI,MAAM,cAAc,CAAA;AAG/B,eAAO,MAAM,GAAG,GAAI,MAAM,QAAQ,KAAG,IAAI,EAGxC,CAAA;AAED,eAAO,MAAM,OAAO,GAAI,MAAM,QAAQ,KAAG,IAAI,EAG5C,CAAA;AAED,eAAO,MAAM,KAAK,GAAI,MAAM,QAAQ,KAAG,IAEtC,CAAA;AAED,eAAO,MAAM,MAAM,GAAI,MAAM,QAAQ,KAAG,OAEvC,CAAA;AAED,eAAO,MAAM,IAAI,GAAI,MAAM,QAAQ,KAAG,IAGrC,CAAA;AAED,eAAO,MAAM,KAAK,GAAI,MAAM,QAAQ,EAAE,SAAS,MAAM,KAAG,IAGvD,CAAA;AAED,eAAO,MAAM,EAAE,GAAI,MAAM,QAAQ,KAAG,IAInC,CAAA;AAED,eAAO,MAAM,EAAE,GAAI,QAAQ,QAAQ,EAAE,aAAa,QAAQ,SAIzD,CAAA"}
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cp = exports.rm = exports.write = exports.read = exports.exists = exports.mkdir = exports.deepdir = exports.dir = void 0;
4
- const nodefs = require("fs");
5
- const Path_1 = require("../core/Path");
6
- const File_1 = require("../core/File");
7
- const dir = (path) => {
8
- const dirents = nodefs.readdirSync(String(path), { encoding: "utf-8" });
9
- return dirents.map(dirent => Path_1.default.from(path, dirent));
10
- };
11
- exports.dir = dir;
12
- const deepdir = (path) => {
13
- const dirents = nodefs.readdirSync(String(path), { encoding: "utf-8", recursive: true });
14
- return dirents.map(dirent => Path_1.default.from(path, dirent));
15
- };
16
- exports.deepdir = deepdir;
17
- const mkdir = (path) => {
18
- nodefs.mkdirSync(String(path), { recursive: true });
19
- };
20
- exports.mkdir = mkdir;
21
- const exists = (path) => {
22
- return nodefs.existsSync(String(path));
23
- };
24
- exports.exists = exists;
25
- const read = (path) => {
26
- const content = nodefs.readFileSync(String(path), "utf-8");
27
- return new File_1.default(Path_1.default.from(path), content);
28
- };
29
- exports.read = read;
30
- const write = (path, content) => {
31
- (0, exports.mkdir)(Path_1.default.from(path).dir);
32
- nodefs.writeFileSync(String(path), content, "utf-8");
33
- };
34
- exports.write = write;
35
- const rm = (path) => {
36
- if ((0, exports.exists)(path)) {
37
- nodefs.rmSync(String(path), { recursive: true });
38
- }
39
- };
40
- exports.rm = rm;
41
- const cp = (source, destination) => {
42
- if ((0, exports.exists)(source)) {
43
- nodefs.cpSync(String(source), String(destination), { recursive: true });
44
- }
45
- };
46
- exports.cp = cp;
@@ -1,5 +0,0 @@
1
- export { default as File } from "../core/File";
2
- export { default as Path, PathLike } from "../core/Path";
3
- export * as fs from "./fs";
4
- export * as path from "./path";
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAExD,OAAO,KAAK,EAAE,MAAM,MAAM,CAAA;AAC1B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAA"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.path = exports.fs = exports.Path = exports.File = void 0;
4
- var File_1 = require("../core/File");
5
- Object.defineProperty(exports, "File", { enumerable: true, get: function () { return File_1.default; } });
6
- var Path_1 = require("../core/Path");
7
- Object.defineProperty(exports, "Path", { enumerable: true, get: function () { return Path_1.default; } });
8
- exports.fs = require("./fs");
9
- exports.path = require("./path");
@@ -1,4 +0,0 @@
1
- import Path, { PathLike } from "../core/Path";
2
- export declare const cwd: () => Path;
3
- export declare const join: (...path: PathLike[]) => Path;
4
- //# sourceMappingURL=path.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["path.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAG7C,eAAO,MAAM,GAAG,YAEf,CAAA;AAED,eAAO,MAAM,IAAI,GAAI,GAAG,MAAM,QAAQ,EAAE,SAEvC,CAAA"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.join = exports.cwd = void 0;
4
- const nodepath = require("path");
5
- const Path_1 = require("../core/Path");
6
- const cwd = () => {
7
- return new Path_1.default(process.cwd());
8
- };
9
- exports.cwd = cwd;
10
- const join = (...path) => {
11
- return new Path_1.default(nodepath.join(...path.map(String)));
12
- };
13
- exports.join = join;
@@ -1,37 +0,0 @@
1
- import { Path } from "../commons/io/sync";
2
- import Plugin from "./Plugin";
3
- export declare enum TemplateEngine {
4
- EJS = "ejs"
5
- }
6
- export declare enum FileExtension {
7
- HTML = "html"
8
- }
9
- export type RendererConfiguration = {
10
- engine: TemplateEngine;
11
- extension: FileExtension;
12
- };
13
- export type DirectoriesConfiguration = {
14
- root: Path;
15
- output: Path;
16
- public: Path;
17
- pages: Path;
18
- styles: Path;
19
- partials: Path;
20
- layouts: Path;
21
- };
22
- type Configuration = {
23
- renderer: RendererConfiguration;
24
- directories: DirectoriesConfiguration;
25
- plugins: Plugin[];
26
- base: string;
27
- };
28
- export type PlainConfiguration = {
29
- base: string;
30
- renderer: Record<keyof RendererConfiguration, string>;
31
- directories: Record<keyof DirectoriesConfiguration, string>;
32
- };
33
- declare namespace Configuration {
34
- const from: (configuration: Partial<PlainConfiguration>) => Configuration;
35
- }
36
- export default Configuration;
37
- //# sourceMappingURL=Configuration.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Configuration.d.ts","sourceRoot":"","sources":["Configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,IAAI,EAAE,2BAAyB;AAC9C,OAAO,MAAM,iBAAqB;AAIlC,oBAAY,cAAc;IACtB,GAAG,QAAQ;CACd;AAED,oBAAY,aAAa;IACrB,IAAI,SAAS;CAChB;AAED,MAAM,MAAM,qBAAqB,GAAG;IAChC,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,aAAa,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACnC,IAAI,EAAE,IAAI,CAAA;IACV,MAAM,EAAE,IAAI,CAAA;IACZ,MAAM,EAAE,IAAI,CAAA;IACZ,KAAK,EAAE,IAAI,CAAA;IACX,MAAM,EAAE,IAAI,CAAA;IACZ,QAAQ,EAAE,IAAI,CAAA;IACd,OAAO,EAAE,IAAI,CAAA;CAChB,CAAA;AAED,KAAK,aAAa,GAAG;IACjB,QAAQ,EAAE,qBAAqB,CAAA;IAC/B,WAAW,EAAE,wBAAwB,CAAA;IACrC,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAC,MAAM,qBAAqB,EAAE,MAAM,CAAC,CAAA;IACrD,WAAW,EAAE,MAAM,CAAC,MAAM,wBAAwB,EAAE,MAAM,CAAC,CAAA;CAC9D,CAAA;AAmBD,kBAAU,aAAa,CAAC;IACb,MAAM,IAAI,GAAI,eAAe,OAAO,CAAC,kBAAkB,CAAC,KAAG,aAuBjE,CAAA;CACJ;AAGD,eAAe,aAAa,CAAA"}
@@ -1,56 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FileExtension = exports.TemplateEngine = void 0;
4
- const sync_1 = require("../commons/io/sync");
5
- const outlinecss_1 = require("../plugins/outlinecss");
6
- var TemplateEngine;
7
- (function (TemplateEngine) {
8
- TemplateEngine["EJS"] = "ejs";
9
- })(TemplateEngine || (exports.TemplateEngine = TemplateEngine = {}));
10
- var FileExtension;
11
- (function (FileExtension) {
12
- FileExtension["HTML"] = "html";
13
- })(FileExtension || (exports.FileExtension = FileExtension = {}));
14
- const defaults = {
15
- base: "/",
16
- renderer: {
17
- engine: "ejs",
18
- extension: ".html"
19
- },
20
- directories: {
21
- root: ".",
22
- output: "./build",
23
- public: "./source/public",
24
- pages: "./source/pages",
25
- styles: "./source/styles",
26
- partials: "./source/templates/partials",
27
- layouts: "./source/templates/layouts"
28
- }
29
- };
30
- var Configuration;
31
- (function (Configuration) {
32
- Configuration.from = (configuration) => {
33
- const renderer = {
34
- ...defaults.renderer,
35
- ...configuration.renderer
36
- };
37
- const directories = {
38
- ...defaults.directories,
39
- ...configuration.directories
40
- };
41
- return {
42
- ...defaults,
43
- ...configuration,
44
- renderer: {
45
- engine: renderer.engine,
46
- extension: renderer.extension,
47
- },
48
- directories: Object.fromEntries(Object.entries(directories)
49
- .map(([property, value]) => [property, sync_1.path.join(sync_1.path.cwd(), value)])),
50
- plugins: [
51
- outlinecss_1.default
52
- ]
53
- };
54
- };
55
- })(Configuration || (Configuration = {}));
56
- exports.default = Configuration;
@@ -1,14 +0,0 @@
1
- export declare enum Event {
2
- END = "end"
3
- }
4
- export type EventSubscriber = (...args: unknown[]) => void;
5
- declare class EventEmitter {
6
- private readonly events;
7
- on(event: Event, subscriber: EventSubscriber): void;
8
- off(event: Event, listener: EventSubscriber): void;
9
- emit(event: Event, ...args: unknown[]): void;
10
- once(event: Event, subscriber: EventSubscriber): void;
11
- removeAllListeners(event?: Event): void;
12
- }
13
- export default EventEmitter;
14
- //# sourceMappingURL=EventEmitter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EventEmitter.d.ts","sourceRoot":"","sources":["EventEmitter.ts"],"names":[],"mappings":"AAAA,oBAAY,KAAK;IACb,GAAG,QAAQ;CACd;AAED,MAAM,MAAM,eAAe,GACvB,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;AAGhC,cAAM,YAAY;IACd,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;IAE3D,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,GAAG,IAAI;IAOnD,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI;IASlD,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM5C,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,GAAG,IAAI;IAQrD,kBAAkB,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI;CAOjD;AAGD,eAAe,YAAY,CAAA"}
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Event = void 0;
4
- var Event;
5
- (function (Event) {
6
- Event["END"] = "end";
7
- })(Event || (exports.Event = Event = {}));
8
- class EventEmitter {
9
- events = new Map();
10
- on(event, subscriber) {
11
- if (!this.events.has(event)) {
12
- this.events.set(event, []);
13
- }
14
- this.events.get(event).push(subscriber);
15
- }
16
- off(event, listener) {
17
- if (this.events.has(event)) {
18
- this.events.set(event, this.events.get(event).filter((l) => l !== listener));
19
- }
20
- }
21
- emit(event, ...args) {
22
- if (this.events.has(event)) {
23
- this.events.get(event).forEach((listener) => listener(...args));
24
- }
25
- }
26
- once(event, subscriber) {
27
- const onceWrapper = (...args) => {
28
- this.off(event, onceWrapper);
29
- subscriber(...args);
30
- };
31
- this.on(event, onceWrapper);
32
- }
33
- removeAllListeners(event) {
34
- if (event) {
35
- this.events.delete(event);
36
- }
37
- else {
38
- this.events.clear();
39
- }
40
- }
41
- }
42
- exports.default = EventEmitter;
@@ -1,14 +0,0 @@
1
- import { Path, PathLike } from "../commons/io/sync/index";
2
- export default class Page {
3
- private readonly _path;
4
- private readonly _content;
5
- private readonly _layout;
6
- private readonly _data;
7
- static from(pathname: PathLike): Page;
8
- constructor(pathname: PathLike, content: string, layout: string, data: Record<string, unknown>);
9
- get path(): Path;
10
- get content(): string;
11
- get data(): Record<string, unknown>;
12
- get layout(): string;
13
- }
14
- //# sourceMappingURL=Page.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["Page.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAY,iCAA+B;AAGlE,MAAM,CAAC,OAAO,OAAO,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAM;IAC5B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAQ;IAChC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyB;WAEjC,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;gBAMhC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAO9F,IAAW,IAAI,IAAI,IAAI,CAEtB;IAED,IAAW,OAAO,IAAI,MAAM,CAE3B;IAED,IAAW,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzC;IAED,IAAW,MAAM,IAAI,MAAM,CAE1B;CACJ"}
package/lib/core/Page.js DELETED
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const matter = require("gray-matter");
4
- const index_1 = require("../commons/io/sync/index");
5
- class Page {
6
- _path;
7
- _content;
8
- _layout;
9
- _data;
10
- static from(pathname) {
11
- const file = index_1.fs.read(pathname);
12
- const { content, data: { layout, ...data } } = matter(file.content);
13
- return new Page(pathname, content, layout, data);
14
- }
15
- constructor(pathname, content, layout, data) {
16
- this._path = index_1.path.join(pathname);
17
- this._content = content;
18
- this._layout = layout;
19
- this._data = data;
20
- }
21
- get path() {
22
- return this._path;
23
- }
24
- get content() {
25
- return this._content;
26
- }
27
- get data() {
28
- return this._data;
29
- }
30
- get layout() {
31
- return this._layout;
32
- }
33
- }
34
- exports.default = Page;
@@ -1,13 +0,0 @@
1
- import Configuration from "./Configuration";
2
- import EventEmitter from "./EventEmitter";
3
- interface Plugin {
4
- name: string;
5
- install(events: EventEmitter, configuration: Configuration): any;
6
- }
7
- export declare const Signal: () => {
8
- signal: Promise<unknown>;
9
- resolve: (_?: unknown) => void;
10
- reject: (_?: unknown) => void;
11
- };
12
- export default Plugin;
13
- //# sourceMappingURL=Plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,wBAA4B;AAChD,OAAO,YAAY,uBAA2B;AAG9C,UAAU,MAAM;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,GAAG,GAAG,CAAA;CACnE;AAED,eAAO,MAAM,MAAM;;kBACI,OAAO,KAAG,IAAI;iBACf,OAAO,KAAG,IAAI;CAMnC,CAAA;AAGD,eAAe,MAAM,CAAA"}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Signal = void 0;
4
- const Signal = () => {
5
- let resolve = (_) => void 0, reject = (_) => void 0;
6
- const signal = new Promise((_resolve, _reject) => {
7
- resolve = _resolve;
8
- reject = _reject;
9
- });
10
- return { signal, resolve, reject };
11
- };
12
- exports.Signal = Signal;
@@ -1,8 +0,0 @@
1
- import Configuration from "../Configuration";
2
- import Page from "../Page";
3
- export default abstract class Renderer {
4
- protected readonly _configuration: Configuration;
5
- constructor(configuration: Configuration);
6
- abstract render(page: Page): string;
7
- }
8
- //# sourceMappingURL=Renderer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Renderer.d.ts","sourceRoot":"","sources":["Renderer.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,yBAA4B;AAChD,OAAO,IAAI,gBAAmB;AAG9B,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,QAAQ;IAClC,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,aAAa,CAAA;gBAEpC,aAAa,EAAE,aAAa;aAIxB,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM;CAC7C"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class Renderer {
4
- _configuration;
5
- constructor(configuration) {
6
- this._configuration = configuration;
7
- }
8
- }
9
- exports.default = Renderer;
@@ -1,8 +0,0 @@
1
- export { default as Renderer } from "./Renderer";
2
- import Configuration from "../Configuration";
3
- import Renderer from "./Renderer";
4
- declare namespace RendererFactory {
5
- const from: (configuration: Configuration) => Renderer;
6
- }
7
- export default RendererFactory;
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAA;AAEhD,OAAO,aAAa,yBAA4B;AAEhD,OAAO,QAAQ,MAAM,YAAY,CAAA;AAGjC,kBAAU,eAAe,CAAC;IACf,MAAM,IAAI,GAAI,eAAe,aAAa,KAAG,QAOnD,CAAA;CACJ;AAGD,eAAe,eAAe,CAAA"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Renderer = void 0;
4
- var Renderer_1 = require("./Renderer");
5
- Object.defineProperty(exports, "Renderer", { enumerable: true, get: function () { return Renderer_1.default; } });
6
- const EJSRenderer_1 = require("../../renderers/EJSRenderer");
7
- var RendererFactory;
8
- (function (RendererFactory) {
9
- RendererFactory.from = (configuration) => {
10
- const { engine } = configuration.renderer;
11
- switch (engine) {
12
- case EJSRenderer_1.default.engine:
13
- default:
14
- return new EJSRenderer_1.default(configuration);
15
- }
16
- };
17
- })(RendererFactory || (RendererFactory = {}));
18
- exports.default = RendererFactory;
package/lib/index.d.ts DELETED
@@ -1 +0,0 @@
1
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
package/lib/index.js DELETED
@@ -1 +0,0 @@
1
- "use strict";
package/lib/main.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function main(...varargs: string[]): Promise<number>;
2
- //# sourceMappingURL=main.d.ts.map
package/lib/main.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":"AASA,wBAAsB,IAAI,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAuBhE"}
package/lib/main.js DELETED
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.main = main;
4
- const Configuration_1 = require("./core/Configuration");
5
- const build_1 = require("./commands/build");
6
- const serve_1 = require("./commands/serve");
7
- const minimist = require("minimist");
8
- const DEFAULT_OUTPUT = "./website-dist";
9
- const DEFAULT_ENTRY = "./website";
10
- async function main(...varargs) {
11
- const options = minimist(varargs, {
12
- alias: { o: "output", e: "entry", b: "base" },
13
- default: { output: DEFAULT_OUTPUT, entry: DEFAULT_ENTRY, base: "/" }
14
- });
15
- const [command] = varargs;
16
- const directories = {
17
- root: ".",
18
- output: options.output,
19
- public: `${options.entry}/public`,
20
- pages: `${options.entry}/pages`,
21
- styles: `${options.entry}/styles`,
22
- partials: `${options.entry}/templates/partials`,
23
- layouts: `${options.entry}/templates/layouts`
24
- };
25
- const configuration = Configuration_1.default.from({ directories, base: options.base });
26
- switch (command) {
27
- default:
28
- case "build":
29
- return await (0, build_1.default)(configuration);
30
- case "serve":
31
- return (0, serve_1.default)(configuration);
32
- }
33
- }
34
- main(...process.argv.slice(2))
35
- .then(code => console.log(code))
36
- .catch(error => console.log(error));
@@ -1,4 +0,0 @@
1
- import Plugin from "../core/Plugin";
2
- declare const plugin: Plugin;
3
- export default plugin;
4
- //# sourceMappingURL=outlinecss.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"outlinecss.d.ts","sourceRoot":"","sources":["outlinecss.ts"],"names":[],"mappings":"AAAA,OAAO,MAAkB,uBAAqB;AAgB9C,QAAA,MAAM,MAAM,EAAE,MAqBb,CAAA;AAGD,eAAe,MAAM,CAAA"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const Plugin_1 = require("../core/Plugin");
4
- const EventEmitter_1 = require("../core/EventEmitter");
5
- const sync_1 = require("../commons/io/sync");
6
- const requireFromParent = (moduleName) => {
7
- try {
8
- const modulePath = require.resolve(moduleName, { paths: [process.cwd()] });
9
- return require(modulePath);
10
- }
11
- catch (err) {
12
- console.error(`Module "${moduleName}" not found in parent package.`);
13
- throw err;
14
- }
15
- };
16
- const plugin = {
17
- name: "outlinecss",
18
- install(emitter, configuration) {
19
- const { signal, resolve } = (0, Plugin_1.Signal)();
20
- emitter.on(EventEmitter_1.Event.END, async () => {
21
- const { directories } = configuration;
22
- const outline = requireFromParent("outlinecss");
23
- if (outline) {
24
- const entry = sync_1.path.join(directories.styles, "./main.scss").full;
25
- const output = sync_1.path.join(directories.output, "assets", `${directories.styles.base}.css`).full;
26
- const tokens = sync_1.path.join(directories.styles, "./tokens").full;
27
- await outline.build({ entry, output, tokens });
28
- resolve();
29
- }
30
- });
31
- return signal;
32
- }
33
- };
34
- exports.default = plugin;
@@ -1,7 +0,0 @@
1
- import Page from "../core/Page";
2
- import Renderer from "../core/Renderer/Renderer";
3
- export default class EJSRenderer extends Renderer {
4
- static readonly engine = "ejs";
5
- render(page: Page): string;
6
- }
7
- //# sourceMappingURL=EJSRenderer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EJSRenderer.d.ts","sourceRoot":"","sources":["EJSRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,qBAAmB;AAC9B,OAAO,QAAQ,MAAM,2BAA2B,CAAA;AAIhD,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,QAAQ;IAC7C,gBAAuB,MAAM,SAAQ;IAE9B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM;CA8BpC"}