Skip to content

Commit

Permalink
Migrate to pnpm (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntorionbearstudio authored Aug 27, 2024
1 parent 3dbd584 commit 5613c3c
Show file tree
Hide file tree
Showing 16 changed files with 19,792 additions and 29,087 deletions.
17 changes: 11 additions & 6 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,24 @@ runs:
with:
node-version-file: .nvmrc

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 8

- name: Cache dependencies
id: yarn-cache
id: pnpm-cache
uses: actions/cache@v3
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-pnpm-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
if: steps.pnpm-cache.outputs.cache-hit != 'true'
run: |
yarn install --cwd example --frozen-lockfile
yarn install --frozen-lockfile
pnpm install -C example --frozen-lockfile
pnpm install --frozen-lockfile
shell: bash
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
uses: ./.github/actions/setup

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

- name: Typecheck files
run: yarn typecheck
run: pnpm typecheck

test:
runs-on: ubuntu-latest
Expand All @@ -33,7 +33,7 @@ jobs:
uses: ./.github/actions/setup

- name: Run unit tests
run: yarn test --maxWorkers=2 --coverage
run: pnpm test -- --maxWorkers=2 --coverage

build:
runs-on: ubuntu-latest
Expand All @@ -45,4 +45,4 @@ jobs:
uses: ./.github/actions/setup

- name: Build package
run: yarn prepack
run: pnpm prepack
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node-linker=hoisted
173 changes: 0 additions & 173 deletions .yarn-metadata.json

This file was deleted.

3 changes: 0 additions & 3 deletions .yarnrc

This file was deleted.

37 changes: 17 additions & 20 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,57 +6,55 @@ We want this community to be friendly and respectful to each other. Please follo

## Development workflow

To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
To get started with the project, run `pnpm install` in the root directory to install the required dependencies for each package:

```sh
yarn
pnpm install
```

> While it's possible to use [`npm`](https://github.com/npm/cli), the tooling is built around [`yarn`](https://classic.yarnpkg.com/), so you'll have an easier time if you use `yarn` for development.
While developing, you can run the [example app](/example/) to test your changes. Any changes you make in your library's JavaScript code will be reflected in the example app without a rebuild. If you change any native code, then you'll need to rebuild the example app.

To start the packager:

```sh
yarn example start
pnpm example start
```

To run the example app on Android:

```sh
yarn example android
pnpm example android
```

To run the example app on iOS:

```sh
yarn example ios
pnpm example ios
```

To run the example app on Web:

```sh
yarn example web
pnpm example web
```

Make sure your code passes TypeScript and ESLint. Run the following to verify:

```sh
yarn typecheck
yarn lint
pnpm typecheck
pnpm lint
```

To fix formatting errors, run the following:

```sh
yarn lint --fix
pnpm lint --fix
```

Remember to add tests for your change if possible. Run the unit tests by:

```sh
yarn test
pnpm test
```


Expand Down Expand Up @@ -88,20 +86,19 @@ We use [release-it](https://github.com/release-it/release-it) to make it easier
To publish new versions, run the following:

```sh
yarn release
pnpm release
```

### Scripts

The `package.json` file contains various scripts for common tasks:

- `yarn bootstrap`: setup project by installing all dependencies and pods.
- `yarn typecheck`: type-check files with TypeScript.
- `yarn lint`: lint files with ESLint.
- `yarn test`: run unit tests with Jest.
- `yarn example start`: start the Metro server for the example app.
- `yarn example android`: run the example app on Android.
- `yarn example ios`: run the example app on iOS.
- `pnpm typecheck`: type-check files with TypeScript.
- `pnpm lint`: lint files with ESLint.
- `pnpm test`: run unit tests with Jest.
- `pnpm example start`: start the Metro server for the example app.
- `pnpm example android`: run the example app on Android.
- `pnpm example ios`: run the example app on iOS.

### Sending a pull request

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ Ficus UI is a React Native UI library forked on Magnus UI and inspired by Chakra

## Installation

With pnpm :

```sh
pnpm add react-native-ficus-ui
```

With npm :

```sh
Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ To develop locally, clone this repository and run the following command to start
the local dev server:

```bash
yarn
yarn dev
pnpm install
pnpm dev
```

And visit `localhost:3000` to preview your changes.
6 changes: 6 additions & 0 deletions docs/pages/docs/getting-started.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ import { Callout, FileTree } from 'nextra/components';

## Installation

With pnpm :

```sh
pnpm add react-native-ficus-ui
```

With npm :

```sh
Expand Down
1 change: 1 addition & 0 deletions example/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node-linker=hoisted
Loading

0 comments on commit 5613c3c

Please sign in to comment.