gatsby-source-filesystem 1.5.35 → 1.5.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/create-remote-file-node.js +9 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -63,8 +63,8 @@ You can query file nodes like the following:
|
|
|
63
63
|
|
|
64
64
|
`gatsby-source-filesystem` exports two helper functions:
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
- `createFilePath`
|
|
67
|
+
- `createRemoteFileNode`
|
|
68
68
|
|
|
69
69
|
### createFilePath
|
|
70
70
|
|
|
@@ -137,7 +137,7 @@ createRemoteFileNode({
|
|
|
137
137
|
|
|
138
138
|
// OPTIONAL
|
|
139
139
|
// Adds htaccess authentication to the download request if passed in.
|
|
140
|
-
auth: {
|
|
140
|
+
auth: { htaccess_user: `USER`, htaccess_pass: `PASSWORD` },
|
|
141
141
|
});
|
|
142
142
|
```
|
|
143
143
|
|
|
@@ -302,7 +302,10 @@ var queue = new Queue(pushToQueue, {
|
|
|
302
302
|
concurrent: 200
|
|
303
303
|
});var requestRemoteNode = function requestRemoteNode(url, headers, tmpFilename, filename) {
|
|
304
304
|
return new Promise(function (resolve, reject) {
|
|
305
|
-
var responseStream = got.stream(url, (0, _extends3.default)({}, headers, {
|
|
305
|
+
var responseStream = got.stream(url, (0, _extends3.default)({}, headers, {
|
|
306
|
+
timeout: 30000,
|
|
307
|
+
retries: 5
|
|
308
|
+
}));
|
|
306
309
|
var fsWriteStream = fs.createWriteStream(tmpFilename);
|
|
307
310
|
responseStream.pipe(fsWriteStream);
|
|
308
311
|
responseStream.on(`downloadProgress`, function (pro) {
|
|
@@ -312,7 +315,11 @@ var queue = new Queue(pushToQueue, {
|
|
|
312
315
|
// If there's a 400/500 response or other error.
|
|
313
316
|
responseStream.on(`error`, function (error, body, response) {
|
|
314
317
|
fs.removeSync(tmpFilename);
|
|
315
|
-
reject(
|
|
318
|
+
reject(error);
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
fsWriteStream.on(`error`, function (error) {
|
|
322
|
+
reject(error);
|
|
316
323
|
});
|
|
317
324
|
|
|
318
325
|
responseStream.on(`response`, function (response) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-source-filesystem",
|
|
3
3
|
"description": "Gatsby plugin which parses files within a directory for further parsing by other plugins",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.39",
|
|
5
5
|
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/gatsbyjs/gatsby/issues"
|