Closed AbhiPrasad closed 4 months ago
Since this same package is used in require-in-the-middle
too, this would result in more files/source for the majority of consumers.
Yeah require-in-the-middle
is a good point.
I wonder if module-details-from-path
will accept some PRs then to atleast clean up the files
thing. Let's try from that angle.
I don't see a reason to bother them with the maintenance burden. See https://github.com/fastify/skeleton/issues/42#issuecomment-1208090783
This PR vendors in
module-details-from-path
and rewrites it to match the syntax we use for import-in-the-middle.I generally believe that less dependencies for diagnostics tooling is a good thing but there are other reasons to do this.
module-details-from-path
pulls in a couple of un-needed files (testing, travis config). We can alleviate this for the ~8.3 mil weekly downloadsimport-in-the-middle
getsOne thing to note about the implementation is that I elected to add JSDoc based types. In my opinion adding a ts build process may be too heavy (unless we want to dual emit CJS/ESM from the lib), so I think this is a good middleground to get better intellisense while we are working on refactoring the lib. Happy to remove if folks thing this is unnecessary.
This PR came from me trying to reduce the import graph of a project that uses OpenTelemetry. Here's
@opentelemetry/instrumentation
for example.