subfont 6.5.0 → 6.8.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/CHANGELOG.md CHANGED
@@ -1,4 +1,33 @@
1
- ### v6.4.2 (2022-06-13)
1
+ ### v6.8.0 (2022-07-28)
2
+
3
+ - [Update assetgraph to ^7.8.1](https://github.com/Munter/subfont/commit/888a97912f98bd937a53b7bec0f39d50ddc96023) ([Andreas Lind](mailto:andreaslindpetersen@gmail.com))
4
+ - [Don't leave stylesheets behind that only contain comments after removing @font-face rules from them https:\/\/github.com\/Munter\/subfont\/issues\/160\#issuecomment-1194672752](https://github.com/Munter/subfont/commit/3dfd9dfbbe5071b94eb52ac216796bc7c0554078) ([Andreas Lind](mailto:andreaslindpetersen@gmail.com))
5
+
6
+ ### v6.7.0 (2022-07-24)
7
+
8
+ - [Update subset-font to ^1.5.0](https://github.com/Munter/subfont/commit/ba79ef6db81cedfd0e52672b530ca3afddd68a94) ([Andreas Lind](mailto:andreaslindpetersen@gmail.com))
9
+ - [Fix warning about missing glyphs for BMP chars](https://github.com/Munter/subfont/commit/5ba0168f35bfef33f9bb9cc8a6d64de8fa1d5585) ([Andreas Lind](mailto:andreaslindpetersen@gmail.com))
10
+ - [Fix CHANGELOG generation in preversion script](https://github.com/Munter/subfont/commit/3ea696f8c336c6072411c9817c0c2f5b8d8d61b9) ([Andreas Lind](mailto:andreaslindpetersen@gmail.com))
11
+
12
+ ### v6.6.1 (2022-07-09)
13
+
14
+ - [ugrvw](https://github.com/Munter/subfont/commit/5ccb873025f9790faf65641551df1a7e65fbfdbf) ([Andreas Lind](mailto:andreaslindpetersen@gmail.com))
15
+ - [Fix CHANGELOG https:\/\/github.com\/Munter\/subfont\/commit\/5365689a5a925304a158fddef2b6af702857371c\#r78084394](https://github.com/Munter/subfont/commit/d42c7a2cffd33662d42d4532c45cb8b90080f128) ([Andreas Lind](mailto:andreaslindpetersen@gmail.com))
16
+ - [Expect browserslist to only prescribe woff I guess the browser features + usage statistics finally changed so woff isn't needed](https://github.com/Munter/subfont/commit/b70db9b769955cabbda2f2a76f2e7758f9968ec7) ([Andreas Lind](mailto:andreaslindpetersen@gmail.com))
17
+ - [Tests: Tolerate u+ in unicode-range \(I guess an in-range dep changed\)](https://github.com/Munter/subfont/commit/92a7871457246b64a997c0bffd9bb2766655d811) ([Andreas Lind](mailto:andreaslindpetersen@gmail.com))
18
+
19
+ ### v6.6.0 (2022-07-09)
20
+
21
+ #### Pull requests
22
+
23
+ - [#162](https://github.com/Munter/subfont/pull/162) update changelog with proper version for 6.5.0 ([Jacob Lamont](mailto:cob@jacoblamont.com))
24
+
25
+ #### Commits to master
26
+
27
+ - [Fix extractReferencedCustomPropertyNames when there's a default value](https://github.com/Munter/subfont/commit/506375504384c1c292348427e98213482aadcae0) ([Andreas Lind](mailto:andreaslindpetersen@gmail.com))
28
+ - [Update font-tracer to ^3.2.0](https://github.com/Munter/subfont/commit/5028f72482be20a72a1301c4218820f89a950bdf) ([Andreas Lind](mailto:andreaslindpetersen@gmail.com))
29
+
30
+ ### v6.5.0 (2022-06-13)
2
31
 
3
32
  - [#161](https://github.com/Munter/subfont/pull/161) Add support for specifying additional characters to include in the subsets ([Andreas Lind](mailto:andreas.lind@workday.com), [Andreas Lind](mailto:andreaslindpetersen@gmail.com))
4
33
 
@@ -7,7 +7,7 @@ function extractReferencedCustomPropertyNames(cssValue) {
7
7
  if (
8
8
  node.type === 'function' &&
9
9
  node.value === 'var' &&
10
- node.nodes.length === 1 &&
10
+ node.nodes.length >= 1 &&
11
11
  node.nodes[0].type === 'word' &&
12
12
  /^--/.test(node.nodes[0].value)
13
13
  ) {
@@ -568,6 +568,12 @@ function getCodepoints(text) {
568
568
  return codepoints;
569
569
  }
570
570
 
571
+ function cssAssetIsEmpty(cssAsset) {
572
+ return cssAsset.parseTree.nodes.every(
573
+ (node) => node.type === 'comment' && !node.text.startsWith('!')
574
+ );
575
+ }
576
+
571
577
  async function subsetFonts(
572
578
  assetGraph,
573
579
  {
@@ -917,7 +923,7 @@ async function subsetFonts(
917
923
  if (missingGlyphsErrors.length) {
918
924
  const errorLog = missingGlyphsErrors.map(
919
925
  ({ char, fontUsage, location }) =>
920
- `- \\u{${char.charCodeAt(0).toString(16)}} (${char}) in font-family '${
926
+ `- \\u{${char.codePointAt(0).toString(16)}} (${char}) in font-family '${
921
927
  fontUsage.props['font-family']
922
928
  }' (${fontUsage.props['font-weight']}/${
923
929
  fontUsage.props['font-style']
@@ -1252,8 +1258,9 @@ These glyphs are used on your site, but they don't exist in the font you applied
1252
1258
  cssAsset.markDirty();
1253
1259
  maybeEmptyCssAssets.add(cssAsset);
1254
1260
  }
1261
+
1255
1262
  for (const cssAsset of maybeEmptyCssAssets) {
1256
- if (cssAsset.isEmpty) {
1263
+ if (cssAssetIsEmpty(cssAsset)) {
1257
1264
  for (const incomingRelation of cssAsset.incomingRelations) {
1258
1265
  incomingRelation.detach();
1259
1266
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "subfont",
3
- "version": "6.5.0",
3
+ "version": "6.8.0",
4
4
  "description": "Speeds up your pages initial paint by automatically subsetting local or Google fonts and loading them optimally",
5
5
  "engines": {
6
6
  "node": ">=10.0.0"
@@ -10,7 +10,7 @@
10
10
  "test": "mocha && npm run lint",
11
11
  "travis": "npm run coverage && npm run lint",
12
12
  "coverage": "nyc --reporter=lcov --reporter=text -- mocha",
13
- "preversion": "offline-github-changelog --next=${npm_package_version} > CHANGELOG.md && git add CHANGELOG.md"
13
+ "preversion": "offline-github-changelog --next=${npm_new_version} > CHANGELOG.md && git add CHANGELOG.md"
14
14
  },
15
15
  "bin": {
16
16
  "subfont": "lib/cli.js"
@@ -47,14 +47,14 @@
47
47
  "homepage": "https://github.com/Munter/subfont#readme",
48
48
  "dependencies": {
49
49
  "@gustavnikolaj/async-main-wrap": "^3.0.1",
50
- "assetgraph": "^7.2.0",
50
+ "assetgraph": "^7.8.1",
51
51
  "browserslist": "^4.13.0",
52
52
  "css-font-parser": "^0.3.0",
53
53
  "css-font-weight-names": "^0.2.1",
54
54
  "css-list-helpers": "^2.0.0",
55
55
  "font-family-papandreou": "^0.2.0-patch2",
56
56
  "font-snapper": "^1.2.0",
57
- "font-tracer": "^3.1.0",
57
+ "font-tracer": "^3.2.0",
58
58
  "fontkit": "^1.8.0",
59
59
  "fontverter": "^2.0.0",
60
60
  "gettemporaryfilepath": "^1.0.1",
@@ -66,7 +66,7 @@
66
66
  "pretty-bytes": "^5.1.0",
67
67
  "puppeteer-core": "^8.0.0",
68
68
  "specificity": "^0.4.1",
69
- "subset-font": "^1.4.0",
69
+ "subset-font": "^1.5.0",
70
70
  "urltools": "^0.4.1",
71
71
  "yargs": "^15.4.0"
72
72
  },