progressively-enhance-web-components 1.0.2 → 1.0.3

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/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@
4
4
 
5
5
  - Put your changes here...
6
6
 
7
+ ## 1.0.3
8
+
9
+ - Fixed another bug that caused errors to print to the console if inline CSS existed in a scanned template.
10
+
7
11
  ## 1.0.2
8
12
 
9
13
  - Fixed a bug that could cause templates to be significantly altered by this preprocessor due to having been fully ingested by a DOM parser and then re-serialized back into a string. As of this version, only the custom elements that are progressively enhanced will be ingested by the DOM parser and re-serialized back into a string.
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "url": "https://github.com/rooseveltframework/progressively-enhance-web-components/graphs/contributors"
9
9
  }
10
10
  ],
11
- "version": "1.0.2",
11
+ "version": "1.0.3",
12
12
  "homepage": "https://github.com/rooseveltframework/progressively-enhance-web-components",
13
13
  "license": "CC-BY-4.0",
14
14
  "main": "progressively-enhance-web-components.js",
@@ -29,9 +29,10 @@ function isBinaryFile (filePath, bytesToCheck = 512) {
29
29
 
30
30
  // hack to get jsdom to shut up about invalid css
31
31
  const originalConsoleError = console.error
32
- console.error = (...args) => {
33
- if (args?.[0]?.type !== 'css parsing') {
34
- originalConsoleError(...args)
32
+ const jsDomCssError = 'Error: Could not parse CSS stylesheet'
33
+ console.error = (...params) => {
34
+ if (!params.find(p => p.toString().includes(jsDomCssError))) {
35
+ originalConsoleError(...params)
35
36
  }
36
37
  }
37
38