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 70049c3a764ed..55d8e35e12714 100644 --- a/packages/gatsby-source-contentful/src/__tests__/__snapshots__/normalize.js.snap +++ b/packages/gatsby-source-contentful/src/__tests__/__snapshots__/normalize.js.snap @@ -1497,62 +1497,103 @@ Our Lemnos products are made carefully by our craftsmen finely honed skillful te Array [ Object { "fields": Object { - "translations": Object { - "de": Object { - "hello": "hallo", - "no": "nein", - }, + "jsonTest": Object { "en-US": Object { - "hello": "hello", - "no": "no", + "devDependencies": Object { + "babel-cli": "^6.26.0", + "babel-eslint": "^7.2.3", + "babel-jest": "^20.0.3", + "babel-plugin-add-module-exports": "^0.2.1", + "babel-plugin-lodash": "^3.2.11", + "babel-plugin-transform-async-to-generator": "^6.24.1", + "babel-plugin-transform-flow-strip-types": "^6.22.0", + "babel-plugin-transform-runtime": "^6.23.0", + "babel-preset-env": "^1.6.0", + "babel-preset-flow": "^6.23.0", + "babel-preset-react": "^6.24.1", + "babel-preset-stage-0": "^6.24.1", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "chokidar": "^1.7.0", + "cross-env": "^5.0.5", + "eslint": "^4.5.0", + "eslint-config-google": "^0.9.1", + "eslint-config-prettier": "^2.5.0", + "eslint-plugin-flow-vars": "^0.5.0", + "eslint-plugin-flowtype": "^2.35.0", + "eslint-plugin-import": "^2.7.0", + "eslint-plugin-jsx-a11y": "^6.0.2", + "eslint-plugin-prettier": "^2.2.0", + "eslint-plugin-react": "^7.3.0", + "flow-bin": "^0.42.0", + "glob": "^7.1.1", + "jest": "^20.0.4", + "jest-cli": "^20.0.4", + "lerna": "^2.1.1", + "plop": "^1.8.1", + "prettier": "^1.7.0", + "prettier-eslint-cli": "4.2.x", + "remotedev-server": "^0.2.3", + "rimraf": "^2.6.1", + }, + "engines": Object { + "yarn": "^1.2.1", + }, + "eslintIgnore": Array [ + "interfaces", + "**/__tests__/fixtures/", + ], + "private": true, + "scripts": Object { + "bootstrap": "yarn && npm run check-versions && lerna run prepublish", + "check-versions": "babel-node scripts/check-versions.js", + "format": "npm run format-packages && npm run format-cache-dir && npm run format-www && npm run format-examples && npm run format-scripts", + "format-cache-dir": "prettier-eslint --write \\"packages/gatsby/cache-dir/*.js\\"", + "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-scripts": "prettier-eslint --write \\"scripts/**/*.js\\"", + "format-www": "prettier-eslint --write \\"www/*.js\\" \\"www/src/**/*.js\\"", + "jest": "jest", + "lerna": "lerna", + "lint": "eslint --ext .js,.jsx packages/**/src", + "lint:flow": "babel-node scripts/flow-check.js", + "plop": "plop", + "publish": "lerna publish", + "publish-canary": "lerna publish --canary --yes", + "publish-next": "lerna publish --npm-tag=next", + "remotedev": "remotedev --hostname=localhost --port=19999", + "test": "yarn lint && yarn jest", + "test:update": "jest --updateSnapshot", + "test:watch": "jest --watch", + "test_bkup": "npm run lint && npm run test-node && npm run test-integration", + "watch": "lerna run watch --no-sort --stream --concurrency 999", + }, + "workspaces": Array [ + "packages/*", + ], }, }, }, "sys": Object { "contentType": Object { "sys": Object { - "id": "globalSettings", + "id": "jsonTest", "linkType": "ContentType", "type": "Link", }, }, - "createdAt": "2017-11-17T13:33:08.292Z", - "createdBy": Object { - "sys": Object { - "id": "2jNQ11AkTRw4aZ7RC5XD2m", - "linkType": "User", - "type": "Link", - }, - }, - "firstPublishedAt": "2017-11-17T13:33:09.688Z", - "id": "qUHfYUmG8o4MCaEWoukuu", - "publishedAt": "2017-11-17T13:33:09.688Z", - "publishedBy": Object { - "sys": Object { - "id": "2jNQ11AkTRw4aZ7RC5XD2m", - "linkType": "User", - "type": "Link", - }, - }, - "publishedCounter": 1, - "publishedVersion": 1, + "createdAt": "2017-11-28T02:16:10.604Z", + "id": "c71mfnH4QKsSsQmgoaQuq6O", + "revision": 1, "space": Object { "sys": Object { - "id": "5wvb725fovi7", + "id": "rocybtov1ozk", "linkType": "Space", "type": "Link", }, }, "type": "Entry", - "updatedAt": "2017-11-17T13:33:09.688Z", - "updatedBy": Object { - "sys": Object { - "id": "2jNQ11AkTRw4aZ7RC5XD2m", - "linkType": "User", - "type": "Link", - }, - }, - "version": 2, + "updatedAt": "2017-11-28T02:16:10.604Z", }, }, ], @@ -1671,7 +1712,7 @@ Set { "c3DVqIYj4dOwwcKu6sgqOgg", "c6dbjWqNd9SqccegcqYq224", "c4BqrajvA8E6qwgkieoqmqO", - "qUHfYUmG8o4MCaEWoukuu", + "c71mfnH4QKsSsQmgoaQuq6O", "c3wtvPBbBjiMKqKKga8I2Cu", "KTRF62Q4gg60q6WCsWKw8", "Xc0ny7GWsMEMCeASWO2um", @@ -1683,7 +1724,6 @@ Set { "wtrHxeu3zEoEce2MokCSi", "c10TkaLheGeQG6qQGqWYqUI", "c6s3iG2OVmoUcosmA8ocqsG", - "FAKE_ID_1phEMTm908mCCeYuSqCkyK", } `; @@ -2261,36 +2301,6 @@ Array [ "title": "House icon", }, ], - Array [ - Object { - "children": Array [], - "description": "", - "file": null, - "id": "FAKE_ID_1phEMTm908mCCeYuSqCkyK", - "internal": Object { - "contentDigest": "9cd202ba8ae3dd79494cd56c1ec453bc", - "type": "ContentfulAsset", - }, - "node_locale": "en-US", - "parent": null, - "title": "", - }, - ], - Array [ - Object { - "children": Array [], - "description": "", - "file": null, - "id": "FAKE_ID_1phEMTm908mCCeYuSqCkyK___de", - "internal": Object { - "contentDigest": "b9803a73e3cb3df628b452fb0aa56e88", - "type": "ContentfulAsset", - }, - "node_locale": "de", - "parent": null, - "title": "", - }, - ], ] `; @@ -3495,93 +3505,233 @@ Unsere Lemnos Produkte werden sorgfältig von unseren Handwerkern fein geschliff Array [ Object { "children": Array [], - "hello": "hello", - "id": "qUHfYUmG8o4MCaEWoukuutranslationsJSONNode", + "devDependencies": Object { + "babel-cli": "^6.26.0", + "babel-eslint": "^7.2.3", + "babel-jest": "^20.0.3", + "babel-plugin-add-module-exports": "^0.2.1", + "babel-plugin-lodash": "^3.2.11", + "babel-plugin-transform-async-to-generator": "^6.24.1", + "babel-plugin-transform-flow-strip-types": "^6.22.0", + "babel-plugin-transform-runtime": "^6.23.0", + "babel-preset-env": "^1.6.0", + "babel-preset-flow": "^6.23.0", + "babel-preset-react": "^6.24.1", + "babel-preset-stage-0": "^6.24.1", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "chokidar": "^1.7.0", + "cross-env": "^5.0.5", + "eslint": "^4.5.0", + "eslint-config-google": "^0.9.1", + "eslint-config-prettier": "^2.5.0", + "eslint-plugin-flow-vars": "^0.5.0", + "eslint-plugin-flowtype": "^2.35.0", + "eslint-plugin-import": "^2.7.0", + "eslint-plugin-jsx-a11y": "^6.0.2", + "eslint-plugin-prettier": "^2.2.0", + "eslint-plugin-react": "^7.3.0", + "flow-bin": "^0.42.0", + "glob": "^7.1.1", + "jest": "^20.0.4", + "jest-cli": "^20.0.4", + "lerna": "^2.1.1", + "plop": "^1.8.1", + "prettier": "^1.7.0", + "prettier-eslint-cli": "4.2.x", + "remotedev-server": "^0.2.3", + "rimraf": "^2.6.1", + }, + "engines": Object { + "yarn": "^1.2.1", + }, + "eslintIgnore": Array [ + "interfaces", + "**/__tests__/fixtures/", + ], + "id": "c71mfnH4QKsSsQmgoaQuq6OjsonTestJSONNode", "internal": Object { - "content": "{\\"hello\\":\\"hello\\",\\"no\\":\\"no\\"}", - "contentDigest": "96a1169aa0a87581536b752eb1a3f90a", + "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": "contentfulGlobalSettingsTranslationsJsonNode", - }, - "no": "no", - "parent": "qUHfYUmG8o4MCaEWoukuu", + "type": "contentfulJsonTestJsonTestJsonNode", + }, + "parent": "c71mfnH4QKsSsQmgoaQuq6O", + "private": true, + "scripts": Object { + "bootstrap": "yarn && npm run check-versions && lerna run prepublish", + "check-versions": "babel-node scripts/check-versions.js", + "format": "npm run format-packages && npm run format-cache-dir && npm run format-www && npm run format-examples && npm run format-scripts", + "format-cache-dir": "prettier-eslint --write \\"packages/gatsby/cache-dir/*.js\\"", + "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-scripts": "prettier-eslint --write \\"scripts/**/*.js\\"", + "format-www": "prettier-eslint --write \\"www/*.js\\" \\"www/src/**/*.js\\"", + "jest": "jest", + "lerna": "lerna", + "lint": "eslint --ext .js,.jsx packages/**/src", + "lint:flow": "babel-node scripts/flow-check.js", + "plop": "plop", + "publish": "lerna publish", + "publish-canary": "lerna publish --canary --yes", + "publish-next": "lerna publish --npm-tag=next", + "remotedev": "remotedev --hostname=localhost --port=19999", + "test": "yarn lint && yarn jest", + "test:update": "jest --updateSnapshot", + "test:watch": "jest --watch", + "test_bkup": "npm run lint && npm run test-node && npm run test-integration", + "watch": "lerna run watch --no-sort --stream --concurrency 999", + }, + "workspaces": Array [ + "packages/*", + ], }, ], Array [ Object { "children": Array [], - "description": null, + "description": "just for testing JSON fields", "displayField": null, - "id": "GlobalSettings", + "id": "JSON-test", "internal": Object { - "contentDigest": "20d71e27567eb0c8617dc38dc712e71c", + "contentDigest": "f16da69f5e198a8896039313bbcb3fa0", "type": "ContentfulContentType", }, - "name": "GlobalSettings", + "name": "JSON-test", "parent": null, }, ], Array [ Object { "children": Array [ - "qUHfYUmG8o4MCaEWoukuutranslationsJSONNode", + "c71mfnH4QKsSsQmgoaQuq6OjsonTestJSONNode", ], - "createdAt": "2017-11-17T13:33:08.292Z", - "id": "qUHfYUmG8o4MCaEWoukuu", + "createdAt": "2017-11-28T02:16:10.604Z", + "id": "c71mfnH4QKsSsQmgoaQuq6O", "internal": Object { - "contentDigest": "cc2f041d63ba14115d495d2604b169b6", - "type": "ContentfulGlobalSettings", + "contentDigest": "6dec04fa56bfd5591b46342f5ad23880", + "type": "ContentfulJsonTest", }, + "jsonTest___NODE": "c71mfnH4QKsSsQmgoaQuq6OjsonTestJSONNode", "node_locale": "en-US", - "parent": "GlobalSettings", - "translations___NODE": "qUHfYUmG8o4MCaEWoukuutranslationsJSONNode", - "updatedAt": "2017-11-17T13:33:09.688Z", - }, - ], - Array [ - Object { - "children": Array [], - "hello": "hallo", - "id": "qUHfYUmG8o4MCaEWoukuu___detranslationsJSONNode", + "parent": "JSON-test", + "updatedAt": "2017-11-28T02:16:10.604Z", + }, + ], + Array [ + Object { + "children": Array [], + "devDependencies": Object { + "babel-cli": "^6.26.0", + "babel-eslint": "^7.2.3", + "babel-jest": "^20.0.3", + "babel-plugin-add-module-exports": "^0.2.1", + "babel-plugin-lodash": "^3.2.11", + "babel-plugin-transform-async-to-generator": "^6.24.1", + "babel-plugin-transform-flow-strip-types": "^6.22.0", + "babel-plugin-transform-runtime": "^6.23.0", + "babel-preset-env": "^1.6.0", + "babel-preset-flow": "^6.23.0", + "babel-preset-react": "^6.24.1", + "babel-preset-stage-0": "^6.24.1", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "chokidar": "^1.7.0", + "cross-env": "^5.0.5", + "eslint": "^4.5.0", + "eslint-config-google": "^0.9.1", + "eslint-config-prettier": "^2.5.0", + "eslint-plugin-flow-vars": "^0.5.0", + "eslint-plugin-flowtype": "^2.35.0", + "eslint-plugin-import": "^2.7.0", + "eslint-plugin-jsx-a11y": "^6.0.2", + "eslint-plugin-prettier": "^2.2.0", + "eslint-plugin-react": "^7.3.0", + "flow-bin": "^0.42.0", + "glob": "^7.1.1", + "jest": "^20.0.4", + "jest-cli": "^20.0.4", + "lerna": "^2.1.1", + "plop": "^1.8.1", + "prettier": "^1.7.0", + "prettier-eslint-cli": "4.2.x", + "remotedev-server": "^0.2.3", + "rimraf": "^2.6.1", + }, + "engines": Object { + "yarn": "^1.2.1", + }, + "eslintIgnore": Array [ + "interfaces", + "**/__tests__/fixtures/", + ], + "id": "c71mfnH4QKsSsQmgoaQuq6O___dejsonTestJSONNode", "internal": Object { - "content": "{\\"hello\\":\\"hallo\\",\\"no\\":\\"nein\\"}", - "contentDigest": "0b30e8832d8da27bb5b1e0e4bd6b9cf7", + "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": "contentfulGlobalSettingsTranslationsJsonNode", - }, - "no": "nein", - "parent": "qUHfYUmG8o4MCaEWoukuu___de", + "type": "contentfulJsonTestJsonTestJsonNode", + }, + "parent": "c71mfnH4QKsSsQmgoaQuq6O___de", + "private": true, + "scripts": Object { + "bootstrap": "yarn && npm run check-versions && lerna run prepublish", + "check-versions": "babel-node scripts/check-versions.js", + "format": "npm run format-packages && npm run format-cache-dir && npm run format-www && npm run format-examples && npm run format-scripts", + "format-cache-dir": "prettier-eslint --write \\"packages/gatsby/cache-dir/*.js\\"", + "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-scripts": "prettier-eslint --write \\"scripts/**/*.js\\"", + "format-www": "prettier-eslint --write \\"www/*.js\\" \\"www/src/**/*.js\\"", + "jest": "jest", + "lerna": "lerna", + "lint": "eslint --ext .js,.jsx packages/**/src", + "lint:flow": "babel-node scripts/flow-check.js", + "plop": "plop", + "publish": "lerna publish", + "publish-canary": "lerna publish --canary --yes", + "publish-next": "lerna publish --npm-tag=next", + "remotedev": "remotedev --hostname=localhost --port=19999", + "test": "yarn lint && yarn jest", + "test:update": "jest --updateSnapshot", + "test:watch": "jest --watch", + "test_bkup": "npm run lint && npm run test-node && npm run test-integration", + "watch": "lerna run watch --no-sort --stream --concurrency 999", + }, + "workspaces": Array [ + "packages/*", + ], }, ], Array [ Object { "children": Array [], - "description": null, + "description": "just for testing JSON fields", "displayField": null, - "id": "GlobalSettings", + "id": "JSON-test", "internal": Object { - "contentDigest": "20d71e27567eb0c8617dc38dc712e71c", + "contentDigest": "f16da69f5e198a8896039313bbcb3fa0", "type": "ContentfulContentType", }, - "name": "GlobalSettings", + "name": "JSON-test", "parent": null, }, ], Array [ Object { "children": Array [ - "qUHfYUmG8o4MCaEWoukuu___detranslationsJSONNode", + "c71mfnH4QKsSsQmgoaQuq6O___dejsonTestJSONNode", ], - "createdAt": "2017-11-17T13:33:08.292Z", - "id": "qUHfYUmG8o4MCaEWoukuu___de", + "createdAt": "2017-11-28T02:16:10.604Z", + "id": "c71mfnH4QKsSsQmgoaQuq6O___de", "internal": Object { - "contentDigest": "450dca6f7322c3de8468a3ac9992c267", - "type": "ContentfulGlobalSettings", + "contentDigest": "52e916ec58e78fb60cf54a03e3b65abd", + "type": "ContentfulJsonTest", }, + "jsonTest___NODE": "c71mfnH4QKsSsQmgoaQuq6O___dejsonTestJSONNode", "node_locale": "de", - "parent": "GlobalSettings", - "translations___NODE": "qUHfYUmG8o4MCaEWoukuu___detranslationsJSONNode", - "updatedAt": "2017-11-17T13:33:09.688Z", + "parent": "JSON-test", + "updatedAt": "2017-11-28T02:16:10.604Z", }, ], ] diff --git a/packages/gatsby-source-contentful/src/__tests__/data.json b/packages/gatsby-source-contentful/src/__tests__/data.json index 5e4f1ee5015bb..51bcddd9d0ab7 100644 --- a/packages/gatsby-source-contentful/src/__tests__/data.json +++ b/packages/gatsby-source-contentful/src/__tests__/data.json @@ -1,6 +1,107 @@ { "currentSyncData": { "entries": [ + { + "sys": { + "space": { + "sys": { + "type": "Link", + "linkType": "Space", + "id": "rocybtov1ozk" + } + }, + "id": "c71mfnH4QKsSsQmgoaQuq6O", + "type": "Entry", + "createdAt": "2017-11-28T02:16:10.604Z", + "updatedAt": "2017-11-28T02:16:10.604Z", + "revision": 1, + "contentType": { + "sys": { + "type": "Link", + "linkType": "ContentType", + "id": "jsonTest" + } + } + }, + "fields": { + "jsonTest": { + "en-US": { + "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" + } + } + } + } + }, { "sys": { "space": { @@ -1446,66 +1547,6 @@ "en-US": "Shop for toys, games, educational aids" } } - }, - { - "sys": { - "space": { - "sys": { - "type": "Link", - "linkType": "Space", - "id": "5wvb725fovi7" - } - }, - "id": "qUHfYUmG8o4MCaEWoukuu", - "type": "Entry", - "createdAt": "2017-11-17T13:33:08.292Z", - "updatedAt": "2017-11-17T13:33:09.688Z", - "createdBy": { - "sys": { - "type": "Link", - "linkType": "User", - "id": "2jNQ11AkTRw4aZ7RC5XD2m" - } - }, - "updatedBy": { - "sys": { - "type": "Link", - "linkType": "User", - "id": "2jNQ11AkTRw4aZ7RC5XD2m" - } - }, - "publishedCounter": 1, - "version": 2, - "publishedBy": { - "sys": { - "type": "Link", - "linkType": "User", - "id": "2jNQ11AkTRw4aZ7RC5XD2m" - } - }, - "publishedVersion": 1, - "firstPublishedAt": "2017-11-17T13:33:09.688Z", - "publishedAt": "2017-11-17T13:33:09.688Z", - "contentType": { - "sys": { - "type": "Link", - "linkType": "ContentType", - "id": "globalSettings" - } - } - }, - "fields": { - "translations": { - "en-US": { - "hello": "hello", - "no": "no" - }, - "de": { - "hello": "hallo", - "no": "nein" - } - } - } } ], "assets": [ @@ -1926,29 +1967,11 @@ } } } - }, - { - "sys": { - "space": { - "sys": { - "type": "Link", - "linkType": "Space", - "id": "rocybtov1ozk" - } - }, - "type": "Asset", - "id": "FAKE_ID_1phEMTm908mCCeYuSqCkyK", - "revision": 0, - "createdAt": "2017-11-16T20:47:42.248Z", - "updatedAt": "2017-11-16T20:47:42.248Z", - "locale": "en-US" - }, - "fields": {} } ], "deletedEntries": [], "deletedAssets": [], - "nextSyncToken": "w5ZGw6JFwqZmVcKsE8Kow4grw45QdybCjsKaw4QCwqF8UBfCm1tVwqbCh8OPw55yw7jCnQtLWFfCucOIw73CiFjCsyd9eFBzOcKuwp3DkxlJw5bCuC4uw5LCj8KSwpDCqsKVwo8zS8KnLS_DisOpwrHCuSHDgBnCgWM" + "nextSyncToken": "w5ZGw6JFwqZmVcKsE8Kow4grw45QdyYzBsKbLwPDrSpwC0bCnlHDgcOhw7wMwpIRw4XCksOzGMKhJkzCrMOuCh7Cpgh2wq0Bw5sjw7jDi0DDrMOKwqoewo3DssOhw5YXfcOsw7JsIcKHwokYwpHDmRZ_KsO8w4_Dlg" }, "contentTypeItems": [ { @@ -2240,60 +2263,34 @@ ] }, { - "sys": { - "space": { - "sys": { - "type": "Link", - "linkType": "Space", - "id": "5wvb725fovi7" - } - }, - "id": "globalSettings", - "type": "ContentType", - "createdAt": "2017-11-17T13:32:48.442Z", - "updatedAt": "2017-11-17T13:32:50.137Z", - "createdBy": { - "sys": { - "type": "Link", - "linkType": "User", - "id": "2jNQ11AkTRw4aZ7RC5XD2m" - } - }, - "updatedBy": { - "sys": { - "type": "Link", - "linkType": "User", - "id": "2jNQ11AkTRw4aZ7RC5XD2m" - } - }, - "publishedCounter": 1, - "version": 2, - "publishedBy": { - "sys": { - "type": "Link", - "linkType": "User", - "id": "2jNQ11AkTRw4aZ7RC5XD2m" - } + "sys": { + "space": { + "sys": { + "type": "Link", + "linkType": "Space", + "id": "rocybtov1ozk" + } + }, + "id": "jsonTest", + "type": "ContentType", + "createdAt": "2017-11-28T02:15:46.221Z", + "updatedAt": "2017-11-28T02:15:46.221Z", + "revision": 1 }, - "publishedVersion": 1, - "firstPublishedAt": "2017-11-17T13:32:50.137Z", - "publishedAt": "2017-11-17T13:32:50.137Z" - }, - "displayField": null, - "name": "GlobalSettings", - "description": null, - "fields": [ - { - "id": "translations", - "name": "Translations", - "type": "Object", - "localized": true, - "required": false, - "validations": [], - "disabled": false, - "omitted": false - } - ] + "displayField": null, + "name": "JSON-test", + "description": "just for testing JSON fields", + "fields": [ + { + "id": "jsonTest", + "name": "json-test", + "type": "Object", + "localized": false, + "required": false, + "disabled": false, + "omitted": false + } + ] } ], "defaultLocale": "en-US", @@ -2311,4 +2308,4 @@ "fallbackCode": "en-US" } ] -} +} \ No newline at end of file