arui-scripts 21.0.0 → 21.0.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.
@@ -1,21 +1,21 @@
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 (22.894 s)
4
+ PASS src/plugins/postcss-global-variables/utils/__tests__/add-global-variable.tests.ts (22.267 s)
5
5
  PASS src/configs/util/__tests__/create-watch-ignore-regex.tests.ts
6
6
  PASS src/configs/util/__tests__/apply-overrides.tests.ts
7
7
  PASS src/configs/app-configs/__tests__/update-with-env.tests.ts
8
+ PASS src/configs/app-configs/__tests__/update-with-presets.tests.ts (22.805 s)
8
9
  PASS src/configs/app-configs/__tests__/update-with-package.tests.ts
9
- PASS src/configs/util/__tests__/compress-with-dcb.test.ts
10
10
  PASS src/configs/util/__tests__/get-polyfills.tests.ts
11
- PASS src/configs/app-configs/__tests__/update-with-presets.tests.ts (23.927 s)
12
11
  PASS src/plugins/postcss-global-variables/utils/__tests__/parse-variables.tests.ts
13
- PASS src/configs/app-configs/__tests__/validate-settings-keys.tests.ts
14
12
  PASS src/plugins/postcss-global-variables/utils/__tests__/get-media-query-name.tests.ts
15
- PASS src/configs/util/__tests__/find-plugin.tests.ts (26.703 s)
13
+ PASS src/configs/util/__tests__/compress-with-dcb.test.ts
14
+ PASS src/configs/app-configs/__tests__/validate-settings-keys.tests.ts
15
+ PASS src/configs/util/__tests__/find-plugin.tests.ts (25.342 s)
16
16
 
17
17
  Test Suites: 12 passed, 12 total
18
18
  Tests: 30 passed, 30 total
19
19
  Snapshots: 0 total
20
- Time: 27.674 s
20
+ Time: 26.364 s
21
21
  Ran all test suites.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # [15.3.0](https://github.com/core-ds/arui-scripts/compare/v15.2.0...v15.3.0) (2023-06-30)
2
2
 
3
+ ## 21.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#461](https://github.com/core-ds/arui-scripts/pull/461) [`e99e957`](https://github.com/core-ds/arui-scripts/commit/e99e95759bf072bb19eff08618c0233fa5bd742d) Thanks [@heymdall-legal](https://github.com/heymdall-legal)! - Пакет fork-ts-checker-webpack-plugin заменен на ts-checker-rspack-plugin. Вам больше не требуется иметь webpack в зависимостях. Баг был представлен в версии 20.12.2
8
+
3
9
  ## 21.0.0
4
10
 
5
11
  ### Major Changes
package/README.md CHANGED
@@ -46,3 +46,4 @@ npm install arui-scripts --save-dev
46
46
  - [Особенности поведения](docs/caveats.md)
47
47
  - [Использование модулей](docs/modules.md)
48
48
  - [Client-only режим](./docs/client-only.md)
49
+ - [Словарь для сжатия](./docs/compression-dictionary.md)
@@ -4,7 +4,7 @@ import { type Options as SwcOptions } from '@swc/core';
4
4
  import { type AppContextWithConfigs } from '../app-configs/types';
5
5
  import { type createSingleClientWebpackConfig } from '../webpack.client';
6
6
  import { type findLoader } from './find-loader';
