@diplodoc/cli-tests 4.60.0 → 5.0.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 (50) hide show
  1. package/e2e/__snapshots__/include-toc.test.ts.snap +106 -106
  2. package/e2e/__snapshots__/load-custom-resources.spec.ts.snap +293 -344
  3. package/e2e/__snapshots__/metadata.spec.ts.snap +119 -144
  4. package/e2e/__snapshots__/plugin-corner-cases.spec.ts.snap +0 -0
  5. package/e2e/__snapshots__/regression.test.ts.snap +904 -715
  6. package/e2e/__snapshots__/restricted-access.test.ts.snap +234 -0
  7. package/e2e/__snapshots__/rtl.spec.ts.snap +248 -302
  8. package/e2e/__snapshots__/translation.spec.ts.snap +366 -0
  9. package/e2e/errors.spec.ts +31 -0
  10. package/e2e/regression.test.ts +7 -2
  11. package/e2e/restricted-access.test.ts +21 -0
  12. package/e2e/translation.spec.ts +1 -1
  13. package/fixtures/cliAdapter.ts +41 -20
  14. package/fixtures/runners/binary.ts +18 -3
  15. package/fixtures/runners/source.ts +5 -5
  16. package/fixtures/runners/types.ts +7 -1
  17. package/fixtures/utils/file.ts +3 -3
  18. package/fixtures/utils/test.ts +6 -1
  19. package/mocks/errors/unreachable-link/input/exists.md +1 -0
  20. package/mocks/errors/unreachable-link/input/index.md +2 -0
  21. package/mocks/errors/unreachable-link/input/toc.yaml +1 -0
  22. package/mocks/include-toc/test6/input/toc.yaml +1 -0
  23. package/mocks/regression/input/1.md +2 -0
  24. package/mocks/regression/input/generic/1.md +3 -0
  25. package/mocks/regression/input/generic/2.md +3 -0
  26. package/mocks/regression/input/generic/3.md +1 -0
  27. package/mocks/regression/input/generic/Sub notes/1.md +3 -0
  28. package/mocks/regression/input/generic/Sub notes/2.md +3 -0
  29. package/mocks/regression/input/includes/deep.md +1 -0
  30. package/mocks/regression/input/includes.md +3 -0
  31. package/mocks/regression/input/redirects.yaml +6 -0
  32. package/mocks/regression/input/toc.yaml +7 -3
  33. package/mocks/restricted-access/test1/input/index.md +0 -0
  34. package/mocks/restricted-access/test1/input/plugins/index.md +0 -0
  35. package/mocks/restricted-access/test1/input/plugins/index2.md +0 -0
  36. package/mocks/restricted-access/test1/input/plugins/index3.md +0 -0
  37. package/mocks/restricted-access/test1/input/plugins/index4.md +4 -0
  38. package/mocks/restricted-access/test1/input/toc.yaml +28 -0
  39. package/mocks/restricted-access/test2/input/index.md +0 -0
  40. package/mocks/restricted-access/test2/input/plugins/index.md +0 -0
  41. package/mocks/restricted-access/test2/input/project/index.md +0 -0
  42. package/mocks/restricted-access/test2/input/toc.yaml +21 -0
  43. package/mocks/restricted-access/test3/input/a1.md +1 -0
  44. package/mocks/restricted-access/test3/input/folder1/a1.md +1 -0
  45. package/mocks/restricted-access/test3/input/folder1/folder2/a1.md +1 -0
  46. package/mocks/restricted-access/test3/input/folder1/folder2/toc.yaml +8 -0
  47. package/mocks/restricted-access/test3/input/folder1/toc.yaml +10 -0
  48. package/mocks/restricted-access/test3/input/index.md +0 -0
  49. package/mocks/restricted-access/test3/input/toc.yaml +16 -0
  50. package/package.json +1 -1
@@ -2,98 +2,116 @@
2
2
 
