yarii-cloudinary 0.2.3 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b2115382b22cd6ec1f837726a9833a5622b183ca9418d38e9a9cd59e32c1b81
4
- data.tar.gz: eb99a32df5167f42dfbba216c0f4760376b946010caace3c36ef1d4d0381de1d
3
+ metadata.gz: cf44fd307805a0b809d541cebcedc9c78647ae2e4e768c04cfe33179f067193d
4
+ data.tar.gz: b685f67566d287bb5061f183969d67cc02a56f78f2189d4085ee291a3c6d7501
5
5
  SHA512:
6
- metadata.gz: a6d7f2eecf836e21b4b9752044aa61f0f92893fc7e08a378f15d27b9b165f852373ea77acf951f3c6bc6651af37bb0b5c5733fe050c6697703a493b28f8b3d21
7
- data.tar.gz: ad83d05e4d0618d614d3d2787398acf6d30283e87d5c6b7ac094e0e1c8a8c2dfbc9be565b6dd52f2c8def9d69c6abfc2db65d332d0f0dd80d5a4975e67e8f905
6
+ metadata.gz: b27fc372cf45960977c0909db4992abdcdde8a83596f5d17b094e29b8745edd5c30642b27085c77c696bbb32126417a67dc42b15b6194a5b4675e28215c132a8
7
+ data.tar.gz: f263dd85b3b1d320fca0564ae87e5375dd8993bf30eaece1dcb1addc41bb9e20c79cf1dc757fc64d17334538e68da1939e9541c246541e707eb1b11da3663436
data/README.md CHANGED
@@ -6,8 +6,8 @@ Short description and motivation. Etc.
6
6
 
7
7
  * `yarii_editor` upload preset needed in Cloudinary (also media needs to be tagged 'yarii_editor')
8
8
  * Add the modal to dashboard extras
9
- * Add the head renderer (yarii_extra_head)
10
- * Add the gem initializer
9
+ * Add `import "yarii-cloudinary"` to your Yarii extras pack (`app/javascript/packs/yariiextras.js`)
10
+ * Add the gem initializer (?)
11
11
  * Add the route
12
12
 
13
13
  ## Usage
@@ -0,0 +1,7 @@
1
+ import "../styles/index.scss"
2
+ import { Application } from "stimulus"
3
+ import { definitionsFromContext } from "stimulus/webpack-helpers"
4
+
5
+ const application = Application.start()
6
+ const context = require.context("./controllers", true, /_controller\.js$/)
7
+ application.load(definitionsFromContext(context))
@@ -1,15 +1,15 @@
1
1
  require "yarii-cloudinary/engine"
2
2
 
3
3
  module YariiCloudinary
4
- ROOT_PATH = Pathname.new(File.join(__dir__, ".."))
4
+ # ROOT_PATH = Pathname.new(File.join(__dir__, ".."))
5
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
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
14
  end
15
15
 
@@ -1,12 +1,14 @@
1
+ require "cloudinary"
2
+
1
3
  module YariiCloudinary
2
4
  class Engine < ::Rails::Engine
3
5
  isolate_namespace YariiCloudinary
4
6
 
5
- ROOT_PATH = Pathname.new(File.join(__dir__, "..", ".."))
7
+ # ROOT_PATH = Pathname.new(File.join(__dir__, "..", ".."))
6
8
 
7
- config.app_middleware.use(
8
- Rack::Static,
9
- urls: ["/yarii-cloudinary-packs"], root: ROOT_PATH.join("public")
10
- )
9
+ # config.app_middleware.use(
10
+ # Rack::Static,
11
+ # urls: ["/yarii-cloudinary-packs"], root: ROOT_PATH.join("public")
12
+ # )
11
13
  end
12
14
  end
@@ -1,3 +1,3 @@
1
1
  module YariiCloudinary
2
- VERSION = '0.2.3'
2
+ VERSION = '0.2.5'
3
3
  end
