Skip to content

Commit 9685511

Browse files
committed
Merge branch 'master' into patch-1
2 parents 12247fc + c3f9127 commit 9685511

File tree

9 files changed

+77
-76
lines changed

9 files changed

+77
-76
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lib

.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["env"]
3+
}

.huskyrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"hooks": {
3+
"pre-commit": "lint-staged"
4+
}
5+
}

.lintstagedrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"*.js": "eslint",
3+
"*.{json,yml,md}": "prettier -l"
4+
}

.prettierrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"proseWrap": "never",
3+
"singleQuote": true,
4+
"semi": false
5+
}

.size-limit.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[
2+
{
3+
"limit": "1 KB",
4+
"ignore": ["apollo-link", "apollo-link-http-common"]
5+
}
6+
]

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
### Patch
66

7+
- Updated dependencies.
8+
- Reduced the size of the published `package.json` by moving dev tool config to files. This also prevents editor extensions such as Prettier and ESLint from detecting config and attempting to operate when opening package files installed in `node_modules`.
9+
- Simplified the `prepublishOnly` script.
710
- Add tips for React Native gotchas, via [#135](https://github.com/jaydenseric/apollo-upload-client/pull/135).
811

912
## 10.0.0

package.json

Lines changed: 21 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,28 @@
3333
},
3434
"browserslist": "> 0.5%, not dead, node 6",
3535
"dependencies": {
36-
"apollo-link": "^1.2.6",
37-
"apollo-link-http-common": "^0.2.8",
38-
"extract-files": "^5.0.0"
36+
"apollo-link": "^1.2.11",
37+
"apollo-link-http-common": "^0.2.13",
38+
"extract-files": "^5.0.1"
3939
},
4040
"devDependencies": {
41-
"@babel/cli": "^7.2.0",
42-
"@babel/core": "^7.2.2",
43-
"@babel/preset-env": "^7.2.0",
41+
"@babel/cli": "^7.4.4",
42+
"@babel/core": "^7.4.4",
43+
"@babel/preset-env": "^7.4.4",
4444
"babel-eslint": "^10.0.1",
45-
"eslint": "^5.10.0",
46-
"eslint-config-env": "^2.0.0",
47-
"eslint-config-prettier": "^3.3.0",
48-
"eslint-plugin-import": "^2.14.0",
49-
"eslint-plugin-import-order-alphabetical": "^0.0.1",
50-
"eslint-plugin-node": "^8.0.0",
51-
"eslint-plugin-prettier": "^3.0.0",
52-
"graphql": "^14.0.2",
53-
"husky": "^1.3.0",
54-
"jsdoc-md": "^1.7.0",
55-
"lint-staged": "^8.1.0",
56-
"prettier": "^1.15.3",
57-
"size-limit": "^0.21.0"
45+
"eslint": "^5.16.0",
46+
"eslint-config-env": "^4.0.0",
47+
"eslint-config-prettier": "^4.2.0",
48+
"eslint-plugin-import": "^2.17.2",
49+
"eslint-plugin-import-order-alphabetical": "^0.0.2",
50+
"eslint-plugin-node": "^8.0.1",
51+
"eslint-plugin-prettier": "^3.0.1",
52+
"graphql": "^14.2.1",
53+
"husky": "^2.1.0",
54+
"jsdoc-md": "^2.1.0",
55+
"lint-staged": "^8.1.5",
56+
"prettier": "^1.17.0",
57+
"size-limit": "^1.3.0"
5858
},
5959
"scripts": {
6060
"prepare": "npm run prepare:clean && npm run prepare:js && npm run prepare:jsdoc && npm run prepare:prettier",
@@ -66,38 +66,6 @@
6666
"test:eslint": "eslint .",
6767
"test:prettier": "prettier '**/*.{json,yml,md}' -l",
6868
"test:size": "size-limit",
69-
"prepublishOnly": "npm run prepare && npm test"
70-
},
71-
"husky": {
72-
"hooks": {
73-
"pre-commit": "lint-staged"
74-
}
75-
},
76-
"lint-staged": {
77-
"*.js": "eslint",
78-
"*.{json,yml,md}": "prettier -l"
79-
},
80-
"eslintIgnore": [
81-
"lib"
82-
],
83-
"eslintConfig": {
84-
"extends": [
85-
"env"
86-
]
87-
},
88-
"prettier": {
89-
"proseWrap": "never",
90-
"singleQuote": true,
91-
"semi": false
92-
},
93-
"size-limit": [
94-
{
95-
"name": "CJS",
96-
"limit": "1 KB",
97-
"ignore": [
98-
"apollo-link",
99-
"apollo-link-http-common"
100-
]
101-
}
102-
]
69+
"prepublishOnly": "npm test"
70+
}
10371
}