3
3
  exports[`Include toc > Nested toc inclusions with mixed including modes > filelist 1`] = `
4
4
  "[
5
- "product1/_includes/inc.md",
5
+ "product1/_includes/inc-hash.md",
6
6
  "product1/article1.md",
7
7
  "product1/toc.yaml",
8
- "product2/overlay1/_includes/inc.md",
8
+ "product2/overlay1/_includes/inc-hash.md",
9
9
  "product2/overlay1/article1.md",
10
- "product2/overlay2/_includes/inc.md",
10
+ "product2/overlay2/_includes/inc-hash.md",
11
11
  "product2/overlay2/article1.md",
12
- "product2/overlay3/_includes/inc.md",
12
+ "product2/overlay3/_includes/inc-hash.md",
13
13
  "product2/overlay3/article1.md",
14
14
  "product2/p2.md",
15
15
  "product2/toc.yaml"
16
16
  ]"
17
17
  `;
18
18
 
19
- exports[`Include toc > Nested toc inclusions with mixed including modes > product1/_includes/inc.md 1`] = `"This is the core include."`;
19
+ exports[`Include toc > Nested toc inclusions with mixed including modes 1`] = `"This is the core include."`;
20
20
 
21
- exports[`Include toc > Nested toc inclusions with mixed including modes > product1/article1.md 1`] = `
21
+ exports[`Include toc > Nested toc inclusions with mixed including modes 2`] = `
22
22
  "---
23
23
  metadata:
24
24
  - name: generator
25
25
  content: Diplodoc Platform vDIPLODOC-VERSION
26
- sourcePath: product1/core/article1.md
27
26
  ---
28
27
  This is the core content of Article 1.
29
28
 
30
- {% include [x](_includes/inc.md) %}
29
+ {% include [x](_includes/inc-hash.md) %}
31
30
  "
32
31
  `;
33
32
 
34
- exports[`Include toc > Nested toc inclusions with mixed including modes > product1/toc.yaml 1`] = `
33
+ exports[`Include toc > Nested toc inclusions with mixed including modes 2 > filelist 1`] = `
34
+ "[
35
+ "toc.yaml"
36
+ ]"
37
+ `;
38
+
39
+ exports[`Include toc > Nested toc inclusions with mixed including modes 2 1`] = `
40
+ "title: main
41
+ items:
42
+ - name: toc_i/item
43
+ - name: core/toc_m/item
44
+ - name: overlay/toc_p/item
45
+ - name: core/toc_i/item
46
+ - name: test
47
+ items:
48
+ - name: core/concepts/toc_i/item
49
+ - name: core/concepts/toc_p/item
50
+ path: toc.yaml
51
+ "
52
+ `;
53
+
54
+ exports[`Include toc > Nested toc inclusions with mixed including modes 3`] = `
35
55
  "title: Product 1 title
36
56
  items:
37
57
  - name: Article1
38
58
  href: article1.md
59
+ path: product1/toc.yaml
39
60
  "
40
61
  `;
41
62
 
42
- exports[`Include toc > Nested toc inclusions with mixed including modes > product2/overlay1/_includes/inc.md 1`] = `
63
+ exports[`Include toc > Nested toc inclusions with mixed including modes 4`] = `
43
64
  "This is the core include.
44
65
  "
45
66
  `;
46
67
 
47
- exports[`Include toc > Nested toc inclusions with mixed including modes > product2/overlay1/article1.md 1`] = `
68
+ exports[`Include toc > Nested toc inclusions with mixed including modes 5`] = `
48
69
  "---
49
70
  metadata:
50
71
  - name: generator
51
72
  content: Diplodoc Platform vDIPLODOC-VERSION
52
- sourcePath: product2/overlay1/product/article1.md
53
73
  ---
54
74
  This is the overlay content of Article 1 for product 2.
55
75
 
56
- {% include [x](_includes/inc.md) %}
76
+ {% include [x](_includes/inc-hash.md) %}
57
77
  "
58
78
  `;
