Skip to content

Commit bfe23c7

Browse files
authored
Merge pull request #8 from jossydeleon/feature
v2.0.0 RC
2 parents a4280b4 + c83ccb5 commit bfe23c7

File tree

46 files changed

+1384
-148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1384
-148
lines changed

.eslintrc.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
"extends": [
7+
"eslint:recommended",
8+
"plugin:@typescript-eslint/recommended",
9+
"plugin:react/recommended"
10+
],
11+
"parser": "@typescript-eslint/parser",
12+
"parserOptions": {
13+
"ecmaVersion": "latest",
14+
"sourceType": "module"
15+
},
16+
"plugins": [
17+
"@typescript-eslint",
18+
"react"
19+
],
20+
"rules": {
21+
"@typescript-eslint/no-explicit-any": "off", // Allow any type
22+
"indent": "off",
23+
"linebreak-style": [
24+
"error",
25+
"unix"
26+
],
27+
"quotes": [
28+
"error",
29+
"single"
30+
],
31+
"semi": [
32+
"error",
33+
"always"
34+
]
35+
}
36+
}

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn lint-staged

README.md

Lines changed: 50 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,29 @@
1-
# React Query Native Devtool
1+
# React Query Native Devtool 🐵 Monorepo
22

33
React Native Query Devtool is a monorepo containing a React Native component and a standalone app to visualize query data in a similar way to react-query-devtools for the web.
44

