Skip to content

Commit 5067c28

Browse files
committed
✨ GraphQL Tree as a separate package
Initial commit of separation from zeus
0 parents  commit 5067c28

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+6217
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.md]
14+
insert_final_newline = false
15+
trim_trailing_whitespace = false

.eslintrc.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
3+
extends: [
4+
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
5+
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
6+
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
7+
],
8+
parserOptions: {
9+
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
10+
sourceType: 'module', // Allows for the use of imports
11+
},
12+
plugins: ['@typescript-eslint', 'prettier'],
13+
rules: {
14+
'@typescript-eslint/no-use-before-define': 0,
15+
'@typescript-eslint/explicit-function-return-type': 0,
16+
'@typescript-eslint/no-var-requires': 0,
17+
'@typescript-eslint/explicit-module-boundary-types': 0,
18+
},
19+
};

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
# Setup .npmrc file to publish to npm
11+
- uses: actions/setup-node@v1
12+
with:
13+
node-version: '14.x'
14+
registry-url: 'https://registry.npmjs.org'
15+
- run: npm install
16+
- run: npm test
17+
- run: npm run build
18+
- run: npm publish --access public --tag latest
19+
env:
20+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.vscode
2+
.DS_STORE
3+
node_modules
4+
.module-cache
5+
*.log*
6+
build
7+
dist
8+
docs-dist
9+
lib
10+
.idea
11+
.docz
12+
.tscache
13+
package-lock.json
14+
*.tsbuildinfo*

.npmignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.vscode
2+
.DS_STORE
3+
.docz
4+
.tscache
5+
node_modules
6+
.module-cache
7+
*.log*
8+
build
9+
dist
10+
src
11+
example
12+
images
13+
.idea
14+
package-lock.json
15+
__tests__

.prettierrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
arrowParens: "always",
3+
printWidth: 80,
4+
semi: true,
5+
trailingComma: "all",
6+
singleQuote: true,
7+
printWidth: 120,
8+
tabWidth: 2
9+
};

CONTRIBUTING.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Contributing to GraphQL JS Tree
2+
3+
We welcome contributions to GraphQL Tree of any kind including documentation, themes,
4+
organization, tutorials, blog posts, bug reports, issues, feature requests,
5+
feature implementations, pull requests, answering questions on the forum,
6+
helping to manage issues, etc.
7+
8+
_Changes to the codebase **and** related documentation, e.g. for a new feature, should still use a single pull request._
9+
10+
## Table of Contents
11+
12+
- [Contributing to GraphQL JS Tree](#contributing-to-graphql-js-tree)
13+
- [Table of Contents](#table-of-contents)
14+
- [Reporting Issues](#reporting-issues)
15+
- [Code Contribution](#code-contribution)
16+
17+
18+
## Reporting Issues
19+
20+
If you believe you have found a defect in GraphQL Zeus or its documentation, use
21+
the GitHub [issue tracker](https://github.com/graphql-editor/graphql-zeus/issues) to report
22+
the problem to the maintainers.
23+
24+
## Code Contribution
25+
26+
GraphQL Zeus is still looking for its direction so remember functionality has to:
27+
28+
- repair existing bugs
29+
- introduce new feature requests
30+
31+
**Bug fixes are, of course, always welcome.**

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Artur Czemiel
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
![](images/zeus.gif)
2+
3+
[![npm](https://img.shields.io/npm/v/graphql-js-tree.svg?style=flat-square)](https://www.npmjs.com/package/graphql-js-tree) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](http://commitizen.github.io/cz-cli/) [![npm downloads](https://img.shields.io/npm/dt/graphql-js-tree.svg?style=flat-square)](https://www.npmjs.com/package/graphql-js-tree)
4+
5+
Simplier approach to GraphQL parsing. Using graphql-js library and parsing AST to simplier types. It is a backbone of `graphql-zeus` and `graphql-editor`
6+
7+
## How it works
8+
9+
It creates very simple `ParserTree` from GraphQL schema
10+
11+
```js
12+
import { Parser, TreeToGraphQL } from 'graphql-js-tree';
13+
14+
const schemaFileContents = `
15+
type Query{
16+
hello: String!
17+
}
18+
schema{
19+
query: Query
20+
}
21+
`;
22+
23+
const parsedSchema = Parser.parse(schemaFileContents);
24+
25+
// Backwards
26+
27+
const graphqlString = TreeToGraphQL.parse(parsedSchema);
28+
```
29+
30+
## Table of contents
31+
32+
- [How it works](#how-it-works)
33+
- [Table of contents](#table-of-contents)
34+
- [License](#license)
35+
- [Support](#support)
36+
- [Contribute](#contribute)
37+
38+
## License
39+
40+
MIT
41+
42+
## Support
43+
44+
[Join our GraphQL Editor Channel](https://join.slack.com/t/graphqleditor/shared_invite/enQtNDkwOTgyOTM5OTc1LWI4YjU3N2U5NGVkNzQ2NzY5MGUxMTJiNjFlZDM1Zjc2OWRmNTI0NDM3OWUxYTk4Yjk3MzZlY2QwOWUzZmM2NDI)
45+
46+
Leave a star ;)
47+
48+
## Contribute
49+
50+
For a complete guide to contributing to GraphQL Editor, see the [Contribution Guide](CONTRIBUTING.md).
51+
52+
1. Fork this repo
53+
2. Create your feature branch: git checkout -b feature-name
54+
3. Commit your changes: git commit -am 'Add some feature'
55+
4. Push to the branch: git push origin my-new-feature
56+
5. Submit a pull request

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ['@commitlint/config-conventional'] };

0 commit comments

Comments
 (0)