@diplodoc/cli-tests 0.0.0-rc-fix-translate-openapi-includer-202507171205 → 0.0.0-rc-liquid-conditions-saving-202509050811

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 (108) hide show
  1. package/e2e/__snapshots__/generate-map.spec.ts.snap +345 -0
  2. package/e2e/__snapshots__/include-toc.test.ts.snap +8 -0
  3. package/e2e/__snapshots__/load-custom-resources.spec.ts.snap +64 -59
  4. package/e2e/__snapshots__/metadata.spec.ts.snap +29 -24
  5. package/e2e/__snapshots__/preprocess.test.ts.snap +549 -0
  6. package/e2e/__snapshots__/regression.test.ts.snap +177 -142
  7. package/e2e/__snapshots__/rtl.spec.ts.snap +44 -41
  8. package/e2e/__snapshots__/search.test.ts.snap +37 -22
  9. package/e2e/__snapshots__/skip-html-extension.spec.ts.snap +211 -0
  10. package/e2e/__snapshots__/translation.spec.ts.snap +518 -2
  11. package/e2e/errors.spec.ts +33 -2
  12. package/e2e/generate-map.spec.ts +9 -3
  13. package/e2e/preprocess.test.ts +33 -0
  14. package/e2e/redirects-validation.spec.ts +61 -0
  15. package/e2e/search.test.ts +1 -1
  16. package/e2e/skip-html-extension.spec.ts +15 -0
  17. package/e2e/translation.spec.ts +47 -2
  18. package/fixtures/cliAdapter.ts +23 -0
  19. package/fixtures/globals.d.ts +4 -0
  20. package/fixtures/runners/binary.ts +4 -3
  21. package/fixtures/runners/types.ts +1 -2
  22. package/fixtures/utils/file.ts +5 -5
  23. package/fixtures/utils/test.ts +17 -8
  24. package/mocks/docs-viewer-interface/input/.yfm +6 -0
  25. package/mocks/docs-viewer-interface/input/index.md +3 -0
  26. package/mocks/docs-viewer-interface/input/toc.yaml +5 -0
  27. package/mocks/errors/extract-filtered-link/input/filtered.md +1 -0
  28. package/mocks/errors/extract-filtered-link/input/filtered2.md +0 -0
  29. package/mocks/errors/extract-filtered-link/input/index.md +7 -0
  30. package/mocks/errors/extract-filtered-link/input/toc.yaml +1 -0
  31. package/mocks/load-custom-resources/md2html-with-resources/input/page.md +9 -2
  32. package/mocks/load-custom-resources/md2md-with-resources/input/page.md +9 -2
  33. package/mocks/load-custom-resources/single-page-with-resources/input/page.md +9 -2
  34. package/mocks/metadata/md2html-with-metadata/input/page.md +8 -1
  35. package/mocks/metadata/md2md-with-metadata/input/page.md +7 -0
  36. package/mocks/preprocess/input/.yfm +1 -0
  37. package/mocks/preprocess/input/1.md +29 -0
  38. package/mocks/preprocess/input/_assets/1.png +0 -0
  39. package/mocks/preprocess/input/_assets/1.svg +0 -0
  40. package/mocks/preprocess/input/autotitle.md +23 -0
  41. package/mocks/preprocess/input/commented-include.md +3 -0
  42. package/mocks/preprocess/input/images.md +5 -0
  43. package/mocks/preprocess/input/included-item.md +12 -0
  44. package/mocks/preprocess/input/includes/deep.md +1 -0
  45. package/mocks/preprocess/input/includes/deepWithIndent.md +6 -0
  46. package/mocks/preprocess/input/includes/presets.yaml +2 -0
  47. package/mocks/preprocess/input/includes/sub/user.md +1 -0
  48. package/mocks/preprocess/input/includes/sub/userWithIndent.md +5 -0
  49. package/mocks/preprocess/input/includes/test.md +1 -0
  50. package/mocks/preprocess/input/includes/user.md +1 -0
  51. package/mocks/preprocess/input/includes.md +18 -0
  52. package/mocks/preprocess/input/latex.md +3 -0
  53. package/mocks/preprocess/input/mermaid.md +13 -0
  54. package/mocks/preprocess/input/presets.yaml +8 -0
  55. package/mocks/preprocess/input/sub/folder/item-1.md +7 -0
  56. package/mocks/preprocess/input/sub/toc.yaml +5 -0
  57. package/mocks/preprocess/input/toc-i.yaml +3 -0
  58. package/mocks/preprocess/input/toc.yaml +16 -0
  59. package/mocks/redirects-validation/extensions-deprecation/input/blah.md +0 -0
  60. package/mocks/redirects-validation/extensions-deprecation/input/redirects.yaml +5 -0
  61. package/mocks/redirects-validation/extensions-deprecation/input/toc.yaml +4 -0
  62. package/mocks/redirects-validation/invalid-regex/input/blah.md +0 -0
  63. package/mocks/redirects-validation/invalid-regex/input/redirects.yaml +3 -0
  64. package/mocks/redirects-validation/invalid-regex/input/toc.yaml +4 -0
  65. package/mocks/redirects-validation/malformed-redirect/input/blah.md +0 -0
  66. package/mocks/redirects-validation/malformed-redirect/input/redirects.yaml +6 -0
  67. package/mocks/redirects-validation/malformed-redirect/input/toc.yaml +4 -0
  68. package/mocks/redirects-validation/same-path/input/blah.md +0 -0
  69. package/mocks/redirects-validation/same-path/input/redirects.yaml +3 -0
  70. package/mocks/redirects-validation/same-path/input/toc.yaml +4 -0
  71. package/mocks/redirects-validation/unparseable/input/blah.md +0 -0
  72. package/mocks/redirects-validation/unparseable/input/redirects.yaml +11 -0
  73. package/mocks/redirects-validation/unparseable/input/toc.yaml +4 -0
  74. package/mocks/regression/input/.yfm +2 -0
  75. package/mocks/regression/input/images.md +2 -0
  76. package/mocks/regression/input/includes/deep.md +2 -0
  77. package/mocks/regression/input/includes/presets.yaml +1 -0
  78. package/mocks/regression/input/includes/tools.md +1 -0
  79. package/mocks/regression/input/includes.md +5 -0
  80. package/mocks/regression/input/merge/merge.md +2 -0
  81. package/mocks/regression/input/merge/presets.yaml +1 -0
  82. package/mocks/regression/input/merge/toc.yaml +2 -0
  83. package/mocks/regression/input/presets.yaml +1 -0
  84. package/mocks/regression/input/toc.yaml +2 -0
  85. package/mocks/search/input/.yfm +12 -0
  86. package/mocks/skip-html-extension/input/.yfm +1 -0
  87. package/mocks/skip-html-extension/input/folder/index.md +1 -0
  88. package/mocks/skip-html-extension/input/index-test-html/index.md +4 -0
  89. package/mocks/skip-html-extension/input/index.md +6 -0
  90. package/mocks/skip-html-extension/input/page1.md +3 -0
  91. package/mocks/skip-html-extension/input/page2.md +6 -0
  92. package/mocks/skip-html-extension/input/toc.yaml +13 -0
  93. package/mocks/translation/conditions/input/index.md +37 -0
  94. package/mocks/translation/dir-files/input/.yfm +6 -0
  95. package/mocks/translation/dir-files/input/ru/aboba.md +2 -4
  96. package/mocks/translation/dir-files/input/ru/nested/a1.md +3 -0
  97. package/mocks/translation/dir-files/input/ru/nested/folder1/a1.md +3 -0
  98. package/mocks/translation/dir-files/input/ru/nested/folder1/toc-i.yaml +3 -0
  99. package/mocks/translation/dir-files/input/ru/nested/syntax/base.md +2 -0
  100. package/mocks/translation/dir-files/input/ru/nested/toc.yaml +1 -0
  101. package/mocks/translation/dir-files/input/ru/no-var-page.md +3 -0
  102. package/mocks/translation/dir-files/input/ru/to-be-excluded.md +1 -0
  103. package/mocks/translation/dir-files/input/ru/toc.yaml +7 -1
  104. package/mocks/translation/openapi/input/toc.yaml +1 -1
  105. package/mocks/warning/unreachable-autotitle/input/index.md +1 -0
  106. package/mocks/warning/unreachable-autotitle/input/link.md +0 -0
  107. package/mocks/warning/unreachable-autotitle/input/toc.yaml +4 -0
  108. package/package.json +5 -5
