From 390669b3e3e22d79b6fb24f8a16bb995e37bd182 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Thu, 2 Aug 2018 08:48:53 -0400 Subject: [PATCH] Restructure --- .idea/graphql_parser.iml | 4 - .idea/runConfigurations/All_Tests.xml | 2 +- .travis.yml | 4 +- README.md | 48 +++------- .gitignore => angel_graphql/.gitignore | 2 +- angel_graphql/LICENSE | 21 +++++ graphql_generator/.gitignore | 93 +++++++++++++++++++ graphql_generator/LICENSE | 21 +++++ graphql_parser/.gitignore | 93 +++++++++++++++++++ graphql_parser/LICENSE | 21 +++++ graphql_parser/README.md | 39 ++++++++ .../analysis_options.yaml | 0 .../example/example.dart | 0 .../example}/visitor.dart | 0 .../lib}/graphql_parser.dart | 0 .../lib}/src/language/ast/alias.dart | 0 .../lib}/src/language/ast/argument.dart | 0 .../lib}/src/language/ast/array_value.dart | 0 .../lib}/src/language/ast/ast.dart | 0 .../lib}/src/language/ast/boolean_value.dart | 0 .../lib}/src/language/ast/default_value.dart | 0 .../lib}/src/language/ast/definition.dart | 0 .../lib}/src/language/ast/directive.dart | 0 .../lib}/src/language/ast/document.dart | 0 .../lib}/src/language/ast/field.dart | 0 .../lib}/src/language/ast/field_name.dart | 0 .../src/language/ast/fragment_definition.dart | 0 .../src/language/ast/fragment_spread.dart | 0 .../src/language/ast/inline_fragment.dart | 0 .../lib}/src/language/ast/list_type.dart | 0 .../lib}/src/language/ast/node.dart | 0 .../lib}/src/language/ast/number_value.dart | 0 .../language/ast/operation_definition.dart | 0 .../lib}/src/language/ast/selection.dart | 0 .../lib}/src/language/ast/selection_set.dart | 0 .../lib}/src/language/ast/string_value.dart | 0 .../lib}/src/language/ast/type.dart | 0 .../lib}/src/language/ast/type_condition.dart | 0 .../lib}/src/language/ast/type_name.dart | 0 .../lib}/src/language/ast/value.dart | 0 .../src/language/ast/value_or_variable.dart | 0 .../lib}/src/language/ast/variable.dart | 0 .../src/language/ast/variable_definition.dart | 0 .../language/ast/variable_definitions.dart | 0 .../lib}/src/language/language.dart | 0 .../lib}/src/language/lexer.dart | 0 .../lib}/src/language/parser.dart | 0 .../lib}/src/language/syntax_error.dart | 0 .../lib}/src/language/token.dart | 0 .../lib}/src/language/token_type.dart | 0 {lib => graphql_parser/lib}/visitor.dart | 0 pubspec.yaml => graphql_parser/pubspec.yaml | 0 {test => graphql_parser/test}/all.dart | 0 .../test}/argument_test.dart | 0 {test => graphql_parser/test}/common.dart | 0 .../test}/directive_test.dart | 0 .../test}/document_test.dart | 0 {test => graphql_parser/test}/field_test.dart | 0 .../test}/fragment_spread_test.dart | 0 .../test}/inline_fragment_test.dart | 0 .../test}/selection_set_test.dart | 0 {test => graphql_parser/test}/type_test.dart | 0 {test => graphql_parser/test}/value_test.dart | 0 .../test}/variable_definition_test.dart | 0 .../test}/variable_test.dart | 0 graphql_schema/.gitignore | 93 +++++++++++++++++++ graphql_schema/LICENSE | 21 +++++ graphql_server/.gitignore | 93 +++++++++++++++++++ graphql_server/LICENSE | 21 +++++ travis.sh | 4 + 70 files changed, 536 insertions(+), 44 deletions(-) rename .gitignore => angel_graphql/.gitignore (99%) create mode 100644 angel_graphql/LICENSE create mode 100644 graphql_generator/.gitignore create mode 100644 graphql_generator/LICENSE create mode 100644 graphql_parser/.gitignore create mode 100644 graphql_parser/LICENSE create mode 100644 graphql_parser/README.md rename .analysis-options => graphql_parser/analysis_options.yaml (100%) rename example/basic.dart => graphql_parser/example/example.dart (100%) rename {example => graphql_parser/example}/visitor.dart (100%) rename {lib => graphql_parser/lib}/graphql_parser.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/alias.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/argument.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/array_value.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/ast.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/boolean_value.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/default_value.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/definition.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/directive.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/document.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/field.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/field_name.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/fragment_definition.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/fragment_spread.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/inline_fragment.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/list_type.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/node.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/number_value.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/operation_definition.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/selection.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/selection_set.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/string_value.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/type.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/type_condition.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/type_name.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/value.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/value_or_variable.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/variable.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/variable_definition.dart (100%) rename {lib => graphql_parser/lib}/src/language/ast/variable_definitions.dart (100%) rename {lib => graphql_parser/lib}/src/language/language.dart (100%) rename {lib => graphql_parser/lib}/src/language/lexer.dart (100%) rename {lib => graphql_parser/lib}/src/language/parser.dart (100%) rename {lib => graphql_parser/lib}/src/language/syntax_error.dart (100%) rename {lib => graphql_parser/lib}/src/language/token.dart (100%) rename {lib => graphql_parser/lib}/src/language/token_type.dart (100%) rename {lib => graphql_parser/lib}/visitor.dart (100%) rename pubspec.yaml => graphql_parser/pubspec.yaml (100%) rename {test => graphql_parser/test}/all.dart (100%) rename {test => graphql_parser/test}/argument_test.dart (100%) rename {test => graphql_parser/test}/common.dart (100%) rename {test => graphql_parser/test}/directive_test.dart (100%) rename {test => graphql_parser/test}/document_test.dart (100%) rename {test => graphql_parser/test}/field_test.dart (100%) rename {test => graphql_parser/test}/fragment_spread_test.dart (100%) rename {test => graphql_parser/test}/inline_fragment_test.dart (100%) rename {test => graphql_parser/test}/selection_set_test.dart (100%) rename {test => graphql_parser/test}/type_test.dart (100%) rename {test => graphql_parser/test}/value_test.dart (100%) rename {test => graphql_parser/test}/variable_definition_test.dart (100%) rename {test => graphql_parser/test}/variable_test.dart (100%) create mode 100644 graphql_schema/.gitignore create mode 100644 graphql_schema/LICENSE create mode 100644 graphql_server/.gitignore create mode 100644 graphql_server/LICENSE create mode 100644 travis.sh diff --git a/.idea/graphql_parser.iml b/.idea/graphql_parser.iml index f5c40a17..377564ba 100644 --- a/.idea/graphql_parser.iml +++ b/.idea/graphql_parser.iml @@ -5,15 +5,11 @@ - - - - \ No newline at end of file diff --git a/.idea/runConfigurations/All_Tests.xml b/.idea/runConfigurations/All_Tests.xml index 0e975a39..9b10a435 100644 --- a/.idea/runConfigurations/All_Tests.xml +++ b/.idea/runConfigurations/All_Tests.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index de2210c9..7c2f802a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1 +1,3 @@ -language: dart \ No newline at end of file +language: dart +script: + - travis.sh \ No newline at end of file diff --git a/README.md b/README.md index 9d7ea6bc..73876bc8 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,13 @@ -# graphql_parser -[![Pub](https://img.shields.io/pub/v/graphql_parser.svg)](https://pub.dartlang.org/packages/graphql_parser) -[![build status](https://travis-ci.org/thosakwe/graphql_parser.svg)](https://travis-ci.org/thosakwe/graphql_parser) +# graphql +A complete implementation of the official +[GraphQL specification](http://facebook.github.io/graphql/October2016/#sec-Language), +in the Dart programming language. -Parses GraphQL queries and schemas. Also includes a `GraphQLVisitor` class. +The goal of this project is to provide to server-side +users of Dart an alternative to REST API's. -*This library is merely a parser/visitor*. Any sort of actual GraphQL API functionality must be implemented by you, -or by a third-party package. - -[Angel framework](https://angel-dart.github.io) -users should consider -[`package:angel_graphql`](https://pub.dartlang.org/packages/angel_graphql) -as a dead-simple way to add GraphQL functionality to their servers. - -# Installation -Add `graphql_parser` as a dependency in your `pubspec.yaml` file: - -```yaml -dependencies: - graphql_parser: ^1.0.0 -``` - -# Usage -The AST featured in this library is directly based off this ANTLR4 grammar created by Joseph T. McBride: -https://github.com/antlr/grammars-v4/blob/master/graphql/GraphQL.g4 - -```dart -import 'package:graphql_parser/graphql_parser.dart'; - -doSomething(String text) { - var tokens = scan(text); - var parser = new Parser(tokens); - - // Parse the GraphQL document using recursive descent - var doc = parser.parseDocument(); - - // Do something with the parsed GraphQL document... -} -``` +Included is also +`package:angel_graphql`, which, when combined with the +[Angel](https://github.com/angel-dart) framework, allows +server-side Dart users to build backends with GraphQL and +virtually any database imaginable. \ No newline at end of file diff --git a/.gitignore b/angel_graphql/.gitignore similarity index 99% rename from .gitignore rename to angel_graphql/.gitignore index e822a056..26517d3b 100644 --- a/.gitignore +++ b/angel_graphql/.gitignore @@ -52,7 +52,7 @@ pubspec.lock # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 # User-specific stuff: -.idea/**/workspace.xml +../.idea/workspace.xml .idea/**/tasks.xml .idea/dictionaries diff --git a/angel_graphql/LICENSE b/angel_graphql/LICENSE new file mode 100644 index 00000000..89074fd3 --- /dev/null +++ b/angel_graphql/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 The Angel Framework + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/graphql_generator/.gitignore b/graphql_generator/.gitignore new file mode 100644 index 00000000..26517d3b --- /dev/null +++ b/graphql_generator/.gitignore @@ -0,0 +1,93 @@ +# See https://www.dartlang.org/tools/private-files.html + +# Files and directories created by pub +.buildlog +.packages +.project +.pub/ +.scripts-bin/ +build/ +**/packages/ + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) +*.dart.js +*.part.js +*.js.deps +*.js.map +*.info.json + +# Directory created by dartdoc +doc/api/ + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +pubspec.lock +### Dart template +# See https://www.dartlang.org/tools/private-files.html + +# Files and directories created by pub + +# SDK 1.20 and later (no longer creates packages directories) + +# Older SDK versions +# (Include if the minimum SDK version specified in pubsepc.yaml is earlier than 1.20) + + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) + +# Directory created by dartdoc + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +../.idea/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +# Gradle: +.idea/**/gradle.xml +.idea/**/libraries + +# Mongo Explorer plugin: +.idea/**/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties diff --git a/graphql_generator/LICENSE b/graphql_generator/LICENSE new file mode 100644 index 00000000..89074fd3 --- /dev/null +++ b/graphql_generator/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 The Angel Framework + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/graphql_parser/.gitignore b/graphql_parser/.gitignore new file mode 100644 index 00000000..26517d3b --- /dev/null +++ b/graphql_parser/.gitignore @@ -0,0 +1,93 @@ +# See https://www.dartlang.org/tools/private-files.html + +# Files and directories created by pub +.buildlog +.packages +.project +.pub/ +.scripts-bin/ +build/ +**/packages/ + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) +*.dart.js +*.part.js +*.js.deps +*.js.map +*.info.json + +# Directory created by dartdoc +doc/api/ + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +pubspec.lock +### Dart template +# See https://www.dartlang.org/tools/private-files.html + +# Files and directories created by pub + +# SDK 1.20 and later (no longer creates packages directories) + +# Older SDK versions +# (Include if the minimum SDK version specified in pubsepc.yaml is earlier than 1.20) + + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) + +# Directory created by dartdoc + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +../.idea/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +# Gradle: +.idea/**/gradle.xml +.idea/**/libraries + +# Mongo Explorer plugin: +.idea/**/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties diff --git a/graphql_parser/LICENSE b/graphql_parser/LICENSE new file mode 100644 index 00000000..89074fd3 --- /dev/null +++ b/graphql_parser/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 The Angel Framework + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/graphql_parser/README.md b/graphql_parser/README.md new file mode 100644 index 00000000..9d7ea6bc --- /dev/null +++ b/graphql_parser/README.md @@ -0,0 +1,39 @@ +# graphql_parser +[![Pub](https://img.shields.io/pub/v/graphql_parser.svg)](https://pub.dartlang.org/packages/graphql_parser) +[![build status](https://travis-ci.org/thosakwe/graphql_parser.svg)](https://travis-ci.org/thosakwe/graphql_parser) + +Parses GraphQL queries and schemas. Also includes a `GraphQLVisitor` class. + +*This library is merely a parser/visitor*. Any sort of actual GraphQL API functionality must be implemented by you, +or by a third-party package. + +[Angel framework](https://angel-dart.github.io) +users should consider +[`package:angel_graphql`](https://pub.dartlang.org/packages/angel_graphql) +as a dead-simple way to add GraphQL functionality to their servers. + +# Installation +Add `graphql_parser` as a dependency in your `pubspec.yaml` file: + +```yaml +dependencies: + graphql_parser: ^1.0.0 +``` + +# Usage +The AST featured in this library is directly based off this ANTLR4 grammar created by Joseph T. McBride: +https://github.com/antlr/grammars-v4/blob/master/graphql/GraphQL.g4 + +```dart +import 'package:graphql_parser/graphql_parser.dart'; + +doSomething(String text) { + var tokens = scan(text); + var parser = new Parser(tokens); + + // Parse the GraphQL document using recursive descent + var doc = parser.parseDocument(); + + // Do something with the parsed GraphQL document... +} +``` diff --git a/.analysis-options b/graphql_parser/analysis_options.yaml similarity index 100% rename from .analysis-options rename to graphql_parser/analysis_options.yaml diff --git a/example/basic.dart b/graphql_parser/example/example.dart similarity index 100% rename from example/basic.dart rename to graphql_parser/example/example.dart diff --git a/example/visitor.dart b/graphql_parser/example/visitor.dart similarity index 100% rename from example/visitor.dart rename to graphql_parser/example/visitor.dart diff --git a/lib/graphql_parser.dart b/graphql_parser/lib/graphql_parser.dart similarity index 100% rename from lib/graphql_parser.dart rename to graphql_parser/lib/graphql_parser.dart diff --git a/lib/src/language/ast/alias.dart b/graphql_parser/lib/src/language/ast/alias.dart similarity index 100% rename from lib/src/language/ast/alias.dart rename to graphql_parser/lib/src/language/ast/alias.dart diff --git a/lib/src/language/ast/argument.dart b/graphql_parser/lib/src/language/ast/argument.dart similarity index 100% rename from lib/src/language/ast/argument.dart rename to graphql_parser/lib/src/language/ast/argument.dart diff --git a/lib/src/language/ast/array_value.dart b/graphql_parser/lib/src/language/ast/array_value.dart similarity index 100% rename from lib/src/language/ast/array_value.dart rename to graphql_parser/lib/src/language/ast/array_value.dart diff --git a/lib/src/language/ast/ast.dart b/graphql_parser/lib/src/language/ast/ast.dart similarity index 100% rename from lib/src/language/ast/ast.dart rename to graphql_parser/lib/src/language/ast/ast.dart diff --git a/lib/src/language/ast/boolean_value.dart b/graphql_parser/lib/src/language/ast/boolean_value.dart similarity index 100% rename from lib/src/language/ast/boolean_value.dart rename to graphql_parser/lib/src/language/ast/boolean_value.dart diff --git a/lib/src/language/ast/default_value.dart b/graphql_parser/lib/src/language/ast/default_value.dart similarity index 100% rename from lib/src/language/ast/default_value.dart rename to graphql_parser/lib/src/language/ast/default_value.dart diff --git a/lib/src/language/ast/definition.dart b/graphql_parser/lib/src/language/ast/definition.dart similarity index 100% rename from lib/src/language/ast/definition.dart rename to graphql_parser/lib/src/language/ast/definition.dart diff --git a/lib/src/language/ast/directive.dart b/graphql_parser/lib/src/language/ast/directive.dart similarity index 100% rename from lib/src/language/ast/directive.dart rename to graphql_parser/lib/src/language/ast/directive.dart diff --git a/lib/src/language/ast/document.dart b/graphql_parser/lib/src/language/ast/document.dart similarity index 100% rename from lib/src/language/ast/document.dart rename to graphql_parser/lib/src/language/ast/document.dart diff --git a/lib/src/language/ast/field.dart b/graphql_parser/lib/src/language/ast/field.dart similarity index 100% rename from lib/src/language/ast/field.dart rename to graphql_parser/lib/src/language/ast/field.dart diff --git a/lib/src/language/ast/field_name.dart b/graphql_parser/lib/src/language/ast/field_name.dart similarity index 100% rename from lib/src/language/ast/field_name.dart rename to graphql_parser/lib/src/language/ast/field_name.dart diff --git a/lib/src/language/ast/fragment_definition.dart b/graphql_parser/lib/src/language/ast/fragment_definition.dart similarity index 100% rename from lib/src/language/ast/fragment_definition.dart rename to graphql_parser/lib/src/language/ast/fragment_definition.dart diff --git a/lib/src/language/ast/fragment_spread.dart b/graphql_parser/lib/src/language/ast/fragment_spread.dart similarity index 100% rename from lib/src/language/ast/fragment_spread.dart rename to graphql_parser/lib/src/language/ast/fragment_spread.dart diff --git a/lib/src/language/ast/inline_fragment.dart b/graphql_parser/lib/src/language/ast/inline_fragment.dart similarity index 100% rename from lib/src/language/ast/inline_fragment.dart rename to graphql_parser/lib/src/language/ast/inline_fragment.dart diff --git a/lib/src/language/ast/list_type.dart b/graphql_parser/lib/src/language/ast/list_type.dart similarity index 100% rename from lib/src/language/ast/list_type.dart rename to graphql_parser/lib/src/language/ast/list_type.dart diff --git a/lib/src/language/ast/node.dart b/graphql_parser/lib/src/language/ast/node.dart similarity index 100% rename from lib/src/language/ast/node.dart rename to graphql_parser/lib/src/language/ast/node.dart diff --git a/lib/src/language/ast/number_value.dart b/graphql_parser/lib/src/language/ast/number_value.dart similarity index 100% rename from lib/src/language/ast/number_value.dart rename to graphql_parser/lib/src/language/ast/number_value.dart diff --git a/lib/src/language/ast/operation_definition.dart b/graphql_parser/lib/src/language/ast/operation_definition.dart similarity index 100% rename from lib/src/language/ast/operation_definition.dart rename to graphql_parser/lib/src/language/ast/operation_definition.dart diff --git a/lib/src/language/ast/selection.dart b/graphql_parser/lib/src/language/ast/selection.dart similarity index 100% rename from lib/src/language/ast/selection.dart rename to graphql_parser/lib/src/language/ast/selection.dart diff --git a/lib/src/language/ast/selection_set.dart b/graphql_parser/lib/src/language/ast/selection_set.dart similarity index 100% rename from lib/src/language/ast/selection_set.dart rename to graphql_parser/lib/src/language/ast/selection_set.dart diff --git a/lib/src/language/ast/string_value.dart b/graphql_parser/lib/src/language/ast/string_value.dart similarity index 100% rename from lib/src/language/ast/string_value.dart rename to graphql_parser/lib/src/language/ast/string_value.dart diff --git a/lib/src/language/ast/type.dart b/graphql_parser/lib/src/language/ast/type.dart similarity index 100% rename from lib/src/language/ast/type.dart rename to graphql_parser/lib/src/language/ast/type.dart diff --git a/lib/src/language/ast/type_condition.dart b/graphql_parser/lib/src/language/ast/type_condition.dart similarity index 100% rename from lib/src/language/ast/type_condition.dart rename to graphql_parser/lib/src/language/ast/type_condition.dart diff --git a/lib/src/language/ast/type_name.dart b/graphql_parser/lib/src/language/ast/type_name.dart similarity index 100% rename from lib/src/language/ast/type_name.dart rename to graphql_parser/lib/src/language/ast/type_name.dart diff --git a/lib/src/language/ast/value.dart b/graphql_parser/lib/src/language/ast/value.dart similarity index 100% rename from lib/src/language/ast/value.dart rename to graphql_parser/lib/src/language/ast/value.dart diff --git a/lib/src/language/ast/value_or_variable.dart b/graphql_parser/lib/src/language/ast/value_or_variable.dart similarity index 100% rename from lib/src/language/ast/value_or_variable.dart rename to graphql_parser/lib/src/language/ast/value_or_variable.dart diff --git a/lib/src/language/ast/variable.dart b/graphql_parser/lib/src/language/ast/variable.dart similarity index 100% rename from lib/src/language/ast/variable.dart rename to graphql_parser/lib/src/language/ast/variable.dart diff --git a/lib/src/language/ast/variable_definition.dart b/graphql_parser/lib/src/language/ast/variable_definition.dart similarity index 100% rename from lib/src/language/ast/variable_definition.dart rename to graphql_parser/lib/src/language/ast/variable_definition.dart diff --git a/lib/src/language/ast/variable_definitions.dart b/graphql_parser/lib/src/language/ast/variable_definitions.dart similarity index 100% rename from lib/src/language/ast/variable_definitions.dart rename to graphql_parser/lib/src/language/ast/variable_definitions.dart diff --git a/lib/src/language/language.dart b/graphql_parser/lib/src/language/language.dart similarity index 100% rename from lib/src/language/language.dart rename to graphql_parser/lib/src/language/language.dart diff --git a/lib/src/language/lexer.dart b/graphql_parser/lib/src/language/lexer.dart similarity index 100% rename from lib/src/language/lexer.dart rename to graphql_parser/lib/src/language/lexer.dart diff --git a/lib/src/language/parser.dart b/graphql_parser/lib/src/language/parser.dart similarity index 100% rename from lib/src/language/parser.dart rename to graphql_parser/lib/src/language/parser.dart diff --git a/lib/src/language/syntax_error.dart b/graphql_parser/lib/src/language/syntax_error.dart similarity index 100% rename from lib/src/language/syntax_error.dart rename to graphql_parser/lib/src/language/syntax_error.dart diff --git a/lib/src/language/token.dart b/graphql_parser/lib/src/language/token.dart similarity index 100% rename from lib/src/language/token.dart rename to graphql_parser/lib/src/language/token.dart diff --git a/lib/src/language/token_type.dart b/graphql_parser/lib/src/language/token_type.dart similarity index 100% rename from lib/src/language/token_type.dart rename to graphql_parser/lib/src/language/token_type.dart diff --git a/lib/visitor.dart b/graphql_parser/lib/visitor.dart similarity index 100% rename from lib/visitor.dart rename to graphql_parser/lib/visitor.dart diff --git a/pubspec.yaml b/graphql_parser/pubspec.yaml similarity index 100% rename from pubspec.yaml rename to graphql_parser/pubspec.yaml diff --git a/test/all.dart b/graphql_parser/test/all.dart similarity index 100% rename from test/all.dart rename to graphql_parser/test/all.dart diff --git a/test/argument_test.dart b/graphql_parser/test/argument_test.dart similarity index 100% rename from test/argument_test.dart rename to graphql_parser/test/argument_test.dart diff --git a/test/common.dart b/graphql_parser/test/common.dart similarity index 100% rename from test/common.dart rename to graphql_parser/test/common.dart diff --git a/test/directive_test.dart b/graphql_parser/test/directive_test.dart similarity index 100% rename from test/directive_test.dart rename to graphql_parser/test/directive_test.dart diff --git a/test/document_test.dart b/graphql_parser/test/document_test.dart similarity index 100% rename from test/document_test.dart rename to graphql_parser/test/document_test.dart diff --git a/test/field_test.dart b/graphql_parser/test/field_test.dart similarity index 100% rename from test/field_test.dart rename to graphql_parser/test/field_test.dart diff --git a/test/fragment_spread_test.dart b/graphql_parser/test/fragment_spread_test.dart similarity index 100% rename from test/fragment_spread_test.dart rename to graphql_parser/test/fragment_spread_test.dart diff --git a/test/inline_fragment_test.dart b/graphql_parser/test/inline_fragment_test.dart similarity index 100% rename from test/inline_fragment_test.dart rename to graphql_parser/test/inline_fragment_test.dart diff --git a/test/selection_set_test.dart b/graphql_parser/test/selection_set_test.dart similarity index 100% rename from test/selection_set_test.dart rename to graphql_parser/test/selection_set_test.dart diff --git a/test/type_test.dart b/graphql_parser/test/type_test.dart similarity index 100% rename from test/type_test.dart rename to graphql_parser/test/type_test.dart diff --git a/test/value_test.dart b/graphql_parser/test/value_test.dart similarity index 100% rename from test/value_test.dart rename to graphql_parser/test/value_test.dart diff --git a/test/variable_definition_test.dart b/graphql_parser/test/variable_definition_test.dart similarity index 100% rename from test/variable_definition_test.dart rename to graphql_parser/test/variable_definition_test.dart diff --git a/test/variable_test.dart b/graphql_parser/test/variable_test.dart similarity index 100% rename from test/variable_test.dart rename to graphql_parser/test/variable_test.dart diff --git a/graphql_schema/.gitignore b/graphql_schema/.gitignore new file mode 100644 index 00000000..26517d3b --- /dev/null +++ b/graphql_schema/.gitignore @@ -0,0 +1,93 @@ +# See https://www.dartlang.org/tools/private-files.html + +# Files and directories created by pub +.buildlog +.packages +.project +.pub/ +.scripts-bin/ +build/ +**/packages/ + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) +*.dart.js +*.part.js +*.js.deps +*.js.map +*.info.json + +# Directory created by dartdoc +doc/api/ + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +pubspec.lock +### Dart template +# See https://www.dartlang.org/tools/private-files.html + +# Files and directories created by pub + +# SDK 1.20 and later (no longer creates packages directories) + +# Older SDK versions +# (Include if the minimum SDK version specified in pubsepc.yaml is earlier than 1.20) + + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) + +# Directory created by dartdoc + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +../.idea/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +# Gradle: +.idea/**/gradle.xml +.idea/**/libraries + +# Mongo Explorer plugin: +.idea/**/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties diff --git a/graphql_schema/LICENSE b/graphql_schema/LICENSE new file mode 100644 index 00000000..89074fd3 --- /dev/null +++ b/graphql_schema/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 The Angel Framework + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/graphql_server/.gitignore b/graphql_server/.gitignore new file mode 100644 index 00000000..26517d3b --- /dev/null +++ b/graphql_server/.gitignore @@ -0,0 +1,93 @@ +# See https://www.dartlang.org/tools/private-files.html + +# Files and directories created by pub +.buildlog +.packages +.project +.pub/ +.scripts-bin/ +build/ +**/packages/ + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) +*.dart.js +*.part.js +*.js.deps +*.js.map +*.info.json + +# Directory created by dartdoc +doc/api/ + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +pubspec.lock +### Dart template +# See https://www.dartlang.org/tools/private-files.html + +# Files and directories created by pub + +# SDK 1.20 and later (no longer creates packages directories) + +# Older SDK versions +# (Include if the minimum SDK version specified in pubsepc.yaml is earlier than 1.20) + + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) + +# Directory created by dartdoc + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +../.idea/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +# Gradle: +.idea/**/gradle.xml +.idea/**/libraries + +# Mongo Explorer plugin: +.idea/**/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties diff --git a/graphql_server/LICENSE b/graphql_server/LICENSE new file mode 100644 index 00000000..89074fd3 --- /dev/null +++ b/graphql_server/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 The Angel Framework + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/travis.sh b/travis.sh new file mode 100644 index 00000000..2da982a9 --- /dev/null +++ b/travis.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -e +set -x +cd graphql_parser && pub get && pub run test -j2 && cd.. \ No newline at end of file