graphql-docs 3.0.1 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99086c3e1811e349aa9ea5cec00715e8d4809ed3645a7b4ca6867a945958ad9b
4
- data.tar.gz: e46166af01f325dd73dd6f328c070c8d23437fc6e4e8734b22d4607462b9eea6
3
+ metadata.gz: 682142e3da8fc82b8239160dada35a1982156aa68455af381602619047a46a91
4
+ data.tar.gz: 8c819a7152b269cd0e06e8979d3dc99755e5426e1c8dd8ccdc197ffaded2fd54
5
5
  SHA512:
6
- metadata.gz: c464e56c73fc3ffdd31a89a1793e3c3fdb3014766f05d6ea4d95bcf158302a0a506b2278fd36f4994660b92f38dd8769cc1901c343ddda5bddb41714a593ad56
7
- data.tar.gz: 3ca5e79abb61fa954695ea37c4368bbcfcf43ca5a3269bd800ea3595abcbde686a4006978393d192a9d862a9dfd72a25e320a818433c77fdfcbb04483d0d21ac
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.
@@ -8,7 +8,7 @@ jobs:
8
8
 
9
9
  strategy:
10
10
  matrix:
11
- ruby-version: [3.1.2, 3.0.4, 2.7.6, 2.6.10, 2.5.9]
11
+ ruby-version: [3.1.2, 3.0.4, 2.7.6, 2.6.10]
12
12
 
13
13
  steps:
14
14
  - uses: actions/checkout@v2
data/.gitignore CHANGED
@@ -12,3 +12,4 @@
12
12
  /.sass-cache/
13
13
  /output/
14
14
  .byebug_history
15
+ *.gem
data/.rubocop.yml CHANGED
@@ -1,6 +1,4 @@
1
- inherit_gem:
2
- rubocop-standard:
3
- - config/default.yml
1
+ require: rubocop-performance
4
2
 
5
3
  Style/StringLiterals:
6
4
  Enabled: true
data/CHANGELOG.md CHANGED
@@ -2,11 +2,24 @@
2
2
 
3
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
4
 
5
- ## v3.0.1
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
6
19
 
