graphql_playground_rails 0.1.0 → 0.1.1

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: c5139f09aa47614172a7352f53b73310639d8462d29c86ba7eac4ad32bffb804
4
- data.tar.gz: a07d4e03cb41a6fe165d6f4236a0335071bf9e31edc7d0ea1171fc68d26e06f7
3
+ metadata.gz: 2e318a0eb96979eed77c96b06d7fafe277ba007a07986df0e08d7b80fe914aee
4
+ data.tar.gz: 11a753a3eedd76f2268f917fb92148ccc427a6de7ba61a13fcafd1ac8f90e29a
5
5
  SHA512:
6
- metadata.gz: 05c8369a16351746c409dad58eceb37dd845c59c0ad64e25a394ab16776bfa88c5cb12308b9b63c58b0dbbeb7e40a82f39eb997312c17fafdd9841d60d9b38e7
7
- data.tar.gz: 373f7eace910fe46be803a1066bd84bc865e0f0b5447af218036a47fc47a397ba11846f41b915670abf6028ed8728b337b3bcd3b1e4e5c1d7bf7876c3a8f9b2a
6
+ metadata.gz: 11b44363379db3ad9b4ee54ae6cde590c8fa5f0544b45b6f306f43ac67b753188ce6a4e0e2e7a8837822eafaa7a3b5e5c08005f2087d44e726a97949d19337bf
7
+ data.tar.gz: 8dd6e5825ba87a6ca97957b62e2bd90732c614f2c3b951e67fb7184a017c73f1d1156eb754371622d2d4571f0dbf36fc59abb4e1dd737c98c540784822336c65
data/README.md CHANGED
@@ -26,7 +26,7 @@ you restart your Rails server.
26
26
  Add this line to your application's Gemfile:
27
27
 
28
28
  ```ruby
29
- gem 'graphql_playground_rails', github: 'gueorgui/graphql_playground_rails'
29
+ gem 'graphql_playground_rails'
30
30
  ```
31
31
 
32
32
  And then execute:
@@ -1,9 +1,4 @@
1
1
  module GraphqlPlaygroundRails
2
2
  module ApplicationHelper
3
- include ::Webpacker::Helper
4
-
5
- def current_webpacker_instance
6
- GraphqlPlaygroundRails.webpacker
7
- end
8
3
  end
9
4
  end
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import ReactDOM from 'react-dom';
3
- import { Provider } from 'react-redux';
4
- import { Playground, store } from 'graphql-playground-react';
5
-
6
- ReactDOM.render(
7
- <Provider store={store}>
8
- <Playground endpoint="http://localhost:3000/graphql" />
9
- </Provider>,
10
- document.querySelector('#root'),
11
- );
@@ -1,14 +1,4 @@
1
1
  require 'graphql_playground_rails/engine'
2
2
 
3
3
  module GraphqlPlaygroundRails
4
- ROOT_PATH = Pathname.new(File.join(__dir__, '..'))
5
-
6
- class << self
7
- def webpacker
8
- @webpacker ||= ::Webpacker::Instance.new(
9
- root_path: ROOT_PATH,
10
- config_path: ROOT_PATH.join('config/webpacker.yml')
11
- )
12
- end
13
- end
14
4
  end
@@ -1,28 +1,5 @@
1
1
  module GraphqlPlaygroundRails
2
2
  class Engine < ::Rails::Engine
3
3
  isolate_namespace GraphqlPlaygroundRails
4
-
5
- initializer 'webpacker.proxy' do |app|
6
- insert_middleware = begin
7
- GraphqlPlaygroundRails.webpacker.config.dev_server.present?
8
- rescue
9
- nil
10
- end
11
- next unless insert_middleware
12
-
13
- app.middleware.insert_before(
14
- 0, Webpacker::DevServerProxy,
15
- ssl_verify_none: true,
16
- webpacker: GraphqlPlaygroundRails.webpacker
17
- )
18
- end
19
-
20
- root_dir = File.dirname(__dir__)
21
- public_dir = File.join(root_dir, 'public')
22
- puts "Mounting middleware at root = #{public_dir}"
23
- config.app_middleware.use(
24
- Rack::Static,
25
- urls: ['/playground'], root: public_dir
26
- )
27
4
  end
28
5
  end
@@ -1,3 +1,3 @@
1
1
  module GraphqlPlaygroundRails
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql_playground_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gueorgui Tcherednitchenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-28 00:00:00.000000000 Z
11
+ date: 2020-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -57,7 +57,6 @@ files:
57
57
  - lib/graphql_playground_rails.rb
58
58
  - lib/graphql_playground_rails/engine.rb
59
59
  - lib/graphql_playground_rails/version.rb
60
- - lib/tasks/graphql_playground_rails_tasks.rake
61
60
  homepage: https://github.com/gueorgui/graphql_playground_rails
62
61
  licenses:
63
62
  - MIT
@@ -1,59 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- def ensure_log_goes_to_stdout
4
- old_logger = Webpacker.logger
5
- Webpacker.logger = ActiveSupport::Logger.new(STDOUT)
6
- yield
7
- ensure
8
- Webpacker.logger = old_logger
9
- end
10
-
11
- namespace :graphql_playground_rails do
12
- namespace :webpacker do
13
- desc 'Install dependencies with Yarn'
14
- task :yarn_install do
15
- Dir.chdir(File.join(__dir__, '../..')) do
16
- system 'yarn install --no-progress --production'
17
- end
18
- end
19
-
20
- desc 'Compile JavaScript packs for production with digests, using Webpack'
21
- task compile: %i[yarn_install environment] do
22
- Webpacker.with_node_env('production') do
23
- ensure_log_goes_to_stdout do
24
- if GraphqlPlaygroundRails.webpacker.commands.compile
25
- # Success!
26
- else
27
- exit!
28
- end
29
- end
30
- end
31
- end
32
- end
33
- end
34
-
35
- def yarn_install_available?
36
- rails_major = Rails::VERSION::MAJOR
37
- rails_minor = Rails::VERSION::MINOR
38
-
39
- rails_major > 5 || (rails_major == 5 && rails_minor >= 1)
40
- end
41
-
42
- def enhance_assets_precompile
43
- deps = yarn_install_available? ? [] : ['graphql_playground_rails:webpacker:yarn_install']
44
- Rake::Task['assets:precompile'].enhance(deps) do
45
- Rake::Task['graphql_playsground_rails:webpacker:compile'].invoke
46
- end
47
- end
48
-
49
- # Compile packs after we've compiled all other assets during precompilation
50
- skip_webpacker_precompile = %w[no false n f].include?(ENV['WEBPACKER_PRECOMPILE'])
51
-
52
- unless skip_webpacker_precompile
53
- if Rake::Task.task_defined?('assets:precompile')
54
- enhance_assets_precompile
55
- else
56
- Rake::Task.define_task('assets:precompile' =>
57
- 'graphql_playsground_rails:webpacker:compile')
58
- end
59
- end