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.
@@ -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,CA8BjF"}
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"}
@@ -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
- // Todo: Disable `outlinecss` plugin
16
- // const signals = []
17
- // for (const plugin of configuration.plugins) {
18
- // signals.push(plugin.install(emitter, configuration))
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
- // await Promise.all(signals)
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,CA2BjF"}
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"}
@@ -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: configuration.directories.output.full,
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":[],"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,KAA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,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"}
@@ -12,6 +12,7 @@ var FileExtension;
12
12
  FileExtension["HTML"] = "html";
13
13
  })(FileExtension || (exports.FileExtension = FileExtension = {}));
14
14
  const defaults = {
15
+ base: "/",
15
16
  renderer: {
16
17
  engine: "ejs",
17
18
  extension: ".html"
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.2",
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": {