reffy 6.3.0 → 6.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reffy",
3
- "version": "6.3.0",
3
+ "version": "6.4.3",
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",
@@ -32,20 +32,20 @@
32
32
  "bin": "./reffy.js",
33
33
  "dependencies": {
34
34
  "abortcontroller-polyfill": "1.7.3",
35
- "browser-specs": "2.27.0",
36
35
  "commander": "9.0.0",
37
36
  "fetch-filecache-for-crawling": "4.1.0",
38
- "puppeteer": "13.1.3",
37
+ "puppeteer": "13.3.2",
39
38
  "semver": "^7.3.5",
39
+ "web-specs": "1.2.0",
40
40
  "webidl2": "24.2.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "chai": "4.3.6",
44
- "mocha": "9.2.0",
44
+ "mocha": "9.2.1",
45
45
  "nock": "13.2.4",
46
- "respec": "29.0.6",
46
+ "respec": "31.0.3",
47
47
  "respec-hljs": "2.1.1",
48
- "rollup": "2.67.1"
48
+ "rollup": "2.67.3"
49
49
  },
50
50
  "scripts": {
51
51
  "test": "mocha --recursive tests/"
package/reffy.js CHANGED
@@ -23,7 +23,7 @@
23
23
 
24
24
  const commander = require('commander');
25
25
  const satisfies = require('semver/functions/satisfies');
26
- const specs = require('browser-specs');
26
+ const specs = require('web-specs');
27
27
  const { version, engines } = require('./package.json');
28
28
  const { requireFromWorkingDirectory } = require('./src/lib/util');
29
29
  const { crawlSpecs } = require('./src/lib/specs-crawler');
@@ -82,7 +82,7 @@ Object.keys(mockSpecs).forEach(path => {
82
82
  // Handling requests generated by ReSpec documents
83
83
  nock("https://api.specref.org")
84
84
  .persist()
85
- .get("/bibrefs?refs=webidl,html").reply(200,
85
+ .get("/bibrefs?refs=webidl").reply(200,
86
86
  { webidl: { href: "https://webidl.spec.whatwg.org/" } },
87
87
  { "Access-Control-Allow-Origin": "*" }
88
88
  );
@@ -12,7 +12,7 @@
12
12
 
13
13
  const fs = require('fs');
14
14
  const path = require('path');
15
- const specs = require('browser-specs');
15
+ const specs = require('web-specs');
16
16
  const cssDfnParser = require('./css-grammar-parser');
17
17
  const { generateIdlParsed, saveIdlParsed } = require('../cli/generate-idlparsed');
18
18
  const { generateIdlNames, saveIdlNames } = require('../cli/generate-idlnames');
package/src/lib/util.js CHANGED
@@ -21,8 +21,6 @@ const reffyModules = require('../browserlib/reffy.json');
21
21
  */
22
22
  const maxPathDepth = 20;
23
23
 
24
- let prefetchedResponses = {};
25
-
26
24
  /**
27
25
  * Returns a range array from 0 to the number provided (not included)
28
26
  */
@@ -334,6 +332,7 @@ async function processSpecification(spec, processFunction, args, options) {
334
332
  processFunction = processFunction || function () {};
335
333
  args = args || [];
336
334
  options = options || {};
335
+ let prefetchedResponse = {};
337
336
 
338
337
  if (!browser) {
339
338
  throw new Error('Browser instance not initialized, setupBrowser() must be called before processSpecification().');
@@ -410,7 +409,7 @@ async function processSpecification(spec, processFunction, args, options) {
410
409
  await cdp.send('Fetch.continueRequest', { requestId });
411
410
  return;
412
411
  }
413
- const response = prefetchedResponses[request.url] ?? await fetch(request.url, { signal: controller.signal, headers: request.headers });
412
+ const response = prefetchedResponse[request.url] ?? await fetch(request.url, { signal: controller.signal, headers: request.headers });
414
413
 
415
414
  const body = await response.buffer();
416
415
 
@@ -479,7 +478,7 @@ async function processSpecification(spec, processFunction, args, options) {
479
478
  if (response.status === 304) {
480
479
  return {status: "notmodified"};
481
480
  }
482
- prefetchedResponses[spec.url] = response;
481
+ prefetchedResponse[spec.url] = response;
483
482
  } catch (err) {
484
483
  throw new Error(`Loading ${spec.url} triggered network error ${err}`);
485
484
  }