readme.md

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ client.mutate({
140140

141141
Used to mark a [React Native `File` substitute](#type-reactnativefilesubstitute). It’s too risky to assume all objects with `uri`, `type` and `name` properties are files to extract. Re-exported from [`extract-files`](https://npm.im/extract-files) for convenience.
142142

143-
| Parameter | Type | Description |
144-
| :-------- | :----------------------------------------------------------- | :----------------------------------------------------------------------------------- |
145-
| `file` | [ReactNativeFileSubstitute](#type-reactnativefilesubstitute) | A React Native [`File`](https://developer.mozilla.org/docs/web/api/file) substitute. |
143+
| Parameter | Type | Description |
144+
| :-- | :-- | :-- |
145+
| `file` | [ReactNativeFileSubstitute](#type-reactnativefilesubstitute) | A React Native [`File`](https://developer.mozilla.org/docs/web/api/file) substitute. |
146146

147147
#### Examples
148148

@@ -158,19 +158,21 @@ _A React Native file that can be used in query or mutation variables._
158158
> })
159159
> ```
160160
161+
---
162+
161163
### function createUploadLink
162164
163165
Creates a terminating [Apollo Link](https://apollographql.com/docs/link) capable of file uploads. Options match [`createHttpLink`](https://apollographql.com/docs/link/links/http#options).
164166
165-
| Parameter | Type | Description |
166-
| :-------------------------- | :-------------------------------------------- | :------------------------------------------------------------------------------------------------ |
167-
| `options` | [Object](https://mdn.io/object) | Options. |
168-
| `options.uri` | [string](https://mdn.io/string)? = `/graphql` | GraphQL endpoint URI. |
169-
| `options.fetch` | [function](https://mdn.io/function)? | [`fetch`](https://fetch.spec.whatwg.org) implementation to use, defaulting to the `fetch` global. |
170-
| `options.fetchOptions` | [FetchOptions](#type-fetchoptions)? | `fetch` options; overridden by upload requirements. |
171-
| `options.credentials` | [string](https://mdn.io/string)? | Overrides `options.fetchOptions.credentials`. |
172-
| `options.headers` | [Object](https://mdn.io/object)? | Merges with and overrides `options.fetchOptions.headers`. |
173-
| `options.includeExtensions` | [boolean](https://mdn.io/boolean)? = `false` | Toggles sending `extensions` fields to the GraphQL server. |
167+
| Parameter | Type | Description |
168+
| :-- | :-- | :-- |
169+
| `options` | Object | Options. |
170+
| `options.uri` | string? = `/graphql` | GraphQL endpoint URI. |
171+
| `options.fetch` | function? | [`fetch`](https://fetch.spec.whatwg.org) implementation to use, defaulting to the `fetch` global. |
172+
| `options.fetchOptions` | [FetchOptions](#type-fetchoptions)? | `fetch` options; overridden by upload requirements. |
173+
| `options.credentials` | string? | Overrides `options.fetchOptions.credentials`. |
174+
| `options.headers` | Object? | Merges with and overrides `options.fetchOptions.headers`. |
175+
| `options.includeExtensions` | boolean? = `false` | Toggles sending `extensions` fields to the GraphQL server. |
174176
175177
**Returns:** ApolloLink — A terminating [Apollo Link](https://apollographql.com/docs/link) capable of file uploads.
176178
@@ -194,34 +196,38 @@ _A basic Apollo Client setup._
194196
> })
195197
> ```
196198
199+
---
200+
197201
### type FetchOptions
198202
199203
GraphQL request `fetch` options.
200204
201-
**Type:** [Object](https://mdn.io/object)
205+
**Type:** Object
202206
203-
| Property | Type | Description |
204-
| :------------ | :------------------------------- | :------------------------------- |
205-
| `headers` | [Object](https://mdn.io/object) | HTTP request headers. |
206-
| `credentials` | [string](https://mdn.io/string)? | Authentication credentials mode. |
207+
| Property | Type | Description |
208+
| :------------ | :------ | :------------------------------- |
209+
| `headers` | Object | HTTP request headers. |
210+
| `credentials` | string? | Authentication credentials mode. |
207211
208212
#### See
209213
210214
- [Polyfillable fetch options](https://github.github.io/fetch#options).
211215
216+
---
217+
212218
### type ReactNativeFileSubstitute
213219
214220
A React Native [`File`](https://developer.mozilla.org/docs/web/api/file) substitute.
215221
216222
Be aware that inspecting network requests with Chrome dev tools interferes with the React Native `FormData` implementation, causing network errors.
217223
218-
**Type:** [Object](https://mdn.io/object)
224+
**Type:** Object
219225
220-
| Property | Type | Description |
221-
| :------- | :------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------ |
222-
| `uri` | [String](https://mdn.io/string) | Filesystem path. |
223-
| `name` | [String](https://mdn.io/string)? | File name. |
224-
| `type` | [String](https://mdn.io/string)? | File content type. Some environments (particularly Android) require a valid MIME type; Expo `ImageResult.type` is unreliable as it can be just `image`. |
226+
| Property | Type | Description |
227+
| :-- | :-- | :-- |
228+
| `uri` | String | Filesystem path. |
229+
| `name` | String? | File name. |
230+
| `type` | String? | File content type. Some environments (particularly Android) require a valid MIME type; Expo `ImageResult.type` is unreliable as it can be just `image`. |
225231
226232
#### See
227233

0 commit comments

Comments
 (0)