File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' create-expo-stack ' : patch
3+ ---
4+
5+ add npmrc file for pnpm projects that use NativeWind and Expo Router
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export function configureProjectFiles(
3232
3333 const packageManager = getPackageManager ( toolbox , cliResults ) ;
3434 // Add npmrc file if user is using pnpm and expo router
35- if ( packageManager === 'pnpm' && navigationPackage ?. name === 'expo-router' ) {
35+ if ( packageManager === 'pnpm' ) {
3636 baseFiles . push ( 'base/.npmrc.ejs' ) ;
3737 }
3838
Original file line number Diff line number Diff line change @@ -4,18 +4,23 @@ import { CliResults } from '../types';
44export type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun' ;
55export type PackageManagerRunnerX = 'npx' | 'pnpx' | 'yarn dlx' | 'bunx' ;
66
7+ // TODO: Rework this function as it is pretty messy
78export function getPackageManager ( toolbox : Toolbox , cliResults : CliResults ) : PackageManager {
89 const {
910 parameters : { options }
1011 } = toolbox ;
11-
1212 if ( options . npm ) return 'npm' ;
1313 if ( options . yarn ) return 'yarn' ;
1414 if ( options . pnpm ) return 'pnpm' ;
1515 if ( options . bun ) return 'bun' ;
1616
17+ if ( cliResults . flags . packageManager !== 'npm' ) {
18+ return cliResults . flags . packageManager ;
19+ }
20+
1721 // This environment variable is set by npm and yarn but pnpm seems less consistent
1822 const userAgent = process . env . npm_config_user_agent ;
23+
1924 if ( userAgent ) {
2025 if ( userAgent . startsWith ( 'yarn' ) ) {
2126 return 'yarn' ;
You can’t perform that action at this time.
0 commit comments