Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 6 additions & 24 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,15 @@ description: Setup Node.js and install dependencies
runs:
using: composite
steps:
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Restore dependencies
id: yarn-cache
uses: actions/cache/restore@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-
node-version-file: .node-version
cache: 'pnpm'

- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --immutable
run: pnpm install
shell: bash

- name: Cache dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
**/node_modules
.yarn/install-state.gz
key: ${{ steps.yarn-cache.outputs.cache-primary-key }}
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
branches:
- main
pull_request:
branches:
- main
merge_group:
types:
- checks_requested
Expand All @@ -21,10 +19,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 @@ -48,4 +46,4 @@ jobs:
uses: ./.github/actions/setup

- name: Build package
run: yarn prepare
run: pnpm prepare
9 changes: 2 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,8 @@ buck-out/
android/app/libs
android/keystores/debug.keystore

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

# Expo
.expo/
Expand Down
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# React Native / Metro often need hoisted node_modules for resolution
node-linker=hoisted
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

541 changes: 0 additions & 541 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

28 changes: 0 additions & 28 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

This file was deleted.

874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.1.cjs

This file was deleted.

10 changes: 0 additions & 10 deletions .yarnrc.yml

This file was deleted.

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

## Development workflow

This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/features/workspaces). It contains the following packages:
This project is a monorepo managed using [pnpm workspaces](https://pnpm.io/workspaces). It contains the following packages:

- The library package in the root directory.
- An example app in the `example/` directory.

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
```

> Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development.
> Since the project relies on pnpm workspaces, you should use [pnpm](https://pnpm.io/) for development.

The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make.

Expand All @@ -28,44 +28,44 @@ You can use various commands from the root directory to work with the project.
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:
Make sure your code passes TypeScript and Biome. Run the following to verify:

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

To fix formatting errors, run the following:
To fix lint and 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
```

### Commit message convention
Expand All @@ -83,9 +83,9 @@ Our pre-commit hooks verify that your commit message matches this format when co

### Linting and tests

[ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/)
[Biome](https://biomejs.dev/), [TypeScript](https://www.typescriptlang.org/)

We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.
We use [TypeScript](https://www.typescriptlang.org/) for type checking, [Biome](https://biomejs.dev/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.

Our pre-commit hooks verify that the linter and tests pass when committing.

Expand All @@ -96,20 +96,20 @@ 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`: setup project by installing dependencies.
- `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 install`: setup project by installing dependencies.
- `pnpm typecheck`: type-check files with TypeScript.
- `pnpm lint`: lint and check formatting with Biome.
- `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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ Install `RN Reanimated` following [their official guide](https://docs.swmansion.
npm install react-native-alert-queue
# or
yarn add react-native-alert-queue
# or
pnpm add react-native-alert-queue
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: ['module:react-native-builder-bob/babel-preset'],
presets: ["module:react-native-builder-bob/babel-preset"],
};
9 changes: 9 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"vcs": {
"clientKind": "git",
"defaultBranch": "main",
"enabled": true,
"useIgnoreFile": true
}
}
39 changes: 0 additions & 39 deletions eslint.config.mjs

This file was deleted.

56 changes: 28 additions & 28 deletions example/app.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"expo": {
"name": "example",
"slug": "example",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"newArchEnabled": true,
"splash": {
"image": "./assets/splash-icon.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"ios": {
"supportsTablet": true,
"bundleIdentifier": "alertqueue.example"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "alertqueue.example"
},
"web": {
"favicon": "./assets/favicon.png"
}
}
"expo": {
"name": "React Native Alert Queue",
"slug": "rn.alert.queue.example",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"newArchEnabled": true,
"splash": {
"image": "./assets/splash-icon.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"ios": {
"supportsTablet": true,
"bundleIdentifier": "rn.alert.queue.example"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "rn.alert.queue.example"
},
"web": {
"favicon": "./assets/favicon.png"
}
}
}
24 changes: 12 additions & 12 deletions example/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
const path = require('path');
const { getConfig } = require('react-native-builder-bob/babel-config');
const pkg = require('../package.json');
const path = require("node:path");
const { getConfig } = require("react-native-builder-bob/babel-config");
const pkg = require("../package.json");

const root = path.resolve(__dirname, '..');
const root = path.resolve(__dirname, "..");

module.exports = function (api) {
api.cache(true);
module.exports = (api) => {
api.cache(true);

return getConfig(
{
presets: ['babel-preset-expo'],
},
{ root, pkg }
);
return getConfig(
{
presets: ["babel-preset-expo"],
},
{ root, pkg },
);
};
4 changes: 2 additions & 2 deletions example/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { registerRootComponent } from 'expo';
import { registerRootComponent } from "expo";

import App from './src/App';
import App from "./src/App";

// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
// It also ensures that whether you load the app in Expo Go or in a native build,
Expand Down
Loading