Skip to content

Commit

Permalink
Merge pull request #156 from obytes/pnpm
Browse files Browse the repository at this point in the history
Using PNPM as package manager
  • Loading branch information
yjose authored May 2, 2023
2 parents c4c40cf + 40bbad5 commit a4b803a
Show file tree
Hide file tree
Showing 24 changed files with 13,121 additions and 12,865 deletions.
73 changes: 0 additions & 73 deletions .github/workflows/notice-yarn-changes.yml

This file was deleted.

90 changes: 41 additions & 49 deletions .github/workflows/validate-pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Validate RR
name: Validate PR

on:
push:
Expand All @@ -7,39 +7,29 @@ on:
branches: [main, master]

jobs:
compile:
name: Compile TS (tsc)
type-check:
name: Type Check (tsc)
runs-on: ubuntu-latest
steps:
- name : 📦 Checkout project repo
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache: 'pnpm'

- name: 📦 Install Reviewdog
uses: reviewdog/action-setup@v1

- name: 📦 Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: 📦 Restore Project Dependencies (node_modules)
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: 📦 Install Project Dependencies
run: yarn install --immutable
run: pnpm install --frozen-lockfile

- name: 🏃‍♂️ Run TypeScript # Reviewdog tsc errorformat: %f:%l:%c - error TS%n: %m
run: |
yarn type-check | reviewdog -name="tsc" -efm="%f(%l,%c): error TS%n: %m" -reporter="github-pr-review" -filter-mode="nofilter" -fail-on-error -tee
pnpm type-check | reviewdog -name="tsc" -efm="%f(%l,%c): error TS%n: %m" -reporter="github-pr-review" -filter-mode="nofilter" -fail-on-error -tee
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -51,26 +41,16 @@ jobs:
steps:
- name : 📦 Checkout project repo
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'

- name: 📦 Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: 📦 Restore Project Dependencies (node_modules)
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: 'pnpm'

- name: 📦 Install Project Dependencies
run: yarn install --immutable
run: pnpm install --frozen-lockfile

- name: 🏃‍♂️ Run ESLint
uses: reviewdog/action-eslint@v1
Expand All @@ -79,33 +59,45 @@ jobs:
reporter: github-pr-review
eslint_flags: '. --ext .js,.jsx,.ts,.tsx'

test:
name: Tests (jest)

doctor:
name: Expo Doctor (expo)
runs-on: ubuntu-latest

steps:
- name : 📦 Checkout project repo
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache: 'pnpm'

- name: 📦 Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: 📦 Install Project Dependencies
run: pnpm install --frozen-lockfile

- name: 🚑 Run Doctor Checks
run: pnpm run doctor

test:
name: Tests (jest)
runs-on: ubuntu-latest

- name: 📦 Restore Project Dependencies (node_modules)
uses: actions/cache@v3
id: yarn-cache
steps:
- name : 📦 Checkout project repo
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'

- name: 📦 Install Project Dependencies
run: yarn install --immutable
run: pnpm install --frozen-lockfile

- name: 🏃‍♂️ Run Tests
run: yarn test:ci
run: pnpm test:ci
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit $1
pnpm commitlint --edit $1
6 changes: 3 additions & 3 deletions .husky/post-merge
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ function changed {
echo 'Checking for changes in yarn.lock...'

if changed 'yarn.lock'; then
echo "📦 yarn.lock changed. Run yarn install to bring your dependencies up to date."
yarn install
echo "📦 yarn.lock changed. Run pnpm install to bring your dependencies up to date."
pnpm install
fi

echo 'You are up to date :)'

echo 'If necessary, you can run yarn prebuild to generate native code.'
echo 'If necessary, you can run pnpm prebuild to generate native code.'

exit 0
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ fi
echo ">> Finish checking branch name"
echo ">> Linting your files and fixing them if needed..."

yarn type-check
yarn lint-staged
pnpm type-check
pnpm lint-staged
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node-linker=hoisted
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"yoavbls.pretty-ts-errors",
"mikestead.dotenv",
"eamodio.gitlens",
"streetsidesoftware.code-spell-checker",
"formulahendry.auto-close-tag",
"formulahendry.auto-rename-tag",
"dsznajder.es7-react-js-snippets",
"bradlc.vscode-tailwindcss",
"lokalise.i18n-ally",
"wesbos.theme-cobalt2",
Expand Down
6 changes: 3 additions & 3 deletions README-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Mobile App </h1>
- [Node.js LTS release](https://nodejs.org/en/)
- [Git](https://git-scm.com/)
- [Watchman](https://facebook.github.io/watchman/docs/install#buildinstall), required only for macOS or Linux users
- [Yarn](https://classic.yarnpkg.com/en/docs/install)
- [Pnpm](https://pnpm.io/installation)
- [Expo Cli](https://docs.expo.dev/workflow/expo-cli/)
- [VS Code Editor](https://code.visualstudio.com/download) ⚠️ Make sure to install all recommended extension from `.vscode/extensions.json`

Expand All @@ -31,13 +31,13 @@ yarn
To run the app on ios

```sh
yarn ios
pnpm ios
```

To run the app on Android

```sh
yarn android
pnpm android
```

## ✍️ Documentation
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ This starter is maintained by [Obytes mobile tribe team](https://www.obytes.com/

In addition to maintaining this starter kit, we are also available to work on custom projects and help you build your dream app. If you are looking for experienced and reliable developers to bring your app vision to life, please visit our website at [obytes.com/contact](https://www.obytes.com/contact) to get in touch with us. We would be happy to discuss your project in more detail and explore how we can help you achieve your goals.

## 🔥 How to contribute ?
## 🔥 How to contribute?

Thank you for your interest in contributing to our project. Your involvement is greatly appreciated and we welcome your contributions. Here are some ways you can help us improve this project:

Expand All @@ -125,6 +125,10 @@ Thank you for your interest in contributing to our project. Your involvement is

We value the input and contributions of our community and look forward to working with you to improve this project.

## ❓ FAQ

If you have any questions about the starter and want answers, please check out the [Discussions](https://github.com/obytes/react-native-template-obytes/discussions) page.

## 🔖 License

This project is MIT licensed.
Loading

0 comments on commit a4b803a

Please sign in to comment.