trestle 0.9.5 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.travis.yml +12 -6
- data/CONTRIBUTING.md +38 -0
- data/Gemfile +9 -2
- data/README.md +5 -0
- data/app/assets/bundle/trestle/bundle.css +6 -6
- data/app/assets/bundle/trestle/bundle.js +40 -38
- data/app/assets/bundle/trestle/fa-brands-400.eot +0 -0
- data/app/assets/bundle/trestle/fa-brands-400.svg +41 -41
- data/app/assets/bundle/trestle/fa-brands-400.ttf +0 -0
- data/app/assets/bundle/trestle/fa-brands-400.woff +0 -0
- data/app/assets/bundle/trestle/fa-brands-400.woff2 +0 -0
- data/app/assets/bundle/trestle/fa-regular-400.eot +0 -0
- data/app/assets/bundle/trestle/fa-regular-400.svg +2 -2
- data/app/assets/bundle/trestle/fa-regular-400.ttf +0 -0
- data/app/assets/bundle/trestle/fa-regular-400.woff +0 -0
- data/app/assets/bundle/trestle/fa-regular-400.woff2 +0 -0
- data/app/assets/bundle/trestle/fa-solid-900.eot +0 -0
- data/app/assets/bundle/trestle/fa-solid-900.svg +13 -7
- data/app/assets/bundle/trestle/fa-solid-900.ttf +0 -0
- data/app/assets/bundle/trestle/fa-solid-900.woff +0 -0
- data/app/assets/bundle/trestle/fa-solid-900.woff2 +0 -0
- data/app/assets/bundle/trestle/flatpickr/ar-dz.js +1 -0
- data/app/assets/bundle/trestle/flatpickr/ar.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/at.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/az.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/be.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/bg.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/bn.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/bs.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/cat.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/ckb.js +1 -0
- data/app/assets/bundle/trestle/flatpickr/cs.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/cy.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/da.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/de.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/default.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/eo.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/es.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/et.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/fa.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/fi.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/fo.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/fr.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/ga.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/gr.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/he.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/hi.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/hr.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/hu.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/hy.js +1 -0
- data/app/assets/bundle/trestle/flatpickr/id.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/is.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/it.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/ja.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/ka.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/km.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/ko.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/kz.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/lt.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/lv.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/mk.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/mn.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/ms.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/my.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/nl.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/nn.js +1 -0
- data/app/assets/bundle/trestle/flatpickr/no.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/pa.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/pl.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/pt.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/ro.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/ru.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/si.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/sk.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/sl.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/sq.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/sr-cyr.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/sr.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/sv.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/th.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/tr.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/uk.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/uz.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/uz_latn.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/vn.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/zh-tw.js +1 -1
- data/app/assets/bundle/trestle/flatpickr/zh.js +1 -1
- data/app/assets/javascripts/trestle/i18n.js.erb +1 -1
- data/app/controllers/trestle/dashboard_controller.rb +2 -2
- data/app/helpers/trestle/avatar_helper.rb +6 -2
- data/app/helpers/trestle/container_helper.rb +12 -4
- data/app/helpers/trestle/params_helper.rb +4 -1
- data/app/helpers/trestle/url_helper.rb +1 -11
- data/app/views/trestle/flash/_alert.html.erb +3 -1
- data/app/views/trestle/flash/_debug.html.erb +13 -8
- data/app/views/trestle/flash/_flash.html.erb +1 -1
- data/config/routes.rb +1 -1
- data/frontend/css/components/_alerts.scss +31 -0
- data/frontend/css/components/_avatar.scss +14 -0
- data/frontend/css/components/_buttons.scss +0 -1
- data/frontend/css/components/_datepicker.scss +1 -0
- data/frontend/css/components/_modal.scss +2 -0
- data/frontend/css/components/_tags.scss +2 -0
- data/frontend/css/components/_timestamp.scss +1 -1
- data/frontend/css/layout/_sidebar.scss +3 -2
- data/frontend/css/variables/_bootstrap.scss +1 -0
- data/frontend/css/variables/_trestle.scss +20 -0
- data/frontend/js/components/dialog.js +8 -3
- data/frontend/theme/trestle/theme/_defaults.scss +4 -4
- data/lib/generators/trestle/install/templates/_theme.scss +1 -1
- data/lib/generators/trestle/install/templates/trestle.rb.erb +6 -1
- data/lib/trestle/adapters/active_record_adapter.rb +16 -0
- data/lib/trestle/form/automatic.rb +2 -0
- data/lib/trestle/form/field.rb +1 -1
- data/lib/trestle/form/renderer.rb +4 -1
- data/lib/trestle/registry.rb +61 -0
- data/lib/trestle/reloader.rb +1 -1
- data/lib/trestle/table/automatic.rb +7 -0
- data/lib/trestle/version.rb +1 -1
- data/lib/trestle.rb +29 -14
- data/package.json +20 -23
- data/webpack.config.js +36 -48
- data/yarn.lock +2947 -4595
- 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
|
30
|
-
|
31
|
-
parallel: true,
|
32
|
-
sourceMap: true
|
19
|
+
new TerserPlugin({
|
20
|
+
extractComments: false
|
33
21
|
}),
|
34
|
-
new
|
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
|
-
|
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
|
-
|
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
|
-
{
|
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:
|
80
|
-
|
81
|
-
|
82
|
-
options: '$'
|
64
|
+
options: {
|
65
|
+
exposes: ['$', 'jQuery']
|
66
|
+
}
|
83
67
|
}]
|
84
68
|
}
|
85
69
|
]
|
86
70
|
},
|
87
71
|
plugins: [
|
88
|
-
new CopyWebpackPlugin(
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
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
|
})
|