Skip to content

Commit b80d158

Browse files
authored
Updated to TypeScript v6; made several major fixes to the reverse HTML mapper; sequelize invocations are now simpler (#7871)
* a) forgot to comment out the writefilesync in the reverse xccdf mapper test and b) it was putting files in the wrong place anyways Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * could simplify this code by using url.parse instead of try/catch around new url Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * made the reverse html mapper able to handle both urls and paths for finding the template files it needs which let us then be able to write a test for it and generate a sample output file Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * css got updated so need to refresh the sample Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * need to declare modules for all imports including css Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * lint Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * unit8array isn't immediately castable to something that can be ingested by blob Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * upgrade to typescript v6 Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * now that we have the latest types, we can use new Set functions - resolves #7816 Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * apparently baseurl is deprecated in v6 in prep for v7 Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * don't need to point at node modules directly to access the tsc binary Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * node as of 22.18.0 can run typescript natively so long as it contains erasable ts syntax: https://nodejs.org/en/learn/typescript/run-natively Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * the contents of that directory do not need to be bundled with the library - the artifacts that they generate are ingested into the code in other ways Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * moved the template files from the frontend over to hdfconverters as well considering that the mapper is there; adjusted the logic so that instead of reading those files directly we would instead as a build step put all of them into a .ts file as raw strings which we could then instead read directly and not have to worry about fs not being availabe in the browser context; being able to read it as strings simplified the logic a bit as well including getting rid of the dependency on axios in that mapper; added a test; swapped the 'twe' back to 'te' in the template.html file due to it causing the buttons to not be responsive since i think despite the dependency upgrading maybe due to the minimized js being old it doesn't know about it yet Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * remove beads dir Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * when you remove baseUrl you need to make the path clearer Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * we don't use jest anymore so no need to keep it in the name Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * Stop wrapping the sequelize cli during its invocations. Previously the sequelize cli depended on a db config file that was written in typescript and which consequently needed to be invoked in a typescript aware manner in order to run properly. To do that, we used the `tsx` dependency. Alongside the other changes we did for the tsconfig, one of the side effects was that the config file was compiled into normal javascript and therefore easily runnable natively. Pointing the sequelize config file at that compiled javascript version of the db config file allowed us to a) get rid of tsx, b) consequently get rid of our dependency on esbuild which often got hit with golang CVEs that didn't actually apply to itself and/or us, and lastly c) get rid of the wrappers we had in the package.json since we didn't need to invoke it in operating system specific ways anymore. A change is that you now need to ensure to build the app before you're able to set up the db where previously all you had to do was install all the dependencies so that you could have access to sequelize. I figure that since we're already going to all the work of installing all the dependencies, then it's not that much more work on top to build the app as well. Separately I cleaned up the backend README a bit, ex. got rid of the LICENSE information that was there since we had an actual LICENSE file. Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * wip for turning entities into tags in html export Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * i dunno why i keep on flipflopping on this but yeah we need data-te, also need mustache to not escape the areas where we can expect html (by default it escapes everything so you have to do triple braces instead of double to fix it) - this resolves #7678 Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * regen samples Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * remove dependabot ignores for various package versions that have been superseded or removed outright Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * forgot to update this hdf converters tests workflow after changing directory structures for the xccdf reverse mapper samples Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * needed to add the types package for sanitize-html to hdf-converters as well Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * make one line Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * strict is true by default in typescript 6 Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * vite / vitest has removed esbuild as a direct dependency in favor of oxc, but the vue2 vitest plugin we use relies on the older behavior and deprecated function transformwithesbuild - consequently we need to manually install it as a dev dependency so that we can run tests Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * have to add ignoredeprecations warning to tests module since cypress is actually not yet compatible with typescript 6 see: cypress-io/cypress#33511 Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * have to add ignoredeprecations warning to frontend module since moduleResolution=node is deprecated and we can't update that without upgrading vue from 2 to 3 I think Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * button implicitly has the role of button so don't need to explicitly define it as such Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * aria label should contain the text that is presented on the visible ui Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * regen assets and samples Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * satisfy sonarqube by providing a default value here that also gets rid of the non-null assertion Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * sonarqube Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * rootdir defaults to '.' in ts6 Signed-off-by: Amndeep Singh Mann <amann@mitre.org> --------- Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
1 parent d9b5b66 commit b80d158

File tree

67 files changed

+170867
-4162
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+170867
-4162
lines changed

.beads/.gitignore

Lines changed: 0 additions & 51 deletions
This file was deleted.

.beads/README.md

Lines changed: 0 additions & 81 deletions
This file was deleted.

.beads/config.yaml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.beads/hooks/post-checkout

Lines changed: 0 additions & 18 deletions
This file was deleted.

.beads/hooks/post-merge

Lines changed: 0 additions & 20 deletions
This file was deleted.

.beads/hooks/pre-commit

Lines changed: 0 additions & 20 deletions
This file was deleted.

.beads/hooks/pre-push

Lines changed: 0 additions & 20 deletions
This file was deleted.

.beads/hooks/prepare-commit-msg

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)