@spryker/oryx-for-zed 2.12.0 → 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 +9 -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 +59 -64
- package/package.json +28 -26
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
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
|
+
|
|
3
12
|
### 2.12.0
|
|
4
13
|
Released on 31.05.2022
|
|
5
14
|
|
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,7 +45,7 @@ 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: {
|
|
@@ -59,25 +53,25 @@ async function getConfiguration(settings) {
|
|
|
59
53
|
ZedGuiEditorConfiguration: `${settings.paths.guiFolder}/assets/Zed/js/modules/editor`,
|
|
60
54
|
ZedGuiModules: `${settings.paths.guiFolder}/assets/Zed/js/modules`,
|
|
61
55
|
jQuery: 'jquery',
|
|
62
|
-
}
|
|
56
|
+
},
|
|
63
57
|
},
|
|
64
58
|
|
|
65
59
|
resolveLoader: {
|
|
66
60
|
modules: [
|
|
67
61
|
'node_modules/@spryker/oryx-for-zed/node_modules',
|
|
68
|
-
'node_modules'
|
|
69
|
-
]
|
|
62
|
+
'node_modules',
|
|
63
|
+
],
|
|
70
64
|
},
|
|
71
65
|
|
|
72
66
|
module: {
|
|
73
67
|
rules: [
|
|
74
68
|
{
|
|
75
69
|
test: /datatables\.net.*/,
|
|
76
|
-
use: 'imports-loader?define=>false'
|
|
70
|
+
use: 'imports-loader?define=>false',
|
|
77
71
|
},
|
|
78
72
|
{
|
|
79
73
|
test: /(jquery-migrate)/,
|
|
80
|
-
use: 'imports-loader?define=>false'
|
|
74
|
+
use: 'imports-loader?define=>false',
|
|
81
75
|
},
|
|
82
76
|
{
|
|
83
77
|
test: /\.m?js$/,
|
|
@@ -86,9 +80,9 @@ async function getConfiguration(settings) {
|
|
|
86
80
|
loader: 'babel-loader',
|
|
87
81
|
options: {
|
|
88
82
|
cacheDirectory: true,
|
|
89
|
-
presets: ['@babel/env']
|
|
90
|
-
}
|
|
91
|
-
}
|
|
83
|
+
presets: ['@babel/env'],
|
|
84
|
+
},
|
|
85
|
+
},
|
|
92
86
|
},
|
|
93
87
|
{
|
|
94
88
|
test: /\.s?css/i,
|
|
@@ -97,27 +91,27 @@ async function getConfiguration(settings) {
|
|
|
97
91
|
{
|
|
98
92
|
loader: 'css-loader',
|
|
99
93
|
options: {
|
|
100
|
-
importLoaders: 1
|
|
101
|
-
}
|
|
94
|
+
importLoaders: 1,
|
|
95
|
+
},
|
|
102
96
|
},
|
|
103
97
|
{
|
|
104
98
|
loader: 'postcss-loader',
|
|
105
99
|
options: {
|
|
106
100
|
ident: 'postcss',
|
|
107
|
-
plugins: postCssPlugins
|
|
108
|
-
}
|
|
101
|
+
plugins: postCssPlugins,
|
|
102
|
+
},
|
|
109
103
|
},
|
|
110
104
|
{
|
|
111
|
-
loader: 'resolve-url-loader'
|
|
105
|
+
loader: 'resolve-url-loader',
|
|
112
106
|
},
|
|
113
107
|
{
|
|
114
108
|
loader: 'sass-loader',
|
|
115
109
|
options: {
|
|
116
110
|
implementation: require('sass'),
|
|
117
|
-
sourceMap: true
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
]
|
|
111
|
+
sourceMap: true,
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
],
|
|
121
115
|
},
|
|
122
116
|
{
|
|
123
117
|
test: /\.(ttf|woff2?|eot|svg|otf)\??(\d*\w*=?\.?)+$/i,
|
|
@@ -125,9 +119,9 @@ async function getConfiguration(settings) {
|
|
|
125
119
|
loader: 'file-loader',
|
|
126
120
|
options: {
|
|
127
121
|
name: 'fonts/[name].[ext]',
|
|
128
|
-
publicPath: settings.paths.publicPath
|
|
129
|
-
}
|
|
130
|
-
}]
|
|
122
|
+
publicPath: settings.paths.publicPath,
|
|
123
|
+
},
|
|
124
|
+
}],
|
|
131
125
|
},
|
|
132
126
|
{
|
|
133
127
|
test: /\.(jpe?g|png|gif|svg)\??(\d*\w*=?\.?)+$/i,
|
|
@@ -135,34 +129,34 @@ async function getConfiguration(settings) {
|
|
|
135
129
|
loader: 'file-loader',
|
|
136
130
|
options: {
|
|
137
131
|
name: 'img/[name].[ext]',
|
|
138
|
-
publicPath: settings.paths.publicPath
|
|
139
|
-
}
|
|
140
|
-
}]
|
|
141
|
-
}
|
|
142
|
-
]
|
|
132
|
+
publicPath: settings.paths.publicPath,
|
|
133
|
+
},
|
|
134
|
+
}],
|
|
135
|
+
},
|
|
136
|
+
],
|
|
143
137
|
},
|
|
144
138
|
|
|
145
139
|
optimization: {
|
|
146
140
|
runtimeChunk: {
|
|
147
|
-
name:
|
|
141
|
+
name: settings.runtimeEntryName,
|
|
148
142
|
},
|
|
149
143
|
concatenateModules: false,
|
|
150
144
|
splitChunks: {
|
|
151
145
|
cacheGroups: {
|
|
152
146
|
default: false,
|
|
153
|
-
|
|
147
|
+
defaultVendors: false,
|
|
154
148
|
commons: {
|
|
155
|
-
name:
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
149
|
+
name: settings.runtimeEntryName,
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
},
|
|
159
153
|
},
|
|
160
154
|
|
|
161
155
|
plugins: [
|
|
162
156
|
new webpack.DefinePlugin({
|
|
163
157
|
DEV: !settings.options.isProduction,
|
|
164
158
|
WATCH: settings.options.isWatching,
|
|
165
|
-
'require.specified': 'require.resolve'
|
|
159
|
+
'require.specified': 'require.resolve',
|
|
166
160
|
}),
|
|
167
161
|
|
|
168
162
|
new webpack.ProvidePlugin({
|
|
@@ -173,13 +167,13 @@ async function getConfiguration(settings) {
|
|
|
173
167
|
// legacy provider
|
|
174
168
|
SprykerAjax: `${settings.paths.guiFolder}/assets/Zed/js/modules/legacy/SprykerAjax`,
|
|
175
169
|
SprykerAjaxCallbacks: `${settings.paths.guiFolder}/assets/Zed/js/modules/legacy/SprykerAjaxCallbacks`,
|
|
176
|
-
SprykerAlert: `${settings.paths.guiFolder}/assets/Zed/js/modules/legacy/SprykerAlert
|
|
170
|
+
SprykerAlert: `${settings.paths.guiFolder}/assets/Zed/js/modules/legacy/SprykerAlert`,
|
|
177
171
|
}),
|
|
178
172
|
|
|
179
173
|
new MiniCssExtractPlugin({
|
|
180
174
|
filename: `./css/[name].css`,
|
|
181
|
-
})
|
|
182
|
-
]
|
|
175
|
+
}),
|
|
176
|
+
],
|
|
183
177
|
};
|
|
184
178
|
|
|
185
179
|
if (settings.options.isProduction) {
|
|
@@ -188,27 +182,28 @@ async function getConfiguration(settings) {
|
|
|
188
182
|
|
|
189
183
|
minimizer: [
|
|
190
184
|
new TerserPlugin({
|
|
191
|
-
cache: true,
|
|
192
185
|
parallel: true,
|
|
193
|
-
sourceMap: false,
|
|
194
186
|
extractComments: false,
|
|
195
187
|
terserOptions: {
|
|
196
188
|
ecma: 5,
|
|
197
189
|
output: {
|
|
198
190
|
comments: false,
|
|
199
|
-
beautify: false
|
|
200
|
-
}
|
|
201
|
-
}
|
|
191
|
+
beautify: false,
|
|
192
|
+
},
|
|
193
|
+
},
|
|
202
194
|
}),
|
|
203
195
|
|
|
204
|
-
new
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
196
|
+
new CssMinimizerPlugin({
|
|
197
|
+
minimizerOptions: {
|
|
198
|
+
preset: [
|
|
199
|
+
'default',
|
|
200
|
+
{
|
|
201
|
+
discardComments: { removeAll: true },
|
|
202
|
+
},
|
|
203
|
+
],
|
|
204
|
+
},
|
|
205
|
+
}),
|
|
206
|
+
],
|
|
212
207
|
};
|
|
213
208
|
}
|
|
214
209
|
|
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.2.5",
|
|
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
|
}
|