Skip to content

Commit

Permalink
chore(repo): update to pnpm 9 (#27624)
Browse files Browse the repository at this point in the history
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses pnpm v8

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses pnpm v9

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: “JamesHenry” <james@henry.sc>
(cherry picked from commit 088a95b)
  • Loading branch information
FrozenPandaz committed Aug 23, 2024
1 parent 8e2c26a commit e25c754
Show file tree
Hide file tree
Showing 7 changed files with 24,089 additions and 20,824 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ commands:
- run:
name: Install pnpm package manager (linux)
command: |
npm install --prefix=$HOME/.local -g @pnpm/exe@8
npm install --prefix=$HOME/.local -g @pnpm/exe@9.2.0
- when:
condition:
equal: [<< parameters.os >>, macos]
steps:
- run:
name: Install pnpm package manager (macos)
command: |
npm install -g @pnpm/exe@8
npm install -g @pnpm/exe@9.2.0
- run:
name: Install Dependencies
command: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
build: |-
set -e &&
npm i -g pnpm@8.15.7 --force &&
npm i -g pnpm@9.2.0 --force &&
pnpm --version &&
pnpm install --frozen-lockfile &&
pnpm nx run-many --verbose --target=build-native -- --target=x86_64-unknown-linux-gnu
Expand All @@ -147,7 +147,7 @@ jobs:
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: |-
set -e &&
npm i -g pnpm@8.15.7 --force &&
npm i -g pnpm@9.2.0 --force &&
pnpm --version &&
pnpm install --frozen-lockfile &&
pnpm nx run-many --verbose --target=build-native -- --target=x86_64-unknown-linux-musl
Expand All @@ -165,7 +165,7 @@ jobs:
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
build: |-
set -e &&
npm i -g pnpm@8.15.7 --force &&
npm i -g pnpm@9.2.0 --force &&
pnpm --version &&
pnpm install --frozen-lockfile &&
pnpm nx run-many --verbose --target=build-native -- --target=aarch64-unknown-linux-gnu
Expand All @@ -191,7 +191,7 @@ jobs:
build: |-
set -e &&
rustup target add aarch64-unknown-linux-musl &&
npm i -g pnpm@8.15.7 --force &&
npm i -g pnpm@9.2.0 --force &&
pnpm --version &&
pnpm install --frozen-lockfile &&
pnpm nx run-many --verbose --target=build-native -- --target=aarch64-unknown-linux-musl
Expand Down Expand Up @@ -318,7 +318,7 @@ jobs:
env
whoami
sudo pkg install -y -f node libnghttp2 www/npm git
sudo npm install --location=global --ignore-scripts pnpm@8.15.7
sudo npm install --location=global --ignore-scripts pnpm@9.2.0
curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile minimal --default-toolchain stable
source "$HOME/.cargo/env"
Expand Down
2 changes: 1 addition & 1 deletion .nx/workflows/agents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ launch-templates:
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev
- name: Install Pnpm
script: |
npm install -g pnpm@8
npm install -g pnpm@9.2.0
- name: Pnpm Install
script: |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -401,5 +401,5 @@
]
}
},
"packageManager": "pnpm@8.15.7"
"packageManager": "pnpm@9.6.0"
}
54 changes: 28 additions & 26 deletions packages/js/babel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,33 @@ module.exports = function (api: any, options: NxWebBabelPresetOptions = {}) {
);
}

const plugins = [
!isNxPackage
? [
require.resolve('@babel/plugin-transform-runtime'),
{
corejs: false,
helpers: true,
regenerator: true,
useESModules: isModern,
absoluteRuntime: dirname(
require.resolve('@babel/runtime/package.json')
),
},
]
: null,
require.resolve('babel-plugin-macros'),
emitDecoratorMetadata
? require.resolve('babel-plugin-transform-typescript-metadata')
: undefined,
// Must use legacy decorators to remain compatible with TypeScript.
[
require.resolve('@babel/plugin-proposal-decorators'),
options.decorators ?? { legacy: true },
],
[require.resolve('@babel/plugin-transform-class-properties'), { loose }],
].filter(Boolean);

return {
presets: [
// Support module/nomodule pattern.
Expand All @@ -64,32 +91,7 @@ module.exports = function (api: any, options: NxWebBabelPresetOptions = {}) {
},
],
],
plugins: [
!isNxPackage
? [
require.resolve('@babel/plugin-transform-runtime'),
{
corejs: false,
helpers: true,
regenerator: true,
useESModules: isModern,
absoluteRuntime: dirname(
require.resolve('@babel/runtime/package.json')
),
},
]
: null,
require.resolve('babel-plugin-macros'),
emitDecoratorMetadata
? require.resolve('babel-plugin-transform-typescript-metadata')
: undefined,
// Must use legacy decorators to remain compatible with TypeScript.
[
require.resolve('@babel/plugin-proposal-decorators'),
options.decorators ?? { legacy: true },
],
[require.resolve('@babel/plugin-transform-class-properties'), { loose }],
].filter(Boolean),
plugins,
overrides: [
// Convert `const enum` to `enum`. The former cannot be supported by babel
// but at least we can get it to not error out.
Expand Down
13 changes: 12 additions & 1 deletion packages/nx/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,18 @@
"events", // This is coming from @storybook/builder-manager since it uses the browser polyfill
"process", // This is coming from @storybook/builder-manager since it uses the browser polyfill
"prettier", // This is coming from @storybook/builder-manager since it uses the browser polyfill
"util" // This is coming from @storybook/builder-manager since it uses the browser polyfill
"util", // This is coming from @storybook/builder-manager since it uses the browser polyfill
// The native modules are optional and only one of them will ever be installed on a given machine
"@nx/nx-darwin-x64",
"@nx/nx-darwin-arm64",
"@nx/nx-linux-x64-gnu",
"@nx/nx-linux-x64-musl",
"@nx/nx-win32-x64-msvc",
"@nx/nx-linux-arm64-gnu",
"@nx/nx-linux-arm64-musl",
"@nx/nx-linux-arm-gnueabihf",
"@nx/nx-win32-arm64-msvc",
"@nx/nx-freebsd-x64"
]
}
]
Expand Down
Loading

0 comments on commit e25c754

Please sign in to comment.