diff --git a/Breaking Changes.md b/Breaking Changes.md index 465b3980ff5fe..a80d7eefe1256 100644 --- a/Breaking Changes.md +++ b/Breaking Changes.md @@ -1,3 +1,4 @@ - Remove postcss plugins (cssnext, cssimport) from default css loader config - change webpack api +- Source & transformer plugins now use UUIDs for ids. If you used glob or regex to query nodes by id then you'll need to query something else. diff --git a/packages/gatsby-source-contentful/src/__tests__/__snapshots__/normalize.js.snap b/packages/gatsby-source-contentful/src/__tests__/__snapshots__/normalize.js.snap index e87a1be9b9752..264bc9377a04d 100644 --- a/packages/gatsby-source-contentful/src/__tests__/__snapshots__/normalize.js.snap +++ b/packages/gatsby-source-contentful/src/__tests__/__snapshots__/normalize.js.snap @@ -1745,9 +1745,9 @@ Array [ "fileName": "zJYzDlGk.jpeg", "url": "//images.contentful.com/rocybtov1ozk/3wtvPBbBjiMKqKKga8I2Cu/c65cb9cce1107c2e7e63c17072fe7932/zJYzDlGk.jpeg", }, - "id": "c3wtvPBbBjiMKqKKga8I2Cu", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "1593e649b4fe3a41f92ed90883243f20", + "contentDigest": "75139d025020af40d19af84d66b251df", "type": "ContentfulAsset", }, "node_locale": "en-US", @@ -1771,9 +1771,9 @@ Array [ "fileName": "zJYzDlGk.jpeg", "url": "//images.contentful.com/rocybtov1ozk/3wtvPBbBjiMKqKKga8I2Cu/c65cb9cce1107c2e7e63c17072fe7932/zJYzDlGk.jpeg", }, - "id": "c3wtvPBbBjiMKqKKga8I2Cu___de", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "8b67139badaa45735ae88ef2e6c61219", + "contentDigest": "ad7cfc82ac78847086bd811528bb01a7", "type": "ContentfulAsset", }, "node_locale": "de", @@ -1797,9 +1797,9 @@ Array [ "fileName": "soso.clock.jpg", "url": "//images.contentful.com/rocybtov1ozk/KTRF62Q4gg60q6WCsWKw8/a8b2e93ac83fbbbb7bf9fba9f92b018e/soso.clock.jpg", }, - "id": "KTRF62Q4gg60q6WCsWKw8", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "4f24dd1565bc3fa00ced8f5828d141eb", + "contentDigest": "7b92549e5c428ba0e140da1144afc73c", "type": "ContentfulAsset", }, "node_locale": "en-US", @@ -1823,9 +1823,9 @@ Array [ "fileName": "soso.clock.jpg", "url": "//images.contentful.com/rocybtov1ozk/KTRF62Q4gg60q6WCsWKw8/a8b2e93ac83fbbbb7bf9fba9f92b018e/soso.clock.jpg", }, - "id": "KTRF62Q4gg60q6WCsWKw8___de", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "47178af1f9b421718f6e58baad400be7", + "contentDigest": "40379f0a5dd13b974ce13e5e498b30c0", "type": "ContentfulAsset", }, "node_locale": "de", @@ -1849,9 +1849,9 @@ Array [ "fileName": "jqvtazcyfwseah9fmysz.jpg", "url": "//images.contentful.com/rocybtov1ozk/Xc0ny7GWsMEMCeASWO2um/af8e29320c04af689798afe96e2345c7/jqvtazcyfwseah9fmysz.jpg", }, - "id": "Xc0ny7GWsMEMCeASWO2um", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "5e3000a5acad1526b245c966b42f2658", + "contentDigest": "ea45014163a1d7fe2644947b1d067967", "type": "ContentfulAsset", }, "node_locale": "en-US", @@ -1875,9 +1875,9 @@ Array [ "fileName": "jqvtazcyfwseah9fmysz.jpg", "url": "//images.contentful.com/rocybtov1ozk/Xc0ny7GWsMEMCeASWO2um/af8e29320c04af689798afe96e2345c7/jqvtazcyfwseah9fmysz.jpg", }, - "id": "Xc0ny7GWsMEMCeASWO2um___de", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "e3575c0980b47f03436da7950347d7ee", + "contentDigest": "b9d79764ae4839cebfe3077630f59a5e", "type": "ContentfulAsset", }, "node_locale": "de", @@ -1901,9 +1901,9 @@ Array [ "fileName": "lemnos-logo.jpg", "url": "//images.contentful.com/rocybtov1ozk/2Y8LhXLnYAYqKCGEWG4EKI/eb29ab3c817906993f65e221523ef252/lemnos-logo.jpg", }, - "id": "c2Y8LhXLnYAYqKCGEWG4EKI", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "3c9ee767ff7810c757275f870464fdb3", + "contentDigest": "ab47d0c9e7c6c24b3ad1301097a5fc58", "type": "ContentfulAsset", }, "node_locale": "en-US", @@ -1927,9 +1927,9 @@ Array [ "fileName": "lemnos-logo.jpg", "url": "//images.contentful.com/rocybtov1ozk/2Y8LhXLnYAYqKCGEWG4EKI/eb29ab3c817906993f65e221523ef252/lemnos-logo.jpg", }, - "id": "c2Y8LhXLnYAYqKCGEWG4EKI___de", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "8059b520a991dbcbb79b36b02a0c4adc", + "contentDigest": "de5f69c2ad1b766ea55089811a23b1cc", "type": "ContentfulAsset", }, "node_locale": "de", @@ -1953,9 +1953,9 @@ Array [ "fileName": "toys_512pxGREY.png", "url": "//images.contentful.com/rocybtov1ozk/6t4HKjytPi0mYgs240wkG/6e730b1e6c2a46929239019240c037e6/toys_512pxGREY.png", }, - "id": "c6t4HKjytPi0mYgs240wkG", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "0b435e081526d3ed9c34ffdeb1878830", + "contentDigest": "537daa7608a39e3e32fdfa2246525470", "type": "ContentfulAsset", }, "node_locale": "en-US", @@ -1979,9 +1979,9 @@ Array [ "fileName": "toys_512pxGREY.png", "url": "//images.contentful.com/rocybtov1ozk/6t4HKjytPi0mYgs240wkG/6e730b1e6c2a46929239019240c037e6/toys_512pxGREY.png", }, - "id": "c6t4HKjytPi0mYgs240wkG___de", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "2bb7aefbcf65c5a6aa4fb8c4dda3a1f6", + "contentDigest": "098fae2420a940db905931a246ad604b", "type": "ContentfulAsset", }, "node_locale": "de", @@ -2005,9 +2005,9 @@ Array [ "fileName": "9ef190c59f0d375c0dea58b58a4bc1f0.jpeg", "url": "//images.contentful.com/rocybtov1ozk/1MgbdJNTsMWKI0W68oYqkU/ad0200fe320b85ecdd823c711161c2f6/9ef190c59f0d375c0dea58b58a4bc1f0.jpeg", }, - "id": "c1MgbdJNTsMWKI0W68oYqkU", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "2fc7b5c0d019022008b9e240d4301368", + "contentDigest": "02c1358b7488cc54050b075fb232deb6", "type": "ContentfulAsset", }, "node_locale": "en-US", @@ -2031,9 +2031,9 @@ Array [ "fileName": "9ef190c59f0d375c0dea58b58a4bc1f0.jpeg", "url": "//images.contentful.com/rocybtov1ozk/1MgbdJNTsMWKI0W68oYqkU/ad0200fe320b85ecdd823c711161c2f6/9ef190c59f0d375c0dea58b58a4bc1f0.jpeg", }, - "id": "c1MgbdJNTsMWKI0W68oYqkU___de", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "e62f5676f867ef422207fa3b86c97477", + "contentDigest": "1216bbfd8bc4352e38e19d9020cf2dec", "type": "ContentfulAsset", }, "node_locale": "de", @@ -2057,9 +2057,9 @@ Array [ "fileName": "1418244847_Streamline-18-256.png", "url": "//images.contentful.com/rocybtov1ozk/6m5AJ9vMPKc8OUoQeoCS4o/e782e3b291ff2b0287546a563af4683c/1418244847_Streamline-18-256.png", }, - "id": "c6m5AJ9vMPKc8OUoQeoCS4o", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "1eac6711bf34fda0014f7b64cb4e8305", + "contentDigest": "770b70ecb7aa0448e53a57486e936759", "type": "ContentfulAsset", }, "node_locale": "en-US", @@ -2083,9 +2083,9 @@ Array [ "fileName": "1418244847_Streamline-18-256.png", "url": "//images.contentful.com/rocybtov1ozk/6m5AJ9vMPKc8OUoQeoCS4o/e782e3b291ff2b0287546a563af4683c/1418244847_Streamline-18-256.png", }, - "id": "c6m5AJ9vMPKc8OUoQeoCS4o___de", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "7755c4dc8506182e8c73a6c96652510f", + "contentDigest": "113034424b490a8af220af7ad1df35bf", "type": "ContentfulAsset", }, "node_locale": "de", @@ -2109,9 +2109,9 @@ Array [ "fileName": "playsam.jpg", "url": "//images.contentful.com/rocybtov1ozk/4zj1ZOfHgQ8oqgaSKm4Qo2/5d967c9c48d67eabff71a9a0232d4378/playsam.jpg", }, - "id": "c4zj1ZOfHgQ8oqgaSKm4Qo2", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "8793690ec8a392934aa605849248b96c", + "contentDigest": "1595f607390fd44c988e4c32641cee57", "type": "ContentfulAsset", }, "node_locale": "en-US", @@ -2135,9 +2135,9 @@ Array [ "fileName": "playsam.jpg", "url": "//images.contentful.com/rocybtov1ozk/4zj1ZOfHgQ8oqgaSKm4Qo2/5d967c9c48d67eabff71a9a0232d4378/playsam.jpg", }, - "id": "c4zj1ZOfHgQ8oqgaSKm4Qo2___de", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "5b4081a6766905a3196dd03f4163b07d", + "contentDigest": "f97d87fcfd9430b4b10f3adf77d4b032", "type": "ContentfulAsset", }, "node_locale": "de", @@ -2161,9 +2161,9 @@ Array [ "fileName": "quwowooybuqbl6ntboz3.jpg", "url": "//images.contentful.com/rocybtov1ozk/wtrHxeu3zEoEce2MokCSi/73dce36715f16e27cf5ff0d2d97d7dff/quwowooybuqbl6ntboz3.jpg", }, - "id": "wtrHxeu3zEoEce2MokCSi", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "8e0e8248efc2587f3d56a912bc123096", + "contentDigest": "7e06912a351f19870f091f4f08265f32", "type": "ContentfulAsset", }, "node_locale": "en-US", @@ -2187,9 +2187,9 @@ Array [ "fileName": "quwowooybuqbl6ntboz3.jpg", "url": "//images.contentful.com/rocybtov1ozk/wtrHxeu3zEoEce2MokCSi/73dce36715f16e27cf5ff0d2d97d7dff/quwowooybuqbl6ntboz3.jpg", }, - "id": "wtrHxeu3zEoEce2MokCSi___de", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "27e23b266ec6dec851d57308a7f4d2f1", + "contentDigest": "358e66348792674fc9a783148bb1a767", "type": "ContentfulAsset", }, "node_locale": "de", @@ -2213,9 +2213,9 @@ Array [ "fileName": "ryugj83mqwa1asojwtwb.jpg", "url": "//images.contentful.com/rocybtov1ozk/10TkaLheGeQG6qQGqWYqUI/f997e8e13c8c83c145e976d0905e64b7/ryugj83mqwa1asojwtwb.jpg", }, - "id": "c10TkaLheGeQG6qQGqWYqUI", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "051bed212b2ea05a3b9a8d6c866c39b8", + "contentDigest": "747af7ae5947fe584f2d78156536f479", "type": "ContentfulAsset", }, "node_locale": "en-US", @@ -2239,9 +2239,9 @@ Array [ "fileName": "ryugj83mqwa1asojwtwb.jpg", "url": "//images.contentful.com/rocybtov1ozk/10TkaLheGeQG6qQGqWYqUI/f997e8e13c8c83c145e976d0905e64b7/ryugj83mqwa1asojwtwb.jpg", }, - "id": "c10TkaLheGeQG6qQGqWYqUI___de", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "9a8b77a18e1b1ec1102c62bb40009ff9", + "contentDigest": "392d3a389d00439e190d0e0355e300d8", "type": "ContentfulAsset", }, "node_locale": "de", @@ -2265,9 +2265,9 @@ Array [ "fileName": "1418244847_Streamline-18-256 (1).png", "url": "//images.contentful.com/rocybtov1ozk/6s3iG2OVmoUcosmA8ocqsG/286ac4c1be74e05d2e7e11bc5a55bc83/1418244847_Streamline-18-256__1_.png", }, - "id": "c6s3iG2OVmoUcosmA8ocqsG", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "06d7aa1fa1b684425c1b7e95f7ee12ed", + "contentDigest": "5a095aac57b7b1993aff95da49dbdc01", "type": "ContentfulAsset", }, "node_locale": "en-US", @@ -2291,9 +2291,9 @@ Array [ "fileName": "1418244847_Streamline-18-256 (1).png", "url": "//images.contentful.com/rocybtov1ozk/6s3iG2OVmoUcosmA8ocqsG/286ac4c1be74e05d2e7e11bc5a55bc83/1418244847_Streamline-18-256__1_.png", }, - "id": "c6s3iG2OVmoUcosmA8ocqsG___de", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "b10953bb1ec80f3eadb9323168fd0294", + "contentDigest": "d9799d32b91186e135d961caf1a49843", "type": "ContentfulAsset", }, "node_locale": "de", @@ -2309,14 +2309,14 @@ Array [ Array [ Object { "children": Array [], - "id": "c7LAnCobuuWYSqks6wAwY2atitleTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Home & Kitchen", "contentDigest": "71520a45fe8b5ecded737e074a6b30a0", "mediaType": "text/markdown", "type": "contentfulCategoryTitleTextNode", }, - "parent": "c7LAnCobuuWYSqks6wAwY2a", + "parent": "uuid-from-gatsby", "title": "Home & Kitchen", }, ], @@ -2324,27 +2324,27 @@ Array [ Object { "categoryDescription": "Shop for furniture, bedding, bath, vacuums, kitchen products, and more", "children": Array [], - "id": "c7LAnCobuuWYSqks6wAwY2acategoryDescriptionTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Shop for furniture, bedding, bath, vacuums, kitchen products, and more", "contentDigest": "24709e2bdb88b89104c215e6b5492bf8", "mediaType": "text/markdown", "type": "contentfulCategoryCategoryDescriptionTextNode", }, - "parent": "c7LAnCobuuWYSqks6wAwY2a", + "parent": "uuid-from-gatsby", }, ], Array [ Object { "children": Array [], - "id": "c24DPGBDeGEaYy8ms4Y8QMQtitleTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Toys", "contentDigest": "66d0af2d5da0109dc2aae67829f7d4d4", "mediaType": "text/markdown", "type": "contentfulCategoryTitleTextNode", }, - "parent": "c24DPGBDeGEaYy8ms4Y8QMQ", + "parent": "uuid-from-gatsby", "title": "Toys", }, ], @@ -2352,14 +2352,14 @@ Array [ Object { "categoryDescription": "Shop for toys, games, educational aids", "children": Array [], - "id": "c24DPGBDeGEaYy8ms4Y8QMQcategoryDescriptionTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Shop for toys, games, educational aids", "contentDigest": "c3cd3eaea58a115e968573664df3a603", "mediaType": "text/markdown", "type": "contentfulCategoryCategoryDescriptionTextNode", }, - "parent": "c24DPGBDeGEaYy8ms4Y8QMQ", + "parent": "uuid-from-gatsby", }, ], Array [ @@ -2367,9 +2367,9 @@ Array [ "children": Array [], "description": null, "displayField": "title", - "id": "Category", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "0418f4c2792c0c223b79211e81387e4d", + "contentDigest": "6020d82d8bb5bd6b1de8a97f6f419053", "type": "ContentfulContentType", }, "name": "Category", @@ -2378,17 +2378,17 @@ Array [ ], Array [ Object { - "categoryDescription___NODE": "c7LAnCobuuWYSqks6wAwY2acategoryDescriptionTextNode", + "categoryDescription___NODE": "uuid-from-gatsby", "children": Array [ - "c7LAnCobuuWYSqks6wAwY2atitleTextNode", - "c7LAnCobuuWYSqks6wAwY2acategoryDescriptionTextNode", + "uuid-from-gatsby", + "uuid-from-gatsby", ], "contentful_id": "c7LAnCobuuWYSqks6wAwY2a", "createdAt": "2017-06-27T09:35:44.000Z", "icon___NODE": "c6m5AJ9vMPKc8OUoQeoCS4o", - "id": "c7LAnCobuuWYSqks6wAwY2a", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "f25b50ae74b21272672bc8e69451ed10", + "contentDigest": "70ed778c8061b0e053e8ea40cee3d70e", "type": "ContentfulCategory", }, "node_locale": "en-US", @@ -2398,23 +2398,23 @@ Array [ "c6dbjWqNd9SqccegcqYq224", "c4BqrajvA8E6qwgkieoqmqO", ], - "title___NODE": "c7LAnCobuuWYSqks6wAwY2atitleTextNode", + "title___NODE": "uuid-from-gatsby", "updatedAt": "2017-06-27T09:55:54.077Z", }, ], Array [ Object { - "categoryDescription___NODE": "c24DPGBDeGEaYy8ms4Y8QMQcategoryDescriptionTextNode", + "categoryDescription___NODE": "uuid-from-gatsby", "children": Array [ - "c24DPGBDeGEaYy8ms4Y8QMQtitleTextNode", - "c24DPGBDeGEaYy8ms4Y8QMQcategoryDescriptionTextNode", + "uuid-from-gatsby", + "uuid-from-gatsby", ], "contentful_id": "c24DPGBDeGEaYy8ms4Y8QMQ", "createdAt": "2017-06-27T09:35:44.992Z", "icon___NODE": "c6t4HKjytPi0mYgs240wkG", - "id": "c24DPGBDeGEaYy8ms4Y8QMQ", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "1c3fd384800248971b9eb86de72b29bf", + "contentDigest": "583c91e9ba31685e895cbfd85251075b", "type": "ContentfulCategory", }, "node_locale": "en-US", @@ -2422,21 +2422,21 @@ Array [ "product___NODE": Array [ "c5KsDBWseXY6QegucYAoacS", ], - "title___NODE": "c24DPGBDeGEaYy8ms4Y8QMQtitleTextNode", + "title___NODE": "uuid-from-gatsby", "updatedAt": "2017-06-27T09:46:43.477Z", }, ], Array [ Object { "children": Array [], - "id": "c7LAnCobuuWYSqks6wAwY2a___detitleTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Haus & Küche", "contentDigest": "21786d8d63d043d9cc0f639450bd5b70", "mediaType": "text/markdown", "type": "contentfulCategoryTitleTextNode", }, - "parent": "c7LAnCobuuWYSqks6wAwY2a___de", + "parent": "uuid-from-gatsby", "title": "Haus & Küche", }, ], @@ -2444,27 +2444,27 @@ Array [ Object { "categoryDescription": "Shop für Möbel, Bettwäsche, Bad, Staubsauger, Küchenprodukte und vieles mehr", "children": Array [], - "id": "c7LAnCobuuWYSqks6wAwY2a___decategoryDescriptionTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Shop für Möbel, Bettwäsche, Bad, Staubsauger, Küchenprodukte und vieles mehr", "contentDigest": "7d7b0c68e20954c3f092bae55ccbdd9f", "mediaType": "text/markdown", "type": "contentfulCategoryCategoryDescriptionTextNode", }, - "parent": "c7LAnCobuuWYSqks6wAwY2a___de", + "parent": "uuid-from-gatsby", }, ], Array [ Object { "children": Array [], - "id": "c24DPGBDeGEaYy8ms4Y8QMQ___detitleTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Spielzeug", "contentDigest": "22658c0cbfd038b32380aa036bff1cfe", "mediaType": "text/markdown", "type": "contentfulCategoryTitleTextNode", }, - "parent": "c24DPGBDeGEaYy8ms4Y8QMQ___de", + "parent": "uuid-from-gatsby", "title": "Spielzeug", }, ], @@ -2472,14 +2472,14 @@ Array [ Object { "categoryDescription": "Spielzeugladen, Spiele, Lernhilfen", "children": Array [], - "id": "c24DPGBDeGEaYy8ms4Y8QMQ___decategoryDescriptionTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Spielzeugladen, Spiele, Lernhilfen", "contentDigest": "93335f47e41d44163239227427760695", "mediaType": "text/markdown", "type": "contentfulCategoryCategoryDescriptionTextNode", }, - "parent": "c24DPGBDeGEaYy8ms4Y8QMQ___de", + "parent": "uuid-from-gatsby", }, ], Array [ @@ -2487,9 +2487,9 @@ Array [ "children": Array [], "description": null, "displayField": "title", - "id": "Category", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "0418f4c2792c0c223b79211e81387e4d", + "contentDigest": "6020d82d8bb5bd6b1de8a97f6f419053", "type": "ContentfulContentType", }, "name": "Category", @@ -2498,17 +2498,17 @@ Array [ ], Array [ Object { - "categoryDescription___NODE": "c7LAnCobuuWYSqks6wAwY2a___decategoryDescriptionTextNode", + "categoryDescription___NODE": "uuid-from-gatsby", "children": Array [ - "c7LAnCobuuWYSqks6wAwY2a___detitleTextNode", - "c7LAnCobuuWYSqks6wAwY2a___decategoryDescriptionTextNode", + "uuid-from-gatsby", + "uuid-from-gatsby", ], "contentful_id": "c7LAnCobuuWYSqks6wAwY2a", "createdAt": "2017-06-27T09:35:44.000Z", "icon___NODE": "c6m5AJ9vMPKc8OUoQeoCS4o___de", - "id": "c7LAnCobuuWYSqks6wAwY2a___de", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "7ff9c12177f67e9ba53cb9e004ce801c", + "contentDigest": "0ee50cca80ec2eb434ac353354be9c28", "type": "ContentfulCategory", }, "node_locale": "de", @@ -2518,23 +2518,23 @@ Array [ "c6dbjWqNd9SqccegcqYq224___de", "c4BqrajvA8E6qwgkieoqmqO___de", ], - "title___NODE": "c7LAnCobuuWYSqks6wAwY2a___detitleTextNode", + "title___NODE": "uuid-from-gatsby", "updatedAt": "2017-06-27T09:55:54.077Z", }, ], Array [ Object { - "categoryDescription___NODE": "c24DPGBDeGEaYy8ms4Y8QMQ___decategoryDescriptionTextNode", + "categoryDescription___NODE": "uuid-from-gatsby", "children": Array [ - "c24DPGBDeGEaYy8ms4Y8QMQ___detitleTextNode", - "c24DPGBDeGEaYy8ms4Y8QMQ___decategoryDescriptionTextNode", + "uuid-from-gatsby", + "uuid-from-gatsby", ], "contentful_id": "c24DPGBDeGEaYy8ms4Y8QMQ", "createdAt": "2017-06-27T09:35:44.992Z", "icon___NODE": "c6t4HKjytPi0mYgs240wkG___de", - "id": "c24DPGBDeGEaYy8ms4Y8QMQ___de", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "53d4c8acc021af0881ed87a68eff3b90", + "contentDigest": "756361222b0ab3e6d36768d22cfff0bc", "type": "ContentfulCategory", }, "node_locale": "de", @@ -2542,7 +2542,7 @@ Array [ "product___NODE": Array [ "c5KsDBWseXY6QegucYAoacS___de", ], - "title___NODE": "c24DPGBDeGEaYy8ms4Y8QMQ___detitleTextNode", + "title___NODE": "uuid-from-gatsby", "updatedAt": "2017-06-27T09:46:43.477Z", }, ], @@ -2550,42 +2550,42 @@ Array [ Object { "children": Array [], "companyName": "Normann Copenhagen", - "id": "c651CQ8rLoIYCeY6G0QG22qcompanyNameTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Normann Copenhagen", "contentDigest": "5fb9d019c3646f6fee84172952337463", "mediaType": "text/markdown", "type": "contentfulBrandCompanyNameTextNode", }, - "parent": "c651CQ8rLoIYCeY6G0QG22q", + "parent": "uuid-from-gatsby", }, ], Array [ Object { "children": Array [], "companyDescription": "Normann Copenhagen is a way of living - a mindset. We love to challenge the conventional design rules. This is why you will find traditional materials put into untraditional use such as a Stone Hook made of Icelandic stones, a vase made out of silicon and last but not least a dog made out of plastic.", - "id": "c651CQ8rLoIYCeY6G0QG22qcompanyDescriptionTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Normann Copenhagen is a way of living - a mindset. We love to challenge the conventional design rules. This is why you will find traditional materials put into untraditional use such as a Stone Hook made of Icelandic stones, a vase made out of silicon and last but not least a dog made out of plastic.", "contentDigest": "8010f6e93f3a7dbca56c041a46d4ab77", "mediaType": "text/markdown", "type": "contentfulBrandCompanyDescriptionTextNode", }, - "parent": "c651CQ8rLoIYCeY6G0QG22q", + "parent": "uuid-from-gatsby", }, ], Array [ Object { "children": Array [], "companyName": "Lemnos", - "id": "c4LgMotpNF6W20YKmuemW0acompanyNameTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Lemnos", "contentDigest": "7b0e3f7cc613d34aafa689516e96056e", "mediaType": "text/markdown", "type": "contentfulBrandCompanyNameTextNode", }, - "parent": "c4LgMotpNF6W20YKmuemW0a", + "parent": "uuid-from-gatsby", }, ], Array [ @@ -2602,7 +2602,7 @@ Lemnos brand products are now highly praised from the design shops and the inter In recent years, we also have been given high priority to develop interior accessories making full use of our traditional techniques by the founding manufacturer and we always focus our minds on the development for the new Lemnos products in the new market. Our Lemnos products are made carefully by our craftsmen finely honed skillful techniques in Japan. They surely bring out the attractiveness of the materials to the maximum and create fine products not being influenced on the fashion trend accordingly. TAKATA Lemnos Inc. definitely would like to be innovative and continuously propose the beauty lasts forever.", - "id": "c4LgMotpNF6W20YKmuemW0acompanyDescriptionTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "TAKATA Lemnos Inc. was founded in 1947 as a brass casting manufacturing industry in Takaoka-city, Toyama Prefecture, Japan and we launched out into the full-scale business trade with Seiko Clock Co., Ltd. since 1966. @@ -2619,35 +2619,35 @@ Our Lemnos products are made carefully by our craftsmen finely honed skillful te "mediaType": "text/markdown", "type": "contentfulBrandCompanyDescriptionTextNode", }, - "parent": "c4LgMotpNF6W20YKmuemW0a", + "parent": "uuid-from-gatsby", }, ], Array [ Object { "children": Array [], "companyName": "Playsam", - "id": "JrePkDVYomE8AwcuCUyMicompanyNameTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Playsam", "contentDigest": "1d2de5c3096635ca01f6ab4131252039", "mediaType": "text/markdown", "type": "contentfulBrandCompanyNameTextNode", }, - "parent": "JrePkDVYomE8AwcuCUyMi", + "parent": "uuid-from-gatsby", }, ], Array [ Object { "children": Array [], "companyDescription": "Playsam is the leading Scandinavian design company for executive wooden toy gift. Scandinavian design playful creativity, integrity and sophistication are Playsam. Scandinavian design and wooden toy makes Playsam gift lovely to the world of design since 1984.", - "id": "JrePkDVYomE8AwcuCUyMicompanyDescriptionTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Playsam is the leading Scandinavian design company for executive wooden toy gift. Scandinavian design playful creativity, integrity and sophistication are Playsam. Scandinavian design and wooden toy makes Playsam gift lovely to the world of design since 1984.", "contentDigest": "f27a71b7f2ee9eabad3335e0c03da951", "mediaType": "text/markdown", "type": "contentfulBrandCompanyDescriptionTextNode", }, - "parent": "JrePkDVYomE8AwcuCUyMi", + "parent": "uuid-from-gatsby", }, ], Array [ @@ -2655,9 +2655,9 @@ Our Lemnos products are made carefully by our craftsmen finely honed skillful te "children": Array [], "description": null, "displayField": "companyName", - "id": "Brand", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "b7cc6c33f996216ec368e79794f50089", + "contentDigest": "523655fd0d90116babdcba9c139672a3", "type": "ContentfulContentType", }, "name": "Brand", @@ -2667,17 +2667,17 @@ Our Lemnos products are made carefully by our craftsmen finely honed skillful te Array [ Object { "children": Array [ - "c651CQ8rLoIYCeY6G0QG22qcompanyNameTextNode", - "c651CQ8rLoIYCeY6G0QG22qcompanyDescriptionTextNode", + "uuid-from-gatsby", + "uuid-from-gatsby", ], - "companyDescription___NODE": "c651CQ8rLoIYCeY6G0QG22qcompanyDescriptionTextNode", - "companyName___NODE": "c651CQ8rLoIYCeY6G0QG22qcompanyNameTextNode", + "companyDescription___NODE": "uuid-from-gatsby", + "companyName___NODE": "uuid-from-gatsby", "contentful_id": "c651CQ8rLoIYCeY6G0QG22q", "createdAt": "2017-06-27T09:35:43.997Z", "email": "normann@normann-copenhagen.com", - "id": "c651CQ8rLoIYCeY6G0QG22q", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "33003756b0e136bea7bad2d285674955", + "contentDigest": "157642db057a5cc5dbede7e114ef78dc", "type": "ContentfulBrand", }, "logo___NODE": "c3wtvPBbBjiMKqKKga8I2Cu", @@ -2698,17 +2698,17 @@ Our Lemnos products are made carefully by our craftsmen finely honed skillful te Array [ Object { "children": Array [ - "c4LgMotpNF6W20YKmuemW0acompanyNameTextNode", - "c4LgMotpNF6W20YKmuemW0acompanyDescriptionTextNode", + "uuid-from-gatsby", + "uuid-from-gatsby", ], - "companyDescription___NODE": "c4LgMotpNF6W20YKmuemW0acompanyDescriptionTextNode", - "companyName___NODE": "c4LgMotpNF6W20YKmuemW0acompanyNameTextNode", + "companyDescription___NODE": "uuid-from-gatsby", + "companyName___NODE": "uuid-from-gatsby", "contentful_id": "c4LgMotpNF6W20YKmuemW0a", "createdAt": "2017-06-27T09:35:44.396Z", "email": "info@acgears.com", - "id": "c4LgMotpNF6W20YKmuemW0a", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "8afe547f426969e90179544a9efd898f", + "contentDigest": "86a22e3a2f4013931de088daa4c40780", "type": "ContentfulBrand", }, "logo___NODE": "c2Y8LhXLnYAYqKCGEWG4EKI", @@ -2727,16 +2727,16 @@ Our Lemnos products are made carefully by our craftsmen finely honed skillful te Array [ Object { "children": Array [ - "JrePkDVYomE8AwcuCUyMicompanyNameTextNode", - "JrePkDVYomE8AwcuCUyMicompanyDescriptionTextNode", + "uuid-from-gatsby", + "uuid-from-gatsby", ], - "companyDescription___NODE": "JrePkDVYomE8AwcuCUyMicompanyDescriptionTextNode", - "companyName___NODE": "JrePkDVYomE8AwcuCUyMicompanyNameTextNode", + "companyDescription___NODE": "uuid-from-gatsby", + "companyName___NODE": "uuid-from-gatsby", "contentful_id": "JrePkDVYomE8AwcuCUyMi", "createdAt": "2017-06-27T09:35:44.988Z", - "id": "JrePkDVYomE8AwcuCUyMi", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "3fb01453150940e20bb9f89531c1fb0a", + "contentDigest": "f155acb4a3187d50c2237874fde8ca89", "type": "ContentfulBrand", }, "logo___NODE": "c4zj1ZOfHgQ8oqgaSKm4Qo2", @@ -2753,42 +2753,42 @@ Our Lemnos products are made carefully by our craftsmen finely honed skillful te Object { "children": Array [], "companyName": "Normann Copenhagen", - "id": "c651CQ8rLoIYCeY6G0QG22q___decompanyNameTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Normann Copenhagen", "contentDigest": "5fb9d019c3646f6fee84172952337463", "mediaType": "text/markdown", "type": "contentfulBrandCompanyNameTextNode", }, - "parent": "c651CQ8rLoIYCeY6G0QG22q___de", + "parent": "uuid-from-gatsby", }, ], Array [ Object { "children": Array [], "companyDescription": "Normann Kopenhagen ist eine Art zu leben - eine Denkweise. Wir lieben es, die konventionellen Designregeln herauszufordern. Aus diesem Grund finden Sie traditionelle Materialien, die in untraditionelle Verwendung wie ein Steinhaken aus isländischen Steinen, eine Vase aus Silizium und last but not least ein Hund aus Kunststoff.", - "id": "c651CQ8rLoIYCeY6G0QG22q___decompanyDescriptionTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Normann Kopenhagen ist eine Art zu leben - eine Denkweise. Wir lieben es, die konventionellen Designregeln herauszufordern. Aus diesem Grund finden Sie traditionelle Materialien, die in untraditionelle Verwendung wie ein Steinhaken aus isländischen Steinen, eine Vase aus Silizium und last but not least ein Hund aus Kunststoff.", "contentDigest": "0a7c7553a38bb0a62a22c20deb99a93f", "mediaType": "text/markdown", "type": "contentfulBrandCompanyDescriptionTextNode", }, - "parent": "c651CQ8rLoIYCeY6G0QG22q___de", + "parent": "uuid-from-gatsby", }, ], Array [ Object { "children": Array [], "companyName": "Lemnos", - "id": "c4LgMotpNF6W20YKmuemW0a___decompanyNameTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Lemnos", "contentDigest": "7b0e3f7cc613d34aafa689516e96056e", "mediaType": "text/markdown", "type": "contentfulBrandCompanyNameTextNode", }, - "parent": "c4LgMotpNF6W20YKmuemW0a___de", + "parent": "uuid-from-gatsby", }, ], Array [ @@ -2805,7 +2805,7 @@ Lemnos Markenprodukte werden nun von den Designläden und den Innenhandelsgesch In den vergangenen Jahren haben wir auch eine hohe Priorität für die Entwicklung von Innenausstattung, die den traditionellen Techniken des Gründungsherstellers voll ausnutzt, und wir konzentrieren uns immer auf die Entwicklung der neuen Lemnos-Produkte im neuen Markt. Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliffen geschickten Techniken in Japan gemacht. Sie bringen sicherlich die Attraktivität der Materialien auf das Maximum und schaffen feine Produkte nicht beeinflusst auf die Mode-Trend entsprechend. TAKATA Lemnos Inc. möchte definitiv innovativ sein und ständig vorschlagen, die Schönheit dauert ewig.", - "id": "c4LgMotpNF6W20YKmuemW0a___decompanyDescriptionTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "TAKATA Lemnos Inc. wurde im Jahre 1947 als Messing-Casting-Fertigungsindustrie in Takaoka-Stadt, Toyama Prefecture, Japan gegründet und wir starteten seit 1966 mit der Seiko Clock Co., Ltd. @@ -2822,35 +2822,35 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff "mediaType": "text/markdown", "type": "contentfulBrandCompanyDescriptionTextNode", }, - "parent": "c4LgMotpNF6W20YKmuemW0a___de", + "parent": "uuid-from-gatsby", }, ], Array [ Object { "children": Array [], "companyName": "Playsam", - "id": "JrePkDVYomE8AwcuCUyMi___decompanyNameTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Playsam", "contentDigest": "1d2de5c3096635ca01f6ab4131252039", "mediaType": "text/markdown", "type": "contentfulBrandCompanyNameTextNode", }, - "parent": "JrePkDVYomE8AwcuCUyMi___de", + "parent": "uuid-from-gatsby", }, ], Array [ Object { "children": Array [], "companyDescription": "Playsam ist die führende skandinavische Designfirma für Executive Holzspielzeug Geschenk. Skandinavisches Design spielerische Kreativität, Integrität und Raffinesse sind Playsam. Skandinavisches Design und hölzernes Spielzeug macht Playsam Geschenk schön in die Welt des Designs seit 1984.", - "id": "JrePkDVYomE8AwcuCUyMi___decompanyDescriptionTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Playsam ist die führende skandinavische Designfirma für Executive Holzspielzeug Geschenk. Skandinavisches Design spielerische Kreativität, Integrität und Raffinesse sind Playsam. Skandinavisches Design und hölzernes Spielzeug macht Playsam Geschenk schön in die Welt des Designs seit 1984.", "contentDigest": "7b0a48d4861111805b6c614bf2373eb6", "mediaType": "text/markdown", "type": "contentfulBrandCompanyDescriptionTextNode", }, - "parent": "JrePkDVYomE8AwcuCUyMi___de", + "parent": "uuid-from-gatsby", }, ], Array [ @@ -2858,9 +2858,9 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff "children": Array [], "description": null, "displayField": "companyName", - "id": "Brand", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "b7cc6c33f996216ec368e79794f50089", + "contentDigest": "523655fd0d90116babdcba9c139672a3", "type": "ContentfulContentType", }, "name": "Brand", @@ -2870,17 +2870,17 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff Array [ Object { "children": Array [ - "c651CQ8rLoIYCeY6G0QG22q___decompanyNameTextNode", - "c651CQ8rLoIYCeY6G0QG22q___decompanyDescriptionTextNode", + "uuid-from-gatsby", + "uuid-from-gatsby", ], - "companyDescription___NODE": "c651CQ8rLoIYCeY6G0QG22q___decompanyDescriptionTextNode", - "companyName___NODE": "c651CQ8rLoIYCeY6G0QG22q___decompanyNameTextNode", + "companyDescription___NODE": "uuid-from-gatsby", + "companyName___NODE": "uuid-from-gatsby", "contentful_id": "c651CQ8rLoIYCeY6G0QG22q", "createdAt": "2017-06-27T09:35:43.997Z", "email": "normann@normann-copenhagen.com", - "id": "c651CQ8rLoIYCeY6G0QG22q___de", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "baf5e423dabeead5532370454b2d39bc", + "contentDigest": "739860046fe5d455822acf2776a0f7c9", "type": "ContentfulBrand", }, "logo___NODE": "c3wtvPBbBjiMKqKKga8I2Cu___de", @@ -2901,17 +2901,17 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff Array [ Object { "children": Array [ - "c4LgMotpNF6W20YKmuemW0a___decompanyNameTextNode", - "c4LgMotpNF6W20YKmuemW0a___decompanyDescriptionTextNode", + "uuid-from-gatsby", + "uuid-from-gatsby", ], - "companyDescription___NODE": "c4LgMotpNF6W20YKmuemW0a___decompanyDescriptionTextNode", - "companyName___NODE": "c4LgMotpNF6W20YKmuemW0a___decompanyNameTextNode", + "companyDescription___NODE": "uuid-from-gatsby", + "companyName___NODE": "uuid-from-gatsby", "contentful_id": "c4LgMotpNF6W20YKmuemW0a", "createdAt": "2017-06-27T09:35:44.396Z", "email": "info@acgears.com", - "id": "c4LgMotpNF6W20YKmuemW0a___de", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "8b11aee89e9d8e6ae944cc75e8c945df", + "contentDigest": "24b35e7fd3f223d355e58059a174894a", "type": "ContentfulBrand", }, "logo___NODE": "c2Y8LhXLnYAYqKCGEWG4EKI___de", @@ -2930,16 +2930,16 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff Array [ Object { "children": Array [ - "JrePkDVYomE8AwcuCUyMi___decompanyNameTextNode", - "JrePkDVYomE8AwcuCUyMi___decompanyDescriptionTextNode", + "uuid-from-gatsby", + "uuid-from-gatsby", ], - "companyDescription___NODE": "JrePkDVYomE8AwcuCUyMi___decompanyDescriptionTextNode", - "companyName___NODE": "JrePkDVYomE8AwcuCUyMi___decompanyNameTextNode", + "companyDescription___NODE": "uuid-from-gatsby", + "companyName___NODE": "uuid-from-gatsby", "contentful_id": "JrePkDVYomE8AwcuCUyMi", "createdAt": "2017-06-27T09:35:44.988Z", - "id": "JrePkDVYomE8AwcuCUyMi___de", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "3a6348c64ef4ef4323ec1d450ba8ba90", + "contentDigest": "5c4a23a65282e04eebc6a97acc979214", "type": "ContentfulBrand", }, "logo___NODE": "c4zj1ZOfHgQ8oqgaSKm4Qo2___de", @@ -2955,112 +2955,112 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff Array [ Object { "children": Array [], - "id": "c5KsDBWseXY6QegucYAoacSproductNameTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Playsam Streamliner Classic Car, Espresso", "contentDigest": "fb5febcf7ce227772c3998af60b6e740", "mediaType": "text/markdown", "type": "contentfulProductProductNameTextNode", }, - "parent": "c5KsDBWseXY6QegucYAoacS", + "parent": "uuid-from-gatsby", "productName": "Playsam Streamliner Classic Car, Espresso", }, ], Array [ Object { "children": Array [], - "id": "c5KsDBWseXY6QegucYAoacSproductDescriptionTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "A classic Playsam design, the Streamliner Classic Car has been selected as Swedish Design Classic by the Swedish National Museum for its inventive style and sleek surface. It's no wonder that this wooden car has also been a long-standing favorite for children both big and small!", "contentDigest": "d27a98d8abd9865c279017aed14f2766", "mediaType": "text/markdown", "type": "contentfulProductProductDescriptionTextNode", }, - "parent": "c5KsDBWseXY6QegucYAoacS", + "parent": "uuid-from-gatsby", "productDescription": "A classic Playsam design, the Streamliner Classic Car has been selected as Swedish Design Classic by the Swedish National Museum for its inventive style and sleek surface. It's no wonder that this wooden car has also been a long-standing favorite for children both big and small!", }, ], Array [ Object { "children": Array [], - "id": "c3DVqIYj4dOwwcKu6sgqOggproductNameTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Hudson Wall Cup", "contentDigest": "927daa584fb961e59edbd07f921b916c", "mediaType": "text/markdown", "type": "contentfulProductProductNameTextNode", }, - "parent": "c3DVqIYj4dOwwcKu6sgqOgg", + "parent": "uuid-from-gatsby", "productName": "Hudson Wall Cup", }, ], Array [ Object { "children": Array [], - "id": "c3DVqIYj4dOwwcKu6sgqOggproductDescriptionTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Wall Hanging Glass Flower Vase and Terrarium", "contentDigest": "da605021a35b1da89c6810fb46275a58", "mediaType": "text/markdown", "type": "contentfulProductProductDescriptionTextNode", }, - "parent": "c3DVqIYj4dOwwcKu6sgqOgg", + "parent": "uuid-from-gatsby", "productDescription": "Wall Hanging Glass Flower Vase and Terrarium", }, ], Array [ Object { "children": Array [], - "id": "c6dbjWqNd9SqccegcqYq224productNameTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Whisk Beater", "contentDigest": "bfab59c3dba2ca3c2fce106049470741", "mediaType": "text/markdown", "type": "contentfulProductProductNameTextNode", }, - "parent": "c6dbjWqNd9SqccegcqYq224", + "parent": "uuid-from-gatsby", "productName": "Whisk Beater", }, ], Array [ Object { "children": Array [], - "id": "c6dbjWqNd9SqccegcqYq224productDescriptionTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "A creative little whisk that comes in 8 different colors. Handy and easy to clean after use. A great gift idea.", "contentDigest": "223b5836966aa0ab2c43a9a870e7a631", "mediaType": "text/markdown", "type": "contentfulProductProductDescriptionTextNode", }, - "parent": "c6dbjWqNd9SqccegcqYq224", + "parent": "uuid-from-gatsby", "productDescription": "A creative little whisk that comes in 8 different colors. Handy and easy to clean after use. A great gift idea.", }, ], Array [ Object { "children": Array [], - "id": "c4BqrajvA8E6qwgkieoqmqOproductNameTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "SoSo Wall Clock", "contentDigest": "2bd6c9f1667f2fbb59343e203cb0b7bf", "mediaType": "text/markdown", "type": "contentfulProductProductNameTextNode", }, - "parent": "c4BqrajvA8E6qwgkieoqmqO", + "parent": "uuid-from-gatsby", "productName": "SoSo Wall Clock", }, ], Array [ Object { "children": Array [], - "id": "c4BqrajvA8E6qwgkieoqmqOproductDescriptionTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "The newly released SoSo Clock from Lemnos marries simple, clean design and bold, striking features. Its saturated marigold face is a lively pop of color to white or grey walls, but would also pair nicely with navy and maroon. Where most clocks feature numbers at the border of the clock, the SoSo brings them in tight to the middle, leaving a wide space between the numbers and the slight frame. The hour hand provides a nice interruption to the black and yellow of the clock - it is featured in a brilliant white. Despite its bold color and contrast, the SoSo maintains a clean, pure aesthetic that is suitable to a variety of contemporary interiors.", "contentDigest": "c5b4a61c6d533216a0efe0d4ee66c98b", "mediaType": "text/markdown", "type": "contentfulProductProductDescriptionTextNode", }, - "parent": "c4BqrajvA8E6qwgkieoqmqO", + "parent": "uuid-from-gatsby", "productDescription": "The newly released SoSo Clock from Lemnos marries simple, clean design and bold, striking features. Its saturated marigold face is a lively pop of color to white or grey walls, but would also pair nicely with navy and maroon. Where most clocks feature numbers at the border of the clock, the SoSo brings them in tight to the middle, leaving a wide space between the numbers and the slight frame. The hour hand provides a nice interruption to the black and yellow of the clock - it is featured in a brilliant white. Despite its bold color and contrast, the SoSo maintains a clean, pure aesthetic that is suitable to a variety of contemporary interiors.", }, ], @@ -3069,9 +3069,9 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff "children": Array [], "description": null, "displayField": "productName", - "id": "Product", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "d9822da16231c6bd9df08d882174266f", + "contentDigest": "043cf76e7aedca253d7f91e366d103d5", "type": "ContentfulContentType", }, "name": "Product", @@ -3085,24 +3085,24 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff "c24DPGBDeGEaYy8ms4Y8QMQ", ], "children": Array [ - "c5KsDBWseXY6QegucYAoacSproductNameTextNode", - "c5KsDBWseXY6QegucYAoacSproductDescriptionTextNode", + "uuid-from-gatsby", + "uuid-from-gatsby", ], "contentful_id": "c5KsDBWseXY6QegucYAoacS", "createdAt": "2017-06-27T09:35:43.996Z", - "id": "c5KsDBWseXY6QegucYAoacS", + "id": "uuid-from-gatsby", "image___NODE": Array [ "wtrHxeu3zEoEce2MokCSi", ], "internal": Object { - "contentDigest": "811e659fd89545c316022b6786c57cf1", + "contentDigest": "7b45563cb7c70ef154ed7f7033edef9c", "type": "ContentfulProduct", }, "node_locale": "en-US", "parent": "Product", "price": 44, - "productDescription___NODE": "c5KsDBWseXY6QegucYAoacSproductDescriptionTextNode", - "productName___NODE": "c5KsDBWseXY6QegucYAoacSproductNameTextNode", + "productDescription___NODE": "uuid-from-gatsby", + "productName___NODE": "uuid-from-gatsby", "quantity": 56, "sizetypecolor": "Length: 135 mm | color: espresso, green, or icar (white)", "sku": "B001R6JUZ2", @@ -3125,24 +3125,24 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff "c7LAnCobuuWYSqks6wAwY2a", ], "children": Array [ - "c3DVqIYj4dOwwcKu6sgqOggproductNameTextNode", - "c3DVqIYj4dOwwcKu6sgqOggproductDescriptionTextNode", + "uuid-from-gatsby", + "uuid-from-gatsby", ], "contentful_id": "c3DVqIYj4dOwwcKu6sgqOgg", "createdAt": "2017-06-27T09:35:44.006Z", - "id": "c3DVqIYj4dOwwcKu6sgqOgg", + "id": "uuid-from-gatsby", "image___NODE": Array [ "Xc0ny7GWsMEMCeASWO2um", ], "internal": Object { - "contentDigest": "03c09c75fe1ff510e235d058c63a3c86", + "contentDigest": "537c668188de4369b36705f0604f8b8f", "type": "ContentfulProduct", }, "node_locale": "en-US", "parent": "Product", "price": 11, - "productDescription___NODE": "c3DVqIYj4dOwwcKu6sgqOggproductDescriptionTextNode", - "productName___NODE": "c3DVqIYj4dOwwcKu6sgqOggproductNameTextNode", + "productDescription___NODE": "uuid-from-gatsby", + "productName___NODE": "uuid-from-gatsby", "quantity": 101, "sizetypecolor": "3 x 3 x 5 inches; 5.3 ounces", "sku": "B00E82D7I8", @@ -3163,24 +3163,24 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff "c7LAnCobuuWYSqks6wAwY2a", ], "children": Array [ - "c6dbjWqNd9SqccegcqYq224productNameTextNode", - "c6dbjWqNd9SqccegcqYq224productDescriptionTextNode", + "uuid-from-gatsby", + "uuid-from-gatsby", ], "contentful_id": "c6dbjWqNd9SqccegcqYq224", "createdAt": "2017-06-27T09:35:44.049Z", - "id": "c6dbjWqNd9SqccegcqYq224", + "id": "uuid-from-gatsby", "image___NODE": Array [ "c10TkaLheGeQG6qQGqWYqUI", ], "internal": Object { - "contentDigest": "7bda89b49c1a548ac2b619432d4a676b", + "contentDigest": "a2db03f92d60a2a0fec1526599974ea1", "type": "ContentfulProduct", }, "node_locale": "en-US", "parent": "Product", "price": 22, - "productDescription___NODE": "c6dbjWqNd9SqccegcqYq224productDescriptionTextNode", - "productName___NODE": "c6dbjWqNd9SqccegcqYq224productNameTextNode", + "productDescription___NODE": "uuid-from-gatsby", + "productName___NODE": "uuid-from-gatsby", "quantity": 89, "sizetypecolor": "0.8 x 0.8 x 11.2 inches; 1.6 ounces", "sku": "B0081F2CCK", @@ -3203,24 +3203,24 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff "c7LAnCobuuWYSqks6wAwY2a", ], "children": Array [ - "c4BqrajvA8E6qwgkieoqmqOproductNameTextNode", - "c4BqrajvA8E6qwgkieoqmqOproductDescriptionTextNode", + "uuid-from-gatsby", + "uuid-from-gatsby", ], "contentful_id": "c4BqrajvA8E6qwgkieoqmqO", "createdAt": "2017-06-27T09:35:44.130Z", - "id": "c4BqrajvA8E6qwgkieoqmqO", + "id": "uuid-from-gatsby", "image___NODE": Array [ "KTRF62Q4gg60q6WCsWKw8", ], "internal": Object { - "contentDigest": "7622bc6f381b1a91955aab7f0343a1a0", + "contentDigest": "23da92eff501bf39fddc9a54a3b0b3d1", "type": "ContentfulProduct", }, "node_locale": "en-US", "parent": "Product", "price": 120, - "productDescription___NODE": "c4BqrajvA8E6qwgkieoqmqOproductDescriptionTextNode", - "productName___NODE": "c4BqrajvA8E6qwgkieoqmqOproductNameTextNode", + "productDescription___NODE": "uuid-from-gatsby", + "productName___NODE": "uuid-from-gatsby", "quantity": 3, "sizetypecolor": "10\\" x 2.2\\"", "sku": "B00MG4ULK2", @@ -3239,112 +3239,112 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff Array [ Object { "children": Array [], - "id": "c5KsDBWseXY6QegucYAoacS___deproductNameTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Playsam Streamliner Klassisches Auto, Espresso", "contentDigest": "7f76178eaaeb38fc20570d0c6eb49c3e", "mediaType": "text/markdown", "type": "contentfulProductProductNameTextNode", }, - "parent": "c5KsDBWseXY6QegucYAoacS___de", + "parent": "uuid-from-gatsby", "productName": "Playsam Streamliner Klassisches Auto, Espresso", }, ], Array [ Object { "children": Array [], - "id": "c5KsDBWseXY6QegucYAoacS___deproductDescriptionTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Ein klassisches Playsam-Design, das Streamliner Classic Car wurde als Swedish Design Classic vom Schwedischen Nationalmuseum für seinen erfinderischen Stil und seine schlanke Oberfläche ausgewählt. Es ist kein Wunder, dass dieses hölzerne Auto auch ein langjähriger Liebling für Kinder gewesen ist, die groß und klein sind!", "contentDigest": "85779a170b2fe2458d707b34459d4085", "mediaType": "text/markdown", "type": "contentfulProductProductDescriptionTextNode", }, - "parent": "c5KsDBWseXY6QegucYAoacS___de", + "parent": "uuid-from-gatsby", "productDescription": "Ein klassisches Playsam-Design, das Streamliner Classic Car wurde als Swedish Design Classic vom Schwedischen Nationalmuseum für seinen erfinderischen Stil und seine schlanke Oberfläche ausgewählt. Es ist kein Wunder, dass dieses hölzerne Auto auch ein langjähriger Liebling für Kinder gewesen ist, die groß und klein sind!", }, ], Array [ Object { "children": Array [], - "id": "c3DVqIYj4dOwwcKu6sgqOgg___deproductNameTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Becher", "contentDigest": "aac31ab0dcf429f1be1d2764db549f43", "mediaType": "text/markdown", "type": "contentfulProductProductNameTextNode", }, - "parent": "c3DVqIYj4dOwwcKu6sgqOgg___de", + "parent": "uuid-from-gatsby", "productName": "Becher", }, ], Array [ Object { "children": Array [], - "id": "c3DVqIYj4dOwwcKu6sgqOgg___deproductDescriptionTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Wand-hängende Glas-Blumen-Vase und Terrarium", "contentDigest": "41d1166dbe8f8af2f8f2bad50fe42f03", "mediaType": "text/markdown", "type": "contentfulProductProductDescriptionTextNode", }, - "parent": "c3DVqIYj4dOwwcKu6sgqOgg___de", + "parent": "uuid-from-gatsby", "productDescription": "Wand-hängende Glas-Blumen-Vase und Terrarium", }, ], Array [ Object { "children": Array [], - "id": "c6dbjWqNd9SqccegcqYq224___deproductNameTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Schneebesen", "contentDigest": "811253206ba751ed27cf3ceb68e334dc", "mediaType": "text/markdown", "type": "contentfulProductProductNameTextNode", }, - "parent": "c6dbjWqNd9SqccegcqYq224___de", + "parent": "uuid-from-gatsby", "productName": "Schneebesen", }, ], Array [ Object { "children": Array [], - "id": "c6dbjWqNd9SqccegcqYq224___deproductDescriptionTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Ein kreativer kleiner Schneebesen, der in 8 verschiedenen Farben kommt. Praktisch und nach dem Gebrauch leicht zu reinigen. Eine tolle Geschenkidee.", "contentDigest": "d0793a3c142dc3f7377edd6625091cb7", "mediaType": "text/markdown", "type": "contentfulProductProductDescriptionTextNode", }, - "parent": "c6dbjWqNd9SqccegcqYq224___de", + "parent": "uuid-from-gatsby", "productDescription": "Ein kreativer kleiner Schneebesen, der in 8 verschiedenen Farben kommt. Praktisch und nach dem Gebrauch leicht zu reinigen. Eine tolle Geschenkidee.", }, ], Array [ Object { "children": Array [], - "id": "c4BqrajvA8E6qwgkieoqmqO___deproductNameTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "SoSo wanduhr", "contentDigest": "8b38ff25d8ab847042efc8d525aaf7a0", "mediaType": "text/markdown", "type": "contentfulProductProductNameTextNode", }, - "parent": "c4BqrajvA8E6qwgkieoqmqO___de", + "parent": "uuid-from-gatsby", "productName": "SoSo wanduhr", }, ], Array [ Object { "children": Array [], - "id": "c4BqrajvA8E6qwgkieoqmqO___deproductDescriptionTextNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "Die neu veröffentlichte SoSo Clock von Lemnos heiratet einfaches, sauberes Design und fette, auffällige Features. Sein gesättigtes Ringelblumengesicht ist ein lebhafter Pop der Farbe zu den weißen oder grauen Wänden, aber würde auch gut mit Marine und kastanienbraun paaren. Wo die meisten Uhren am Rande der Uhr Nummern sind, bringt der SoSo sie in die Mitte und lässt einen weiten Raum zwischen den Zahlen und dem leichten Rahmen. Der Stundenzeiger bietet eine schöne Unterbrechung der schwarzen und gelben der Uhr - es ist in einem brillanten Weiß vorgestellt. Trotz seiner kräftigen Farbe und des Kontrastes behält der SoSo eine saubere, reine Ästhetik, die für eine Vielzahl von zeitgenössischen Interieurs geeignet ist.", "contentDigest": "038ff737ccc03e4525691d265d5a92b7", "mediaType": "text/markdown", "type": "contentfulProductProductDescriptionTextNode", }, - "parent": "c4BqrajvA8E6qwgkieoqmqO___de", + "parent": "uuid-from-gatsby", "productDescription": "Die neu veröffentlichte SoSo Clock von Lemnos heiratet einfaches, sauberes Design und fette, auffällige Features. Sein gesättigtes Ringelblumengesicht ist ein lebhafter Pop der Farbe zu den weißen oder grauen Wänden, aber würde auch gut mit Marine und kastanienbraun paaren. Wo die meisten Uhren am Rande der Uhr Nummern sind, bringt der SoSo sie in die Mitte und lässt einen weiten Raum zwischen den Zahlen und dem leichten Rahmen. Der Stundenzeiger bietet eine schöne Unterbrechung der schwarzen und gelben der Uhr - es ist in einem brillanten Weiß vorgestellt. Trotz seiner kräftigen Farbe und des Kontrastes behält der SoSo eine saubere, reine Ästhetik, die für eine Vielzahl von zeitgenössischen Interieurs geeignet ist.", }, ], @@ -3353,9 +3353,9 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff "children": Array [], "description": null, "displayField": "productName", - "id": "Product", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "d9822da16231c6bd9df08d882174266f", + "contentDigest": "043cf76e7aedca253d7f91e366d103d5", "type": "ContentfulContentType", }, "name": "Product", @@ -3369,24 +3369,24 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff "c24DPGBDeGEaYy8ms4Y8QMQ___de", ], "children": Array [ - "c5KsDBWseXY6QegucYAoacS___deproductNameTextNode", - "c5KsDBWseXY6QegucYAoacS___deproductDescriptionTextNode", + "uuid-from-gatsby", + "uuid-from-gatsby", ], "contentful_id": "c5KsDBWseXY6QegucYAoacS", "createdAt": "2017-06-27T09:35:43.996Z", - "id": "c5KsDBWseXY6QegucYAoacS___de", + "id": "uuid-from-gatsby", "image___NODE": Array [ "wtrHxeu3zEoEce2MokCSi___de", ], "internal": Object { - "contentDigest": "836af08a2bb5b7cef21ad9969b5abbcc", + "contentDigest": "e183b5fd560ce1d31eaefcec7f7881d5", "type": "ContentfulProduct", }, "node_locale": "de", "parent": "Product", "price": 44, - "productDescription___NODE": "c5KsDBWseXY6QegucYAoacS___deproductDescriptionTextNode", - "productName___NODE": "c5KsDBWseXY6QegucYAoacS___deproductNameTextNode", + "productDescription___NODE": "uuid-from-gatsby", + "productName___NODE": "uuid-from-gatsby", "quantity": 56, "sizetypecolor": "Length: 135 mm | color: espresso, green, or icar (white)", "sku": "B001R6JUZ2", @@ -3409,24 +3409,24 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff "c7LAnCobuuWYSqks6wAwY2a___de", ], "children": Array [ - "c3DVqIYj4dOwwcKu6sgqOgg___deproductNameTextNode", - "c3DVqIYj4dOwwcKu6sgqOgg___deproductDescriptionTextNode", + "uuid-from-gatsby", + "uuid-from-gatsby", ], "contentful_id": "c3DVqIYj4dOwwcKu6sgqOgg", "createdAt": "2017-06-27T09:35:44.006Z", - "id": "c3DVqIYj4dOwwcKu6sgqOgg___de", + "id": "uuid-from-gatsby", "image___NODE": Array [ "Xc0ny7GWsMEMCeASWO2um___de", ], "internal": Object { - "contentDigest": "065b8dd5500014f4364a817d302260d5", + "contentDigest": "9386810ccab1ac082720a9a4d63df979", "type": "ContentfulProduct", }, "node_locale": "de", "parent": "Product", "price": 11, - "productDescription___NODE": "c3DVqIYj4dOwwcKu6sgqOgg___deproductDescriptionTextNode", - "productName___NODE": "c3DVqIYj4dOwwcKu6sgqOgg___deproductNameTextNode", + "productDescription___NODE": "uuid-from-gatsby", + "productName___NODE": "uuid-from-gatsby", "quantity": 101, "sizetypecolor": "3 x 3 x 5 inches; 5.3 ounces", "sku": "B00E82D7I8", @@ -3447,24 +3447,24 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff "c7LAnCobuuWYSqks6wAwY2a___de", ], "children": Array [ - "c6dbjWqNd9SqccegcqYq224___deproductNameTextNode", - "c6dbjWqNd9SqccegcqYq224___deproductDescriptionTextNode", + "uuid-from-gatsby", + "uuid-from-gatsby", ], "contentful_id": "c6dbjWqNd9SqccegcqYq224", "createdAt": "2017-06-27T09:35:44.049Z", - "id": "c6dbjWqNd9SqccegcqYq224___de", + "id": "uuid-from-gatsby", "image___NODE": Array [ "c10TkaLheGeQG6qQGqWYqUI___de", ], "internal": Object { - "contentDigest": "aba1d4c1689dc05617bf22ca5b790d67", + "contentDigest": "3bcbc977870069dee1b5bc7fa8371e37", "type": "ContentfulProduct", }, "node_locale": "de", "parent": "Product", "price": 22, - "productDescription___NODE": "c6dbjWqNd9SqccegcqYq224___deproductDescriptionTextNode", - "productName___NODE": "c6dbjWqNd9SqccegcqYq224___deproductNameTextNode", + "productDescription___NODE": "uuid-from-gatsby", + "productName___NODE": "uuid-from-gatsby", "quantity": 89, "sizetypecolor": "0.8 x 0.8 x 11.2 inches; 1.6 ounces", "sku": "B0081F2CCK", @@ -3487,24 +3487,24 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff "c7LAnCobuuWYSqks6wAwY2a___de", ], "children": Array [ - "c4BqrajvA8E6qwgkieoqmqO___deproductNameTextNode", - "c4BqrajvA8E6qwgkieoqmqO___deproductDescriptionTextNode", + "uuid-from-gatsby", + "uuid-from-gatsby", ], "contentful_id": "c4BqrajvA8E6qwgkieoqmqO", "createdAt": "2017-06-27T09:35:44.130Z", - "id": "c4BqrajvA8E6qwgkieoqmqO___de", + "id": "uuid-from-gatsby", "image___NODE": Array [ "KTRF62Q4gg60q6WCsWKw8___de", ], "internal": Object { - "contentDigest": "db0ca03c9861093ff9670d9bdfd5e273", + "contentDigest": "9ffc3ed0fd667808a8d9b3bfddf7bf3b", "type": "ContentfulProduct", }, "node_locale": "de", "parent": "Product", "price": 120, - "productDescription___NODE": "c4BqrajvA8E6qwgkieoqmqO___deproductDescriptionTextNode", - "productName___NODE": "c4BqrajvA8E6qwgkieoqmqO___deproductNameTextNode", + "productDescription___NODE": "uuid-from-gatsby", + "productName___NODE": "uuid-from-gatsby", "quantity": 3, "sizetypecolor": "10\\" x 2.2\\"", "sku": "B00MG4ULK2", @@ -3567,14 +3567,14 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff "interfaces", "**/__tests__/fixtures/", ], - "id": "c71mfnH4QKsSsQmgoaQuq6OjsonTestJSONNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "{\\"engines\\":{\\"yarn\\":\\"^1.2.1\\"},\\"private\\":true,\\"scripts\\":{\\"jest\\":\\"jest\\",\\"lint\\":\\"eslint --ext .js,.jsx packages/**/src\\",\\"plop\\":\\"plop\\",\\"test\\":\\"yarn lint && yarn jest\\",\\"lerna\\":\\"lerna\\",\\"watch\\":\\"lerna run watch --no-sort --stream --concurrency 999\\",\\"format\\":\\"npm run format-packages && npm run format-cache-dir && npm run format-www && npm run format-examples && npm run format-scripts\\",\\"publish\\":\\"lerna publish\\",\\"bootstrap\\":\\"yarn && npm run check-versions && lerna run prepublish\\",\\"lint:flow\\":\\"babel-node scripts/flow-check.js\\",\\"remotedev\\":\\"remotedev --hostname=localhost --port=19999\\",\\"test_bkup\\":\\"npm run lint && npm run test-node && npm run test-integration\\",\\"format-www\\":\\"prettier-eslint --write \\\\\\"www/*.js\\\\\\" \\\\\\"www/src/**/*.js\\\\\\"\\",\\"test:watch\\":\\"jest --watch\\",\\"test:update\\":\\"jest --updateSnapshot\\",\\"publish-next\\":\\"lerna publish --npm-tag=next\\",\\"check-versions\\":\\"babel-node scripts/check-versions.js\\",\\"format-scripts\\":\\"prettier-eslint --write \\\\\\"scripts/**/*.js\\\\\\"\\",\\"publish-canary\\":\\"lerna publish --canary --yes\\",\\"format-examples\\":\\"prettier-eslint --write \\\\\\"examples/**/gatsby-node.js\\\\\\" \\\\\\"examples/**/gatsby-config.js\\\\\\" \\\\\\"examples/**/src/**/*.js\\\\\\"\\",\\"format-packages\\":\\"prettier-eslint --write \\\\\\"packages/*/src/**/*.js\\\\\\"\\",\\"format-cache-dir\\":\\"prettier-eslint --write \\\\\\"packages/gatsby/cache-dir/*.js\\\\\\"\\"},\\"workspaces\\":[\\"packages/*\\"],\\"eslintIgnore\\":[\\"interfaces\\",\\"**/__tests__/fixtures/\\"],\\"devDependencies\\":{\\"glob\\":\\"^7.1.1\\",\\"jest\\":\\"^20.0.4\\",\\"plop\\":\\"^1.8.1\\",\\"lerna\\":\\"^2.1.1\\",\\"eslint\\":\\"^4.5.0\\",\\"rimraf\\":\\"^2.6.1\\",\\"chokidar\\":\\"^1.7.0\\",\\"flow-bin\\":\\"^0.42.0\\",\\"jest-cli\\":\\"^20.0.4\\",\\"prettier\\":\\"^1.7.0\\",\\"babel-cli\\":\\"^6.26.0\\",\\"cross-env\\":\\"^5.0.5\\",\\"babel-jest\\":\\"^20.0.3\\",\\"babel-eslint\\":\\"^7.2.3\\",\\"babel-runtime\\":\\"^6.26.0\\",\\"babel-register\\":\\"^6.26.0\\",\\"babel-preset-env\\":\\"^1.6.0\\",\\"remotedev-server\\":\\"^0.2.3\\",\\"babel-preset-flow\\":\\"^6.23.0\\",\\"babel-preset-react\\":\\"^6.24.1\\",\\"babel-plugin-lodash\\":\\"^3.2.11\\",\\"eslint-plugin-react\\":\\"^7.3.0\\",\\"prettier-eslint-cli\\":\\"4.2.x\\",\\"babel-preset-stage-0\\":\\"^6.24.1\\",\\"eslint-config-google\\":\\"^0.9.1\\",\\"eslint-plugin-import\\":\\"^2.7.0\\",\\"eslint-config-prettier\\":\\"^2.5.0\\",\\"eslint-plugin-flowtype\\":\\"^2.35.0\\",\\"eslint-plugin-jsx-a11y\\":\\"^6.0.2\\",\\"eslint-plugin-prettier\\":\\"^2.2.0\\",\\"eslint-plugin-flow-vars\\":\\"^0.5.0\\",\\"babel-plugin-transform-runtime\\":\\"^6.23.0\\",\\"babel-plugin-add-module-exports\\":\\"^0.2.1\\",\\"babel-plugin-transform-flow-strip-types\\":\\"^6.22.0\\",\\"babel-plugin-transform-async-to-generator\\":\\"^6.24.1\\"}}", "contentDigest": "2555b7857c70c4293f9c6f3258dff561", "mediaType": "application/json", "type": "contentfulJsonTestJsonTestJsonNode", }, - "parent": "c71mfnH4QKsSsQmgoaQuq6O", + "parent": "uuid-from-gatsby", "private": true, "scripts": Object { "bootstrap": "yarn && npm run check-versions && lerna run prepublish", @@ -3610,9 +3610,9 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff "children": Array [], "description": "just for testing JSON fields", "displayField": null, - "id": "JSON-test", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "f16da69f5e198a8896039313bbcb3fa0", + "contentDigest": "9d44539046f153bcd9f3d110e20c428c", "type": "ContentfulContentType", }, "name": "JSON-test", @@ -3622,16 +3622,16 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff Array [ Object { "children": Array [ - "c71mfnH4QKsSsQmgoaQuq6OjsonTestJSONNode", + "uuid-from-gatsby", ], "contentful_id": "c71mfnH4QKsSsQmgoaQuq6O", "createdAt": "2017-11-28T02:16:10.604Z", - "id": "c71mfnH4QKsSsQmgoaQuq6O", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "6e84478bcc75fa7f7c8c722b216af25d", + "contentDigest": "4da6aaab54ff1a4961bc6c03cd0f59f5", "type": "ContentfulJsonTest", }, - "jsonTest___NODE": "c71mfnH4QKsSsQmgoaQuq6OjsonTestJSONNode", + "jsonTest___NODE": "uuid-from-gatsby", "node_locale": "en-US", "parent": "JSON-test", "updatedAt": "2017-11-28T02:16:10.604Z", @@ -3684,14 +3684,14 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff "interfaces", "**/__tests__/fixtures/", ], - "id": "c71mfnH4QKsSsQmgoaQuq6O___dejsonTestJSONNode", + "id": "uuid-from-gatsby", "internal": Object { "content": "{\\"engines\\":{\\"yarn\\":\\"^1.2.1\\"},\\"private\\":true,\\"scripts\\":{\\"jest\\":\\"jest\\",\\"lint\\":\\"eslint --ext .js,.jsx packages/**/src\\",\\"plop\\":\\"plop\\",\\"test\\":\\"yarn lint && yarn jest\\",\\"lerna\\":\\"lerna\\",\\"watch\\":\\"lerna run watch --no-sort --stream --concurrency 999\\",\\"format\\":\\"npm run format-packages && npm run format-cache-dir && npm run format-www && npm run format-examples && npm run format-scripts\\",\\"publish\\":\\"lerna publish\\",\\"bootstrap\\":\\"yarn && npm run check-versions && lerna run prepublish\\",\\"lint:flow\\":\\"babel-node scripts/flow-check.js\\",\\"remotedev\\":\\"remotedev --hostname=localhost --port=19999\\",\\"test_bkup\\":\\"npm run lint && npm run test-node && npm run test-integration\\",\\"format-www\\":\\"prettier-eslint --write \\\\\\"www/*.js\\\\\\" \\\\\\"www/src/**/*.js\\\\\\"\\",\\"test:watch\\":\\"jest --watch\\",\\"test:update\\":\\"jest --updateSnapshot\\",\\"publish-next\\":\\"lerna publish --npm-tag=next\\",\\"check-versions\\":\\"babel-node scripts/check-versions.js\\",\\"format-scripts\\":\\"prettier-eslint --write \\\\\\"scripts/**/*.js\\\\\\"\\",\\"publish-canary\\":\\"lerna publish --canary --yes\\",\\"format-examples\\":\\"prettier-eslint --write \\\\\\"examples/**/gatsby-node.js\\\\\\" \\\\\\"examples/**/gatsby-config.js\\\\\\" \\\\\\"examples/**/src/**/*.js\\\\\\"\\",\\"format-packages\\":\\"prettier-eslint --write \\\\\\"packages/*/src/**/*.js\\\\\\"\\",\\"format-cache-dir\\":\\"prettier-eslint --write \\\\\\"packages/gatsby/cache-dir/*.js\\\\\\"\\"},\\"workspaces\\":[\\"packages/*\\"],\\"eslintIgnore\\":[\\"interfaces\\",\\"**/__tests__/fixtures/\\"],\\"devDependencies\\":{\\"glob\\":\\"^7.1.1\\",\\"jest\\":\\"^20.0.4\\",\\"plop\\":\\"^1.8.1\\",\\"lerna\\":\\"^2.1.1\\",\\"eslint\\":\\"^4.5.0\\",\\"rimraf\\":\\"^2.6.1\\",\\"chokidar\\":\\"^1.7.0\\",\\"flow-bin\\":\\"^0.42.0\\",\\"jest-cli\\":\\"^20.0.4\\",\\"prettier\\":\\"^1.7.0\\",\\"babel-cli\\":\\"^6.26.0\\",\\"cross-env\\":\\"^5.0.5\\",\\"babel-jest\\":\\"^20.0.3\\",\\"babel-eslint\\":\\"^7.2.3\\",\\"babel-runtime\\":\\"^6.26.0\\",\\"babel-register\\":\\"^6.26.0\\",\\"babel-preset-env\\":\\"^1.6.0\\",\\"remotedev-server\\":\\"^0.2.3\\",\\"babel-preset-flow\\":\\"^6.23.0\\",\\"babel-preset-react\\":\\"^6.24.1\\",\\"babel-plugin-lodash\\":\\"^3.2.11\\",\\"eslint-plugin-react\\":\\"^7.3.0\\",\\"prettier-eslint-cli\\":\\"4.2.x\\",\\"babel-preset-stage-0\\":\\"^6.24.1\\",\\"eslint-config-google\\":\\"^0.9.1\\",\\"eslint-plugin-import\\":\\"^2.7.0\\",\\"eslint-config-prettier\\":\\"^2.5.0\\",\\"eslint-plugin-flowtype\\":\\"^2.35.0\\",\\"eslint-plugin-jsx-a11y\\":\\"^6.0.2\\",\\"eslint-plugin-prettier\\":\\"^2.2.0\\",\\"eslint-plugin-flow-vars\\":\\"^0.5.0\\",\\"babel-plugin-transform-runtime\\":\\"^6.23.0\\",\\"babel-plugin-add-module-exports\\":\\"^0.2.1\\",\\"babel-plugin-transform-flow-strip-types\\":\\"^6.22.0\\",\\"babel-plugin-transform-async-to-generator\\":\\"^6.24.1\\"}}", "contentDigest": "2555b7857c70c4293f9c6f3258dff561", "mediaType": "application/json", "type": "contentfulJsonTestJsonTestJsonNode", }, - "parent": "c71mfnH4QKsSsQmgoaQuq6O___de", + "parent": "uuid-from-gatsby", "private": true, "scripts": Object { "bootstrap": "yarn && npm run check-versions && lerna run prepublish", @@ -3727,9 +3727,9 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff "children": Array [], "description": "just for testing JSON fields", "displayField": null, - "id": "JSON-test", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "f16da69f5e198a8896039313bbcb3fa0", + "contentDigest": "9d44539046f153bcd9f3d110e20c428c", "type": "ContentfulContentType", }, "name": "JSON-test", @@ -3739,16 +3739,16 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff Array [ Object { "children": Array [ - "c71mfnH4QKsSsQmgoaQuq6O___dejsonTestJSONNode", + "uuid-from-gatsby", ], "contentful_id": "c71mfnH4QKsSsQmgoaQuq6O", "createdAt": "2017-11-28T02:16:10.604Z", - "id": "c71mfnH4QKsSsQmgoaQuq6O___de", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "6992fd46d58816fb028c2369de2e4736", + "contentDigest": "8945ca8e1a18a7d6c6b644157ef41d41", "type": "ContentfulJsonTest", }, - "jsonTest___NODE": "c71mfnH4QKsSsQmgoaQuq6O___dejsonTestJSONNode", + "jsonTest___NODE": "uuid-from-gatsby", "node_locale": "de", "parent": "JSON-test", "updatedAt": "2017-11-28T02:16:10.604Z", diff --git a/packages/gatsby-source-contentful/src/__tests__/normalize.js b/packages/gatsby-source-contentful/src/__tests__/normalize.js index bff51753ca072..09d03330268bf 100644 --- a/packages/gatsby-source-contentful/src/__tests__/normalize.js +++ b/packages/gatsby-source-contentful/src/__tests__/normalize.js @@ -52,6 +52,8 @@ describe(`Process contentful data`, () => { it(`creates nodes for each entry`, () => { const createNode = jest.fn() + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) contentTypeItems.forEach((contentTypeItem, i) => { normalize.createContentTypeNodes({ contentTypeItem, @@ -59,6 +61,7 @@ describe(`Process contentful data`, () => { conflictFieldPrefix, entries: entryList[i].map(normalize.fixIds), createNode, + createNodeId, resolvable, foreignReferenceMap, defaultLocale, @@ -70,11 +73,14 @@ describe(`Process contentful data`, () => { it(`creates nodes for each asset`, () => { const createNode = jest.fn() + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) const assets = currentSyncData.assets assets.forEach(assetItem => { normalize.createAssetNodes({ assetItem, createNode, + createNodeId, defaultLocale, locales, }) diff --git a/packages/gatsby-source-contentful/src/gatsby-node.js b/packages/gatsby-source-contentful/src/gatsby-node.js index c2d05ccde1030..efdc2aae49e31 100644 --- a/packages/gatsby-source-contentful/src/gatsby-node.js +++ b/packages/gatsby-source-contentful/src/gatsby-node.js @@ -30,7 +30,7 @@ exports.setFieldsOnGraphQLNodeType = require(`./extend-node-type`).extendNodeTyp */ exports.sourceNodes = async ( - { actions, getNodes, hasNodeChanged, store }, + { actions, getNodes, createNodeId, hasNodeChanged, store }, { spaceId, accessToken, host } ) => { const { createNode, deleteNodes, touchNode, setPluginStatus } = actions @@ -151,6 +151,7 @@ exports.sourceNodes = async ( conflictFieldPrefix, entries: entryList[i], createNode, + createNodeId, resolvable, foreignReferenceMap, defaultLocale, @@ -162,6 +163,7 @@ exports.sourceNodes = async ( normalize.createAssetNodes({ assetItem, createNode, + createNodeId, defaultLocale, locales, }) diff --git a/packages/gatsby-source-contentful/src/normalize.js b/packages/gatsby-source-contentful/src/normalize.js index df5ee6b5cd35e..4fe4794cdd680 100644 --- a/packages/gatsby-source-contentful/src/normalize.js +++ b/packages/gatsby-source-contentful/src/normalize.js @@ -149,10 +149,10 @@ exports.buildForeignReferenceMap = ({ return foreignReferenceMap } -function createTextNode(node, key, text, createNode) { +function createTextNode(node, key, text, createNode, createNodeId) { const str = _.isString(text) ? text : ` ` const textNode = { - id: `${node.id}${key}TextNode`, + id: createNodeId(`${node.id}${key}TextNode`), parent: node.id, children: [], [key]: str, @@ -171,11 +171,11 @@ function createTextNode(node, key, text, createNode) { } exports.createTextNode = createTextNode -function createJSONNode(node, key, content, createNode) { +function createJSONNode(node, key, content, createNode, createNodeId) { const str = JSON.stringify(content) const JSONNode = { ...content, - id: `${node.id}${key}JSONNode`, + id: createNodeId(`${node.id}${key}JSONNode`), parent: node.id, children: [], internal: { @@ -199,6 +199,7 @@ exports.createContentTypeNodes = ({ conflictFieldPrefix, entries, createNode, + createNodeId, resolvable, foreignReferenceMap, defaultLocale, @@ -286,7 +287,7 @@ exports.createContentTypeNodes = ({ } let entryNode = { - id: mId(entryItem.sys.id), + id: createNodeId(mId(entryItem.sys.id)), contentful_id: entryItem.sys.contentful_id, createdAt: entryItem.sys.createdAt, updatedAt: entryItem.sys.updatedAt, @@ -328,7 +329,8 @@ exports.createContentTypeNodes = ({ entryNode, entryItemFieldKey, entryItemFields[entryItemFieldKey], - createNode + createNode, + createNodeId, ) delete entryItemFields[entryItemFieldKey] @@ -337,7 +339,8 @@ exports.createContentTypeNodes = ({ entryNode, entryItemFieldKey, entryItemFields[entryItemFieldKey], - createNode + createNode, + createNodeId, ) delete entryItemFields[entryItemFieldKey] @@ -356,7 +359,7 @@ exports.createContentTypeNodes = ({ // Create a node for each content type const contentTypeNode = { - id: contentTypeItemId, + id: createNodeId(contentTypeItemId), parent: null, children: [], name: contentTypeItem.name, @@ -382,6 +385,7 @@ exports.createContentTypeNodes = ({ exports.createAssetNodes = ({ assetItem, createNode, + createNodeId, defaultLocale, locales, }) => { @@ -405,7 +409,7 @@ exports.createAssetNodes = ({ : ``, } const assetNode = { - id: mId(localizedAsset.sys.id), + id: createNodeId(mId(localizedAsset.sys.id)), parent: null, children: [], ...localizedAsset.fields, diff --git a/packages/gatsby-source-drupal/src/gatsby-node.js b/packages/gatsby-source-drupal/src/gatsby-node.js index d089c2bc6c244..f7ff6e42f4f2b 100644 --- a/packages/gatsby-source-drupal/src/gatsby-node.js +++ b/packages/gatsby-source-drupal/src/gatsby-node.js @@ -13,7 +13,7 @@ const createContentDigest = obj => exports.sourceNodes = async ( { actions, getNode, hasNodeChanged, store, cache }, - { baseUrl, apiBase } + { baseUrl, apiBase, createNodeId } ) => { const { createNode } = actions @@ -103,7 +103,7 @@ exports.sourceNodes = async ( _.each(contentType.data, datum => { const node = { - id: datum.id, + id: createNodeId(datum.id), parent: null, children: [], ...datum.attributes, diff --git a/packages/gatsby-source-faker/package.json b/packages/gatsby-source-faker/package.json index 44d57fcfb914f..3ab0395ee052c 100644 --- a/packages/gatsby-source-faker/package.json +++ b/packages/gatsby-source-faker/package.json @@ -1,6 +1,6 @@ { "name": "gatsby-source-faker", - "version": "1.0.1", + "version": "2.0.0", "description": "A gatsby plugin to get fake data for testing", "main": "index.js", "scripts": { diff --git a/packages/gatsby-source-faker/src/gatsby-node.js b/packages/gatsby-source-faker/src/gatsby-node.js index ae04ee52e8efa..20cdafc3f2dc3 100644 --- a/packages/gatsby-source-faker/src/gatsby-node.js +++ b/packages/gatsby-source-faker/src/gatsby-node.js @@ -1,7 +1,7 @@ const faker = require(`faker`) const crypto = require(`crypto`) -exports.sourceNodes = ({ actions }, pluginOptions) => { +exports.sourceNodes = ({ actions, createNodeId }, pluginOptions) => { const { createNode } = actions const { schema, count, type } = pluginOptions for (let i = 0; i < count; i++) { @@ -20,7 +20,7 @@ exports.sourceNodes = ({ actions }, pluginOptions) => { .digest(`hex`) const nodeBase = { - id: JSON.stringify(faker.random.number()), + id: createNodeId(JSON.stringify(faker.random.number())), parent: null, children: [], internal: { diff --git a/packages/gatsby-source-filesystem/src/__tests__/create-file-node.js b/packages/gatsby-source-filesystem/src/__tests__/create-file-node.js index f933f812b77f5..416ea9abdd487 100644 --- a/packages/gatsby-source-filesystem/src/__tests__/create-file-node.js +++ b/packages/gatsby-source-filesystem/src/__tests__/create-file-node.js @@ -5,6 +5,9 @@ const { createFileNode } = require(`../create-file-node`) // FIXME: This test needs to not use snapshots because of file differences // and locations across users and CI systems describe(`create-file-node`, () => { - it(`creates a file node`, () => - createFileNode(path.resolve(`${__dirname}/fixtures/file.json`), {})) + it(`creates a file node`, () => { + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) + return createFileNode(path.resolve(`${__dirname}/fixtures/file.json`), createNodeId, {}) + }) }) diff --git a/packages/gatsby-source-filesystem/src/create-file-node.js b/packages/gatsby-source-filesystem/src/create-file-node.js index 03e4f12edb747..8f76a22745911 100644 --- a/packages/gatsby-source-filesystem/src/create-file-node.js +++ b/packages/gatsby-source-filesystem/src/create-file-node.js @@ -14,7 +14,7 @@ const createId = path => { exports.createId = createId -exports.createFileNode = async (pathToFile, pluginOptions = {}) => { +exports.createFileNode = async (pathToFile, createNodeId, pluginOptions = {}) => { const slashed = slash(pathToFile) const parsedSlashed = path.parse(slashed) const slashedFile = { @@ -56,7 +56,7 @@ exports.createFileNode = async (pathToFile, pluginOptions = {}) => { // Don't actually make the File id the absolute path as otherwise // people will use the id for that and ids shouldn't be treated as // useful information. - id: createId(pathToFile), + id: createNodeId(pathToFile), children: [], parent: `___SOURCE___`, internal, diff --git a/packages/gatsby-source-filesystem/src/gatsby-node.js b/packages/gatsby-source-filesystem/src/gatsby-node.js index b17e27b0983e7..f55dc0623c074 100644 --- a/packages/gatsby-source-filesystem/src/gatsby-node.js +++ b/packages/gatsby-source-filesystem/src/gatsby-node.js @@ -4,7 +4,7 @@ const fs = require(`fs`) const { createId, createFileNode } = require(`./create-file-node`) exports.sourceNodes = ( - { actions, getNode, hasNodeChanged, reporter }, + { actions, getNode, createNodeId, hasNodeChanged, reporter }, pluginOptions ) => { const { createNode, deleteNode } = actions @@ -36,7 +36,7 @@ Please pick a path to an existing directory. }) const createAndProcessNode = path => - createFileNode(path, pluginOptions).then(createNode) + createFileNode(path, createNodeId, pluginOptions).then(createNode) // For every path that is reported before the 'ready' event, we throw them // into a queue and then flush the queue when 'ready' event arrives. diff --git a/packages/gatsby-source-hacker-news/package.json b/packages/gatsby-source-hacker-news/package.json index a216ee5d9338a..dec70bbb3a3ef 100644 --- a/packages/gatsby-source-hacker-news/package.json +++ b/packages/gatsby-source-hacker-news/package.json @@ -1,6 +1,6 @@ { "name": "gatsby-source-hacker-news", - "version": "1.0.9", + "version": "2.0.0", "description": "Gatsby source plugin for building websites using Hacker News as a data source", "scripts": { "build": "babel src --out-dir . --ignore **/__tests__/**", diff --git a/packages/gatsby-source-hacker-news/src/gatsby-node.js b/packages/gatsby-source-hacker-news/src/gatsby-node.js index 6fd28b0fcf710..57f166aefb5e1 100644 --- a/packages/gatsby-source-hacker-news/src/gatsby-node.js +++ b/packages/gatsby-source-hacker-news/src/gatsby-node.js @@ -8,7 +8,7 @@ const get = query => `https://www.graphqlhub.com/graphql?query=${encodeURIComponent(query)}` ) -exports.sourceNodes = async ({ actions, getNode, hasNodeChanged }) => { +exports.sourceNodes = async ({ actions, getNode, createNodeId, hasNodeChanged }) => { const { createNode } = actions // Do the initial fetch @@ -96,6 +96,7 @@ fragment commentsFragment on HackerNewsItem { const storyNode = { ...kidLessStory, + id: createNodeId(kidLessStory.id), children: kids.kids.map(k => k.id), parent: `__SOURCE__`, content: storyStr, @@ -127,6 +128,7 @@ fragment commentsFragment on HackerNewsItem { } let commentNode = { ..._.omit(comment, `kids`), + id: createNodeId(comment.id), children: comment.kids.map(k => k.id), parent, internal: { @@ -150,12 +152,12 @@ fragment commentsFragment on HackerNewsItem { createNode(commentNode) if (comment.kids.length > 0) { - createCommentNodes(comment.kids, comment.id, depth + 1) + createCommentNodes(comment.kids, commentNode.id, depth + 1) } }) } - createCommentNodes(kids.kids, story.id) + createCommentNodes(kids.kids, storyNode.id) }) return diff --git a/packages/gatsby-source-medium/package.json b/packages/gatsby-source-medium/package.json index 60a25b61da085..cab9978976021 100644 --- a/packages/gatsby-source-medium/package.json +++ b/packages/gatsby-source-medium/package.json @@ -1,7 +1,7 @@ { "name": "gatsby-source-medium", "description": "Gatsby source plugin for building websites using Medium as a data source", - "version": "1.0.11", + "version": "2.0.0", "author": "Robert Vogt ", "dependencies": { "axios": "^0.16.2", diff --git a/packages/gatsby-source-medium/src/gatsby-node.js b/packages/gatsby-source-medium/src/gatsby-node.js index 005d82d703fcd..ee454c7e27b00 100644 --- a/packages/gatsby-source-medium/src/gatsby-node.js +++ b/packages/gatsby-source-medium/src/gatsby-node.js @@ -25,7 +25,7 @@ const convertTimestamps = (nextObj, prevObj, prevKey) => { const strip = payload => payload.replace(prefix, ``) -exports.sourceNodes = async ({ actions }, { username }) => { +exports.sourceNodes = async ({ actions, createNodeId }, { username }) => { const { createNode } = actions try { @@ -84,7 +84,7 @@ exports.sourceNodes = async ({ actions }, { username }) => { const node = Object.assign( resource, { - id: resource.id ? resource.id : resource.userId, + id: createNodeId(resource.id ? resource.id : resource.userId), parent: `__SOURCE__`, children: [], internal: { diff --git a/packages/gatsby-source-mongodb/package.json b/packages/gatsby-source-mongodb/package.json index 0aec10fb07dfd..b3f4eadfd1323 100644 --- a/packages/gatsby-source-mongodb/package.json +++ b/packages/gatsby-source-mongodb/package.json @@ -1,6 +1,6 @@ { "name": "gatsby-source-mongodb", - "version": "1.5.13", + "version": "2.0.0", "description": "Stub description for gatsby-source-mongodb", "main": "index.js", "scripts": { diff --git a/packages/gatsby-source-mongodb/src/gatsby-node.js b/packages/gatsby-source-mongodb/src/gatsby-node.js index 4c0a355147825..288453921bae1 100644 --- a/packages/gatsby-source-mongodb/src/gatsby-node.js +++ b/packages/gatsby-source-mongodb/src/gatsby-node.js @@ -4,7 +4,7 @@ const createMappingChildNodes = require(`./mapping`) const _ = require(`lodash`) exports.sourceNodes = ( - { actions, getNode, hasNodeChanged }, + { actions, getNode, createNodeId, hasNodeChanged }, pluginOptions, done ) => { @@ -32,10 +32,10 @@ exports.sourceNodes = ( let collection = pluginOptions.collection || `documents` if (_.isArray(collection)) { for (const col of collection) { - createNodes(db, pluginOptions, dbName, createNode, col, done) + createNodes(db, pluginOptions, dbName, createNode, createNodeId, col, done) } } else { - createNodes(db, pluginOptions, dbName, createNode, collection, done) + createNodes(db, pluginOptions, dbName, createNode, createNodeId, collection, done) } } ) @@ -46,6 +46,7 @@ function createNodes( pluginOptions, dbName, createNode, + createNodeId, collectionName, done ) { @@ -66,7 +67,7 @@ function createNodes( var node = { // Data for the node. ...item, - id: `${id}`, + id: createNodeId(`${id}`), parent: `__${collectionName}__`, children: [], internal: { diff --git a/packages/gatsby-transformer-csv/package.json b/packages/gatsby-transformer-csv/package.json index 963ac5671da62..ee5e4fe70b7cb 100644 --- a/packages/gatsby-transformer-csv/package.json +++ b/packages/gatsby-transformer-csv/package.json @@ -1,6 +1,6 @@ { "name": "gatsby-transformer-csv", - "version": "1.3.7", + "version": "2.0.0", "description": "Gatsby transformer plugin for CSV files", "main": "index.js", "scripts": { diff --git a/packages/gatsby-transformer-csv/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-transformer-csv/src/__tests__/__snapshots__/gatsby-node.js.snap index 7543c0171ce5f..14f2b875a35e2 100644 --- a/packages/gatsby-transformer-csv/src/__tests__/__snapshots__/gatsby-node.js.snap +++ b/packages/gatsby-transformer-csv/src/__tests__/__snapshots__/gatsby-node.js.snap @@ -7,7 +7,7 @@ Array [ "blue": "true", "children": Array [], "funny": "yup", - "id": "whatever [0] >>> CSV", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "5005aee6b2557974cae0aabc712e125a", "type": "TestCsv", @@ -20,7 +20,7 @@ Array [ "blue": "false", "children": Array [], "funny": "nope", - "id": "whatever [1] >>> CSV", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "0af87da7e572c2d6d8493bcd642c2c78", "type": "TestCsv", @@ -39,7 +39,7 @@ Array [ "blue": "true", "children": Array [], "funny": "yup", - "id": "whatever [0] >>> CSV", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "5005aee6b2557974cae0aabc712e125a", "type": "TestCsv", @@ -68,7 +68,7 @@ false,\\"nope\\"", "blue": "false", "children": Array [], "funny": "nope", - "id": "whatever [1] >>> CSV", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "0af87da7e572c2d6d8493bcd642c2c78", "type": "TestCsv", @@ -101,7 +101,7 @@ Array [ "children": Array [], "field1": "blue", "field2": "funny", - "id": "whatever [0] >>> CSV", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "49605f5e32a2250d7ca740c5d2e79784", "type": "TestCsv", @@ -114,7 +114,7 @@ Array [ "children": Array [], "field1": "true", "field2": "yup", - "id": "whatever [1] >>> CSV", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "2bf0bc0e8539ef5f6bbcf67c8b733233", "type": "TestCsv", @@ -127,7 +127,7 @@ Array [ "children": Array [], "field1": "false", "field2": "nope", - "id": "whatever [2] >>> CSV", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "f5f617ce4243d639de924543dec5600e", "type": "TestCsv", @@ -146,7 +146,7 @@ Array [ "children": Array [], "field1": "blue", "field2": "funny", - "id": "whatever [0] >>> CSV", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "49605f5e32a2250d7ca740c5d2e79784", "type": "TestCsv", @@ -175,7 +175,7 @@ false,nope", "children": Array [], "field1": "true", "field2": "yup", - "id": "whatever [1] >>> CSV", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "2bf0bc0e8539ef5f6bbcf67c8b733233", "type": "TestCsv", @@ -204,7 +204,7 @@ false,nope", "children": Array [], "field1": "false", "field2": "nope", - "id": "whatever [2] >>> CSV", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "f5f617ce4243d639de924543dec5600e", "type": "TestCsv", diff --git a/packages/gatsby-transformer-csv/src/__tests__/gatsby-node.js b/packages/gatsby-transformer-csv/src/__tests__/gatsby-node.js index 5fcdd7df77971..4f99b4d3e0651 100644 --- a/packages/gatsby-transformer-csv/src/__tests__/gatsby-node.js +++ b/packages/gatsby-transformer-csv/src/__tests__/gatsby-node.js @@ -1,5 +1,4 @@ const Promise = require(`bluebird`) -const _ = require(`lodash`) const json2csv = require(`json2csv`) const { onCreateNode } = require(`../gatsby-node`) @@ -29,11 +28,14 @@ describe(`Process nodes correctly`, () => { const createNode = jest.fn() const createParentChildLink = jest.fn() const actions = { createNode, createParentChildLink } + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) await onCreateNode({ node, loadNodeContent, actions, + createNodeId, }).then(() => { expect(createNode.mock.calls).toMatchSnapshot() expect(createParentChildLink.mock.calls).toMatchSnapshot() @@ -48,12 +50,15 @@ describe(`Process nodes correctly`, () => { const createNode = jest.fn() const createParentChildLink = jest.fn() const actions = { createNode, createParentChildLink } + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) await onCreateNode( { node, loadNodeContent, actions, + createNodeId, }, { noheader: true } ).then(() => { @@ -63,52 +68,4 @@ describe(`Process nodes correctly`, () => { expect(createParentChildLink).toHaveBeenCalledTimes(3) }) }) - - it(`If the object has an id, it uses that as the id instead of the auto-generated one`, async () => { - const fields = [`id`, `blue`, `funny`] - const data = [ - { id: `foo`, blue: true, funny: `yup` }, - { blue: false, funny: `nope` }, - ] - const csv = json2csv({ data: data, fields: fields }) - node.content = csv - - const createNode = jest.fn() - const createParentChildLink = jest.fn() - const actions = { createNode, createParentChildLink } - - await onCreateNode({ - node, - loadNodeContent, - actions, - }).then(() => { - expect(createNode.mock.calls[0][0].id).toEqual(`foo`) - }) - }) - - it(`the different objects shouldn't get the same ID even if they have the same content`, async () => { - const fields = [`id`, `blue`, `funny`] - const data = [ - { id: `foo`, blue: true, funny: `yup` }, - { blue: false, funny: `nope` }, - { blue: false, funny: `nope` }, - { green: false, funny: `nope` }, - ] - const csv = json2csv({ data: data, fields: fields }) - node.content = csv - - const createNode = jest.fn() - const createParentChildLink = jest.fn() - const actions = { createNode, createParentChildLink } - - await onCreateNode({ - node, - loadNodeContent, - actions, - }).then(() => { - const ids = createNode.mock.calls.map(object => object[0].id) - // Test that they're unique - expect(_.uniq(ids).length).toEqual(4) - }) - }) }) diff --git a/packages/gatsby-transformer-csv/src/gatsby-node.js b/packages/gatsby-transformer-csv/src/gatsby-node.js index 0504d0488045e..2085fb6369dee 100644 --- a/packages/gatsby-transformer-csv/src/gatsby-node.js +++ b/packages/gatsby-transformer-csv/src/gatsby-node.js @@ -15,7 +15,10 @@ const convertToJson = (data, options) => }) }) -async function onCreateNode({ node, actions, loadNodeContent }, options) { +async function onCreateNode( + { node, actions, loadNodeContent, createNodeId }, + options +) { const { createNode, createParentChildLink } = actions // Filter out non-csv content if (node.extension !== `csv`) { @@ -36,7 +39,7 @@ async function onCreateNode({ node, actions, loadNodeContent }, options) { return { ...obj, - id: obj.id ? obj.id : `${node.id} [${i}] >>> CSV`, + id: obj.id ? obj.id : createNodeId(`${node.id} [${i}] >>> CSV`), children: [], parent: node.id, internal: { diff --git a/packages/gatsby-transformer-documentationjs/package.json b/packages/gatsby-transformer-documentationjs/package.json index d704ec6243a4e..8e50eb999b842 100644 --- a/packages/gatsby-transformer-documentationjs/package.json +++ b/packages/gatsby-transformer-documentationjs/package.json @@ -1,6 +1,6 @@ { "name": "gatsby-transformer-documentationjs", - "version": "1.4.8", + "version": "2.0.0", "description": "Gatsby transformer plugin which uses Documentation.js to extract JavaScript documentation", "main": "index.js", "scripts": { diff --git a/packages/gatsby-transformer-documentationjs/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-transformer-documentationjs/src/__tests__/__snapshots__/gatsby-node.js.snap index 45e6fd766758b..c8129b358b028 100644 --- a/packages/gatsby-transformer-documentationjs/src/__tests__/__snapshots__/gatsby-node.js.snap +++ b/packages/gatsby-transformer-documentationjs/src/__tests__/__snapshots__/gatsby-node.js.snap @@ -4,7 +4,7 @@ exports[`transformer-react-doc-gen: onCreateNode should extract out a descriptio Array [ Object { "children": Array [], - "id": "documentationJS node_1 comment #0--DocumentationJSComponentDescription--comment.description", + "id": "uuid-from-gatsby", "internal": Object { "content": "A pretty cool jsdoc example ", @@ -16,7 +16,7 @@ Array [ }, Object { "children": Array [], - "id": "documentationJS node_1 comment #0--DocumentationJSComponentDescription--apple", + "id": "uuid-from-gatsby", "internal": Object { "content": "A nice crispy apple ", @@ -29,7 +29,7 @@ Array [ Object { "children": Array [], "commentNumber": 0, - "description___NODE": "documentationJS node_1 comment #0--DocumentationJSComponentDescription--comment.description", + "description___NODE": "uuid-from-gatsby", "examples": Array [ Object { "highlighted": "const apple = require('apple') @@ -38,16 +38,16 @@ Array [ apple()", }, ], - "id": "documentationJS node_1 comment #0", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "b635e85506044a6cdcebbcd7fda00b7d", + "contentDigest": "eb588cf103987de4bb07a2d28a5cf7c5", "type": "DocumentationJs", }, "kind": "constant", "name": "apple", "params": Array [ Object { - "description___NODE": "documentationJS node_1 comment #0--DocumentationJSComponentDescription--apple", + "description___NODE": "uuid-from-gatsby", "name": "apple", "title": "param", "type": Object { diff --git a/packages/gatsby-transformer-documentationjs/src/__tests__/gatsby-node.js b/packages/gatsby-transformer-documentationjs/src/__tests__/gatsby-node.js index fd4032cbf3bcd..02ee112205b93 100644 --- a/packages/gatsby-transformer-documentationjs/src/__tests__/gatsby-node.js +++ b/packages/gatsby-transformer-documentationjs/src/__tests__/gatsby-node.js @@ -4,11 +4,14 @@ import gatsbyNode from "../gatsby-node" describe(`transformer-react-doc-gen: onCreateNode`, () => { let actions, node, createdNodes, updatedNodes + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) let run = (node = node, opts = {}) => gatsbyNode.onCreateNode( { node, actions, + createNodeId, }, opts ) diff --git a/packages/gatsby-transformer-documentationjs/src/gatsby-node.js b/packages/gatsby-transformer-documentationjs/src/gatsby-node.js index 47151d036275d..f20f25daa7762 100644 --- a/packages/gatsby-transformer-documentationjs/src/gatsby-node.js +++ b/packages/gatsby-transformer-documentationjs/src/gatsby-node.js @@ -22,11 +22,11 @@ const commentId = (parentId, commentNumber) => const descriptionId = (parentId, name) => `${parentId}--DocumentationJSComponentDescription--${name}` -function createDescriptionNode(node, docNodeId, markdownStr, name, actions) { +function createDescriptionNode(node, docNodeId, markdownStr, name, actions, createNodeId) { const { createNode } = actions const descriptionNode = { - id: descriptionId(docNodeId, name), + id: createNodeId(descriptionId(docNodeId, name)), parent: node.id, children: [], internal: { @@ -47,7 +47,7 @@ function createDescriptionNode(node, docNodeId, markdownStr, name, actions) { * Implement the onCreateNode API to create documentation.js nodes * @param {Object} super this is a super param */ -exports.onCreateNode = async ({ node, loadNodeContent, actions }) => { +exports.onCreateNode = async ({ node, loadNodeContent, actions, createNodeId }) => { const { createNode, createParentChildLink } = actions if ( @@ -83,7 +83,8 @@ exports.onCreateNode = async ({ node, loadNodeContent, actions }) => { commentId(node.id, i), stringifyMarkdownAST(docsJson.description), `comment.description`, - actions + actions, + createNodeId ) } @@ -94,7 +95,8 @@ exports.onCreateNode = async ({ node, loadNodeContent, actions }) => { commentId(node.id, i), stringifyMarkdownAST(param.description), param.name, - actions + actions, + createNodeId ) delete param.description } @@ -128,7 +130,8 @@ exports.onCreateNode = async ({ node, loadNodeContent, actions }) => { commentId(node.id, i), stringifyMarkdownAST(ret.description), ret.title, - actions + actions, + createNodeId ) } @@ -153,7 +156,7 @@ exports.onCreateNode = async ({ node, loadNodeContent, actions }) => { const docNode = { ...picked, commentNumber: i, - id: commentId(node.id, i), + id: createNodeId(commentId(node.id, i)), parent: node.id, children: [], internal: { diff --git a/packages/gatsby-transformer-excel/package.json b/packages/gatsby-transformer-excel/package.json index df8dfbf8d73ac..f06cb4aaa6ef2 100644 --- a/packages/gatsby-transformer-excel/package.json +++ b/packages/gatsby-transformer-excel/package.json @@ -1,6 +1,6 @@ { "name": "gatsby-transformer-excel", - "version": "1.0.3", + "version": "2.0.0", "description": "Gatsby transformer plugin for Excel spreadsheets", "main": "index.js", "scripts": { diff --git a/packages/gatsby-transformer-excel/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-transformer-excel/src/__tests__/__snapshots__/gatsby-node.js.snap index 833b86eeed937..7b5e742e4f0e6 100644 --- a/packages/gatsby-transformer-excel/src/__tests__/__snapshots__/gatsby-node.js.snap +++ b/packages/gatsby-transformer-excel/src/__tests__/__snapshots__/gatsby-node.js.snap @@ -7,7 +7,7 @@ Array [ "blue": true, "children": Array [], "funny": "yup", - "id": "whatever [Sheet1 0] >>> csv", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "73901821b17d5aa9dd6026181f73b64c", "type": "TestCsv__Sheet1", @@ -20,7 +20,7 @@ Array [ "blue": false, "children": Array [], "funny": "nope", - "id": "whatever [Sheet1 1] >>> csv", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "f624311d932d73dcd416d2a8bea2b67d", "type": "TestCsv__Sheet1", @@ -31,7 +31,7 @@ Array [ Array [ Object { "children": Array [], - "id": "whatever [0] >>> csv", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "10c867561d207bc7dae0455d3cccad5b", "type": "TestCsv", @@ -50,7 +50,7 @@ Array [ "blue": true, "children": Array [], "funny": "yup", - "id": "whatever [Sheet1 0] >>> csv", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "73901821b17d5aa9dd6026181f73b64c", "type": "TestCsv__Sheet1", @@ -80,7 +80,7 @@ FALSE,nope "blue": false, "children": Array [], "funny": "nope", - "id": "whatever [Sheet1 1] >>> csv", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "f624311d932d73dcd416d2a8bea2b67d", "type": "TestCsv__Sheet1", @@ -108,7 +108,7 @@ FALSE,nope Object { "child": Object { "children": Array [], - "id": "whatever [0] >>> csv", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "10c867561d207bc7dae0455d3cccad5b", "type": "TestCsv", diff --git a/packages/gatsby-transformer-excel/src/__tests__/gatsby-node.js b/packages/gatsby-transformer-excel/src/__tests__/gatsby-node.js index c1db7687157c3..3a8445ad9314c 100644 --- a/packages/gatsby-transformer-excel/src/__tests__/gatsby-node.js +++ b/packages/gatsby-transformer-excel/src/__tests__/gatsby-node.js @@ -1,5 +1,4 @@ const Promise = require(`bluebird`) -const _ = require(`lodash`) const XLSX = require(`xlsx`) const { onCreateNode } = require(`../gatsby-node`) @@ -30,11 +29,14 @@ describe(`Process nodes correctly`, () => { const createNode = jest.fn() const createParentChildLink = jest.fn() const actions = { createNode, createParentChildLink } + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) await onCreateNode({ node, loadNodeContent, actions, + createNodeId, }).then(() => { expect(createNode.mock.calls).toMatchSnapshot() expect(createParentChildLink.mock.calls).toMatchSnapshot() @@ -42,56 +44,4 @@ describe(`Process nodes correctly`, () => { expect(createParentChildLink).toHaveBeenCalledTimes(2 + 1) }) }) - - it(`If the object has an id, it uses that as the id instead of the auto-generated one`, async () => { - const data = [ - [`id`, `blue`, `funny`], - [`foo`, true, `yup`], - [void 0, false, `nope`], - ] - const csv = XLSX.utils.sheet_to_csv( - XLSX.utils.aoa_to_sheet(data, { raw: true }) - ) - node.content = csv - - const createNode = jest.fn() - const createParentChildLink = jest.fn() - const actions = { createNode, createParentChildLink } - - await onCreateNode({ - node, - loadNodeContent, - actions, - }).then(() => { - expect(createNode.mock.calls[0][0].id).toEqual(`foo`) - }) - }) - - it(`the different objects shouldn't get the same ID even if they have the same content`, async () => { - const data = [ - [`id`, `blue`, `funny`, `green`], - [`foo`, true, `yup`], - [void 0, false, `nope`], - [void 0, false, `nope`], - [void 0, void 0, `nope`, false], - ] - const csv = XLSX.utils.sheet_to_csv( - XLSX.utils.aoa_to_sheet(data, { raw: true }) - ) - node.content = csv - - const createNode = jest.fn() - const createParentChildLink = jest.fn() - const actions = { createNode, createParentChildLink } - - await onCreateNode({ - node, - loadNodeContent, - actions, - }).then(() => { - const ids = createNode.mock.calls.map(object => object[0].id) - // Test that they're unique - expect(_.uniq(ids).length).toEqual(4 + 1) - }) - }) }) diff --git a/packages/gatsby-transformer-excel/src/gatsby-node.js b/packages/gatsby-transformer-excel/src/gatsby-node.js index 8347c3b17d477..0cb744348a630 100644 --- a/packages/gatsby-transformer-excel/src/gatsby-node.js +++ b/packages/gatsby-transformer-excel/src/gatsby-node.js @@ -10,7 +10,10 @@ function _loadNodeContent(fileNode, fallback) { : fallback(fileNode) } -async function onCreateNode({ node, actions, loadNodeContent }, options) { +async function onCreateNode( + { node, actions, loadNodeContent, createNodeId }, + options +) { const { createNode, createParentChildLink } = actions const extensions = `xls|xlsx|xlsm|xlsb|xml|xlw|xlc|csv|txt|dif|sylk|slk|prn|ods|fods|uos|dbf|wks|123|wq1|qpw|htm|html`.split( `|` @@ -36,7 +39,9 @@ async function onCreateNode({ node, actions, loadNodeContent }, options) { return { ...obj, - id: obj.id ? obj.id : `${node.id} [${n} ${i}] >>> ${node.extension}`, + id: obj.id + ? obj.id + : createNodeId(`${node.id} [${n} ${i}] >>> ${node.extension}`), children: [], parent: node.id, internal: { @@ -62,7 +67,7 @@ async function onCreateNode({ node, actions, loadNodeContent }, options) { .digest(`hex`) const z = { - id: `${node.id} [${idx}] >>> ${node.extension}`, + id: createNodeId(`${node.id} [${idx}] >>> ${node.extension}`), children: [], parent: node.id, internal: { diff --git a/packages/gatsby-transformer-hjson/package.json b/packages/gatsby-transformer-hjson/package.json index 050468b3281ea..1a4813cf5a876 100644 --- a/packages/gatsby-transformer-hjson/package.json +++ b/packages/gatsby-transformer-hjson/package.json @@ -1,6 +1,6 @@ { "name": "gatsby-transformer-hjson", - "version": "1.0.2", + "version": "2.0.0", "description": "Gatsby transformer plugin for HJSON files", "scripts": { "build": "babel src --out-dir . --ignore **/__tests__/**", diff --git a/packages/gatsby-transformer-hjson/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-transformer-hjson/src/__tests__/__snapshots__/gatsby-node.js.snap index 7cccd9475d45e..0e872c59980ef 100644 --- a/packages/gatsby-transformer-hjson/src/__tests__/__snapshots__/gatsby-node.js.snap +++ b/packages/gatsby-transformer-hjson/src/__tests__/__snapshots__/gatsby-node.js.snap @@ -7,7 +7,7 @@ Array [ "blue": true, "children": Array [], "funny": "yup", - "id": "foo", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "8838e569ae02d98806532310fb2a577a", "type": "FooHJson", @@ -26,7 +26,7 @@ Array [ "blue": true, "children": Array [], "funny": "yup", - "id": "foo", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "8838e569ae02d98806532310fb2a577a", "type": "FooHJson", @@ -62,7 +62,7 @@ Array [ "blue": true, "children": Array [], "funny": "yup", - "id": "foo", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "8838e569ae02d98806532310fb2a577a", "type": "NodeNameHJson", @@ -75,7 +75,7 @@ Array [ "blue": false, "children": Array [], "funny": "nope", - "id": "whatever [1] >>> HJSON", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "f624311d932d73dcd416d2a8bea2b67d", "type": "NodeNameHJson", @@ -94,7 +94,7 @@ Array [ "blue": true, "children": Array [], "funny": "yup", - "id": "foo", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "8838e569ae02d98806532310fb2a577a", "type": "NodeNameHJson", @@ -131,7 +131,7 @@ Array [ "blue": false, "children": Array [], "funny": "nope", - "id": "whatever [1] >>> HJSON", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "f624311d932d73dcd416d2a8bea2b67d", "type": "NodeNameHJson", diff --git a/packages/gatsby-transformer-hjson/src/__tests__/gatsby-node.js b/packages/gatsby-transformer-hjson/src/__tests__/gatsby-node.js index 32a3faded8ff7..f631ab236f4fd 100644 --- a/packages/gatsby-transformer-hjson/src/__tests__/gatsby-node.js +++ b/packages/gatsby-transformer-hjson/src/__tests__/gatsby-node.js @@ -1,5 +1,4 @@ const Promise = require(`bluebird`) -const _ = require(`lodash`) const HJSON = require(`hjson`) const { onCreateNode } = require(`../gatsby-node`) @@ -30,11 +29,14 @@ describe(`Process HJSON nodes correctly`, () => { const createNode = jest.fn() const createParentChildLink = jest.fn() const actions = { createNode, createParentChildLink } + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) await onCreateNode({ node, loadNodeContent, actions, + createNodeId, }).then(() => { expect(createNode.mock.calls).toMatchSnapshot() expect(createParentChildLink.mock.calls).toMatchSnapshot() @@ -51,11 +53,14 @@ describe(`Process HJSON nodes correctly`, () => { const createNode = jest.fn() const createParentChildLink = jest.fn() const actions = { createNode, createParentChildLink } + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) await onCreateNode({ node, loadNodeContent, actions, + createNodeId, }).then(() => { expect(createNode.mock.calls).toMatchSnapshot() expect(createParentChildLink.mock.calls).toMatchSnapshot() @@ -63,48 +68,4 @@ describe(`Process HJSON nodes correctly`, () => { expect(createParentChildLink).toHaveBeenCalledTimes(1) }) }) - - it(`If the object has an id, it uses that as the id instead of an autogenerated one`, async () => { - const data = [ - { id: `foo`, blue: true, funny: `yup` }, - { blue: false, funny: `nope` }, - ] - node.content = HJSON.stringify(data) - - const createNode = jest.fn() - const createParentChildLink = jest.fn() - const actions = { createNode, createParentChildLink } - - await onCreateNode({ - node, - loadNodeContent, - actions, - }).then(() => { - expect(createNode.mock.calls[0][0].id).toEqual(`foo`) - }) - }) - - it(`the different objects shouldn't get the same ID even if they have the same content`, async () => { - const data = [ - { id: `foo`, blue: true, funny: `yup` }, - { blue: false, funny: `nope` }, - { blue: false, funny: `nope` }, - { green: false, funny: `nope` }, - ] - node.content = HJSON.stringify(data) - - const createNode = jest.fn() - const createParentChildLink = jest.fn() - const actions = { createNode, createParentChildLink } - - await onCreateNode({ - node, - loadNodeContent, - actions, - }).then(() => { - const ids = createNode.mock.calls.map(object => object[0].id) - // Test that they're unique - expect(_.uniq(ids).length).toEqual(4) - }) - }) }) diff --git a/packages/gatsby-transformer-hjson/src/gatsby-node.js b/packages/gatsby-transformer-hjson/src/gatsby-node.js index bf1703316e4fe..b300604449e04 100644 --- a/packages/gatsby-transformer-hjson/src/gatsby-node.js +++ b/packages/gatsby-transformer-hjson/src/gatsby-node.js @@ -3,7 +3,9 @@ const crypto = require(`crypto`) const path = require(`path`) const HJSON = require(`hjson`) -async function onCreateNode({ node, actions, loadNodeContent }) { +async function onCreateNode({ node, actions, loadNodeContent, createNodeId }) { + const { createNode, createParentChildLink } = actions + function transformObject(obj, id, type) { const objStr = JSON.stringify(obj) const contentDigest = crypto @@ -24,8 +26,6 @@ async function onCreateNode({ node, actions, loadNodeContent }) { createParentChildLink({ parent: node, child: jsonNode }) } - const { createNode, createParentChildLink } = actions - // We only care about HJSON content. // NOTE the mime package does not recognize HJSON yet // See RFC https://hjson.org/rfc.html#rfc.section.1.3 @@ -43,14 +43,16 @@ async function onCreateNode({ node, actions, loadNodeContent }) { parsedContent.forEach((obj, i) => { transformObject( obj, - obj.id ? obj.id : `${node.id} [${i}] >>> HJSON`, + obj.id ? obj.id : createNodeId(`${node.id} [${i}] >>> HJSON`), _.upperFirst(_.camelCase(`${node.name} HJson`)) ) }) } else if (_.isPlainObject(parsedContent)) { transformObject( parsedContent, - parsedContent.id ? parsedContent.id : `${node.id} >>> HJSON`, + parsedContent.id + ? parsedContent.id + : createNodeId(`${node.id} >>> HJSON`), _.upperFirst(_.camelCase(`${path.basename(node.dir)} HJson`)) ) } diff --git a/packages/gatsby-transformer-javascript-static-exports/package.json b/packages/gatsby-transformer-javascript-static-exports/package.json index f46ad62beb7ae..b6554085360d1 100644 --- a/packages/gatsby-transformer-javascript-static-exports/package.json +++ b/packages/gatsby-transformer-javascript-static-exports/package.json @@ -1,6 +1,6 @@ { "name": "gatsby-transformer-javascript-static-exports", - "version": "1.3.8", + "version": "2.0.0", "description": "Gatsby transformer plugin for JavaScript to extract exports.data statically.", "scripts": { "build": "babel src --out-dir . --ignore **/__tests__/**", diff --git a/packages/gatsby-transformer-javascript-static-exports/src/gatsby-node.js b/packages/gatsby-transformer-javascript-static-exports/src/gatsby-node.js index 615426476ee2d..c139b1f6ad992 100644 --- a/packages/gatsby-transformer-javascript-static-exports/src/gatsby-node.js +++ b/packages/gatsby-transformer-javascript-static-exports/src/gatsby-node.js @@ -3,7 +3,7 @@ const crypto = require(`crypto`) const babylon = require(`babylon`) const traverse = require(`@babel/traverse`).default -async function onCreateNode({ node, getNode, actions, loadNodeContent }) { +async function onCreateNode({ node, getNode, actions, loadNodeContent, createNodeId }) { const { createNode, createParentChildLink } = actions // This only processes javascript files. @@ -122,7 +122,7 @@ async function onCreateNode({ node, getNode, actions, loadNodeContent }) { .digest(`hex`) const nodeData = { - id: `${node.id} >>> JSFrontmatter`, + id: createNodeId(`${node.id} >>> JSFrontmatter`), children: [], parent: node.id, node: { ...node }, diff --git a/packages/gatsby-transformer-json/package.json b/packages/gatsby-transformer-json/package.json index bbaa9a02605e7..cb7986c811ee1 100644 --- a/packages/gatsby-transformer-json/package.json +++ b/packages/gatsby-transformer-json/package.json @@ -1,6 +1,6 @@ { "name": "gatsby-transformer-json", - "version": "1.0.14", + "version": "2.0.0", "description": "Gatsby transformer plugin for JSON files", "scripts": { "build": "babel src --out-dir . --ignore **/__tests__/**", diff --git a/packages/gatsby-transformer-json/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-transformer-json/src/__tests__/__snapshots__/gatsby-node.js.snap index 864d7241e11e7..763ac9fd8361c 100644 --- a/packages/gatsby-transformer-json/src/__tests__/__snapshots__/gatsby-node.js.snap +++ b/packages/gatsby-transformer-json/src/__tests__/__snapshots__/gatsby-node.js.snap @@ -7,7 +7,7 @@ Array [ "blue": true, "children": Array [], "funny": "yup", - "id": "foo", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "8838e569ae02d98806532310fb2a577a", "type": "FooJson", @@ -26,7 +26,7 @@ Array [ "blue": true, "children": Array [], "funny": "yup", - "id": "foo", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "8838e569ae02d98806532310fb2a577a", "type": "FooJson", @@ -58,7 +58,7 @@ Array [ "blue": true, "children": Array [], "funny": "yup", - "id": "foo", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "8838e569ae02d98806532310fb2a577a", "type": "NodeNameJson", @@ -71,7 +71,7 @@ Array [ "blue": false, "children": Array [], "funny": "nope", - "id": "whatever [1] >>> JSON", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "f624311d932d73dcd416d2a8bea2b67d", "type": "NodeNameJson", @@ -90,7 +90,7 @@ Array [ "blue": true, "children": Array [], "funny": "yup", - "id": "foo", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "8838e569ae02d98806532310fb2a577a", "type": "NodeNameJson", @@ -117,7 +117,7 @@ Array [ "blue": false, "children": Array [], "funny": "nope", - "id": "whatever [1] >>> JSON", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "f624311d932d73dcd416d2a8bea2b67d", "type": "NodeNameJson", diff --git a/packages/gatsby-transformer-json/src/__tests__/gatsby-node.js b/packages/gatsby-transformer-json/src/__tests__/gatsby-node.js index 6202469d32183..e593975f2b84b 100644 --- a/packages/gatsby-transformer-json/src/__tests__/gatsby-node.js +++ b/packages/gatsby-transformer-json/src/__tests__/gatsby-node.js @@ -1,5 +1,4 @@ const Promise = require(`bluebird`) -const _ = require(`lodash`) const { onCreateNode } = require(`../gatsby-node`) @@ -29,11 +28,14 @@ describe(`Process JSON nodes correctly`, () => { const createNode = jest.fn() const createParentChildLink = jest.fn() const actions = { createNode, createParentChildLink } + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) await onCreateNode({ node, loadNodeContent, actions, + createNodeId, }).then(() => { expect(createNode.mock.calls).toMatchSnapshot() expect(createParentChildLink.mock.calls).toMatchSnapshot() @@ -50,11 +52,14 @@ describe(`Process JSON nodes correctly`, () => { const createNode = jest.fn() const createParentChildLink = jest.fn() const actions = { createNode, createParentChildLink } + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) await onCreateNode({ node, loadNodeContent, actions, + createNodeId, }).then(() => { expect(createNode.mock.calls).toMatchSnapshot() expect(createParentChildLink.mock.calls).toMatchSnapshot() @@ -62,48 +67,4 @@ describe(`Process JSON nodes correctly`, () => { expect(createParentChildLink).toHaveBeenCalledTimes(1) }) }) - - it(`If the object has an id, it uses that as the id instead of an autogenerated one`, async () => { - const data = [ - { id: `foo`, blue: true, funny: `yup` }, - { blue: false, funny: `nope` }, - ] - node.content = JSON.stringify(data) - - const createNode = jest.fn() - const createParentChildLink = jest.fn() - const actions = { createNode, createParentChildLink } - - await onCreateNode({ - node, - loadNodeContent, - actions, - }).then(() => { - expect(createNode.mock.calls[0][0].id).toEqual(`foo`) - }) - }) - - it(`the different objects shouldn't get the same ID even if they have the same content`, async () => { - const data = [ - { id: `foo`, blue: true, funny: `yup` }, - { blue: false, funny: `nope` }, - { blue: false, funny: `nope` }, - { green: false, funny: `nope` }, - ] - node.content = JSON.stringify(data) - - const createNode = jest.fn() - const createParentChildLink = jest.fn() - const actions = { createNode, createParentChildLink } - - await onCreateNode({ - node, - loadNodeContent, - actions, - }).then(() => { - const ids = createNode.mock.calls.map(object => object[0].id) - // Test that they're unique - expect(_.uniq(ids).length).toEqual(4) - }) - }) }) diff --git a/packages/gatsby-transformer-json/src/gatsby-node.js b/packages/gatsby-transformer-json/src/gatsby-node.js index c886d6d98592a..a5be138b70bf8 100644 --- a/packages/gatsby-transformer-json/src/gatsby-node.js +++ b/packages/gatsby-transformer-json/src/gatsby-node.js @@ -2,7 +2,7 @@ const _ = require(`lodash`) const crypto = require(`crypto`) const path = require(`path`) -async function onCreateNode({ node, actions, loadNodeContent }) { +async function onCreateNode({ node, actions, loadNodeContent, createNodeId }) { function transformObject(obj, id, type) { const objStr = JSON.stringify(obj) const contentDigest = crypto @@ -37,14 +37,14 @@ async function onCreateNode({ node, actions, loadNodeContent }) { parsedContent.forEach((obj, i) => { transformObject( obj, - obj.id ? obj.id : `${node.id} [${i}] >>> JSON`, + obj.id ? obj.id : createNodeId(`${node.id} [${i}] >>> JSON`), _.upperFirst(_.camelCase(`${node.name} Json`)) ) }) } else if (_.isPlainObject(parsedContent)) { transformObject( parsedContent, - parsedContent.id ? parsedContent.id : `${node.id} >>> JSON`, + parsedContent.id ? parsedContent.id : createNodeId(`${node.id} >>> JSON`), _.upperFirst(_.camelCase(`${path.basename(node.dir)} Json`)) ) } diff --git a/packages/gatsby-transformer-react-docgen/package.json b/packages/gatsby-transformer-react-docgen/package.json index 83ab407db28e8..55e37c0ae5ee7 100644 --- a/packages/gatsby-transformer-react-docgen/package.json +++ b/packages/gatsby-transformer-react-docgen/package.json @@ -1,6 +1,6 @@ { "name": "gatsby-transformer-react-docgen", - "version": "1.0.12", + "version": "2.0.0", "description": "Expose React component metadata and prop information as GraphQL types", "main": "index.js", "scripts": { diff --git a/packages/gatsby-transformer-react-docgen/src/__tests__/on-node-create.js b/packages/gatsby-transformer-react-docgen/src/__tests__/on-node-create.js index 057a09312a667..729b4c2cd8430 100644 --- a/packages/gatsby-transformer-react-docgen/src/__tests__/on-node-create.js +++ b/packages/gatsby-transformer-react-docgen/src/__tests__/on-node-create.js @@ -14,12 +14,15 @@ const readFile = file => describe(`transformer-react-doc-gen: onCreateNode`, () => { let loadNodeContent, actions, node, createdNodes, updatedNodes + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) let run = (node, opts = {}) => onCreateNode( { node, loadNodeContent, actions, + createNodeId, }, opts ) diff --git a/packages/gatsby-transformer-react-docgen/src/on-node-create.js b/packages/gatsby-transformer-react-docgen/src/on-node-create.js index 288339d47c253..9446b8e7a0d03 100644 --- a/packages/gatsby-transformer-react-docgen/src/on-node-create.js +++ b/packages/gatsby-transformer-react-docgen/src/on-node-create.js @@ -10,12 +10,12 @@ const digest = str => const propsId = (parentId, name) => `${parentId}--ComponentProp-${name}` const descId = parentId => `${parentId}--ComponentDescription` -function createDescriptionNode(node, entry, actions) { +function createDescriptionNode(node, entry, actions, createNodeId) { if (!entry.description) return node const { createNode } = actions const descriptionNode = { - id: descId(node.id), + id: createNodeId(descId(node.id)), parent: node.id, children: [], text: entry.description, @@ -34,7 +34,7 @@ function createDescriptionNode(node, entry, actions) { return node } -function createPropNodes(node, component, actions) { +function createPropNodes(node, component, actions, createNodeId) { const { createNode } = actions let children = new Array(component.props.length) @@ -44,7 +44,7 @@ function createPropNodes(node, component, actions) { let propNode = { ...prop, - id: propNodeId, + id: createNodeId(propNodeId), children: [], parent: node.id, parentType: prop.type, @@ -54,7 +54,7 @@ function createPropNodes(node, component, actions) { }, } children[i] = propNode.id - propNode = createDescriptionNode(propNode, prop, actions) + propNode = createDescriptionNode(propNode, prop, actions, createNodeId) createNode(propNode) }) @@ -64,7 +64,7 @@ function createPropNodes(node, component, actions) { } export default function onCreateNode( - { node, loadNodeContent, actions }, + { node, loadNodeContent, actions, createNodeId }, pluginOptions ) { const { createNode, createParentChildLink } = actions @@ -87,7 +87,7 @@ export default function onCreateNode( let metadataNode = { ...component, props: null, // handled by the prop node creation - id: nodeId, + id: createNodeId(nodeId), children: [], parent: node.id, internal: { @@ -97,8 +97,8 @@ export default function onCreateNode( } createParentChildLink({ parent: node, child: metadataNode }) - metadataNode = createPropNodes(metadataNode, component, actions) - metadataNode = createDescriptionNode(metadataNode, component, actions) + metadataNode = createPropNodes(metadataNode, component, actions, createNodeId) + metadataNode = createDescriptionNode(metadataNode, component, actions, createNodeId) createNode(metadataNode) }) }) diff --git a/packages/gatsby-transformer-remark/package.json b/packages/gatsby-transformer-remark/package.json index 19410fcc926b0..83b0aa7fb1189 100644 --- a/packages/gatsby-transformer-remark/package.json +++ b/packages/gatsby-transformer-remark/package.json @@ -1,7 +1,7 @@ { "name": "gatsby-transformer-remark", "description": "Gatsby transformer plugin for Markdown using the Remark library and ecosystem", - "version": "1.7.29", + "version": "2.0.0", "author": "Kyle Mathews ", "dependencies": { "@babel/runtime": "^7.0.0-beta.38", diff --git a/packages/gatsby-transformer-remark/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-transformer-remark/src/__tests__/__snapshots__/gatsby-node.js.snap index 9f85b30cbbf61..fbeb9fa7cd1e8 100644 --- a/packages/gatsby-transformer-remark/src/__tests__/__snapshots__/gatsby-node.js.snap +++ b/packages/gatsby-transformer-remark/src/__tests__/__snapshots__/gatsby-node.js.snap @@ -12,7 +12,7 @@ Array [ "parent": "whatever", "title": "my little pony", }, - "id": "whatever >>> MarkdownRemark", + "id": "uuid-from-gatsby", "internal": Object { "content": "--- title: \\"my little pony\\" @@ -42,7 +42,7 @@ Array [ "parent": "whatever", "title": "my little pony", }, - "id": "whatever >>> MarkdownRemark", + "id": "uuid-from-gatsby", "internal": Object { "content": "--- title: \\"my little pony\\" @@ -90,7 +90,7 @@ In quis lectus sed eros efficitur luctus. Morbi tempor, nisl eget feugiat tincid "parent": "whatever", "title": "my little pony", }, - "id": "whatever >>> MarkdownRemark", + "id": "uuid-from-gatsby", "internal": Object { "content": "--- title: \\"my little pony\\" @@ -134,7 +134,7 @@ In quis lectus sed eros efficitur luctus. Morbi tempor, nisl eget feugiat tincid "parent": "whatever", "title": "my little pony", }, - "id": "whatever >>> MarkdownRemark", + "id": "uuid-from-gatsby", "internal": Object { "content": "--- title: \\"my little pony\\" diff --git a/packages/gatsby-transformer-remark/src/__tests__/extend-node.js b/packages/gatsby-transformer-remark/src/__tests__/extend-node.js index 02fa981dd2588..2801700f58285 100644 --- a/packages/gatsby-transformer-remark/src/__tests__/extend-node.js +++ b/packages/gatsby-transformer-remark/src/__tests__/extend-node.js @@ -90,11 +90,14 @@ Where oh where is my little pony? } const createParentChildLink = jest.fn() const actions = { createNode, createParentChildLink } + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) await onCreateNode({ node, loadNodeContent, actions, + createNodeId, }) }) }) diff --git a/packages/gatsby-transformer-remark/src/__tests__/gatsby-node.js b/packages/gatsby-transformer-remark/src/__tests__/gatsby-node.js index 0ceec296edf08..1ed75c66d9edc 100644 --- a/packages/gatsby-transformer-remark/src/__tests__/gatsby-node.js +++ b/packages/gatsby-transformer-remark/src/__tests__/gatsby-node.js @@ -39,11 +39,14 @@ Where oh where is my little pony? const createNode = jest.fn() const createParentChildLink = jest.fn() const actions = { createNode, createParentChildLink } + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) await onCreateNode({ node, loadNodeContent, actions, + createNodeId, }).then(() => { expect(createNode.mock.calls).toMatchSnapshot() expect( @@ -78,12 +81,15 @@ Sed bibendum sem iaculis, pellentesque leo sed, imperdiet ante. Sed consequat ma const createNode = jest.fn() const createParentChildLink = jest.fn() const actions = { createNode, createParentChildLink } + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) await onCreateNode( { node, loadNodeContent, actions, + createNodeId, }, { excerpt_separator: `` } ).then(() => { @@ -186,12 +192,15 @@ In quis lectus sed eros efficitur luctus. Morbi tempor, nisl eget feugiat tincid const createParentChildLink = jest.fn() const actions = { createNode, createParentChildLink } + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) onCreateNode( { node, loadNodeContent, actions, + createNodeId, }, { excerpt_separator: `` } ) @@ -239,11 +248,14 @@ Sed bibendum sem iaculis, pellentesque leo sed, imperdiet ante. Sed consequat ma const createParentChildLink = jest.fn() const actions = { createNode, createParentChildLink } + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) onCreateNode({ node, loadNodeContent, actions, + createNodeId, }) }) }) diff --git a/packages/gatsby-transformer-remark/src/on-node-create.js b/packages/gatsby-transformer-remark/src/on-node-create.js index cbcb2c047e7bf..d7e37d82510e0 100644 --- a/packages/gatsby-transformer-remark/src/on-node-create.js +++ b/packages/gatsby-transformer-remark/src/on-node-create.js @@ -3,7 +3,7 @@ const crypto = require(`crypto`) const _ = require(`lodash`) module.exports = async function onCreateNode( - { node, getNode, loadNodeContent, actions }, + { node, getNode, loadNodeContent, actions, createNodeId }, pluginOptions ) { const { createNode, createParentChildLink } = actions @@ -36,7 +36,7 @@ module.exports = async function onCreateNode( .update(JSON.stringify(data)) .digest(`hex`) const markdownNode = { - id: `${node.id} >>> MarkdownRemark`, + id: createNodeId(`${node.id} >>> MarkdownRemark`), children: [], parent: node.id, internal: { diff --git a/packages/gatsby-transformer-sharp/package.json b/packages/gatsby-transformer-sharp/package.json index 92f1f2cc90c98..f525caac6b9fd 100644 --- a/packages/gatsby-transformer-sharp/package.json +++ b/packages/gatsby-transformer-sharp/package.json @@ -1,6 +1,6 @@ { "name": "gatsby-transformer-sharp", - "version": "1.6.17", + "version": "2.0.0", "description": "Gatsby transformer plugin for images using Sharp", "scripts": { "build": "babel src --out-dir . --ignore **/__tests__/**", diff --git a/packages/gatsby-transformer-sharp/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-transformer-sharp/src/__tests__/__snapshots__/gatsby-node.js.snap index aa7f28cbab761..8c50432d9ed1f 100644 --- a/packages/gatsby-transformer-sharp/src/__tests__/__snapshots__/gatsby-node.js.snap +++ b/packages/gatsby-transformer-sharp/src/__tests__/__snapshots__/gatsby-node.js.snap @@ -5,7 +5,7 @@ Array [ Array [ Object { "children": Array [], - "id": "whatever >> ImageSharp", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "whatever", "type": "ImageSharp", @@ -22,7 +22,7 @@ Array [ Object { "child": Object { "children": Array [], - "id": "whatever >> ImageSharp", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "whatever", "type": "ImageSharp", diff --git a/packages/gatsby-transformer-sharp/src/__tests__/gatsby-node.js b/packages/gatsby-transformer-sharp/src/__tests__/gatsby-node.js index 4335a097b32c9..ad1adb04a46e5 100644 --- a/packages/gatsby-transformer-sharp/src/__tests__/gatsby-node.js +++ b/packages/gatsby-transformer-sharp/src/__tests__/gatsby-node.js @@ -13,10 +13,13 @@ describe(`Process image nodes correctly`, () => { const createNode = jest.fn() const createParentChildLink = jest.fn() const actions = { createNode, createParentChildLink } + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) await onCreateNode({ node, actions, + createNodeId, }).then(() => { expect(createNode.mock.calls).toMatchSnapshot() expect(createParentChildLink.mock.calls).toMatchSnapshot() diff --git a/packages/gatsby-transformer-sharp/src/on-node-create.js b/packages/gatsby-transformer-sharp/src/on-node-create.js index 40354e7180057..455948841d1ad 100644 --- a/packages/gatsby-transformer-sharp/src/on-node-create.js +++ b/packages/gatsby-transformer-sharp/src/on-node-create.js @@ -1,6 +1,6 @@ const _ = require(`lodash`) -module.exports = async function onCreateNode({ node, actions }) { +module.exports = async function onCreateNode({ node, actions, createNodeId }) { const { createNode, createParentChildLink } = actions const extensions = [`jpeg`, `jpg`, `png`, `webp`, `tif`, `tiff`] @@ -9,7 +9,7 @@ module.exports = async function onCreateNode({ node, actions }) { } const imageNode = { - id: `${node.id} >> ImageSharp`, + id: createNodeId(`${node.id} >> ImageSharp`), children: [], parent: node.id, internal: { diff --git a/packages/gatsby-transformer-toml/package.json b/packages/gatsby-transformer-toml/package.json index 6950db43e759f..ce90fd1991230 100644 --- a/packages/gatsby-transformer-toml/package.json +++ b/packages/gatsby-transformer-toml/package.json @@ -1,6 +1,6 @@ { "name": "gatsby-transformer-toml", - "version": "1.1.7", + "version": "2.0.0", "description": "Gatsby transformer plugin for toml", "scripts": { "build": "babel src --out-dir . --ignore **/__tests__/**", diff --git a/packages/gatsby-transformer-toml/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-transformer-toml/src/__tests__/__snapshots__/gatsby-node.js.snap index fc0cfcd2f7337..2521d1e0dcac2 100644 --- a/packages/gatsby-transformer-toml/src/__tests__/__snapshots__/gatsby-node.js.snap +++ b/packages/gatsby-transformer-toml/src/__tests__/__snapshots__/gatsby-node.js.snap @@ -5,7 +5,7 @@ Array [ Array [ Object { "children": Array [], - "id": "whatever >>> TOML", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "9ce7919cb3f607a0542bac4aa46136b6", "type": "", @@ -43,7 +43,7 @@ Array [ Object { "child": Object { "children": Array [], - "id": "whatever >>> TOML", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "9ce7919cb3f607a0542bac4aa46136b6", "type": "", diff --git a/packages/gatsby-transformer-toml/src/__tests__/gatsby-node.js b/packages/gatsby-transformer-toml/src/__tests__/gatsby-node.js index 71885b5ae7561..e827bfed37104 100644 --- a/packages/gatsby-transformer-toml/src/__tests__/gatsby-node.js +++ b/packages/gatsby-transformer-toml/src/__tests__/gatsby-node.js @@ -40,11 +40,14 @@ describe(`Process TOML nodes correctly`, () => { const createNode = jest.fn() const createParentChildLink = jest.fn() const actions = { createNode, createParentChildLink } + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) await onCreateNode({ node, loadNodeContent, actions, + createNodeId, }).then(() => { expect(createNode.mock.calls).toMatchSnapshot() expect(createParentChildLink.mock.calls).toMatchSnapshot() @@ -53,26 +56,6 @@ describe(`Process TOML nodes correctly`, () => { }) }) - it(`If the object has an id, it uses that as the id instead of the auto-generated one`, async () => { - node.content = ` - id = 'foo' - blue = true - funny = 'yup' - ` - - const createNode = jest.fn() - const createParentChildLink = jest.fn() - const actions = { createNode, createParentChildLink } - - await onCreateNode({ - node, - loadNodeContent, - actions, - }).then(() => { - expect(createNode.mock.calls[0][0].id).toEqual(`foo`) - }) - }) - // Since TOML transformer doesn't generate sub-objects from arrays, // but directly uses the object, 'id' uniqueness tests between sub-objects // are omitted. diff --git a/packages/gatsby-transformer-toml/src/gatsby-node.js b/packages/gatsby-transformer-toml/src/gatsby-node.js index 2e063bcf0faf2..8cb73188590d9 100644 --- a/packages/gatsby-transformer-toml/src/gatsby-node.js +++ b/packages/gatsby-transformer-toml/src/gatsby-node.js @@ -2,7 +2,7 @@ const toml = require(`toml`) const _ = require(`lodash`) const crypto = require(`crypto`) -async function onCreateNode({ node, actions, loadNodeContent }) { +async function onCreateNode({ node, actions, loadNodeContent, createNodeId }) { const { createNode, createParentChildLink } = actions // Filter out non-toml content // Currently TOML files are considered 'application/octet-stream' in 'mime-db' @@ -26,7 +26,9 @@ async function onCreateNode({ node, actions, loadNodeContent }) { const newNode = { ...parsedContent, - id: parsedContent.id ? parsedContent.id : `${node.id} >>> TOML`, + id: parsedContent.id + ? parsedContent.id + : createNodeId(`${node.id} >>> TOML`), children: [], parent: node.id, internal: { diff --git a/packages/gatsby-transformer-xml/package.json b/packages/gatsby-transformer-xml/package.json index a60eec5b5f306..42d36733fd2e0 100644 --- a/packages/gatsby-transformer-xml/package.json +++ b/packages/gatsby-transformer-xml/package.json @@ -1,6 +1,6 @@ { "name": "gatsby-transformer-xml", - "version": "1.0.11", + "version": "2.0.0", "description": "Stub description for gatsby-transformer-xml", "main": "index.js", "scripts": { diff --git a/packages/gatsby-transformer-xml/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-transformer-xml/src/__tests__/__snapshots__/gatsby-node.js.snap index ebaca6b0c2835..41e05996c2a80 100644 --- a/packages/gatsby-transformer-xml/src/__tests__/__snapshots__/gatsby-node.js.snap +++ b/packages/gatsby-transformer-xml/src/__tests__/__snapshots__/gatsby-node.js.snap @@ -9,9 +9,9 @@ Array [ }, "children": Array [], "content": "", - "id": "bk101", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "446732570969e52599dded1ba4941b65", + "contentDigest": "4fa0c7a57664d1566dba2f85176f62cf", "type": "NodeNameXml", }, "name": "book", @@ -50,7 +50,7 @@ Array [ Object { "attributes": Object {}, "children": Array [], - "content": "An in-depth look at creating applications + "content": "An in-depth look at creating applications with XML.", "name": "description", }, @@ -64,9 +64,9 @@ Array [ }, "children": Array [], "content": "", - "id": "bk102", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "f1aadb72f7fc4e80a8b0f44899a4c30c", + "contentDigest": "d01ca541dbe1148c59883a673342df9b", "type": "NodeNameXml", }, "name": "book", @@ -105,8 +105,8 @@ Array [ Object { "attributes": Object {}, "children": Array [], - "content": "A former architect battles corporate zombies, - an evil sorceress, and her own childhood to become queen + "content": "A former architect battles corporate zombies, + an evil sorceress, and her own childhood to become queen of the world.", "name": "description", }, @@ -126,9 +126,9 @@ Array [ }, "children": Array [], "content": "", - "id": "bk101", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "446732570969e52599dded1ba4941b65", + "contentDigest": "4fa0c7a57664d1566dba2f85176f62cf", "type": "NodeNameXml", }, "name": "book", @@ -167,7 +167,7 @@ Array [ Object { "attributes": Object {}, "children": Array [], - "content": "An in-depth look at creating applications + "content": "An in-depth look at creating applications with XML.", "name": "description", }, @@ -184,7 +184,7 @@ Array [ Computer 44.95 2000-10-01 - An in-depth look at creating applications + An in-depth look at creating applications with XML. @@ -193,8 +193,8 @@ Array [ Fantasy 5.95 2000-12-16 - A former architect battles corporate zombies, - an evil sorceress, and her own childhood to become queen + A former architect battles corporate zombies, + an evil sorceress, and her own childhood to become queen of the world. @@ -218,9 +218,9 @@ Array [ }, "children": Array [], "content": "", - "id": "bk102", + "id": "uuid-from-gatsby", "internal": Object { - "contentDigest": "f1aadb72f7fc4e80a8b0f44899a4c30c", + "contentDigest": "d01ca541dbe1148c59883a673342df9b", "type": "NodeNameXml", }, "name": "book", @@ -259,8 +259,8 @@ Array [ Object { "attributes": Object {}, "children": Array [], - "content": "A former architect battles corporate zombies, - an evil sorceress, and her own childhood to become queen + "content": "A former architect battles corporate zombies, + an evil sorceress, and her own childhood to become queen of the world.", "name": "description", }, @@ -277,7 +277,7 @@ Array [ Computer 44.95 2000-10-01 - An in-depth look at creating applications + An in-depth look at creating applications with XML. @@ -286,8 +286,8 @@ Array [ Fantasy 5.95 2000-12-16 - A former architect battles corporate zombies, - an evil sorceress, and her own childhood to become queen + A former architect battles corporate zombies, + an evil sorceress, and her own childhood to become queen of the world. diff --git a/packages/gatsby-transformer-xml/src/__tests__/gatsby-node.js b/packages/gatsby-transformer-xml/src/__tests__/gatsby-node.js index 4312f0c67520d..4bcdf3f08728c 100644 --- a/packages/gatsby-transformer-xml/src/__tests__/gatsby-node.js +++ b/packages/gatsby-transformer-xml/src/__tests__/gatsby-node.js @@ -45,11 +45,14 @@ describe(`Process XML nodes correctly`, () => { const createNode = jest.fn() const createParentChildLink = jest.fn() const actions = { createNode, createParentChildLink } + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) await onCreateNode({ node, loadNodeContent, actions, + createNodeId, }).then(() => { expect(createNode.mock.calls).toMatchSnapshot() expect(createParentChildLink.mock.calls).toMatchSnapshot() @@ -57,17 +60,4 @@ describe(`Process XML nodes correctly`, () => { expect(createParentChildLink).toHaveBeenCalledTimes(2) }) }) - it(`should set the node id to the attribute id if specified`, async () => { - const createNode = jest.fn() - const createParentChildLink = jest.fn() - const actions = { createNode, createParentChildLink } - - await onCreateNode({ - node, - loadNodeContent, - actions, - }).then(() => { - expect(createNode.mock.calls[0][0].id).toEqual(`bk101`) - }) - }) }) diff --git a/packages/gatsby-transformer-xml/src/gatsby-node.js b/packages/gatsby-transformer-xml/src/gatsby-node.js index b868d69659209..5ae418aa3ab1e 100644 --- a/packages/gatsby-transformer-xml/src/gatsby-node.js +++ b/packages/gatsby-transformer-xml/src/gatsby-node.js @@ -2,7 +2,7 @@ const parseXml = require(`xml-parser`) const crypto = require(`crypto`) const _ = require(`lodash`) -async function onCreateNode({ node, actions, loadNodeContent }) { +async function onCreateNode({ node, actions, loadNodeContent, createNodeId }) { const { createNode, createParentChildLink } = actions // We only care about XML content. @@ -23,7 +23,9 @@ async function onCreateNode({ node, actions, loadNodeContent }) { } return { ...obj, - id: obj.attributes.id ? obj.attributes.id : `${node.id} [${i}] >>> XML`, + id: obj.attributes.id + ? obj.attributes.id + : createNodeId(`${node.id} [${i}] >>> XML`), parent: node.id, children: [], internal: { diff --git a/packages/gatsby-transformer-yaml/package.json b/packages/gatsby-transformer-yaml/package.json index a4705dee67b2e..493d185913e77 100644 --- a/packages/gatsby-transformer-yaml/package.json +++ b/packages/gatsby-transformer-yaml/package.json @@ -1,6 +1,6 @@ { "name": "gatsby-transformer-yaml", - "version": "1.5.14", + "version": "2.0.0", "description": "Gatsby transformer plugin for yaml", "scripts": { "build": "babel src --out-dir . --ignore **/__tests__/**", diff --git a/packages/gatsby-transformer-yaml/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-transformer-yaml/src/__tests__/__snapshots__/gatsby-node.js.snap index b46019684b2c9..e85e2e1c228c0 100644 --- a/packages/gatsby-transformer-yaml/src/__tests__/__snapshots__/gatsby-node.js.snap +++ b/packages/gatsby-transformer-yaml/src/__tests__/__snapshots__/gatsby-node.js.snap @@ -7,7 +7,7 @@ Array [ "blue": true, "children": Array [], "funny": "yup", - "id": "whatever >>> YAML", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "73901821b17d5aa9dd6026181f73b64c", "type": "BarYaml", @@ -26,7 +26,7 @@ Array [ "blue": true, "children": Array [], "funny": "yup", - "id": "whatever >>> YAML", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "73901821b17d5aa9dd6026181f73b64c", "type": "BarYaml", @@ -59,7 +59,7 @@ Array [ "blue": true, "children": Array [], "funny": "yup", - "id": "whatever [0] >>> YAML", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "73901821b17d5aa9dd6026181f73b64c", "type": "TestYaml", @@ -72,7 +72,7 @@ Array [ "blue": false, "children": Array [], "funny": "nope", - "id": "whatever [1] >>> YAML", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "f624311d932d73dcd416d2a8bea2b67d", "type": "TestYaml", @@ -91,7 +91,7 @@ Array [ "blue": true, "children": Array [], "funny": "yup", - "id": "whatever [0] >>> YAML", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "73901821b17d5aa9dd6026181f73b64c", "type": "TestYaml", @@ -121,7 +121,7 @@ Array [ "blue": false, "children": Array [], "funny": "nope", - "id": "whatever [1] >>> YAML", + "id": "uuid-from-gatsby", "internal": Object { "contentDigest": "f624311d932d73dcd416d2a8bea2b67d", "type": "TestYaml", diff --git a/packages/gatsby-transformer-yaml/src/__tests__/gatsby-node.js b/packages/gatsby-transformer-yaml/src/__tests__/gatsby-node.js index 458daa6d6aee4..5dd263d88ea93 100644 --- a/packages/gatsby-transformer-yaml/src/__tests__/gatsby-node.js +++ b/packages/gatsby-transformer-yaml/src/__tests__/gatsby-node.js @@ -1,6 +1,5 @@ const Promise = require(`bluebird`) const yaml = require(`js-yaml`) -const _ = require(`lodash`) const { onCreateNode } = require(`../gatsby-node`) @@ -26,11 +25,14 @@ describe(`Process YAML nodes correctly`, () => { const createNode = jest.fn() const createParentChildLink = jest.fn() const actions = { createNode, createParentChildLink } + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) await onCreateNode({ node, loadNodeContent, actions, + createNodeId, }).then(() => { expect(createNode.mock.calls).toMatchSnapshot() expect(createParentChildLink.mock.calls).toMatchSnapshot() @@ -47,11 +49,14 @@ describe(`Process YAML nodes correctly`, () => { const createNode = jest.fn() const createParentChildLink = jest.fn() const actions = { createNode, createParentChildLink } + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) await onCreateNode({ node, loadNodeContent, actions, + createNodeId, }).then(() => { expect(createNode.mock.calls).toMatchSnapshot() expect(createParentChildLink.mock.calls).toMatchSnapshot() @@ -59,48 +64,4 @@ describe(`Process YAML nodes correctly`, () => { expect(createParentChildLink).toHaveBeenCalledTimes(1) }) }) - - it(`If the object has an id, it uses that as the id instead of the auto-generated one`, async () => { - const data = [ - { id: `foo`, blue: true, funny: `yup` }, - { blue: false, funny: `nope` }, - ] - node.content = yaml.safeDump(data) - - const createNode = jest.fn() - const createParentChildLink = jest.fn() - const actions = { createNode, createParentChildLink } - - await onCreateNode({ - node, - loadNodeContent, - actions, - }).then(() => { - expect(createNode.mock.calls[0][0].id).toEqual(`foo`) - }) - }) - - it(`the different objects shouldn't get the same ID even if they have the same content`, async () => { - const data = [ - { id: `foo`, blue: true, funny: `yup` }, - { blue: false, funny: `nope` }, - { blue: false, funny: `nope` }, - { green: false, funny: `nope` }, - ] - node.content = yaml.safeDump(data) - - const createNode = jest.fn() - const createParentChildLink = jest.fn() - const actions = { createNode, createParentChildLink } - - await onCreateNode({ - node, - loadNodeContent, - actions, - }).then(() => { - const ids = createNode.mock.calls.map(object => object[0].id) - // Test that they're unique - expect(_.uniq(ids).length).toEqual(4) - }) - }) }) diff --git a/packages/gatsby-transformer-yaml/src/gatsby-node.js b/packages/gatsby-transformer-yaml/src/gatsby-node.js index bf9097cdd4049..94478d9846045 100644 --- a/packages/gatsby-transformer-yaml/src/gatsby-node.js +++ b/packages/gatsby-transformer-yaml/src/gatsby-node.js @@ -3,7 +3,7 @@ const _ = require(`lodash`) const crypto = require(`crypto`) const path = require(`path`) -async function onCreateNode({ node, actions, loadNodeContent }) { +async function onCreateNode({ node, actions, loadNodeContent, createNodeId }) { function transformObject(obj, id, type) { const objStr = JSON.stringify(obj) const contentDigest = crypto @@ -37,14 +37,14 @@ async function onCreateNode({ node, actions, loadNodeContent }) { parsedContent.forEach((obj, i) => { transformObject( obj, - obj.id ? obj.id : `${node.id} [${i}] >>> YAML`, + obj.id ? obj.id : createNodeId(`${node.id} [${i}] >>> YAML`), _.upperFirst(_.camelCase(`${node.name} Yaml`)) ) }) } else if (_.isPlainObject(parsedContent)) { transformObject( parsedContent, - parsedContent.id ? parsedContent.id : `${node.id} >>> YAML`, + parsedContent.id ? parsedContent.id : createNodeId(`${node.id} >>> YAML`), _.upperFirst(_.camelCase(`${path.basename(node.dir)} Yaml`)) ) } diff --git a/packages/gatsby/src/bootstrap/__tests__/__snapshots__/load-plugins.js.snap b/packages/gatsby/src/bootstrap/__tests__/__snapshots__/load-plugins.js.snap index 5b87a2422b84b..ef207e1840e79 100644 --- a/packages/gatsby/src/bootstrap/__tests__/__snapshots__/load-plugins.js.snap +++ b/packages/gatsby/src/bootstrap/__tests__/__snapshots__/load-plugins.js.snap @@ -66,10 +66,7 @@ Array [ Object { "id": "Plugin query-runner", "name": "query-runner", - "nodeAPIs": Array [ - "onCreatePage", - "onCreateLayout", - ], + "nodeAPIs": Array [], "pluginOptions": Object { "plugins": Array [], }, @@ -163,10 +160,7 @@ Array [ Object { "id": "Plugin query-runner", "name": "query-runner", - "nodeAPIs": Array [ - "onCreatePage", - "onCreateLayout", - ], + "nodeAPIs": Array [], "pluginOptions": Object { "plugins": Array [], },