Skip to content

Switches to using validateJSON#1213

Merged
tupaschoal merged 3 commits into
TTLApp:mainfrom
Atomic-Germ:dev/1052
Jul 11, 2025
Merged

Switches to using validateJSON#1213
tupaschoal merged 3 commits into
TTLApp:mainfrom
Atomic-Germ:dev/1052

Conversation

@Atomic-Germ

Copy link
Copy Markdown
Contributor

Related issue

Closes #1052

Context / Background

We were using an RYO solution, and this moves us to validateJSON.

What change is being introduced by this PR?

  • js/validate-json.js -> js/validate-json.mjs
  • Adjusted js/import-export.mjs so that it uses validateJSON exported from js/validate-json.mjs
  • Removed the old bits and associated tests.

How will this be tested?

All automated tests should still pass. The app should refuse to import a broken ttldb file.

@codecov

codecov Bot commented Jun 4, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
js/import-export.mjs 100.00% <100.00%> (ø)
js/validate-json.mjs 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@araujoarthur0

Copy link
Copy Markdown
Collaborator

Please add a meaningful self-descriptive name to the PR.

Comment thread __tests__/__main__/import-export.mjs Outdated
@Atomic-Germ Atomic-Germ changed the title Dev/1052 Switches to using validateJSON Jun 7, 2025

@tupaschoal tupaschoal left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you redo the first commit to use git mv instead? Then it will be recorded as a file rename, instead of a file deletion + file addition.

Other than that seems fine, since validateJSON has pretty good test coverage on its own.

@tupaschoal
tupaschoal merged commit fb86b28 into TTLApp:main Jul 11, 2025
4 checks passed
@tupaschoal

Copy link
Copy Markdown
Collaborator

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace hand-made json validator by validateJSON utility

3 participants