Skip to content

Commit df65a89

Browse files
feat: removed schemas and replaced it with @diplodoc/ajv (#2004)
* feat: removed schemas and replaced it with @diplodoc/ajv * chore: Update package-lock.json * fix: fixed linter * fix: updated ajv * chore: Update package-lock.json * fix: updated ajv * chore: Update package-lock.json * fix: updated ajv * chore: Update package-lock.json * fix: fixed tests * fix: fixed * fix: fixed * fix: fixed ajv --------- Co-authored-by: yc-ui-bot <95919151+yc-ui-bot@users.noreply.github.com>
1 parent c1f2246 commit df65a89

14 files changed

Lines changed: 33 additions & 29663 deletions

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
/assets
44
/lib
55
!tests/**/input
6-
schemas/page-constructor-schema.json
76

87
# libraries
98
npm-debug.log

AGENTS.md

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ If a module contains a `MODULE.md` file, it is considered part of the module's c
2626
- `cases/` — test cases
2727
- `fixtures/` — test fixtures
2828
- `mocks/` — test mocks
29-
- `schemas/` — JSON/YAML schemas for fundamental project data structures
3029

3130
### CLI Commands
3231

@@ -253,27 +252,6 @@ The project supports configuration via:
253252
Main configuration files:
254253

255254
- `YFM_CONFIG_FILENAME` — configuration file name (usually `.yfm`)
256-
- Schemas in `schemas/` — JSON/YAML schemas for validation
257-
258-
### Schemas Directory
259-
260-
The `schemas/` directory stores schemas for fundamental project data structures:
261-
262-
- **`toc-schema.yaml`** — schema for documentation table of contents (`toc.yaml`)
263-
- Defines the structure of navigation and document hierarchy
264-
265-
- **`presets-schema.yaml`** — schema for template variables file (`presets.yaml`)
266-
- Defines variables used for document templating
267-
268-
- **`leading-schema.yaml`** — schema for "leading" (overview) pages structure
269-
- Defines the structure of summary/overview pages in documentation
270-
271-
- **`page-constructor-schema.yaml`** — schema for Page Constructor format
272-
- Defines the format for generating HTML pages from YAML descriptions
273-
- Based on [@gravity-ui/page-constructor](https://gravity-ui.com/ru/libraries/page-constructor)
274-
- Used to create pages from JSON/YAML block-based configurations
275-
276-
**Important**: Schemas and TypeScript types must always be kept in sync. When modifying types in `src/` that correspond to a schema (e.g., `RawToc``toc-schema.yaml`, `Preset``presets-schema.yaml`), you must update the matching schema in `schemas/` and vice versa. A mismatch between schemas and code leads to bugs where valid input (per schema) is silently rejected by the implementation.
277255

278256
## Additional Resources
279257

@@ -318,4 +296,4 @@ The `schemas/` directory stores schemas for fundamental project data structures:
318296
4. When working with VCS (GitHub/Arcadia), token configuration is required in `.env` or `.yfm`
319297
5. **All comments and documentation files (ADR, AGENTS.md, README, etc.) must be written in English**
320298
6. **The `src/steps/` directory is deprecated. Do not add new code there. If you need to fix existing code, carefully move it to `commands/build/features/`**
321-
7. **When changing TypeScript types that have a corresponding schema in `schemas/`, always update the schema to match, and vice versa**
299+
7. **When changing TypeScript types that have a corresponding schema in [`schemas/`](https://github.com/diplodoc-platform/ajv), always update the schema to match, and vice versa**

package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
]
7777
},
7878
"dependencies": {
79+
"@diplodoc/ajv": "^0.0.5",
7980
"@diplodoc/client": "^5.7.11",
8081
"@diplodoc/liquid": "^1.5.2",
8182
"@diplodoc/transform": "^4.75.4",

schemas/frontmatter-schema.yaml

Lines changed: 0 additions & 298 deletions
This file was deleted.

0 commit comments

Comments
 (0)