plug 0.1.28 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -0
- data/app/helpers/plug/application_helper.rb +10 -0
- data/app/views/layouts/plug/application.html.haml +0 -2
- data/app/views/plug/shared/_head.html.haml +1 -3
- data/lib/generators/plug/install_generator.rb +18 -0
- data/lib/generators/plug/templates/plug.vite.js +2 -0
- data/lib/plug/version.rb +1 -1
- metadata +9 -39
- data/app/assets/config/plug_manifest.js +0 -3
- data/app/assets/images/plug/favicon.png +0 -0
- data/app/assets/javascripts/plug/application.js +0 -18
- data/app/assets/javascripts/plug/trix-core.js +0 -12
- data/app/assets/stylesheets/plug/_settings.scss +0 -865
- data/app/assets/stylesheets/plug/application.scss +0 -43
- data/app/assets/stylesheets/plug/blocks/_alert.scss +0 -5
- data/app/assets/stylesheets/plug/blocks/_menu.scss +0 -11
- data/app/assets/stylesheets/plug/blocks/_nav.scss +0 -9
- data/app/assets/stylesheets/plug/blocks/_notice.scss +0 -4
- data/app/assets/stylesheets/plug/blocks/_state.scss +0 -11
- data/app/assets/stylesheets/plug/blocks/_task-button.scss +0 -3
- data/app/assets/stylesheets/plug/foundation_and_overrides.scss +0 -59
- data/app/assets/stylesheets/plug/milligram.scss +0 -635
- data/app/assets/stylesheets/plug/mixins/_bem.scss +0 -17
- data/app/assets/stylesheets/plug/normalize.scss +0 -447
- data/app/assets/stylesheets/plug/partials/_main.scss +0 -4
- data/app/assets/stylesheets/plug/partials/_utils.scss +0 -3
- data/app/assets/stylesheets/plug/trix-overrides.scss +0 -8
- data/app/assets/stylesheets/plug/trix.scss +0 -374
- data/app/assets/stylesheets/plug/variables/_colors.scss +0 -8
- data/app/assets/stylesheets/plug/variables/_typography.scss +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93d959b1cce72eb10a7dfb1708c75acca84dae5bf7ec85b91a8b97e02c094b5c
|
4
|
+
data.tar.gz: fa51e5f82f7c8113b370c83c33c8b5119948e744f42e302f341073dd0bba20fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efd393e765ebba44fee818a02850193b3c3630cd6a1aa08da5dc1d8dfda764db432e4c421742b5bcfafdfb6e0c2f84226c01b8a0799c1e87c7a81f8833330cce
|
7
|
+
data.tar.gz: dae650a9a2304a57777eb6b76f33ea86a38a83bc27e3ae16e55e70bec94ad9a98dc0c391de7188638e187a8b244537a7eaef26c396bf945fe706c89db329b801
|
data/README.md
CHANGED
@@ -129,6 +129,15 @@ Make sure to **bump** the version. Rubygems don't accept version overrides.
|
|
129
129
|
→ gem push plug-<version>.gem
|
130
130
|
```
|
131
131
|
|
132
|
+
### Publishing to `npmjs.com`
|
133
|
+
|
134
|
+
Make sure to match the version with the Rubygems version.
|
135
|
+
|
136
|
+
```bash
|
137
|
+
→ npm login
|
138
|
+
→ npm publish --access public
|
139
|
+
```
|
140
|
+
|
132
141
|
### TODOs
|
133
142
|
|
134
143
|
- Ability to disable all features using one button
|
@@ -2,5 +2,15 @@
|
|
2
2
|
|
3
3
|
module Plug
|
4
4
|
module ApplicationHelper
|
5
|
+
def asset_tags
|
6
|
+
asset_source = defined?(ViteRuby) ? :vite : :other
|
7
|
+
|
8
|
+
case asset_source
|
9
|
+
when :vite
|
10
|
+
vite_javascript_tag 'entrypoints/plug'
|
11
|
+
else
|
12
|
+
raise 'Plug does not support asset pipelines anymore. Use Vite.js instead.'
|
13
|
+
end
|
14
|
+
end
|
5
15
|
end
|
6
16
|
end
|
@@ -3,9 +3,7 @@
|
|
3
3
|
%meta{content: 'width=device-width, initial-scale=1.0', name: 'viewport'}/
|
4
4
|
%title Plug
|
5
5
|
|
6
|
-
= stylesheet_link_tag 'plug/application', media: 'all'
|
7
|
-
= javascript_include_tag 'plug/application'
|
8
|
-
= favicon_link_tag 'plug/favicon.png'
|
9
6
|
= csrf_meta_tags
|
7
|
+
= asset_tags
|
10
8
|
|
11
9
|
%script{ defer: '', src: 'https://use.fontawesome.com/releases/v5.13.0/js/all.js' }
|
@@ -11,5 +11,23 @@ module Plug
|
|
11
11
|
def mount_engine
|
12
12
|
inject_into_file('config/routes.rb', "\n mount Plug::Engine => '/plug', as: 'plug'\n\n", before: /^end/)
|
13
13
|
end
|
14
|
+
|
15
|
+
def setup_vite_assets
|
16
|
+
copy_file 'plug.vite.js', 'app/frontend/entrypoints/plug.js'
|
17
|
+
end
|
18
|
+
|
19
|
+
def add_plug_package
|
20
|
+
package_json_path = 'package.json'
|
21
|
+
|
22
|
+
if File.exist?(package_json_path)
|
23
|
+
package_json = JSON.parse(File.read(package_json_path))
|
24
|
+
package_json['dependencies'] ||= {}
|
25
|
+
package_json['dependencies']['@digitalnz/plug'] ||= "^#{Plug::VERSION}"
|
26
|
+
|
27
|
+
File.write(package_json_path, JSON.pretty_generate(package_json) + "\n")
|
28
|
+
else
|
29
|
+
say 'package.json not found. Please ensure you are running this generator in the root directory of your Rails project.', :red
|
30
|
+
end
|
31
|
+
end
|
14
32
|
end
|
15
33
|
end
|
data/lib/plug/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boost
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-07-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aasm
|
@@ -67,20 +67,6 @@ dependencies:
|
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '5.2'
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: sass-rails
|
72
|
-
requirement: !ruby/object:Gem::Requirement
|
73
|
-
requirements:
|
74
|
-
- - ">="
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '0'
|
77
|
-
type: :runtime
|
78
|
-
prerelease: false
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
80
|
-
requirements:
|
81
|
-
- - ">="
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version: '0'
|
84
70
|
- !ruby/object:Gem::Dependency
|
85
71
|
name: capybara
|
86
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -189,28 +175,6 @@ files:
|
|
189
175
|
- MIT-LICENSE
|
190
176
|
- README.md
|
191
177
|
- Rakefile
|
192
|
-
- app/assets/config/plug_manifest.js
|
193
|
-
- app/assets/images/plug/favicon.png
|
194
|
-
- app/assets/javascripts/plug/application.js
|
195
|
-
- app/assets/javascripts/plug/trix-core.js
|
196
|
-
- app/assets/stylesheets/plug/_settings.scss
|
197
|
-
- app/assets/stylesheets/plug/application.scss
|
198
|
-
- app/assets/stylesheets/plug/blocks/_alert.scss
|
199
|
-
- app/assets/stylesheets/plug/blocks/_menu.scss
|
200
|
-
- app/assets/stylesheets/plug/blocks/_nav.scss
|
201
|
-
- app/assets/stylesheets/plug/blocks/_notice.scss
|
202
|
-
- app/assets/stylesheets/plug/blocks/_state.scss
|
203
|
-
- app/assets/stylesheets/plug/blocks/_task-button.scss
|
204
|
-
- app/assets/stylesheets/plug/foundation_and_overrides.scss
|
205
|
-
- app/assets/stylesheets/plug/milligram.scss
|
206
|
-
- app/assets/stylesheets/plug/mixins/_bem.scss
|
207
|
-
- app/assets/stylesheets/plug/normalize.scss
|
208
|
-
- app/assets/stylesheets/plug/partials/_main.scss
|
209
|
-
- app/assets/stylesheets/plug/partials/_utils.scss
|
210
|
-
- app/assets/stylesheets/plug/trix-overrides.scss
|
211
|
-
- app/assets/stylesheets/plug/trix.scss
|
212
|
-
- app/assets/stylesheets/plug/variables/_colors.scss
|
213
|
-
- app/assets/stylesheets/plug/variables/_typography.scss
|
214
178
|
- app/controllers/plug/api/api_controller.rb
|
215
179
|
- app/controllers/plug/api/features_controller.rb
|
216
180
|
- app/controllers/plug/api/site_notices_controller.rb
|
@@ -245,6 +209,7 @@ files:
|
|
245
209
|
- db/migrate/20180424015828_add_theme_to_plug_site_notice.rb
|
246
210
|
- lib/generators/plug/install_generator.rb
|
247
211
|
- lib/generators/plug/templates/plug.rb
|
212
|
+
- lib/generators/plug/templates/plug.vite.js
|
248
213
|
- lib/plug.rb
|
249
214
|
- lib/plug/configuration.rb
|
250
215
|
- lib/plug/constraint.rb
|
@@ -255,7 +220,12 @@ homepage: https://github.com/digitalnz/plug
|
|
255
220
|
licenses:
|
256
221
|
- MIT
|
257
222
|
metadata: {}
|
258
|
-
post_install_message:
|
223
|
+
post_install_message: |
|
224
|
+
### Upgrading Plug from 0.1.x to 0.2.x ###
|
225
|
+
|
226
|
+
Due to introduction of Vite support, some additional dependencies and configuration will be needed.
|
227
|
+
Running `bin/rails g plug:install` will add extra js dependencies and configuration to your project.
|
228
|
+
`0.2.x`` doesn't support asset pipelines anymore. Use Vite.js instead.
|
259
229
|
rdoc_options: []
|
260
230
|
require_paths:
|
261
231
|
- lib
|
Binary file
|
@@ -1,18 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
-
//
|
10
|
-
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
-
// about supported directives.
|
12
|
-
//
|
13
|
-
//= require_tree .
|
14
|
-
|
15
|
-
// Prevent drag and drop from the editor
|
16
|
-
document.addEventListener('trix-file-accept', function(event) {
|
17
|
-
event.preventDefault();
|
18
|
-
});
|