gatsby-transformer-json 4.1.0 → 4.3.0

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,36 @@
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.3.0](https://github.com/gatsbyjs/gatsby/commits/HEAD/packages/gatsby-transformer-json) (2021-12-01)
7
+
8
+ [🧾 Release notes](https://www.gatsbyjs.com/docs/reference/release-notes/v4.3)
9
+
10
+ **Note:** Version bump only for package gatsby-transformer-json
11
+
12
+ ## [4.2.0](https://github.com/gatsbyjs/gatsby/commits/gatsby-transformer-json@4.2.0/packages/gatsby-transformer-json) (2021-11-16)
13
+
14
+ [🧾 Release notes](https://www.gatsbyjs.com/docs/reference/release-notes/v4.2)
15
+
16
+ **Note:** Version bump only for package gatsby-transformer-json
17
+
18
+ ## [4.1.0](https://github.com/gatsbyjs/gatsby/commits/gatsby-transformer-json@4.1.0/packages/gatsby-transformer-json) (2021-11-02)
19
+
20
+ [🧾 Release notes](https://www.gatsbyjs.com/docs/reference/release-notes/v4.1)
21
+
22
+ **Note:** Version bump only for package gatsby-transformer-json
23
+
24
+ ## [4.0.0](https://github.com/gatsbyjs/gatsby/commits/gatsby-transformer-json@4.0.0/packages/gatsby-transformer-json) (2021-10-21)
25
+
26
+ [🧾 Release notes](https://www.gatsbyjs.com/docs/reference/release-notes/v4.0)
27
+
28
+ #### Chores
29
+
30
+ - apply patches for v4 [#33170](https://github.com/gatsbyjs/gatsby/issues/33170) ([f8c5141](https://github.com/gatsbyjs/gatsby/commit/f8c5141bf72108a53338fd01514522ae7a1b37bf))
31
+
32
+ #### Other Changes
33
+
34
+ - Prefix `id` and only use createNodeId fix [#28942](https://github.com/gatsbyjs/gatsby/issues/28942) ([c20d6f6](https://github.com/gatsbyjs/gatsby/commit/c20d6f68c485467898ba82f79450c356b26f6ec1))
35
+
6
36
  ## [3.14.0](https://github.com/gatsbyjs/gatsby/commits/gatsby-transformer-json@3.14.0/packages/gatsby-transformer-json) (2021-09-18)
7
37
 
8
38
  [🧾 Release notes](https://www.gatsbyjs.com/docs/reference/release-notes/v3.14)
package/gatsby-node.js CHANGED
@@ -46,7 +46,7 @@ async function onCreateNode({
46
46
  }
47
47
  }
48
48
 
49
- function transformObject(obj, id, type) {
49
+ async function transformObject(obj, id, type) {
50
50
  const jsonNode = { ...obj,
51
51
  id,
52
52
  children: [],
@@ -61,7 +61,7 @@ async function onCreateNode({
61
61
  jsonNode[`jsonId`] = obj.id;
62
62
  }
63
63
 
64
- createNode(jsonNode);
64
+ await createNode(jsonNode);
65
65
  createParentChildLink({
66
66
  parent: node,
67
67
  child: jsonNode
@@ -83,15 +83,16 @@ async function onCreateNode({
83
83
  }
84
84
 
85
85
  if (_.isArray(parsedContent)) {
86
- parsedContent.forEach((obj, i) => {
87
- transformObject(obj, createNodeId(`${node.id} [${i}] >>> JSON`), getType({
86
+ for (let i = 0, l = parsedContent.length; i < l; i++) {
87
+ const obj = parsedContent[i];
88
+ await transformObject(obj, createNodeId(`${node.id} [${i}] >>> JSON`), getType({
88
89
  node,
89
90
  object: obj,
90
91
  isArray: true
91
92
  }));
92
- });
93
+ }
93
94
  } else if (_.isPlainObject(parsedContent)) {
94
- transformObject(parsedContent, createNodeId(`${node.id} >>> JSON`), getType({
95
+ await transformObject(parsedContent, createNodeId(`${node.id} >>> JSON`), getType({
95
96
  node,
96
97
  object: parsedContent,
97
98
  isArray: false
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gatsby-transformer-json",
3
3
  "description": "Gatsby transformer plugin for JSON files",
4
- "version": "4.1.0",
4
+ "version": "4.3.0",
5
5
  "author": "Kyle Mathews <mathews.kyle@gmail.com>",
6
6
  "bugs": {
7
7
  "url": "https://github.com/gatsbyjs/gatsby/issues"
@@ -13,7 +13,7 @@
13
13
  "devDependencies": {
14
14
  "@babel/cli": "^7.15.4",
15
15
  "@babel/core": "^7.15.5",
16
- "babel-preset-gatsby-package": "^2.1.0",
16
+ "babel-preset-gatsby-package": "^2.3.0",
17
17
  "cross-env": "^7.0.3"
18
18
  },
19
19
  "homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-json#readme",
@@ -39,5 +39,5 @@
39
39
  "engines": {
40
40
  "node": ">=14.15.0"
41
41
  },
42
- "gitHead": "4086ca523d1caf68d44076e361f00e7b4b96c4a5"
42
+ "gitHead": "864751dd815c57f4122bc7aa12e17aac53ec3ba0"
43
43
  }