Skip to content

Commit dbce095

Browse files
authored
Merge pull request #520 from gadget-inc/pnpm
pnpm
2 parents 06c761f + 61ef7b0 commit dbce095

33 files changed

+7216
-7786
lines changed

.envrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
use flake
2+
3+
source_env_if_exists .envrc.local
Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
1-
name: 'Setup test environment'
2-
description: ''
1+
name: "Setup test environment"
2+
description: ""
33
inputs: {}
44
outputs: {}
55
runs:
6-
using: "composite"
7-
steps:
8-
- name: Use Node.js ${{ matrix.node-version }}
9-
uses: actions/setup-node@v2
6+
using: "composite"
7+
steps:
8+
- uses: pnpm/action-setup@v2
9+
name: Install pnpm
1010
with:
11-
node-version: ${{ matrix.node-version }}
12-
cache: 'yarn'
13-
- run: yarn install --frozen-lockfile
14-
shell: "bash"
11+
version: 8
12+
run_install: false
13+
14+
- name: Get pnpm store directory
15+
shell: bash
16+
run: |
17+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
18+
19+
- uses: actions/cache@v3
20+
name: Setup pnpm cache
21+
with:
22+
path: ${{ env.STORE_PATH }}
23+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
24+
restore-keys: |
25+
${{ runner.os }}-pnpm-store-
26+
27+
- name: Install dependencies
28+
shell: bash
29+
run: pnpm install

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ jobs:
88

99
strategy:
1010
matrix:
11-
node-version: [16.x, 18.x]
11+
node-version: [16.x, 18.x, 20.x]
1212
os: [ubuntu-latest]
1313

1414
steps:
1515
- uses: actions/checkout@v2
1616
- uses: ./.github/actions/setup-test-env
1717
- name: Build JS
18-
run: yarn build
18+
run: pnpm build
1919
- name: Run Tests
20-
run: yarn run test
20+
run: pnpm run test
2121
- name: Run Lint
22-
run: yarn run lint
22+
run: pnpm run lint
2323

2424
automerge:
2525
needs: build

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v2
1818
- uses: ./.github/actions/setup-test-env
1919
- name: Build all packages
20-
run: yarn build
20+
run: pnpm build
2121
- id: npm-publish
2222
name: Publish fastify-renderer
2323
uses: JS-DevTools/npm-publish@v1
@@ -30,4 +30,4 @@ jobs:
3030
if: ${{ steps.npm-publish.outputs.type != 'none' }}
3131
with:
3232
tag_name: ${{ steps.npm-publish.outputs.version }}
33-
generate_release_notes: true
33+
generate_release_notes: true

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jspm_packages/
2929
# Output of 'npm pack'
3030
*.tgz
3131

32-
# Yarn Integrity file
32+
# pnpm Integrity file
3333
.yarn-integrity
3434

3535
# dotenv environment variables file

.swcrc

Lines changed: 0 additions & 18 deletions
This file was deleted.

Contributing.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,47 @@
1-
# Contributing to fastify-renderer
1+
# Contributing to fastify-renderer
22

33
See below for information on how fastify-renderer's community is governed.
4+
5+
## Development
6+
7+
### Running a development server for a test app
8+
9+
To run a local dev server that mounts the monorepo version of `fastify-render` in a test app, run
10+
11+
```shell
12+
pnpm -F=simple-react dev
13+
```
14+
15+
### Running tests
16+
17+
You can run all the tests with:
18+
19+
```shell
20+
pnpm test
21+
```
22+
23+
You can run a specific test file with:
24+
25+
```shell
26+
pnpm test packages/test-apps/simple-react/test/some-test-file.spec.ts
27+
```
28+
29+
You can run a specific test case with:
30+
31+
```shell
32+
pnpm test packages/test-apps/simple-react/test/some-test-file.spec.ts -- -t "the case name"
33+
```
34+
35+
#### Debugging Playwright tests
36+
37+
Playwright supports a handy debug environment variable:
38+
39+
```shell
40+
PWDEBUG=1 pnpm test packages/test-apps/simple-react/test/some-test-file.spec.ts
41+
```
42+
43+
This pops open a headful browser for running tests, and a UI for stepping through each execution element as it happens.
44+
445
## Releases
546

647
Bump the version with `npm version <minor|major|patch>` then commit the change to git. When your changes get pushed/merged to `main` on github, Github Actions will run the `release` workflow and automatically publish the release to NPM.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Features:
2222
npm install fastify-renderer --save
2323
# Using yarn
2424
yarn install fastify-renderer
25+
# Using pnpm
26+
pnpm install fastify-renderer
2527
```
2628

2729
## Registering the plugin

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
description = "fastify-renderer development environment";
3+
4+
inputs = {
5+
flake-utils.url = "github:numtide/flake-utils";
6+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
7+
};
8+
9+
outputs = { self, flake-utils, nixpkgs }:
10+
(flake-utils.lib.eachSystem [
11+
"x86_64-linux"
12+
"x86_64-darwin"
13+
"aarch64-darwin"
14+
]
15+
(system: nixpkgs.lib.fix (flake:
16+
let
17+
pkgs = nixpkgs.legacyPackages.${system};
18+
in
19+
rec {
20+
21+
packages =
22+
rec {
23+
bash = pkgs.bash;
24+
nodejs = pkgs.nodejs-18_x;
25+
pnpm = pkgs.nodePackages.pnpm;
26+
};
27+
28+
devShell = pkgs.mkShell {
29+
packages = builtins.attrValues packages;
30+
};
31+
}
32+
)));
33+
}

0 commit comments

Comments
 (0)