Skip to content

feature: super validator infrastructure and first two validators#725

Merged
edoversb merged 7 commits intodevelopfrom
feature/supervalidator
Aug 4, 2025
Merged

feature: super validator infrastructure and first two validators#725
edoversb merged 7 commits intodevelopfrom
feature/supervalidator

Conversation

@harbournick
Copy link
Copy Markdown
Collaborator

@harbournick harbournick commented Aug 4, 2025

  • Creates new SuperValidator class that will contain active document, import and export validations
  • Creates extensible infra for adding many validators and extending existing ones
  • Adds custom logger for SuperValidator and validators
  • Adds validation on ready event for both standard and collaboration mode
  • Adds first two validators for checking rId in image node and link mark
  • Adds document.xml.rels docx helpers
  • Adds complete JSDoc definitions and automated TS checks for all new files (build will fail if types are invalid)
  • 100% unit test coverage in validator

@harbournick harbournick self-assigned this Aug 4, 2025
@harbournick harbournick marked this pull request as ready for review August 4, 2025 04:38
@harbournick harbournick force-pushed the feature/supervalidator branch from f5515f4 to d6c13c1 Compare August 4, 2025 05:53
@harbournick harbournick force-pushed the feature/supervalidator branch from d6c13c1 to 453f2c1 Compare August 4, 2025 06:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a comprehensive document validation infrastructure for the Super Editor with initial validator implementations for handling missing rId attributes in images and links.

  • Creates a modular SuperValidator architecture that supports multiple document validation types
  • Implements automatic validation on editor initialization and collaboration readiness events
  • Adds comprehensive logging, JSDoc documentation, and 100% test coverage

Reviewed Changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/super-editor/src/core/Editor.js Integrates SuperValidator into editor lifecycle
packages/super-editor/src/core/super-validator/ Core validator infrastructure with logging and types
packages/super-editor/src/core/super-validator/validators/state/ State validators for image nodes and link marks
packages/super-editor/src/core/super-converter/docx-helpers/ Document.xml.rels utility functions for rId management
packages/super-editor/tsconfig.json Updated module resolution for NodeNext
packages/superdoc/src/dev/components/SuperdocDev.vue Dev environment configuration updates
Comments suppressed due to low confidence (2)

packages/super-editor/src/core/super-validator/validators/state/nodes/link/rules/link-rid.js:27

  • The variable name 'newId' is misleading since this line is finding an existing ID, not creating a new one. Consider renaming to 'existingId' or 'foundId' for clarity.
      let newId = editor.converter.docxHelpers.findRelationshipIdFromTarget(href, editor);

packages/super-editor/src/core/super-validator/validators/state/nodes/image/rules/image-rid.js:25

  • The variable name 'newId' is misleading since this line is finding an existing ID, not creating a new one. Consider renaming to 'existingId' or 'foundId' for clarity.
      let newId = editor.converter.docxHelpers.findRelationshipIdFromTarget(src, editor);

Comment thread packages/super-editor/src/core/super-validator/logger/logger.js Outdated
@harbournick harbournick force-pushed the feature/supervalidator branch from e80612a to c337647 Compare August 4, 2025 17:44
Copy link
Copy Markdown
Contributor

@edoversb edoversb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@edoversb edoversb merged commit 80d0aeb into develop Aug 4, 2025
8 checks passed
@edoversb edoversb deleted the feature/supervalidator branch August 4, 2025 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants