webanvil 0.0.2 → 0.0.4
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/lib/commands/build.d.ts.map +1 -1
- package/lib/commands/build.js +5 -6
- package/lib/commands/serve.d.ts.map +1 -1
- package/lib/commands/serve.js +6 -1
- package/lib/core/Configuration.d.ts +2 -0
- package/lib/core/Configuration.d.ts.map +1 -1
- package/lib/core/Configuration.js +1 -0
- package/lib/main.js +3 -3
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["build.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,8BAA4B;AAMhD,wBAA8B,KAAK,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["build.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,8BAA4B;AAMhD,wBAA8B,KAAK,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CA6BjF"}
|
package/lib/commands/build.js
CHANGED
|
@@ -12,11 +12,10 @@ async function build(configuration) {
|
|
|
12
12
|
.map(pathname => Page_1.default.from(pathname));
|
|
13
13
|
const renderer = Renderer_1.default.from(configuration);
|
|
14
14
|
const emitter = new EventEmitter_1.default();
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// }
|
|
15
|
+
const signals = [];
|
|
16
|
+
for (const plugin of configuration.plugins) {
|
|
17
|
+
signals.push(plugin.install(emitter, configuration));
|
|
18
|
+
}
|
|
20
19
|
sync_1.fs.rm(configuration.directories.output);
|
|
21
20
|
for (const page of pages) {
|
|
22
21
|
const html = renderer.render(page);
|
|
@@ -32,6 +31,6 @@ async function build(configuration) {
|
|
|
32
31
|
sync_1.fs.cp(configuration.directories.public, configuration.directories.output);
|
|
33
32
|
}
|
|
34
33
|
emitter.emit(EventEmitter_1.Event.END);
|
|
35
|
-
|
|
34
|
+
await Promise.all(signals);
|
|
36
35
|
return 0;
|
|
37
36
|
}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,CAgCjF"}
|
package/lib/commands/serve.js
CHANGED
|
@@ -24,7 +24,12 @@ async function serve(configuration) {
|
|
|
24
24
|
browser.watch(index_1.path.join(configuration.directories.styles, `**/*`).full)
|
|
25
25
|
.on("change", run(rebuild, reload));
|
|
26
26
|
browser.init({
|
|
27
|
-
server:
|
|
27
|
+
server: {
|
|
28
|
+
baseDir: configuration.directories.output.full,
|
|
29
|
+
routes: {
|
|
30
|
+
[configuration.base]: configuration.directories.output.full
|
|
31
|
+
}
|
|
32
|
+
},
|
|
28
33
|
open: false
|
|
29
34
|
});
|
|
30
35
|
return new Promise(() => void 0);
|
|
@@ -23,8 +23,10 @@ type Configuration = {
|
|
|
23
23
|
renderer: RendererConfiguration;
|
|
24
24
|
directories: DirectoriesConfiguration;
|
|
25
25
|
plugins: Plugin[];
|
|
26
|
+
base: string;
|
|
26
27
|
};
|
|
27
28
|
export type PlainConfiguration = {
|
|
29
|
+
base: string;
|
|
28
30
|
renderer: Record<keyof RendererConfiguration, string>;
|
|
29
31
|
directories: Record<keyof DirectoriesConfiguration, string>;
|
|
30
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Configuration.d.ts","sourceRoot":"","sources":["Configuration.ts"],"names":[],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AED,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"}
|
package/lib/main.js
CHANGED
|
@@ -9,8 +9,8 @@ const DEFAULT_OUTPUT = "./website-dist";
|
|
|
9
9
|
const DEFAULT_ENTRY = "./website";
|
|
10
10
|
async function main(...varargs) {
|
|
11
11
|
const options = minimist(varargs, {
|
|
12
|
-
alias: { o: "output", e: "entry" },
|
|
13
|
-
default: { output: DEFAULT_OUTPUT, entry: DEFAULT_ENTRY }
|
|
12
|
+
alias: { o: "output", e: "entry", b: "base" },
|
|
13
|
+
default: { output: DEFAULT_OUTPUT, entry: DEFAULT_ENTRY, base: "/" }
|
|
14
14
|
});
|
|
15
15
|
const [command] = varargs;
|
|
16
16
|
const directories = {
|
|
@@ -22,7 +22,7 @@ async function main(...varargs) {
|
|
|
22
22
|
partials: `${options.entry}/templates/partials`,
|
|
23
23
|
layouts: `${options.entry}/templates/layouts`
|
|
24
24
|
};
|
|
25
|
-
const configuration = Configuration_1.default.from({ directories });
|
|
25
|
+
const configuration = Configuration_1.default.from({ directories, base: options.base });
|
|
26
26
|
switch (command) {
|
|
27
27
|
default:
|
|
28
28
|
case "build":
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webanvil",
|
|
3
3
|
"description": "A zero configuration static site generator that just works.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
7
7
|
"bin": {
|
|
8
8
|
"webanvil": "bin/run"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"serve:website": "npx webanvil serve",
|
|
11
|
+
"serve:website": "npx webanvil serve --base /webanvil/",
|
|
12
12
|
"build": "npm run build:library && npm run build:website",
|
|
13
13
|
"build:library": "npm run clean && tsc --build",
|
|
14
14
|
"build:website": "npx webanvil",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"browser-sync": "^3.0.3",
|
|
21
21
|
"gray-matter": "^4.0.3",
|
|
22
22
|
"minimist": "^1.2.8",
|
|
23
|
+
"outlinecss": "^0.0.3",
|
|
23
24
|
"rollup": "^4.34.6"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|