mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-21 04:57:05 +02:00
feat(create): new --package-manager option; interactive package manager selection (#6750)
This commit is contained in:
parent
89560226f0
commit
a70514205d
4 changed files with 76 additions and 32 deletions
|
@ -36,14 +36,17 @@ program.version(packageJson.version);
|
|||
|
||||
program
|
||||
.arguments('[siteName] [template] [rootDir]')
|
||||
.option('--use-npm', 'Use NPM as package manage even with Yarn installed')
|
||||
.option(
|
||||
'--skip-install',
|
||||
'-p, --package-manager <manager>',
|
||||
'The package manager used to install dependencies. One of yarn, npm, and pnpm.',
|
||||
)
|
||||
.option(
|
||||
'-s, --skip-install',
|
||||
'Do not run package manager immediately after scaffolding',
|
||||
)
|
||||
.option('--typescript', 'Use the TypeScript template variant')
|
||||
.option('-t, --typescript', 'Use the TypeScript template variant')
|
||||
.option(
|
||||
'--git-strategy <strategy>',
|
||||
'-g, --git-strategy <strategy>',
|
||||
`Only used if the template is a git repository.
|
||||
\`deep\`: preserve full history
|
||||
\`shallow\`: clone with --depth=1
|
||||
|
@ -56,10 +59,10 @@ program
|
|||
siteName,
|
||||
template,
|
||||
rootDir = '.',
|
||||
{useNpm, skipInstall, typescript, gitStrategy} = {},
|
||||
{packageManager, skipInstall, typescript, gitStrategy} = {},
|
||||
) => {
|
||||
wrapCommand(init)(path.resolve(rootDir), siteName, template, {
|
||||
useNpm,
|
||||
packageManager,
|
||||
skipInstall,
|
||||
typescript,
|
||||
gitStrategy,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue