@diplodoc/cli-tests 0.0.0-rc-reusable-e2es-202504041505 → 0.0.0-rc-fix-lint-202505221548

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 (51) hide show
  1. package/bin.mjs +4 -6
  2. package/e2e/__snapshots__/include-toc.test.ts.snap +21 -13
  3. package/e2e/__snapshots__/load-custom-resources.spec.ts.snap +257 -310
  4. package/e2e/__snapshots__/metadata.spec.ts.snap +111 -137
  5. package/e2e/__snapshots__/plugin-corner-cases.spec.ts.snap +0 -0
  6. package/e2e/__snapshots__/regression.test.ts.snap +799 -604
  7. package/e2e/__snapshots__/rtl.spec.ts.snap +226 -282
  8. package/e2e/__snapshots__/translation.spec.ts.snap +426 -0
  9. package/e2e/generate-map.spec.ts +2 -5
  10. package/e2e/include-toc.test.ts +15 -18
  11. package/e2e/load-custom-resources.spec.ts +3 -6
  12. package/e2e/metadata.spec.ts +3 -6
  13. package/e2e/plugin-corner-cases.spec.ts +3 -6
  14. package/e2e/regression.test.ts +13 -11
  15. package/e2e/rtl.spec.ts +3 -6
  16. package/e2e/translation.spec.ts +55 -0
  17. package/fixtures/cliAdapter.ts +46 -6
  18. package/fixtures/runners/binary.ts +5 -19
  19. package/fixtures/runners/source.ts +3 -8
  20. package/fixtures/utils/file.ts +23 -16
  21. package/fixtures/utils/test.ts +2 -2
  22. package/mocks/include-toc/test6/input/toc.yaml +1 -0
  23. package/mocks/regression/input/1.md +6 -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 +2 -0
  31. package/mocks/regression/input/redirects.yaml +6 -0
  32. package/mocks/regression/input/sub/folder/item-1.md +2 -0
  33. package/mocks/regression/input/toc.yaml +7 -3
  34. package/mocks/translation/dir-files/input/ru/_includes/test.md +1 -0
  35. package/mocks/translation/dir-files/input/ru/_no-translate/exclude.md +1 -0
  36. package/mocks/translation/dir-files/input/ru/aboba.md +7 -0
  37. package/mocks/translation/dir-files/input/ru/index.md +3 -0
  38. package/mocks/translation/dir-files/input/ru/nested/index-yfm.md +2 -0
  39. package/mocks/translation/dir-files/input/ru/nested/index.yaml +24 -0
  40. package/mocks/translation/dir-files/input/ru/nested/not-in-toc.md +20 -0
  41. package/mocks/translation/dir-files/input/ru/nested/syntax/base.md +1 -0
  42. package/mocks/translation/dir-files/input/ru/nested/syntax/index.md +2 -0
  43. package/mocks/translation/dir-files/input/ru/nested/syntax/lists.md +1 -0
  44. package/mocks/translation/dir-files/input/ru/nested/toc.yaml +18 -0
  45. package/mocks/translation/dir-files/input/ru/not-in-toc.md +20 -0
  46. package/mocks/translation/dir-files/input/ru/toc.yaml +7 -0
  47. package/mocks/translation/yaml-scheme/input/ru/.yfm +1 -0
  48. package/mocks/translation/yaml-scheme/input/ru/index-direct.yaml +133 -0
  49. package/mocks/translation/yaml-scheme/input/ru/index.yaml +32 -0
  50. package/mocks/translation/yaml-scheme/input/ru/toc.yaml +19 -0
  51. package/package.json +8 -6
package/bin.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import {spawn} from 'node:child_process';
3
+ import {execa} from 'execa';
4
4
  import {dirname, join, resolve} from 'node:path';
5
5
  import {fileURLToPath} from 'node:url';
6
6
  import {createRequire} from 'node:module';
@@ -8,7 +8,7 @@ import {createRequire} from 'node:module';
8
8
  const require = createRequire(import.meta.url);
9
9
  const vitestPath = require.resolve('vitest');
10
10
 
