reffy 16.0.0 → 16.0.2

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": "16.0.0",
3
+ "version": "16.0.2",
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",
@@ -36,14 +36,14 @@
36
36
  "ajv-formats": "3.0.1",
37
37
  "commander": "12.1.0",
38
38
  "fetch-filecache-for-crawling": "5.1.1",
39
- "puppeteer": "22.10.0",
39
+ "puppeteer": "22.11.2",
40
40
  "semver": "^7.3.5",
41
41
  "web-specs": "3.9.1",
42
42
  "webidl2": "24.4.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "mocha": "10.4.0",
46
- "respec": "35.1.0",
46
+ "respec": "35.1.1",
47
47
  "respec-hljs": "2.1.1",
48
48
  "rollup": "4.18.0",
49
49
  "undici": "^6.1.0"
@@ -28,7 +28,8 @@ export default function () {
28
28
  if (n.closest('.head, del')) return;
29
29
  const pageUrl = n.href.split('#')[0];
30
30
  // links generated by authoring tools have data-link-type or data-xref-type set
31
- let linkSet = n.dataset.linkType || n.dataset.xrefType ? autolinks : rawlinks;
31
+ // Bikeshed also adds automatic untyped links in the generatedindex ("ul.index aside")
32
+ let linkSet = n.dataset.linkType || n.dataset.xrefType || n.closest("ul.index aside") ? autolinks : rawlinks;
32
33
  if (!linkSet[pageUrl]) {
33
34
  linkSet[pageUrl] = {anchors: new Set()};
34
35
  }
@@ -84,8 +84,15 @@ async function crawlSpec(spec, crawlOptions) {
84
84
  try {
85
85
  const fallback = crawlOptions.fallbackData?.results?.find(s => s.url === spec.url);
86
86
  let cacheInfo = {};
87
- if (crawlOptions.fallbackData?.crawler === `reffy-${reffyVersion}`) {
88
- cacheInfo = Object.assign({}, fallback?.crawlCacheInfo);
87
+ if (fallback && !fallback.error &&
88
+ crawlOptions.fallbackData?.crawler === `reffy-${reffyVersion}`) {
89
+ // Note: we don't want to reuse the previous crawl results if
90
+ // there was an error because we don't really know whether these
91
+ // results come from that previous crawl (in which case we should
92
+ // crawl the spec again), or from a an earlier crawl where
93
+ // everything went fine (in which case we could reuse the results
94
+ // if the spec wasn't updated in the meantime).
95
+ cacheInfo = Object.assign({}, fallback.crawlCacheInfo);
89
96
  }
90
97
  let result = null;
91
98
  if (crawlOptions.useCrawl) {
@@ -348,6 +355,11 @@ async function crawlList(speclist, crawlOptions) {
348
355
  const crawlQueue = new ThrottledQueue({
349
356
  maxParallel: 4,
350
357
  sleepInterval: origin => {
358
+ if (crawlOptions.useCrawl) {
359
+ // Not an actual crawl, we're going to reuse previous crawl
360
+ // results instead. No need to sleep!
361
+ return 0;
362
+ }
351
363
  switch (origin) {
352
364
  case 'https://csswg.org': return 2000;
353
365
  case 'https://www.w3.org': return 1000;