Skip to content

Commit 373baf6

Browse files
authored
Merge pull request #156 from akd-io/feature/136-support-pnpm
Add missing --use-pnpm flag to create-next-app cli when using pnpm
2 parents e7f71b3 + 596ac59 commit 373baf6

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

src/main/plugins/next.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,16 @@ export const nextPlugin = createPlugin({
8080
"--no-src-dir",
8181
"--import-alias=@/*",
8282
]
83-
if (flags["package-manager"] === "npm") {
84-
createNextAppArgs.push("--use-npm")
83+
switch (flags["package-manager"]) {
84+
case "pnpm":
85+
createNextAppArgs.push("--use-pnpm")
86+
break
87+
case "yarn":
88+
// default is yarn. And there's no flag for it.
89+
break
90+
case "npm":
91+
createNextAppArgs.push("--use-npm")
92+
break
8593
}
8694

8795
await runCommand("npx", [

src/main/setup/setup.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,17 @@ export const performSetupSteps = async (
6161
inputs: ValidCNSInputs
6262
): Promise<void> => {
6363
const steps = [
64-
// Create Next App
65-
nextPlugin.steps.createNextApp,
66-
67-
// Package management
64+
// Update package manager
6865
pnpmPlugin.steps.updatePnpm,
6966
yarnPlugin.steps.updateYarn,
70-
createNextStackPlugin.steps.installDependencies,
7167

72-
// Remove official CNA content
68+
// Create Next App
69+
nextPlugin.steps.createNextApp,
7370
nextPlugin.steps.removeOfficialCNAContent,
7471

72+
// Install dependencies
73+
createNextStackPlugin.steps.installDependencies,
74+
7575
// Configuration
7676
createNextStackPlugin.steps.addScripts,
7777
createNextStackPlugin.steps.addGitAttributes,

0 commit comments

Comments
 (0)