doc-detective-common 1.3.0 → 1.4.0-beta.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.
@@ -1,7 +1,7 @@
1
1
  # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
2
  # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
3
 
4
- name: Node.js Package
4
+ name: Publish NPM package
5
5
 
6
6
  on:
7
7
  release:
@@ -13,8 +13,14 @@ jobs:
13
13
  runs-on: ${{ matrix.os }}
14
14
  strategy:
15
15
  matrix:
16
- os: [ubuntu-latest]
17
- node: [18]
16
+ os:
17
+ - ubuntu-latest
18
+ - windows-latest
19
+ - macos-latest
20
+ node:
21
+ - 16
22
+ - 18
23
+ - 20
18
24
 
19
25
  steps:
20
26
  - uses: actions/checkout@v3
@@ -38,11 +44,14 @@ jobs:
38
44
  - run: npm test
39
45
 
40
46
  publish-npm:
47
+ name: Publish to NPM
41
48
  needs: test
42
49
  runs-on: ubuntu-latest
43
50
  steps:
44
51
  - uses: actions/checkout@v3
45
52
  - uses: actions/setup-node@v3
53
+ with:
54
+ registry-url: https://registry.npmjs.org/
46
55
  - name: Cache node_modules
47
56
  uses: actions/cache@v3
48
57
  with:
@@ -56,3 +65,20 @@ jobs:
56
65
  - run: npm publish
57
66
  env:
58
67
  NODE_AUTH_TOKEN: ${{secrets.npm_token}}
68
+
69
+ update-docs:
70
+ name: Update documentation
71
+ needs: publish-npm
72
+ runs-on: ubuntu-latest
73
+ steps:
74
+ - uses: actions/checkout@v3
75
+
76
+ - name: Get package version
77
+ run: echo "VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV
78
+
79
+ - name: Trigger GitHub Action in doc-detective.github.io
80
+ run: |
81
+ curl -XPOST -H "Authorization: token ${{ secrets.DOCS_PERSONAL_ACCESS_TOKEN }}" \
82
+ -H "Accept: application/vnd.github.everest-preview+json" \
83
+ "https://api.github.com/repos/doc-detective/doc-detective.github.io/dispatches" \
84
+ -d '{"event_type": "update-common-package-event", "client_payload": {"version": "${{ env.VERSION }}"} }'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doc-detective-common",
3
- "version": "1.3.0",
3
+ "version": "1.4.0-beta.0",
4
4
  "description": "Shared components for Doc Detective projects. ",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -44,7 +44,6 @@
44
44
  "properties": {
45
45
  "input": {
46
46
  "description": "Path(s) to test specifications and documentation source files. May be paths to specific files or to directories to scan for files.",
47
- "default": ".",
48
47
  "anyOf": [
49
48
  {
50
49
  "type": "string"
@@ -104,8 +103,7 @@
104
103
  },
105
104
  "recursive": {
106
105
  "description": "If `true` searches `input`, `setup`, and `cleanup` paths recursively for test specificaions and source files.",
107
- "type": "boolean",
108
- "default": true
106
+ "type": "boolean"
109
107
  },
110
108
  "mediaDirectory": {
111
109
  "description": "Path of the directory in which to store output media files.",
@@ -146,6 +144,25 @@
146
144
  "path": {
147
145
  "type": "string",
148
146
  "description": "Path to the application. If not specified, defaults to typical install paths per platform. If specified but the path is invalid, the context is skipped."
147
+ },
148
+ "options": {
149
+ "type": "object",
150
+ "description": "Options to pass to the app. Only works when `name` is `firefox` or `chrome`.",
151
+ "additionalProperties": false,
152
+ "properties": {
153
+ "width": {
154
+ "type": "integer",
155
+ "description": "Width of the window in pixels."
156
+ },
157
+ "height": {
158
+ "type": "integer",
159
+ "description": "Height of the window in pixels."
160
+ },
161
+ "headless": {
162
+ "type": "boolean",
163
+ "description": "If `true`, runs the browser in headless mode."
164
+ }
165
+ }
149
166
  }
150
167
  }
151
168
  },
@@ -176,6 +193,21 @@
176
193
  "linux"
177
194
  ]
178
195
  },
