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
|
@@ -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,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 @@
|
|
|
1
|
+
export * from "@storybook/addon-vitest/preset";
|
|
@@ -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,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,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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
package/bin/run.cmd
DELETED
package/lib/commands/build.d.ts
DELETED
|
@@ -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"}
|
package/lib/commands/build.js
DELETED
|
@@ -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
|
-
}
|
package/lib/commands/serve.d.ts
DELETED
|
@@ -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"}
|
package/lib/commands/serve.js
DELETED
|
@@ -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"}
|