@@ -1,15 +1,27 @@
1
1
  {
2
2
  "name": "yarii-cloudinary",
3
- "private": true,
3
+ "version": "0.2.5",
4
+ "main": "app/javascript/index.js",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/whitefusionhq/yarii-cloudinary"
8
+ },
9
+ "author": "Jared White <jared@whitefusion.io>",
10
+ "homepage": "https://whitefusion.io",
11
+ "license": "MIT",
12
+ "private": false,
4
13
  "dependencies": {
5
- "@rails/webpacker": "^4.0.7",
6
14
  "axios": "^0.18.0",
7
15
  "cloudinary-core": "^2.7.4",
8
16
  "html-loader": "^0.5.5",
9
17
  "stimulus": "^1.1.1"
10
18
  },
11
- "version": "0.1.0",
12
19
  "devDependencies": {
20
+ "@rails/webpacker": "^4.0.7",
13
21
  "webpack-dev-server": "^3.8.1"
14
- }
22
+ },
23
+ "files": [
24
+ "app/javascript",
25
+ "app/styles"
26
+ ]
15
27
  }
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.name = "yarii-cloudinary"
9
9
  spec.version = YariiCloudinary::VERSION
10
10
  spec.authors = ["Jared White"]
11
- spec.email = ["jared@jaredwhite.com"]
12
- spec.homepage = "https://whitefusion.io"
11
+ spec.email = ["jared@whitefusion.io"]
12
+ spec.homepage = "https://github.com/whitefusionhq/yarii-cloudinary"
13
13
  spec.summary = "Allows images to be loaded and viewed in Yarii via the Cloudinary service"
14
14
  spec.description = spec.summary
15
15
  spec.license = "MIT"
@@ -17,6 +17,5 @@ Gem::Specification.new do |spec|
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r!^(test|script|spec|features)/!) }
18
18
 
19
19
  spec.add_dependency "rails", "~> 6.0.0"
20
- spec.add_dependency "webpacker", "~> 4.0"
21
20
  spec.add_dependency "cloudinary", "~> 1.12"
22
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yarii-cloudinary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared White
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-21 00:00:00.000000000 Z
11
+ date: 2020-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 6.0.0
27
- - !ruby/object:Gem::Dependency
28
- name: webpacker
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '4.0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '4.0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: cloudinary
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -54,7 +40,7 @@ dependencies:
54
40
  version: '1.12'
55
41
  description: Allows images to be loaded and viewed in Yarii via the Cloudinary service
56
42
  email:
57
- - jared@jaredwhite.com
43
+ - jared@whitefusion.io
58
44
  executables: []
59
45
  extensions: []
60
46
  extra_rdoc_files: []
@@ -66,18 +52,13 @@ files:
66
52
  - Procfile.staging
67
53
  - README.md
68
54
  - Rakefile
69
- - app/assets/images/yarii_cloudinary/.keep
70
55
  - app/controllers/yarii_cloudinary/application_controller.rb
71
56
  - app/controllers/yarii_cloudinary/media_controller.rb
72
- - app/helpers/yarii_cloudinary/application_helper.rb
73
57
  - app/javascript/controllers/cloudinary_browse_media_controller.js
74
58
  - app/javascript/controllers/cloudinary_multiple_media_controller.js
75
59
  - app/javascript/controllers/cloudinary_single_media_controller.js
76
- - app/javascript/controllers/index.js
77
- - app/javascript/packs/application.js
78
- - app/jobs/yarii_cloudinary/application_job.rb
60
+ - app/javascript/index.js
79
61
  - app/styles/index.scss
80
- - app/views/yarii_cloudinary/application/yarii_cloudinary_head.erb
81
62
  - app/views/yarii_cloudinary/media/_browse_thumbnail.html.erb
82
63
  - app/views/yarii_cloudinary/media/_form_thumbnail.html.erb
83
64
  - app/views/yarii_cloudinary/media/_modal.html.erb
@@ -89,14 +70,7 @@ files:
89
70
  - bin/rails
90
71
  - bin/webpack
91
72
  - config/routes.rb
92
- - config/webpack/development.js
93
- - config/webpack/environment.js
94
- - config/webpack/production.js
95
- - config/webpack/staging.js
96
- - config/webpack/test.js
97
- - config/webpacker.yml
98
73
  - db/migrate/20190923000809_create_yarii_sites.rb
