reffy 20.0.13 → 20.0.15

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.
Files changed (78) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +151 -151
  3. package/index.js +29 -29
  4. package/package.json +5 -5
  5. package/reffy.js +324 -324
  6. package/schemas/browserlib/extract-algorithms.json +52 -52
  7. package/schemas/browserlib/extract-cssdfn.json +108 -108
  8. package/schemas/browserlib/extract-dfns.json +90 -90
  9. package/schemas/browserlib/extract-elements.json +17 -17
  10. package/schemas/browserlib/extract-events.json +31 -31
  11. package/schemas/browserlib/extract-headings.json +19 -19
  12. package/schemas/browserlib/extract-ids.json +7 -7
  13. package/schemas/browserlib/extract-links.json +12 -12
  14. package/schemas/browserlib/extract-refs.json +12 -12
  15. package/schemas/common.json +876 -876
  16. package/schemas/files/extracts/algorithms.json +12 -12
  17. package/schemas/files/extracts/css.json +16 -16
  18. package/schemas/files/extracts/dfns.json +12 -12
  19. package/schemas/files/extracts/elements.json +12 -12
  20. package/schemas/files/extracts/events.json +12 -12
  21. package/schemas/files/extracts/headings.json +12 -12
  22. package/schemas/files/extracts/ids.json +12 -12
  23. package/schemas/files/extracts/links.json +12 -12
  24. package/schemas/files/extracts/refs.json +12 -12
  25. package/schemas/files/index.json +59 -59
  26. package/schemas/postprocessing/events.json +50 -50
  27. package/schemas/postprocessing/idlnames-parsed.json +27 -27
  28. package/schemas/postprocessing/idlnames.json +17 -17
  29. package/schemas/postprocessing/idlparsed.json +67 -67
  30. package/src/browserlib/clone-and-clean.mjs +24 -24
  31. package/src/browserlib/create-outline.mjs +353 -353
  32. package/src/browserlib/extract-algorithms.mjs +723 -723
  33. package/src/browserlib/extract-cddl.mjs +125 -125
  34. package/src/browserlib/extract-dfns.mjs +1093 -1093
  35. package/src/browserlib/extract-headings.mjs +76 -76
  36. package/src/browserlib/extract-ids.mjs +28 -28
  37. package/src/browserlib/extract-links.mjs +45 -45
  38. package/src/browserlib/extract-references.mjs +308 -308
  39. package/src/browserlib/extract-webidl.mjs +89 -89
  40. package/src/browserlib/get-absolute-url.mjs +29 -29
  41. package/src/browserlib/get-code-elements.mjs +20 -20
  42. package/src/browserlib/get-generator.mjs +26 -26
  43. package/src/browserlib/get-lastmodified-date.mjs +13 -13
  44. package/src/browserlib/get-revision.mjs +12 -12
  45. package/src/browserlib/get-title.mjs +14 -14
  46. package/src/browserlib/informative-selector.mjs +24 -24
  47. package/src/browserlib/map-ids-to-headings.mjs +173 -173
  48. package/src/browserlib/reffy.json +85 -85
  49. package/src/browserlib/trim-spaces.mjs +35 -35
  50. package/src/cli/check-missing-dfns.js +587 -587
  51. package/src/cli/merge-crawl-results.js +132 -132
  52. package/src/cli/parse-webidl.js +447 -447
  53. package/src/lib/css-grammar-parse-tree.schema.json +109 -109
  54. package/src/lib/css-grammar-parser.js +440 -440
  55. package/src/lib/fetch.js +51 -51
  56. package/src/lib/markdown-report.js +360 -360
  57. package/src/lib/mock-server.js +218 -218
  58. package/src/lib/post-processor.js +322 -322
  59. package/src/lib/throttled-queue.js +129 -129
  60. package/src/postprocessing/annotate-links.js +41 -41
  61. package/src/postprocessing/csscomplete.js +48 -48
  62. package/src/postprocessing/idlnames.js +391 -391
  63. package/src/postprocessing/idlparsed.js +179 -179
  64. package/src/postprocessing/patch-dfns.js +51 -51
  65. package/src/specs/missing-css-rules.json +197 -197
  66. package/src/specs/spec-equivalents.json +149 -149
  67. package/src/browserlib/extract-editors.mjs~ +0 -14
  68. package/src/browserlib/extract-events.mjs~ +0 -3
  69. package/src/browserlib/generate-es-dfn-report.sh~ +0 -4
  70. package/src/browserlib/get-revision.mjs~ +0 -7
  71. package/src/cli/csstree-grammar-check.js +0 -28
  72. package/src/cli/csstree-grammar-check.js~ +0 -10
  73. package/src/cli/csstree-grammar-parser.js +0 -11
  74. package/src/cli/csstree-grammar-parser.js~ +0 -1
  75. package/src/cli/extract-editors.js~ +0 -38
  76. package/src/cli/process-specs.js~ +0 -28
  77. package/src/postprocessing/annotate-links.js~ +0 -8
  78. package/src/postprocessing/events.js~ +0 -245
