Skip to content

Commit

Permalink
fix(cli): remove unnecessary install command in monorepo and provide …
Browse files Browse the repository at this point in the history
…docs (#230)

* fix(cli): remove unnecessary install command in monorepo and provide docs

* remove imports
  • Loading branch information
eunjae-lee authored Jul 18, 2023
1 parent 87a22e4 commit dba06d2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions packages/cli/src/commands/create/monorepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ import { MONOREPO_TEMPLATE_PATH } from '../../../config'
import {
betterPrompts,
filterPathsToInclude,
getInstallCommand,
initializeNewRepo,
runCommand,
} from '../../utils'
import { add } from '../add'
import walk from 'walkdir'
Expand Down Expand Up @@ -72,6 +70,12 @@ const specifyPackageManager = ({
}
}

const MONOREPO_DOCS: Record<PackageManager, string> = {
npm: 'https://docs.npmjs.com/cli/v7/using-npm/workspaces',
yarn: 'https://yarnpkg.com/features/workspaces',
pnpm: 'https://pnpm.io/workspaces',
}

export const createMonorepo: CreateMonorepoFunc = async ({
dir,
packageManager,
Expand Down Expand Up @@ -118,10 +122,6 @@ export const createMonorepo: CreateMonorepoFunc = async ({
)
}

const installCommand = getInstallCommand(packageManager)
console.log(bold(cyan(`[info] Running \`${installCommand}\`...`)))
await runCommand(installCommand, { cwd: repoDir })

console.log(bold(cyan('[info] Creating the first field-plugin...')))
await add({
dir: `${repoDir}/packages`,
Expand All @@ -132,4 +132,7 @@ export const createMonorepo: CreateMonorepoFunc = async ({
})
unlinkSync(`${repoDir}/packages/.gitkeep`)
await initializeNewRepo({ dir: repoDir })

console.log('\n\n- To learn more about monorepo:')
console.log(` > ${MONOREPO_DOCS[packageManager]}`)
}

1 comment on commit dba06d2

@vercel
Copy link

@vercel vercel bot commented on dba06d2 Jul 18, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.