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 +4 -4
- data/README.md +1 -1
- data/app/helpers/graphql_playground_rails/application_helper.rb +0 -5
- data/app/javascript/packs/index.js +0 -11
- data/lib/graphql_playground_rails.rb +0 -10
- data/lib/graphql_playground_rails/engine.rb +0 -23
- data/lib/graphql_playground_rails/version.rb +1 -1
- metadata +2 -3
- data/lib/tasks/graphql_playground_rails_tasks.rake +0 -59
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e318a0eb96979eed77c96b06d7fafe277ba007a07986df0e08d7b80fe914aee
|
4
|
+
data.tar.gz: 11a753a3eedd76f2268f917fb92148ccc427a6de7ba61a13fcafd1ac8f90e29a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11b44363379db3ad9b4ee54ae6cde590c8fa5f0544b45b6f306f43ac67b753188ce6a4e0e2e7a8837822eafaa7a3b5e5c08005f2087d44e726a97949d19337bf
|
7
|
+
data.tar.gz: 8dd6e5825ba87a6ca97957b62e2bd90732c614f2c3b951e67fb7184a017c73f1d1156eb754371622d2d4571f0dbf36fc59abb4e1dd737c98c540784822336c65
|
data/README.md
CHANGED
@@ -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
|
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.
|
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-
|
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
|