Skip to content

Commit

Permalink
Convert to pnpm (#1127)
Browse files Browse the repository at this point in the history
* Convert to pnpm

* Add pnpm to build
  • Loading branch information
AaronMoat authored Jun 17, 2024
1 parent e1d8f8d commit 5f5e4df
Show file tree
Hide file tree
Showing 13 changed files with 19,292 additions and 15,230 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Configured by Renovate
fe/package.json
package.json
yarn.lock
pnpm-lock.yaml
11 changes: 7 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,23 @@ jobs:
with:
node-version: 18.x

- name: Set up pnpm
run: corepack enable pnpm && corepack install

- name: Install dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Publish to npm
uses: changesets/action@v1
with:
publish: yarn release
version: yarn stage
publish: pnpm release
version: pnpm stage
env:
GITHUB_TOKEN: ${{ secrets.SEEK_OSS_CI_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.SEEK_OSS_CI_NPM_TOKEN }}

- name: Deploy to GitHub Pages
run: yarn deploy
run: pnpm deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IS_GITHUB_PAGES: true
11 changes: 7 additions & 4 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,18 @@ jobs:
with:
node-version: 18.x

- name: Set up pnpm
run: corepack enable pnpm && corepack install

- name: Install dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Test
run: yarn test:ci
run: pnpm test:ci

- name: Lint
run: yarn lint
run: pnpm lint

# sku lint does not dry run the build
- name: Build fe
run: yarn fe build
run: pnpm fe build
6 changes: 6 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
public-hoist-pattern[]="@types*"
public-hoist-pattern[]="*eslint*"
public-hoist-pattern[]="*prettier*"
public-hoist-pattern[]="esbuild"
public-hoist-pattern[]="jest"
public-hoist-pattern[]="tsconfig-seek"
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ dist-storybook/
dist/
report/
# end managed by sku

pnpm-lock.yaml
22 changes: 11 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ If you're on Windows, we recommend the [Windows Subsystem for Linux].

First, some JavaScript tooling:

- Node.js 12+
- Yarn 1.x
- Node.js LTS
- pnpm as per `package.json#packageManager`

Next, install npm dependencies:

```shell
yarn install
pnpm install
```

### Git workflow
Expand Down Expand Up @@ -108,29 +108,29 @@ If all is well, they will merge your pull request into master.
You may find it easier to develop alongside unit tests:

```shell
yarn fe test --watch
pnpm fe test --watch
```

Format your code once you're happy with it:

```shell
yarn format
pnpm format
```

We run linting and testing in CI,
but consider running these commands locally for a faster feedback loop:

```shell
yarn lint
yarn test
pnpm lint
pnpm test
```

### Running locally

Start local development servers:

```shell
yarn fe start
pnpm fe start
```

## Releases
Expand All @@ -155,7 +155,7 @@ a changeset is not necessary for:
- npm dev dependencies

```shell
yarn changeset
pnpm changeset
```

The Changesets CLI is interactive and follows [semantic versioning]:
Expand Down Expand Up @@ -191,8 +191,8 @@ git switch beta
git reset --hard origin/master

# stage a beta release
yarn changeset pre enter beta
yarn changeset version
pnpm changeset pre enter beta
pnpm changeset version
```

If previous betas have been released under the same semantic version,
Expand Down
31 changes: 3 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ Reference implementation of a SEEK-integrated recruitment system.
- [Design](#design)
- [Overview](#overview)
- [Structure](#structure)
- [Usage](#usage)
- [Prerequisites](#prerequisites)
- [Run](#run)
- [Contributing](#contributing)
- [Meta](#meta)
- [Related SEEK OSS](#related-seek-oss)
- [Contributing](https://github.com/seek-oss/wingman/blob/master/CONTRIBUTING.md)
Expand Down Expand Up @@ -91,31 +89,9 @@ Internally, we maintain a private implementation to [dogfood] additions and chan
The frontend contains components (under [/fe/lib](/fe/lib)) that are packaged and published to npm.
This allows us to share code between the public implementation of Wingman in this repo and SEEK’s own private implementation.

## Usage
## Contributing

### Prerequisites

We depend on upstream tooling like [sku] that are predominantly tested on macOS and Linux.
If you’re on Windows, we recommend the [Windows Subsystem for Linux].

First, some JavaScript tooling:

- Node.js 12+
- Yarn 1.x

Next, install npm dependencies:

```shell
yarn install
```

### Run

Start local development servers:

```shell
yarn fe start
```
See [CONTRIBUTING.md](./CONTRIBUTING.md) for instructions on how to contribute to Wingman.

## Meta

Expand All @@ -137,4 +113,3 @@ Wingman is built on a bunch of other stuff that we’ve open sourced:
[seek api]: https://developer.seek.com/introduction
[sku]: https://github.com/seek-oss/sku
[windows subsystem for linux]: https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux
[yarn workspaces]: https://classic.yarnpkg.com/en/docs/workspaces/
3 changes: 2 additions & 1 deletion fe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"content-disposition": "0.5.4",
"date-fns": "3.6.0",
"faker": "5.5.3",
"graphql-tag": "2.12.6",
"path-browserify": "1.0.1",
"query-string": "7.1.3",
"react": "18.3.1",
Expand Down Expand Up @@ -62,7 +63,7 @@
"build": "sku build",
"build-storybook": "sku build-storybook",
"format": "sku format",
"lint": "sku lint && yarn -s lint:codegen",
"lint": "sku lint && pnpm -s lint:codegen",
"lint:codegen": "ts-node lib/types/seekApi.typeDefs.ts",
"serve": "sku serve",
"start": "sku start",
Expand Down
21 changes: 7 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,16 @@
},
"private": true,
"scripts": {
"fe": "yarn workspace wingman-fe",
"format": "yarn workspaces run format",
"lint": "yarn workspaces run lint",
"stage": "changeset version && yarn format",
"fe": "pnpm --filter wingman-fe",
"format": "pnpm -r format",
"lint": "pnpm -r lint",
"stage": "changeset version && pnpm format",
"release": "changeset publish",
"test": "yarn workspaces run test",
"test:ci": "yarn workspaces run test:ci",
"test": "pnpm -r test",
"test:ci": "pnpm -r test:ci",
"codegen": "graphql-codegen --config codegen.yml",
"deploy": "scripts/deploy"
},
"version": "0.0.0",
"workspaces": {
"nohoist": [
"wingman-fe/**"
],
"packages": [
"fe"
]
}
"packageManager": "[email protected]"
}
Loading

0 comments on commit 5f5e4df

Please sign in to comment.