-
Notifications
You must be signed in to change notification settings - Fork 0
/
fractal.config.js
123 lines (95 loc) · 2.7 KB
/
fractal.config.js
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
'use strict';
// Require statements
const path = require('path');
const argVals = process.argv.slice(2);
const fractalEnv = argVals && argVals.includes('build') ? 'production': 'dev';
const twigDocsAdapter = require('@frctl/twig');
const twigAdapter = require('@wondrousllc/fractal-twig-drupal-adapter')({
handlePrefix: '@fractal/',
});
// Init Fractal
const fractal = module.exports = require('@frctl/fractal').create();
// Setup Twig
// fractal.components.engine(frctlTwig);
fractal.components.engine(twigAdapter);
fractal.components.set('ext', '.twig');
fractal.docs.engine(twigDocsAdapter);
// Metadata
fractal.set('project.title', 'BC Grid');
fractal.set('project.version', 'v1.0');
// Components/Docs Settings
fractal.components.set('path', path.join('./fractal', 'patterns'));
fractal.components.set('default.preview', '@preview');
fractal.docs.set('path', path.join('./fractal', 'docs'));
// Static Asssets Path
fractal.web.set('static.path', path.join('./assets', 'dist'));
// if ( fractalEnv === 'production' ) {
// console.log('its production');
// fractal.web.set('static.mount', path.join('brand', 'style-guide'));
// }
// Set Build Directory
fractal.web.set('builder.dest', path.join('.', 'docs'));
// Custom Fractal Theme
const mandelbrot = require('@frctl/mandelbrot');
// const theme = require('@bluecadet/cadetfrctl')(mandelbrot, {
// favicon: '/images/fractal_favicon.png',
// styles: ['default', '/css/fractal.css'],
// panels: [
// 'html',
// 'view',
// 'context',
// 'resources',
// 'notes',
// 'a11y'
// ],
// });
const theme = mandelbrot({
favicon: '/dependencies/fractal/fractal_favicon.ico',
styles: ['default', '/css/fractal-theme.css'],
nav: ['docs', 'components'],
panels: [
'html',
'view',
'context',
'resources',
'notes',
],
});
fractal.web.theme(theme);
const root = process.cwd();
const ignoredCssFiles = [
path.join(root, './assets/src/**/*.css'),
path.join(root, './fractal/**/*.css'),
];
fractal.web.set('server.sync', true);
fractal.web.set('server.port', 3006);
fractal.web.set('server.syncOptions', {
// open: true,
watchOptions: {
ignored: ignoredCssFiles,
},
});
// Default Context
fractal.components.set('default.context', {
'isFractal': true,
'env': fractalEnv,
});
// Statues
fractal.components.set('statuses', {
proto: {
label: 'Prototype',
description: 'Do not implement.',
color: '#CB2D17',
},
wip: {
label: 'WIP',
description: 'Work in progress, subject to changes.',
color: '#FF8F61',
},
ready: {
label: 'Ready',
description: 'Ready to implement.',
color: '#1A901C',
},
});
fractal.components.set('default.status', 'wip');