59
79
 
60
- exports[`Include toc > Nested toc inclusions with mixed including modes > product2/overlay2/_includes/inc.md 1`] = `
80
+ exports[`Include toc > Nested toc inclusions with mixed including modes 6`] = `
61
81
  "This is the core include.
62
82
  "
63
83
  `;
64
84
 
65
- exports[`Include toc > Nested toc inclusions with mixed including modes > product2/overlay2/article1.md 1`] = `
85
+ exports[`Include toc > Nested toc inclusions with mixed including modes 7`] = `
66
86
  "---
67
87
  metadata:
68
88
  - name: generator
69
89
  content: Diplodoc Platform vDIPLODOC-VERSION
70
- sourcePath: product2/overlay2/product/article1.md
71
90
  ---
72
91
  This is the overlay number #2 of Article 1 content for product 2.
73
92
 
74
- {% include [x](_includes/inc.md) %}
93
+ {% include [x](_includes/inc-hash.md) %}
75
94
  "
76
95
  `;
77
96
 
78
- exports[`Include toc > Nested toc inclusions with mixed including modes > product2/overlay3/_includes/inc.md 1`] = `
97
+ exports[`Include toc > Nested toc inclusions with mixed including modes 8`] = `
79
98
  "This is the core include.
80
99
  "
81
100
  `;
82
101
 
83
- exports[`Include toc > Nested toc inclusions with mixed including modes > product2/overlay3/article1.md 1`] = `
102
+ exports[`Include toc > Nested toc inclusions with mixed including modes 9`] = `
84
103
  "---
85
104
  metadata:
86
105
  - name: generator
87
106
  content: Diplodoc Platform vDIPLODOC-VERSION
88
- sourcePath: product2/core/article1.md
89
107
  ---
90
108
  This is the core content of Article 1.
91
109
 
92
- {% include [x](_includes/inc.md) %}
110
+ {% include [x](_includes/inc-hash.md) %}
93
111
  "
94
112
  `;
95
113
 
96
- exports[`Include toc > Nested toc inclusions with mixed including modes > product2/p2.md 1`] = `
114
+ exports[`Include toc > Nested toc inclusions with mixed including modes 10`] = `
97
115
  "---
98
116
  metadata:
99
117
  - name: generator
@@ -105,7 +123,7 @@ Check here link to [Article1 overlay 1](overlay1/article1.md)
105
123
  Check here link to [Article1 overlay 2](overlay2/article1.md)"
106
124
  `;
107
125
 
108
- exports[`Include toc > Nested toc inclusions with mixed including modes > product2/toc.yaml 1`] = `
126
+ exports[`Include toc > Nested toc inclusions with mixed including modes 11`] = `
109
127
  "title: Product 2 title
110
128
  items:
111
129
  - name: P2 Article
@@ -122,30 +140,20 @@ items:
122
140
  items:
123
141
  - name: Article1
124
142
  href: overlay3/article1.md
143
+ path: product2/toc.yaml
125
144
  "
126
145
  `;
127
146
 
128
- exports[`Include toc > Nested toc inclusions with mixed including modes 2 > filelist 1`] = `
147
+ exports[`Include toc > Toc is included in link mode > filelist 1`] = `
129
148
  "[
149
+ "a1.md",
150
+ "folder1/a1.md",
151
+ "folder1/folder2/a1.md",
130
152
  "toc.yaml"
131
153
  ]"
132
154
  `;
133
155
 
134
- exports[`Include toc > Nested toc inclusions with mixed including modes 2 > toc.yaml 1`] = `
135
- "title: main
136
- items:
137
- - name: toc_i/item
138
- - name: core/toc_m/item
139
- - name: overlay/toc_p/item
140
- - name: core/toc_i/item
141
- - name: test
142
- items:
143
- - name: core/concepts/toc_i/item
144
- - name: core/concepts/toc_p/item
145
- "
146
- `;
147
-
148
- exports[`Include toc > Toc is included in link mode > a1.md 1`] = `
156
+ exports[`Include toc > Toc is included in link mode 1`] = `
149
157
  "---
150
158
  metadata:
151
159
  - name: generator
@@ -155,16 +163,7 @@ This is the /a1.md file content.
155
163
  "
156
164
  `;
