@mediafly/js-ui 49.0.3 → 50.0.0
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.
- package/.certs/ca.crt +32 -0
- package/.certs/localhost.crt +32 -0
- package/.certs/localhost.key +27 -0
- package/.certs/localhost.pfx +0 -0
- package/.node-version +1 -0
- package/CHANGELOG.md +7 -3
- package/Dockerfile +42 -0
- package/Jenkinsfile +67 -52
- package/cypress.config.ts +26 -0
- package/lib/dropdown/dropdown.d.ts +1 -1
- package/lib/font-selector/font-selector.d.ts +1 -1
- package/lib/fonts.css +24 -0
- package/lib/rich-text/rich-text.component.js +11 -10
- package/lib/rich-text/rich-text.component.js.map +1 -1
- package/lib/styles.css +6 -10
- package/lib/tsconfig.deploy.tsbuildinfo +1062 -878
- package/package.json +30 -33
- package/src/components/date-time-zone-picker/datepicker.ts +1 -1
- package/src/components/dropdown/dropdown.ts +1 -1
- package/src/components/font-selector/font-selector.ts +1 -1
- package/src/components/rich-text/rich-text.component.ts +18 -16
- package/src/index.js +1 -3
- package/tsconfig.json +0 -1
- package/tsconfig.tsbuildinfo +1028 -574
- package/webpack.config.js +184 -167
- package/cypress.json +0 -10
package/webpack.config.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const fs = require('fs')
|
|
2
|
-
const isCI = require('is-ci')
|
|
3
2
|
const path = require('path')
|
|
3
|
+
|
|
4
4
|
const webpack = require('webpack')
|
|
5
|
+
const { ProgressPlugin, ProvidePlugin } = webpack
|
|
5
6
|
|
|
6
|
-
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
|
|
7
7
|
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
|
8
|
-
const
|
|
8
|
+
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')
|
|
9
9
|
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin')
|
|
10
10
|
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
|
11
11
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
|
@@ -15,71 +15,44 @@ const WebpackConcatPlugin = require('webpack-concat-files-plugin')
|
|
|
15
15
|
const WriteFilePlugin = require('write-file-webpack-plugin')
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
module.exports = (
|
|
19
|
-
|
|
20
|
-
const isProd = (process.env.NODE_ENV === 'production')
|
|
18
|
+
module.exports = function (env) {
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
{ from: 'src/fonts', to: 'fonts' },
|
|
27
|
-
{ from: 'src/img', to: 'img' },
|
|
28
|
-
],
|
|
29
|
-
}),
|
|
30
|
-
new webpack.EnvironmentPlugin(options),
|
|
31
|
-
new FixStyleOnlyEntriesPlugin({ silent: true, ignore: 'webpack-dev-server' }),
|
|
32
|
-
new ForkTsCheckerWebpackPlugin({
|
|
33
|
-
async: false,
|
|
34
|
-
}),
|
|
35
|
-
new HtmlWebpackPlugin({
|
|
36
|
-
excludeChunks: ['components', 'standalone'],
|
|
37
|
-
template: 'src/index.html',
|
|
38
|
-
...process.env
|
|
39
|
-
}),
|
|
40
|
-
new MiniCssExtractPlugin({
|
|
41
|
-
filename: '[name].css',
|
|
42
|
-
chunkFilename: '[id].css',
|
|
43
|
-
}),
|
|
44
|
-
// This plugin is used to generated the consumable css-module file by simply concat'ing the component modules.
|
|
45
|
-
// We don't process them because the consumers will do so when importing styles from this file.
|
|
46
|
-
new WebpackConcatPlugin({
|
|
47
|
-
bundles: [{
|
|
48
|
-
src: './src/components/less/**/*.module.css',
|
|
49
|
-
dest: './dist/jsui.module.css',
|
|
50
|
-
}],
|
|
51
|
-
}),
|
|
52
|
-
new webpack.ProvidePlugin({
|
|
53
|
-
'window.jQuery': 'jquery',
|
|
54
|
-
}),
|
|
55
|
-
new StylelintWebpackPlugin({
|
|
56
|
-
files: [
|
|
57
|
-
'src/**/*.css',
|
|
58
|
-
'src/**/*.less',
|
|
59
|
-
],
|
|
60
|
-
}),
|
|
61
|
-
new WriteFilePlugin(),
|
|
62
|
-
]
|
|
63
|
-
|
|
64
|
-
if (!isCI) {
|
|
65
|
-
plugins.push(new webpack.ProgressPlugin({
|
|
66
|
-
activeModules: false,
|
|
67
|
-
}))
|
|
68
|
-
}
|
|
20
|
+
// Get access to the "real" environment variable so we can tell if we're in CI.
|
|
21
|
+
// Expose this on Webpack's `env` for consistency in case we want to use it in code.
|
|
22
|
+
// (Webpack doesn't expose real env vars on its environment object here)
|
|
23
|
+
env.CI = !!process.env.CI
|
|
69
24
|
|
|
70
25
|
return {
|
|
71
26
|
devServer: {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
27
|
+
allowedHosts: [
|
|
28
|
+
'imediafly.com',
|
|
29
|
+
'mediafly.com',
|
|
30
|
+
],
|
|
31
|
+
client: {
|
|
32
|
+
overlay: {
|
|
33
|
+
warnings: false,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
devMiddleware: {
|
|
37
|
+
publicPath: '/',
|
|
38
|
+
},
|
|
39
|
+
headers: {
|
|
40
|
+
'Access-Control-Allow-Origin': '*',
|
|
41
|
+
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
|
|
42
|
+
'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization',
|
|
43
|
+
},
|
|
44
|
+
host: env.unitTests ? 'localhost' : 'local.imediafly.com',
|
|
45
|
+
hot: false,
|
|
46
|
+
server: {
|
|
47
|
+
type: 'https',
|
|
48
|
+
options: env.WEBPACK_SERVE && {
|
|
49
|
+
cert: fs.readFileSync(path.join(__dirname, '.certs/localhost.crt')),
|
|
50
|
+
key: fs.readFileSync(path.join(__dirname, '.certs/localhost.key')),
|
|
51
|
+
},
|
|
78
52
|
},
|
|
79
53
|
port: 8187,
|
|
80
|
-
stats: 'minimal',
|
|
81
54
|
},
|
|
82
|
-
devtool:
|
|
55
|
+
devtool: env.CI ? false : 'eval-cheap-module-source-map',
|
|
83
56
|
entry: {
|
|
84
57
|
bundle: './src/index.js',
|
|
85
58
|
components: './src/components/index.ts',
|
|
@@ -87,121 +60,165 @@ module.exports = (options = {}) => {
|
|
|
87
60
|
styles: './src/index.less',
|
|
88
61
|
standalone: './src/components/less/standalone.less',
|
|
89
62
|
},
|
|
90
|
-
mode:
|
|
63
|
+
mode: 'development',
|
|
91
64
|
module: {
|
|
92
|
-
rules: [
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
return `jsui-${component}__${localName}`
|
|
65
|
+
rules: [
|
|
66
|
+
{
|
|
67
|
+
test: /\.html$/,
|
|
68
|
+
type: 'asset/source',
|
|
69
|
+
exclude: [
|
|
70
|
+
path.resolve(process.cwd(), 'src/index.html'),
|
|
71
|
+
],
|
|
72
|
+
}, {
|
|
73
|
+
test: /\.ts$/,
|
|
74
|
+
enforce: 'pre', // preload the tslint loader
|
|
75
|
+
exclude: /node_modules/,
|
|
76
|
+
loader: 'tslint-loader',
|
|
77
|
+
options: {
|
|
78
|
+
emitErrors: env.CI,
|
|
79
|
+
},
|
|
80
|
+
}, {
|
|
81
|
+
test: /\.less|\.css$/,
|
|
82
|
+
enforce: 'pre',
|
|
83
|
+
loader: 'import-glob-loader',
|
|
84
|
+
}, {
|
|
85
|
+
test: /\.less|\.css$/,
|
|
86
|
+
use: [
|
|
87
|
+
MiniCssExtractPlugin.loader,
|
|
88
|
+
{
|
|
89
|
+
loader: 'css-loader',
|
|
90
|
+
options: {
|
|
91
|
+
modules: {
|
|
92
|
+
auto: true,
|
|
93
|
+
getLocalIdent: (context, localIdentName, localName, options) => { // generate our own classnames, avoiding "-module" in the generated name
|
|
94
|
+
const filename = context.resourcePath.replace(context.context, '')
|
|
95
|
+
const component = filename.slice(1, filename.indexOf('.')) // remove leading slash and extension
|
|
96
|
+
return `jsui-${component}__${localName}`
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
url: {
|
|
100
|
+
filter: (url) => !url.startsWith('/'), // don't try to process absolute paths (e.g, fonts)
|
|
129
101
|
},
|
|
130
102
|
},
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
path.resolve(process.cwd(), 'src')
|
|
152
|
-
],
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
loader: 'postcss-loader',
|
|
106
|
+
options: {
|
|
107
|
+
postcssOptions: {
|
|
108
|
+
plugins: () => [
|
|
109
|
+
require('postcss-modules-values'),
|
|
110
|
+
require('postcss-nested'),
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
loader: 'less-loader',
|
|
117
|
+
options: {
|
|
118
|
+
lessOptions: {
|
|
119
|
+
paths: [
|
|
120
|
+
path.resolve(process.cwd(), 'src')
|
|
121
|
+
],
|
|
122
|
+
},
|
|
153
123
|
},
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
}, {
|
|
127
|
+
test: /\.js$/,
|
|
128
|
+
include: /(src)/,
|
|
129
|
+
use: [
|
|
130
|
+
{
|
|
131
|
+
loader: 'babel-loader',
|
|
132
|
+
options: {
|
|
133
|
+
presets: [require('babel-preset-env')],
|
|
134
|
+
plugins: [require('babel-plugin-angularjs-annotate')]
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
}, {
|
|
139
|
+
test: /\.(ts)$/,
|
|
140
|
+
include: /(src)/,
|
|
141
|
+
use: [
|
|
142
|
+
{
|
|
143
|
+
loader: 'babel-loader',
|
|
144
|
+
options: {
|
|
145
|
+
plugins: [require('babel-plugin-angularjs-annotate')]
|
|
146
|
+
}
|
|
147
|
+
}, {
|
|
148
|
+
loader: 'ts-loader',
|
|
149
|
+
options: {
|
|
150
|
+
context: path.resolve(process.cwd()),
|
|
151
|
+
configFile: 'tsconfig.json',
|
|
152
|
+
onlyCompileBundledFiles: true,
|
|
153
|
+
// transpileOnly: true
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
}, {
|
|
158
|
+
test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
|
|
159
|
+
loader: 'file-loader',
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
},
|
|
163
|
+
optimization: {
|
|
164
|
+
minimizer: [
|
|
165
|
+
`...`, // TerserWebpackPlugin: https://webpack.js.org/plugins/terser-webpack-plugin/
|
|
166
|
+
new CssMinimizerPlugin({}),
|
|
167
|
+
],
|
|
168
|
+
splitChunks: {
|
|
169
|
+
chunks: 'all',
|
|
170
|
+
},
|
|
193
171
|
},
|
|
194
172
|
output: {
|
|
173
|
+
clean: true,
|
|
195
174
|
path: path.resolve(process.cwd(), 'dist'),
|
|
196
|
-
|
|
197
|
-
filename: '[name].js'
|
|
175
|
+
filename: '[name].js',
|
|
198
176
|
},
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
177
|
+
plugins: [
|
|
178
|
+
new CopyWebpackPlugin({
|
|
179
|
+
patterns: [
|
|
180
|
+
{ from: 'src/fonts', to: 'fonts' },
|
|
181
|
+
{ from: 'src/img', to: 'img' },
|
|
182
|
+
],
|
|
183
|
+
}),
|
|
184
|
+
// new webpack.EnvironmentPlugin(options),
|
|
185
|
+
// new FixStyleOnlyEntriesPlugin({ silent: true, ignore: 'webpack-dev-server' }),
|
|
186
|
+
new ForkTsCheckerWebpackPlugin({
|
|
187
|
+
async: false,
|
|
188
|
+
}),
|
|
189
|
+
new HtmlWebpackPlugin({
|
|
190
|
+
excludeChunks: ['components', 'standalone'],
|
|
191
|
+
template: 'src/index.html',
|
|
192
|
+
...process.env,
|
|
193
|
+
}),
|
|
194
|
+
new MiniCssExtractPlugin({
|
|
195
|
+
filename: '[name].css',
|
|
196
|
+
chunkFilename: '[id].css',
|
|
197
|
+
}),
|
|
198
|
+
// This plugin is used to generated the consumable css-module file by simply concat'ing the component modules.
|
|
199
|
+
// We don't process them because the consumers will do so when importing styles from this file.
|
|
200
|
+
new WebpackConcatPlugin({
|
|
201
|
+
bundles: [{
|
|
202
|
+
src: './src/components/less/**/*.module.css',
|
|
203
|
+
dest: './dist/jsui.module.css',
|
|
204
|
+
}],
|
|
205
|
+
}),
|
|
206
|
+
new ProvidePlugin({
|
|
207
|
+
'window.jQuery': 'jquery',
|
|
208
|
+
}),
|
|
209
|
+
new StylelintWebpackPlugin({
|
|
210
|
+
files: [
|
|
211
|
+
'src/**/*.css',
|
|
212
|
+
'src/**/*.less',
|
|
213
|
+
],
|
|
214
|
+
}),
|
|
215
|
+
new WriteFilePlugin(),
|
|
216
|
+
...(!env.CI)
|
|
217
|
+
? [new ProgressPlugin({ profile: false })]
|
|
218
|
+
: []
|
|
219
|
+
],
|
|
203
220
|
resolve: {
|
|
204
|
-
extensions: ['.js', '.ts', '
|
|
221
|
+
extensions: ['.js', '.ts', '*'],
|
|
205
222
|
plugins: [
|
|
206
223
|
new TsConfigPathsPlugin(),
|
|
207
224
|
],
|
package/cypress.json
DELETED