Skip to content
This repository was archived by the owner on Aug 29, 2022. It is now read-only.

Commit c5b224b

Browse files
committed
Update to fractal.config file
1 parent d6ef630 commit c5b224b

File tree

3 files changed

+56
-3
lines changed

3 files changed

+56
-3
lines changed

fractal.config.js

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
"use strict";
2+
const pkg = require("./package.json");
3+
const path = require("path");
4+
const fractal = require("@frctl/fractal").create();
5+
6+
const context = {
7+
package: {
8+
name: pkg.name,
9+
version: pkg.version
10+
},
11+
uswds: {
12+
path: "../../dist"
13+
}
14+
};
15+
16+
fractal.set("project.title", `U.S. Web Design System (v${pkg.version})`);
17+
18+
const components = fractal.components;
19+
components.set("ext", ".njk");
20+
components.set("path", "src/components");
21+
components.set("default.preview", "@uswds");
22+
components.set("default.context", context);
23+
24+
// use Nunjucks as the templating engine
25+
components.engine(
26+
require("@frctl/nunjucks")({
27+
filters: {
28+
jsonify: d => JSON.stringify(d, null, " "),
29+
dataurl: (d, type) => `data:${type},${encodeURIComponent(d)}`
30+
},
31+
paths: ["src/components"]
32+
})
33+
);
34+
35+
const web = fractal.web;
36+
37+
web.theme(
38+
require("@frctl/mandelbrot")({
39+
lang: "en-US",
40+
skin: "white",
41+
// display context data in YAML
42+
format: "yaml",
43+
// which panels to show
44+
panels: ["html", "notes", "view", "context", "resources", "info"]
45+
})
46+
);
47+
48+
web.set("static.path", "dist");
49+
web.set("static.mount", "dist");
50+
// output files to /build
51+
web.set("builder.dest", "build");
52+
53+
module.exports = fractal;

spec/chrome-fractal-tester.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const os = require("os");
22
const urlParse = require("url").parse;
33
const chromeLauncher = require("chrome-launcher");
44
const CDP = require("chrome-remote-interface");
5-
const fractal = require("../fractal");
5+
const fractal = require("../fractal.config");
66

77
const { REMOTE_CHROME_URL } = process.env;
88
const HOSTNAME = REMOTE_CHROME_URL ? os.hostname().toLowerCase() : "localhost";
@@ -63,7 +63,7 @@ const getChrome = REMOTE_CHROME_URL ? getRemoteChrome : launchChromeLocally;
6363
const server = fractal.web.server({ sync: false });
6464

6565
// eslint-disable-next-line no-param-reassign, no-return-assign
66-
const autobind = self => name => self[name] = self[name].bind(self);
66+
const autobind = self => name => (self[name] = self[name].bind(self));
6767

6868
class ChromeFractalTester {
6969
constructor() {

spec/delayed-root-suite.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// prerequistes needed for test collection to work. That's what
1010
// this file is for.
1111

12-
const fractal = require("../fractal");
12+
const fractal = require("../fractal.config");
1313

1414
exports.fractalLoad = fractal.components.load();
1515

0 commit comments

Comments
 (0)