@penskemediacorp/larva 0.3.9-develop.3 → 0.3.9-develop.5

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.
@@ -8,7 +8,7 @@ const getAppConfiguration = require( './utils/getAppConfiguration' );
8
8
  const copySyncHelper = require( './utils/copySyncHelper' );
9
9
 
10
10
  const assetsConfig = getAppConfiguration( 'assets' );
11
- const webfontsConfig = getAppConfiguration( 'webfonts' );
11
+ const themeAssetsConfig = getAppConfiguration( 'themeAssets' );
12
12
 
13
13
  /**
14
14
  * Generate Static HTML
@@ -67,7 +67,15 @@ module.exports = function generateStatic( routesArr, buildPath, done, urlBase =
67
67
  });
68
68
 
69
69
  copySyncHelper( publicAssetsSrc, publicAssetsDest );
70
- copySyncHelper( webfontsConfig.path, path.join( publicAssetsDest, 'webfonts' ) );
70
+
71
+ const themeAssetKeys = Object.keys( themeAssetsConfig );
72
+
73
+ themeAssetKeys.forEach( key => {
74
+ const src = themeAssetsConfig[key];
75
+ const dest = path.join( buildPath, `../assets/theme/${key}` );
76
+
77
+ copySyncHelper( src, dest );
78
+ });
71
79
 
72
80
  // Build the site.
73
81
  // Cycle through the list of routes and write the response
package/lib/server.js CHANGED
@@ -23,7 +23,7 @@ const app = express();
23
23
  const patternConfig = getAppConfiguration( 'patterns' );
24
24
  const brandConfig = getAppConfiguration( 'brand' );
25
25
  const assetsConfig = getAppConfiguration( 'assets' );
26
- const webfontsConfig = getAppConfiguration( 'webfonts' );
26
+ const themeAssetsConfig = getAppConfiguration( 'themeAssets' );
27
27
  const twigPaths = getPatternPathsToLoad( patternConfig );
28
28
 
29
29
  let loader = new TwingLoaderFilesystem( twigPaths );
@@ -84,9 +84,12 @@ if ( fs.existsSync( assetsConfig.path ) ) {
84
84
  app.use( '/assets' , express.static( assetsConfig.path ) );
85
85
  }
86
86
 
87
- if ( fs.existsSync( webfontsConfig.path ) ) {
88
- app.use( '/assets/public/webfonts' , express.static( webfontsConfig.path ) );
89
- }
87
+ // Expose any theme directories with assets in the express server
88
+ const themeAssetKeys = Object.keys( themeAssetsConfig );
89
+
90
+ themeAssetKeys.forEach( key => {
91
+ app.use( '/assets/theme/' + key , express.static( themeAssetsConfig[key] ) );
92
+ });
90
93
 
91
94
  app.use( '/:source?/css', function (req, res) {
92
95
 
@@ -52,9 +52,7 @@ const defaultConfig = {
52
52
  })(),
53
53
  },
54
54
 
55
- webfonts: {
56
- path: path.resolve( './src/fonts' )
57
- },
55
+ themeAssets: {},
58
56
  };
59
57
 
60
58
  module.exports = function getAppConfiguration( key, usePackageDefault = true ) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@penskemediacorp/larva",
3
- "version": "0.3.9-develop.3+7ba1cc94",
3
+ "version": "0.3.9-develop.5+c3d02735",
4
4
  "description": "> TODO: description",
5
5
  "author": "laras126 <laras126@gmail.com>",
6
6
  "homepage": "https://github.com/Penske-Media-Corp/pmc-larva/tree/master/packages/larva#readme",
@@ -47,7 +47,7 @@
47
47
  "@penskemediacorp/eslint-config": "^0.3.8",
48
48
  "@penskemediacorp/larva-css": "^0.3.8",
49
49
  "@penskemediacorp/larva-js": "^0.3.5",
50
- "@penskemediacorp/larva-patterns": "^0.3.9-develop.3+7ba1cc94",
50
+ "@penskemediacorp/larva-patterns": "^0.3.8",
51
51
  "@penskemediacorp/larva-scss": "^0.3.5",
52
52
  "@penskemediacorp/larva-svg": "^0.3.5",
53
53
  "@penskemediacorp/larva-tokens": "^0.3.8",
@@ -88,5 +88,5 @@
88
88
  "webpack": "^4.43.0",
89
89
  "webpack-cli": "^3.3.12"
90
90
  },
91
- "gitHead": "7ba1cc945dba54ac8eaefa2e12c21007f8819f26"
91
+ "gitHead": "c3d027359877e55ce1fdae88fb2df3c2768acd52"
92
92
  }