11
- const vitest = spawn(
11
+ await execa(
12
12
  join(dirname(vitestPath), 'vitest.mjs'),
13
13
  [
14
14
  'run',
@@ -23,8 +23,6 @@ const vitest = spawn(
23
23
  NODE_ENV: 'test',
24
24
  },
25
25
  },
26
- );
27
-
28
- vitest.on('exit', (code) => {
29
- process.exit(code || 0);
26
+ ).catch((error) => {
27
+ process.exit(error.exitCode || 1);
30
28
  });
@@ -2,21 +2,21 @@
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-e3b0c44298fc.md",
6
6
  "product1/article1.md",
7
7
  "product1/toc.yaml",
8
- "product2/overlay1/_includes/inc.md",
8
+ "product2/overlay1/_includes/inc-e3b0c44298fc.md",
9
9
  "product2/overlay1/article1.md",
10
- "product2/overlay2/_includes/inc.md",
10
+ "product2/overlay2/_includes/inc-e3b0c44298fc.md",
11
11
  "product2/overlay2/article1.md",
12
- "product2/overlay3/_includes/inc.md",
12
+ "product2/overlay3/_includes/inc-e3b0c44298fc.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 > product1/_includes/inc-e3b0c44298fc.md 1`] = `"This is the core include."`;
20
20
 
21
21
  exports[`Include toc > Nested toc inclusions with mixed including modes > product1/article1.md 1`] = `
22
22
  "---
@@ -27,7 +27,7 @@ sourcePath: product1/core/article1.md
27
27
  ---
28
28
  This is the core content of Article 1.
29
29
 
30
- {% include [x](_includes/inc.md) %}
30
+ {% include [x](_includes/inc-e3b0c44298fc.md) %}
31
31
  "
32
32
  `;
33
33
 
@@ -36,10 +36,11 @@ exports[`Include toc > Nested toc inclusions with mixed including modes > produc
36
36
  items:
37
37
  - name: Article1
38
38
  href: article1.md
39
+ path: product1/toc.yaml
39
40
  "
40
41
  `;
41
42
 
42
- exports[`Include toc > Nested toc inclusions with mixed including modes > product2/overlay1/_includes/inc.md 1`] = `
43
+ exports[`Include toc > Nested toc inclusions with mixed including modes > product2/overlay1/_includes/inc-e3b0c44298fc.md 1`] = `
43
44
  "This is the core include.
44
45
  "
45
46
  `;
@@ -53,11 +54,11 @@ sourcePath: product2/overlay1/product/article1.md
53
54
  ---
54
55
  This is the overlay content of Article 1 for product 2.
55
56
 
56
- {% include [x](_includes/inc.md) %}
57
+ {% include [x](_includes/inc-e3b0c44298fc.md) %}
57
58
  "
58
59
  `;
59
60
 
60
- exports[`Include toc > Nested toc inclusions with mixed including modes > product2/overlay2/_includes/inc.md 1`] = `
61
+ exports[`Include toc > Nested toc inclusions with mixed including modes > product2/overlay2/_includes/inc-e3b0c44298fc.md 1`] = `
61
62
  "This is the core include.
62
63
  "
63
64
  `;
@@ -71,11 +72,11 @@ sourcePath: product2/overlay2/product/article1.md
71
72
  ---
72
73
  This is the overlay number #2 of Article 1 content for product 2.
73
74
 
74
- {% include [x](_includes/inc.md) %}
75
+ {% include [x](_includes/inc-e3b0c44298fc.md) %}
75
76
  "
76
77
  `;
77
78
 
78
- exports[`Include toc > Nested toc inclusions with mixed including modes > product2/overlay3/_includes/inc.md 1`] = `
79
+ exports[`Include toc > Nested toc inclusions with mixed including modes > product2/overlay3/_includes/inc-e3b0c44298fc.md 1`] = `
79
80
  "This is the core include.
80
81
  "
81
82
  `;
@@ -89,7 +90,7 @@ sourcePath: product2/core/article1.md
89
90
  ---
90
91
  This is the core content of Article 1.
91
92
 
92
- {% include [x](_includes/inc.md) %}
93
+ {% include [x](_includes/inc-e3b0c44298fc.md) %}
93
94
  "
94
95
  `;
95
96
 
@@ -122,6 +123,7 @@ items:
122
123
  items:
123
124
  - name: Article1
124
125
  href: overlay3/article1.md
126
+ path: product2/toc.yaml
125
127
  "
126
128
  `;
127
129
 
@@ -142,6 +144,7 @@ items:
142
144
  items:
143
145
  - name: core/concepts/toc_i/item
144
146
  - name: core/concepts/toc_p/item
147
+ path: toc.yaml
145
148
  "
146
149
  `;
147
150
 
@@ -196,6 +199,7 @@ exports[`Include toc > Toc is included in link mode > toc.yaml 1`] = `
196
199
  items:
197
200
  - name: A1
198
201
  href: folder1/folder2/a1.md
202
+ path: toc.yaml
199
203
  "
200
204
  `;
201
205
 
@@ -297,6 +301,7 @@ exports[`Include toc > Toc is included inline, not as a new section > toc.yaml 1
297
301
  href: fileC.md
298
302
  - name: NameX
299
303
  href: fileX.md
304
+ path: toc.yaml
300
305
  "
301
306
  `;
302
307
 
@@ -332,6 +337,7 @@ exports[`Include toc > Toc root merge on non root dir > ru/toc.yaml 1`] = `
332
337
  items:
333
338
  - name: sub-page
334
339
  href: index.yaml
340
+ path: ru/toc.yaml
335
341
  "
336
342
  `;
337
343
 
@@ -375,6 +381,7 @@ href: index.yaml
375
381
  items:
376
382
  - name: A1
377
383
  href: a1.md
384
+ path: toc.yaml
378
385
  "
379
386
  `;
380
387
 
@@ -448,7 +455,7 @@ exports[`Include toc > Toc with generic includer > toc.yaml 1`] = `
448
455
  items:
449
456
  - name: test
450
457
  href: test/test.md
451
- - name: Overview
458
+ - name: index
452
459
  href: test/index.md
453
460
  - name: sub
454
461
  items:
@@ -460,5 +467,6 @@ items:
460
467
  items:
461
468
  - name: sub-3
462
469
  href: test/sub/sub/sub-3.md
470
+ path: toc.yaml
463
471
  "
464
472
  `;