create-payload-app
Advanced tools
Comparing version 3.0.0-beta.99 to 3.0.0-beta.100
@@ -29,2 +29,4 @@ import * as p from '@clack/prompts'; | ||
installCmd = 'pnpm install'; | ||
} else if (packageManager === 'bun') { | ||
installCmd = 'bun install'; | ||
} | ||
@@ -31,0 +33,0 @@ try { |
@@ -5,3 +5,3 @@ import type { CliArgs, PackageManager } from '../types.js'; | ||
projectDir: string; | ||
}): Promise<PackageManager>; | ||
}): PackageManager; | ||
//# sourceMappingURL=get-package-manager.d.ts.map |
@@ -1,4 +0,3 @@ | ||
import execa from 'execa'; | ||
import fse from 'fs-extra'; | ||
export async function getPackageManager(args) { | ||
export function getPackageManager(args) { | ||
const { cliArgs, projectDir } = args; | ||
@@ -14,11 +13,7 @@ try { | ||
detected = 'npm'; | ||
} else if (cliArgs?.['--use-bun'] || fse.existsSync(`${projectDir}/bun.lockb`)) { | ||
detected = 'bun'; | ||
} else { | ||
// Otherwise check for existing commands | ||
if (await commandExists('pnpm')) { | ||
detected = 'pnpm'; | ||
} else if (await commandExists('yarn')) { | ||
detected = 'yarn'; | ||
} else { | ||
detected = 'npm'; | ||
} | ||
// Otherwise check the execution environment | ||
detected = getEnvironmentPackageManager(); | ||
} | ||
@@ -30,11 +25,16 @@ return detected; | ||
} | ||
async function commandExists(command) { | ||
try { | ||
await execa.command(`command -v ${command}`); | ||
return true; | ||
} catch { | ||
return false; | ||
function getEnvironmentPackageManager() { | ||
const userAgent = process.env.npm_config_user_agent || ''; | ||
if (userAgent.startsWith('yarn')) { | ||
return 'yarn'; | ||
} | ||
if (userAgent.startsWith('pnpm')) { | ||
return 'pnpm'; | ||
} | ||
if (userAgent.startsWith('bun')) { | ||
return 'bun'; | ||
} | ||
return 'npm'; | ||
} | ||
//# sourceMappingURL=get-package-manager.js.map |
@@ -38,2 +38,3 @@ import * as p from '@clack/prompts'; | ||
'--no-deps': Boolean, | ||
'--use-bun': Boolean, | ||
'--use-npm': Boolean, | ||
@@ -98,3 +99,3 @@ '--use-pnpm': Boolean, | ||
const projectDir = nextConfigPath ? path.dirname(nextConfigPath) : path.resolve(process.cwd(), slugify(projectName)); | ||
const packageManager = await getPackageManager({ | ||
const packageManager = getPackageManager({ | ||
cliArgs: this.args, | ||
@@ -101,0 +102,0 @@ projectDir |
@@ -18,2 +18,3 @@ import type arg from 'arg'; | ||
'--template-branch': StringConstructor; | ||
'--use-bun': BooleanConstructor; | ||
'--use-npm': BooleanConstructor; | ||
@@ -20,0 +21,0 @@ '--use-pnpm': BooleanConstructor; |
@@ -35,2 +35,3 @@ /* eslint-disable no-console */ import chalk from 'chalk'; | ||
--use-pnpm Use pnpm to install dependencies | ||
--use-bun Use bun to install dependencies (experimental) | ||
--no-deps Do not install any dependencies | ||
@@ -37,0 +38,0 @@ -h Show help |
{ | ||
"name": "create-payload-app", | ||
"version": "3.0.0-beta.99", | ||
"version": "3.0.0-beta.100", | ||
"homepage": "https://payloadcms.com", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
232607
2344
16