arui-scripts 23.9.1 → 23.9.3

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,26 +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 (14.607 s)
4
+ PASS src/commands/util/__tests__/run-compilers.tests.ts (19.192 s)
5
+ PASS src/plugins/postcss-global-variables/utils/__tests__/add-global-variable.tests.ts
5
6
  PASS src/bin/__tests__/create-cli.tests.ts
6
7
  PASS src/configs/app-configs/__tests__/update-with-presets.tests.ts
7
8
  PASS src/configs/util/__tests__/create-watch-ignore-regex.tests.ts
8
9
  PASS src/configs/util/__tests__/apply-overrides.tests.ts
9
10
  PASS src/commands/util/__tests__/artifacts-deprecations.tests.ts
11
+ PASS src/plugins/__tests__/attribute-module-css.tests.ts (38.033 s)
10
12
  PASS src/configs/app-configs/__tests__/update-with-env.tests.ts
11
- PASS src/plugins/__tests__/attribute-module-css.tests.ts (26.948 s)
13
+ PASS src/configs/util/__tests__/find-plugin.tests.ts (40.904 s)
14
+ PASS src/configs/__tests__/rspack-client-assets.tests.ts (18.834 s)
12
15
  PASS src/configs/app-configs/__tests__/update-with-package.tests.ts
13
- PASS src/configs/util/__tests__/compress-with-dcb.test.ts
14
16
  PASS src/configs/util/__tests__/get-polyfills.tests.ts
17
+ PASS src/configs/__tests__/webpack-client-modules.tests.ts
15
18
  PASS src/plugins/postcss-global-variables/utils/__tests__/parse-variables.tests.ts
16
- PASS src/commands/util/__tests__/client-assets-sizes.tests.ts
17
- PASS src/plugins/postcss-global-variables/utils/__tests__/get-media-query-name.tests.ts
19
+ PASS src/configs/util/__tests__/compress-with-dcb.test.ts
18
20
  PASS src/configs/app-configs/__tests__/validate-settings-keys.tests.ts
19
- PASS src/configs/util/__tests__/find-plugin.tests.ts (30.649 s)
20
- PASS src/configs/__tests__/webpack-client-modules.tests.ts (15.5 s)
21
+ PASS src/plugins/postcss-global-variables/utils/__tests__/get-media-query-name.tests.ts
22
+ PASS src/commands/util/__tests__/client-assets-sizes.tests.ts
21
23
 
22
- Test Suites: 17 passed, 17 total
23
- Tests: 47 passed, 47 total
24
+ Test Suites: 19 passed, 19 total
25
+ Tests: 54 passed, 54 total
24
26
  Snapshots: 0 total
25
- Time: 33.027 s
27
+ Time: 42.588 s
26
28
  Ran all test suites.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # arui-scripts
2
2
 
3
+ ## 23.9.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#605](https://github.com/core-ds/arui-scripts/pull/605) [`94ce42aa`](https://github.com/core-ds/arui-scripts/commit/94ce42aa67e8fa3e8c4f1f883c5aac179de9413e) Thanks [@dmitrbrvsk](https://github.com/dmitrbrvsk)! - Сборка больше не завершается успешно, если компилятор упал. Раньше при падении по сигналу (например, из-за нехватки памяти) `arui-scripts build` выходил с кодом 0 и CI/CD считал такую сборку успешной, хотя ассеты собраны не полностью.
8
+
9
+ ## 23.9.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#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`
14
+
15
+ - [#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`, если список словарей пуст
16
+
3
17
  ## 23.9.1
4
18
 
5
19
  ### Patch Changes
@@ -12,26 +12,27 @@ function runCompilers(pathToCompilers) {
12
12
  fs_extra_1.default.removeSync(app_configs_1.configs.serverOutputPath);
13
13
  }
14
14
  const compilers = pathToCompilers.map((pathToCompiler) => {
15
- if (Array.isArray(pathToCompiler)) {
16
- const compiler = (0, child_process_1.spawn)('node', pathToCompiler, {
17
- stdio: 'inherit',
18
- cwd: app_configs_1.configs.cwd,
19
- });
20
- compiler.on('error', onProcessExit);
21
- compiler.on('close', onProcessExit);
22
- return compiler;
23
- }
24
- const compiler = (0, child_process_1.spawn)('node', [pathToCompiler], {
15
+ const compiler = (0, child_process_1.spawn)('node', Array.isArray(pathToCompiler) ? pathToCompiler : [pathToCompiler], {
25
16
  stdio: 'inherit',
17
+ cwd: app_configs_1.configs.cwd,
26
18
  });
27
- compiler.on('error', onProcessExit);
28
- compiler.on('close', onProcessExit);
19
+ compiler.on('error', onProcessError);
20
+ compiler.on('close', onProcessClose);
29
21
  return compiler;
30
22
  });
31
- function onProcessExit(code) {
23
+ function stopCompilers(exitCode) {
24
+ compilers.forEach((compiler) => compiler.kill());
25
+ process.exit(exitCode);
26
+ }
27
+ // в error приходит объект ошибки, а не код для выхода
28
+ function onProcessError(error) {
29
+ console.error(error.message);
30
+ stopCompilers(1);
31
+ }
32
+ function onProcessClose(code) {
32
33
  if (code !== 0) {
33
- compilers.forEach((compiler) => compiler.kill());
34
- process.exit(code);
34
+ // code === null означает, что процесс убит сигналом
35
+ stopCompilers(code !== null && code !== void 0 ? code : 1);
35
36
  }
36
37
  }
37
38
  }
@@ -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.1",
3
+ "version": "23.9.3",
4
4
  "main": "./build/index.js",
5
5
  "typings": "./build/index.d.ts",
6
6
  "exports": {