Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PoC(XSD and XML in TS) #1558

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

PoC(XSD and XML in TS) #1558

wants to merge 10 commits into from

Conversation

Spencer6497
Copy link
Contributor

@Spencer6497 Spencer6497 commented Dec 18, 2024

This PR is a minimal proof-of-concept for xJustiz communication in the app, enabling both

  • Consuming XSDs and generating Typescript Type declarations
  • Generation of valid XML from the aforementioned, strongly-typed javascript objects

NOTES

  • npm run build:typesFromXSD generates the types. Unfortunately, it can only be run once (does not update the files if altered), and the generated output must be fixed (imports are incorrect)
  • npm run build:xml runs a proof-of-concept script, generateXMLFromObject.ts, that uses the generated type to build a barebones object, build an XML from it, and print it out to file.
  • the xcsd library we're using is massively out-of-date (5 years!), but I'm waiting to see if we can use a newer fork. Unclear if this will fix the aforementioned issues.
  • utilize cxsd as proof-of-concept
  • add proof-of-concept script for TS -> XML, re-generate types via cxsd
  • tweak cxsd script and move output to sensible locations
  • fix ts errors in generated files, add npm script for xml generation

Copy link

sonarqubecloud bot commented Jan 8, 2025

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.

1 participant