reffy 10.1.3 → 10.2.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": "reffy",
3
- "version": "10.1.3",
3
+ "version": "10.2.0",
4
4
  "description": "W3C/WHATWG spec dependencies exploration companion. Features a short set of tools to study spec references as well as WebIDL term definitions and references found in W3C specifications.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,28 +27,28 @@
27
27
  ],
28
28
  "license": "MIT",
29
29
  "engines": {
30
- "node": ">=14"
30
+ "node": ">=14.18"
31
31
  },
32
32
  "main": "index.js",
33
33
  "bin": "./reffy.js",
34
34
  "dependencies": {
35
- "abortcontroller-polyfill": "1.7.3",
35
+ "abortcontroller-polyfill": "1.7.5",
36
36
  "ajv": "8.11.0",
37
37
  "ajv-formats": "2.1.1",
38
38
  "commander": "9.4.1",
39
39
  "fetch-filecache-for-crawling": "4.1.0",
40
40
  "puppeteer": "18.2.1",
41
41
  "semver": "^7.3.5",
42
- "web-specs": "2.29.0",
42
+ "web-specs": "2.31.0",
43
43
  "webidl2": "24.2.2"
44
44
  },
45
45
  "devDependencies": {
46
46
  "chai": "4.3.6",
47
47
  "mocha": "10.0.0",
48
48
  "nock": "13.2.9",
49
- "respec": "32.2.5",
49
+ "respec": "32.3.0",
50
50
  "respec-hljs": "2.1.1",
51
- "rollup": "2.79.1"
51
+ "rollup": "3.1.0"
52
52
  },
53
53
  "scripts": {
54
54
  "test": "mocha --recursive tests/"
@@ -230,6 +230,13 @@ export default function (spec, idToHeading = {}) {
230
230
  return node;
231
231
  })
232
232
  .filter(hasValidType)
233
+ // When the whole term links to an external spec, the definition is an
234
+ // imported definition. Such definitions are not "real" definitions, let's
235
+ // skip them.
236
+ .filter(node => {
237
+ const link = node.querySelector('a[href^="http"]');
238
+ return !link || (node.textContent.trim() !== link.textContent.trim());
239
+ })
233
240
  .map(node => definitionMapper(node, idToHeading));
234
241
  }
235
242
 
@@ -583,32 +590,6 @@ function preProcessHTML() {
583
590
  el.id = headingId;
584
591
  }
585
592
  });
586
-
587
- // all the definitions in indices.html are non-normative, so we skip them
588
- // to avoid having to properly type them
589
- // they're not all that interesting
590
- document.querySelectorAll('section[data-reffy-page$="indices.html"] dfn[id]')
591
- .forEach(el => {
592
- el.dataset.dfnSkip = true;
593
- });
594
-
595
- document.querySelectorAll("dfn[id]:not([data-dfn-type]):not([data-skip])")
596
- .forEach(el => {
597
- // Hard coded rules for special ids
598
- // dom-style is defined elsewhere
599
- if (el.id === "dom-style") {
600
- el.dataset.dfnType = 'attribute';
601
- el.dataset.dfnFor = 'HTMLElement';
602
- el.dataset.noexport = "";
603
- return;
604
- }
605
-
606
- // If there is a link, we assume this documents an imported definition
607
- // so we make it ignored by removing the id
608
- if (el.querySelector('a[href^="http"]')) {
609
- return;
610
- }
611
- });
612
593
  }
613
594
 
614
595
  function preProcessSVG2() {