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
2 changes: 0 additions & 2 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 Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ To run the example app on 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
pnpm typecheck
pnpm lint
```

To fix formatting errors, run the following:
To fix lint and formatting errors, run the following:

```sh
pnpm lint --fix
pnpm lint:fix
```

Remember to add tests for your change if possible. Run the unit tests by:
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 @@ -105,7 +105,7 @@ The `package.json` file contains various scripts for common tasks:

- `pnpm install`: setup project by installing dependencies.
- `pnpm typecheck`: type-check files with TypeScript.
- `pnpm lint`: lint files with ESLint.
- `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.
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
24 changes: 12 additions & 12 deletions example/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const path = require('path');
const { getDefaultConfig } = require('@expo/metro-config');
const { mergeConfig } = require('@react-native/metro-config');
const path = require("node:path");
const { getDefaultConfig } = require("@expo/metro-config");
const { mergeConfig } = require("@react-native/metro-config");

const defaultConfig = getDefaultConfig(__dirname);

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

/**
* Metro configuration
Expand All @@ -14,14 +14,14 @@ const monorepoRoot = path.resolve(projectRoot, '..');
* @type {import('@react-native/metro-config').MetroConfig}
*/
const config = {
watchFolders: [monorepoRoot],
resolver: {
nodeModulesPaths: [
path.resolve(projectRoot, 'node_modules'),
path.resolve(monorepoRoot, 'node_modules'),
],
unstable_enablePackageExports: true,
},
watchFolders: [monorepoRoot],
resolver: {
nodeModulesPaths: [
path.resolve(projectRoot, "node_modules"),
path.resolve(monorepoRoot, "node_modules"),
],
unstable_enablePackageExports: true,
},
};

module.exports = mergeConfig(defaultConfig, config);
56 changes: 28 additions & 28 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"name": "react-native-alert-queue-example",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
},
"dependencies": {
"react-native-alert-queue": "workspace:*",
"@expo/metro-runtime": "~6.1.2",
"expo": "~54.0.32",
"expo-status-bar": "~3.0.9",
"react": "19.1.0",
"react-dom": "19.1.0",
"react-native": "0.81.5",
"react-native-reanimated": "~4.1.1",
"react-native-safe-area-context": "~5.6.0",
"react-native-web": "^0.21.0",
"react-native-worklets": "0.5.1"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@react-native/metro-config": "0.81.5",
"react-native-builder-bob": "^0.40.17"
},
"private": true
"name": "react-native-alert-queue-example",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
},
"dependencies": {
"react-native-alert-queue": "workspace:*",
"@expo/metro-runtime": "~6.1.2",
"expo": "~54.0.33",
"expo-status-bar": "~3.0.9",
"react": "19.1.0",
"react-dom": "19.1.0",
"react-native": "0.81.5",
"react-native-reanimated": "~4.1.1",
"react-native-safe-area-context": "~5.6.2",
"react-native-web": "^0.21.2",
"react-native-worklets": "0.5.1"
},
"devDependencies": {
"@babel/core": "^7.29.0",
"@react-native/metro-config": "0.81.5",
"react-native-builder-bob": "^0.40.18"
},
"private": true
}
82 changes: 41 additions & 41 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
import { Text, View, StyleSheet, ScrollView } from 'react-native';
import { ScrollView, StyleSheet, Text, View } from "react-native";

import { AlertContainer } from 'react-native-alert-queue';
import { AlertContainer } from "react-native-alert-queue";

import { SafeAreaView, SafeAreaProvider } from 'react-native-safe-area-context';
import { Basics } from './containers/Basics';
import { Customizations } from './containers/Customizations';
import { Updating } from './containers/Updating';
import { KeyboardAvoiding } from './containers/Keyboard';
import { Confetti } from './containers/Confetti';
import { SafeAreaProvider, SafeAreaView } from "react-native-safe-area-context";
import { Basics } from "./containers/Basics";
import { Confetti } from "./containers/Confetti";
import { Customizations } from "./containers/Customizations";
import { KeyboardAvoiding } from "./containers/Keyboard";
import { Updating } from "./containers/Updating";

export default function App() {
return (
<SafeAreaProvider>
<View style={styles.container}>
<SafeAreaView style={styles.wrapper}>
<Text style={styles.title}>React Native Alert Queue</Text>
<ScrollView contentContainerStyle={styles.scrollViewContent}>
<Basics />
<Customizations />
<Updating />
<KeyboardAvoiding />
<Confetti />
</ScrollView>
</SafeAreaView>
<AlertContainer />
</View>
</SafeAreaProvider>
);
return (
<SafeAreaProvider>
<View style={styles.container}>
<SafeAreaView style={styles.wrapper}>
<Text style={styles.title}>React Native Alert Queue</Text>
<ScrollView contentContainerStyle={styles.scrollViewContent}>
<Basics />
<Customizations />
<Updating />
<KeyboardAvoiding />
<Confetti />
</ScrollView>
</SafeAreaView>
<AlertContainer />
</View>
</SafeAreaProvider>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
},
wrapper: {
flex: 1,
},
scrollViewContent: {
paddingHorizontal: 20,
paddingBottom: 20,
},
title: {
fontSize: 26,
fontWeight: 'bold',
marginVertical: 20,
textAlign: 'center',
},
container: {
flex: 1,
},
wrapper: {
flex: 1,
},
scrollViewContent: {
paddingHorizontal: 20,
paddingBottom: 20,
},
title: {
fontSize: 26,
fontWeight: "bold",
marginVertical: 20,
textAlign: "center",
},
});
Loading