reffy 14.0.2 → 14.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": "14.0.2",
3
+ "version": "14.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",
@@ -34,19 +34,19 @@
34
34
  "dependencies": {
35
35
  "ajv": "8.12.0",
36
36
  "ajv-formats": "2.1.1",
37
- "commander": "11.0.0",
37
+ "commander": "11.1.0",
38
38
  "fetch-filecache-for-crawling": "5.0.0",
39
- "puppeteer": "21.1.0",
39
+ "puppeteer": "21.3.8",
40
40
  "semver": "^7.3.5",
41
- "web-specs": "2.66.0",
41
+ "web-specs": "2.71.0",
42
42
  "webidl2": "24.4.1"
43
43
  },
44
44
  "devDependencies": {
45
- "chai": "4.3.8",
45
+ "chai": "4.3.10",
46
46
  "mocha": "10.2.0",
47
- "respec": "34.1.6",
47
+ "respec": "34.2.0",
48
48
  "respec-hljs": "2.1.1",
49
- "rollup": "3.28.1",
49
+ "rollup": "4.1.4",
50
50
  "undici": "^5.22.1"
51
51
  },
52
52
  "overrides": {
@@ -30,7 +30,7 @@ export default function () {
30
30
  // Note some selectors are re-defined locally in HTML and Fullscreen. We
31
31
  // won't import them.
32
32
  atrules: extractDfns({
33
- selector: 'dfn[data-dfn-type=at-rule]',
33
+ selector: 'dfn[data-dfn-type=at-rule]:not([data-dfn-for])',
34
34
  extractor: extractTypedDfn,
35
35
  duplicates: 'reject',
36
36
  warnings
@@ -90,7 +90,18 @@ export default function () {
90
90
  });
91
91
  }
92
92
 
93
- // Move descriptors to at-rules structure
93
+ // Subsidiary at-rules are at-rules that can be used within a parent at-rule,
94
+ // we'll consider that they are "descriptors".
95
+ const subsidiary = extractDfns({
96
+ selector: 'dfn[data-dfn-type=at-rule][data-dfn-for]',
97
+ extractor: extractTypedDfn,
98
+ duplicates: 'reject',
99
+ keepDfnType: true,
100
+ warnings
101
+ });
102
+ descriptors = descriptors.concat([subsidiary]);
103
+
104
+ // Move descriptors, and subsidiary at-rules, to at-rules structure
94
105
  for (const desclist of descriptors) {
95
106
  for (const desc of desclist) {
96
107
  let rule = res.atrules.find(r => r.name === desc.for);
@@ -0,0 +1,12 @@
1
+ export default function () {
2
+ // bikeshed uses 'document-revision'
3
+ // but the documented convention in https://wiki.whatwg.org/wiki/MetaExtensions
4
+ // is just 'revision' per https://github.com/krallin/meta-revision
5
+ const meta = document.querySelector('meta[name="document-revision"], meta[name="revision"]');
6
+ const revision = meta?.content.trim();
7
+ // git commit shas are 40 hexadecimal characters
8
+ if (revision?.match(/[0-9a-f]{40}/)) {
9
+ return revision;
10
+ }
11
+ return null;
12
+ }
@@ -14,6 +14,11 @@
14
14
  "property": "date",
15
15
  "metadata": true
16
16
  },
17
+ {
18
+ "href": "./get-revision.mjs",
19
+ "property": "revision",
20
+ "metadata": true
21
+ },
17
22
  {
18
23
  "href": "./extract-links.mjs",
19
24
  "property": "links"
@@ -44,7 +44,7 @@ const mockSpecs = {
44
44
  <script src='https://www.w3.org/Tools/respec/respec-w3c'></script>
45
45
  <div id=abstract></div>
46
46
  <pre class='idl'>[Exposed=Window] interface Foo { attribute DOMString bar; };</pre>`,
47
- "/accelerometer/": `<html>
47
+ "/accelerometer/": `<html><meta name='document-revision' content='c0917d216986f88bdd43c72c0b13352c71f283aa'>
48
48
  <h2>Normative references</h2>
49
49
  <dl>
50
50
  <dt>FOO</dt>