trestle 0.9.5 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/.travis.yml +12 -6
  4. data/CONTRIBUTING.md +38 -0
  5. data/Gemfile +9 -2
  6. data/README.md +5 -0
  7. data/app/assets/bundle/trestle/bundle.css +6 -6
  8. data/app/assets/bundle/trestle/bundle.js +40 -38
  9. data/app/assets/bundle/trestle/fa-brands-400.eot +0 -0
  10. data/app/assets/bundle/trestle/fa-brands-400.svg +41 -41
  11. data/app/assets/bundle/trestle/fa-brands-400.ttf +0 -0
  12. data/app/assets/bundle/trestle/fa-brands-400.woff +0 -0
  13. data/app/assets/bundle/trestle/fa-brands-400.woff2 +0 -0
  14. data/app/assets/bundle/trestle/fa-regular-400.eot +0 -0
  15. data/app/assets/bundle/trestle/fa-regular-400.svg +2 -2
  16. data/app/assets/bundle/trestle/fa-regular-400.ttf +0 -0
  17. data/app/assets/bundle/trestle/fa-regular-400.woff +0 -0
  18. data/app/assets/bundle/trestle/fa-regular-400.woff2 +0 -0
  19. data/app/assets/bundle/trestle/fa-solid-900.eot +0 -0
  20. data/app/assets/bundle/trestle/fa-solid-900.svg +13 -7
  21. data/app/assets/bundle/trestle/fa-solid-900.ttf +0 -0
  22. data/app/assets/bundle/trestle/fa-solid-900.woff +0 -0
  23. data/app/assets/bundle/trestle/fa-solid-900.woff2 +0 -0
  24. data/app/assets/bundle/trestle/flatpickr/ar-dz.js +1 -0
  25. data/app/assets/bundle/trestle/flatpickr/ar.js +1 -1
  26. data/app/assets/bundle/trestle/flatpickr/at.js +1 -1
  27. data/app/assets/bundle/trestle/flatpickr/az.js +1 -1
  28. data/app/assets/bundle/trestle/flatpickr/be.js +1 -1
  29. data/app/assets/bundle/trestle/flatpickr/bg.js +1 -1
  30. data/app/assets/bundle/trestle/flatpickr/bn.js +1 -1
  31. data/app/assets/bundle/trestle/flatpickr/bs.js +1 -1
  32. data/app/assets/bundle/trestle/flatpickr/cat.js +1 -1
  33. data/app/assets/bundle/trestle/flatpickr/ckb.js +1 -0
  34. data/app/assets/bundle/trestle/flatpickr/cs.js +1 -1
  35. data/app/assets/bundle/trestle/flatpickr/cy.js +1 -1
  36. data/app/assets/bundle/trestle/flatpickr/da.js +1 -1
  37. data/app/assets/bundle/trestle/flatpickr/de.js +1 -1
  38. data/app/assets/bundle/trestle/flatpickr/default.js +1 -1
  39. data/app/assets/bundle/trestle/flatpickr/eo.js +1 -1
  40. data/app/assets/bundle/trestle/flatpickr/es.js +1 -1
  41. data/app/assets/bundle/trestle/flatpickr/et.js +1 -1
  42. data/app/assets/bundle/trestle/flatpickr/fa.js +1 -1
  43. data/app/assets/bundle/trestle/flatpickr/fi.js +1 -1
  44. data/app/assets/bundle/trestle/flatpickr/fo.js +1 -1
  45. data/app/assets/bundle/trestle/flatpickr/fr.js +1 -1
  46. data/app/assets/bundle/trestle/flatpickr/ga.js +1 -1
  47. data/app/assets/bundle/trestle/flatpickr/gr.js +1 -1
  48. data/app/assets/bundle/trestle/flatpickr/he.js +1 -1
  49. data/app/assets/bundle/trestle/flatpickr/hi.js +1 -1
  50. data/app/assets/bundle/trestle/flatpickr/hr.js +1 -1
  51. data/app/assets/bundle/trestle/flatpickr/hu.js +1 -1
  52. data/app/assets/bundle/trestle/flatpickr/hy.js +1 -0
  53. data/app/assets/bundle/trestle/flatpickr/id.js +1 -1
  54. data/app/assets/bundle/trestle/flatpickr/is.js +1 -1
  55. data/app/assets/bundle/trestle/flatpickr/it.js +1 -1
  56. data/app/assets/bundle/trestle/flatpickr/ja.js +1 -1
  57. data/app/assets/bundle/trestle/flatpickr/ka.js +1 -1
  58. data/app/assets/bundle/trestle/flatpickr/km.js +1 -1
  59. data/app/assets/bundle/trestle/flatpickr/ko.js +1 -1
  60. data/app/assets/bundle/trestle/flatpickr/kz.js +1 -1
  61. data/app/assets/bundle/trestle/flatpickr/lt.js +1 -1
  62. data/app/assets/bundle/trestle/flatpickr/lv.js +1 -1
  63. data/app/assets/bundle/trestle/flatpickr/mk.js +1 -1
  64. data/app/assets/bundle/trestle/flatpickr/mn.js +1 -1
  65. data/app/assets/bundle/trestle/flatpickr/ms.js +1 -1
  66. data/app/assets/bundle/trestle/flatpickr/my.js +1 -1
  67. data/app/assets/bundle/trestle/flatpickr/nl.js +1 -1
  68. data/app/assets/bundle/trestle/flatpickr/nn.js +1 -0
  69. data/app/assets/bundle/trestle/flatpickr/no.js +1 -1
  70. data/app/assets/bundle/trestle/flatpickr/pa.js +1 -1
  71. data/app/assets/bundle/trestle/flatpickr/pl.js +1 -1
  72. data/app/assets/bundle/trestle/flatpickr/pt.js +1 -1
  73. data/app/assets/bundle/trestle/flatpickr/ro.js +1 -1
  74. data/app/assets/bundle/trestle/flatpickr/ru.js +1 -1
  75. data/app/assets/bundle/trestle/flatpickr/si.js +1 -1
  76. data/app/assets/bundle/trestle/flatpickr/sk.js +1 -1
  77. data/app/assets/bundle/trestle/flatpickr/sl.js +1 -1
  78. data/app/assets/bundle/trestle/flatpickr/sq.js +1 -1
  79. data/app/assets/bundle/trestle/flatpickr/sr-cyr.js +1 -1
  80. data/app/assets/bundle/trestle/flatpickr/sr.js +1 -1
  81. data/app/assets/bundle/trestle/flatpickr/sv.js +1 -1
  82. data/app/assets/bundle/trestle/flatpickr/th.js +1 -1
  83. data/app/assets/bundle/trestle/flatpickr/tr.js +1 -1
  84. data/app/assets/bundle/trestle/flatpickr/uk.js +1 -1
  85. data/app/assets/bundle/trestle/flatpickr/uz.js +1 -1
  86. data/app/assets/bundle/trestle/flatpickr/uz_latn.js +1 -1
  87. data/app/assets/bundle/trestle/flatpickr/vn.js +1 -1
  88. data/app/assets/bundle/trestle/flatpickr/zh-tw.js +1 -1
  89. data/app/assets/bundle/trestle/flatpickr/zh.js +1 -1
  90. data/app/assets/javascripts/trestle/i18n.js.erb +1 -1
  91. data/app/controllers/trestle/dashboard_controller.rb +2 -2
  92. data/app/helpers/trestle/avatar_helper.rb +6 -2
  93. data/app/helpers/trestle/container_helper.rb +12 -4
  94. data/app/helpers/trestle/params_helper.rb +4 -1
  95. data/app/helpers/trestle/url_helper.rb +1 -11
  96. data/app/views/trestle/flash/_alert.html.erb +3 -1
  97. data/app/views/trestle/flash/_debug.html.erb +13 -8
  98. data/app/views/trestle/flash/_flash.html.erb +1 -1
  99. data/config/routes.rb +1 -1
  100. data/frontend/css/components/_alerts.scss +31 -0
  101. data/frontend/css/components/_avatar.scss +14 -0
  102. data/frontend/css/components/_buttons.scss +0 -1
  103. data/frontend/css/components/_datepicker.scss +1 -0
  104. data/frontend/css/components/_modal.scss +2 -0
  105. data/frontend/css/components/_tags.scss +2 -0
  106. data/frontend/css/components/_timestamp.scss +1 -1
  107. data/frontend/css/layout/_sidebar.scss +3 -2
  108. data/frontend/css/variables/_bootstrap.scss +1 -0
  109. data/frontend/css/variables/_trestle.scss +20 -0
  110. data/frontend/js/components/dialog.js +8 -3
  111. data/frontend/theme/trestle/theme/_defaults.scss +4 -4
  112. data/lib/generators/trestle/install/templates/_theme.scss +1 -1
  113. data/lib/generators/trestle/install/templates/trestle.rb.erb +6 -1
  114. data/lib/trestle/adapters/active_record_adapter.rb +16 -0
  115. data/lib/trestle/form/automatic.rb +2 -0
  116. data/lib/trestle/form/field.rb +1 -1
  117. data/lib/trestle/form/renderer.rb +4 -1
  118. data/lib/trestle/registry.rb +61 -0
  119. data/lib/trestle/reloader.rb +1 -1
  120. data/lib/trestle/table/automatic.rb +7 -0
  121. data/lib/trestle/version.rb +1 -1
  122. data/lib/trestle.rb +29 -14
  123. data/package.json +20 -23
  124. data/webpack.config.js +36 -48
  125. data/yarn.lock +2947 -4595
  126. metadata +9 -3
data/webpack.config.js CHANGED
@@ -1,12 +1,12 @@
1
1
  const path = require('path');
2
2
 
3
- const Uglify = require('uglify-js');
4
- const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
5
- const MiniCssExtractPlugin = require('mini-css-extract-plugin');
6
- const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
7
3
  const CopyWebpackPlugin = require('copy-webpack-plugin');
4
+ const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
5
+ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
6
+ const TerserPlugin = require('terser-webpack-plugin');
8
7
 
9
8
  module.exports = {
9
+ mode: 'production',
10
10
  entry: path.resolve(__dirname, 'frontend/index.js'),
11
11
  output: {
12
12
  library: 'Trestle',
@@ -15,27 +15,11 @@ module.exports = {
15
15
  path: path.resolve(__dirname, 'app/assets/bundle/trestle')
16
16
  },
17
17
  optimization: {
18
- splitChunks: {
19
- cacheGroups: {
20
- styles: {
21
- name: 'styles',
22
- test: /\.css$/,
23
- chunks: 'all',
24
- enforce: true
25
- }
26
- }
27
- },
28
18
  minimizer: [
29
- new UglifyJsPlugin({
30
- cache: true,
31
- parallel: true,
32
- sourceMap: true
19
+ new TerserPlugin({
20
+ extractComments: false
33
21
  }),
34
- new OptimizeCSSAssetsPlugin({
35
- cssProcessorPluginOptions: {
36
- preset: ['default', { normalizePositions: false }]
37
- }
38
- })
22
+ new CssMinimizerPlugin()
39
23
  ]
40
24
  },
41
25
  module: {
@@ -49,26 +33,27 @@ module.exports = {
49
33
  },
50
34
  {
51
35
  test: /\.(ttf|eot|svg|woff2?)(\?[\s\S]+)?$/,
52
- use: {
53
- loader: 'file-loader',
54
- options: {
55
- name: '[name].[ext]'
56
- }
57
- }
36
+ type: 'asset/resource'
58
37
  },
59
38
  {
60
39
  test: /\.(png|jpg|gif)$/i,
61
- exclude: /node_modules/,
62
- use: {
63
- loader: 'url-loader'
64
- }
40
+ type: 'asset/inline'
65
41
  },
66
42
  {
67
43
  test: /\.s?[ac]ss$/,
68
44
  use: [
69
45
  { loader: MiniCssExtractPlugin.loader },
70
46
  { loader: 'css-loader' },
71
- { loader: 'postcss-loader', options: { plugins: [ require('autoprefixer') ] } },
47
+ {
48
+ loader: 'postcss-loader',
49
+ options: {
50
+ postcssOptions: {
51
+ plugins: [
52
+ ['autoprefixer', {}]
53
+ ]
54
+ }
55
+ }
56
+ },
72
57
  { loader: 'sass-loader' }
73
58
  ]
74
59
  },
@@ -76,26 +61,29 @@ module.exports = {
76
61
  test: require.resolve('jquery'),
77
62
  use: [{
78
63
  loader: 'expose-loader',
79
- options: 'jQuery'
80
- }, {
81
- loader: 'expose-loader',
82
- options: '$'
64
+ options: {
65
+ exposes: ['$', 'jQuery']
66
+ }
83
67
  }]
84
68
  }
85
69
  ]
86
70
  },
87
71
  plugins: [
88
- new CopyWebpackPlugin([
89
- { from: 'node_modules/@fortawesome/fontawesome-free/webfonts/*', to: '[name].[ext]' },
90
- {
91
- from: 'node_modules/flatpickr/dist/l10n/*.js',
92
- to: 'flatpickr/[name].[ext]',
93
- ignore: ['index.js'],
94
- transform: function(fileContent, path) {
95
- return Uglify.minify(fileContent.toString()).code.toString();
72
+ new CopyWebpackPlugin({
73
+ patterns: [
74
+ {
75
+ from: 'node_modules/@fortawesome/fontawesome-free/webfonts/*',
76
+ to: '[name][ext]'
77
+ },
78
+ {
79
+ from: 'node_modules/flatpickr/dist/l10n/*.js',
80
+ to: 'flatpickr/[name][ext]',
81
+ globOptions: {
82
+ ignore: ['**/index.js']
83
+ }
96
84
  }
97
- }
98
- ]),
85
+ ]
86
+ }),
99
87
  new MiniCssExtractPlugin({
100
88
  filename: 'bundle.css'
101
89
  })