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 deploy with local dependencies #6016
Feat deploy with local dependencies #6016
Conversation
This should be opt-in because not everyone expects this behaviour. For instance, in the past there were issues about the injected dependencies because only the files from the "files" field were linked. And there were also complaints when the deploy command only installed prod deps. |
How about |
actually, it is ok. No new option is needed because we already describe this as the way it should work in the docs: https://pnpm.io/cli/deploy#files-included-in-the-deployed-project |
customFetchers?: CustomFetchers | ||
): Fetchers { | ||
const defaultFetchers = { | ||
...createTarballFetcher(fetchFromRegistry, getAuthHeader, opts), | ||
...createGitFetcher(opts), | ||
...createDirectoryFetcher({ resolveSymlinks: opts.resolveSymlinksInInjectedDirs }), | ||
...createDirectoryFetcher({ resolveSymlinks: opts.resolveSymlinksInInjectedDirs, includeOnlyPackageFiles: opts.includeOnlyPackageFiles }), |
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.
it is not good because it will change the behaviour of the fetcher for all dependencies. But we only want to change it to the deployed project. I am not sure how to do it because we use the injected dep functionality to deploy the project. But we don't want to change how all injected deps are fetched.
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.
Did you meaning this case ?
// @pkg/bar
{
name: "@pkg/bar"
}
// @pkg/foo
{
name: "@pkg/foo",
"dependencies": {
"@pkg/bar": "workspace:*",
"baz": "file:../../baz"
}
}
if we set opts.includeOnlyPackageFiles: true
, it will affect file protocol dependency(baz
) too.
If only local dependencies (workspace protocol, file protocol, link protocol) use the directory fetcher, it seems to be ok to follow the files setting in package.json by default (if someone need to copy all files, then remove the files setting).
I'm not sure if there are other scenarios that are affected that I'm missing, if so, please let me know, thanks a lot.
Hello |
371bcc5
to
e176e00
Compare
This is a breaking change, so it will be shipped in v8. I have named the setting |
Close #5911
Close #5961