5-
![Screenshot](https://github.com/jossydeleon/react-native-query-devtool-monorepo/assets/25192002/981f444f-4a27-4d41-8a95-bab861d7edab)
5+
<p align="center">
6+
<img src="https://github.com/jossydeleon/react-native-query-devtool-monorepo/assets/25192002/7c5011a9-262a-477e-99e8-af10289bc149" alt="rnqdt" style="display: block; margin: auto;">
7+
</p>
68

79
## Features
810

911
- Provides a component for integrating query data in React Native applications running react-query v3, and @tanstack/react-query v4 and v5.
10-
- Includes a standalone app to visualize and help debug query data.
11-
12-
## Standalone App
13-
14-
The standalone app allows you to visualize and debug query data from your React Native application using the `@jsmdeleon/react-native-query-devtool` package.
12+
- (Optional) Includes a standalone app to visualize and help debug query data.
1513

1614
## Installation
1715

18-
You can download the standalone app from the following link. Currently, it's available only for **macOS M1** and **Windows x64**:
19-
20-
[Download latest App](https://github.com/jossydeleon/react-native-query-devtool-monorepo/releases)
21-
22-
**Linux users:** You need to build the app from source as it's currently only available for **macOS M1** and **Windows x64**. Ensure to set up your environment accordingly before building the app.
16+
To use the devtool component in your React Native project, install the package using `npm` or `yarn`, You will also need to install `react-native-gesture-handlers` if you haven't already.
2317

2418
```bash
25-
# Go to app folder
26-
cd react-native-query-devtool-app
27-
28-
# Install dependencies
29-
yarn
30-
31-
# Build
32-
yarn build-server
33-
```
34-
35-
After running the build command, you'll find the freshly built app in a new folder named **'out'**.
36-
37-
## React Native Component
38-
39-
To use the devtool component in your React Native project, install the package:
40-
41-
```bash
42-
npm install @jsmdeleon/react-native-query-devtool
19+
npm install react-native-gesture-handler @jsmdeleon/react-native-query-devtool
4320
# or
44-
yarn add @jsmdeleon/react-native-query-devtool
21+
yarn add react-native-gesture-handler @jsmdeleon/react-native-query-devtool
4522
```
4623

4724
## Usage
4825

49-
In your React Native application, import `QueryNativeDevtool` to send query data to the server app for debugging:
26+
In your React Native application, import `QueryNativeDevtool`
5027

5128
```javascript
5229
import { QueryNativeDevtool } from "@jsmdeleon/react-native-query-devtool";
@@ -57,7 +34,7 @@ export default function App() {
5734
<View style={styles.container}>
5835
<Main />
5936
</View>
60-
<QueryNativeDevtool queryClient={queryClient} />
37+
<QueryNativeDevtool queryClient={queryClient} useRemoteDevtool={false} />
6138
</QueryClientProvider>
6239
);
6340
}
@@ -67,27 +44,56 @@ export default function App() {
6744

6845
If your app runs `react-query v3` pass `version="v3"` prop to `QueryNativeDevtool`
6946

70-
```javascript
71-
import { QueryNativeDevtool } from "@jsmdeleon/react-native-query-devtool";
47+
## Available Props
48+
49+
| Prop Name | Type | Description | Default Value |
50+
| -------------------- | ----------- | ------------------------------------------ | ------------- |
51+
| `queryClient`\* | QueryClient | First name of the user | undefined |
52+
| `version` | string | Last name of the user | "v5" |
53+
| `hideFloatingButton` | boolean | Hides Floating button | false |
54+
| `useRemoteDevtool` | boolean | Enable remote debugging via standalone app | true |
55+
56+
## Standalone app (Optional)
57+
58+
If you want more room to debug your query data, you can download the standalone app from the following link. Currently, it's available only for **macOS M1** and **Windows x64**. Check [Standalone Repo](https://github.com/jossydeleon/react-native-query-devtool-monorepo/tree/main/packages/react-native-query-devtool-app)
7259

60+
```javascript
7361
export default function App() {
7462
return (
7563
<QueryClientProvider client={queryClient}>
76-
<View style={styles.container}>
77-
<Main />
78-
</View>
79-
<QueryNativeDevtool queryClient={queryClient} version="v3" />
64+
<QueryNativeDevtool queryClient={queryClient} useRemoteDevtool={true} />
8065
</QueryClientProvider>
8166
);
8267
}
8368
```
8469

85-
This will enable your React Native application to send query data to the Electron app for debugging purposes.
70+
[Download latest App](https://github.com/jossydeleon/react-native-query-devtool-monorepo/releases)
71+
72+
**Note:** The binaries provided are not signed. If you have concerns about security or trust, you can choose to build the app from the source code for your machine.
73+
74+
**Linux users:** You need to build the app from source as it's currently only available for **macOS M1** and **Windows x64**. Ensure to set up your environment accordingly before building the app.
75+
76+
```bash
77+
# Go to app folder
78+
cd packages/react-native-query-devtool-app
79+
80+
# Install dependencies
81+
yarn
82+
83+
# Build
84+
yarn build-server
85+
```
86+
87+
After running the build command, you'll find the freshly built app in a new folder named **'out'**.
88+
89+
**Important:** The standalone app uses port `9017` by default. Ensure that this port is available and not blocked by any firewall settings or other applications on your system.
8690

8791
## Examples
8892

8993
In the example folder, you can find example projects demonstrating the usage of `@jsmdeleon/react-native-query-devtool` with different versions of React Query (v3, v4, and v5). To test the examples, navigate to the example folder, select the desired example, and run yarn ios or yarn android.
9094

95+
[Examples Repo](https://github.com/jossydeleon/react-native-query-devtool-monorepo/tree/main/example)
96+
9197
```bash
9298
cd example
9399

@@ -102,3 +108,7 @@ yarn ios
102108
# or
103109
yarn android
104110
```
111+
112+
## Contributions
113+
114+
Contributions to improve this project are welcome! If you have any ideas for new features, enhancements, bug fixes, or optimizations, feel free to submit a pull request. You can also report any bugs or issues you encounter by opening a new issue

example/react-query-v3/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"expo": "~50.0.6",
1515
"expo-status-bar": "~1.11.1",
1616
"react": "18.2.0",
17-
"react-native": "0.73.4"
17+
"react-native": "0.73.4",
18+
"react-native-gesture-handler": "^2.0.0"
1819
},
1920
"devDependencies": {
2021
"@babel/core": "^7.20.0"

example/react-query-v3/src/App.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ export default function App() {
1818
</View>
1919
</QueryClientProvider>
2020

21-
<QueryNativeDevtool queryClient={queryClient} version="v3" />
21+
<QueryNativeDevtool
22+
queryClient={queryClient}
23+
version="v3"
24+
useRemoteDevtool={false}
25+
/>
2226
</SafeAreaView>
2327
);
2428
}

example/react-query-v4/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"expo": "~50.0.6",
1515
"expo-status-bar": "~1.11.1",
1616
"react": "18.2.0",
17-
"react-native": "0.73.4"
17+
"react-native": "0.73.4",
18+
"react-native-gesture-handler": "^2.0.0"
1819
},
1920
"devDependencies": {
2021
"@babel/core": "^7.20.0"

example/react-query-v5/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"expo": "~50.0.6",
1515
"expo-status-bar": "~1.11.1",
1616
"react": "18.2.0",
17-
"react-native": "0.73.4"
17+
"react-native": "0.73.4",
18+
"react-native-gesture-handler": "^2.0.0"
1819
},
1920
"devDependencies": {
2021
"@babel/core": "^7.20.0"

package.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55
"name": "Josymar",
66
"email": "[email protected]"
77
},
8-
"version": "1.0.0",
8+
"version": "2.0.0",
99
"private": true,
1010
"scripts": {
1111
"dev-electron": "cd ./packages/react-native-query-devtool-app && electron-forge start",
1212
"build-server": "cd ./packages/react-native-query-devtool-app && electron-forge make",
13-
"publish-server":"cd ./packages/react-native-query-devtool-app && electron-forge publish",
13+
"publish-server": "cd ./packages/react-native-query-devtool-app && electron-forge publish",
1414
"build-client": "cd ./packages/react-native-query-devtool && tsup",
1515
"publish-client": "cd ./packages/react-native-query-devtool && yarn publish --access public",
1616
"v3-example-ios": "cd ./example/react-query-v3 && expo start --ios",
17-
"v3-example-android": "cd ./example/react-query-v3 && expo start --android"
17+
"v3-example-android": "cd ./example/react-query-v3 && expo start --android",
18+
"run-linters": "prettier --write && eslint --fix",
19+
"prepare": "husky"
1820
},
1921
"workspaces": [
2022
"packages/*"
@@ -26,13 +28,26 @@
2628
"devtool"
2729
],
2830
"type": "module",
31+
"lint-staged": {
32+
"*.{js,jsx,ts,tsx}": [
33+
"prettier ./packages/react-native-query-devtool/src --write",
34+
"eslint ./packages/react-native-query-devtool/src --fix"
35+
]
36+
},
2937
"devDependencies": {
3038
"@types/node": "^20.11.8",
3139
"@types/react": "^18.2.48",
3240
"@types/react-native": "^0.72.8",
3341
"@types/react-query": "^1.2.9",
42+
"@typescript-eslint/eslint-plugin": "^7.2.0",
43+
"@typescript-eslint/parser": "^7.2.0",
3444
"babel-core": "^4.7.16",
3545
"babel-runtime": "^6.26.0",
46+
"eslint": "^8.56.0",
47+
"eslint-plugin-react": "^7.34.1",
48+
"husky": "^9.0.11",
49+
"lint-staged": "^15.2.2",
50+
"prettier": "^3.1.1",
3651
"react-native": "^0.72.9",
3752
"ts-node": "^10.9.2",
3853
"tsup": "^8.0.1",
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# @jsmdeleon/react-native-query-devtool-app
2+
3+
## Features
4+
5+
Standalone app to visualize and help debug query data. You can download it from the following link. Currently, it's available only for **macOS M1** and **Windows x64**. [Download latest App](https://github.com/jossydeleon/react-native-query-devtool-monorepo/releases)
6+
7+
![Screenshot 2024-03-17 at 3 31 31 PM](https://github.com/jossydeleon/react-native-query-devtool-monorepo/assets/25192002/52789d5f-df95-4dff-bc09-5435bb92e814)
8+
9+
10+
**Note:** The binaries provided are not signed. If you have concerns about security or trust, you can choose to build the app from the source code for your machine.
11+
12+
**Linux users:** You need to build the app from source as it's currently only available for **macOS M1** and **Windows x64**. Ensure to set up your environment accordingly before building the app.
13+
14+
```bash
15+
# Go to app folder
16+
cd react-native-query-devtool-app
17+
18+
# Install dependencies
19+
yarn
20+
21+
# Build
22+
yarn build-server
23+
```
24+
25+
After running the build command, you'll find the freshly built app in a new folder named **'out'**.
26+
27+
**Important:** The standalone app uses port `9017` by default. Ensure that this port is available and not blocked by any firewall settings or other applications on your system.
28+
29+
## Examples
30+
31+
In the example folder, you can find example projects demonstrating the usage of `@jsmdeleon/react-native-query-devtool` with different versions of React Query (v3, v4, and v5). To test the examples, navigate to the example folder, select the desired example, and run yarn ios or yarn android.
32+
33+
[Examples Repo](https://github.com/jossydeleon/react-native-query-devtool-monorepo/tree/main/example)
34+
35+
```bash
36+
cd example
37+
38+
# Navigate to the desired example, for example:
39+
cd react-query-v3
40+
41+
# Install dependencies
42+
yarn
43+
44+
# Run example
45+
yarn ios
46+
# or
47+
yarn android
48+
```
49+
50+
## Contributions
51+
52+
Contributions to improve this project are welcome! If you have any ideas for new features, enhancements, bug fixes, or optimizations, feel free to submit a pull request. You can also report any bugs or issues you encounter by opening a new issue

packages/react-native-query-devtool-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@jsmdeleon/react-native-query-devtool-app",
33
"productName": "react-native-query-devtool-app",
4-
"version": "1.0.0",
4+
"version": "2.0.0",
55
"description": "The standalone app allows you to visualize and debug query data from your React Native application using the @jsmdeleon/react-native-query-devtool package.",
66
"main": ".webpack/main",
77
"scripts": {

0 commit comments

Comments
 (0)