graphql-docs 3.0.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +31 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/.github/workflows/tests.yml +21 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +1 -3
- data/CHANGELOG.md +25 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/CONTRIBUTING.md +18 -0
- data/LICENSE.txt +1 -0
- data/README.md +59 -13
- data/Rakefile +24 -22
- data/{script → bin}/console +2 -4
- data/bin/rake +27 -0
- data/bin/setup +6 -0
- data/exe/graphql-docs +51 -0
- data/graphql-docs.gemspec +26 -14
- data/lib/graphql-docs/generator.rb +2 -2
- data/lib/graphql-docs/layouts/default.html +1 -1
- data/lib/graphql-docs/version.rb +1 -1
- data/lib/graphql-docs.rb +0 -4
- metadata +68 -68
- data/.github/FUNDING.yml +0 -12
- data/.travis.yml +0 -23
- data/script/bootstrap +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 682142e3da8fc82b8239160dada35a1982156aa68455af381602619047a46a91
|
4
|
+
data.tar.gz: 8c819a7152b269cd0e06e8979d3dc99755e5426e1c8dd8ccdc197ffaded2fd54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1749780edd31bd7baec9d97e38c6eafed30aa938eba9bc8f59a297fa4075cab18e85715427a90be631613da74fbc3a515f9545dbfc14150658d671a37e52f3e
|
7
|
+
data.tar.gz: 29929cab7bd7512e14f7178687d72152a4d2204a0cfdf6a1cfa1777683bdc76fafe367d0c3e385afb6d6fb64ba40f4c60be02d97fe4ee5b3cade092fe719c2b4
|
@@ -0,0 +1,31 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Create a report to help us improve
|
4
|
+
title: ''
|
5
|
+
labels: bug
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Describe the bug**
|
11
|
+
A clear and concise description of what the bug is.
|
12
|
+
|
13
|
+
**To Reproduce**
|
14
|
+
Steps to reproduce the behavior:
|
15
|
+
1. Do x
|
16
|
+
2. Do y
|
17
|
+
|
18
|
+
**Expected behavior**
|
19
|
+
A clear and concise description of what you expected to happen.
|
20
|
+
|
21
|
+
**Screenshots**
|
22
|
+
If applicable, add screenshots to help explain your problem.
|
23
|
+
|
24
|
+
**Additional context**
|
25
|
+
Add any other context about the problem here.
|
26
|
+
|
27
|
+
Examples:
|
28
|
+
|
29
|
+
- Source code
|
30
|
+
- Version of gem being used
|
31
|
+
- Ruby version
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
name: Feature request
|
3
|
+
about: Suggest an idea for this project
|
4
|
+
title: ''
|
5
|
+
labels: enhancement
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
12
|
+
|
13
|
+
**Describe the solution you'd like**
|
14
|
+
A clear and concise description of what you want to happen.
|
15
|
+
|
16
|
+
**Describe alternatives you've considered**
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
18
|
+
|
19
|
+
**Additional context**
|
20
|
+
Add any other context or screenshots about the feature request here.
|
@@ -0,0 +1,21 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: [push,pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
|
9
|
+
strategy:
|
10
|
+
matrix:
|
11
|
+
ruby-version: [3.1.2, 3.0.4, 2.7.6, 2.6.10]
|
12
|
+
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v2
|
15
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
16
|
+
uses: ruby/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
ruby-version: ${{ matrix.ruby-version }}
|
19
|
+
bundler-cache: true
|
20
|
+
- name: Run the test suite
|
21
|
+
run: bundle exec rake
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# graphql-docs Changelog
|
2
|
+
|
3
|
+
A concise overview of the public-facing changes to the gem from version to version. Does not include internal changes to the dev experience for the gem.
|
4
|
+
|
5
|
+
## Unreleased
|
6
|
+
|
7
|
+
## v4.0.0 - 2023-01-26
|
8
|
+
|
9
|
+
- **Breaking change**: drop support for Ruby 2.5 and earlier
|
10
|
+
- CLI with limited options, e.g. `graphql-docs schema.graphql`
|
11
|
+
- Dart Sass replaces Ruby Sass because Ruby Sass is deprecated
|
12
|
+
- Fixes:
|
13
|
+
- Upgrade commonmarker to latest ver to address security vulnerabilities
|
14
|
+
- commonmarker pinned to version without security vulnerability
|
15
|
+
- Chores
|
16
|
+
- Dev env refresh
|
17
|
+
|
18
|
+
## v3.0.1 - 2022-10-14
|
19
|
+
|
20
|
+
- fix: Relieves `EscapeUtils.escape_html is deprecated. Use GCI.escapeHTML instead, it's faster` deprecation warning until it gets released in an downstream dependency
|
21
|
+
- meta: Maintainership change from [gjtorikian](https://github.com/gjtorikian) to [brettchalupa](https://github.com/brettchalupa)
|
22
|
+
|
23
|
+
## v3.0.0 - 2022-03-23
|
24
|
+
|
25
|
+
- Upgrades `graphql` gem to the 2.x series
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
+
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
8
|
+
|
9
|
+
## Our Standards
|
10
|
+
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
12
|
+
|
13
|
+
* Demonstrating empathy and kindness toward other people
|
14
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
15
|
+
* Giving and gracefully accepting constructive feedback
|
16
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
17
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
18
|
+
|
19
|
+
Examples of unacceptable behavior include:
|
20
|
+
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or
|
22
|
+
advances of any kind
|
23
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
24
|
+
* Public or private harassment
|
25
|
+
* Publishing others' private information, such as a physical or email
|
26
|
+
address, without their explicit permission
|
27
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
28
|
+
professional setting
|
29
|
+
|
30
|
+
## Enforcement Responsibilities
|
31
|
+
|
32
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
33
|
+
|
34
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
35
|
+
|
36
|
+
## Scope
|
37
|
+
|
38
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
39
|
+
|
40
|
+
## Enforcement
|
41
|
+
|
42
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at brettchalupa@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
|
43
|
+
|
44
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
45
|
+
|
46
|
+
## Enforcement Guidelines
|
47
|
+
|
48
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
49
|
+
|
50
|
+
### 1. Correction
|
51
|
+
|
52
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
53
|
+
|
54
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
55
|
+
|
56
|
+
### 2. Warning
|
57
|
+
|
58
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
59
|
+
|
60
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
61
|
+
|
62
|
+
### 3. Temporary Ban
|
63
|
+
|
64
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
65
|
+
|
66
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
67
|
+
|
68
|
+
### 4. Permanent Ban
|
69
|
+
|
70
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
71
|
+
|
72
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
73
|
+
|
74
|
+
## Attribution
|
75
|
+
|
76
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
77
|
+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
78
|
+
|
79
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
80
|
+
|
81
|
+
[homepage]: https://www.contributor-covenant.org
|
82
|
+
|
83
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
84
|
+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# Contribuing Guide
|
2
|
+
|
3
|
+
Contributions to this project are welcome. If you have an idea for a bigger change, [open an issue first](https://github.com/brettchalupa/graphql-docs/issues/new/choose) and we can discuss it.
|
4
|
+
|
5
|
+
For fixes and small additions, follow the steps below to get developing and contributing:
|
6
|
+
|
7
|
+
1. Fork & clone the repository in GitHub
|
8
|
+
2. Run the `bin/setup` script to install development dependencies
|
9
|
+
3. Work on a branch
|
10
|
+
4. Make changes
|
11
|
+
5. Ensure tests pass by running `bin/rake`
|
12
|
+
6. Commit your changes, this project follows [the Conventional Commits spec](https://www.conventionalcommits.org/en/v1.0.0/)
|
13
|
+
7. Open up a pull request
|
14
|
+
|
15
|
+
## Finding Issues
|
16
|
+
|
17
|
+
- Good First Issue — If you're new to the project or Ruby, check out the ["good first issue" tag](https://github.com/brettchalupa/graphql-docs/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22). They're smaller, approachable issues if you're just getting started.
|
18
|
+
- Web — tasks that don't require much Ruby knowledge but require HTML and CSS have the ["web" tag](https://github.com/brettchalupa/graphql-docs/issues?q=is%3Aopen+is%3Aissue+label%3A%22web%22+)
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
# GraphQLDocs
|
2
2
|
|
3
|
-
|
3
|
+
Ruby library and CLI for easily generating beautiful documentation from your GraphQL schema.
|
4
4
|
|
5
5
|
![sample](https://cloud.githubusercontent.com/assets/64050/23438604/6a23add0-fdc7-11e6-8852-ef41e8451033.png)
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
Add
|
9
|
+
Add the gem to your project with this command:
|
10
10
|
|
11
|
-
```
|
12
|
-
|
11
|
+
``` console
|
12
|
+
bundle add graphql-docs
|
13
13
|
```
|
14
14
|
|
15
|
-
And then execute:
|
16
|
-
|
17
|
-
$ bundle
|
18
|
-
|
19
15
|
Or install it yourself as:
|
20
16
|
|
21
|
-
|
17
|
+
``` console
|
18
|
+
gem install graphql-docs
|
19
|
+
```
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
23
|
+
GraphQLDocs can be used as a Ruby library to build the documentation website. Using it as a Ruby library allows for more control and using every supported option. Here's an example:
|
24
|
+
|
25
25
|
``` ruby
|
26
26
|
# pass in a filename
|
27
27
|
GraphQLDocs.build(filename: filename)
|
@@ -36,6 +36,20 @@ end
|
|
36
36
|
GraphQLDocs.build(schema: schema)
|
37
37
|
```
|
38
38
|
|
39
|
+
GrophQLDocs also has a simplified CLI (`graphql-docs`) that gets installed with the gem:
|
40
|
+
|
41
|
+
``` console
|
42
|
+
graphql-docs schema.graphql
|
43
|
+
```
|
44
|
+
|
45
|
+
That will generate the output in the `output` dir.
|
46
|
+
|
47
|
+
See all of the supported CLI options with:
|
48
|
+
|
49
|
+
``` console
|
50
|
+
graphql-docs -h
|
51
|
+
```
|
52
|
+
|
39
53
|
## Breakdown
|
40
54
|
|
41
55
|
There are several phases going on the single `GraphQLDocs.build` call:
|
@@ -181,16 +195,48 @@ The format of `schema_member_path` is a dot delimited path to the schema member.
|
|
181
195
|
"Mutation.addLike" # a mutation
|
182
196
|
```
|
183
197
|
|
198
|
+
## Supported Ruby Versions
|
199
|
+
|
200
|
+
The gem currently supports **Ruby 2.6 and newer**. Any dropping of Ruby version
|
201
|
+
support is considered a breaking change and means a major release for the gem.
|
202
|
+
|
203
|
+
## Upgrading
|
204
|
+
|
205
|
+
This project aims to strictly follow [Semantic Versioning](https://semver.org/).
|
206
|
+
Minor and patch level updates can be done with pretty high confidence that your usage won't break.
|
207
|
+
|
208
|
+
Review the
|
209
|
+
[Changelog](https://github.com/brettchalupa/graphql-docs/blob/main/CHANGELOG.md)
|
210
|
+
for detailed changes for each release. The intent is to make upgrading as
|
211
|
+
painless as possible.
|
212
|
+
|
213
|
+
## Roadmap
|
214
|
+
|
215
|
+
Upcoming work for the project is organized publicly via [GitHub
|
216
|
+
Projects](https://github.com/users/brettchalupa/projects/7/views/1).
|
217
|
+
|
184
218
|
## Development
|
185
219
|
|
186
|
-
After checking out the repo, run `
|
220
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
221
|
+
`bin/rake test` to run the tests. You can also run `bin/console` for
|
222
|
+
an interactive prompt that will allow you to experiment.
|
187
223
|
|
188
|
-
## Sample
|
224
|
+
## Sample Site
|
189
225
|
|
190
226
|
Clone this repository and run:
|
191
227
|
|
192
228
|
```
|
193
|
-
|
229
|
+
bin/rake sample:generate
|
194
230
|
```
|
195
231
|
|
196
|
-
to see some sample output.
|
232
|
+
to see some sample output in the `output` dir.
|
233
|
+
|
234
|
+
Boot up a server to view it:
|
235
|
+
|
236
|
+
```
|
237
|
+
bin/rake sample:serve
|
238
|
+
```
|
239
|
+
|
240
|
+
## Credits
|
241
|
+
|
242
|
+
Originally built by [gjtorikian](https://github.com/gjtorikian). Actively maintained by [brettchalupa](https://github.com/brettchalupa).
|
data/Rakefile
CHANGED
@@ -28,7 +28,6 @@ end
|
|
28
28
|
|
29
29
|
desc 'Set up a console'
|
30
30
|
task :console do
|
31
|
-
require 'pry'
|
32
31
|
require 'graphql-docs'
|
33
32
|
|
34
33
|
def reload!
|
@@ -36,33 +35,36 @@ task :console do
|
|
36
35
|
files.each { |file| load file }
|
37
36
|
end
|
38
37
|
|
38
|
+
require 'irb'
|
39
39
|
ARGV.clear
|
40
|
-
|
40
|
+
IRB.start
|
41
41
|
end
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
options = {}
|
49
|
-
options[:delete_output] = true
|
50
|
-
options[:base_url] = ENV.fetch('GQL_DOCS_BASE_URL', '')
|
51
|
-
options[:filename] = File.join(File.dirname(__FILE__), 'test', 'graphql-docs', 'fixtures', 'gh-schema.graphql')
|
52
|
-
|
53
|
-
GraphQLDocs.build(options)
|
54
|
-
end
|
43
|
+
namespace :sample do
|
44
|
+
desc 'Generate the sample documentation'
|
45
|
+
task :generate do
|
46
|
+
require 'graphql-docs'
|
55
47
|
|
56
|
-
|
57
|
-
|
58
|
-
|
48
|
+
options = {}
|
49
|
+
options[:delete_output] = true
|
50
|
+
options[:base_url] = ENV.fetch('GQL_DOCS_BASE_URL', '')
|
51
|
+
options[:filename] = File.join(File.dirname(__FILE__), 'test', 'graphql-docs', 'fixtures', 'gh-schema.graphql')
|
59
52
|
|
60
|
-
|
53
|
+
puts "Generating sample docs"
|
54
|
+
GraphQLDocs.build(options)
|
55
|
+
end
|
61
56
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
57
|
+
desc 'Generate the documentation and run a web server'
|
58
|
+
task serve: [:generate] do
|
59
|
+
require 'webrick'
|
60
|
+
PORT = "5050"
|
61
|
+
puts "Navigate to http://localhost:#{PORT} to view the sample docs"
|
62
|
+
server = WEBrick::HTTPServer.new Port: PORT
|
63
|
+
server.mount '/', WEBrick::HTTPServlet::FileHandler, 'output'
|
64
|
+
trap('INT') { server.stop }
|
65
|
+
server.start
|
66
|
+
end
|
67
|
+
task server: :serve
|
66
68
|
end
|
67
69
|
|
68
70
|
desc 'Generate and publish docs to gh-pages'
|
data/{script → bin}/console
RENAMED
data/bin/rake
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rake' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
12
|
+
|
13
|
+
bundle_binstub = File.expand_path("bundle", __dir__)
|
14
|
+
|
15
|
+
if File.file?(bundle_binstub)
|
16
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
17
|
+
load(bundle_binstub)
|
18
|
+
else
|
19
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
20
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
require "rubygems"
|
25
|
+
require "bundler/setup"
|
26
|
+
|
27
|
+
load Gem.bin_path("rake", "rake")
|
data/bin/setup
ADDED
data/exe/graphql-docs
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "graphql-docs"
|
4
|
+
require "optparse"
|
5
|
+
|
6
|
+
NAME = "graphql-docs".freeze
|
7
|
+
|
8
|
+
opts = {}
|
9
|
+
OptionParser.new do |parser|
|
10
|
+
parser.program_name = NAME
|
11
|
+
parser.banner = <<~EOS
|
12
|
+
|
13
|
+
Generate GraphQL docs from the passed in schema file.
|
14
|
+
|
15
|
+
Usage: graphql-docs SCHEMA
|
16
|
+
|
17
|
+
The only required argument is the path to the schema file to generate the site from.
|
18
|
+
|
19
|
+
Examples:
|
20
|
+
$ graphql-docs schema.graphql
|
21
|
+
$ graphql-docs schema.graphql -o _docs
|
22
|
+
|
23
|
+
Options:
|
24
|
+
EOS
|
25
|
+
|
26
|
+
parser.version = GraphQLDocs::VERSION
|
27
|
+
|
28
|
+
parser.on("-o", "--output-dir DIR", "Where the site is generated to, defaults to ./output")
|
29
|
+
parser.on("-d", "--delete-output", "Delete the output-dir before generating, defaults to false")
|
30
|
+
parser.on("-b", "--base-url URL", "URL to preprend for assets and links, defaults to \"\"")
|
31
|
+
parser.on("--verbose", "Run in verbose mode")
|
32
|
+
end.parse!(into: opts)
|
33
|
+
|
34
|
+
def err(msg)
|
35
|
+
abort("#{NAME}: Error: #{msg}")
|
36
|
+
end
|
37
|
+
|
38
|
+
schema = ARGV[0]
|
39
|
+
if schema.nil?
|
40
|
+
err("schema must be specified")
|
41
|
+
end
|
42
|
+
opts[:filename] = schema
|
43
|
+
|
44
|
+
verbose = opts.delete(:verbose)
|
45
|
+
|
46
|
+
puts("Generating site with the following options: #{opts}") if verbose
|
47
|
+
|
48
|
+
opts.transform_keys! { |k| k.to_s.gsub("-", "_").to_sym }
|
49
|
+
GraphQLDocs.build(opts)
|
50
|
+
|
51
|
+
puts("Site successfully generated in: #{opts[:output_dir] || 'output' }") if verbose
|
data/graphql-docs.gemspec
CHANGED
@@ -7,38 +7,50 @@ require 'graphql-docs/version'
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
8
|
spec.name = 'graphql-docs'
|
9
9
|
spec.version = GraphQLDocs::VERSION
|
10
|
-
spec.authors = ['Garen Torikian']
|
11
|
-
spec.email = ['
|
10
|
+
spec.authors = ['Brett Chalupa', 'Garen Torikian']
|
11
|
+
spec.email = ['brettchalupa@gmail.com']
|
12
12
|
|
13
13
|
spec.summary = 'Easily generate beautiful documentation from your GraphQL schema.'
|
14
|
-
spec.
|
14
|
+
spec.description = <<-EOF
|
15
|
+
Library and CLI for generating a website from a GraphQL API's schema
|
16
|
+
definition. With ERB templating support and a plethora of configuration
|
17
|
+
options, you can customize the output to your needs. The library easily
|
18
|
+
integrates with your Ruby deployment toolchain to ensure the docs for your
|
19
|
+
API are up to date.
|
20
|
+
EOF
|
21
|
+
spec.homepage = 'https://github.com/brettchalupa/graphql-docs'
|
15
22
|
spec.license = 'MIT'
|
23
|
+
spec.metadata = {
|
24
|
+
"bug_tracker_uri" => "https://github.com/brettchalupa/graphql-docs/issues",
|
25
|
+
"changelog_uri" => "https://github.com/brettchalupa/graphql-docs/blob/main/CHANGELOG.md",
|
26
|
+
"wiki_uri" => "https://github.com/brettchalupa/graphql-docs/wiki",
|
27
|
+
}
|
16
28
|
|
17
29
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
30
|
f.match(%r{^(test|spec|features)/})
|
19
31
|
end
|
20
|
-
spec.bindir = '
|
21
|
-
spec.executables = spec.files.grep(%r{^
|
32
|
+
spec.bindir = 'exe'
|
33
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
34
|
spec.require_paths = ['lib']
|
23
35
|
|
36
|
+
spec.required_ruby_version = '>= 2.6.0'
|
37
|
+
|
24
38
|
spec.add_dependency 'graphql', '~> 2.0'
|
25
39
|
|
26
40
|
# rendering
|
27
|
-
spec.add_dependency 'commonmarker', '~> 0.
|
41
|
+
spec.add_dependency 'commonmarker', '>= 0.23.6', '~> 0.23'
|
28
42
|
spec.add_dependency 'escape_utils', '~> 1.2'
|
29
43
|
spec.add_dependency 'extended-markdown-filter', '~> 0.4'
|
30
44
|
spec.add_dependency 'gemoji', '~> 3.0'
|
31
|
-
spec.add_dependency 'html-pipeline', '~> 2.
|
32
|
-
spec.add_dependency '
|
45
|
+
spec.add_dependency 'html-pipeline', '>= 2.14.3', '~> 2.14'
|
46
|
+
spec.add_dependency 'dartsass', '~> 1.49'
|
33
47
|
|
34
|
-
spec.add_development_dependency 'awesome_print'
|
35
48
|
spec.add_development_dependency 'html-proofer', '~> 3.4'
|
36
49
|
spec.add_development_dependency 'minitest', '~> 5.0'
|
37
50
|
spec.add_development_dependency 'minitest-focus', '~> 1.1'
|
38
|
-
spec.add_development_dependency '
|
39
|
-
spec.add_development_dependency '
|
40
|
-
spec.add_development_dependency 'rubocop'
|
41
|
-
spec.add_development_dependency 'rubocop-performance'
|
42
|
-
spec.add_development_dependency 'rubocop-standard'
|
51
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
52
|
+
spec.add_development_dependency 'rubocop', '~> 1.37'
|
53
|
+
spec.add_development_dependency 'rubocop-performance', '~> 1.15'
|
43
54
|
spec.add_development_dependency 'webmock', '~> 2.3'
|
55
|
+
spec.add_development_dependency 'webrick', '~> 1.7'
|
44
56
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'erb'
|
4
|
-
require '
|
4
|
+
require 'fileutils'
|
5
5
|
|
6
6
|
module GraphQLDocs
|
7
7
|
class Generator
|
@@ -85,7 +85,7 @@ module GraphQLDocs
|
|
85
85
|
FileUtils.mkdir_p(File.join(@options[:output_dir], 'assets'))
|
86
86
|
|
87
87
|
sass = File.join(assets_dir, 'css', 'screen.scss')
|
88
|
-
system `
|
88
|
+
system `bundle exec dartsass --no-source-map=none #{sass} #{@options[:output_dir]}/assets/style.css`
|
89
89
|
|
90
90
|
FileUtils.cp_r(File.join(assets_dir, 'images'), File.join(@options[:output_dir], 'assets'))
|
91
91
|
FileUtils.cp_r(File.join(assets_dir, 'webfonts'), File.join(@options[:output_dir], 'assets'))
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<head>
|
4
4
|
<meta charset="utf-8">
|
5
5
|
<meta name="description" content="<%= name %> GraphQL documentation">
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
7
7
|
<title><%= title || name %></title>
|
8
8
|
<link rel="stylesheet" href="<%= base_url %>/assets/style.css">
|
9
9
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/3.2.2/anchor.min.js"></script>
|
data/lib/graphql-docs/version.rb
CHANGED
data/lib/graphql-docs.rb
CHANGED
@@ -7,10 +7,6 @@ require 'graphql-docs/generator'
|
|
7
7
|
require 'graphql-docs/parser'
|
8
8
|
require 'graphql-docs/version'
|
9
9
|
|
10
|
-
begin
|
11
|
-
require 'awesome_print'
|
12
|
-
require 'pry'
|
13
|
-
rescue LoadError; end # rubocop:disable Lint/SuppressedException
|
14
10
|
module GraphQLDocs
|
15
11
|
class << self
|
16
12
|
def build(options)
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-docs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- Brett Chalupa
|
7
8
|
- Garen Torikian
|
8
9
|
autorequire:
|
9
|
-
bindir:
|
10
|
+
bindir: exe
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2023-01-26 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: graphql
|
@@ -28,16 +29,22 @@ dependencies:
|
|
28
29
|
name: commonmarker
|
29
30
|
requirement: !ruby/object:Gem::Requirement
|
30
31
|
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 0.23.6
|
31
35
|
- - "~>"
|
32
36
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
37
|
+
version: '0.23'
|
34
38
|
type: :runtime
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
37
41
|
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 0.23.6
|
38
45
|
- - "~>"
|
39
46
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0.
|
47
|
+
version: '0.23'
|
41
48
|
- !ruby/object:Gem::Dependency
|
42
49
|
name: escape_utils
|
43
50
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,44 +91,36 @@ dependencies:
|
|
84
91
|
name: html-pipeline
|
85
92
|
requirement: !ruby/object:Gem::Requirement
|
86
93
|
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 2.14.3
|
87
97
|
- - "~>"
|
88
98
|
- !ruby/object:Gem::Version
|
89
|
-
version: '2.
|
99
|
+
version: '2.14'
|
90
100
|
type: :runtime
|
91
101
|
prerelease: false
|
92
102
|
version_requirements: !ruby/object:Gem::Requirement
|
93
103
|
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: 2.14.3
|
94
107
|
- - "~>"
|
95
108
|
- !ruby/object:Gem::Version
|
96
|
-
version: '2.
|
109
|
+
version: '2.14'
|
97
110
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
111
|
+
name: dartsass
|
99
112
|
requirement: !ruby/object:Gem::Requirement
|
100
113
|
requirements:
|
101
114
|
- - "~>"
|
102
115
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
116
|
+
version: '1.49'
|
104
117
|
type: :runtime
|
105
118
|
prerelease: false
|
106
119
|
version_requirements: !ruby/object:Gem::Requirement
|
107
120
|
requirements:
|
108
121
|
- - "~>"
|
109
122
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: awesome_print
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
123
|
+
version: '1.49'
|
125
124
|
- !ruby/object:Gem::Dependency
|
126
125
|
name: html-proofer
|
127
126
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,104 +164,104 @@ dependencies:
|
|
165
164
|
- !ruby/object:Gem::Version
|
166
165
|
version: '1.1'
|
167
166
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
167
|
+
name: rake
|
169
168
|
requirement: !ruby/object:Gem::Requirement
|
170
169
|
requirements:
|
171
170
|
- - "~>"
|
172
171
|
- !ruby/object:Gem::Version
|
173
|
-
version: '
|
172
|
+
version: '13.0'
|
174
173
|
type: :development
|
175
174
|
prerelease: false
|
176
175
|
version_requirements: !ruby/object:Gem::Requirement
|
177
176
|
requirements:
|
178
177
|
- - "~>"
|
179
178
|
- !ruby/object:Gem::Version
|
180
|
-
version: '
|
181
|
-
- !ruby/object:Gem::Dependency
|
182
|
-
name: rake
|
183
|
-
requirement: !ruby/object:Gem::Requirement
|
184
|
-
requirements:
|
185
|
-
- - ">="
|
186
|
-
- !ruby/object:Gem::Version
|
187
|
-
version: '0'
|
188
|
-
type: :development
|
189
|
-
prerelease: false
|
190
|
-
version_requirements: !ruby/object:Gem::Requirement
|
191
|
-
requirements:
|
192
|
-
- - ">="
|
193
|
-
- !ruby/object:Gem::Version
|
194
|
-
version: '0'
|
179
|
+
version: '13.0'
|
195
180
|
- !ruby/object:Gem::Dependency
|
196
181
|
name: rubocop
|
197
182
|
requirement: !ruby/object:Gem::Requirement
|
198
183
|
requirements:
|
199
|
-
- - "
|
184
|
+
- - "~>"
|
200
185
|
- !ruby/object:Gem::Version
|
201
|
-
version: '
|
186
|
+
version: '1.37'
|
202
187
|
type: :development
|
203
188
|
prerelease: false
|
204
189
|
version_requirements: !ruby/object:Gem::Requirement
|
205
190
|
requirements:
|
206
|
-
- - "
|
191
|
+
- - "~>"
|
207
192
|
- !ruby/object:Gem::Version
|
208
|
-
version: '
|
193
|
+
version: '1.37'
|
209
194
|
- !ruby/object:Gem::Dependency
|
210
195
|
name: rubocop-performance
|
211
196
|
requirement: !ruby/object:Gem::Requirement
|
212
197
|
requirements:
|
213
|
-
- - "
|
198
|
+
- - "~>"
|
214
199
|
- !ruby/object:Gem::Version
|
215
|
-
version: '
|
200
|
+
version: '1.15'
|
216
201
|
type: :development
|
217
202
|
prerelease: false
|
218
203
|
version_requirements: !ruby/object:Gem::Requirement
|
219
204
|
requirements:
|
220
|
-
- - "
|
205
|
+
- - "~>"
|
221
206
|
- !ruby/object:Gem::Version
|
222
|
-
version: '
|
207
|
+
version: '1.15'
|
223
208
|
- !ruby/object:Gem::Dependency
|
224
|
-
name:
|
209
|
+
name: webmock
|
225
210
|
requirement: !ruby/object:Gem::Requirement
|
226
211
|
requirements:
|
227
|
-
- - "
|
212
|
+
- - "~>"
|
228
213
|
- !ruby/object:Gem::Version
|
229
|
-
version: '
|
214
|
+
version: '2.3'
|
230
215
|
type: :development
|
231
216
|
prerelease: false
|
232
217
|
version_requirements: !ruby/object:Gem::Requirement
|
233
218
|
requirements:
|
234
|
-
- - "
|
219
|
+
- - "~>"
|
235
220
|
- !ruby/object:Gem::Version
|
236
|
-
version: '
|
221
|
+
version: '2.3'
|
237
222
|
- !ruby/object:Gem::Dependency
|
238
|
-
name:
|
223
|
+
name: webrick
|
239
224
|
requirement: !ruby/object:Gem::Requirement
|
240
225
|
requirements:
|
241
226
|
- - "~>"
|
242
227
|
- !ruby/object:Gem::Version
|
243
|
-
version: '
|
228
|
+
version: '1.7'
|
244
229
|
type: :development
|
245
230
|
prerelease: false
|
246
231
|
version_requirements: !ruby/object:Gem::Requirement
|
247
232
|
requirements:
|
248
233
|
- - "~>"
|
249
234
|
- !ruby/object:Gem::Version
|
250
|
-
version: '
|
251
|
-
description:
|
235
|
+
version: '1.7'
|
236
|
+
description: |2
|
237
|
+
Library and CLI for generating a website from a GraphQL API's schema
|
238
|
+
definition. With ERB templating support and a plethora of configuration
|
239
|
+
options, you can customize the output to your needs. The library easily
|
240
|
+
integrates with your Ruby deployment toolchain to ensure the docs for your
|
241
|
+
API are up to date.
|
252
242
|
email:
|
253
|
-
-
|
254
|
-
executables:
|
243
|
+
- brettchalupa@gmail.com
|
244
|
+
executables:
|
245
|
+
- graphql-docs
|
255
246
|
extensions: []
|
256
247
|
extra_rdoc_files: []
|
257
248
|
files:
|
258
|
-
- ".github/
|
249
|
+
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
250
|
+
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
251
|
+
- ".github/workflows/tests.yml"
|
259
252
|
- ".gitignore"
|
260
253
|
- ".rubocop.yml"
|
261
|
-
-
|
254
|
+
- CHANGELOG.md
|
255
|
+
- CODE_OF_CONDUCT.md
|
256
|
+
- CONTRIBUTING.md
|
262
257
|
- Gemfile
|
263
258
|
- LICENSE.txt
|
264
259
|
- README.md
|
265
260
|
- Rakefile
|
261
|
+
- bin/console
|
262
|
+
- bin/rake
|
263
|
+
- bin/setup
|
264
|
+
- exe/graphql-docs
|
266
265
|
- graphql-docs.gemspec
|
267
266
|
- lib/graphql-docs.rb
|
268
267
|
- lib/graphql-docs/configuration.rb
|
@@ -334,12 +333,13 @@ files:
|
|
334
333
|
- lib/graphql-docs/parser.rb
|
335
334
|
- lib/graphql-docs/renderer.rb
|
336
335
|
- lib/graphql-docs/version.rb
|
337
|
-
|
338
|
-
- script/console
|
339
|
-
homepage: https://github.com/gjtorikian/graphql-docs
|
336
|
+
homepage: https://github.com/brettchalupa/graphql-docs
|
340
337
|
licenses:
|
341
338
|
- MIT
|
342
|
-
metadata:
|
339
|
+
metadata:
|
340
|
+
bug_tracker_uri: https://github.com/brettchalupa/graphql-docs/issues
|
341
|
+
changelog_uri: https://github.com/brettchalupa/graphql-docs/blob/main/CHANGELOG.md
|
342
|
+
wiki_uri: https://github.com/brettchalupa/graphql-docs/wiki
|
343
343
|
post_install_message:
|
344
344
|
rdoc_options: []
|
345
345
|
require_paths:
|
@@ -348,14 +348,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
348
348
|
requirements:
|
349
349
|
- - ">="
|
350
350
|
- !ruby/object:Gem::Version
|
351
|
-
version:
|
351
|
+
version: 2.6.0
|
352
352
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
353
353
|
requirements:
|
354
354
|
- - ">="
|
355
355
|
- !ruby/object:Gem::Version
|
356
356
|
version: '0'
|
357
357
|
requirements: []
|
358
|
-
rubygems_version: 3.3.
|
358
|
+
rubygems_version: 3.3.22
|
359
359
|
signing_key:
|
360
360
|
specification_version: 4
|
361
361
|
summary: Easily generate beautiful documentation from your GraphQL schema.
|
data/.github/FUNDING.yml
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
# These are supported funding model platforms
|
2
|
-
|
3
|
-
github: gjtorikian
|
4
|
-
patreon: gjtorikian
|
5
|
-
open_collective: garen-torikian
|
6
|
-
#ko_fi: # Replace with a single Ko-fi username
|
7
|
-
#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
8
|
-
#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
9
|
-
#liberapay: # Replace with a single Liberapay username
|
10
|
-
issuehunt: gjtorikian
|
11
|
-
#otechie: # Replace with a single Otechie username
|
12
|
-
#custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
data/.travis.yml
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
language: ruby
|
3
|
-
cache: bundler
|
4
|
-
|
5
|
-
rvm:
|
6
|
-
- 2.4.9
|
7
|
-
- 2.5.7
|
8
|
-
- 2.6.5
|
9
|
-
- 2.7.0
|
10
|
-
|
11
|
-
git:
|
12
|
-
depth: 10
|
13
|
-
|
14
|
-
before_install:
|
15
|
-
- gem update --system
|
16
|
-
- gem install bundler
|
17
|
-
|
18
|
-
matrix:
|
19
|
-
include:
|
20
|
-
- script: bundle exec rake rubocop
|
21
|
-
rvm: 2.6.0
|
22
|
-
- script: bundle exec rake html_proofer
|
23
|
-
rvm: 2.6.0
|