Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: enable yarn and pnpm Corepack binaries by default #51886

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions tools/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,10 @@ def npm_files(options, action):
def corepack_files(options, action):
package_files(options, action, 'corepack', {
'corepack': 'dist/corepack.js',
# Not the default just yet:
# 'yarn': 'dist/yarn.js',
# 'yarnpkg': 'dist/yarn.js',
# 'pnpm': 'dist/pnpm.js',
# 'pnpx': 'dist/pnpx.js',
'yarn': 'dist/yarn.js',
'yarnpkg': 'dist/yarn.js',
'pnpm': 'dist/pnpm.js',
'pnpx': 'dist/pnpx.js',
})

# On z/OS, we install node-gyp for convenience, as some vendors don't have
Expand Down
8 changes: 6 additions & 2 deletions tools/msvs/msi/nodemsi/i18n/en-us.wxl
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@
<String Id="NodeRuntime_Description" Value="Install the core [ProductName] runtime (node.exe)."/>

<String Id="npm_Title" Value="npm package manager"/>
<String Id="npm_Description" Value="Install npm, the recommended package manager for [ProductName]."/>
<String Id="npm_Description" Value="Install npm, a package manager for [ProductName]."/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change does not relate to enabling Corepack by default (ie. we can recommend npm even though Corepack is being distributed). I'd suggest making a separate PR so we can discuss this change independently.

Suggested change
<String Id="npm_Description" Value="Install npm, a package manager for [ProductName]."/>
<String Id="npm_Description" Value="Install npm, the recommended package manager for [ProductName]."/>


<String Id="corepack_Title" Value="corepack manager"/>
<String Id="corepack_Title" Value="Corepack manager"/>
<String Id="corepack_Description" Value="Install corepack, the universal package manager for [ProductName]."/>
<String Id="corepack_pnpm_Title" Value="pnpm package manager"/>
<String Id="corepack_pnpm_Description" Value="Install pnpm, a package manager for [ProductName], distributed by Corepack."/>
<String Id="corepack_yarn_Title" Value="Yarn package manager"/>
<String Id="corepack_yarn_Description" Value="Install Yarn, a package manager for [ProductName], distributed by Corepack."/>

<String Id="DocumentationShortcuts_Title" Value="Online documentation shortcuts"/>
<String Id="DocumentationShortcuts_Description" Value="Add start menu entries that link the online documentation for [ProductName] [FullVersion] and the [ProductName] website."/>
Expand Down
32 changes: 32 additions & 0 deletions tools/msvs/msi/nodemsi/product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,22 @@
<ComponentGroupRef Id="CorepackSourceFiles"/>
</Feature>

<Feature Id="corepack_pnpm"
Level="1"
Title="!(loc.corepack_pnpm_Title)"
Description="!(loc.corepack_pnpm_Description)">
<ComponentRef Id="CorepackpnpmCmdScript"/>
<ComponentRef Id="CorepackpnpmBashScript"/>
</Feature>

<Feature Id="corepack_yarn"
Level="1"
Title="!(loc.corepack_yarn_Title)"
Description="!(loc.corepack_yarn_Description)">
<ComponentRef Id="CorepackYarnCmdScript"/>
<ComponentRef Id="CorepackYarnBashScript"/>
</Feature>

<Feature Id="npm"
Level="1"
Title="!(loc.npm_Title)"
Expand Down Expand Up @@ -216,6 +232,22 @@
<File Id="corepack.sh" KeyPath="yes" Source="$(var.CorepackSourceDir)\shims\nodewin\corepack"/>
</Component>

<Component Id="CorepackPnpmCmdScript">
<File Id="corepack.cmd" KeyPath="yes" Source="$(var.CorepackSourceDir)\shims\nodewin\pnpm.cmd"/>
</Component>

<Component Id="CorepackPnpmBashScript">
<File Id="corepack.sh" KeyPath="yes" Source="$(var.CorepackSourceDir)\shims\nodewin\pnpm"/>
</Component>

<Component Id="CorepackYarnCmdScript">
<File Id="corepack.cmd" KeyPath="yes" Source="$(var.CorepackSourceDir)\shims\nodewin\yarn.cmd"/>
</Component>

<Component Id="CorepackYarnBashScript">
<File Id="corepack.sh" KeyPath="yes" Source="$(var.CorepackSourceDir)\shims\nodewin\yarn"/>
</Component>

<Component Id="NpmCmdScript">
<File Id="npm.cmd" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npm.cmd"/>
</Component>
Expand Down