Skip to content

Commit 663810b

Browse files
committed
[cli] add npmrc file for pnpm projects that use NativeWind and Expo Router
1 parent 8a390cc commit 663810b

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'create-expo-stack': patch
3+
---
4+
5+
add npmrc file for pnpm projects that use NativeWind and Expo Router

cli/src/utilities/configureProjectFiles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

cli/src/utilities/getPackageManager.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,18 @@ export function getPackageManager(toolbox: Toolbox, cliResults: CliResults): Pac
88
const {
99
parameters: { options }
1010
} = toolbox;
11-
11+
console.log('options.npm', options.npm);
1212
if (options.npm) return 'npm';
13+
console.log('options.yarn', options.yarn);
1314
if (options.yarn) return 'yarn';
15+
console.log('options.pnpm', options.pnpm);
1416
if (options.pnpm) return 'pnpm';
17+
console.log('options.bun', options.bun);
1518
if (options.bun) return 'bun';
1619

1720
// This environment variable is set by npm and yarn but pnpm seems less consistent
1821
const userAgent = process.env.npm_config_user_agent;
22+
console.log('userAgent', userAgent);
1923
if (userAgent) {
2024
if (userAgent.startsWith('yarn')) {
2125
return 'yarn';
@@ -27,6 +31,7 @@ export function getPackageManager(toolbox: Toolbox, cliResults: CliResults): Pac
2731
return 'npm';
2832
}
2933
} else {
34+
console.log('cliResults.flags.packageManager', cliResults.flags.packageManager);
3035
// If no user agent is set, assume npm
3136
return cliResults.flags.packageManager;
3237
}

0 commit comments

Comments
 (0)