Skip to content

Commit 934a59c

Browse files
priscilawebdevcmanallen
authored andcommitted
ref(onboarding): Add pnpm to express js install step (#79093)
1 parent e1bc9fe commit 934a59c

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

static/app/gettingStartedDocs/node/express.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@ app.listen(3000);
5454

5555
const onboarding: OnboardingConfig = {
5656
introduction: () =>
57-
tct('In this quick guide you’ll use [strong:npm] or [strong:yarn] to set up:', {
58-
strong: <strong />,
59-
}),
57+
tct(
58+
'In this quick guide you’ll use [strong:npm], [strong:yarn] or [strong:pnpm] to set up:',
59+
{
60+
strong: <strong />,
61+
}
62+
),
6063
install: (params: Params) => [
6164
{
6265
type: StepType.INSTALL,

static/app/utils/gettingStartedDocs/node.ts

+21-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function getInstallSnippet({
2929
additionalPackages = [],
3030
basePackage = '@sentry/node',
3131
}: {
32-
packageManager: 'npm' | 'yarn';
32+
packageManager: 'npm' | 'yarn' | 'pnpm';
3333
params: DocsParams;
3434
additionalPackages?: string[];
3535
basePackage?: string;
@@ -40,9 +40,15 @@ export function getInstallSnippet({
4040
}
4141
packages = packages.concat(additionalPackages);
4242

43-
return packageManager === 'yarn'
44-
? `yarn add ${packages.join(' ')}`
45-
: `npm install --save ${packages.join(' ')}`;
43+
if (packageManager === 'yarn') {
44+
return `yarn add ${packages.join(' ')}`;
45+
}
46+
47+
if (packageManager === 'pnpm') {
48+
return `pnpm add ${packages.join(' ')}`;
49+
}
50+
51+
return `npm install ${packages.join(' ')} --save`;
4652
}
4753

4854
export function getInstallConfig(
@@ -80,6 +86,17 @@ export function getInstallConfig(
8086
basePackage,
8187
}),
8288
},
89+
{
90+
label: 'pnpm',
91+
value: 'pnpm',
92+
language: 'bash',
93+
code: getInstallSnippet({
94+
params,
95+
additionalPackages,
96+
packageManager: 'pnpm',
97+
basePackage,
98+
}),
99+
},
83100
],
84101
},
85102
];

0 commit comments

Comments
 (0)