157
165
 
158
- exports[`Include toc > Toc is included in link mode > filelist 1`] = `
159
- "[
160
- "a1.md",
161
- "folder1/a1.md",
162
- "folder1/folder2/a1.md",
163
- "toc.yaml"
164
- ]"
165
- `;
166
-
167
- exports[`Include toc > Toc is included in link mode > folder1/a1.md 1`] = `
166
+ exports[`Include toc > Toc is included in link mode 2`] = `
168
167
  "---
169
168
  metadata:
170
169
  - name: generator
@@ -174,7 +173,7 @@ This is the /folder1/a1.md file content.
174
173
  "
175
174
  `;
176
175
 
177
- exports[`Include toc > Toc is included in link mode > folder1/folder2/a1.md 1`] = `
176
+ exports[`Include toc > Toc is included in link mode 3`] = `
178
177
  "---
179
178
  metadata:
180
179
  - name: generator
@@ -184,7 +183,7 @@ This is the /folder1/folder1/a1.md file content.
184
183
  "
185
184
  `;
186
185
 
187
- exports[`Include toc > Toc is included in link mode > toc.yaml 1`] = `
186
+ exports[`Include toc > Toc is included in link mode 4`] = `
188
187
  "items:
189
188
  - name: A1
190
189
  href: a1.md
@@ -196,15 +195,28 @@ exports[`Include toc > Toc is included in link mode > toc.yaml 1`] = `
196
195
  items:
197
196
  - name: A1
198
197
  href: folder1/folder2/a1.md
198
+ path: toc.yaml
199
199
  "
200
200
  `;
201
201
 
202
- exports[`Include toc > Toc is included inline, not as a new section > .yfm 1`] = `
202
+ exports[`Include toc > Toc is included inline, not as a new section > filelist 1`] = `
203
+ "[
204
+ ".yfm",
205
+ "file1.md",
206
+ "fileA.md",
207
+ "fileB.md",
208
+ "fileC.md",
209
+ "fileX.md",
210
+ "toc.yaml"
211
+ ]"
212
+ `;
213
+
214
+ exports[`Include toc > Toc is included inline, not as a new section 1`] = `
203
215
  "applyPresets: true
204
216
  "
205
217
  `;
206
218
 
207
- exports[`Include toc > Toc is included inline, not as a new section > file1.md 1`] = `
219
+ exports[`Include toc > Toc is included inline, not as a new section 2`] = `
208
220
  "---
209
221
  metadata:
210
222
  - name: generator
@@ -214,12 +226,11 @@ metadata:
214
226
  "
215
227
  `;
216
228
 
217
- exports[`Include toc > Toc is included inline, not as a new section > fileA.md 1`] = `
229
+ exports[`Include toc > Toc is included inline, not as a new section 3`] = `
218
230
  "---
219
231
  metadata:
220
232
  - name: generator
221
233
  content: Diplodoc Platform vDIPLODOC-VERSION
222
- sourcePath: folder/fileA.md
223
234
  title: File A
224
235
  description: YFM description
225
236
  ---
@@ -233,12 +244,11 @@ Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, wh
233
244
  "
234
245
  `;
235
246
 
236
- exports[`Include toc > Toc is included inline, not as a new section > fileB.md 1`] = `
247
+ exports[`Include toc > Toc is included inline, not as a new section 4`] = `
237
248
  "---
238
249
  metadata:
239
250
  - name: generator
240
251
  content: Diplodoc Platform vDIPLODOC-VERSION
241
- sourcePath: folder/fileB.md
242
252
  ---
243
253
  # File B
244
254
 
@@ -252,18 +262,17 @@ Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, wh
252
262
  "
253
263
  `;
