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
@@ -0,0 +1,8 @@
1
+ import { withProjectVitePlugins } from "../../_chunks/project-vite.mjs";
2
+ import { resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { viteFinal as viteFinal$1 } from "@storybook/react-vite/preset";
5
+ export * from "@storybook/react-vite/preset";
6
+ const addons = [resolve(fileURLToPath(new URL("..", import.meta.url)), "test")];
7
+ const viteFinal = async (...arguments_) => viteFinal$1(await withProjectVitePlugins(arguments_[0]), arguments_[1]);
8
+ export { addons, viteFinal };
@@ -0,0 +1,5 @@
1
+ import { viteFinal as viteFinal$1 } from "@storybook/react-vite/preset";
2
+ export * from "@storybook/react-vite/preset";
3
+ declare const addons: string[];
4
+ declare const viteFinal: (...arguments_: Parameters<typeof viteFinal$1>) => Promise<import("vite").InlineConfig>;
5
+ export { addons, viteFinal };
@@ -0,0 +1,8 @@
1
+ import { withProjectVitePlugins } from "../../_chunks/project-vite.mjs";
2
+ import { resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { viteFinal as viteFinal$1 } from "@storybook/react-vite/preset";
5
+ export * from "@storybook/react-vite/preset";
6
+ const addons = [resolve(fileURLToPath(new URL("..", import.meta.url)), "test")];
7
+ const viteFinal = async (...arguments_) => viteFinal$1(await withProjectVitePlugins(arguments_[0]), arguments_[1]);
8
+ export { addons, viteFinal };
@@ -0,0 +1,3 @@
1
+ import { StorybookConfig } from "@storybook/svelte-vite/node";
2
+ declare const framework: string;
3
+ export { type StorybookConfig, framework };
@@ -0,0 +1,4 @@
1
+ import { dirname } from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ const framework = dirname(fileURLToPath(import.meta.url));
4
+ export { framework };
@@ -0,0 +1,8 @@
1
+ import { withProjectVitePlugins } from "../../_chunks/project-vite.mjs";
2
+ import { resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { viteFinal as viteFinal$1 } from "@storybook/svelte-vite/preset";
5
+ export * from "@storybook/svelte-vite/preset";
6
+ const addons = [resolve(fileURLToPath(new URL("..", import.meta.url)), "test")];
7
+ const viteFinal = async (...arguments_) => viteFinal$1(await withProjectVitePlugins(arguments_[0]), arguments_[1]);
8
+ export { addons, viteFinal };
@@ -0,0 +1,5 @@
1
+ import { viteFinal as viteFinal$1 } from "@storybook/svelte-vite/preset";
2
+ export * from "@storybook/svelte-vite/preset";
3
+ declare const addons: string[];
4
+ declare const viteFinal: (...arguments_: Parameters<typeof viteFinal$1>) => Promise<import("vite").InlineConfig>;
5
+ export { addons, viteFinal };
@@ -0,0 +1,8 @@
1
+ import { withProjectVitePlugins } from "../../_chunks/project-vite.mjs";
2
+ import { resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { viteFinal as viteFinal$1 } from "@storybook/svelte-vite/preset";
5
+ export * from "@storybook/svelte-vite/preset";
6
+ const addons = [resolve(fileURLToPath(new URL("..", import.meta.url)), "test")];
7
+ const viteFinal = async (...arguments_) => viteFinal$1(await withProjectVitePlugins(arguments_[0]), arguments_[1]);
8
+ export { addons, viteFinal };
@@ -0,0 +1,2 @@
1
+ export * from "@storybook/addon-vitest/preset";
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "@storybook/addon-vitest/preset";
@@ -0,0 +1,2 @@
1
+ export * from "@storybook/addon-vitest/preset";
2
+ export {};
@@ -0,0 +1,3 @@
1
+ import { StorybookConfig } from "@storybook/vue3-vite/node";
2
+ declare const framework: string;
3
+ export { type StorybookConfig, framework };
@@ -0,0 +1,4 @@
1
+ import { dirname } from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ const framework = dirname(fileURLToPath(import.meta.url));
4
+ export { framework };
@@ -0,0 +1,8 @@
1
+ import { withProjectVitePlugins } from "../../_chunks/project-vite.mjs";
2
+ import { resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { viteFinal as viteFinal$1 } from "@storybook/vue3-vite/preset";
5
+ export * from "@storybook/vue3-vite/preset";
6
+ const addons = [resolve(fileURLToPath(new URL("..", import.meta.url)), "test")];
7
+ const viteFinal = async (...arguments_) => viteFinal$1(await withProjectVitePlugins(arguments_[0]), arguments_[1]);
8
+ export { addons, viteFinal };
@@ -0,0 +1,5 @@
1
+ import { viteFinal as viteFinal$1 } from "@storybook/vue3-vite/preset";
2
+ export * from "@storybook/vue3-vite/preset";
3
+ declare const addons: string[];
4
+ declare const viteFinal: (...arguments_: Parameters<typeof viteFinal$1>) => Promise<any>;
5
+ export { addons, viteFinal };
@@ -0,0 +1,8 @@
1
+ import { withProjectVitePlugins } from "../../_chunks/project-vite.mjs";
2
+ import { resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { viteFinal as viteFinal$1 } from "@storybook/vue3-vite/preset";
5
+ export * from "@storybook/vue3-vite/preset";
6
+ const addons = [resolve(fileURLToPath(new URL("..", import.meta.url)), "test")];
7
+ const viteFinal = async (...arguments_) => viteFinal$1(await withProjectVitePlugins(arguments_[0]), arguments_[1]);
8
+ export { addons, viteFinal };
@@ -0,0 +1,3 @@
1
+ import { StorybookConfig } from "@storybook/web-components-vite/node";
2
+ declare const framework: string;
3
+ export { type StorybookConfig, framework };
@@ -0,0 +1,4 @@
1
+ import { dirname } from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ const framework = dirname(fileURLToPath(import.meta.url));
4
+ export { framework };
@@ -0,0 +1,7 @@
1
+ import { withProjectVitePlugins } from "../../_chunks/project-vite.mjs";
2
+ import { resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ export * from "@storybook/web-components-vite/preset";
5
+ const addons = [resolve(fileURLToPath(new URL("..", import.meta.url)), "test")];
6
+ const viteFinal = withProjectVitePlugins;
7
+ export { addons, viteFinal };
@@ -0,0 +1,4 @@
1
+ export * from "@storybook/web-components-vite/preset";
2
+ declare const addons: string[];
3
+ declare const viteFinal: (config: import("vite").InlineConfig) => Promise<import("vite").InlineConfig>;
4
+ export { addons, viteFinal };
@@ -0,0 +1,7 @@
1
+ import { withProjectVitePlugins } from "../../_chunks/project-vite.mjs";
2
+ import { resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ export * from "@storybook/web-components-vite/preset";
5
+ const addons = [resolve(fileURLToPath(new URL("..", import.meta.url)), "test")];
6
+ const viteFinal = withProjectVitePlugins;
7
+ export { addons, viteFinal };
package/package.json CHANGED
@@ -1,60 +1,151 @@
1
- {
2
- "name": "webanvil",
3
- "description": "A zero configuration static site generator that just works.",
4
- "version": "0.0.6",
5
- "main": "./lib/index.js",
6
- "types": "./lib/index.d.ts",
7
- "bin": {
8
- "webanvil": "bin/run"
9
- },
10
- "scripts": {
11
- "serve:website": "npx webanvil serve --base /webanvil/",
12
- "build": "npm run build:library && npm run build:website",
13
- "build:library": "npm run clean && tsc --build",
14
- "build:website": "npx webanvil",
15
- "clean": "tsc --build --clean",
16
- "preprepare": "ts-patch install",
17
- "prepack": "npm run build"
18
- },
19
- "dependencies": {
20
- "browser-sync": "^3.0.3",
21
- "gray-matter": "^4.0.3",
22
- "minimist": "^1.2.8",
23
- "rollup": "^4.34.6"
24
- },
25
- "devDependencies": {
26
- "@open-wc/rollup-plugin-html": "^1.2.5",
27
- "@types/browser-sync": "^2.29.0",
28
- "@types/minimist": "^1.2.5",
29
- "@types/node": "^22.4.0",
30
- "ejs": "^3.1.10",
31
- "ts-patch": "^3.2.1",
32
- "tslib": "^2.6.3",
33
- "typescript": "^5.5.4",
34
- "typescript-transform-paths": "^3.4.11",
35
- "webanvil": ".",
36
- "outlinecss": "^0.0.5"
37
- },
38
- "author": "Mateusz Pietrzak",
39
- "license": "MIT",
40
- "repository": {
41
- "type": "git",
42
- "url": "git+https://github.com/mzpkdev/webanvil.git"
43
- },
44
- "files": [
45
- "bin/",
46
- "lib/**/*.js",
47
- "lib/**/*.d.ts",
48
- "lib/**/*.d.ts.map",
49
- "README.md",
50
- "LICENSE"
51
- ],
52
- "keywords": [
53
- "webanvil",
54
- "cli",
55
- "html",
56
- "ssg",
57
- "static-site-generator",
58
- "zero-config"
59
- ]
60
- }
1
+ {
2
+ "name": "webanvil",
3
+ "version": "0.0.8",
4
+ "description": "A unified CLI for building, testing, linting, formatting, and type-checking JavaScript and TypeScript projects.",
5
+ "keywords": [
6
+ "build-tool",
7
+ "cli",
8
+ "javascript",
9
+ "rolldown",
10
+ "typescript",
11
+ "vite",
12
+ "vitest"
13
+ ],
14
+ "homepage": "https://mzpkdev.github.io/webanvil/",
15
+ "bugs": "https://github.com/mzpkdev/webanvil/issues",
16
+ "license": "MIT",
17
+ "author": {
18
+ "name": "Mateusz Pietrzak",
19
+ "email": "mateusz@mzpk.dev",
20
+ "url": "https://github.com/mzpkdev"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/mzpkdev/webanvil.git"
25
+ },
26
+ "bin": {
27
+ "wa": "bin/webanvil",
28
+ "webanvil": "bin/webanvil"
29
+ },
30
+ "files": [
31
+ "bin",
32
+ "dist",
33
+ "README.md"
34
+ ],
35
+ "type": "module",
36
+ "main": "./dist/index.mjs",
37
+ "types": "./dist/index.d.mts",
38
+ "exports": {
39
+ ".": {
40
+ "types": "./dist/index.d.mts",
41
+ "import": "./dist/index.mjs",
42
+ "default": "./dist/index.mjs"
43
+ },
44
+ "./storybook/test/preset": {
45
+ "types": "./dist/storybook/test/preset.d.mts",
46
+ "import": "./dist/storybook/test/preset.mjs",
47
+ "default": "./dist/storybook/test/preset.mjs"
48
+ },
49
+ "./storybook/react": {
50
+ "types": "./dist/storybook/react/index.d.mts",
51
+ "import": "./dist/storybook/react/index.mjs",
52
+ "default": "./dist/storybook/react/index.mjs"
53
+ },
54
+ "./storybook/react/preset": {
55
+ "types": "./dist/storybook/react/preset.d.mts",
56
+ "import": "./dist/storybook/react/preset.mjs",
57
+ "default": "./dist/storybook/react/preset.mjs"
58
+ },
59
+ "./storybook/svelte": {
60
+ "types": "./dist/storybook/svelte/index.d.mts",
61
+ "import": "./dist/storybook/svelte/index.mjs",
62
+ "default": "./dist/storybook/svelte/index.mjs"
63
+ },
64
+ "./storybook/svelte/preset": {
65
+ "types": "./dist/storybook/svelte/preset.d.mts",
66
+ "import": "./dist/storybook/svelte/preset.mjs",
67
+ "default": "./dist/storybook/svelte/preset.mjs"
68
+ },
69
+ "./storybook/vue": {
70
+ "types": "./dist/storybook/vue/index.d.mts",
71
+ "import": "./dist/storybook/vue/index.mjs",
72
+ "default": "./dist/storybook/vue/index.mjs"
73
+ },
74
+ "./storybook/vue/preset": {
75
+ "types": "./dist/storybook/vue/preset.d.mts",
76
+ "import": "./dist/storybook/vue/preset.mjs",
77
+ "default": "./dist/storybook/vue/preset.mjs"
78
+ },
79
+ "./storybook/web-components": {
80
+ "types": "./dist/storybook/web-components/index.d.mts",
81
+ "import": "./dist/storybook/web-components/index.mjs",
82
+ "default": "./dist/storybook/web-components/index.mjs"
83
+ },
84
+ "./storybook/web-components/preset": {
85
+ "types": "./dist/storybook/web-components/preset.d.mts",
86
+ "import": "./dist/storybook/web-components/preset.mjs",
87
+ "default": "./dist/storybook/web-components/preset.mjs"
88
+ }
89
+ },
90
+ "publishConfig": {
91
+ "access": "public",
92
+ "registry": "https://registry.npmjs.org/"
93
+ },
94
+ "scripts": {
95
+ "build": "obuild && node scripts/prepare-storybook-presets.mjs",
96
+ "prepack": "npm run build",
97
+ "pretest": "npm run build",
98
+ "test": "vitest run --passWithNoTests --config vitest.repo.config.ts",
99
+ "test:watch": "vitest",
100
+ "typecheck": "npm run build && node bin/webanvil typecheck",
101
+ "lint": "npm run build && node bin/webanvil lint",
102
+ "lint:fix": "npm run build && node bin/webanvil lint --fix",
103
+ "format": "npm run build && node bin/webanvil format",
104
+ "format:check": "npm run build && node bin/webanvil format --check",
105
+ "check": "npm run typecheck && npm run lint && npm run format:check && npm test"
106
+ },
107
+ "dependencies": {
108
+ "@playwright/browser-chromium": "1.58.2",
109
+ "@storybook/addon-vitest": "10.5.9",
110
+ "@storybook/react-vite": "10.5.9",
111
+ "@storybook/svelte-vite": "10.5.9",
112
+ "@storybook/vue3-vite": "10.5.9",
113
+ "@storybook/web-components-vite": "10.5.9",
114
+ "@types/node": "^26.1.1",
115
+ "@typescript/native-preview": "7.0.0-dev.20260707.2",
116
+ "@vitest/browser": "4.1.10",
117
+ "@vitest/browser-playwright": "4.1.10",
118
+ "@vitest/coverage-v8": "4.1.10",
119
+ "@vitest/ui": "4.1.10",
120
+ "c12": "^4.0.0-beta.5",
121
+ "cmdore": "^0.4.1",
122
+ "consola": "^3.4.2",
123
+ "defu": "^6.1.7",
124
+ "execa": "^9.6.1",
125
+ "get-tsconfig": "5.0.0-beta.5",
126
+ "jsdom": "^29.1.1",
127
+ "mlly": "^1.8.2",
128
+ "oxfmt": "0.60.0",
129
+ "oxlint": "1.75.0",
130
+ "pathe": "^2.0.3",
131
+ "pkg-types": "^2.3.1",
132
+ "playwright": "1.58.2",
133
+ "rolldown": "1.2.0",
134
+ "rolldown-plugin-dts": "0.27.13",
135
+ "semver": "7.8.5",
136
+ "storybook": "10.5.9",
137
+ "tinyglobby": "^0.2.15",
138
+ "typescript": "6.0.3",
139
+ "vite": "8.1.5",
140
+ "vitest": "4.1.10",
141
+ "yaml": "^2.9.0",
142
+ "zod": "^4.4.3"
143
+ },
144
+ "devDependencies": {
145
+ "obuild": "^0.4.38",
146
+ "unplugin": "^3.3.0"
147
+ },
148
+ "engines": {
149
+ "node": "^22.18.0 || >=24.11.0"
150
+ }
151
+ }
package/bin/run DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- require("../lib/main.js")
package/bin/run.cmd DELETED
@@ -1,3 +0,0 @@
1
- mkvbot@echo off
2
-
3
- node "%~dp0\run" %*
@@ -1,3 +0,0 @@
1
- import Configuration from "../core/Configuration";
2
- export default function build(configuration: Configuration): Promise<number>;
3
- //# sourceMappingURL=build.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["build.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,8BAA4B;AAMhD,wBAA8B,KAAK,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BjF"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = build;
4
- const sync_1 = require("../commons/io/sync");
5
- const Renderer_1 = require("../core/Renderer");
6
- const Page_1 = require("../core/Page");
7
- const EventEmitter_1 = require("../core/EventEmitter");
8
- async function build(configuration) {
9
- const pages = sync_1.fs.deepdir(configuration.directories.pages)
10
- .filter(pathname => pathname.base.includes(configuration.renderer.extension))
11
- .map(pathname => Page_1.default.from(pathname));
12
- const renderer = Renderer_1.default.from(configuration);
13
- const emitter = new EventEmitter_1.default();
14
- const signals = [];
15
- for (const plugin of configuration.plugins) {
16
- signals.push(plugin.install(emitter, configuration));
17
- }
18
- sync_1.fs.rm(configuration.directories.output);
19
- for (const page of pages) {
20
- const html = renderer.render(page);
21
- const output = page.path
22
- .replace(configuration.directories.pages, "");
23
- if (output.base === "index.html") {
24
- sync_1.fs.write(sync_1.path.join(configuration.directories.output, output), html);
25
- }
26
- else {
27
- sync_1.fs.write(sync_1.path.join(configuration.directories.output, output.dir, output.name, "index.html"), html);
28
- }
29
- sync_1.fs.cp(configuration.directories.public, configuration.directories.output);
30
- }
31
- emitter.emit(EventEmitter_1.Event.END);
32
- await Promise.all(signals);
33
- return 0;
34
- }
@@ -1,3 +0,0 @@
1
- import Configuration from "../core/Configuration";
2
- export default function serve(configuration: Configuration): Promise<number>;
3
- //# sourceMappingURL=serve.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["serve.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,8BAA4B;AAIhD,wBAA8B,KAAK,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAiCjF"}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = serve;
4
- const bs = require("browser-sync");
5
- const index_1 = require("../commons/io/sync/index");
6
- const build_1 = require("./build");
7
- async function serve(configuration) {
8
- await (0, build_1.default)(configuration);
9
- const browser = bs.create();
10
- const rebuild = async () => {
11
- return (0, build_1.default)(configuration);
12
- };
13
- const reload = async () => {
14
- browser.reload();
15
- };
16
- browser.watch(index_1.path.join(configuration.directories.public, `**/*`).full)
17
- .on("change", run(reload));
18
- browser.watch(index_1.path.join(configuration.directories.pages, `**/*`).full)
19
- .on("change", run(rebuild, reload));
20
- browser.watch(index_1.path.join(configuration.directories.partials, `**/*`).full)
21
- .on("change", run(rebuild, reload));
22
- browser.watch(index_1.path.join(configuration.directories.layouts, `**/*`).full)
23
- .on("change", run(rebuild, reload));
24
- browser.watch(index_1.path.join(configuration.directories.styles, `**/*`).full)
25
- .on("change", run(rebuild, reload));
26
- browser.init({
27
- server: {
28
- baseDir: configuration.directories.output.full,
29
- routes: {
30
- [configuration.base]: configuration.directories.output.full
31
- }
32
- },
33
- startPath: configuration.base,
34
- open: false
35
- });
36
- return new Promise(() => void 0);
37
- }
38
- const run = (...jobs) => {
39
- return (...varargs) => {
40
- return jobs.reduce((accumulator, job) => {
41
- return accumulator.then(job);
42
- }, Promise.resolve(varargs[0]));
43
- };
44
- };
@@ -1,11 +0,0 @@
1
- import Path from "./Path";
2
- export default class File {
3
- private readonly _path;
4
- private readonly _content;
5
- constructor(path: Path, content: string);
6
- get path(): Path;
7
- get content(): string;
8
- toString(): string;
9
- valueOf(): string;
10
- }
11
- //# sourceMappingURL=File.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"File.d.ts","sourceRoot":"","sources":["File.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,QAAQ,CAAA;AAGzB,MAAM,CAAC,OAAO,OAAO,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAM;IAC5B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;gBAErB,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM;IAKvC,IAAW,IAAI,IAAI,IAAI,CAEtB;IAED,IAAW,OAAO,IAAI,MAAM,CAE3B;IAEM,QAAQ;IAIR,OAAO,IAAI,MAAM;CAG3B"}
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class File {
4
- _path;
5
- _content;
6
- constructor(path, content) {
7
- this._path = path;
8
- this._content = content;
9
- }
10
- get path() {
11
- return this._path;
12
- }
13
- get content() {
14
- return this._content;
15
- }
16
- toString() {
17
- return this.content;
18
- }
19
- valueOf() {
20
- return this.toString();
21
- }
22
- }
23
- exports.default = File;
@@ -1,30 +0,0 @@
1
- import * as nodeutil from "util";
2
- export type PathStruct = {
3
- dir?: string;
4
- name?: string;
5
- ext?: string;
6
- };
7
- export type PathLike = Path | string;
8
- export default class Path {
9
- private readonly _dir;
10
- private readonly _name;
11
- private readonly _ext;
12
- static from(path: PathLike | PathStruct, ...segments: PathLike[]): Path;
13
- constructor(pathname: string);
14
- replace(path: PathLike | PathStruct, replaceValue?: string): Path;
15
- join(...segments: PathLike[]): Path;
16
- from(to: PathLike): Path;
17
- to(from: PathLike): Path;
18
- get full(): string;
19
- get base(): string;
20
- get name(): string;
21
- set name(value: string);
22
- get ext(): string;
23
- set ext(value: string);
24
- get dir(): string;
25
- set dir(value: string);
26
- toString(): string;
27
- valueOf(): string;
28
- [nodeutil.inspect.custom](): string;
29
- }
30
- //# sourceMappingURL=Path.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Path.d.ts","sourceRoot":"","sources":["Path.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,MAAM,CAAA;AAGhC,MAAM,MAAM,UAAU,GAClB;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEjD,MAAM,MAAM,QAAQ,GAChB,IAAI,GAAG,MAAM,CAAA;AAEjB,MAAM,CAAC,OAAO,OAAO,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAQ;IAC7B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;IAC9B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAQ;WAEf,IAAI,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,EAAE,GAAG,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI;gBAelE,QAAQ,EAAE,MAAM;IAOrB,OAAO,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI;IAiBjE,IAAI,CAAC,GAAG,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI;IAInC,IAAI,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI;IAIxB,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI;IAI/B,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAW,IAAI,CAAC,KAAK,EAAE,MAAM,EAE5B;IAED,IAAW,GAAG,IAAI,MAAM,CAEvB;IAED,IAAW,GAAG,CAAC,KAAK,EAAE,MAAM,EAE3B;IAED,IAAW,GAAG,IAAI,MAAM,CAEvB;IAED,IAAW,GAAG,CAAC,KAAK,EAAE,MAAM,EAE3B;IAwCM,QAAQ;IAIR,OAAO,IAAI,MAAM;IAIjB,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM;CAG7C"}