@penskemediacorp/larva 1.75.1 → 1.77.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@penskemediacorp/larva",
3
- "version": "1.75.1",
3
+ "version": "1.77.0",
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",
@@ -45,16 +45,16 @@
45
45
  "dependencies": {
46
46
  "@babel/core": "^7",
47
47
  "@babel/preset-env": "^7",
48
- "@penskemediacorp/backstopjs-config": "^1.75.1",
49
- "@penskemediacorp/eslint-config": "^1.75.1",
50
- "@penskemediacorp/larva-css": "^1.75.1",
51
- "@penskemediacorp/larva-js": "^1.75.1",
52
- "@penskemediacorp/larva-patterns": "^1.75.1",
53
- "@penskemediacorp/larva-scss": "^1.75.1",
54
- "@penskemediacorp/larva-svg": "^1.75.1",
55
- "@penskemediacorp/larva-tokens": "^1.75.1",
56
- "@penskemediacorp/stylelint-config": "^1.75.1",
57
- "@penskemediacorp/twig-to-php-parser": "^1.75.1",
48
+ "@penskemediacorp/backstopjs-config": "^1.77.0",
49
+ "@penskemediacorp/eslint-config": "^1.77.0",
50
+ "@penskemediacorp/larva-css": "^1.77.0",
51
+ "@penskemediacorp/larva-js": "^1.77.0",
52
+ "@penskemediacorp/larva-patterns": "^1.77.0",
53
+ "@penskemediacorp/larva-scss": "^1.77.0",
54
+ "@penskemediacorp/larva-svg": "^1.77.0",
55
+ "@penskemediacorp/larva-tokens": "^1.77.0",
56
+ "@penskemediacorp/stylelint-config": "^1.77.0",
57
+ "@penskemediacorp/twig-to-php-parser": "^1.77.0",
58
58
  "axios": "^1",
59
59
  "babel-loader": "^9",
60
60
  "chalk": "^4",
@@ -96,5 +96,5 @@
96
96
  "overrides": {
97
97
  "@wordpress/eslint-plugin": "^17"
98
98
  },
99
- "gitHead": "f7139155550e18069eef02ef305b6ab5622cbc2f"
99
+ "gitHead": "4f246de4548be09e0eed5b4d071a02e6f4c11fba"
100
100
  }
@@ -5,6 +5,7 @@ const gulpIgnore = require( 'gulp-ignore' );
5
5
  const gulpPostCss = require( 'gulp-postcss' );
6
6
  const gulpRename = require( 'gulp-rename' );
7
7
  const gulpStylelint = require( 'gulp-stylelint' );
8
+ const through2 = require( 'through2' );
8
9
 
9
10
  const globImporter = require( 'node-sass-glob-importer' );
10
11
  const { mkdirpSync } = require( 'fs-extra' );
@@ -45,6 +46,25 @@ const stylelintOpts = {
45
46
  Functions
46
47
  **************/
47
48
 
49
+ /**
50
+ * Strip UTF-8 BOM from CSS files.
51
+ * Prevents junk characters in production when CSS is concatenated.
52
+ *
53
+ * @return {Stream} Gulp stream transformer.
54
+ */
55
+ const stripBom = () => {
56
+ return through2.obj( function ( file, enc, cb ) {
57
+ if ( file.isBuffer() ) {
58
+ // Remove UTF-8 BOM (0xEF 0xBB 0xBF) if present
59
+ const bom = Buffer.from( [ 0xef, 0xbb, 0xbf ] );
60
+ if ( file.contents.slice( 0, 3 ).equals( bom ) ) {
61
+ file.contents = file.contents.slice( 3 );
62
+ }
63
+ }
64
+ cb( null, file );
65
+ } );
66
+ };
67
+
48
68
  /**
49
69
  * Build CSS.
50
70
  *
@@ -70,6 +90,7 @@ const buildScss = (
70
90
  gulp.src( './entries/*.scss' )
71
91
  .pipe( gulpStylelint( stylelintOpts ) )
72
92
  .pipe( sass( sassOpts ).on( 'error', sass.logError ) )
93
+ .pipe( stripBom() ) // Remove UTF-8 BOM added by Sass compiler
73
94
  .pipe( gulp.dest( cssDest ) )
74
95
  .pipe( gulpIgnore.exclude( 'larva-ui.css' ) )
75
96
  .pipe(