@spryker/oryx-for-zed 2.11.5 → 2.13.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/CHANGELOG.md +19 -0
- package/README.md +2 -4
- package/build.js +2 -2
- package/lib/build.js +68 -0
- package/lib/configure-paths.js +31 -0
- package/lib/copy.js +6 -4
- package/lib/find.js +75 -0
- package/lib/index.js +8 -4
- package/lib/log.js +66 -0
- package/lib/settings.js +8 -7
- package/lib/webpack.config.js +61 -66
- package/package.json +28 -26
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
### 2.13.0
|
|
4
|
+
Released on 04.04.2023
|
|
5
|
+
|
|
6
|
+
- Removed `core-js`, `es6-promise`, `optimize-css-assets-webpack-plugin` dependencies.
|
|
7
|
+
- Removed deprecated `@spryker/oryx` dependency and moved it's functionality into the package.
|
|
8
|
+
- Introduced `dayjs`, `css-minimizer-webpack-plugin`, `fast-glob` dependencies.
|
|
9
|
+
- Updated dependencies.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### 2.12.0
|
|
13
|
+
Released on 31.05.2022
|
|
14
|
+
|
|
15
|
+
- Updated `@babel/core` dependency.
|
|
16
|
+
- Updated `@babel/preset-env` dependency.
|
|
17
|
+
- Updated `babel-loader` dependency.
|
|
18
|
+
- Updated `sass` dependency.
|
|
19
|
+
- Adjusted webpack config for jQuery scope.
|
|
20
|
+
|
|
21
|
+
|
|
3
22
|
### 2.11.4
|
|
4
23
|
Released on 7.04.2022
|
|
5
24
|
|
package/README.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# Oryx for Zed
|
|
2
2
|
|
|
3
|
-
Spryker ZED frontend automation tool
|
|
3
|
+
Spryker ZED frontend automation tool
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
> If you're looking for **Oryx**, [click here](https://github.com/spryker/oryx).
|
|
5
|
+
The tool [documentation](https://docs.spryker.com/docs/scos/dev/front-end-development/zed/oryx-for-zed.html).
|
package/build.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const build = require('./lib/build');
|
|
4
4
|
const api = require('./lib');
|
|
5
5
|
|
|
6
6
|
// deprecated copyAssetsCallback for backward compatibility only
|
|
7
7
|
const copyAssetsCallback = require('./lib/copy');
|
|
8
8
|
|
|
9
9
|
api.getConfiguration(api.settings)
|
|
10
|
-
.then(configuration =>
|
|
10
|
+
.then(configuration => build(configuration, copyAssetsCallback))
|
|
11
11
|
.catch(error => console.error('An error occurred while creating configuration', error));
|
package/lib/build.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const colors = require('colors/safe');
|
|
2
|
+
const dayjs = require('dayjs');
|
|
3
|
+
const log = require('./log');
|
|
4
|
+
|
|
5
|
+
function build(configuration, callback) {
|
|
6
|
+
log.task('build');
|
|
7
|
+
|
|
8
|
+
if (!build.webpack) {
|
|
9
|
+
build.loadCompiler();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
log.step('using webpack', build.webpackVersion);
|
|
13
|
+
|
|
14
|
+
if (configuration.watch) {
|
|
15
|
+
log.step('watchers enabled', colors.dim('(press [ctrl+c] to exit)'));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
log.step('building assets...');
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
build.webpack(configuration, (error, stats) => {
|
|
22
|
+
const output = !!stats && stats.toString(configuration.stats);
|
|
23
|
+
const duration = dayjs(stats.endTime - stats.startTime).format('s.SSS');
|
|
24
|
+
let message = `built in ${duration}s`;
|
|
25
|
+
let logFn = 'done';
|
|
26
|
+
|
|
27
|
+
if (error || stats.hasErrors()) {
|
|
28
|
+
message = 'build failed';
|
|
29
|
+
logFn = 'error';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (error) {
|
|
33
|
+
log.error(colors.red('webpack configuration:'), error.toString());
|
|
34
|
+
log.error(colors.red('details:'), error.details);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (output) {
|
|
38
|
+
log.step(`webpack output:\n ${output}`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (configuration.watch) {
|
|
42
|
+
const endTime = dayjs(stats.endTime).format('HH:mm:ss');
|
|
43
|
+
|
|
44
|
+
message = `${colors.dim(`[${endTime}]`)} ${message}...`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
log[logFn].apply(log, [message]);
|
|
48
|
+
|
|
49
|
+
if (callback) {
|
|
50
|
+
callback(error, stats);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
} catch (error) {
|
|
54
|
+
log.error(colors.red('webpack configuration:'), error.toString());
|
|
55
|
+
log.error('build aborted');
|
|
56
|
+
|
|
57
|
+
if (callback) {
|
|
58
|
+
callback(error);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
build.loadCompiler = function(webpack, webpackVersion) {
|
|
64
|
+
this.webpack = webpack || require('webpack');
|
|
65
|
+
this.webpackVersion = webpackVersion || require('webpack/package').version;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
module.exports = build;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
function configurePaths(entryPaths, runtimeEntryName) {
|
|
2
|
+
if (!runtimeEntryName) {
|
|
3
|
+
return entryPaths;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const runtimeEntryPaths = {};
|
|
7
|
+
const dependedEntryPaths = {};
|
|
8
|
+
|
|
9
|
+
Object.entries(entryPaths).forEach(([key, value]) => {
|
|
10
|
+
if (key === runtimeEntryName) {
|
|
11
|
+
runtimeEntryPaths[key] = {
|
|
12
|
+
runtime: false,
|
|
13
|
+
import: value,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
dependedEntryPaths[key] = {
|
|
20
|
+
dependOn: runtimeEntryName,
|
|
21
|
+
import: value,
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
...runtimeEntryPaths,
|
|
27
|
+
...dependedEntryPaths,
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
module.exports = configurePaths;
|
package/lib/copy.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
const fs = require('fs-extra');
|
|
2
2
|
const path = require('path');
|
|
3
|
-
const
|
|
3
|
+
const log = require('./log');
|
|
4
4
|
const settings = require('./settings');
|
|
5
5
|
|
|
6
6
|
const copyAssets = async () => {
|
|
7
7
|
const backCompatibilityPublicDir = path.resolve(path.join('public/Zed', settings.paths.publicPath));
|
|
8
8
|
|
|
9
9
|
try {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
log.task('Copy assets for backward compatibility after renaming assets folder');
|
|
11
|
+
log.step('copying assets...');
|
|
12
|
+
|
|
12
13
|
await fs.copy(settings.paths.publicDir, backCompatibilityPublicDir);
|
|
13
|
-
|
|
14
|
+
|
|
15
|
+
log.done('assets copied to: ', backCompatibilityPublicDir);
|
|
14
16
|
} catch (err) {
|
|
15
17
|
console.error(err)
|
|
16
18
|
}
|
package/lib/find.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const fastGlob = require('fast-glob');
|
|
3
|
+
const log = require('./log');
|
|
4
|
+
|
|
5
|
+
const cwd = process.cwd();
|
|
6
|
+
|
|
7
|
+
function parseSettings(settings) {
|
|
8
|
+
return Object.assign({}, {
|
|
9
|
+
glob: { onlyFiles: false },
|
|
10
|
+
}, settings);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async function fastGlobAsync(patterns, rootConfiguration) {
|
|
14
|
+
try {
|
|
15
|
+
return await fastGlob(patterns, rootConfiguration);
|
|
16
|
+
} catch(error) {
|
|
17
|
+
log.error('An error occurred while globbing the system for entry points.', error);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async function glob(configuration, dirs, patterns) {
|
|
22
|
+
return await dirs.reduce(async (resultsPromise, dir) => {
|
|
23
|
+
const relativeRoot = dir.replace(cwd, '.');
|
|
24
|
+
|
|
25
|
+
log.debug('searching in', `${relativeRoot}...`);
|
|
26
|
+
|
|
27
|
+
const rootConfiguration = { ...configuration, cwd: dir };
|
|
28
|
+
const results = await resultsPromise;
|
|
29
|
+
const fastGlobPath = await fastGlobAsync(patterns, rootConfiguration);
|
|
30
|
+
const fastGlobFullPath = fastGlobPath.map(result => path.join(dir, result));
|
|
31
|
+
|
|
32
|
+
return results.concat(fastGlobFullPath);
|
|
33
|
+
}, Promise.resolve([]));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function toObject(paths, defineName) {
|
|
37
|
+
return paths.reduce((object, currentPath) => {
|
|
38
|
+
const name = defineName ? defineName(currentPath) : path.basename(currentPath);
|
|
39
|
+
|
|
40
|
+
object[name] = currentPath;
|
|
41
|
+
|
|
42
|
+
return object;
|
|
43
|
+
}, {});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async function find(settings, initial = {}) {
|
|
47
|
+
const parsedSettings = parseSettings(settings);
|
|
48
|
+
|
|
49
|
+
log.debug('settings:', parsedSettings);
|
|
50
|
+
|
|
51
|
+
let results = await glob(parsedSettings.glob, parsedSettings.dirs, parsedSettings.patterns);
|
|
52
|
+
let count = 0;
|
|
53
|
+
|
|
54
|
+
log.task('find');
|
|
55
|
+
log.debug('initial:', initial);
|
|
56
|
+
|
|
57
|
+
if (parsedSettings.description) {
|
|
58
|
+
log.step(parsedSettings.description);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (Array.isArray(initial)) {
|
|
62
|
+
results = initial.concat(results);
|
|
63
|
+
count = results.length;
|
|
64
|
+
} else {
|
|
65
|
+
results = Object.assign({}, initial, toObject(results, parsedSettings.defineName));
|
|
66
|
+
count = Object.keys(results).length;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
log.debug('results:', results);
|
|
70
|
+
log.done(count, 'found');
|
|
71
|
+
|
|
72
|
+
return results;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
module.exports = find;
|
package/lib/index.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
const oryx = require('@spryker/oryx');
|
|
2
1
|
const webpack = require('webpack');
|
|
3
2
|
const webpackVersion = require('webpack/package').version;
|
|
3
|
+
const log = require('./log');
|
|
4
|
+
const build = require('./build');
|
|
5
|
+
const copyAssets = require('./copy');
|
|
4
6
|
const pkg = require('../package');
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
log.info(pkg.name, pkg.version);
|
|
9
|
+
build.loadCompiler(webpack, webpackVersion);
|
|
8
10
|
|
|
9
11
|
const settings = require('./settings');
|
|
10
12
|
const getConfiguration = require('./webpack.config');
|
|
11
13
|
|
|
12
14
|
module.exports = {
|
|
13
15
|
settings,
|
|
14
|
-
getConfiguration
|
|
16
|
+
getConfiguration,
|
|
17
|
+
build,
|
|
18
|
+
copyAssets,
|
|
15
19
|
};
|
package/lib/log.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const colors = require('colors/safe');
|
|
2
|
+
|
|
3
|
+
const prefix = {
|
|
4
|
+
info: '\u2648 ',
|
|
5
|
+
task: null,
|
|
6
|
+
step: colors.blue('\u25cf'),
|
|
7
|
+
done: colors.green('\u2714'),
|
|
8
|
+
error: colors.red('\u2718'),
|
|
9
|
+
debug: colors.dim('\u25cf [DEBUG]'),
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
function getArgs(color, prefixArg, ...args) {
|
|
13
|
+
args = args.map(arg => {
|
|
14
|
+
let output = arg;
|
|
15
|
+
|
|
16
|
+
if (typeof(arg) === 'object') {
|
|
17
|
+
output = `\n ${JSON.stringify(arg, ' ', 2)}`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (color) {
|
|
21
|
+
return colors[color].apply(null, [output]);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return output;
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
if (prefixArg) {
|
|
28
|
+
return [prefixArg].concat(args);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return args;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function info() {
|
|
35
|
+
console.info.apply(console, getArgs('magenta', prefix.info, ...arguments));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function task() {
|
|
39
|
+
console.log();
|
|
40
|
+
console.log.apply(console, getArgs('blue', prefix.task, ...arguments));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function step() {
|
|
44
|
+
console.log.apply(console, getArgs(null, prefix.step, ...arguments));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function debug() {
|
|
48
|
+
console.log.apply(console, getArgs('dim', prefix.debug, ...arguments));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function done() {
|
|
52
|
+
console.log.apply(console, getArgs(null, prefix.done, ...arguments));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function error() {
|
|
56
|
+
console.error.apply(console, getArgs(null, prefix.error, ...arguments));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
module.exports = {
|
|
60
|
+
info,
|
|
61
|
+
task,
|
|
62
|
+
step,
|
|
63
|
+
done,
|
|
64
|
+
error,
|
|
65
|
+
debug: !!process.env.DEBUG ? debug : function() {},
|
|
66
|
+
}
|
package/lib/settings.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
|
-
const oryx = require('@spryker/oryx');
|
|
4
3
|
const argv = require('yargs').argv;
|
|
4
|
+
const log = require('./log');
|
|
5
5
|
|
|
6
6
|
const isVerbose = !!argv.verbose;
|
|
7
|
-
|
|
8
7
|
const rootDir = process.cwd();
|
|
9
8
|
const sourcePath = './assets/Zed/';
|
|
10
9
|
const publicPath = '/assets/';
|
|
@@ -17,7 +16,7 @@ let bundlesPath = './vendor/spryker/';
|
|
|
17
16
|
let guiFolder = 'gui';
|
|
18
17
|
|
|
19
18
|
if (!fs.existsSync(path.resolve(bundlesPath, guiFolder))) {
|
|
20
|
-
|
|
19
|
+
log.step('spryker core: no-bundle-split layout detected');
|
|
21
20
|
|
|
22
21
|
bundlesPath = './vendor/spryker/spryker/Bundles/';
|
|
23
22
|
guiFolder = 'Gui';
|
|
@@ -30,7 +29,7 @@ const settings = {
|
|
|
30
29
|
options: {
|
|
31
30
|
isProduction: !!argv.prod,
|
|
32
31
|
isWatching: !!argv.dev,
|
|
33
|
-
isVerbose
|
|
32
|
+
isVerbose,
|
|
34
33
|
},
|
|
35
34
|
|
|
36
35
|
paths: {
|
|
@@ -47,18 +46,20 @@ const settings = {
|
|
|
47
46
|
sdkDir,
|
|
48
47
|
},
|
|
49
48
|
|
|
49
|
+
runtimeEntryName: 'spryker-zed-gui-commons',
|
|
50
|
+
|
|
50
51
|
entry: {
|
|
51
52
|
dirs: [bundlesDir, ecoDir, sdkDir],
|
|
52
53
|
patterns: ['**/Zed/**/*.entry.js'],
|
|
53
54
|
description: 'looking for entry points...',
|
|
54
|
-
defineName: p => path.basename(p, '.entry.js')
|
|
55
|
+
defineName: p => path.basename(p, '.entry.js'),
|
|
55
56
|
},
|
|
56
57
|
|
|
57
58
|
resolveModules: {
|
|
58
59
|
dirs: [bundlesDir],
|
|
59
60
|
patterns: ['**/Zed/node_modules'],
|
|
60
|
-
description: 'resolving core modules deps...'
|
|
61
|
-
}
|
|
61
|
+
description: 'resolving core modules deps...',
|
|
62
|
+
},
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
module.exports = settings;
|
package/lib/webpack.config.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const oryx = require('@spryker/oryx');
|
|
3
1
|
const webpack = require('webpack');
|
|
4
|
-
const autoprefixer = require('autoprefixer');
|
|
5
2
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
6
3
|
const TerserPlugin = require('terser-webpack-plugin');
|
|
7
|
-
const
|
|
4
|
+
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
|
5
|
+
const find = require('./find');
|
|
6
|
+
const configurePaths = require('./configure-paths');
|
|
8
7
|
|
|
9
8
|
async function getConfiguration(settings) {
|
|
10
9
|
let mode = 'development';
|
|
@@ -14,16 +13,11 @@ async function getConfiguration(settings) {
|
|
|
14
13
|
if (settings.options.isProduction) {
|
|
15
14
|
mode = 'production';
|
|
16
15
|
devtool = false;
|
|
17
|
-
|
|
18
|
-
postCssPlugins = [
|
|
19
|
-
autoprefixer({
|
|
20
|
-
browsers: ['last 4 versions']
|
|
21
|
-
})
|
|
22
|
-
];
|
|
16
|
+
postCssPlugins = [require('autoprefixer')];
|
|
23
17
|
}
|
|
24
18
|
|
|
25
|
-
const entryPromise =
|
|
26
|
-
const modulesPromise =
|
|
19
|
+
const entryPromise = find(settings.entry);
|
|
20
|
+
const modulesPromise = find(settings.resolveModules, []);
|
|
27
21
|
const [entryPaths, modulesPaths] = await Promise.all([entryPromise, modulesPromise]);
|
|
28
22
|
|
|
29
23
|
let config = {
|
|
@@ -35,14 +29,14 @@ async function getConfiguration(settings) {
|
|
|
35
29
|
watchOptions: {
|
|
36
30
|
aggregateTimeout: 300,
|
|
37
31
|
poll: 500,
|
|
38
|
-
ignored: /(node_modules)
|
|
32
|
+
ignored: /(node_modules)/,
|
|
39
33
|
},
|
|
40
34
|
|
|
41
|
-
entry: entryPaths,
|
|
35
|
+
entry: configurePaths(entryPaths, settings.runtimeEntryName),
|
|
42
36
|
|
|
43
37
|
output: {
|
|
44
38
|
path: settings.paths.publicDir,
|
|
45
|
-
filename: './js/[name].js'
|
|
39
|
+
filename: './js/[name].js',
|
|
46
40
|
},
|
|
47
41
|
|
|
48
42
|
resolve: {
|
|
@@ -51,32 +45,33 @@ async function getConfiguration(settings) {
|
|
|
51
45
|
'node_modules/@spryker/oryx-for-zed/node_modules',
|
|
52
46
|
'node_modules',
|
|
53
47
|
settings.paths.sourcePath,
|
|
54
|
-
settings.paths.bundlesPath
|
|
48
|
+
settings.paths.bundlesPath,
|
|
55
49
|
],
|
|
56
50
|
extensions: ['.js', '.css', '.scss'],
|
|
57
51
|
alias: {
|
|
58
52
|
ZedGui: `${settings.paths.guiFolder}/assets/Zed/js/modules/commons`,
|
|
59
53
|
ZedGuiEditorConfiguration: `${settings.paths.guiFolder}/assets/Zed/js/modules/editor`,
|
|
60
|
-
ZedGuiModules: `${settings.paths.guiFolder}/assets/Zed/js/modules
|
|
61
|
-
|
|
54
|
+
ZedGuiModules: `${settings.paths.guiFolder}/assets/Zed/js/modules`,
|
|
55
|
+
jQuery: 'jquery',
|
|
56
|
+
},
|
|
62
57
|
},
|
|
63
58
|
|
|
64
59
|
resolveLoader: {
|
|
65
60
|
modules: [
|
|
66
61
|
'node_modules/@spryker/oryx-for-zed/node_modules',
|
|
67
|
-
'node_modules'
|
|
68
|
-
]
|
|
62
|
+
'node_modules',
|
|
63
|
+
],
|
|
69
64
|
},
|
|
70
65
|
|
|
71
66
|
module: {
|
|
72
67
|
rules: [
|
|
73
68
|
{
|
|
74
69
|
test: /datatables\.net.*/,
|
|
75
|
-
use: 'imports-loader?define=>false'
|
|
70
|
+
use: 'imports-loader?define=>false',
|
|
76
71
|
},
|
|
77
72
|
{
|
|
78
73
|
test: /(jquery-migrate)/,
|
|
79
|
-
use: 'imports-loader?define=>false'
|
|
74
|
+
use: 'imports-loader?define=>false',
|
|
80
75
|
},
|
|
81
76
|
{
|
|
82
77
|
test: /\.m?js$/,
|
|
@@ -85,9 +80,9 @@ async function getConfiguration(settings) {
|
|
|
85
80
|
loader: 'babel-loader',
|
|
86
81
|
options: {
|
|
87
82
|
cacheDirectory: true,
|
|
88
|
-
presets: ['@babel/env']
|
|
89
|
-
}
|
|
90
|
-
}
|
|
83
|
+
presets: ['@babel/env'],
|
|
84
|
+
},
|
|
85
|
+
},
|
|
91
86
|
},
|
|
92
87
|
{
|
|
93
88
|
test: /\.s?css/i,
|
|
@@ -96,27 +91,27 @@ async function getConfiguration(settings) {
|
|
|
96
91
|
{
|
|
97
92
|
loader: 'css-loader',
|
|
98
93
|
options: {
|
|
99
|
-
importLoaders: 1
|
|
100
|
-
}
|
|
94
|
+
importLoaders: 1,
|
|
95
|
+
},
|
|
101
96
|
},
|
|
102
97
|
{
|
|
103
98
|
loader: 'postcss-loader',
|
|
104
99
|
options: {
|
|
105
100
|
ident: 'postcss',
|
|
106
|
-
plugins: postCssPlugins
|
|
107
|
-
}
|
|
101
|
+
plugins: postCssPlugins,
|
|
102
|
+
},
|
|
108
103
|
},
|
|
109
104
|
{
|
|
110
|
-
loader: 'resolve-url-loader'
|
|
105
|
+
loader: 'resolve-url-loader',
|
|
111
106
|
},
|
|
112
107
|
{
|
|
113
108
|
loader: 'sass-loader',
|
|
114
109
|
options: {
|
|
115
110
|
implementation: require('sass'),
|
|
116
|
-
sourceMap: true
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
]
|
|
111
|
+
sourceMap: true,
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
],
|
|
120
115
|
},
|
|
121
116
|
{
|
|
122
117
|
test: /\.(ttf|woff2?|eot|svg|otf)\??(\d*\w*=?\.?)+$/i,
|
|
@@ -124,9 +119,9 @@ async function getConfiguration(settings) {
|
|
|
124
119
|
loader: 'file-loader',
|
|
125
120
|
options: {
|
|
126
121
|
name: 'fonts/[name].[ext]',
|
|
127
|
-
publicPath: settings.paths.publicPath
|
|
128
|
-
}
|
|
129
|
-
}]
|
|
122
|
+
publicPath: settings.paths.publicPath,
|
|
123
|
+
},
|
|
124
|
+
}],
|
|
130
125
|
},
|
|
131
126
|
{
|
|
132
127
|
test: /\.(jpe?g|png|gif|svg)\??(\d*\w*=?\.?)+$/i,
|
|
@@ -134,34 +129,34 @@ async function getConfiguration(settings) {
|
|
|
134
129
|
loader: 'file-loader',
|
|
135
130
|
options: {
|
|
136
131
|
name: 'img/[name].[ext]',
|
|
137
|
-
publicPath: settings.paths.publicPath
|
|
138
|
-
}
|
|
139
|
-
}]
|
|
140
|
-
}
|
|
141
|
-
]
|
|
132
|
+
publicPath: settings.paths.publicPath,
|
|
133
|
+
},
|
|
134
|
+
}],
|
|
135
|
+
},
|
|
136
|
+
],
|
|
142
137
|
},
|
|
143
138
|
|
|
144
139
|
optimization: {
|
|
145
140
|
runtimeChunk: {
|
|
146
|
-
name:
|
|
141
|
+
name: settings.runtimeEntryName,
|
|
147
142
|
},
|
|
148
143
|
concatenateModules: false,
|
|
149
144
|
splitChunks: {
|
|
150
145
|
cacheGroups: {
|
|
151
146
|
default: false,
|
|
152
|
-
|
|
147
|
+
defaultVendors: false,
|
|
153
148
|
commons: {
|
|
154
|
-
name:
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
149
|
+
name: settings.runtimeEntryName,
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
},
|
|
158
153
|
},
|
|
159
154
|
|
|
160
155
|
plugins: [
|
|
161
156
|
new webpack.DefinePlugin({
|
|
162
157
|
DEV: !settings.options.isProduction,
|
|
163
158
|
WATCH: settings.options.isWatching,
|
|
164
|
-
'require.specified': 'require.resolve'
|
|
159
|
+
'require.specified': 'require.resolve',
|
|
165
160
|
}),
|
|
166
161
|
|
|
167
162
|
new webpack.ProvidePlugin({
|
|
@@ -172,13 +167,13 @@ async function getConfiguration(settings) {
|
|
|
172
167
|
// legacy provider
|
|
173
168
|
SprykerAjax: `${settings.paths.guiFolder}/assets/Zed/js/modules/legacy/SprykerAjax`,
|
|
174
169
|
SprykerAjaxCallbacks: `${settings.paths.guiFolder}/assets/Zed/js/modules/legacy/SprykerAjaxCallbacks`,
|
|
175
|
-
SprykerAlert: `${settings.paths.guiFolder}/assets/Zed/js/modules/legacy/SprykerAlert
|
|
170
|
+
SprykerAlert: `${settings.paths.guiFolder}/assets/Zed/js/modules/legacy/SprykerAlert`,
|
|
176
171
|
}),
|
|
177
172
|
|
|
178
173
|
new MiniCssExtractPlugin({
|
|
179
174
|
filename: `./css/[name].css`,
|
|
180
|
-
})
|
|
181
|
-
]
|
|
175
|
+
}),
|
|
176
|
+
],
|
|
182
177
|
};
|
|
183
178
|
|
|
184
179
|
if (settings.options.isProduction) {
|
|
@@ -187,32 +182,32 @@ async function getConfiguration(settings) {
|
|
|
187
182
|
|
|
188
183
|
minimizer: [
|
|
189
184
|
new TerserPlugin({
|
|
190
|
-
cache: true,
|
|
191
185
|
parallel: true,
|
|
192
|
-
sourceMap: false,
|
|
193
186
|
extractComments: false,
|
|
194
187
|
terserOptions: {
|
|
195
188
|
ecma: 5,
|
|
196
189
|
output: {
|
|
197
190
|
comments: false,
|
|
198
|
-
beautify: false
|
|
199
|
-
}
|
|
200
|
-
}
|
|
191
|
+
beautify: false,
|
|
192
|
+
},
|
|
193
|
+
},
|
|
201
194
|
}),
|
|
202
195
|
|
|
203
|
-
new
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
196
|
+
new CssMinimizerPlugin({
|
|
197
|
+
minimizerOptions: {
|
|
198
|
+
preset: [
|
|
199
|
+
'default',
|
|
200
|
+
{
|
|
201
|
+
discardComments: { removeAll: true },
|
|
202
|
+
},
|
|
203
|
+
],
|
|
204
|
+
},
|
|
205
|
+
}),
|
|
206
|
+
],
|
|
211
207
|
};
|
|
212
208
|
}
|
|
213
209
|
|
|
214
210
|
return config;
|
|
215
211
|
}
|
|
216
212
|
|
|
217
|
-
|
|
218
213
|
module.exports = getConfiguration;
|
package/package.json
CHANGED
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spryker/oryx-for-zed",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Spryker ZED frontend automation tool
|
|
3
|
+
"version": "2.13.0",
|
|
4
|
+
"description": "Spryker ZED frontend automation tool",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git@github.com:spryker/oryx-for-zed.git"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
5
10
|
"author": {
|
|
6
11
|
"name": "Spryker Sytems GmbH",
|
|
7
12
|
"email": "info@spryker.com",
|
|
8
13
|
"url": "http://spryker.com"
|
|
9
14
|
},
|
|
10
|
-
"repository": {
|
|
11
|
-
"url": "git@github.com:spryker/oryx-for-zed.git",
|
|
12
|
-
"type": "git"
|
|
13
|
-
},
|
|
14
|
-
"license": "MIT",
|
|
15
15
|
"main": "index.js",
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": ">=
|
|
18
|
-
"npm": ">=
|
|
17
|
+
"node": ">=16.0.0",
|
|
18
|
+
"npm": ">=8.0.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"autoprefixer": "~8.3.0",
|
|
25
|
-
"babel-loader": "~8.1.0",
|
|
26
|
-
"core-js": "~2.5.5",
|
|
21
|
+
"autoprefixer": "~9.8.8",
|
|
22
|
+
"babel-loader": "~8.3.0",
|
|
23
|
+
"colors": "~1.4.0",
|
|
27
24
|
"css-loader": "~2.1.1",
|
|
28
|
-
"
|
|
25
|
+
"css-minimizer-webpack-plugin": "~4.2.2",
|
|
26
|
+
"dayjs": "~1.11.7",
|
|
27
|
+
"fast-glob": "~3.2.12",
|
|
29
28
|
"file-loader": "~1.1.11",
|
|
30
|
-
"fs-extra": "~10.
|
|
29
|
+
"fs-extra": "~10.1.0",
|
|
31
30
|
"imports-loader": "~0.8.0",
|
|
32
|
-
"mini-css-extract-plugin": "~
|
|
33
|
-
"
|
|
34
|
-
"postcss-loader": "~2.1.4",
|
|
31
|
+
"mini-css-extract-plugin": "~2.7.2",
|
|
32
|
+
"postcss-loader": "~2.1.6",
|
|
35
33
|
"resolve-url-loader": "~5.0.0",
|
|
36
|
-
"sass": "~1.
|
|
37
|
-
"sass-loader": "~10.
|
|
38
|
-
"style-loader": "~0.
|
|
39
|
-
"terser-webpack-plugin": "~
|
|
40
|
-
"webpack": "~
|
|
41
|
-
"yargs": "~13.3.
|
|
34
|
+
"sass": "~1.60.0",
|
|
35
|
+
"sass-loader": "~10.4.1",
|
|
36
|
+
"style-loader": "~0.23.1",
|
|
37
|
+
"terser-webpack-plugin": "~5.3.6",
|
|
38
|
+
"webpack": "~5.74.0",
|
|
39
|
+
"yargs": "~13.3.2"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@babel/core": "~7.21.3",
|
|
43
|
+
"@babel/preset-env": "~7.20.2"
|
|
42
44
|
}
|
|
43
45
|
}
|