Open pombredanne opened 1 year ago
In terms of solution we can start with:
We have two cases:
To
-side to the From
-side. If the path match conclusively, we can further validate some paths using actual content"sources":[
"../../../../../../src/main/resources/META-INF/resources/style.scss",
"../../../../../../../../../node_modules/@clayui/css/src/scss/cadmin/variables/_globals.scss"
],
These path should be traced back and mapped to the To-side OR to third-party external code, like the @clayui/css
npm package in this example.
To support this tracing we likely need to keep a list of these stored in the DB and have a way to relate each such path to either another From-side resource or a file inside a package, which means at least adding some DiscoveredPackage.
Adding these DiscoveredPackages (that may not be always deployed yet and not in the To-side at all) could be done this way:
To process map files, we can consider https://github.com/mattrobenolt/python-sourcemap or parse by hand since this is a simple JSON format. Note that webpack may sometimes create weird paths in the js.map files.
I suggest that we start with path matching this way processing each file one at a time:
If we match the path to an unambiguous package, we would:
Regarding PurlDB matching we need to consider that some teams package their own code as private npm packages kept in a private repo so these will never appear in PurlDB.
This is mostly done and operational as steps in the develop_to_deploy pipeline ... so we are just keeping this open to create a JS-only pipeline
When I use JavaScript in an application, I have a few typical configurations and contexts:
At development time:
At run time:
node_modules
as-is (typical for a node-based server-side application) or as resources in some other deployed artifacts (seen sometimes in Java)My problem is to find which subset of the devel codebase (the From side) has been deployed (the To side) knowing that the deployed JS may be: