Skip to content

Commit be24af3

Browse files
committed
migrate to pnpm
1 parent 2ca0409 commit be24af3

26 files changed

+5699
-9260
lines changed

.github/CONTRIBUTING.md

+14-25
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,34 @@ Thanks for your interest in contributing to Inertia.js!
44

55
## Packages
66

7-
To make local Inertia.js development easier, this project has been setup as a monorepo using [NPM Workspaces](https://docs.npmjs.com/using-npm/workspaces). To set it up, start by cloning the repository on your system.
7+
To make local Inertia.js development easier, this project has been setup as a monorepo using [pnpm](https://pnpm.io/workspaces). To set it up, start by cloning the repository on your system.
88

99
```sh
1010
git clone https://github.com/inertiajs/inertia.git inertia
1111
cd inertia
1212
```
1313

14-
Next, install the JavaScript dependencies:
14+
Next, install the JavaScript dependencies and build the packages:
1515

1616
```sh
17-
npm install
17+
pnpm install && pnpm build
1818
```
1919

20-
Next, build the packages:
20+
If you're making changes to one of the packages, you can setup a watcher to automatically run the build step whenever files are changed.
2121

2222
```sh
23-
npm run build --workspace=packages --if-present
23+
pnpm watch
2424
```
2525

26-
If you're making changes to one of the packages that requires a build step (`core`, `react`, `vue2`, `vue3`), you can setup a watcher to automatically run the build step whenever files are changed.
27-
28-
```sh
29-
cd packages/core
30-
npm run dev
31-
```
32-
33-
When proposing changes to one of the adapters (`react`, `vue2`, `vue3`, `svelte`), please try to apply the same changes to the other adapters where possible.
26+
When proposing changes to one of the adapters, please try to apply the same changes to the other adapters where possible.
3427

3528
## Playgrounds
3629

3730
It's often helpful to develop Inertia.js using a real application. The playground folder contains an example Laravel project for each of the adapters. Here's how to get a playground running:
3831

3932
```sh
4033
cd playgrounds/react
41-
npm run build
34+
pnpm build
4235
composer install
4336
cp .env.example .env
4437
php artisan key:generate
@@ -49,30 +42,26 @@ php artisan serve
4942
To automatically see changes to the JavaScript files in the browser, start the development server:
5043

5144
```sh
52-
npm run dev
45+
pnpm dev
5346
```
5447

5548
To test the SSR mode, first run the build, and then start the SSR server:
5649

5750
```sh
58-
npm run build
51+
pnpm build
5952
php artisan inertia:start-ssr
6053
```
6154

6255
## Testing
6356

64-
Inertia.js uses [Playwright](https://playwright.dev/) for testing. To run the tests, use the following command:
65-
66-
```sh
67-
cd tests && npx playwright test
68-
```
57+
Inertia.js uses [Playwright](https://playwright.dev/) for testing. To run the tests, use the `pnpm test` command.
6958

7059
## Publishing
7160

7261
This section is really for the benefit of the core maintainers.
7362

74-
1. Increment the version numbers in the `package.json` file for each package, making sure to also update the adapter dependencies on `@inertiajs/core`.
75-
2. Run `npm install` to update the top-level `package-lock.json` file.
76-
3. Update `CHANGELOG.md`.
77-
4. Run `npm publish` for each package. This will automatically run the necessary build step. When publishing beta releases, make sure to run `npm publish --tag=beta` or `npm publish --tag=next` if it's `next`.
63+
1. Increment the version numbers in the `package.json` file for each package,
64+
2. Run `pnpm install`,
65+
3. Update `CHANGELOG.md`,
66+
4. Run `pnpm publish -r` in the root directory. This will automatically run the necessary build steps and publish all packages. When publishing beta releases, make sure to run `pnpm publish -r --tag=beta` or `npm publish -r --tag=next` if it's `next`,
7867
5. Add release notes to [GitHub](https://github.com/inertiajs/inertia/releases).

.github/workflows/build.yml

+9-16
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,23 @@ jobs:
66
timeout-minutes: 15
77
runs-on: ubuntu-20.04
88

9-
strategy:
10-
matrix:
11-
adapter: ['react', 'vue3', 'svelte']
12-
139
steps:
1410
- name: Checkout
1511
uses: actions/checkout@v4
1612

13+
- name: Install pnpm
14+
uses: pnpm/action-setup@v3
15+
with:
16+
version: 10
17+
1718
- name: Setup Node.js
1819
uses: actions/setup-node@v4
1920
with:
2021
node-version: 20.15
22+
cache: pnpm
2123

22-
- name: Cache node modules
23-
uses: actions/cache@v4
24-
with:
25-
key: ${{ runner.OS }}-npm-cache-${{ hashFiles('package-lock.json') }}
26-
path: |
27-
~/.cache
28-
node_modules
29-
packages/${{ matrix.adapter }}/tests/node_modules
24+
- name: Install dependencies
25+
run: pnpm install
3026

3127
- name: Build Inertia
32-
run: |
33-
npm install
34-
cd packages/core && npm run build
35-
cd ../${{ matrix.adapter }} && npm run build
28+
run: pnpm build

.github/workflows/playwright.yml

+20-40
Original file line numberDiff line numberDiff line change
@@ -7,50 +7,30 @@ jobs:
77
runs-on: ubuntu-20.04
88
strategy:
99
matrix:
10-
adapter: ['vue3', 'react', 'svelte']
11-
env:
12-
PACKAGE: ${{ matrix.adapter }}
10+
adapter: ['vue', 'react', 'svelte']
1311
steps:
14-
- uses: actions/checkout@v4
12+
- name: Checkout
13+
uses: actions/checkout@v4
1514

16-
- uses: actions/setup-node@v4
17-
with:
18-
node-version: 21.7.3
15+
- name: Install pnpm
16+
uses: pnpm/action-setup@v3
17+
with:
18+
version: 10
1919

20-
- name: Build Inertia
21-
run: |
22-
npm install
23-
cd packages/core
24-
npm run build
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 21.7.3
24+
cache: pnpm
2525

26-
- name: Build Adapter
27-
run: |
28-
cd packages/${{ matrix.adapter }}
29-
npm run build
26+
- name: Install dependencies
27+
run: pnpm install
3028

31-
- name: Install Test Dependencies
32-
run: |
33-
cd packages/${{ matrix.adapter }}/test-app
34-
npm install
29+
- name: Build Inertia
30+
run: pnpm -r --filter ./packages/core --filter ./packages/${{ matrix.adapter }}* build
3531

36-
- name: Local-link @inertiajs/core
37-
run: cd packages/core && npm link
32+
- name: Install Playwright Browsers
33+
run: pnpm playwright install chromium
3834

39-
- name: Local-link @inertiajs/${{ matrix.adapter }}
40-
run: cd packages/${{ matrix.adapter }} && npm link
41-
42-
- name: Install Playwright Browsers
43-
run: cd packages/${{ matrix.adapter }} && npx playwright install --with-deps
44-
45-
- name: Install Playwright Test Dependencies
46-
run: cd tests/app && npm install
47-
48-
- name: Run Playwright Tests
49-
run: cd tests && npx playwright test
50-
51-
- uses: actions/upload-artifact@v4
52-
if: ${{ !cancelled() }}
53-
with:
54-
name: playwright-report
55-
path: packages/${{ matrix.adapter }}/playwright-report/
56-
retention-days: 30
35+
- name: Run Playwright Tests
36+
run: pnpm test:${{ matrix.adapter }}

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.github/
2+
pnpm-lock.yaml
23
**/.svelte-kit
34
**/bootstrap/ssr
45
**/composer.json

0 commit comments

Comments
 (0)