File tree 3 files changed +12
-2
lines changed
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(
32
32
33
33
const packageManager = getPackageManager ( toolbox , cliResults ) ;
34
34
// Add npmrc file if user is using pnpm and expo router
35
- if ( packageManager === 'pnpm' && navigationPackage ?. name === 'expo-router' ) {
35
+ if ( packageManager === 'pnpm' ) {
36
36
baseFiles . push ( 'base/.npmrc.ejs' ) ;
37
37
}
38
38
Original file line number Diff line number Diff line change @@ -4,18 +4,23 @@ import { CliResults } from '../types';
4
4
export type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun' ;
5
5
export type PackageManagerRunnerX = 'npx' | 'pnpx' | 'yarn dlx' | 'bunx' ;
6
6
7
+ // TODO: Rework this function as it is pretty messy
7
8
export function getPackageManager ( toolbox : Toolbox , cliResults : CliResults ) : PackageManager {
8
9
const {
9
10
parameters : { options }
10
11
} = toolbox ;
11
-
12
12
if ( options . npm ) return 'npm' ;
13
13
if ( options . yarn ) return 'yarn' ;
14
14
if ( options . pnpm ) return 'pnpm' ;
15
15
if ( options . bun ) return 'bun' ;
16
16
17
+ if ( cliResults . flags . packageManager !== 'npm' ) {
18
+ return cliResults . flags . packageManager ;
19
+ }
20
+
17
21
// This environment variable is set by npm and yarn but pnpm seems less consistent
18
22
const userAgent = process . env . npm_config_user_agent ;
23
+
19
24
if ( userAgent ) {
20
25
if ( userAgent . startsWith ( 'yarn' ) ) {
21
26
return 'yarn' ;
You can’t perform that action at this time.
0 commit comments