Skip to content

Commit

Permalink
chore(refactor): refactor the entire package
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardRNStudio committed Apr 7, 2024
1 parent 8fb1da5 commit 18f1c2f
Show file tree
Hide file tree
Showing 100 changed files with 16,772 additions and 21,932 deletions.
98 changes: 0 additions & 98 deletions .circleci/config.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Setup
description: Setup Node.js and install dependencies

runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Cache dependencies
id: yarn-cache
uses: actions/cache@v4
with:
path: |
**/node_modules
.yarn/install-state.gz
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --immutable
shell: bash
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
day: 'thursday'
time: '22:00'
timezone: 'Europe/London'
rebase-strategy: 'disabled'
70 changes: 70 additions & 0 deletions .github/workflows/build-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Build application
on:
push:
branches:
- main
workflow_dispatch:

jobs:
lint:
name: Lint files
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Lint files
run: yarn lint

- name: Typecheck files
run: yarn typecheck

test:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

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

build-library:
name: Build library
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Build package
run: yarn prepare

update-version:
name: Update version
runs-on: ubuntu-latest
needs: [build-library]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Git
run: |
git config --global user.name "RichardRNStudio"
git config --global user.email "[email protected]"
- name: Update version
run: |
npm version patch -m "Bump version to %s"
git push --force --follow-tags
env:
NODE_AUTH_TOKEN: ${{secrets.ACTIONS_PAT}}
49 changes: 49 additions & 0 deletions .github/workflows/check-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Check Pull Request
on:
pull_request:
branches:
- main

jobs:
lint:
name: Lint files
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Lint files
run: yarn lint

- name: Typecheck files
run: yarn typecheck

test:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

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

build-library:
name: Build library
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Build package
run: yarn prepare
59 changes: 59 additions & 0 deletions .github/workflows/deploy-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Publish NPM package
on:
release:
types: [created]

jobs:
lint:
name: Lint files
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Lint files
run: yarn lint

- name: Typecheck files
run: yarn typecheck

test:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

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

publish-npm:
name: Build & Publish NPM package
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Build package
run: yarn prepare

- name: Publish
run: |
git config --global user.name 'RichardRNStudio'
git config --global user.email '${NPM_EMAIL}'
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
npm publish --access public
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_EMAIL: ${{ secrets.NPM_EMAIL }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
25 changes: 20 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,22 @@ project.xcworkspace

# Android/IJ
#
.idea
.classpath
.cxx
.gradle
.idea
.project
.settings
local.properties
android.iml

# Cocoapods
#
example/ios/Pods

# Ruby
example/vendor/

# node.js
#
node_modules/
Expand All @@ -53,11 +60,19 @@ buck-out/
android/app/libs
android/keystores/debug.keystore

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Expo
.expo/*
.expo/

# Turborepo
.turbo/

# generated by bob
lib/

# dot-env
.env
18 changes: 0 additions & 18 deletions .npmignore

This file was deleted.

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18
6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

Loading

0 comments on commit 18f1c2f

Please sign in to comment.