Skip to content
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

Merged
merged 6 commits into from Feb 19, 2023

Conversation

await-ovo
Copy link
Member

Close #5911
Close #5961

@zkochan
Copy link
Member

zkochan commented Feb 2, 2023

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.

@await-ovo
Copy link
Member Author

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 pnpm --ignore-package-files deploy?
We respect package.json files setting by default, if we want copy all files then we use --ignore-package-files option.

@zkochan
Copy link
Member

zkochan commented Feb 2, 2023

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 }),
Copy link
Member

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.

Copy link
Member Author

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.

@sergio-ferreira-jscrambler

Hello
Is there any way I can help with this PR? This is something very important for my team :)

@zkochan zkochan changed the base branch from main to v8 February 12, 2023 23:40
@zkochan zkochan force-pushed the feat-deploy-with-local-dependencies branch from 371bcc5 to e176e00 Compare February 12, 2023 23:51
@zkochan
Copy link
Member

zkochan commented Feb 13, 2023

This is a breaking change, so it will be shipped in v8. I have named the setting deploy-all-files but I am open to alternative names.

@zkochan zkochan requested a review from a team February 17, 2023 02:39
@zkochan zkochan added this to the v8.0 milestone Feb 19, 2023
@zkochan zkochan merged commit 7a0ce1d into pnpm:v8 Feb 19, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pnpm deploy copies workspace dependencies ignored files Deploy ignores files list of local dependencies
3 participants