@@ -0,0 +1,16 @@
1
+ items:
2
+ - name: Md item with not_var syntax
3
+ href: ./1.md
4
+ - name: Md item named without extension
5
+ href: ./1
6
+ - include: {path: toc-i.yaml}
7
+ - include: {path: sub/toc.yaml, mode: link}
8
+ - href: ./mermaid
9
+ - name: '{#T}'
10
+ href: ./latex
11
+ - name: Images
12
+ href: ./images
13
+ - name: Autotitle
14
+ href: ./autotitle
15
+ - name: includes
16
+ href: ./includes
@@ -0,0 +1,5 @@
1
+ common:
2
+ - from: /foo.md
3
+ to: /bar.md
4
+ - from: /barbar.md
5
+ to: /baz.md
@@ -0,0 +1,4 @@
1
+ items:
2
+ - name: Blah
3
+ href: blah.md
4
+
@@ -0,0 +1,3 @@
1
+ common:
2
+ - from: /(foo.md
3
+ to: /bar.md
@@ -0,0 +1,4 @@
1
+ items:
2
+ - name: Blah
3
+ href: blah.md
4
+
@@ -0,0 +1,6 @@
1
+ common:
2
+ - form: /foo.md
3
+ to: /bar.md
4
+ - match: /barbar.md
5
+ redirect: /baz.md
6
+ -
@@ -0,0 +1,4 @@
1
+ items:
2
+ - name: Blah
3
+ href: blah.md
4
+
@@ -0,0 +1,3 @@
1
+ common:
2
+ - from: /foo
3
+ to: /foo
@@ -0,0 +1,4 @@
1
+ items:
2
+ - name: Blah
3
+ href: blah.md
4
+
@@ -0,0 +1,11 @@
1
+ common:
2
+ - from: /foo.md
3
+ to: /bar.md
4
+
5
+ <<<<<<< HEAD
6
+
7
+ - from: /barbar.md
8
+ to: /baz.md
9
+
10
+ =======
11
+ >>>>>>> merge-branch
@@ -0,0 +1,4 @@
1
+ items:
2
+ - name: Blah
3
+ href: blah.md
4
+
@@ -0,0 +1,2 @@
1
+ preprocess:
2
+ mergeAutotitles: true
@@ -9,3 +9,5 @@
9
9
  <!-- ![commented](_assets/4.png) -->
10
10
 
11
11
  ![with backslash](_assets/5\_1.png)
12
+
13
+ [![img 3](_assets/{{img_3}})](latex.md)
@@ -1 +1,3 @@
1
1
  {% include [user](./user.md) %}
2
+
3
+ [![img 3](../_assets/{{img_3}})](../latex.md)
@@ -1,2 +1,3 @@
1
1
  default:
2
2
  user: Alice
3
+ img_3: 4.png
@@ -0,0 +1 @@
1
+ Tool: {{tools}}
@@ -6,3 +6,8 @@ Text
6
6
 
7
7
  <!--{% include [For includes/deep.md](includes/deep.md) %}-->
8
8
  {% include [For includes/deep.md](includes/deep.md) %}
9
+
10
+ Link after include
11
+ [{#T}](./1.md#subtitle)
12
+
13
+ Link after include
@@ -1,3 +1,5 @@
1
1
  # Should use merged item
2
2
 
3
3
  [merged](./merged.md)
4
+
5
+ {% include [tools](../includes/tools.md) %}
@@ -1,2 +1,3 @@
1
1
  default:
2
2
  product: merge
3
+ tools: Hammer and Laser
@@ -1,4 +1,6 @@
1
1
  items:
2
2
  - name: Use merged
3
3
  href: ./merge.md
4
+ - name: Multitoc item
5
+ href: ../1.md
4
6
  - include: {path: ../merge-source/toc-m.yaml, mode: merge}
@@ -3,6 +3,7 @@ default:
3
3
  not-var: not-var-value
4
4
  product: root
5
5
  user: Bob
6
+ img_3: 3.png
6
7
 
7
8
  internal:
8
9
  default-var: default-var-internal-value
@@ -9,6 +9,8 @@ items:
9
9
  href: ./1
10
10
  - name: Item with empty href
11
11
  href:
12
+ - name: Multitoc item
13
+ href: ./merge/merged.md
12
14
  - include: {path: toc-i.yaml}
13
15
  - include: {path: sub/toc.yaml, mode: link}
14
16
  - href: ./mermaid
@@ -0,0 +1,12 @@
1
+ allowHTML: true
2
+ langs: ['en','ru']
3
+
4
+ interface:
5
+ toc-header: false
6
+ favicon-src: https://storage.yandexcloud.net/diplodoc-www-assets/favicon/favicon.ico
7
+
8
+ search:
9
+ provider: local
10
+ tolerance: 2
11
+ confidense: phrased
12
+
@@ -0,0 +1 @@
1
+ allowHTML: true
@@ -0,0 +1 @@
1
+ # Page 3
@@ -0,0 +1,4 @@
1
+ # Folder
2
+
3
+ [Link 1](../page1.md)
4
+ [Link 2](../page2.md)
@@ -0,0 +1,6 @@
1
+ # Header
2
+
3
+ Content
4
+
5
+ [Link 1](page1.md)
6
+ [Link 2](page2.md)
@@ -0,0 +1,3 @@
1
+ # Page 1
2
+
3
+ [Link](page2.md#hash)
@@ -0,0 +1,6 @@
1
+ # Page 2
2
+
3
+ ## hash
4
+
5
+ [Link](./folder/index.md)
6
+ [External link](https://example.com)
@@ -0,0 +1,13 @@
1
+ title: Skip html extension
2
+ href: index.md
3
+
4
+ items:
5
+ - name: Title 1
6
+ href: page1.md
7
+ - name: Title 2
8
+ href: page2.md
9
+ - name: Title 3
10
+ href: ./folder/index.md
11
+ - name: Title 4
12
+ href: ./index-test-html/index.md
13
+
@@ -0,0 +1,37 @@
1
+ [existing file](./exists.md)
2
+ <!-- [missed file](./missed.md) -->
3
+ {% if prod == true %}Test text{% endif %}
4
+
5
+ {% if inner == true %}inner test text{% endif %}
6
+
7
+ {% if prod == true %}Test text{% if inner == true %}inner test text{% endif %}{% endif %}
8
+
9
+ {% if prod == true %}
10
+
11
+ {% if list contains "item" %}
12
+
13
+ #### List
14
+
15
+ {% if item == true %}1. Item {% endif %}
16
+
17
+ Some text
18
+
19
+ {% endif %}
20
+
21
+ {% endif %}
22
+
23
+ #### Standalone contains condition
24
+
25
+ {% if list contains "item" %}
26
+
27
+ #### List
28
+
29
+ {% endif %}
30
+
31
+ #### Inline contains condition
32
+
33
+ {% if prod == true %}
34
+
35
+ #### List {% if list contains "item" %} sub text {% endif %}
36
+
37
+ {% endif %}
@@ -0,0 +1,6 @@
1
+ translate:
2
+ extract:
3
+ vars:
4
+ test: prod
5
+ skip: dev
6
+
@@ -1,7 +1,5 @@
1
1
  ## Заголовок include
2
2
 
3
- [ссылка на файл не в toc.yaml](./aboba-not-in-toc.md)
4
-
5
- {% include [Описание](./_includes/test.md) %}
6
-
3
+ <!-- [ссылка на файл не в toc.yaml](./aboba-not-in-toc.md) -->
7
4
 
5
+ {% include [Описание](./_includes/test.md) %}
@@ -0,0 +1,3 @@
1
+ ## Included A1
2
+
3
+ TEST
@@ -0,0 +1,3 @@
1
+ ## Included A1
2
+
3
+ TEST
@@ -0,0 +1,3 @@
1
+ items:
2
+ - name: A1
3
+ href: a1.md
@@ -1 +1,3 @@
1
1
  # Базовая разметка
2
+
3
+ {% if test == "dev" %}[will be deleted on translate-extract](./index.md){% endif %}
@@ -3,6 +3,7 @@ href: index.yaml
3
3
  items:
4
4
  - name: API Yandex Cloud
5
5
  href: index.yaml
6
+ - include: {mode: merge, path: folder1/toc-i.yaml}
6
7
  - name: Yandex Flavored Markdown
7
8
  href: index-yfm.md
8
9
  items:
@@ -0,0 +1,3 @@
1
+ ## No var page
2
+
3
+ This page might be translated or not. Depends on --strict-vars option.
@@ -0,0 +1 @@
1
+ ## Excluded title
@@ -4,4 +4,10 @@ items:
4
4
  - name: Aboba
5
5
  href: aboba.md
6
6
  - name: Не переводить
7
- href: _no-translate/exclude.md
7
+ when: skip == 'prod'
8
+ href: _no-translate/exclude.md
9
+ - name: Нет переменной в vars
10
+ when: novar == 'test'
11
+ href: no-var-page.md
12
+ - name: exclude-test
13
+ href: to-be-excluded.md
@@ -5,4 +5,4 @@ items:
5
5
  includers:
6
6
  - name: openapi
7
7
  input: openapi-spec.yaml
8
-
8
+ mode: link
@@ -0,0 +1 @@
1
+ [{#T}](./link.md#unknown_yfm010)
@@ -0,0 +1,4 @@
1
+ href: index.md
2
+ items:
3
+ name: link
4
+ href: link.md
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diplodoc/cli-tests",
3
- "version": "0.0.0-rc-fix-translate-openapi-includer-202507171205",
3
+ "version": "0.0.0-rc-liquid-conditions-saving-202509050811",
4
4
  "bin": {
5
5
  "diplodoc-cli-test": "bin.mjs"
6
6
  },
@@ -27,19 +27,19 @@
27
27
  "@diplodoc/cli": "file:.."
28
28
  },
29
29
  "dependencies": {
30
- "@diplodoc/client": "^3.6.3",
30
+ "@diplodoc/liquid": "^1.3.4",
31
31
  "@types/node": "18.x",
32
32
  "@vitest/coverage-istanbul": "^3.1.1",
33
33
  "@vitest/coverage-v8": "^3.1.1",
34
- "commander": "^13.1.0",
35
34
  "execa": "^9.5.3",
36
35
  "glob": "^11.0.2",
37
36
  "js-yaml": "^4.1.0",
37
+ "strip-ansi": "^7.1.0",
38
38
  "ts-dedent": "^2.2.0",
39
- "ts-node": "^10.4.0",
40
- "typescript": "^5.3.3"
39
+ "typescript": "^5.9.2"
41
40
  },
42
41
  "peerDependencies": {
42
+ "@diplodoc/cli": "*",
43
43
  "vitest": "^3.1.1"
44
44
  }
45
45
  }