99
- - lib/tasks/yarii_cloudinary_tasks.rake
100
74
  - lib/yarii-cloudinary.rb
101
75
  - lib/yarii-cloudinary/engine.rb
102
76
  - lib/yarii-cloudinary/version.rb
@@ -104,7 +78,7 @@ files:
104
78
  - postcss.config.js
105
79
  - yarii-cloudinary.gemspec
106
80
  - yarn.lock
107
- homepage: https://whitefusion.io
81
+ homepage: https://github.com/whitefusionhq/yarii-cloudinary
108
82
  licenses:
109
83
  - MIT
110
84
  metadata: {}
File without changes
@@ -1,9 +0,0 @@
1
- module YariiCloudinary
2
- module ApplicationHelper
3
- include ::Webpacker::Helper
4
-
5
- def current_webpacker_instance
6
- YariiCloudinary.webpacker
7
- end
8
- end
9
- end
@@ -1,11 +0,0 @@
1
- // Load all the controllers within this directory and all subdirectories.
2
- // Controller files must be named *_controller.js.
3
-
4
- import { Application } from "stimulus"
5
- import { definitionsFromContext } from "stimulus/webpack-helpers"
6
-
7
- const application = Application.start()
8
- const context = require.context("controllers", true, /_controller\.js$/)
9
- application.load(definitionsFromContext(context))
10
-
11
- console.info("cloudinary II:!")
@@ -1,2 +0,0 @@
1
- import '../../styles/index.scss'
2
- import "controllers"
@@ -1,4 +0,0 @@
1
- module YariiCloudinary
2
- class ApplicationJob < ActiveJob::Base
3
- end
4
- end
@@ -1,2 +0,0 @@
1
- <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
2
- <%= stylesheet_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
@@ -1,5 +0,0 @@
1
- process.env.NODE_ENV = process.env.NODE_ENV || 'development'
2
-
3
- const environment = require('./environment')
4
-
5
- module.exports = environment.toWebpackConfig()
@@ -1,3 +0,0 @@
1
- const { environment } = require('@rails/webpacker')
2
-
3
- module.exports = environment
@@ -1,5 +0,0 @@
1
- process.env.NODE_ENV = process.env.NODE_ENV || 'production'
2
-
3
- const environment = require('./environment')
4
-
5
- module.exports = environment.toWebpackConfig()
@@ -1,5 +0,0 @@
1
- process.env.NODE_ENV = process.env.NODE_ENV || 'staging'
2
-
3
- const environment = require('./environment')
4
-
5
- module.exports = environment.toWebpackConfig()
@@ -1,5 +0,0 @@
1
- process.env.NODE_ENV = process.env.NODE_ENV || 'development'
2
-
3
- const environment = require('./environment')
4
-
5
- module.exports = environment.toWebpackConfig()
@@ -1,110 +0,0 @@
1
- # Note: You must restart bin/webpack-dev-server for changes to take effect
2
-
3
- default: &default
4
- source_path: app/javascript
5
- source_entry_path: packs
6
- public_root_path: public
7
- # use a different sub-folder name
8
- public_output_path: yarii-cloudinary-packs
9
-
10
- cache_path: tmp/cache/webpacker
11
- check_yarn_integrity: false
12
- webpack_compile_output: false
13
-
14
- # Additional paths webpack should lookup modules
15
- # ['app/assets', 'engine/foo/app/assets']
16
- resolved_paths: []
17
-
18
- # Reload manifest.json on all requests so we reload latest compiled packs
19
- cache_manifest: false
20
-
21
- # Extract and emit a css file
22
- extract_css: true
23
-
24
- static_assets_extensions:
25
- - .jpg
26
- - .jpeg
27
- - .png
28
- - .gif
29
- - .tiff
30
- - .ico
31
- - .svg
32
- - .eot
33
- - .otf
34
- - .ttf
35
- - .woff
36
- - .woff2
37
-
38
- extensions:
39
- - .mjs
40
- - .js
41
- - .sass
42
- - .scss
43
- - .css
44
- - .module.sass
45
- - .module.scss
46
- - .module.css
47
- - .png
48
- - .svg
49
- - .gif
50
- - .jpeg
51
- - .jpg
52
-
53
- development:
54
- <<: *default
55
- compile: true
56
-
57
- # Verifies that versions and hashed value of the package contents in the project's package.json
58
- check_yarn_integrity: true
59
-
60
- # Reference: https://webpack.js.org/configuration/dev-server/
61
- dev_server:
62
- https: false
63
- host: localhost
64
- port: 3035
65
- public: localhost:3035
66
- hmr: false
67
- # Inline should be set to true if using HMR
68
- inline: true
69
- overlay: true
70
- compress: true
71
- disable_host_check: true
72
- use_local_ip: false
73
- quiet: false
74
- headers:
75
- 'Access-Control-Allow-Origin': '*'
76
- watch_options:
77
- ignored: '**/node_modules/**'
78
-
79
-
80
- test:
81
- <<: *default
82
- compile: true
83
-
84
- # Compile test packs to a separate directory
85
- public_output_path: packs-test
86
-
87
- staging:
88
- <<: *default
89
-
90
- # Staging, like Production, depends on precompilation of packs prior to booting for performance.
91
- compile: false
92
-
93
- # Extract and emit a css file
94
- extract_css: true
95
-
96
- # Cache manifest.json for performance
97
- cache_manifest: true
98
-
99
-
100
- production:
101
- <<: *default
102
-
103
- # Production depends on precompilation of packs prior to booting for performance.
104
- compile: false
105
-
106
- # Extract and emit a css file
107
- extract_css: true
108
-
109
- # Cache manifest.json for performance
110
- cache_manifest: true
@@ -1,61 +0,0 @@
1
- def ensure_log_goes_to_stdout
2
- old_logger = Webpacker.logger
3
- Webpacker.logger = ActiveSupport::Logger.new(STDOUT)
4
- yield
5
- ensure
6
- Webpacker.logger = old_logger
7
- end
8
-
9
-
10
- namespace :yarii_cloudinary do
11
- namespace :webpacker do
12
- desc "Install deps with yarn"
13
- task :yarn_install do
14
- Dir.chdir(File.join(__dir__, "../..")) do
15
- system "yarn install --no-progress --production"
16
- end
17
- end
18
-
19
- desc "Compile JavaScript packs using webpack for production with digests"
20
- task compile: [:yarn_install, :environment] do
21
- Webpacker.with_node_env("production") do
22
- ensure_log_goes_to_stdout do
23
- if YariiCloudinary.webpacker.commands.compile
24
- # Successful compilation!
25
- puts "YariiCloudinary Plugin -- Webpacker success"
26
- else
27
- # Failed compilation
28
- puts "YariiCloudinary Plugin -- something's wrong with Webpacker!"
29
- exit!
30
- end
31
- end
32
- end
33
- end
34
- end
35
- end
36
-
37
- def yarn_install_available?
38
- rails_major = Rails::VERSION::MAJOR
39
- rails_minor = Rails::VERSION::MINOR
40
-
41
- rails_major > 5 || (rails_major == 5 && rails_minor >= 1)
42
- end
43
-
44
- def enhance_assets_precompile
45
- # yarn:install was added in Rails 5.1
46
- deps = yarn_install_available? ? [] : ["yarii_cloudinary:webpacker:yarn_install"]
47
- Rake::Task["assets:precompile"].enhance(deps) do
48
- Rake::Task["yarii_cloudinary:webpacker:compile"].invoke
49
- end
50
- end
51
-
52
- # Compile packs after we've compiled all other assets during precompilation
53
- skip_webpacker_precompile = %w(no false n f).include?(ENV["WEBPACKER_PRECOMPILE"])
54
-
55
- unless skip_webpacker_precompile
56
- if Rake::Task.task_defined?("assets:precompile")
57
- enhance_assets_precompile
58
- else
59
- Rake::Task.define_task("assets:precompile" => "yarii_cloudinary:webpacker:compile")
60
- end
61
- end