reffy 6.4.2 → 6.6.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.
Files changed (43) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +158 -158
  3. package/index.js +11 -11
  4. package/package.json +53 -53
  5. package/reffy.js +248 -248
  6. package/src/browserlib/canonicalize-url.mjs +50 -50
  7. package/src/browserlib/create-outline.mjs +352 -352
  8. package/src/browserlib/extract-cssdfn.mjs +319 -319
  9. package/src/browserlib/extract-dfns.mjs +687 -686
  10. package/src/browserlib/extract-editors.mjs~ +14 -0
  11. package/src/browserlib/extract-elements.mjs +205 -205
  12. package/src/browserlib/extract-headings.mjs +48 -48
  13. package/src/browserlib/extract-ids.mjs +28 -28
  14. package/src/browserlib/extract-links.mjs +28 -28
  15. package/src/browserlib/extract-references.mjs +203 -203
  16. package/src/browserlib/extract-webidl.mjs +134 -134
  17. package/src/browserlib/generate-es-dfn-report.sh~ +4 -0
  18. package/src/browserlib/get-absolute-url.mjs +21 -21
  19. package/src/browserlib/get-generator.mjs +26 -26
  20. package/src/browserlib/get-lastmodified-date.mjs +13 -13
  21. package/src/browserlib/get-title.mjs +11 -11
  22. package/src/browserlib/informative-selector.mjs +16 -16
  23. package/src/browserlib/map-ids-to-headings.mjs +136 -136
  24. package/src/browserlib/reffy.json +53 -53
  25. package/src/cli/check-missing-dfns.js +609 -609
  26. package/src/cli/csstree-grammar-check.js +28 -0
  27. package/src/cli/csstree-grammar-check.js~ +10 -0
  28. package/src/cli/csstree-grammar-parser.js +11 -0
  29. package/src/cli/csstree-grammar-parser.js~ +1 -0
  30. package/src/cli/extract-editors.js~ +38 -0
  31. package/src/cli/generate-idlnames.js +430 -430
  32. package/src/cli/generate-idlparsed.js +139 -139
  33. package/src/cli/merge-crawl-results.js +128 -128
  34. package/src/cli/parse-webidl.js +430 -430
  35. package/src/cli/process-specs.js~ +28 -0
  36. package/src/lib/css-grammar-parse-tree.schema.json +109 -109
  37. package/src/lib/css-grammar-parser.js +440 -440
  38. package/src/lib/fetch.js +56 -56
  39. package/src/lib/nock-server.js +127 -127
  40. package/src/lib/specs-crawler.js +631 -622
  41. package/src/lib/util.js +943 -943
  42. package/src/specs/missing-css-rules.json +197 -197
  43. package/src/specs/spec-equivalents.json +149 -149