196
+ {
197
+ "app": {
198
+ "name": "firefox",
199
+ "options": {
200
+ "width": 800,
201
+ "height": 600,
202
+ "headless": false
203
+ }
204
+ },
205
+ "platforms": [
206
+ "linux",
207
+ "windows",
208
+ "mac"
209
+ ]
210
+ },
179
211
  {
180
212
  "app": {
181
213
  "name": "chrome"
@@ -198,7 +230,24 @@
198
230
  ]
199
231
  }
200
232
  ]
201
- }
233
+ },
234
+ "default": [
235
+ {
236
+ "app": {
237
+ "name": "firefox",
238
+ "options": {
239
+ "width": 1200,
240
+ "height": 800,
241
+ "headless": true
242
+ }
243
+ },
244
+ "platforms": [
245
+ "linux",
246
+ "mac",
247
+ "windows"
248
+ ]
249
+ }
250
+ ]
202
251
  }
203
252
  }
204
253
  },
@@ -209,7 +258,6 @@
209
258
  "properties": {
210
259
  "input": {
211
260
  "description": "Path(s) to test specifications and documentation source files. May be paths to specific files or to directories to scan for files.",
212
- "default": ".",
213
261
  "anyOf": [
214
262
  {
215
263
  "type": "string"
@@ -233,13 +281,20 @@
233
281
  },
234
282
  "recursive": {
235
283
  "description": "If `true` searches `input`, `setup`, and `cleanup` paths recursively for test specificaions and source files.",
236
- "type": "boolean",
237
- "default": true
284
+ "type": "boolean"
238
285
  },
239
286
  "markup": {
287
+ "default": [
288
+ "onscreenText",
289
+ "emphasis",
290
+ "image",
291
+ "hyperlink",
292
+ "codeInline",
293
+ "codeBlock",
294
+ "interaction"
295
+ ],
240
296
  "description": "Markup types to include when performing this operation. If no markup types are specified, the operation includes all markup types as defined in `fileTypes`.",
241
297
  "type": "array",
242
- "default": [],
243
298
  "items": {
244
299
  "oneOf": [
245
300
  {
@@ -257,7 +312,6 @@
257
312
  "properties": {
258
313
  "input": {
259
314
  "description": "Path(s) to test specifications and documentation source files. May be paths to specific files or to directories to scan for files.",
260
- "default": ".",
261
315
  "anyOf": [
262
316
  {
263
317
  "type": "string"
@@ -281,13 +335,20 @@
281
335
  },
282
336
  "recursive": {
283
337
  "description": "If `true` searches `input`, `setup`, and `cleanup` paths recursively for test specificaions and source files.",
284
- "type": "boolean",
285
- "default": true
338
+ "type": "boolean"
286
339
  },
287
340
  "markup": {
341
+ "default": [
342
+ "onscreenText",
343
+ "emphasis",
344
+ "image",
345
+ "hyperlink",
346
+ "codeInline",
347
+ "codeBlock",
348
+ "interaction"
349
+ ],
288
350
  "description": "Markup types to include when performing this operation. If no markup types are specified, the operation includes all markup types as defined in `fileTypes`.",
289
351
  "type": "array",
290
- "default": [],
291
352
  "items": {
292
353
  "oneOf": [
293
354
  {
@@ -608,7 +669,6 @@
608
669
  "definitions": {
609
670
  "input": {
610
671
  "description": "Path(s) to test specifications and documentation source files. May be paths to specific files or to directories to scan for files.",
611
- "default": ".",
612
672
  "anyOf": [
613
673
  {
614
674
  "type": "string"
@@ -627,8 +687,7 @@
627
687
  },
628
688
  "recursive": {
629
689
  "description": "If `true` searches `input`, `setup`, and `cleanup` paths recursively for test specificaions and source files.",
630
- "type": "boolean",
631
- "default": true
690
+ "type": "boolean"
632
691
  },
633
692
  "output": {
634
693
  "description": "Path of the directory in which to store the output of Doc Detective commands.",
@@ -638,7 +697,6 @@
638
697
  "markupToInclude": {
639
698
  "description": "Markup types to include when performing this operation. If no markup types are specified, the operation includes all markup types as defined in `fileTypes`.",
640
699
  "type": "array",
641
- "default": [],
642
700
  "items": {
643
701
  "oneOf": [
644
702
  {
@@ -905,7 +963,11 @@
905
963
  {
906
964
  "app": {
907
965
  "name": "firefox",
908
- "path": ""
966
+ "options": {
967
+ "width": 1200,
968
+ "height": 800,
969
+ "headless": true
970
+ }
909
971
  },
910
972
  "platforms": [
911
973
  "linux",
@@ -22,6 +22,25 @@
22
22
  "path": {
23
23
  "type": "string",
24
24
  "description": "Path to the application. If not specified, defaults to typical install paths per platform. If specified but the path is invalid, the context is skipped."
25
+ },
26
+ "options": {
27
+ "type": "object",
28
+ "description": "Options to pass to the app. Only works when `name` is `firefox` or `chrome`.",
29
+ "additionalProperties": false,
30
+ "properties": {
31
+ "width": {
32
+ "type": "integer",
33
+ "description": "Width of the window in pixels."
34
+ },
35
+ "height": {
36
+ "type": "integer",
37
+ "description": "Height of the window in pixels."
38
+ },
39
+ "headless": {
40
+ "type": "boolean",
41
+ "description": "If `true`, runs the browser in headless mode."
42
+ }
43
+ }
25
44
  }
26
45
  }
27
46
  },
@@ -52,6 +71,21 @@
52
71
  "linux"
53
72
  ]
54
73
  },
74
+ {
75
+ "app": {
76
+ "name": "firefox",
77
+ "options": {
78
+ "width": 800,
79
+ "height": 600,
80
+ "headless": false
81
+ }
82
+ },
83
+ "platforms": [
84
+ "linux",
85
+ "windows",
86
+ "mac"
87
+ ]
88
+ },
55
89
  {
56
90
  "app": {
57
91
  "name": "chrome"
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "matchText": {
29
29
  "type": "string",
30
- "description": "Text that the element shuold contain. If the element doesn't contain the text, the step fails."
30
+ "description": "Text that the element should contain. If the element doesn't contain the text, the step fails."
31
31
  },
32
32
  "moveTo": {
33
33
  "type": "boolean",
@@ -43,6 +43,25 @@
43
43
  "path": {
44
44
  "type": "string",
45
45
  "description": "Path to the application. If not specified, defaults to typical install paths per platform. If specified but the path is invalid, the context is skipped."
46
+ },
47
+ "options": {
48
+ "type": "object",
49
+ "description": "Options to pass to the app. Only works when `name` is `firefox` or `chrome`.",
50
+ "additionalProperties": false,
51
+ "properties": {
52
+ "width": {
53
+ "type": "integer",
54
+ "description": "Width of the window in pixels."
55
+ },
56
+ "height": {
57
+ "type": "integer",
58
+ "description": "Height of the window in pixels."
59
+ },
60
+ "headless": {
61
+ "type": "boolean",
62
+ "description": "If `true`, runs the browser in headless mode."
63
+ }
64
+ }
46
65
  }
47
66
  }
48
67
  },
@@ -73,6 +92,21 @@
73
92
  "linux"
74
93
  ]
75
94
  },
95
+ {
96
+ "app": {
97
+ "name": "firefox",
98
+ "options": {
99
+ "width": 800,
100
+ "height": 600,
101
+ "headless": false
102
+ }
103
+ },
104
+ "platforms": [
105
+ "linux",
106
+ "windows",
107
+ "mac"
108
+ ]
109
+ },
76
110
  {
77
111
  "app": {
78
112
  "name": "chrome"
@@ -149,6 +183,25 @@
149
183
  "path": {
150
184
  "type": "string",
151
185
  "description": "Path to the application. If not specified, defaults to typical install paths per platform. If specified but the path is invalid, the context is skipped."
186
+ },
187
+ "options": {
188
+ "type": "object",
189
+ "description": "Options to pass to the app. Only works when `name` is `firefox` or `chrome`.",
190
+ "additionalProperties": false,
191
+ "properties": {
192
+ "width": {
193
+ "type": "integer",
194
+ "description": "Width of the window in pixels."
195
+ },
196
+ "height": {
197
+ "type": "integer",
198
+ "description": "Height of the window in pixels."
199
+ },
200
+ "headless": {
201
+ "type": "boolean",
202
+ "description": "If `true`, runs the browser in headless mode."
203
+ }
204
+ }
152
205
  }
153
206
  }
154
207
  },
@@ -179,6 +232,21 @@
179
232
  "linux"
180
233
  ]
181
234
  },
235
+ {
236
+ "app": {
237
+ "name": "firefox",
238
+ "options": {
239
+ "width": 800,
240
+ "height": 600,
241
+ "headless": false
242
+ }
243
+ },
244
+ "platforms": [
245
+ "linux",
246
+ "windows",
247
+ "mac"
248
+ ]
249
+ },
182
250
  {
183
251
  "app": {
184
252
  "name": "chrome"
@@ -735,7 +803,7 @@
735
803
  },
736
804
  "matchText": {
737
805
  "type": "string",
738
- "description": "Text that the element shuold contain. If the element doesn't contain the text, the step fails."
806
+ "description": "Text that the element should contain. If the element doesn't contain the text, the step fails."
739
807
  },
740
808
  "moveTo": {
741
809
  "type": "boolean",
@@ -44,6 +44,25 @@
44
44
  "path": {
45
45
  "type": "string",
46
46
  "description": "Path to the application. If not specified, defaults to typical install paths per platform. If specified but the path is invalid, the context is skipped."
47
+ },
48
+ "options": {
49
+ "type": "object",
50
+ "description": "Options to pass to the app. Only works when `name` is `firefox` or `chrome`.",
51
+ "additionalProperties": false,
52
+ "properties": {
53
+ "width": {
54
+ "type": "integer",
55
+ "description": "Width of the window in pixels."
56
+ },
57
+ "height": {
58
+ "type": "integer",
59
+ "description": "Height of the window in pixels."
60
+ },
61
+ "headless": {
62
+ "type": "boolean",
63
+ "description": "If `true`, runs the browser in headless mode."
64
+ }
65
+ }
47
66
  }
48
67
  }
49
68
  },
@@ -74,6 +93,21 @@
74
93
  "linux"
75
94
  ]
76
95
  },
96
+ {
97
+ "app": {
98
+ "name": "firefox",
99
+ "options": {
100
+ "width": 800,
101
+ "height": 600,
102
+ "headless": false
103
+ }
104
+ },
105
+ "platforms": [
106
+ "linux",
107
+ "windows",
108
+ "mac"
109
+ ]
110
+ },
77
111
  {
78
112
  "app": {
79
113
  "name": "chrome"
@@ -630,7 +664,7 @@
630
664
  },
631
665
  "matchText": {
632
666
  "type": "string",
633
- "description": "Text that the element shuold contain. If the element doesn't contain the text, the step fails."
667
+ "description": "Text that the element should contain. If the element doesn't contain the text, the step fails."
634
668
  },
635
669
  "moveTo": {
636
670
  "type": "boolean",
@@ -89,7 +89,20 @@
89
89
  "$ref": "context_v2.schema.json#"
90
90
  }
91
91
  ]
92
- }
92
+ },
93
+ "default": [
94
+ {
95
+ "app": {
96
+ "name": "firefox",
97
+ "options": {
98
+ "width": 1200,
99
+ "height": 800,
100
+ "headless": true
101
+ }
102
+ },
103
+ "platforms": ["linux", "mac", "windows"]
104
+ }
105
+ ]
93
106
  }
94
107
  }
95
108
  },
@@ -108,7 +121,16 @@
108
121
  "$ref": "#/definitions/recursive"
109
122
  },
110
123
  "markup": {
111
- "$ref": "#/definitions/markupToInclude"
124
+ "$ref": "#/definitions/markupToInclude",
125
+ "default": [
126
+ "onscreenText",
127
+ "emphasis",
128
+ "image",
129
+ "hyperlink",
130
+ "codeInline",
131
+ "codeBlock",
132
+ "interaction"
133
+ ]
112
134
  }
113
135
  }
114
136
  },
@@ -127,7 +149,16 @@
127
149
  "$ref": "#/definitions/recursive"
128
150
  },
129
151
  "markup": {
130
- "$ref": "#/definitions/markupToInclude"
152
+ "$ref": "#/definitions/markupToInclude",
153
+ "default": [
154
+ "onscreenText",
155
+ "emphasis",
156
+ "image",
157
+ "hyperlink",
158
+ "codeInline",
159
+ "codeBlock",
160
+ "interaction"
161
+ ]
131
162
  }
132
163
  }
133
164
  },
@@ -392,7 +423,6 @@
392
423
  "definitions": {
393
424
  "input": {
394
425
  "description": "Path(s) to test specifications and documentation source files. May be paths to specific files or to directories to scan for files.",
395
- "default": ".",
396
426
  "anyOf": [
397
427
  {
398
428
  "type": "string"
@@ -411,8 +441,7 @@
411
441
  },
412
442
  "recursive": {
413
443
  "description": "If `true` searches `input`, `setup`, and `cleanup` paths recursively for test specificaions and source files.",
414
- "type": "boolean",
415
- "default": true
444
+ "type": "boolean"
416
445
  },
417
446
  "output": {
418
447
  "description": "Path of the directory in which to store the output of Doc Detective commands.",
@@ -422,7 +451,6 @@
422
451
  "markupToInclude": {
423
452
  "description": "Markup types to include when performing this operation. If no markup types are specified, the operation includes all markup types as defined in `fileTypes`.",
424
453
  "type": "array",
425
- "default": [],
426
454
  "items": {
427
455
  "oneOf": [
428
456
  {
@@ -635,7 +663,11 @@
635
663
  {
636
664
  "app": {
637
665
  "name": "firefox",
638
- "path": ""
666
+ "options": {
667
+ "width": 1200,
668
+ "height": 800,
669
+ "headless": true
670
+ }
639
671
  },
640
672
  "platforms": ["linux", "mac", "windows"]
641
673
  }
@@ -17,6 +17,25 @@
17
17
  "path": {
18
18
  "type": "string",
19
19
  "description": "Path to the application. If not specified, defaults to typical install paths per platform. If specified but the path is invalid, the context is skipped."
20
+ },
21
+ "options": {
22
+ "type": "object",
23
+ "description": "Options to pass to the app. Only works when `name` is `firefox` or `chrome`.",
24
+ "additionalProperties": false,
25
+ "properties": {
26
+ "width": {
27
+ "type": "integer",
28
+ "description": "Width of the window in pixels."
29
+ },
30
+ "height": {
31
+ "type": "integer",
32
+ "description": "Height of the window in pixels."
33
+ },
34
+ "headless": {
35
+ "type": "boolean",
36
+ "description": "If `true`, runs the browser in headless mode."
37
+ }
38
+ }
20
39
  }
21
40
  }
22
41
  },
@@ -38,6 +57,17 @@
38
57
  },
39
58
  "platforms": ["linux"]
40
59
  },
60
+ {
61
+ "app": {
62
+ "name": "firefox",
63
+ "options": {
64
+ "width": 800,
65
+ "height": 600,
66
+ "headless": false
67
+ }
68
+ },
69
+ "platforms": ["linux", "windows", "mac"]
70
+ },
41
71
  {
42
72
  "app": {
43
73
  "name": "chrome"
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "matchText": {
29
29
  "type": "string",
30
- "description": "Text that the element shuold contain. If the element doesn't contain the text, the step fails."
30
+ "description": "Text that the element should contain. If the element doesn't contain the text, the step fails."
31
31
  },
32
32
  "moveTo": {
33
33
  "type": "boolean",