Repository navigation
feat: support pnpm with create-next-app
#34947
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
84a072a
feat: support `pnpm` with `create-next-app`
balazsorban44 c0fd7a8
test: add `--use-pnpm` tests
balazsorban44 dafdfce
docs: mention `--use-pnpm` flag in docs
balazsorban44 64f9df1
test: remove `only`
balazsorban44 219620e
Update test/integration/create-next-app/index.test.ts
balazsorban44 96853c5
chore: add pnpm action setup to tests
balazsorban44 289ece8
chore: use latest pnpm
balazsorban44 d40bb65
chore: debug
balazsorban44 a72a32c
chore: debug
balazsorban44 342bb61
fix: fall back to `yarn` instead of `npm`
balazsorban44 4a53801
test: run all tests
balazsorban44 906494b
Merge branch 'canary' into feat/create-next-app-pnpm
balazsorban44 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
feat: support
pnpm with create-next-app
- Loading branch information
commit 84a072a434549dced0174e636c852bb0e723fe37
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { execSync } from 'child_process' | ||
|
|
||
| export type PackageManager = 'npm' | 'pnpm' | 'yarn' | ||
|
|
||
| export function getPkgManager(): PackageManager { | ||
| try { | ||
| const userAgent = process.env.npm_config_user_agent | ||
| if (userAgent) { | ||
| if (userAgent.startsWith('yarn')) { | ||
| return 'yarn' | ||
| } else if (userAgent.startsWith('pnpm')) { | ||
| return 'pnpm' | ||
| } | ||
| } | ||
| try { | ||
| execSync('yarn --version', { stdio: 'ignore' }) | ||
| return 'yarn' | ||
| } catch { | ||
| execSync('pnpm --version', { stdio: 'ignore' }) | ||
| return 'pnpm' | ||
| } | ||
| } catch { | ||
| return 'npm' | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.