7
- import { type findPlugin } from './find-plugin';
7
+ import { type createFindPluginFunction } from './find-plugin';
8
8
  type Overrides = {
9
9
  webpack: rspack.Configuration | rspack.Configuration[];
10
10
  webpackClient: rspack.Configuration | rspack.Configuration[];
@@ -42,11 +42,11 @@ type BoundCreateSingleClientWebpackConfig = OmitFirstArg<typeof createSingleClie
42
42
  type ClientWebpackAdditionalArgs = {
43
43
  createSingleClientWebpackConfig: BoundCreateSingleClientWebpackConfig;
44
44
  findLoader: typeof findLoader;
45
- findPlugin: ReturnType<typeof findPlugin<'client'>>;
45
+ findPlugin: ReturnType<typeof createFindPluginFunction<'client'>>;
46
46
  };
47
47
  type ServerWebpackAdditionalArgs = {
48
48
  findLoader: typeof findLoader;
49
- findPlugin: ReturnType<typeof findPlugin<'server'>>;
49
+ findPlugin: ReturnType<typeof createFindPluginFunction<'server'>>;
50
50
  };
51
51
  /**
52
52
  * Дополнительные аргументы, которые будут переданы в функцию оверрайда
@@ -4,9 +4,9 @@ import { type BannerPluginArgument, type Configuration, type CssExtractRspackPlu
4
4
  import type AssetsPlugin from 'assets-webpack-plugin';
5
5
  import type CaseSensitivePathsPlugin from 'case-sensitive-paths-webpack-plugin';
6
6
  import type CompressionPlugin from 'compression-webpack-plugin';
7
- import { type ForkTsCheckerWebpackPluginOptions } from 'fork-ts-checker-webpack-plugin/lib/plugin-options';
8
7
  import type MiniCssExtractPlugin from 'mini-css-extract-plugin';
9
8
  import { type RunScriptWebpackPlugin } from 'run-script-webpack-plugin';
9
+ import { type TsCheckerRspackPluginOptions } from 'ts-checker-rspack-plugin/lib/plugin-options';
10
10
  import { type WebpackDeduplicationPlugin } from 'webpack-deduplication-plugin';
11
11
  import { type WebpackManifestPlugin } from 'webpack-manifest-plugin';
12
12
  type PluginsListClient = {
@@ -24,7 +24,7 @@ type PluginsListClient = {
24
24
  runtimeOptions: MiniCssExtractPlugin.RuntimeOptions;
25
25
  };
26
26
  ForkTsCheckerWebpackPlugin: {
27
- options: ForkTsCheckerWebpackPluginOptions;
27
+ options: TsCheckerRspackPluginOptions;
28
28
  };
29
29
  IgnorePlugin: {
30
30
  options: {
@@ -74,11 +74,5 @@ type PluginsListServer = {
74
74
  };
75
75
  };
76
76
  type SelectedPluginsList<Type extends 'client' | 'server'> = Type extends 'client' ? PluginsListClient : PluginsListServer;
77
- /**
78
- *
79
- * @param config конфигурация webpack
80
- * @param pluginName имя плагина
81
- * @returns плагин или плагины, которые подошли под условие из testRule
82
- */
83
- export declare function findPlugin<Type extends 'client' | 'server'>(): <PluginName extends keyof SelectedPluginsList<Type>>(config: Configuration, pluginName: PluginName) => SelectedPluginsList<Type>[PluginName][];
77
+ export declare function createFindPluginFunction<Type extends 'client' | 'server'>(): <PluginName extends keyof SelectedPluginsList<Type>>(config: Configuration, pluginName: PluginName) => SelectedPluginsList<Type>[PluginName][];
84
78
  export {};
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findPlugin = findPlugin;
4
- /**
5
- *
6
- * @param config конфигурация webpack
7
- * @param pluginName имя плагина
8
- * @returns плагин или плагины, которые подошли под условие из testRule
9
- */
10
- function findPlugin() {
3
+ exports.createFindPluginFunction = createFindPluginFunction;
4
+ function createFindPluginFunction() {
5
+ /**
6
+ * @param config конфигурация webpack
7
+ * @param pluginName имя плагина
8
+ * @returns плагин или плагины, которые подошли под условие из testRule
9
+ */
11
10
  return (config, pluginName) => {
12
11
  if (!config.plugins || !pluginName)
13
12
  return [];
@@ -8,5 +8,5 @@ const webpack_client_1 = require("./webpack.client");
8
8
  exports.config = (0, apply_overrides_1.applyOverrides)(['webpack', 'webpackClient', 'webpackDev', 'webpackClientDev'], (0, webpack_client_1.createClientWebpackConfig)('dev'), {
9
9
  createSingleClientWebpackConfig: webpack_client_1.createSingleClientWebpackConfig.bind(null, 'dev'),
10
10
  findLoader: find_loader_1.findLoader,
11
- findPlugin: (0, find_plugin_1.findPlugin)(),
11
+ findPlugin: (0, find_plugin_1.createFindPluginFunction)(),
12
12
  });
@@ -47,7 +47,7 @@ const assets_webpack_plugin_1 = __importDefault(require("assets-webpack-plugin")
47
47
  const case_sensitive_paths_webpack_plugin_1 = __importDefault(require("case-sensitive-paths-webpack-plugin"));
48
48
  const compression_webpack_plugin_1 = __importDefault(require("compression-webpack-plugin"));
49
49
  const css_minimizer_webpack_plugin_1 = __importDefault(require("css-minimizer-webpack-plugin"));
50
- const fork_ts_checker_webpack_plugin_1 = __importDefault(require("fork-ts-checker-webpack-plugin"));
50
+ const ts_checker_rspack_plugin_1 = require("ts-checker-rspack-plugin");
51
51
  const html_webpack_plugin_1 = __importDefault(require("html-webpack-plugin"));
52
52
  const rspack_manifest_plugin_1 = require("rspack-manifest-plugin");
53
53
  const webpack_deduplication_plugin_1 = require("webpack-deduplication-plugin");
@@ -297,7 +297,7 @@ const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.ass
297
297
  (mode === 'prod' || !app_configs_1.configs.disableDevWebpackTypecheck) &&
298
298
  app_configs_1.configs.tsconfig !== null &&
299
299
  app_configs_1.configs.codeLoader !== 'tsc' &&
300
- new fork_ts_checker_webpack_plugin_1.default(),
300
+ new ts_checker_rspack_plugin_1.TsCheckerRspackPlugin(),
301
301
  // moment.js очень большая библиотека, которая включает в себя массу локализаций, которые мы не используем.
302
302
  // Поэтому мы их просто игнорируем, чтобы не включать в сборку.
303
303
  // https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
@@ -8,5 +8,5 @@ const webpack_client_1 = require("./webpack.client");
8
8
  exports.webpackClientConfig = (0, apply_overrides_1.applyOverrides)(['webpack', 'webpackClient', 'webpackProd', 'webpackClientProd'], (0, webpack_client_1.createClientWebpackConfig)('prod'), {
9
9
  createSingleClientWebpackConfig: webpack_client_1.createSingleClientWebpackConfig.bind(null, 'prod'),
10
10
  findLoader: find_loader_1.findLoader,
11
- findPlugin: (0, find_plugin_1.findPlugin)(),
11
+ findPlugin: (0, find_plugin_1.createFindPluginFunction)(),
12
12
  });
@@ -5,4 +5,4 @@ const apply_overrides_1 = require("./util/apply-overrides");
5
5
  const find_loader_1 = require("./util/find-loader");
6
6
  const find_plugin_1 = require("./util/find-plugin");
7
7
  const webpack_server_1 = require("./webpack.server");
8
- exports.webpackServerConfig = (0, apply_overrides_1.applyOverrides)(['webpack', 'webpackServer', 'webpackDev', 'webpackServerDev'], (0, webpack_server_1.createServerConfig)('dev'), { findLoader: find_loader_1.findLoader, findPlugin: (0, find_plugin_1.findPlugin)() });
8
+ exports.webpackServerConfig = (0, apply_overrides_1.applyOverrides)(['webpack', 'webpackServer', 'webpackDev', 'webpackServerDev'], (0, webpack_server_1.createServerConfig)('dev'), { findLoader: find_loader_1.findLoader, findPlugin: (0, find_plugin_1.createFindPluginFunction)() });
@@ -5,4 +5,4 @@ const apply_overrides_1 = require("./util/apply-overrides");
5
5
  const find_loader_1 = require("./util/find-loader");
6
6
  const find_plugin_1 = require("./util/find-plugin");
7
7
  const webpack_server_1 = require("./webpack.server");
8
- exports.webpackServerConfig = (0, apply_overrides_1.applyOverrides)(['webpack', 'webpackServer', 'webpackProd', 'webpackServerProd'], (0, webpack_server_1.createServerConfig)('prod'), { findLoader: find_loader_1.findLoader, findPlugin: (0, find_plugin_1.findPlugin)() });
8
+ exports.webpackServerConfig = (0, apply_overrides_1.applyOverrides)(['webpack', 'webpackServer', 'webpackProd', 'webpackServerProd'], (0, webpack_server_1.createServerConfig)('prod'), { findLoader: find_loader_1.findLoader, findPlugin: (0, find_plugin_1.createFindPluginFunction)() });
package/docs/caveats.md CHANGED
@@ -21,9 +21,9 @@
21
21
  В dev сборке для сервера и клиента настроено кеширование. Оно должно нормально работать когда вы просто работаете
22
22
  над проектом - меняете ваш код, ставите новые зависимости и тд.
23
23
 
24
- Но когда вы руками меняете код внутри node_modules - вы не сможете увидеть ваши изменения, так как webpack будет
24
+ Но когда вы руками меняете код внутри node_modules - вы не сможете увидеть ваши изменения, так как rspack будет
25
25
  использовать данные из кеша. Для того чтобы ваши изменения применились в сборке вам необходимо очистить кеш
26
- webpack и перезапустить сборку. Кеши хранятся в папке `.cache` внутри `node_modules` вашего проекта.
26
+ rspack и перезапустить сборку. Кеши хранятся в папке `.cache` внутри `node_modules` вашего проекта.
27
27
 
28
28
  ```
29
29
  rm -rf ./node_modules/.cache
package/docs/commands.md CHANGED
@@ -10,7 +10,7 @@ arui-scripts start
10
10
  ```
11
11
 
12
12
  ### start:prod
13
- Запускает dev-сервер для клиентского кода и серверный код в watch-режиме. При этом использует production-конфигурацию для webpack.
13
+ Запускает dev-сервер для клиентского кода и серверный код в watch-режиме. При этом использует production-конфигурацию для rspack.
14
14
  Может быть полезна для сбора метрик производительности.
15
15
 
16
16
  **Как запустить?**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arui-scripts",
3
- "version": "21.0.0",
3
+ "version": "21.0.1",
4
4
  "main": "./build/index.js",
5
5
  "typings": "./build/index.d.ts",
6
6
  "license": "MPL-2.0",
@@ -61,7 +61,6 @@
61
61
  "css-minimizer-webpack-plugin": "5.0.0",
62
62
  "expose-loader": "3.1.0",
63
63
  "filesize": "^6.4.0",
64
- "fork-ts-checker-webpack-plugin": "9.1.0",
65
64
  "fs-extra": "6.0.1",
66
65
  "html-webpack-plugin": "^5.6.0",
67
66
  "image-minimizer-webpack-plugin": "^3.8.3",
@@ -111,6 +110,7 @@
111
110
  "swc-plugin-coverage-instrument": "0.0.32",
112
111
  "tar": "7.5.11",
113
112
  "terser-webpack-plugin": "5.3.14",
113
+ "ts-checker-rspack-plugin": "^1.3.0",
114
114
  "ts-jest": "29.1.0",
115
115
  "ts-loader": "9.4.4",
116
116
  "ts-node": "10.9.2",