Skip to content

Fix web converter samples and clear CI lint noise#4

Merged
voku merged 3 commits into
mainfrom
copilot/fix-ci-script-errors
Apr 18, 2026
Merged

Fix web converter samples and clear CI lint noise#4
voku merged 3 commits into
mainfrom
copilot/fix-ci-script-errors

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 18, 2026

TLDR

Removes the remaining web-entry lint noise and fixes the converter page’s shipped sample inputs so the examples align with the current converters and CI passes cleanly.

Details

  • CI failures

    • Removed the console.error fallback branches from the web entrypoints (main.ts, converter-main.ts) that were surfacing as no-console warnings in CI.
    • Kept behavior minimal: mount when the target exists; otherwise do nothing.
  • Converter page samples

    • Updated the built-in Python sample to match what the Python converter currently supports and round-trips reliably.
    • Expanded the PHP sample so it represents the full seeded model shown on the converter page instead of a partial / broken example.
    • Kept the sample set consistent with the shared typeDiagram seed model used by the converter UI.
  • Regression coverage

    • Added packages/web/test/converter-samples.test.ts to verify:
      • the shipped TD_SAMPLE parses and builds,
      • each language sample converts through the real converter,
      • the resulting model prints back to valid typeDiagram source.
    • Tightened the assertions to compare the expected declaration sets directly so drift in shipped samples is caught early.
const el = document.getElementById("converter-mount");
if (el instanceof HTMLElement) {
  mountConverter(el);
}

How Do The Automated Tests Prove It Works?

  • make ci reproduces the failing path from the issue and now completes cleanly through format check, lint, test, build, and bundle-size.
  • packages/web/test/converter-samples.test.ts exercises the actual shipped converter samples and verifies they remain parseable / convertible across supported languages.
  • npm run -w packages/web test covers the converter UI seed content alongside the existing converter page and render pipeline tests.

Copilot AI and others added 3 commits April 18, 2026 13:07
@voku voku marked this pull request as ready for review April 18, 2026 13:34
@voku
Copy link
Copy Markdown
Owner

voku commented Apr 18, 2026

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the DOM element mounting logic in converter-main.ts and main.ts to use instanceof HTMLElement checks while removing error logging for missing elements. It significantly expands the sample code for Python and PHP in converter.ts to include more complex types such as Enums, nullable fields, and new data structures like ChatTurnInput and UriPart. Additionally, it exports these samples and introduces a new test suite, converter-samples.test.ts, to ensure that the seed content remains parseable and convertible across all supported languages. I have no feedback to provide as there were no review comments to evaluate.

@voku voku merged commit 1ae3e5b into main Apr 18, 2026
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.

2 participants