gatsby-source-filesystem 2.0.21 → 2.0.24

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/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.0.24](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-filesystem/compare/gatsby-source-filesystem@2.0.23...gatsby-source-filesystem@2.0.24) (2019-03-11)
7
+
8
+ **Note:** Version bump only for package gatsby-source-filesystem
9
+
10
+ ## [2.0.23](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-filesystem/compare/gatsby-source-filesystem@2.0.22...gatsby-source-filesystem@2.0.23) (2019-02-25)
11
+
12
+ ### Bug Fixes
13
+
14
+ - **gatsby-source-filesystem:** Do not re-download cached files from createRemoteFileNode ([#12054](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-filesystem/issues/12054)) ([a358239](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-filesystem/commit/a358239))
15
+
16
+ ## [2.0.22](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-filesystem/compare/gatsby-source-filesystem@2.0.21...gatsby-source-filesystem@2.0.22) (2019-02-22)
17
+
18
+ **Note:** Version bump only for package gatsby-source-filesystem
19
+
6
20
  ## [2.0.21](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-filesystem/compare/gatsby-source-filesystem@2.0.20...gatsby-source-filesystem@2.0.21) (2019-02-20)
7
21
 
8
22
  ### Bug Fixes
@@ -164,10 +164,11 @@ function _pushToQueue() {
164
164
  }
165
165
 
166
166
  const requestRemoteNode = (url, headers, tmpFilename) => new Promise((resolve, reject) => {
167
- const responseStream = got.stream(url, Object.assign({}, headers, {
167
+ const responseStream = got.stream(url, {
168
+ headers,
168
169
  timeout: 30000,
169
170
  retries: 5
170
- }));
171
+ });
171
172
  const fsWriteStream = fs.createWriteStream(tmpFilename);
172
173
  responseStream.pipe(fsWriteStream);
173
174
  responseStream.on(`downloadProgress`, pro => console.log(pro)); // If there's a 400/500 response or other error.
@@ -245,9 +246,13 @@ function _processRemoteNode() {
245
246
 
246
247
  const tmpFilename = createFilePath(pluginCacheDir, `tmp-${digest}`, ext); // Fetch the file.
247
248
 
248
- const response = yield requestRemoteNode(url, headers, tmpFilename); // Save the response headers for future requests.
249
+ const response = yield requestRemoteNode(url, headers, tmpFilename);
250
+
251
+ if (response.statusCode == 200) {
252
+ // Save the response headers for future requests.
253
+ yield cache.set(cacheId(url), response.headers);
254
+ } // If the user did not provide an extension and we couldn't get one from remote file, try and guess one
249
255
 
250
- yield cache.set(cacheId(url), response.headers); // If the user did not provide an extension and we couldn't get one from remote file, try and guess one
251
256
 
252
257
  if (ext === ``) {
253
258
  const buffer = readChunk.sync(tmpFilename, 0, fileType.minimumBytes);
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": "2.0.21",
4
+ "version": "2.0.24",
5
5
  "author": "Kyle Mathews <mathews.kyle@gmail.com>",
6
6
  "bugs": {
7
7
  "url": "https://github.com/gatsbyjs/gatsby/issues"
@@ -10,7 +10,7 @@
10
10
  "@babel/runtime": "^7.0.0",
11
11
  "better-queue": "^3.8.7",
12
12
  "bluebird": "^3.5.0",
13
- "chokidar": "^1.7.0",
13
+ "chokidar": "^2.1.2",
14
14
  "file-type": "^10.2.0",
15
15
  "fs-extra": "^5.0.0",
16
16
  "got": "^7.1.0",
@@ -26,7 +26,7 @@
26
26
  "devDependencies": {
27
27
  "@babel/cli": "^7.0.0",
28
28
  "@babel/core": "^7.0.0",
29
- "babel-preset-gatsby-package": "^0.1.3",
29
+ "babel-preset-gatsby-package": "^0.1.4",
30
30
  "cross-env": "^5.1.4"
31
31
  },
32
32
  "homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-filesystem#readme",
@@ -44,5 +44,5 @@
44
44
  "prepare": "cross-env NODE_ENV=production npm run build",
45
45
  "watch": "babel -w src --out-dir . --ignore **/__tests__"
46
46
  },
47
- "gitHead": "c73dc9f54fb4136aa0b609e54696dc1f3dec9429"
47
+ "gitHead": "17118da6ecfbc274db521e11cabbaa6f45f7fd5a"
48
48
  }