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