254
264
 
255
- exports[`Include toc > Toc is included inline, not as a new section > fileC.md 1`] = `
265
+ exports[`Include toc > Toc is included inline, not as a new section 5`] = `
256
266
  "---
257
267
  metadata:
258
268
  - name: generator
259
269
  content: Diplodoc Platform vDIPLODOC-VERSION
260
- sourcePath: folder/folder/fileC.md
261
270
  ---
262
271
  # File C
263
272
  "
264
273
  `;
265
274
 
266
- exports[`Include toc > Toc is included inline, not as a new section > fileX.md 1`] = `
275
+ exports[`Include toc > Toc is included inline, not as a new section 6`] = `
267
276
  "---
268
277
  metadata:
269
278
  - name: generator
@@ -273,19 +282,7 @@ metadata:
273
282
  "
274
283
  `;
275
284
 
276
- exports[`Include toc > Toc is included inline, not as a new section > filelist 1`] = `
277
- "[
278
- ".yfm",
279
- "file1.md",
280
- "fileA.md",
281
- "fileB.md",
282
- "fileC.md",
283
- "fileX.md",
284
- "toc.yaml"
285
- ]"
286
- `;
287
-
288
- exports[`Include toc > Toc is included inline, not as a new section > toc.yaml 1`] = `
285
+ exports[`Include toc > Toc is included inline, not as a new section 7`] = `
289
286
  "items:
290
287
  - name: Name1
291
288
  href: file1.md
@@ -297,11 +294,7 @@ exports[`Include toc > Toc is included inline, not as a new section > toc.yaml 1
297
294
  href: fileC.md
298
295
  - name: NameX
299
296
  href: fileX.md
300
- "
301
- `;
302
-
303
- exports[`Include toc > Toc root merge on non root dir > .yfm 1`] = `
304
- "allowHtml: true
297
+ path: toc.yaml
305
298
  "
306
299
  `;
307
300
 
@@ -313,7 +306,12 @@ exports[`Include toc > Toc root merge on non root dir > filelist 1`] = `
313
306
  ]"
314
307
  `;
315
308
 
316
- exports[`Include toc > Toc root merge on non root dir > ru/index.yaml 1`] = `
309
+ exports[`Include toc > Toc root merge on non root dir 1`] = `
310
+ "allowHtml: true
311
+ "
312
+ `;
313
+
314
+ exports[`Include toc > Toc root merge on non root dir 2`] = `
317
315
  "blocks:
318
316
  - type: header-block
319
317
  title: Title
@@ -323,19 +321,27 @@ meta:
323
321
  metadata:
324
322
  - name: generator
325
323
  content: Diplodoc Platform vDIPLODOC-VERSION
326
- sourcePath: ru/sub/folder/index.yaml
327
324
  "
328
325
  `;
329
326
 
330
- exports[`Include toc > Toc root merge on non root dir > ru/toc.yaml 1`] = `
327
+ exports[`Include toc > Toc root merge on non root dir 3`] = `
331
328
  "title: Toc
332
329
  items:
333
330
  - name: sub-page
334
331
  href: index.yaml
332
+ path: ru/toc.yaml
335
333
  "
336
334
  `;
337
335
 
338
- exports[`Include toc > Toc with expressions > a1.md 1`] = `
336
+ exports[`Include toc > Toc with expressions > filelist 1`] = `
337
+ "[
338
+ "a1.md",
339
+ "index.yaml",
340
+ "toc.yaml"
341
+ ]"
342
+ `;
343
+
344
+ exports[`Include toc > Toc with expressions 1`] = `
339
345
  "---
340
346
  metadata:
341
347
  - name: generator
@@ -345,15 +351,7 @@ This is the /a1.md file content.
345
351
  "
