@@ -4,33 +4,34 @@ const path = require('path');
44const mandelbrot = require ( '@frctl/mandelbrot' ) ;
55const minimist = require ( 'minimist' ) ;
66
7- const { getStaticFilePath } = require ( __dirname + '/bin/get-path.js' ) ;
7+ // Get base config
8+ const fractal = require ( '@tacc/core-styles/fractal.config.js' ) ;
9+ const themeConfig = require ( '@tacc/core-styles/fractal.theme.js' ) ;
810
11+ // Get project
12+ // (name)
13+ const { getStaticFilePath } = require ( __dirname + '/bin/get-path.js' ) ;
914const args = minimist ( process . argv . slice ( 2 ) ) ;
1015let projectName = args [ 'project' ] || '' ;
1116 projectName = ( projectName !== 'core-cms' ) ? projectName : '' ;
17+ // (stylesheet)
1218const projectCSSFile = projectName
1319 ? path . join ( '/' , getStaticFilePath ( projectName , 'css/build/site.css' ) )
1420 : null ;
1521
16- const fractal = require ( '@tacc/core-styles/fractal.config.js' ) ;
17- const themeConfig = require ( '@tacc/core-styles/fractal.theme.js' ) ;
18-
19- const theme = mandelbrot ( Object . assign ( themeConfig , {
20- skin : Object . assign ( themeConfig . skin , {
21- links : '#877453' ,
22- } )
23- } ) ) ;
24-
22+ // Get base path
2523const coreStylesRoot = path . join (
2624 path . dirname ( require . resolve ( '@tacc/core-styles' ) ) ,
27- // The '../' exits 'src/' which require.resolve returns a file from
25+ // The '../' exits 'src/' which is at the end of what require.resolve returns
2826 '../'
2927) ;
3028
29+ // Set source paths
30+ // (for components)
3131fractal . components . set ( 'path' ,
3232 path . join ( coreStylesRoot , 'src/lib/_imports' )
3333) ;
34+ // (for stylesheets)
3435fractal . components . set ( 'default.context' , {
3536 styles : {
3637 external : {
@@ -47,11 +48,17 @@ if ( projectCSSFile ) {
4748 fractal . cli . log ( `+ Included CSS for "${ projectName } ": '${ projectCSSFile } '` ) ;
4849}
4950
50- fractal . web . set ( 'static.path' ,
51- path . join ( coreStylesRoot , 'dist' )
52- ) ;
51+ // Set website paths
52+ fractal . web . set ( 'static.path' , path . join ( coreStylesRoot , 'dist' ) ) ;
5353fractal . web . set ( 'builder.dest' , __dirname + '/taccsite_ui' ) ;
5454
55+ // Customize theme
56+ const theme = mandelbrot ( Object . assign ( themeConfig , {
57+ skin : Object . assign ( themeConfig . skin , {
58+ links : '#877453' ,
59+ } )
60+ } ) ) ;
5561fractal . web . theme ( theme ) ;
5662
63+ // Export
5764module . exports = fractal ;
0 commit comments