arui-scripts 23.9.0 → 23.9.2

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.
@@ -1,25 +1,28 @@
1
1
  ts-jest[versions] (WARN) Version 6.0.2 of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=4.3.0 <6.0.0-0). Please do not report issues in ts-jest if you are using unsupported versions.
2
2
  ts-jest[versions] (WARN) Version 6.0.2 of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=4.3.0 <6.0.0-0). Please do not report issues in ts-jest if you are using unsupported versions.
3
3
  ts-jest[versions] (WARN) Version 6.0.2 of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=4.3.0 <6.0.0-0). Please do not report issues in ts-jest if you are using unsupported versions.
4
- PASS src/plugins/postcss-global-variables/utils/__tests__/add-global-variable.tests.ts (17.834 s)
4
+ PASS src/plugins/postcss-global-variables/utils/__tests__/add-global-variable.tests.ts (18.254 s)
5
5
  PASS src/bin/__tests__/create-cli.tests.ts
6
6
  PASS src/configs/app-configs/__tests__/update-with-presets.tests.ts
7
7
  PASS src/configs/util/__tests__/create-watch-ignore-regex.tests.ts
8
8
  PASS src/configs/util/__tests__/apply-overrides.tests.ts
9
9
  PASS src/commands/util/__tests__/artifacts-deprecations.tests.ts
10
+ PASS src/plugins/__tests__/attribute-module-css.tests.ts (28.778 s)
10
11
  PASS src/configs/app-configs/__tests__/update-with-env.tests.ts
11
- PASS src/plugins/__tests__/attribute-module-css.tests.ts (36.576 s)
12
+ PASS src/configs/__tests__/webpack-client-modules.tests.ts (8.298 s)
12
13
  PASS src/configs/app-configs/__tests__/update-with-package.tests.ts
13
- PASS src/configs/util/__tests__/compress-with-dcb.test.ts
14
+ PASS src/configs/__tests__/rspack-client-assets.tests.ts (18.268 s)
14
15
  PASS src/configs/util/__tests__/get-polyfills.tests.ts
16
+ PASS src/configs/util/__tests__/find-plugin.tests.ts (38.766 s)
15
17
  PASS src/plugins/postcss-global-variables/utils/__tests__/parse-variables.tests.ts
18
+ PASS src/configs/util/__tests__/compress-with-dcb.test.ts
16
19
  PASS src/plugins/postcss-global-variables/utils/__tests__/get-media-query-name.tests.ts
17
20
  PASS src/configs/app-configs/__tests__/validate-settings-keys.tests.ts
18
- PASS src/configs/__tests__/webpack-client-modules.tests.ts (19.679 s)
19
- PASS src/configs/util/__tests__/find-plugin.tests.ts (40.022 s)
21
+ PASS src/commands/util/__tests__/client-assets-sizes.tests.ts
22
+ A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --detectOpenHandles to find leaks. Active timers can also cause this, ensure that .unref() was called on them.
20
23
 
21
- Test Suites: 16 passed, 16 total
22
- Tests: 46 passed, 46 total
24
+ Test Suites: 18 passed, 18 total
25
+ Tests: 49 passed, 49 total
23
26
  Snapshots: 0 total
24
- Time: 40.869 s
27
+ Time: 40.88 s
25
28
  Ran all test suites.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # arui-scripts
2
2
 
