fix(http): make the debug panel compatible with Yarn PnP installs #608
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm trying to get deepkit running with Yarn PnP (using deepkit-node - I might send a pull request with that later, when I figure out if it'll actually be usable).
Summary of changes
Right now, running an app (
yarn node --import deepkit-node ./app.ts server:start
) withFrameworkModule({ debug: true })
in a Yarn PnP environment produces a warning:As a result, the debug panel doesn't work. This is because the
node_modules
path is hardcoded, and there is nonode_modules
on Yarn PnP.With this change, it works. I'm using
import.meta.resolve
to resolve a path to index.html, and I'm forcing yarn to actually unzip ("unplug") the static files, so that it's possible to access them in a traditional way.As
import.meta
is accessible only in the ESM mode, I'm doing some hack to do the resolution withrequire.resolve
in CJS mode - I don't really like this solution, but I don't have any idea for a better one. Theoretically, this should be transparently handled by the ESM->CJS transpiler, but TypeScript doesn't support it.Relinquishment of Rights
Please mark following checkbox to confirm that you relinquish all rights of your changes: