rails_material_admin 0.1.6 → 0.1.7

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: 8e6b21ac40cbd665cf6df1db9b047652de73149c2dcc2aa7cd8465bb88778097
4
- data.tar.gz: '08bbc4c950271b43aca4b64390b120d0603921453c9b3aabed0ca2ec3670d87c'
3
+ metadata.gz: f4b3364f18972b77b40153b8aa0ebd70bc58cddb61756e57989a2bebde6d8a5a
4
+ data.tar.gz: 8da212e4b2f996bd258c687dce0e7bcde0cbe214222fdfc6fd7c33cddaa9048c
5
5
  SHA512:
6
- metadata.gz: 58eb9b295ee84128115417b476e9ea8e20f1dbae89c2786d151f4a81abc3def0629e6e10546719745421e75178605ac396bff27b1be988df7d1e4305ab480ef0
7
- data.tar.gz: 183329dd4f89b51e2b9446165c33229ff8c0a18840daeae881e818a71f3bd3dea353232aac7bc7476c0d8fee58c19e61f0651771ef45480e0668a223948eb1f5
6
+ metadata.gz: 8b8297f2577f2ffd71c83c072f1718ad7861d85b32b1efe24f081d096b24d43b6b9f30eebe552feb4b7d80d3e7045453f756f4173f75796d815d18f300d7992a
7
+ data.tar.gz: 80900e997b9f24df31e43c9c575cb6c7187b3c3202de4295ddf1a361d63dacd8679a1ab808094c38da7689bf8ac197fa7e0259d003c5ebde04f9808e42619471
data/README.md CHANGED
@@ -7,32 +7,6 @@ Easily install and set up admin quickly
7
7
 
8
8
  ## Prerequisite
9
9
  - Need set up your db first
10
- - Used js libraries
11
- ```json
12
- {
13
- "name": "MyProject",
14
- "private": true,
15
- "dependencies": {
16
- "@rails/webpacker": "5.1.1",
17
- "core-js": "3",
18
- "file-loader": "^6.0.0",
19
- "url-loader": "^4.1.0",
20
- "expose-loader": "^0.7.5",
21
- "resolve-url-loader": "^3.1.1",
22
- "jquery": "^3.5.1",
23
- "select2": "^4.0.13",
24
- "popper.js": "^1.16.1",
25
- "rails-ujs": "^5.2.4-2",
26
- "stimulus": "^1.1.1",
27
- "turbolinks": "^5.2.0",
28
- "datatables.net-bs4": "^1.10.21",
29
- "datatables.net-responsive-bs4": "^2.2.5"
30
- },
31
- "devDependencies": {
32
- "webpack-dev-server": "^3.11.0"
33
- }
34
- }
35
- ```
36
10
 
37
11
 
38
12
  ## Usage
@@ -10,7 +10,11 @@ environment.loaders.append('expose-loader', {
10
10
  test: require.resolve('jquery'),
11
11
  use: [{
12
12
  loader: 'expose-loader',
13
- options: '$'
13
+ options: {
14
+ exposes: {
15
+ globalName: '$',
16
+ }
17
+ }
14
18
  }]
15
19
  })
16
20
 
@@ -8,7 +8,8 @@ class MaterialAdminGenerator < Rails::Generators::NamedBase
8
8
  JS_PKGS =
9
9
  'datatables.net-bs4 datatables.net-responsive-bs4'\
10
10
  ' expose-loader file-loader url-loader resolve-url-loader'\
11
- ' rails-ujs stimulus turbolinks'\
11
+ ' @rails/ujs @rails/activestorage'\
12
+ ' stimulus turbolinks'\
12
13
  ' jquery popper.js select2'
13
14
 
14
15
  # TODO: Warning! Add reset project.
@@ -38,9 +39,9 @@ class MaterialAdminGenerator < Rails::Generators::NamedBase
38
39
 
39
40
  FileUtils.copy_entry("#{GEM_PATH}/vendor/#{GEM_NAME}", "#{webpacker_dir}/vendor/#{GEM_NAME}/")
40
41
 
41
- p 'Import package.json...'
42
+ # p 'Import package.json...'
42
43
 
43
- FileUtils.cp "#{GEM_PATH}/package.json", "#{Rails.root}/package.json"
44
+ # FileUtils.cp "#{GEM_PATH}/package.json", "#{Rails.root}/package.json"
44
45
 
45
46
  p 'Import js source files...'
46
47
 
@@ -59,6 +60,10 @@ class MaterialAdminGenerator < Rails::Generators::NamedBase
59
60
  )
60
61
  end
61
62
 
63
+ def yarn_install
64
+ system("yarn add #{JS_PKGS}")
65
+ end
66
+
62
67
  def create_helper
63
68
  p "Create #{layout_name} layout helper..."
64
69
 
@@ -129,10 +134,6 @@ class MaterialAdminGenerator < Rails::Generators::NamedBase
129
134
  FileUtils.copy_entry("#{GEM_PATH}/app/views/shared", dest)
130
135
  end
131
136
 
132
- def yarn_install
133
- system("yarn add #{JS_PKGS}")
134
- end
135
-
136
137
  def create_base_controller
137
138
  p "Create base controller'"
138
139
 
@@ -1,3 +1,3 @@
1
1
  module MaterialAdmin
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
3
3
  end
@@ -1,23 +1,23 @@
1
1
  import 'core-js/stable'
2
2
  import 'regenerator-runtime/runtime'
3
3
 
4
- import { Application } from "stimulus";
5
- import { definitionsFromContext } from "stimulus/webpack-helpers"
4
+ import { Application } from 'stimulus'
5
+ import { definitionsFromContext } from 'stimulus/webpack-helpers'
6
6
 
7
- import Rails from 'rails-ujs';
8
- import Turbolinks from 'turbolinks';
7
+ import Rails from '@rails/ujs'
8
+ import Turbolinks from 'turbolinks'
9
9
 
10
- import 'datatables.net';
11
- import 'datatables.net-responsive-bs4';
12
- import 'select2';
10
+ import 'datatables.net'
11
+ import 'datatables.net-responsive-bs4'
12
+ import 'select2'
13
13
 
14
- import '../vendor/material_admin/material_admin';
14
+ import '../vendor/rails_material_admin/material_admin'
15
15
 
16
- import '../src/javascripts/lib/utils_datatables.js';
17
- import '../src/javascripts/admin/common/scaffold.js';
16
+ import '../src/javascripts/lib/utils_datatables.js'
17
+ import '../src/javascripts/admin/common/scaffold.js'
18
18
 
19
- Rails.start();
20
- Turbolinks.start();
19
+ Rails.start()
20
+ Turbolinks.start()
21
21
 
22
22
  const application = Application.start()
23
23
  // const context = require.context("../src/javascripts/admin/controllers/", true, /\.js$/)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_material_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tracy Cai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-13 00:00:00.000000000 Z
11
+ date: 2021-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -53,7 +53,6 @@ files:
53
53
  - lib/material_admin/railtie.rb
54
54
  - lib/material_admin/version.rb
55
55
  - lib/tasks/material_admin_tasks.rake
56
- - package.json
57
56
  - vendor/javascript/packs/admin.js
58
57
  - vendor/javascript/packs/admin_style.js
59
58
  - vendor/javascript/src/javascripts/admin/common/common.js
@@ -1,23 +0,0 @@
1
- {
2
- "name": "beebeego-back",
3
- "private": true,
4
- "dependencies": {
5
- "@rails/webpacker": "5.1.1",
6
- "core-js": "3",
7
- "datatables.net-bs4": "^1.10.21",
8
- "datatables.net-responsive-bs4": "^2.2.5",
9
- "expose-loader": "^0.7.5",
10
- "file-loader": "^6.0.0",
11
- "jquery": "^3.5.1",
12
- "popper.js": "^1.16.1",
13
- "rails-ujs": "^5.2.4-2",
14
- "resolve-url-loader": "^3.1.1",
15
- "select2": "^4.0.13",
16
- "stimulus": "^1.1.1",
17
- "turbolinks": "^5.2.0",
18
- "url-loader": "^4.1.0"
19
- },
20
- "devDependencies": {
21
- "webpack-dev-server": "^3.11.0"
22
- }
23
- }