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

Package manager pnpm #4920

Closed
wants to merge 8 commits into from

Conversation

dishuostec
Copy link
Contributor

↪️ Pull Request

Try to add pnpm suport

#3408

@height
Copy link

height bot commented Jul 22, 2020

Link Height tasks by mentioning a task ID in the pull request title or description, commit messages, or comments.

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@dishuostec dishuostec force-pushed the package-manager-pnpm branch from 79b6e07 to 0d3e2b1 Compare July 24, 2020 06:41
Copy link
Member

@DeMoorJasper DeMoorJasper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add some integration tests? You can take inspiration from how we did it for yarn 2

]);
let hasYarn = await Yarn.exists();

// If Yarn isn't available, or there is a package-lock.json file, use npm.
let configName = configFile && path.basename(configFile);
if (!hasYarn || configName === 'package-lock.json') {
return new Npm();
if (!hasYarn || configName) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the Yarn binary doesn't exist and no lockfile is present, NPM should be used by default. However, if there is no lockfile, this new logic will cause Yarn to be used even when the binary doesn't exist.

Copy link
Contributor Author

@dishuostec dishuostec Jul 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the Yarn binary doesn't exist and no lockfile is present, NPM should be used by default. However, if there is no lockfile, this new logic will cause Yarn to be used even when the binary doesn't exist.

Yes, I made a mistake.

@dishuostec
Copy link
Contributor Author

could you add some integration tests? You can take inspiration from how we did it for yarn 2

I couldn't find which part is the test for yarn2, do you mean @parcel/integration-test?

@DeMoorJasper
Copy link
Member

@dishuostec yes that's the package with all our integration tests.

For inspiration I meant https://github.com/parcel-bundler/parcel/blob/v2/packages/core/integration-tests/test/pnp.js which is part of our test suite

@mischnic
Copy link
Member

(The PnP tests are only testing the resolver, not the autoinstall part)

@dishuostec
Copy link
Contributor Author

Pnpm use symlinked node_modules structure. If a package is dependent on by several package, then the package will be resolved as different position. It will be bundle multiple times.

I created new pr #4939.

@aminya aminya mentioned this pull request Sep 9, 2020
1 task
@aminya
Copy link
Contributor

aminya commented Sep 9, 2020

Really looking forward to this. Having to manage many packages, the time and storage that pnpm saves me is a big advantage. However, the fact that Parcel does not work with pnpm is a bummer!

@dishuostec dishuostec closed this Sep 25, 2020
@dishuostec dishuostec deleted the package-manager-pnpm branch September 25, 2020 07:35
@dishuostec dishuostec restored the package-manager-pnpm branch September 25, 2020 07:38
@aminya aminya mentioned this pull request Sep 25, 2020
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.

5 participants