Skip to content

Commit 0f834b1

Browse files
fix: use pnpm for plugin
1 parent 3e2d036 commit 0f834b1

File tree

8 files changed

+5402
-13365
lines changed

8 files changed

+5402
-13365
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,22 @@ jobs:
1313
- uses: actions/setup-node@v4
1414
with:
1515
node-version: 22
16-
- name: restore dependencies
17-
uses: bahmutov/npm-install@v1
18-
- name: restore dependencies
19-
uses: bahmutov/npm-install@v1
20-
with:
21-
working-directory: e2e
16+
cache: 'pnpm'
17+
- name: install plugin
18+
run: pnpm install
19+
- name: install e2e
20+
run: pnpm install
21+
working-directory: e2e
22+
- name: lint plugin and e2e
23+
run: pnpm run lint:all
24+
# lint the e2e repos
2225
# e2e repos need the plugin to be built
23-
- run: npm run build
24-
- name: restore dependencies
25-
uses: bahmutov/npm-install@v1
26-
with:
27-
working-directory: e2e/test_repos/repos/tailwindv3/repo
28-
- run: npm run lint:all
29-
- run: npm run lint
26+
- run: pnpm run build
27+
- name: install tailwindv3
28+
run: pnpm install
29+
working-directory: e2e/test_repos/repos/tailwindv3/repo
30+
- name: lint tailwindv3
31+
run: pnpm run lint
3032
working-directory: e2e/test_repos/repos/tailwindv3/repo
3133
type_check:
3234
name: type check
@@ -37,16 +39,19 @@ jobs:
3739
- uses: actions/setup-node@v4
3840
with:
3941
node-version: 22
40-
- name: restore dependencies
41-
uses: bahmutov/npm-install@v1
42+
cache: 'pnpm'
43+
- name: install plugin
44+
run: pnpm install
45+
- name: type-check plugin
46+
run: pnpm run type-check
47+
# type check the e2e repos
4248
# e2e repos need the plugin to be built
43-
- run: npm run build
44-
- name: restore dependencies
45-
uses: bahmutov/npm-install@v1
46-
with:
47-
working-directory: e2e/test_repos/repos/tailwindv3/repo
48-
- run: npm run type-check
49-
- run: npm run type-check
49+
- run: pnpm run build
50+
- name: install tailwindv3
51+
run: pnpm install
52+
working-directory: e2e/test_repos/repos/tailwindv3/repo
53+
- name: type-check tailwindv3
54+
run: pnpm run type-check
5055
working-directory: e2e/test_repos/repos/tailwindv3/repo
5156
test:
5257
runs-on: ubuntu-latest
@@ -56,9 +61,9 @@ jobs:
5661
- uses: actions/setup-node@v4
5762
with:
5863
node-version: 22
59-
- name: restore dependencies
60-
uses: bahmutov/npm-install@v1
61-
- run: npm run test
64+
cache: 'pnpm'
65+
- run: pnpm install
66+
- run: pnpm run test
6267
- name: report coverage
6368
if: always()
6469
uses: davelosert/vitest-coverage-report-action@v2
@@ -70,14 +75,12 @@ jobs:
7075
- uses: actions/setup-node@v4
7176
with:
7277
node-version: 22
73-
- name: restore dependencies
74-
uses: bahmutov/npm-install@v1
75-
- run: npm run build
76-
- name: restore e2e dependencies
77-
uses: bahmutov/npm-install@v1
78-
with:
79-
working-directory: e2e
80-
- run: npm run e2e
78+
cache: 'pnpm'
79+
- run: pnpm install
80+
- run: pnpm run build
81+
- run: pnpm install
82+
working-directory: e2e
83+
- run: pnpm run e2e
8184
working-directory: e2e
8285
- name: upload playwright report
8386
uses: actions/upload-artifact@v4

.github/workflows/release.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ jobs:
1414
with:
1515
node-version: 22
1616
registry-url: https://registry.npmjs.org/
17-
- name: restore dependencies
18-
uses: bahmutov/npm-install@v1
19-
- name: release
20-
run: npm run release
17+
cache: 'pnpm'
18+
- run: pnpm install
19+
- run: pnpm run release
2120
env:
2221
HUSKY: 0 # semantic-release does a push which would trigger the pre-push git hook
2322
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.husky/pre-push

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npm run test:all
1+
pnpm run test:all