3
+ ## 23.9.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#602](https://github.com/core-ds/arui-scripts/pull/602) [`0c7063af`](https://github.com/core-ds/arui-scripts/commit/0c7063af3b3c735a562962a4d56884399511f430) Thanks [@dmitrbrvsk](https://github.com/dmitrbrvsk)! - Минификация картинок не работала: правило стояло после общего svg правила в `oneOf` и использовало несуществующий тип модуля `assets`. Правило перенесено вперед, поправлен тип, у svgo отключен `removeViewBox`
8
+
9
+ - [#602](https://github.com/core-ds/arui-scripts/pull/602) [`d67562cb`](https://github.com/core-ds/arui-scripts/commit/d67562cb95db673cee84bf1b7e0df3a85a4ec503) Thanks [@dmitrbrvsk](https://github.com/dmitrbrvsk)! - для словарей сжатия не добавляется `CopyRspackPlugin`, если список словарей пуст
10
+
11
+ ## 23.9.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#600](https://github.com/core-ds/arui-scripts/pull/600) [`c42d4163`](https://github.com/core-ds/arui-scripts/commit/c42d4163b69b4da28a2e4def467082b6ee59e663) Thanks [@dmitrbrvsk](https://github.com/dmitrbrvsk)! - В выводе размеров ассетов после сборки gzip размер брался из brotli файла, теперь показывается настоящий gzip-размер
16
+
17
+ - [#600](https://github.com/core-ds/arui-scripts/pull/600) [`12c1b1d3`](https://github.com/core-ds/arui-scripts/commit/12c1b1d3855539287a6ba560aa54a6d2d435eab1) Thanks [@dmitrbrvsk](https://github.com/dmitrbrvsk)! - dev server слушает свободный порт, который нашел `get-port`, а не всегда порт из конфига и адрес печатается только после успешного старта
18
+
3
19
  ## 23.9.0
4
20
 
5
21
  ### Minor Changes
@@ -54,7 +54,7 @@ function printAssetsSizes(webpackStats) {
54
54
  Object.keys(assetsMap).forEach((assetName) => {
55
55
  const asset = assetsMap[assetName];
56
56
  const size = asset.size || 0;
57
- const gzipSize = asset.brSize || size;
57
+ const gzipSize = asset.gzipSize || size;
58
58
  const brSize = asset.brSize || gzipSize;
59
59
  const dcbSize = asset.dcbSize || brSize;
60
60
  totalSizes.size += size;
@@ -18,7 +18,6 @@ const print_compiler_output_1 = require("../start/print-compiler-output");
18
18
  function runClientDevServer(configuration) {
19
19
  return __awaiter(this, void 0, void 0, function* () {
20
20
  const clientCompiler = (0, core_1.rspack)(configuration);
21
- const clientDevServer = new dev_server_1.RspackDevServer(dev_server_2.devServerConfig, clientCompiler);
22
21
  clientCompiler.hooks.invalid.tap('client', () => console.log('Compiling client...'));
23
22
  clientCompiler.hooks.done.tap('client', (stats) => (0, print_compiler_output_1.printCompilerOutput)('Client', stats));
24
23
  const DEFAULT_PORT = dev_server_2.devServerConfig.port;
@@ -33,9 +32,10 @@ function runClientDevServer(configuration) {
33
32
  // We have not found a port.
34
33
  return;
35
34
  }
36
- clientDevServer.startCallback(() => {
37
- console.log(`Client dev server running at http://${HOST}:${port}...`);
38
- });
35
+ // dev-server слушает порт из конфига как есть, поэтому подменяем его найденным свободным
36
+ const clientDevServer = new dev_server_1.RspackDevServer(Object.assign(Object.assign({}, dev_server_2.devServerConfig), { port }), clientCompiler);
37
+ yield clientDevServer.start();
38
+ console.log(`Client dev server running at http://${HOST}:${port}...`);
39
39
  }
40
40
  catch (err) {
41
41
  if (util_1.types.isNativeError(err)) {
@@ -2,6 +2,11 @@ import ImageMinimizerPlugin from 'image-minimizer-webpack-plugin';
2
2
  export declare function getImageMinLoader(): false | {
3
3
  test: RegExp;
4
4
  type: string;
5
+ parser: {
6
+ dataUrlCondition: {
7
+ maxSize: number | undefined;
8
+ };
9
+ };
5
10
  use: {
6
11
  loader: string;
7
12
  options: {
@@ -17,6 +22,15 @@ export declare function getImageMinLoader(): false | {
17
22
  colorTypeReduction: boolean | undefined;
18
23
  paletteReduction: boolean | undefined;
19
24
  interlaced: boolean | undefined;
25
+ })[] | (string | {
26
+ plugins: {
27
+ name: string;
28
+ params: {
29
+ overrides: {
30
+ removeViewBox: boolean;
31
+ };
32
+ };
33
+ }[];
20
34
  })[] | (string | {
21
35
  optimizationLevel: number | undefined;
22
36
  interlaced: boolean;
@@ -21,7 +21,13 @@ function getImageMinLoader() {
21
21
  ].filter(Boolean);
22
22
  return {
23
23
  test: new RegExp(`\\.(${loaderExtensions.join('|')})$`),
24
- type: 'assets',
24
+ type: 'asset',
25
+ // правило стоит раньше общих asset правил, поэтому порог инлайна должен быть тем же
26
+ parser: {
27
+ dataUrlCondition: {
28
+ maxSize: app_configs_1.configs.dataUrlMaxSize,
29
+ },
30
+ },
25
31
  use: [
26
32
  {
27
33
  loader: image_minimizer_webpack_plugin_1.default.loader,
@@ -47,7 +53,20 @@ function getImageMinLoader() {
47
53
  interlaced: png === null || png === void 0 ? void 0 : png.interlaced,
48
54
  },
49
55
  ],
50
- (svg === null || svg === void 0 ? void 0 : svg.enabled) && ['svgo'],
56
+ (svg === null || svg === void 0 ? void 0 : svg.enabled) && [
57
+ 'svgo',
58
+ {
59
+ plugins: [
60
+ {
61
+ name: 'preset-default',
62
+ params: {
63
+ // preset-default в svgo вырезает viewBox, без него svg перестают масштабироваться
64
+ overrides: { removeViewBox: false },
65
+ },
66
+ },
67
+ ],
68
+ },
69
+ ],
51
70
  (gif === null || gif === void 0 ? void 0 : gif.enabled) && [
52
71
  'gifsicle',
53
72
  {
@@ -249,6 +249,8 @@ const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.ass
249
249
  },
250
250
  ],
251
251
  },
252
+ // В oneOf срабатывает первое подходящее правило, поэтому минификация картинок должна стоять раньше svg правила
253
+ mode === 'prod' && (0, minimizers_1.getImageMinLoader)(),
252
254
  {
253
255
  test: /\.svg/,
254
256
  type: 'asset',
@@ -258,7 +260,6 @@ const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.ass
258
260
  },
259
261
  },
260
262
  },
261
- mode === 'prod' && (0, minimizers_1.getImageMinLoader)(),
262
263
  {
263
264
  exclude: [/\.(js|jsx|mjs|cjs|ts|tsx)$/, /\.(html|ejs)$/, /\.json$/],
264
265
  type: 'asset',
@@ -328,7 +329,7 @@ const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.ass
328
329
  filename: '../index.html',
329
330
  }),
330
331
  mode === 'dev' && app_configs_1.configs.clientOnly && new client_env_config_1.ClientConfigPlugin(),
331
- app_configs_1.configs.compressionPredefinedDictionaryPath &&
332
+ app_configs_1.configs.compressionPredefinedDictionaryPath.length > 0 &&
332
333
  new core_1.CopyRspackPlugin({
333
334
  patterns: app_configs_1.configs.compressionPredefinedDictionaryPath,
334
335
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arui-scripts",
3
- "version": "23.9.0",
3
+ "version": "23.9.2",
4
4
  "main": "./build/index.js",
5
5
  "typings": "./build/index.d.ts",
6
6
  "exports": {