Skip to content

Commit 4a74c22

Browse files
committed
chore: Update dependencies
BREAKING CHANGE: Remove Relay Classic support
1 parent fc8bb6d commit 4a74c22

20 files changed

+3585
-3174
lines changed

.babelrc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"presets": [
3-
["env", {
4-
"loose": true
5-
}],
6-
"stage-1"
3+
["@4c", {
4+
"targets": {}
5+
}]
76
],
8-
"plugins": ["add-module-exports"]
7+
"plugins": [
8+
"add-module-exports"
9+
]
910
}

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": [
33
"4catalyzer",
4+
"4catalyzer-jest",
45
"prettier"
56
],
67
"plugins": [

README.md

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Relay Local Schema [![Travis][build-badge]][build] [![npm][npm-badge]][npm]
2+
23
Use [Relay](http://facebook.github.io/relay/) without a GraphQL server.
34

5+
[![Codecov][codecov-badge]][codecov]
46
[![Discord][discord-badge]][discord]
57

68
## Usage
79

8-
### Relay Modern
9-
1010
```js
1111
import { Environment } from 'react-relay';
1212
import { Network } from 'relay-local-schema';
@@ -48,33 +48,6 @@ const environment = new Environment({
4848
});
4949
```
5050

51-
### Relay Classic
52-
53-
```js
54-
import RelayLocalSchema from 'relay-local-schema/lib/classic';
55-
56-
import schema from './data/schema';
57-
58-
Relay.injectNetworkLayer(
59-
new RelayLocalSchema.NetworkLayer({ schema })
60-
);
61-
```
62-
63-
This will execute queries against the specified schema locally, rather than against a separate GraphQL server.
64-
65-
You can also supply a GraphQL.js `rootValue` or `contextValue`, or an `onError` callback:
66-
67-
```js
68-
Relay.injectNetworkLayer(
69-
new RelayLocalSchema.NetworkLayer({
70-
schema,
71-
rootValue: 'foo',
72-
contextValue: 'bar',
73-
onError: (errors, request) => console.error(errors, request),
74-
})
75-
);
76-
```
77-
7851
## Caveat
7952

8053
This is intended for exploratory work, integration tests, demos, and working with local data. This is not generally intended as a substitute for a remote GraphQL back end in production.
@@ -85,5 +58,8 @@ This is intended for exploratory work, integration tests, demos, and working wit
8558
[npm-badge]: https://img.shields.io/npm/v/relay-local-schema.svg
8659
[npm]: https://www.npmjs.org/package/relay-local-schema
8760

61+
[codecov-badge]: https://img.shields.io/codecov/c/github/relay-tools/relay-local-schema/master.svg
62+
[codecov]: https://codecov.io/gh/relay-tools/relay-local-schema
63+
8864
[discord-badge]: https://img.shields.io/badge/Discord-join%20chat%20%E2%86%92-738bd7.svg
8965
[discord]: https://discord.gg/0ZcbPKXt5bX40xsQ

package.json

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,21 @@
77
],
88
"main": "lib/index.js",
99
"scripts": {
10-
"build": "rimraf lib && babel src -d lib",
10+
"build": "BABEL_ENV=production babel src -d lib --delete-dir-on-start",
1111
"build-fixtures": "npm run update-schema && npm run relay-compiler",
12-
"lint": "eslint src test *.js",
12+
"lint": "eslint src test",
1313
"prepublish": "npm run build",
14-
"relay-compiler": "relay-compiler --src test/modern --schema test/fixtures/schema.graphql",
14+
"relay-compiler": "relay-compiler --src test --schema test/fixtures/schema.graphql",
1515
"tdd": "jest --watch",
1616
"test": "npm run build-fixtures && npm run lint && npm run testonly -- --coverage",
1717
"testonly": "jest --runInBand --verbose",
1818
"update-schema": "babel-node test/fixtures/updateSchema.js"
1919
},
20+
"husky": {
21+
"hooks": {
22+
"pre-commit": "lint-staged"
23+
}
24+
},
2025
"lint-staged": {
2126
"*.js": [
2227
"eslint --fix",
@@ -50,39 +55,32 @@
5055
"homepage": "https://github.com/relay-tools/relay-local-schema#readme",
5156
"peerDependencies": {
5257
"graphql": ">=0.5.0",
53-
"react-relay": ">=1.0.0",
5458
"relay-runtime": ">=1.0.0"
5559
},
5660
"devDependencies": {
57-
"babel-cli": "^6.26.0",
58-
"babel-core": "^6.26.0",
59-
"babel-eslint": "^8.2.2",
60-
"babel-jest": "^22.4.3",
61-
"babel-plugin-add-module-exports": "^0.2.1",
62-
"babel-plugin-relay": "^1.5.0",
63-
"babel-polyfill": "^6.26.0",
64-
"babel-preset-env": "^1.6.1",
65-
"babel-preset-react": "^6.24.1",
66-
"babel-preset-stage-1": "^6.24.1",
67-
"codecov": "^3.0.0",
68-
"eslint": "^4.19.1",
69-
"eslint-config-4catalyzer-react": "^0.4.1",
70-
"eslint-config-prettier": "^2.9.0",
71-
"eslint-plugin-import": "^2.9.0",
72-
"eslint-plugin-jsx-a11y": "^6.0.3",
73-
"eslint-plugin-prettier": "^2.6.0",
74-
"eslint-plugin-react": "^7.7.0",
61+
"@4c/babel-preset": "^4.1.5",
62+
"@babel/cli": "^7.2.3",
63+
"@babel/core": "^7.3.4",
64+
"@babel/node": "^7.2.2",
65+
"babel-eslint": "^10.0.1",
66+
"babel-jest": "^24.5.0",
67+
"babel-plugin-add-module-exports": "^1.0.0",
68+
"babel-plugin-relay": "^3.0.0",
69+
"codecov": "^3.2.0",
70+
"eslint": "^5.15.3",
71+
"eslint-config-4catalyzer": "^0.7.2",
72+
"eslint-config-4catalyzer-jest": "^1.1.2",
73+
"eslint-config-prettier": "^4.1.0",
74+
"eslint-plugin-import": "^2.16.0",
75+
"eslint-plugin-jest": "^22.4.1",
76+
"eslint-plugin-prettier": "^3.0.1",
7577
"graphql": "^14.1.1",
76-
"graphql-relay": "^0.5.4",
77-
"husky": "^0.14.3",
78-
"jest": "^22.4.3",
79-
"lint-staged": "^7.0.0",
80-
"prettier": "^1.11.1",
81-
"react": "^16.2.0",
82-
"react-dom": "^16.2.0",
83-
"react-relay": "^1.5.0",
84-
"relay-compiler": "^1.5.0",
85-
"relay-runtime": "^1.5.0",
86-
"rimraf": "^2.6.2"
78+
"graphql-relay": "^0.6.0",
79+
"husky": "^1.3.1",
80+
"jest": "^24.5.0",
81+
"lint-staged": "^8.1.5",
82+
"prettier": "^1.16.4",
83+
"relay-compiler": "^3.0.0",
84+
"relay-runtime": "^3.0.0"
8785
}
8886
}
File renamed without changes.

src/classic/NetworkLayer.js

Lines changed: 0 additions & 53 deletions
This file was deleted.

src/classic/__forks__/createRequestError.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/classic/__forks__/formatRequestErrors.js

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/classic/index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)