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
package/src/lib/fetch.js CHANGED
@@ -1,51 +1,51 @@
1
- /**
2
- * Wrapper around the fetch module to setup a few config parameters from
3
- * config.json
4
- *
5
- * @module finder
6
- */
7
-
8
- import os from 'node:os';
9
- import path from 'node:path';
10
- import baseFetch from 'fetch-filecache-for-crawling';
11
- import { loadJSON } from './util.js';
12
-
13
- // Read configuration parameters from `config.json` file
14
- let config = await loadJSON('config.json');
15
- if (!config) {
16
- config = {};
17
- }
18
-
19
-
20
- /**
21
- * Fetch function that applies fetch parameters defined in `config.json`
22
- * unless parameters are already set.
23
- *
24
- * By default, force the HTTP refresh strategy to "once", so that only one
25
- * HTTP request gets sent on a given URL per crawl.
26
- *
27
- * @function
28
- * @param {String} url URL to fetch
29
- * @param {Object} options Fetch options (and options for node-fetch, and
30
- * options for fetch-filecache-for-crawling)
31
- * @return {Promise(Response)} Promise to get an HTTP response
32
- */
33
- export default async function fetch(url, options) {
34
- options = Object.assign({headers: {}}, options);
35
- ['cacheFolder', 'resetCache', 'cacheRefresh', 'logToConsole'].forEach(param => {
36
- let fetchParam = (param === 'cacheRefresh') ? 'refresh' : param;
37
- if (config[param] && !options.hasOwnProperty(fetchParam)) {
38
- options[fetchParam] = config[param];
39
- }
40
- });
41
- if (!options.refresh) {
42
- options.refresh = 'once';
43
- }
44
-
45
- // Use cache folder in tmp folder by default
46
- if (!options.cacheFolder) {
47
- options.cacheFolder = path.resolve(os.tmpdir(), 'reffy-cache');
48
- }
49
-
50
- return baseFetch(url, options);
51
- }
1
+ /**
2
+ * Wrapper around the fetch module to setup a few config parameters from
3
+ * config.json
4
+ *
5
+ * @module finder
6
+ */
7
+
8
+ import os from 'node:os';
9
+ import path from 'node:path';
10
+ import baseFetch from 'fetch-filecache-for-crawling';
11
+ import { loadJSON } from './util.js';
12
+
13
+ // Read configuration parameters from `config.json` file
14
+ let config = await loadJSON('config.json');
15
+ if (!config) {
16
+ config = {};
17
+ }
18
+
19
+
20
+ /**
21
+ * Fetch function that applies fetch parameters defined in `config.json`
22
+ * unless parameters are already set.
23
+ *
24
+ * By default, force the HTTP refresh strategy to "once", so that only one
25
+ * HTTP request gets sent on a given URL per crawl.
26
+ *
27
+ * @function
28
+ * @param {String} url URL to fetch
29
+ * @param {Object} options Fetch options (and options for node-fetch, and
30
+ * options for fetch-filecache-for-crawling)
31
+ * @return {Promise(Response)} Promise to get an HTTP response
32
+ */
33
+ export default async function fetch(url, options) {
34
+ options = Object.assign({headers: {}}, options);
35
+ ['cacheFolder', 'resetCache', 'cacheRefresh', 'logToConsole'].forEach(param => {
36
+ let fetchParam = (param === 'cacheRefresh') ? 'refresh' : param;
37
+ if (config[param] && !options.hasOwnProperty(fetchParam)) {
38
+ options[fetchParam] = config[param];
39
+ }
40
+ });
41
+ if (!options.refresh) {
42
+ options.refresh = 'once';
43
+ }
44
+
45
+ // Use cache folder in tmp folder by default
46
+ if (!options.cacheFolder) {
47
+ options.cacheFolder = path.resolve(os.tmpdir(), 'reffy-cache');
48
+ }
49
+
50
+ return baseFetch(url, options);
51
+ }