- Issue created by @danflanagan8
- πΊπΈUnited States danflanagan8 St. Louis, US
I was fortunate enough to meet with the OS team at CMS and ask some questions about the validation stuff! What a nice group of devs.
First, there are no plans to create an api endpoint (security concerns and concerns over huge file sizes). Second, there are no plans to create a php library for validation (they want a single source of truth for validation, which is and will be the typescript library).
So what can we don with the npm package that has the validation as js?
The npm package is here: https://www.npmjs.com/package/hpt-validator
The github for that is here: https://github.com/CMSgov/hpt-validator
Naively, I want to make that npm package a dependency of the Drupal module. The module would then define a validation library that more-or-less is a drupal wrapper for the hpt-validator js. The validation would then happen on the front end, probably during file upload. Perhaps also on page load of the hpt edit form. And maybe after some use action (e.g. button click) on the hpt collection page.
I'm never sure what the current best practice is for js dependencies, though, so I need to research that.
- πΊπΈUnited States danflanagan8 St. Louis, US
I created an upstream issue (I guess?) hoping for a new build script that generates a dist js.