7
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
8
21
  - meta: Maintainership change from [gjtorikian](https://github.com/gjtorikian) to [brettchalupa](https://github.com/brettchalupa)
9
22
 
10
- ## v3.0.0
23
+ ## v3.0.0 - 2022-03-23
11
24
 
12
25
  - Upgrades `graphql` gem to the 2.x series
@@ -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/README.md CHANGED
@@ -1,27 +1,27 @@
1
1
  # GraphQLDocs
2
2
 
3
- Easily generate beautiful documentation from your GraphQL schema.
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 this line to your application's Gemfile:
9
+ Add the gem to your project with this command:
10
10
 
11
- ```ruby
12
- gem 'graphql-docs'
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
- $ gem install graphql-docs
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,19 +195,47 @@ 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 `script/bootstrap` to install dependencies. Then, run `rake test` to run the tests. You can also run `bundle exec rake console` for an interactive prompt that will allow you to experiment.
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 site
224
+ ## Sample Site
189
225
 
190
226
  Clone this repository and run:
191
227
 
192
228
  ```
193
- bundle exec rake sample
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
+ ```
197
239
 
198
240
  ## Credits
199
241
 
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
- Pry.start
40
+ IRB.start
41
41
  end
42
42
 
43
- desc 'Generate the documentation'
44
- task :generate_sample do
45
- require 'pry'
46
- require 'graphql-docs'
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
- desc 'Generate the documentation and run a web server'
57
- task sample: [:generate_sample] do
58
- require 'webrick'
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
- puts 'Navigate to http://localhost:3000 to see the sample docs'
53
+ puts "Generating sample docs"
54
+ GraphQLDocs.build(options)
55
+ end
61
56
 
62
- server = WEBrick::HTTPServer.new Port: 3000
63
- server.mount '/', WEBrick::HTTPServlet::FileHandler, 'output'
64
- trap('INT') { server.stop }
65
- server.start
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'
@@ -2,10 +2,8 @@
2
2
 
3
3
  set -e
4
4
 
5
- dir=`pwd`
6
-
7
5
  echo "===> Bundling..."
8
- script/bootstrap --quiet
6
+ bin/setup --quiet
9
7
 
10
8
  echo "===> Launching..."
11
- bundle exec rake console
9
+ bin/rake console
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
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install "$@"
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
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
 
13
13
  spec.summary = 'Easily generate beautiful documentation from your GraphQL schema.'
14
14
  spec.description = <<-EOF
15
- GraphQLDocs is a library for generating HTML from a GraphQL API's schema
15
+ Library and CLI for generating a website from a GraphQL API's schema
16
16
  definition. With ERB templating support and a plethora of configuration
17
17
  options, you can customize the output to your needs. The library easily
18
18
  integrates with your Ruby deployment toolchain to ensure the docs for your
@@ -29,29 +29,28 @@ Gem::Specification.new do |spec|
29
29
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
30
30
  f.match(%r{^(test|spec|features)/})
31
31
  end
32
- spec.bindir = 'bin'
33
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
32
+ spec.bindir = 'exe'
33
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
34
34
  spec.require_paths = ['lib']
35
35
 
36
+ spec.required_ruby_version = '>= 2.6.0'
37
+
36
38
  spec.add_dependency 'graphql', '~> 2.0'
37
39
 
38
40
  # rendering
39
- spec.add_dependency 'commonmarker', '~> 0.16'
40
- spec.add_dependency 'escape_utils', '~> 1.2.2'
41
+ spec.add_dependency 'commonmarker', '>= 0.23.6', '~> 0.23'
42
+ spec.add_dependency 'escape_utils', '~> 1.2'
41
43
  spec.add_dependency 'extended-markdown-filter', '~> 0.4'
42
44
  spec.add_dependency 'gemoji', '~> 3.0'
43
- spec.add_dependency 'html-pipeline', '~> 2.9'
44
- spec.add_dependency 'sass', '~> 3.4'
45
+ spec.add_dependency 'html-pipeline', '>= 2.14.3', '~> 2.14'
46
+ spec.add_dependency 'dartsass', '~> 1.49'
45
47
 
46
- spec.add_development_dependency 'awesome_print'
47
48
  spec.add_development_dependency 'html-proofer', '~> 3.4'
48
49
  spec.add_development_dependency 'minitest', '~> 5.0'
49
50
  spec.add_development_dependency 'minitest-focus', '~> 1.1'
50
- spec.add_development_dependency 'pry-byebug', '~> 3.6'
51
- spec.add_development_dependency 'rake'
52
- spec.add_development_dependency 'rubocop'
53
- spec.add_development_dependency 'rubocop-performance'
54
- 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'
55
54
  spec.add_development_dependency 'webmock', '~> 2.3'
56
55
  spec.add_development_dependency 'webrick', '~> 1.7'
57
56
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'erb'
4
- require 'sass'
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 `sass --sourcemap=none #{sass}:#{@options[:output_dir]}/assets/style.css`
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, maximum-scale=1, user-scalable=no">
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>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GraphQLDocs
4
- VERSION = '3.0.1'
4
+ VERSION = '4.0.0'
5
5
  end
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,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Chalupa
8
8
  - Garen Torikian
9
9
  autorequire:
10
- bindir: bin
10
+ bindir: exe
11
11
  cert_chain: []
12
- date: 2022-10-14 00:00:00.000000000 Z
12
+ date: 2023-01-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: graphql
@@ -29,30 +29,36 @@ dependencies:
29
29
  name: commonmarker
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 0.23.6
32
35
  - - "~>"
33
36
  - !ruby/object:Gem::Version
34
- version: '0.16'
37
+ version: '0.23'
35
38
  type: :runtime
36
39
  prerelease: false
37
40
  version_requirements: !ruby/object:Gem::Requirement
38
41
  requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: 0.23.6
39
45
  - - "~>"
40
46
  - !ruby/object:Gem::Version
41
- version: '0.16'
47
+ version: '0.23'
42
48
  - !ruby/object:Gem::Dependency
43
49
  name: escape_utils
44
50
  requirement: !ruby/object:Gem::Requirement
45
51
  requirements:
46
52
  - - "~>"
47
53
  - !ruby/object:Gem::Version
48
- version: 1.2.2
54
+ version: '1.2'
49
55
  type: :runtime
50
56
  prerelease: false
51
57
  version_requirements: !ruby/object:Gem::Requirement
52
58
  requirements:
53
59
  - - "~>"
54
60
  - !ruby/object:Gem::Version
55
- version: 1.2.2
61
+ version: '1.2'
56
62
  - !ruby/object:Gem::Dependency
57
63
  name: extended-markdown-filter
58
64
  requirement: !ruby/object:Gem::Requirement
@@ -85,44 +91,36 @@ dependencies:
85
91
  name: html-pipeline
86
92
  requirement: !ruby/object:Gem::Requirement
87
93
  requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: 2.14.3
88
97
  - - "~>"
89
98
  - !ruby/object:Gem::Version
90
- version: '2.9'
99
+ version: '2.14'
91
100
  type: :runtime
92
101
  prerelease: false
93
102
  version_requirements: !ruby/object:Gem::Requirement
94
103
  requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: 2.14.3
95
107
  - - "~>"
96
108
  - !ruby/object:Gem::Version
97
- version: '2.9'
109
+ version: '2.14'
98
110
  - !ruby/object:Gem::Dependency
99
- name: sass
111
+ name: dartsass
100
112
  requirement: !ruby/object:Gem::Requirement
101
113
  requirements:
102
114
  - - "~>"
103
115
  - !ruby/object:Gem::Version
104
- version: '3.4'
116
+ version: '1.49'
105
117
  type: :runtime
106
118
  prerelease: false
107
119
  version_requirements: !ruby/object:Gem::Requirement
108
120
  requirements:
109
121
  - - "~>"
110
122
  - !ruby/object:Gem::Version
111
- version: '3.4'
112
- - !ruby/object:Gem::Dependency
113
- name: awesome_print
114
- requirement: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - ">="
117
- - !ruby/object:Gem::Version
118
- version: '0'
119
- type: :development
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - ">="
124
- - !ruby/object:Gem::Version
125
- version: '0'
123
+ version: '1.49'
126
124
  - !ruby/object:Gem::Dependency
127
125
  name: html-proofer
128
126
  requirement: !ruby/object:Gem::Requirement
@@ -166,75 +164,47 @@ dependencies:
166
164
  - !ruby/object:Gem::Version
167
165
  version: '1.1'
168
166
  - !ruby/object:Gem::Dependency
169
- name: pry-byebug
167
+ name: rake
170
168
  requirement: !ruby/object:Gem::Requirement
171
169
  requirements:
172
170
  - - "~>"
173
171
  - !ruby/object:Gem::Version
174
- version: '3.6'
172
+ version: '13.0'
175
173
  type: :development
176
174
  prerelease: false
177
175
  version_requirements: !ruby/object:Gem::Requirement
178
176
  requirements:
179
177
  - - "~>"
180
178
  - !ruby/object:Gem::Version
181
- version: '3.6'
182
- - !ruby/object:Gem::Dependency
183
- name: rake
184
- requirement: !ruby/object:Gem::Requirement
185
- requirements:
186
- - - ">="
187
- - !ruby/object:Gem::Version
188
- version: '0'
189
- type: :development
190
- prerelease: false
191
- version_requirements: !ruby/object:Gem::Requirement
192
- requirements:
193
- - - ">="
194
- - !ruby/object:Gem::Version
195
- version: '0'
179
+ version: '13.0'
196
180
  - !ruby/object:Gem::Dependency
197
181
  name: rubocop
198
182
  requirement: !ruby/object:Gem::Requirement
199
183
  requirements:
200
- - - ">="
184
+ - - "~>"
201
185
  - !ruby/object:Gem::Version
202
- version: '0'
186
+ version: '1.37'
203
187
  type: :development
204
188
  prerelease: false
205
189
  version_requirements: !ruby/object:Gem::Requirement
206
190
  requirements:
207
- - - ">="
191
+ - - "~>"
208
192
  - !ruby/object:Gem::Version
209
- version: '0'
193
+ version: '1.37'
210
194
  - !ruby/object:Gem::Dependency
211
195
  name: rubocop-performance
212
196
  requirement: !ruby/object:Gem::Requirement
213
197
  requirements:
214
- - - ">="
215
- - !ruby/object:Gem::Version
216
- version: '0'
217
- type: :development
218
- prerelease: false
219
- version_requirements: !ruby/object:Gem::Requirement
220
- requirements:
221
- - - ">="
222
- - !ruby/object:Gem::Version
223
- version: '0'
224
- - !ruby/object:Gem::Dependency
225
- name: rubocop-standard
226
- requirement: !ruby/object:Gem::Requirement
227
- requirements:
228
- - - ">="
198
+ - - "~>"
229
199
  - !ruby/object:Gem::Version
230
- version: '0'
200
+ version: '1.15'
231
201
  type: :development
232
202
  prerelease: false
233
203
  version_requirements: !ruby/object:Gem::Requirement
234
204
  requirements:
235
- - - ">="
205
+ - - "~>"
236
206
  - !ruby/object:Gem::Version
237
- version: '0'
207
+ version: '1.15'
238
208
  - !ruby/object:Gem::Dependency
239
209
  name: webmock
240
210
  requirement: !ruby/object:Gem::Requirement
@@ -264,25 +234,34 @@ dependencies:
264
234
  - !ruby/object:Gem::Version
265
235
  version: '1.7'
266
236
  description: |2
267
- GraphQLDocs is a library for generating HTML from a GraphQL API's schema
237
+ Library and CLI for generating a website from a GraphQL API's schema
268
238
  definition. With ERB templating support and a plethora of configuration
269
239
  options, you can customize the output to your needs. The library easily
270
240
  integrates with your Ruby deployment toolchain to ensure the docs for your
271
241
  API are up to date.
272
242
  email:
273
243
  - brettchalupa@gmail.com
274
- executables: []
244
+ executables:
245
+ - graphql-docs
275
246
  extensions: []
276
247
  extra_rdoc_files: []
277
248
  files:
249
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
250
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
278
251
  - ".github/workflows/tests.yml"
279
252
  - ".gitignore"
280
253
  - ".rubocop.yml"
281
254
  - CHANGELOG.md
255
+ - CODE_OF_CONDUCT.md
256
+ - CONTRIBUTING.md
282
257
  - Gemfile
283
258
  - LICENSE.txt
284
259
  - README.md
285
260
  - Rakefile
261
+ - bin/console
262
+ - bin/rake
263
+ - bin/setup
264
+ - exe/graphql-docs
286
265
  - graphql-docs.gemspec
287
266
  - lib/graphql-docs.rb
288
267
  - lib/graphql-docs/configuration.rb
@@ -354,8 +333,6 @@ files:
354
333
  - lib/graphql-docs/parser.rb
355
334
  - lib/graphql-docs/renderer.rb
356
335
  - lib/graphql-docs/version.rb
357
- - script/bootstrap
358
- - script/console
359
336
  homepage: https://github.com/brettchalupa/graphql-docs
360
337
  licenses:
361
338
  - MIT
@@ -371,7 +348,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
371
348
  requirements:
372
349
  - - ">="
373
350
  - !ruby/object:Gem::Version
374
- version: '0'
351
+ version: 2.6.0
375
352
  required_rubygems_version: !ruby/object:Gem::Requirement
376
353
  requirements:
377
354
  - - ">="
data/script/bootstrap DELETED
@@ -1,5 +0,0 @@
1
- #!/bin/sh
2
-
3
- set -e
4
-
5
- bundle install "$@"