@@ -1,149 +1,149 @@
1
- {
2
- "https://www.w3.org/TR/webmessaging/": [
3
- "https://html.spec.whatwg.org/"
4
- ],
5
- "https://www.w3.org/TR/2dcontext/": [
6
- "https://html.spec.whatwg.org/",
7
- "https://www.whatwg.org/specs/web-apps/current-work/multipage/",
8
- "https://www.w3.org/TR/2dcontext2/"
9
- ],
10
- "https://www.w3.org/TR/workers/": [
11
- "https://html.spec.whatwg.org/"
12
- ],
13
- "https://html.spec.whatwg.org/multipage/": [
14
- "https://w3c.github.io/html/",
15
- "https://www.w3.org/TR/html/",
16
- "https://www.w3.org/TR/html5/",
17
- "https://www.w3.org/TR/html51/",
18
- "https://www.w3.org/TR/html52/",
19
- "https://html.spec.whatwg.org/",
20
- "https://www.whatwg.org/specs/web-apps/current-work/multipage/",
21
- "https://www.w3.org/TR/eventsource/",
22
- "https://www.w3.org/TR/webmessaging/",
23
- "https://www.w3.org/TR/2dcontext/",
24
- "https://www.w3.org/TR/2dcontext2/",
25
- "https://www.w3.org/TR/webstorage/",
26
- "https://www.w3.org/TR/workers/",
27
- "https://www.w3.org/TR/websockets/",
28
- "https://www.w3.org/html/wg/drafts/html/master/webappapis.html"
29
- ],
30
- "https://www.w3.org/TR/dom41/": [
31
- "https://dom.spec.whatwg.org/",
32
- "https://www.w3.org/TR/dom/",
33
- "https://www.w3.org/TR/DOM-Level-3-Core/",
34
- "https://www.w3.org/TR/domcore/",
35
- "https://www.w3.org/TR/REC-DOM-Level-1/"
36
- ],
37
- "https://www.w3.org/TR/html52/": [
38
- "https://www.w3.org/TR/html/",
39
- "https://www.w3.org/TR/html5/",
40
- "https://www.w3.org/TR/html51/",
41
- "https://www.w3.org/TR/html52/",
42
- "https://html.spec.whatwg.org/",
43
- "https://html.spec.whatwg.org/multipage/"
44
- ],
45
- "https://dom.spec.whatwg.org/": [
46
- "https://www.w3.org/TR/dom/",
47
- "https://www.w3.org/TR/dom41/",
48
- "https://www.w3.org/TR/DOM-Level-3-Core/",
49
- "https://www.w3.org/TR/domcore/",
50
- "https://www.w3.org/TR/REC-DOM-Level-1/"
51
- ],
52
- "https://www.khronos.org/registry/webgl/specs/latest/1.0/": [
53
- "https://www.khronos.org/registry/webgl/specs/1.0/",
54
- "https://www.khronos.org/registry/webgl/specs/latest/"
55
- ],
56
- "https://www.w3.org/TR/notifications/": [
57
- "https://notifications.spec.whatwg.org/"
58
- ],
59
- "https://www.w3.org/TR/geolocation-API/": [
60
- "https://dev.w3.org/geo/api/spec-source.html"
61
- ],
62
- "https://www.w3.org/TR/uievents/": [
63
- "https://w3c.github.io/uievents/"
64
- ],
65
- "https://www.w3.org/TR/mediacapture-streams/": [
66
- "https://w3c.github.io/mediacapture-main/getusermedia.html"
67
- ],
68
- "https://www.w3.org/TR/vibration/": [
69
- "https://dev.w3.org/2009/dap/vibration/"
70
- ],
71
- "https://www.w3.org/TR/html-media-capture/": [
72
- "https://dev.w3.org/2009/dap/camera/"
73
- ],
74
- "https://www.w3.org/TR/service-workers-1/": [
75
- "https://w3c.github.io/ServiceWorker/",
76
- "https://www.w3.org/TR/service-workers/"
77
- ],
78
- "https://www.w3.org/TR/webvtt1/": [
79
- "https://dev.w3.org/html5/webvtt/"
80
- ],
81
- "https://www.w3.org/TR/WebCryptoAPI/": [
82
- "https://w3c.github.io/webcrypto/"
83
- ],
84
- "https://www.w3.org/TR/pointerlock-2/": [
85
- "https://www.w3.org/TR/pointerlock/"
86
- ],
87
- "https://www.w3.org/TR/hr-time-3/": [
88
- "https://www.w3.org/TR/hr-time/",
89
- "https://www.w3.org/TR/hr-time-2/"
90
- ],
91
- "https://www.w3.org/TR/navigation-timing-2/": [
92
- "https://www.w3.org/TR/navigation-timing/"
93
- ],
94
- "https://www.w3.org/TR/pointerevents2/": [
95
- "https://www.w3.org/TR/pointerevents/"
96
- ],
97
- "https://www.w3.org/TR/page-visibility-2/": [
98
- "https://www.w3.org/TR/page-visibility/"
99
- ],
100
- "https://www.w3.org/TR/user-timing-2/": [
101
- "https://www.w3.org/TR/user-timing/"
102
- ],
103
- "https://www.w3.org/TR/performance-timeline-2/": [
104
- "https://www.w3.org/TR/performance-timeline/"
105
- ],
106
- "https://www.w3.org/TR/IndexedDB-2/": [
107
- "https://www.w3.org/TR/IndexedDB/"
108
- ],
109
- "https://www.w3.org/TR/resource-timing-2/": [
110
- "https://www.w3.org/TR/resource-timing-1/",
111
- "https://www.w3.org/TR/resource-timing/"
112
- ],
113
- "https://www.w3.org/TR/input-events-2/": [
114
- "https://www.w3.org/TR/input-events-1/"
115
- ],
116
- "https://www.w3.org/TR/SVG2/": [
117
- "https://www.w3.org/TR/SVG/",
118
- "https://www.w3.org/TR/SVG11/"
119
- ],
120
- "https://w3c.github.io/staticrange/": [
121
- "https://w3c.github.io/staticrange/index.html"
122
- ],
123
- "https://www.w3.org/TR/geometry-1/": [
124
- "https://drafts.fxtf.org/geometry/"
125
- ],
126
- "https://www.w3.org/TR/css-values-3/": [
127
- "https://www.w3.org/TR/css3-values/",
128
- "https://www.w3.org/TR/css-values/"
129
- ],
130
- "https://www.w3.org/TR/css-syntax-3/": [
131
- "https://www.w3.org/TR/css-syntax/"
132
- ],
133
- "https://www.w3.org/TR/css-fonts-4/": [
134
- "https://www.w3.org/TR/css3-fonts/",
135
- "https://www.w3.org/TR/css-fonts-3/"
136
- ],
137
- "https://www.w3.org/TR/css3-selectors/": [
138
- "https://www.w3.org/TR/selectors/"
139
- ],
140
- "https://www.w3.org/TR/compositing-1/": [
141
- "https://www.w3.org/TR/compositing/"
142
- ],
143
- "https://www.w3.org/TR/css-writing-modes-3/": [
144
- "https://www.w3.org/TR/css3-writing-modes/"
145
- ],
146
- "https://www.w3.org/TR/cssom-view-1/": [
147
- "https://www.w3.org/TR/cssom-view/"
148
- ]
149
- }
1
+ {
2
+ "https://www.w3.org/TR/webmessaging/": [
3
+ "https://html.spec.whatwg.org/"
4
+ ],
5
+ "https://www.w3.org/TR/2dcontext/": [
6
+ "https://html.spec.whatwg.org/",
7
+ "https://www.whatwg.org/specs/web-apps/current-work/multipage/",
8
+ "https://www.w3.org/TR/2dcontext2/"
9
+ ],
10
+ "https://www.w3.org/TR/workers/": [
11
+ "https://html.spec.whatwg.org/"
12
+ ],
13
+ "https://html.spec.whatwg.org/multipage/": [
14
+ "https://w3c.github.io/html/",
15
+ "https://www.w3.org/TR/html/",
16
+ "https://www.w3.org/TR/html5/",
17
+ "https://www.w3.org/TR/html51/",
18
+ "https://www.w3.org/TR/html52/",
19
+ "https://html.spec.whatwg.org/",
20
+ "https://www.whatwg.org/specs/web-apps/current-work/multipage/",
21
+ "https://www.w3.org/TR/eventsource/",
22
+ "https://www.w3.org/TR/webmessaging/",
23
+ "https://www.w3.org/TR/2dcontext/",
24
+ "https://www.w3.org/TR/2dcontext2/",
25
+ "https://www.w3.org/TR/webstorage/",
26
+ "https://www.w3.org/TR/workers/",
27
+ "https://www.w3.org/TR/websockets/",
28
+ "https://www.w3.org/html/wg/drafts/html/master/webappapis.html"
29
+ ],
30
+ "https://www.w3.org/TR/dom41/": [
31
+ "https://dom.spec.whatwg.org/",
32
+ "https://www.w3.org/TR/dom/",
33
+ "https://www.w3.org/TR/DOM-Level-3-Core/",
34
+ "https://www.w3.org/TR/domcore/",
35
+ "https://www.w3.org/TR/REC-DOM-Level-1/"
36
+ ],
37
+ "https://www.w3.org/TR/html52/": [
38
+ "https://www.w3.org/TR/html/",
39
+ "https://www.w3.org/TR/html5/",
40
+ "https://www.w3.org/TR/html51/",
41
+ "https://www.w3.org/TR/html52/",
42
+ "https://html.spec.whatwg.org/",
43
+ "https://html.spec.whatwg.org/multipage/"
44
+ ],
45
+ "https://dom.spec.whatwg.org/": [
46
+ "https://www.w3.org/TR/dom/",
47
+ "https://www.w3.org/TR/dom41/",
48
+ "https://www.w3.org/TR/DOM-Level-3-Core/",
49
+ "https://www.w3.org/TR/domcore/",
50
+ "https://www.w3.org/TR/REC-DOM-Level-1/"
51
+ ],
52
+ "https://www.khronos.org/registry/webgl/specs/latest/1.0/": [
53
+ "https://www.khronos.org/registry/webgl/specs/1.0/",
54
+ "https://www.khronos.org/registry/webgl/specs/latest/"
55
+ ],
56
+ "https://www.w3.org/TR/notifications/": [
57
+ "https://notifications.spec.whatwg.org/"
58
+ ],
59
+ "https://www.w3.org/TR/geolocation-API/": [
60
+ "https://dev.w3.org/geo/api/spec-source.html"
61
+ ],
62
+ "https://www.w3.org/TR/uievents/": [
63
+ "https://w3c.github.io/uievents/"
64
+ ],
65
+ "https://www.w3.org/TR/mediacapture-streams/": [
66
+ "https://w3c.github.io/mediacapture-main/getusermedia.html"
67
+ ],
68
+ "https://www.w3.org/TR/vibration/": [
69
+ "https://dev.w3.org/2009/dap/vibration/"
70
+ ],
71
+ "https://www.w3.org/TR/html-media-capture/": [
72
+ "https://dev.w3.org/2009/dap/camera/"
73
+ ],
74
+ "https://www.w3.org/TR/service-workers-1/": [
75
+ "https://w3c.github.io/ServiceWorker/",
76
+ "https://www.w3.org/TR/service-workers/"
77
+ ],
78
+ "https://www.w3.org/TR/webvtt1/": [
79
+ "https://dev.w3.org/html5/webvtt/"
80
+ ],
81
+ "https://www.w3.org/TR/WebCryptoAPI/": [
82
+ "https://w3c.github.io/webcrypto/"
83
+ ],
84
+ "https://www.w3.org/TR/pointerlock-2/": [
85
+ "https://www.w3.org/TR/pointerlock/"
86
+ ],
87
+ "https://www.w3.org/TR/hr-time-3/": [
88
+ "https://www.w3.org/TR/hr-time/",
89
+ "https://www.w3.org/TR/hr-time-2/"
90
+ ],
91
+ "https://www.w3.org/TR/navigation-timing-2/": [
92
+ "https://www.w3.org/TR/navigation-timing/"
93
+ ],
94
+ "https://www.w3.org/TR/pointerevents2/": [
95
+ "https://www.w3.org/TR/pointerevents/"
96
+ ],
97
+ "https://www.w3.org/TR/page-visibility-2/": [
98
+ "https://www.w3.org/TR/page-visibility/"
99
+ ],
100
+ "https://www.w3.org/TR/user-timing-2/": [
101
+ "https://www.w3.org/TR/user-timing/"
102
+ ],
103
+ "https://www.w3.org/TR/performance-timeline-2/": [
104
+ "https://www.w3.org/TR/performance-timeline/"
105
+ ],
106
+ "https://www.w3.org/TR/IndexedDB-2/": [
107
+ "https://www.w3.org/TR/IndexedDB/"
108
+ ],
109
+ "https://www.w3.org/TR/resource-timing-2/": [
110
+ "https://www.w3.org/TR/resource-timing-1/",
111
+ "https://www.w3.org/TR/resource-timing/"
112
+ ],
113
+ "https://www.w3.org/TR/input-events-2/": [
114
+ "https://www.w3.org/TR/input-events-1/"
115
+ ],
116
+ "https://www.w3.org/TR/SVG2/": [
117
+ "https://www.w3.org/TR/SVG/",
118
+ "https://www.w3.org/TR/SVG11/"
119
+ ],
120
+ "https://w3c.github.io/staticrange/": [
121
+ "https://w3c.github.io/staticrange/index.html"
122
+ ],
123
+ "https://www.w3.org/TR/geometry-1/": [
124
+ "https://drafts.fxtf.org/geometry/"
125
+ ],
126
+ "https://www.w3.org/TR/css-values-3/": [
127
+ "https://www.w3.org/TR/css3-values/",
128
+ "https://www.w3.org/TR/css-values/"
129
+ ],
130
+ "https://www.w3.org/TR/css-syntax-3/": [
131
+ "https://www.w3.org/TR/css-syntax/"
132
+ ],
133
+ "https://www.w3.org/TR/css-fonts-4/": [
134
+ "https://www.w3.org/TR/css3-fonts/",
135
+ "https://www.w3.org/TR/css-fonts-3/"
136
+ ],
137
+ "https://www.w3.org/TR/css3-selectors/": [
138
+ "https://www.w3.org/TR/selectors/"
139
+ ],
140
+ "https://www.w3.org/TR/compositing-1/": [
141
+ "https://www.w3.org/TR/compositing/"
142
+ ],
143
+ "https://www.w3.org/TR/css-writing-modes-3/": [
144
+ "https://www.w3.org/TR/css3-writing-modes/"
145
+ ],
146
+ "https://www.w3.org/TR/cssom-view-1/": [
147
+ "https://www.w3.org/TR/cssom-view/"
148
+ ]
149
+ }
@@ -1,14 +0,0 @@
1
- export default function () {
2
- const dateEl = document.querySelector('.head time');
3
- const statusAndDate = [...document.querySelectorAll('.head h2')]
4
- .map(el => el.textContent).join(' ').trim();
5
- const lastModified = new Date(Date.parse(document.lastModified));
6
- const date = dateEl ? dateEl.textContent.trim() :
7
- (statusAndDate ? statusAndDate.split(/\s+/).slice(-3).join(' ') :
8
- [
9
- lastModified.toLocaleDateString('en-US', { day: 'numeric' }),
10
- lastModified.toLocaleDateString('en-US', { month: 'long' }),
11
- lastModified.toLocaleDateString('en-US', { year: 'numeric' })
12
- ].join(' '));
13
- return date;
14
- }
@@ -1,3 +0,0 @@
1
- export default function (spec, idToHeading = {}) {
2
-
3
- }
@@ -1,4 +0,0 @@
1
- echo "# Interfaces" && jq '.dfns[]|select(.type == "interface")|"- [" + .linkingText[0] + "](" + .href + ")"' es/dfns/ecmascript.json |tr -d '"'
2
- echo
3
- echo "# Attributes" && jq '.dfns[]|select(.type == "attribute")|"- [" + .["for"][0] + "." + .linkingText[0] + "](" + .href + ")"' es/dfns/ecmascript.json |tr -d '"'
4
- echo
@@ -1,7 +0,0 @@
1
- export default function () {
2
- const meta = document.querySelector('meta[name="document-revision"], meta[name="revision"]');
3
- const revision = meta?.content;
4
- if (revision && revision.match(/[0-9a-f]{40}/)) {
5
- return revision;
6
- }
7
- }
@@ -1,28 +0,0 @@
1
- const fs = require("fs");
2
- const { definitionSyntax } = require('css-tree');
3
-
4
- function parse(value, file) {
5
- try {
6
- if (value && !value === definitionSyntax.generate(definitionSyntax.parse(value))) {
7
- console.error("Discrepancy when parsing " + value + " in " + file);
8
- }
9
- } catch (e) {
10
- console.error("Error parsing " + value + " in " + file + ": " + e.message);
11
- }
12
- }
13
-
14
- if (require.main === module) {
15
- const file = process.argv[2];
16
- if (!file) {
17
- console.error('Required file parameter missing');
18
- process.exit(2);
19
- }
20
- const data = fs.readFileSync(file, "utf-8");
21
- const {properties, descriptors, valuespaces} = JSON.parse(data);
22
- for (let dataset of [properties, descriptors, valuespaces].map(Object.values)) {
23
- for (let dfn of dataset) {
24
- parse(dfn.value);
25
- parse(dfn.newValue);
26
- }
27
- }
28
- }
@@ -1,10 +0,0 @@
1
- const { definitionSyntax } = require('css-tree');
2
-
3
- if (require.main === module) {
4
- const file = process.argv[2];
5
- if (!file) {
6
- console.error('Required file parameter missing');
7
- process.exit(2);
8
- }
9
- console.log(JSON.stringify(definitionSyntax.parse(input), null, 2));
10
- }
@@ -1,11 +0,0 @@
1
- const { definitionSyntax } = require('css-tree');
2
-
3
- if (require.main === module) {
4
- const input = process.argv.slice(2).join(" ");
5
- if (!input) {
6
- console.error('Required input parameter missing');
7
- process.exit(2);
8
- }
9
- console.log(JSON.stringify(definitionSyntax.parse(input), null, 2));
10
- }
11
-
@@ -1 +0,0 @@
1
- const { definitionSyntax } = require('css-tree');
@@ -1,38 +0,0 @@
1
- async function processSpec(spec, crawlOptions) {
2
- spec.crawled = crawlOptions.publishedVersion ?
3
- (spec.release ? spec.release : spec.nightly) :
4
- spec.nightly;
5
- spec.date = "";
6
- spec.links = {};
7
- spec.refs = {};
8
- spec.idl = {};
9
- if (spec.error) {
10
- return spec;
11
- }
12
-
13
- try {
14
- const result = await processSpecification(spec.crawled, (spec) => {
15
- const idToHeading = window.reffy.mapIdsToHeadings();
16
- return {
17
- crawled: window.location.toString(),
18
- title: window.reffy.getTitle(),
19
- generator: window.reffy.getGenerator(),
20
- date: window.reffy.getLastModifiedDate(),
21
- editors: window.reffy.extractEditors()
22
- };
23
- }, [spec]);
24
-
25
- // Copy results back into initial spec object
26
- spec.crawled = result.crawled;
27
- spec.title = result.title ? result.title : spec.title;
28
- spec.generator = result.generator;
29
- spec.date = result.date;
30
- spec.editors = result.editors;
31
- }
32
- catch (err) {
33
- spec.title = spec.title || '[Could not be determined, see error]';
34
- spec.error = err.toString() + (err.stack ? ' ' + err.stack : '');
35
- }
36
-
37
- return spec;
38
- }
@@ -1,28 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * The spec processor takes a list of spec URLs as input, gathers some knowledge
4
- * about these specs (published versions, URL of the Editor's Draft, etc.),
5
- * fetches these specs, parses them, extracts relevant information that they
6
- * contain (such as the WebIDL they define, the list of specifications that they
7
- * reference, and links to external specs), and produces a crawl report with the
8
- * results of these investigations.
9
- *
10
- * The spec processor can be called directly through:
11
- *
12
- * `node process-specs.js [listfile] [crawl folder] [option]`
13
- *
14
- * where `listfile` is the name of a JSON file that contains the list of specs
15
- * to crawl, `crawl folder` is the name of the folder where the crawl report
16
- * will be created, and `option` is an optional parameter that can be set to
17
- * `tr` to tell the crawler to crawl the published version of W3C specifications
18
- * instead of the Editor's Draft.
19
- *
20
- * The JSON file that contains the list of specs to crawl must be an array whose
21
- * individual items are either:
22
- * 1. a string that gets interpreted as the URL or the shortname of the spec to
23
- * crawl. The spec must exist in w3c/browser-specs
24
- * 2. an object that follows the w3c/browser-specs model:
25
- * https://github.com/w3c/browser-specs#spec-object
26
- *
27
- * @module crawler
28
- */
@@ -1,8 +0,0 @@
1
- // Annotate with the spec to which the page belong if we can find one
2
- if (Array.isArray(specs)) {
3
- const specUrl = canonicalizeUrl(pageUrl);
4
- let matchingSpec = specs.find(s => s?.release?.url === specUrl || s?.nightly?.url === specUrl || (s?.series?.currentSpecification === s?.shortname && (s?.series?.nightlyUrl === specUrl || s?.series?.releaseUrl === specUrl)) || s?.nightly?.pages?.includes(specUrl) || s?.release?.pages?.includes(specUrl));
5
- if (matchingSpec) {
6
- links[pageUrl].specShortname = matchingSpec.shortname;
7
- }
8
- }