.lintstagedrc.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"*.@(ts|tsx|js|jsx)": ["npm run lint:js", "npm run format"],
3-
"*.json": ["npm run format"],
4-
"*.*rc": ["npm run format -- --parser json"],
5-
"*.@(css|scss)": ["npm run lint:styles", "npm run format"]
2+
"*.@(ts|tsx|js|jsx)": ["pnpm run lint:js", "pnpm run format"],
3+
"*.json": ["pnpm run format"],
4+
"*.*rc": ["pnpm run format -- --parser json"],
5+
"*.@(css|scss)": ["pnpm run lint:styles", "pnpm run format"]
66
}

CONTRIBUTING.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ If you are here to suggest a feature, feel free to [start a discussion](https://
1919
The fastest way to work on the repository is by using [Stackblitz's Codeflow](https://stackblitz.com/codeflow)
2020

2121
1. Click the `Open in Codeflow` button on this repo's README (or go directly to [this link](https:///pr.new/RyanClementsHax/tailwindcss-themer))
22-
2. Run the build using `npm run watch`
22+
2. Run the build using `pnpm run watch`
2323
3. Implement your changes and tests to files in the `src/` directory and corresponding test files
2424
4. Use the example repos to integration test changes
2525
5. Document your changes in the appropriate doc page
@@ -31,35 +31,36 @@ The fastest way to work on the repository is by using [Stackblitz's Codeflow](ht
3131
If you prefer to not use Stackblitz for faster development, you can still do this the old fashioned way.
3232

3333
1. Fork this repository
34-
2. Install dependencies by running `npm install`
35-
3. Run the build using `npm run watch`
36-
4. Implement your changes and tests to files in the `src/` directory and corresponding test files
37-
5. Use the example repos to integration test changes
38-
6. Document your changes in the appropriate doc page
39-
7. Git stage your required changes and commit (see below commit guidelines)
40-
8. Submit PR for review
34+
2. [Install pnpm](https://pnpm.io/installation)
35+
3. Install dependencies by running `pnpm install`
36+
4. Run the build using `pnpm run watch`
37+
5. Implement your changes and tests to files in the `src/` directory and corresponding test files
38+
6. Use the example repos to integration test changes
39+
7. Document your changes in the appropriate doc page
40+
8. Git stage your required changes and commit (see below commit guidelines)
41+
9. Submit PR for review
4142

4243
### Running examples
4344

4445
All examples are located in the `examples` directory of this repo.
4546

46-
1. Run `npm run watch` in the root of `tailwindcss-themer` to build the plugin and watch for any changes
47+
1. Run `pnpm run watch` in the root of `tailwindcss-themer` to build the plugin and watch for any changes
4748
2. Replace the `"tailwindcss-themer": "latest"` line in the example project's `package.json` with `"tailwindcss-themer": "file:../../"`
48-
3. Run`npm install` in the repo's root directory
49-
4. Run `npm run start` in the selected example's directory
50-
5. After making a change to the plugin, restart the example's server (i.e. rerun `npm run start`) so that it picks up the changes
49+
3. Run`pnpm install` in the repo's root directory
50+
4. Run `pnpm run start` in the selected example's directory
51+
5. After making a change to the plugin, restart the example's server (i.e. rerun `pnpm run start`) so that it picks up the changes
5152

5253
### Running e2e tests
5354

5455
For e2e testing we use [Playwright](https://playwright.dev/).
5556

56-
1. Run `npm install` to install dependencies
57-
2. Run `npm run build` to build the plugin
57+
1. Run `pnpm install` to install dependencies
58+
2. Run `pnpm run build` to build the plugin
5859
3. Change directories to the `e2e` directory
59-
4. Run `npm install` to install the playwright dependencies and browsers
60+
4. Run `pnpm install` to install the playwright dependencies and browsers
6061
- This step should handle setting up playwright but if this isn't working, their [documentation](https://playwright.dev/python/docs/intro) for more help on setting up your environment
6162
- If you use WSL, you might find [this comment](https://github.com/microsoft/playwright/issues/13533#issuecomment-1098391029) to be helpful
62-
5. Run `npm run e2e` to run the playwright tests
63+
5. Run `pnpm run e2e` to run the playwright tests
6364

6465
## Commit message conventions
6566

0 commit comments

Comments
 (0)