gatsby-source-filesystem 4.12.0-next.0 → 4.12.0-next.1
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 +12 -0
- package/README.md +2 -0
- package/create-file-node-from-buffer.js +5 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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
|
+
## [4.11.0](https://github.com/gatsbyjs/gatsby/commits/gatsby-source-filesystem@4.11.0/packages/gatsby-source-filesystem) (2022-03-29)
|
|
7
|
+
|
|
8
|
+
[🧾 Release notes](https://www.gatsbyjs.com/docs/reference/release-notes/v4.11)
|
|
9
|
+
|
|
10
|
+
#### Bug Fixes
|
|
11
|
+
|
|
12
|
+
- cleanup tests [#35200](https://github.com/gatsbyjs/gatsby/issues/35200) ([f4121fb](https://github.com/gatsbyjs/gatsby/commit/f4121fbd7fce0034816e3e743481c13cb4181d07))
|
|
13
|
+
|
|
14
|
+
#### Chores
|
|
15
|
+
|
|
16
|
+
- replace all uses of gatsbyjs.org with gatsbyjs.com [#35101](https://github.com/gatsbyjs/gatsby/issues/35101) ([16cff41](https://github.com/gatsbyjs/gatsby/commit/16cff413e154dc4e74fc5be631d52c76273e5cbc))
|
|
17
|
+
|
|
6
18
|
### [4.10.1](https://github.com/gatsbyjs/gatsby/commits/gatsby-source-filesystem@4.10.1/packages/gatsby-source-filesystem) (2022-03-23)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package gatsby-source-filesystem
|
package/README.md
CHANGED
|
@@ -261,6 +261,8 @@ When working with data that isn't already stored in a file, such as when queryin
|
|
|
261
261
|
|
|
262
262
|
The `createFileNodeFromBuffer` helper accepts a `Buffer`, caches its contents to disk, and creates a file node that points to it.
|
|
263
263
|
|
|
264
|
+
The name of the file can be passed to the `createFileNodeFromBuffer` helper. If no name is given, the content hash will be used to determine the name.
|
|
265
|
+
|
|
264
266
|
## Example usage
|
|
265
267
|
|
|
266
268
|
The following example is adapted from the source of [`gatsby-source-mysql`](https://github.com/malcolm-kee/gatsby-source-mysql):
|
|
@@ -137,7 +137,7 @@ module.exports = ({
|
|
|
137
137
|
parentNodeId = null,
|
|
138
138
|
createNodeId,
|
|
139
139
|
ext,
|
|
140
|
-
name
|
|
140
|
+
name
|
|
141
141
|
}) => {
|
|
142
142
|
// validation of the input
|
|
143
143
|
// without this it's notoriously easy to pass in the wrong `createNodeId`
|
|
@@ -165,6 +165,10 @@ module.exports = ({
|
|
|
165
165
|
|
|
166
166
|
if (!hash) {
|
|
167
167
|
hash = createContentDigest(buffer);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (!name) {
|
|
171
|
+
name = hash;
|
|
168
172
|
} // Check if we already requested node for this remote file
|
|
169
173
|
// and return stored promise if we did.
|
|
170
174
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-source-filesystem",
|
|
3
3
|
"description": "Gatsby source plugin for building websites from local data. Markdown, JSON, images, YAML, CSV, and dozens of other data types supported.",
|
|
4
|
-
"version": "4.12.0-next.
|
|
4
|
+
"version": "4.12.0-next.1",
|
|
5
5
|
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/gatsbyjs/gatsby/issues"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"chokidar": "^3.5.2",
|
|
12
12
|
"file-type": "^16.5.3",
|
|
13
13
|
"fs-extra": "^10.0.0",
|
|
14
|
-
"gatsby-core-utils": "^3.12.0-next.
|
|
14
|
+
"gatsby-core-utils": "^3.12.0-next.1",
|
|
15
15
|
"got": "^9.6.0",
|
|
16
16
|
"md5-file": "^5.0.0",
|
|
17
17
|
"mime": "^2.5.2",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"engines": {
|
|
50
50
|
"node": ">=14.15.0"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "c452e959b90de7cb0ae56af694edd404bb1b46c0"
|
|
53
53
|
}
|