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
feat: Support Yarn PnP #3209
base: main
Are you sure you want to change the base?
feat: Support Yarn PnP #3209
Conversation
39187e4
to
fc38e7f
Compare
fc38e7f
to
ab78f3c
Compare
ab78f3c
to
7641f6f
Compare
packages/api/core/src/api/start.ts
Outdated
@@ -153,6 +153,8 @@ export default async ({ | |||
} as NodeJS.ProcessEnv, | |||
}; | |||
|
|||
delete spawnOpts.env.NODE_OPTIONS; |
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.
Can you explain why this is necessary? I'm a bit weary about what other effects this might have.
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.
See below
@dsanders11 When executing script in package.json, .pnp.cjs is injected through NODE_OPTIONS because the pnp module loader is required. NODE_OPTIONS:
|
packages/api/core/src/api/start.ts
Outdated
@@ -153,6 +153,8 @@ export default async ({ | |||
} as NodeJS.ProcessEnv, | |||
}; | |||
|
|||
delete spawnOpts.env.NODE_OPTIONS; |
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.
I would like this to conditionally delete the strings that Yarn adds from process.env.NODE_OPTIONS
instead of clearing the entire env var.
Unfortunately, commander
doesn't seem to expose any utilities to parse args strings, and util.parseArgs
is only available in Node 18+, so we might need to just hack this in manually.
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.
used regex instead of parse to reduce complexity.
7641f6f
to
977f624
Compare
977f624
to
2888d82
Compare
Summarize your changes:
Support Yarn PnP
require.resolve