-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep app dir #2062
Keep app dir #2062
Conversation
'entrypoint', | ||
request, | ||
request.virtualize(resolve(pkg.root, matched?.[0] ?? '-embroider-entrypoint.js')) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a first attempt at fixing the way the entrypoint works, since it may need to crawl a different directory than the package root, given what's in package.json exports.
But this is not really sufficient by itself. The AppFiles
class assumes that app and tests have already been smashed together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting the entrypoint inside a path that is mapped via package.json exports seems like a good idea, so this code is probably helpful. It ensures that we're resolving things that are actually supposed to be resolvable from outside the package. But we can't use only this path to identify which dirs to crawl when building the entrypoint, since there is more than one dir to crawl.
Instead, it probably makes sense to make the crawling code attempt to apply resolve.exports
to the-package/tests/example
and the-package/example
to identify the two directories we need to crawl to build AppFiles.
// don't support package.json `exports`. As for a future v2 engine or app: | ||
// this whole method is only relevant for implementing packageRules, which | ||
// should only be for classic stuff. v2 packages should do the right | ||
// things from the beginning and not need packageRules about themselves. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment was claiming we don't care about making this code work in native v2 packages, but it honestly seems easier to just make it work than guarantee that nobody will try to ever use reverseComponentLookup
in a v2 package.
add some fixes to the keep-app-dir implementation
# Conflicts: # packages/core/src/module-resolver.ts # packages/core/src/virtual-test-entrypoint.ts
add required fixes to keep-app-dir PR
This is the last major step before removing app rewriting.