346
352
  `;
347
353
 
348
- exports[`Include toc > Toc with expressions > filelist 1`] = `
349
- "[
350
- "a1.md",
351
- "index.yaml",
352
- "toc.yaml"
353
- ]"
354
- `;
355
-
356
- exports[`Include toc > Toc with expressions > index.yaml 1`] = `
354
+ exports[`Include toc > Toc with expressions 2`] = `
357
355
  "title: Title A
358
356
  description:
359
357
  - Desc A
@@ -369,12 +367,13 @@ links:
369
367
  "
370
368
  `;
371
369
 
372
- exports[`Include toc > Toc with expressions > toc.yaml 1`] = `
370
+ exports[`Include toc > Toc with expressions 3`] = `
373
371
  "title: Title A
374
372
  href: index.yaml
375
373
  items:
376
374
  - name: A1
377
375
  href: a1.md
376
+ path: toc.yaml
378
377
  "
379
378
  `;
380
379
 
@@ -389,7 +388,7 @@ exports[`Include toc > Toc with generic includer > filelist 1`] = `
389
388
  ]"
390
389
  `;
391
390
 
392
- exports[`Include toc > Toc with generic includer > test/index.md 1`] = `
391
+ exports[`Include toc > Toc with generic includer 1`] = `
393
392
  "---
394
393
  metadata:
395
394
  - name: generator
@@ -402,30 +401,30 @@ metadata:
402
401
  "
403
402
  `;
404
403
 
405
- exports[`Include toc > Toc with generic includer > test/sub/sub/sub-3.md 1`] = `
404
+ exports[`Include toc > Toc with generic includer 2`] = `
406
405
  "---
407
406
  metadata:
408
407
  - name: generator
409
408
  content: Diplodoc Platform vDIPLODOC-VERSION
410
409
  ---
411
- # H1"
410
+ # H1
411
+
412
+ [same level link](./sub-2.md)
413
+ [outer link](../test.md)
414
+ [inner link](./sub/sub-3.md)
415
+ "
412
416
  `;
413
417
 
414
- exports[`Include toc > Toc with generic includer > test/sub/sub-1.md 1`] = `
418
+ exports[`Include toc > Toc with generic includer 3`] = `
415
419
  "---
416
420
  metadata:
417
421
  - name: generator
418
422
  content: Diplodoc Platform vDIPLODOC-VERSION
419
423
  ---
420
- # H1
421
-
422
- [same level link](./sub-2.md)
423
- [outer link](../test.md)
424
- [inner link](./sub/sub-3.md)
425
- "
424
+ # H1"
426
425
  `;
427
426
 
428
- exports[`Include toc > Toc with generic includer > test/sub/sub-2.md 1`] = `
427
+ exports[`Include toc > Toc with generic includer 4`] = `
429
428
  "---
430
429
  metadata:
431
430
  - name: generator
@@ -434,7 +433,7 @@ metadata:
434
433
  # H1"
435
434
  `;
436
435
 
437
- exports[`Include toc > Toc with generic includer > test/test.md 1`] = `
436
+ exports[`Include toc > Toc with generic includer 5`] = `
438
437
  "---
439
438
  metadata:
440
439
  - name: generator
@@ -443,12 +442,12 @@ metadata:
443
442
  # H1"
444
443
  `;
445
444
 
446
- exports[`Include toc > Toc with generic includer > toc.yaml 1`] = `
445
+ exports[`Include toc > Toc with generic includer 6`] = `
447
446
  "title: main
448
447
  items:
449
448
  - name: test
450
449
  href: test/test.md
451
- - name: Overview
450
+ - name: index
452
451
  href: test/index.md
453
452
  - name: sub
454
453
  items:
@@ -460,5 +459,6 @@ items:
460
459
  items:
461
460
  - name: sub-3
462
461
  href: test/sub/sub/sub-3.md
462
+ path: toc.yaml
463
463
  "
464
464
  `;