diff --git a/lib/constants.js b/lib/constants.js index b4570b6..4b34eeb 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -173,6 +173,11 @@ export const LANGUAGES = [ name: 'F# / OCaml', mode: 'mllike' }, + { + name: 'GraphQL', + mode: 'graphql', + custom: true + }, { name: 'Go', mode: 'go' diff --git a/lib/customModes/graphql.js b/lib/customModes/graphql.js new file mode 100644 index 0000000..e16c3d4 --- /dev/null +++ b/lib/customModes/graphql.js @@ -0,0 +1 @@ +export * from 'codemirror-graphql/mode' diff --git a/package.json b/package.json index f0d0d96..9bd1e5d 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "axios": "^0.17.1", "body-parser": "^1.17.2", "codemirror": "^5.31.0", + "codemirror-graphql": "^0.6.12", "codemirror-mode-elixir": "^1.1.1", "dom-to-image": "^2.5.2", "dropperx": "^0.1.0", diff --git a/yarn.lock b/yarn.lock index 3a7f55e..5c4e21e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -85,6 +85,10 @@ version "4.0.8" resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.0.8.tgz#d27600e9ba2f371e08695d90a0fe0408d89c7be7" +"@types/graphql@0.11.7": + version "0.11.7" + resolved "https://registry.yarnpkg.com/@types/graphql/-/graphql-0.11.7.tgz#da39a2f7c74e793e32e2bb7b3b68da1691532dd5" + "@types/jquery@*": version "3.2.18" resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.2.18.tgz#a1cd262034cd8c79fa4d9b2a409d8f747ac2f72f" @@ -97,6 +101,10 @@ version "4.14.87" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.87.tgz#55f92183b048c2c64402afe472f8333f4e319a6b" +"@types/lodash@^4.14.85": + version "4.14.93" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.93.tgz#a6d2a1e1601a3c29196f38ef1990b68a9afa1e1c" + "@types/minimatch@3.0.1": version "3.0.1" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.1.tgz#b683eb60be358304ef146f5775db4c0e3696a550" @@ -1379,6 +1387,13 @@ codeclimate-test-reporter@^0.5.0: lcov-parse "0.0.10" request "~2.79.0" +codemirror-graphql@^0.6.12: + version "0.6.12" + resolved "https://registry.yarnpkg.com/codemirror-graphql/-/codemirror-graphql-0.6.12.tgz#91a273fe5188857524a30221d06e645b4ca41f00" + dependencies: + graphql-language-service-interface "^1.0.16" + graphql-language-service-parser "^0.1.14" + codemirror-mode-elixir@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/codemirror-mode-elixir/-/codemirror-mode-elixir-1.1.1.tgz#cc5b79bf5f93b6da426e32364a673a681391416c" @@ -1622,6 +1637,13 @@ cross-env@^5.1.1: cross-spawn "^5.1.0" is-windows "^1.0.0" +cross-fetch@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-1.1.1.tgz#dede6865ae30f37eae62ac90ebb7bdac002b05a0" + dependencies: + node-fetch "1.7.3" + whatwg-fetch "2.0.3" + cross-spawn@5.1.0, cross-spawn@^5.0.1, cross-spawn@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" @@ -2645,6 +2667,77 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6: version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" +graphql-config@1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/graphql-config/-/graphql-config-1.1.4.tgz#af09659f877b96451838de456e4e4f4be45be6dd" + dependencies: + graphql "^0.12.3" + graphql-import "^0.1.7" + graphql-request "^1.4.0" + js-yaml "^3.10.0" + minimatch "^3.0.4" + rimraf "^2.6.2" + +graphql-import@^0.1.7: + version "0.1.9" + resolved "https://registry.yarnpkg.com/graphql-import/-/graphql-import-0.1.9.tgz#9161f4f7ea92337b60fd40e22e64d3a68c212729" + dependencies: + "@types/graphql" "0.11.7" + "@types/lodash" "^4.14.85" + graphql "^0.12.3" + lodash "^4.17.4" + +graphql-language-service-interface@^1.0.16: + version "1.0.18" + resolved "https://registry.yarnpkg.com/graphql-language-service-interface/-/graphql-language-service-interface-1.0.18.tgz#c0fc1ef72c6f6f4bf9042bd7a8a8a66e0772caa8" + dependencies: + graphql-config "1.1.4" + graphql-language-service-parser "^1.0.18" + graphql-language-service-types "^1.0.18" + graphql-language-service-utils "^1.0.18" + +graphql-language-service-parser@^0.1.14: + version "0.1.14" + resolved "https://registry.yarnpkg.com/graphql-language-service-parser/-/graphql-language-service-parser-0.1.14.tgz#dd25abda5dcff4f2268c9a19e026004271491661" + dependencies: + graphql-language-service-types "^0.1.14" + +graphql-language-service-parser@^1.0.18: + version "1.0.18" + resolved "https://registry.yarnpkg.com/graphql-language-service-parser/-/graphql-language-service-parser-1.0.18.tgz#80fe714f244fc81bc0352d0008ecafdf8fa75fe8" + dependencies: + graphql-config "1.1.4" + graphql-language-service-types "^1.0.18" + +graphql-language-service-types@^0.1.14: + version "0.1.14" + resolved "https://registry.yarnpkg.com/graphql-language-service-types/-/graphql-language-service-types-0.1.14.tgz#e6112785fc23ea8222f59a7f00e61b359f263c88" + +graphql-language-service-types@^1.0.18: + version "1.0.18" + resolved "https://registry.yarnpkg.com/graphql-language-service-types/-/graphql-language-service-types-1.0.18.tgz#0c9ebb6dd7babd61bf6b3bea0675abde5d7e5b16" + dependencies: + graphql-config "1.1.4" + +graphql-language-service-utils@^1.0.18: + version "1.0.18" + resolved "https://registry.yarnpkg.com/graphql-language-service-utils/-/graphql-language-service-utils-1.0.18.tgz#133fd0ce8ce360aad09c41feb47015eb7878cd3a" + dependencies: + graphql-config "1.1.4" + graphql-language-service-types "^1.0.18" + +graphql-request@^1.4.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-1.4.1.tgz#0772743cfac8dfdd4d69d36106a96c9bdd191ce8" + dependencies: + cross-fetch "1.1.1" + +graphql@^0.12.3: + version "0.12.3" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-0.12.3.tgz#11668458bbe28261c0dcb6e265f515ba79f6ce07" + dependencies: + iterall "1.1.3" + handlebars@^4.0.2: version "4.0.11" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc" @@ -3158,6 +3251,10 @@ isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" +iterall@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.1.3.tgz#1cbbff96204056dde6656e2ed2e2226d0e6d72c9" + jest-get-type@^21.2.0: version "21.2.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-21.2.0.tgz#f6376ab9db4b60d81e39f30749c6c466f40d4a23" @@ -3175,7 +3272,7 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" -js-yaml@^3.9.0: +js-yaml@^3.10.0, js-yaml@^3.9.0: version "3.10.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" dependencies: @@ -3905,7 +4002,7 @@ next@^4.2.1: write-file-webpack-plugin "4.2.0" xss-filters "1.2.7" -node-fetch@^1.0.1: +node-fetch@1.7.3, node-fetch@^1.0.1: version "1.7.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" dependencies: @@ -5005,7 +5102,7 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: +rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: @@ -5891,7 +5988,7 @@ webpack@^3.10.0: webpack-sources "^1.0.1" yargs "^8.0.2" -whatwg-fetch@>=0.10.0: +whatwg-fetch@2.0.3, whatwg-fetch@>=0.10.0: version "2.0.3" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84"