@@ -0,0 +1,28 @@
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,109 +1,109 @@
1
- {
2
- "$schema": "http://json-schema.org/schema#",
3
- "definitions": {
4
- "typedterminal": {
5
- "type": "object",
6
- "properties": {
7
- "type": { "type": "string", "enum": ["primitive", "valuespace", "propertyref", "keyword" ] },
8
- "name": { "type": "string"},
9
- "optional": { "type": "boolean" },
10
- "range": { "type": "array", "items": {"type": "string"} }
11
- },
12
- "additionalProperties": false,
13
- "required": ["type", "name"]
14
- },
15
- "stringterminal": {
16
- "type": "object",
17
- "properties": {
18
- "type": { "type": "string", "pattern": "^string$" },
19
- "content": {"type": "string"}
20
- },
21
- "additionalProperties": false,
22
- "required": ["type", "content"]
23
- },
24
- "oneOf": {
25
- "type": "object",
26
- "properties": {
27
- "oneOf": {
28
- "type": "array",
29
- "items": { "$ref": "#/definitions/component"}
30
- },
31
- "nonempty": { "type": "boolean" }
32
- },
33
- "additionalProperties": false,
34
- "required": ["oneOf"]
35
- },
36
- "anyOf": {
37
- "type": "object",
38
- "properties": {
39
- "anyOf": {
40
- "type": "array",
41
- "items": { "$ref": "#/definitions/component"}
42
- },
43
- "nonempty": { "type": "boolean" }
44
- },
45
- "additionalProperties": false,
46
- "required": ["anyOf"]
47
- },
48
- "allOf": {
49
- "type": "object",
50
- "properties": {
51
- "allOf": {
52
- "type": "array",
53
- "items": { "$ref": "#/definitions/component"}
54
- },
55
- "nonempty": { "type": "boolean" }
56
- },
57
- "additionalProperties": false,
58
- "required": ["allOf"]
59
- },
60
- "sequence": {
61
- "type": "object",
62
- "properties": {
63
- "type": { "type": "string", "pattern": "^array$"},
64
- "items": {
65
- "oneOf": [
66
- {
67
- "type": "array",
68
- "items": { "$ref": "#/definitions/component"}
69
- },
70
- { "$ref": "#/definitions/component"}
71
- ]
72
- },
73
- "minItems": { "type": "number" },
74
- "maxItems": { "type": "number" }
75
- },
76
- "additionalProperties": false,
77
- "required": ["type", "items"]
78
- },
79
- "function": {
80
- "type": "object",
81
- "properties": {
82
- "type": { "type": "string", "pattern": "^function$"},
83
- "arguments": {
84
- "oneOf": [
85
- {
86
- "type": "array",
87
- "items": { "$ref": "#/definitions/component"}
88
- },
89
- { "$ref": "#/definitions/component"}
90
- ]
91
- }
92
- },
93
- "additionalProperties": false,
94
- "required": ["type", "arguments"]
95
- },
96
- "component": {
97
- "oneOf": [
98
- { "$ref": "#/definitions/typedterminal" },
99
- { "$ref": "#/definitions/stringterminal" },
100
- { "$ref": "#/definitions/oneOf" },
101
- { "$ref": "#/definitions/anyOf" },
102
- { "$ref": "#/definitions/allOf" },
103
- { "$ref": "#/definitions/sequence" },
104
- { "$ref": "#/definitions/function" }
105
- ]
106
- }
107
- },
108
- "$ref": "#/definitions/component"
109
- }
1
+ {
2
+ "$schema": "http://json-schema.org/schema#",
3
+ "definitions": {
4
+ "typedterminal": {
5
+ "type": "object",
6
+ "properties": {
7
+ "type": { "type": "string", "enum": ["primitive", "valuespace", "propertyref", "keyword" ] },
8
+ "name": { "type": "string"},
9
+ "optional": { "type": "boolean" },
10
+ "range": { "type": "array", "items": {"type": "string"} }
11
+ },
12
+ "additionalProperties": false,
13
+ "required": ["type", "name"]
14
+ },
15
+ "stringterminal": {
16
+ "type": "object",
17
+ "properties": {
18
+ "type": { "type": "string", "pattern": "^string$" },
19
+ "content": {"type": "string"}
20
+ },
21
+ "additionalProperties": false,
22
+ "required": ["type", "content"]
23
+ },
24
+ "oneOf": {
25
+ "type": "object",
26
+ "properties": {
27
+ "oneOf": {
28
+ "type": "array",
29
+ "items": { "$ref": "#/definitions/component"}
30
+ },
31
+ "nonempty": { "type": "boolean" }
32
+ },
33
+ "additionalProperties": false,
34
+ "required": ["oneOf"]
35
+ },
36
+ "anyOf": {
37
+ "type": "object",
38
+ "properties": {
39
+ "anyOf": {
40
+ "type": "array",
41
+ "items": { "$ref": "#/definitions/component"}
42
+ },
43
+ "nonempty": { "type": "boolean" }
44
+ },
45
+ "additionalProperties": false,
46
+ "required": ["anyOf"]
47
+ },
48
+ "allOf": {
49
+ "type": "object",
50
+ "properties": {
51
+ "allOf": {
52
+ "type": "array",
53
+ "items": { "$ref": "#/definitions/component"}
54
+ },
55
+ "nonempty": { "type": "boolean" }
56
+ },
57
+ "additionalProperties": false,
58
+ "required": ["allOf"]
59
+ },
60
+ "sequence": {
61
+ "type": "object",
62
+ "properties": {
63
+ "type": { "type": "string", "pattern": "^array$"},
64
+ "items": {
65
+ "oneOf": [
66
+ {
67
+ "type": "array",
68
+ "items": { "$ref": "#/definitions/component"}
69
+ },
70
+ { "$ref": "#/definitions/component"}
71
+ ]
72
+ },
73
+ "minItems": { "type": "number" },
74
+ "maxItems": { "type": "number" }
75
+ },
76
+ "additionalProperties": false,
77
+ "required": ["type", "items"]
78
+ },
79
+ "function": {
80
+ "type": "object",
81
+ "properties": {
82
+ "type": { "type": "string", "pattern": "^function$"},
83
+ "arguments": {
84
+ "oneOf": [
85
+ {
86
+ "type": "array",
87
+ "items": { "$ref": "#/definitions/component"}
88
+ },
89
+ { "$ref": "#/definitions/component"}
90
+ ]
91
+ }
92
+ },
93
+ "additionalProperties": false,
94
+ "required": ["type", "arguments"]
95
+ },
96
+ "component": {
97
+ "oneOf": [
98
+ { "$ref": "#/definitions/typedterminal" },
99
+ { "$ref": "#/definitions/stringterminal" },
100
+ { "$ref": "#/definitions/oneOf" },
101
+ { "$ref": "#/definitions/anyOf" },
102
+ { "$ref": "#/definitions/allOf" },
103
+ { "$ref": "#/definitions/sequence" },
104
+ { "$ref": "#/definitions/function" }
105
+ ]
106
+ }
107
+ },
108
+ "$ref": "#/definitions/component"
109
+ }