Skip to content

Commit ee9dc06

Browse files
jyoesfrankcalise
authored andcommitted
Initial reactotron-apollo-client
1 parent c11d6a4 commit ee9dc06

File tree

13 files changed

+582
-0
lines changed

13 files changed

+582
-0
lines changed

lib/reactotron-apollo-client/.babelrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": [
3+
"@babel/preset-env",
4+
"@babel/preset-typescript"
5+
]
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
npm-debug.log
3+
coverage
4+
.nyc_output
5+
dist
6+
yarn-error.log
7+
.idea
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
**/.vscode
2+
**/android
3+
**/build
4+
**/compiled
5+
**/dist
6+
**/ios
7+
**/package.json
8+
**/release
9+
CHANGELOG.md
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"printWidth": 100,
3+
"semi": false,
4+
"trailingComma": "es5"
5+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changelog
2+
3+
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4+
5+
### [0.1.2](https://github.com/infinitered/reactotron/compare/reactotron-@apollo/[email protected]@apollo/[email protected]) (2023-07-06)
6+
7+
### [0.1.1](https://github.com/infinitered/reactotron/compare/reactotron-@apollo/[email protected]@apollo/[email protected]) (2023-06-15)
8+
9+
## 0.1.0 (2023-06-15)
10+
11+
12+
### Features
13+
14+
* **lib:** add `@apollo/client` plugin ([#1291](https://github.com/infinitered/reactotron/issues/1291)) ([a5637fa](https://github.com/infinitered/reactotron/commit/a5637fae2a3eabcea27cc491d13d0174c46be9e9))

lib/reactotron-apollo-client/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 - 3016 Infinite Red LLC.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# reactotron-apollo-client
2+
3+
Log updates to your [@apollo/client](https://github.com/mrousavy/@apollo/client) store in the Reactotron timeline.
4+
5+
# Installing
6+
7+
```bash
8+
npm i --save-dev reactotron-apollo-client
9+
# or
10+
yarn add -D reactotron-apollo-client
11+
```
12+
13+
## Usage
14+
15+
Import your mmkv storage instance:
16+
17+
```js
18+
import { MMKV } from "@apollo/client"
19+
export const storage = new MMKV()
20+
```
21+
22+
To use the `mmkvPlugin`, add the additional plugin on the `import` line.
23+
24+
```js
25+
import Reactotron from "reactotron-react-native"
26+
import mmkvPlugin from "reactotron-apollo-client"
27+
import { storage } from "./mmkv/storage/instance/location" // <--- update this location
28+
...
29+
Reactotron.configure()
30+
.use(mmkvPlugin({ storage })) // <--- here we go!
31+
.connect()
32+
```
33+
34+
And you're done! Now you can see your MMKV in Reactotron.
35+
36+
## Advanced Usage
37+
38+
`mmkvPlugin()` accepts an object with an `ignore` key. The value is an array of strings you would like to prevent sending to Reactotron.
39+
40+
```js
41+
mmkvPlugin({
42+
storage,
43+
ignore: ["secret"],
44+
})
45+
```
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"name": "reactotron-apollo-client",
3+
"version": "0.0.1",
4+
"description": "A Reactotron plugin for @apollo/client.",
5+
"author": "Infinite Red",
6+
"license": "MIT",
7+
"bugs": {
8+
"url": "https://github.com/infinitered/reactotron/issues"
9+
},
10+
"homepage": "https://github.com/infinitered/reactotron/tree/beta/lib/reactotron-apollo-client",
11+
"repository": "https://github.com/infinitered/reactotron/tree/beta/lib/reactotron-apollo-client",
12+
"files": [
13+
"dist",
14+
"LICENSE"
15+
],
16+
"main": "dist/reactotron-apollo-client.umd.js",
17+
"module": "dist/reactotron-apollo-client.es5.js",
18+
"typings": "dist/types/reactotron-apollo-client.d.ts",
19+
"scripts": {
20+
"test": "jest --passWithNoTests",
21+
"test:watch": "jest --watch --notify",
22+
"format": "prettier '*.{js,ts,tsx,json,md,css,yml}|**/*.{js,ts,tsx,json,md,css,yml}'",
23+
"format:check": "yarn format --check",
24+
"format:write": "yarn format --write",
25+
"prebuild": "yarn clean",
26+
"build": "yarn tsc && yarn compile",
27+
"prebuild:dev": "yarn clean",
28+
"build:dev": "yarn tsc && yarn compile:dev",
29+
"clean": "trash dist",
30+
"lint": "eslint 'src/**/**.{ts,tsx}'",
31+
"compile": "NODE_ENV=production rollup -c rollup.config.ts",
32+
"compile:dev": "NODE_ENV=development rollup -c rollup.config.ts",
33+
"tsc": "tsc",
34+
"typecheck": "tsc",
35+
"ci:test": "yarn test --runInBand"
36+
},
37+
"peerDependencies": {
38+
"@apollo/client": "*",
39+
"reactotron-core-client": "*"
40+
},
41+
"dependencies": {
42+
"ramda": "^0.25.0"
43+
},
44+
"devDependencies": {
45+
"@apollo/client": "^3.8.3",
46+
"@babel/core": "^7.21.0",
47+
"@babel/preset-env": "^7.20.2",
48+
"@babel/preset-typescript": "^7.21.0",
49+
"@types/jest": "^29.4.0",
50+
"@types/node": "^11.9.5",
51+
"@types/ramda": "^0.25.50",
52+
"@typescript-eslint/eslint-plugin": "^5.54.0",
53+
"@typescript-eslint/parser": "^5.54.0",
54+
"babel-eslint": "^10.1.0",
55+
"babel-jest": "^29.4.3",
56+
"eslint": "^8.35.0",
57+
"eslint-config-prettier": "^8.6.0",
58+
"eslint-config-standard": "^17.0.0",
59+
"eslint-plugin-import": "^2.27.5",
60+
"eslint-plugin-node": "^11.1.0",
61+
"eslint-plugin-promise": "^6.1.1",
62+
"eslint-plugin-react": "^7.32.2",
63+
"eslint-plugin-react-hooks": "^4.6.0",
64+
"eslint-plugin-standard": "^5.0.0",
65+
"graphql": "^16.8.0",
66+
"jest": "^29.4.3",
67+
"prettier": "^2.8.4",
68+
"reactotron-core-client": "workspace:*",
69+
"rollup": "^1.1.2",
70+
"rollup-plugin-babel": "^4.3.2",
71+
"rollup-plugin-babel-minify": "^7.0.0",
72+
"rollup-plugin-filesize": "^6.0.1",
73+
"rollup-plugin-node-resolve": "^4.0.0",
74+
"rollup-plugin-resolve": "^0.0.1-predev.1",
75+
"testdouble": "^3.16.8",
76+
"trash-cli": "^5.0.0",
77+
"ts-jest": "^29.0.5",
78+
"typescript": "4.9.5"
79+
},
80+
"eslintConfig": {
81+
"root": false
82+
}
83+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "reactotron-apollo-client",
3+
"targets": {
4+
"version": {
5+
"executor": "@jscutlery/semver:version"
6+
}
7+
}
8+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import resolve from "rollup-plugin-node-resolve"
2+
import babel from "rollup-plugin-babel"
3+
import filesize from "rollup-plugin-filesize"
4+
import minify from "rollup-plugin-babel-minify"
5+
6+
const pkg = require("./package.json")
7+
8+
const LIBRARY_NAME = "reactotron-apollo-client"
9+
const GLOBALS = ["@apollo/client", "graphql"]
10+
11+
export default {
12+
input: "src/reactotron-apollo-client.ts",
13+
output: [
14+
{
15+
file: pkg.main,
16+
name: LIBRARY_NAME,
17+
format: "umd",
18+
sourcemap: true,
19+
globals: GLOBALS,
20+
},
21+
{
22+
file: pkg.module,
23+
format: "es",
24+
sourcemap: true,
25+
globals: GLOBALS,
26+
},
27+
],
28+
plugins: [
29+
resolve({ extensions: [".ts"] }),
30+
babel({ extensions: [".ts"], runtimeHelpers: true }),
31+
process.env.NODE_ENV === "production"
32+
? minify({
33+
comments: false,
34+
})
35+
: null,
36+
filesize(),
37+
],
38+
external: ["@apollo/client", "reactotron-core-client", "graphql"],
39+
}

0 commit comments

Comments
 (0)