arui-scripts 20.12.2 → 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.
Files changed (33) hide show
  1. package/.turbo/turbo-test.log +9 -6
  2. package/CHANGELOG.md +44 -0
  3. package/README.md +1 -0
  4. package/build/bin/index.d.ts +1 -2
  5. package/build/bin/index.js +1 -0
  6. package/build/commands/changelog/index.js +17 -7
  7. package/build/commands/ensure-yarn/index.d.ts +1 -0
  8. package/build/commands/ensure-yarn/index.js +1 -0
  9. package/build/commands/test/get-config.js +2 -25
  10. package/build/commands/test/index.js +17 -7
  11. package/build/configs/jest/babel-transform.d.ts +1 -1
  12. package/build/configs/modules.js +17 -7
  13. package/build/configs/util/apply-overrides.d.ts +3 -3
  14. package/build/configs/util/compress-with-dcb.d.ts +1 -1
  15. package/build/configs/util/dcb-compression-plugin.d.ts +2 -3
  16. package/build/configs/util/find-plugin.d.ts +5 -12
  17. package/build/configs/util/find-plugin.js +7 -8
  18. package/build/configs/util/node-assets-ignore.d.ts +1 -0
  19. package/build/configs/util/node-assets-ignore.js +1 -0
  20. package/build/configs/util/register-ts-node.d.ts +1 -0
  21. package/build/configs/util/register-ts-node.js +4 -3
  22. package/build/configs/webpack.client.dev.js +1 -1
  23. package/build/configs/webpack.client.js +19 -9
  24. package/build/configs/webpack.client.prod.js +1 -1
  25. package/build/configs/webpack.server.dev.js +1 -1
  26. package/build/configs/webpack.server.prod.js +1 -1
  27. package/docs/caveats.md +2 -2
  28. package/docs/commands.md +1 -1
  29. package/package.json +11 -6
  30. package/tsconfig-local.json +6 -2
  31. package/tsconfig-local.tsbuildinfo +1 -0
  32. package/tsconfig.json +1 -41
  33. package/build/tsconfig-local.tsbuildinfo +0 -1
@@ -1,18 +1,21 @@
1
- PASS src/plugins/postcss-global-variables/utils/__tests__/add-global-variable.tests.ts (29.217 s)
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
+ 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
+ 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.267 s)
2
5
  PASS src/configs/util/__tests__/create-watch-ignore-regex.tests.ts
3
- PASS src/configs/app-configs/__tests__/update-with-presets.tests.ts (29.62 s)
4
6
  PASS src/configs/util/__tests__/apply-overrides.tests.ts
5
- PASS src/configs/app-configs/__tests__/update-with-package.tests.ts
6
7
  PASS src/configs/app-configs/__tests__/update-with-env.tests.ts
7
- PASS src/configs/util/__tests__/compress-with-dcb.test.ts
8
+ PASS src/configs/app-configs/__tests__/update-with-presets.tests.ts (22.805 s)
9
+ PASS src/configs/app-configs/__tests__/update-with-package.tests.ts
8
10
  PASS src/configs/util/__tests__/get-polyfills.tests.ts
9
11
  PASS src/plugins/postcss-global-variables/utils/__tests__/parse-variables.tests.ts
10
12
  PASS src/plugins/postcss-global-variables/utils/__tests__/get-media-query-name.tests.ts
13
+ PASS src/configs/util/__tests__/compress-with-dcb.test.ts
11
14
  PASS src/configs/app-configs/__tests__/validate-settings-keys.tests.ts
12
- PASS src/configs/util/__tests__/find-plugin.tests.ts (31.315 s)
15
+ PASS src/configs/util/__tests__/find-plugin.tests.ts (25.342 s)
13
16
 
14
17
  Test Suites: 12 passed, 12 total
15
18
  Tests: 30 passed, 30 total
16
19
  Snapshots: 0 total
17
- Time: 32.112 s
20
+ Time: 26.364 s
18
21
  Ran all test suites.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
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
+
9
+ ## 21.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - [#449](https://github.com/core-ds/arui-scripts/pull/449) [`63a7336`](https://github.com/core-ds/arui-scripts/commit/63a7336cc279d6eeab3bc8ba24246a036e683d72) Thanks [@heymdall-legal](https://github.com/heymdall-legal)! - Добавлена поддержка ts@6. Удалена поддержка ts@4.
14
+
15
+ В базовом tsconfig.json значение `compilerOptions.moduleResolution` изменено с "node" на "bundler".
16
+ Режим bundler включает поддержку современных механизмов резолва пакетов — в первую очередь поля exports в package.json зависимостей.
17
+ Это приближает поведение TypeScript к тому, как модули реально резолвятся rspack.
18
+
19
+ ### Что может сломаться
20
+
21
+ **Импорты по путям, не объявленным в `exports` зависимости**
22
+
23
+ Это основная причина возможных ошибок. Если у пакета в `package.json` есть поле `exports`, TypeScript теперь использует **только его** для резолва. Прямые импорты внутренностей пакета, не описанные в `exports`, перестанут резолвиться:
24
+
25
+ ```
26
+ TS2307: Cannot find module 'some-lib/dist/utils' or its corresponding type declarations.
27
+ ```
28
+
29
+ Примеры импортов, которые могут сломаться:
30
+
31
+ ```ts
32
+ // Импорт из внутренней директории пакета
33
+ import { helper } from 'some-lib/dist/internal/utils';
34
+
35
+ // Субпутевой импорт, не описанный в exports
36
+ import { Component } from '@scope/ui-kit/some-undeclared-path';
37
+ ```
38
+
39
+ **Изменение приоритета `typesVersions` vs `exports`**
40
+
41
+ Если зависимость использует одновременно `typesVersions` и `exports` с условием `types`, то в режиме `bundler` приоритет получает `exports`. В редких случаях это может привести к подхвату других типов.
42
+
43
+ **Пакеты с неполными `exports` (только `require`)**
44
+
45
+ Если зависимость в `exports` указала только условие `require` без `import` или `default`, импорт может не зарезолвиться. На практике это редкость.
46
+
3
47
  ## 20.12.2
4
48
 
5
49
  ### Patch 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)
@@ -1,3 +1,2 @@
1
1
  #! /usr/bin/env node
2
- declare const commands: Record<string, () => void>;
3
- declare const command: string;
2
+ export {};
@@ -2,6 +2,7 @@
2
2
  "use strict";
3
3
  /* eslint-disable global-require */
4
4
  /* eslint import/no-dynamic-require: 0 */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
5
6
  const commands = {
6
7
  start: () => require('../commands/start'),
7
8
  'start:prod': () => require('../commands/start-prod'),
@@ -19,13 +19,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
19
19
  }) : function(o, v) {
20
20
  o["default"] = v;
21
21
  });
22
- var __importStar = (this && this.__importStar) || function (mod) {
23
- if (mod && mod.__esModule) return mod;
24
- var result = {};
25
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
- __setModuleDefault(result, mod);
27
- return result;
28
- };
22
+ var __importStar = (this && this.__importStar) || (function () {
23
+ var ownKeys = function(o) {
24
+ ownKeys = Object.getOwnPropertyNames || function (o) {
25
+ var ar = [];
26
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
27
+ return ar;
28
+ };
29
+ return ownKeys(o);
30
+ };
31
+ return function (mod) {
32
+ if (mod && mod.__esModule) return mod;
33
+ var result = {};
34
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
35
+ __setModuleDefault(result, mod);
36
+ return result;
37
+ };
38
+ })();
29
39
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
30
40
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
31
41
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  if (process.env.npm_config_user_agent && process.env.npm_config_user_agent.indexOf('yarn') === -1) {
3
4
  console.log(process.env);
4
5
  console.error('You must use yarn to install dependencies, now using', process.env.npm_execpath);
@@ -1,27 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -71,7 +48,7 @@ function getAppJestConfig() {
71
48
  return __awaiter(this, void 0, void 0, function* () {
72
49
  const jestConfigPath = path_1.default.resolve(process.cwd(), 'jest.config.js');
73
50
  if (fs_1.default.existsSync(jestConfigPath)) {
74
- return (yield Promise.resolve(`${jestConfigPath}`).then(s => __importStar(require(s)))).default;
51
+ return (yield import(jestConfigPath)).default;
75
52
  }
76
53
  if (app_configs_1.configs.appPackage.jest) {
77
54
  return app_configs_1.configs.appPackage.jest;
@@ -95,7 +72,7 @@ function getPresetConfig(presetPath) {
95
72
  if (!presetModule) {
96
73
  throw new Error(`Cannot find module '${normalizedPresetPath}'`);
97
74
  }
98
- const _a = (yield Promise.resolve(`${presetModule}`).then(s => __importStar(require(s)))).default, { preset: subPreset } = _a, preset = __rest(_a, ["preset"]);
75
+ const _a = (yield import(presetModule)).default, { preset: subPreset } = _a, preset = __rest(_a, ["preset"]);
99
76
  if (subPreset) {
100
77
  console.warn(`Jest can't handle preset chaining. Preset "${subPreset}" will be ignored.`);
101
78
  }
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -1,2 +1,2 @@
1
- declare const _exports: import("@jest/transform").SyncTransformer<babel.TransformOptions>;
1
+ declare const _exports: import("@jest/transform").SyncTransformer<import("@babel/core").TransformOptions>;
2
2
  export = _exports;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.MODULES_ENTRY_NAME = void 0;
27
37
  exports.haveExposedDefaultModules = haveExposedDefaultModules;
@@ -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
  * Дополнительные аргументы, которые будут переданы в функцию оверрайда
@@ -1,2 +1,2 @@
1
1
  import { Buffer } from 'buffer';
2
- export declare function compressWithDcb(inputFile: Buffer, dictionaryData: Buffer): Promise<Buffer>;
2
+ export declare function compressWithDcb(inputFile: Buffer, dictionaryData: Buffer): Promise<Buffer<ArrayBuffer>>;
@@ -1,5 +1,4 @@
1
- import { type Assets, type Compilation, type Compiler } from '@rspack/core';
2
- import { type PathData } from '@rspack/core/dist/Compilation';
1
+ import { type Assets, type Compilation, type Compiler, type PathData } from '@rspack/core';
3
2
  import { type Rules } from 'compression-webpack-plugin';
4
3
  type DcbCompressionOptions = {
5
4
  test?: Rules;
@@ -15,7 +14,7 @@ type DcbCompressionOptions = {
15
14
  export declare class CustomCompressionPlugin {
16
15
  protected options: DcbCompressionOptions;
17
16
  constructor(options: DcbCompressionOptions);
18
- runCompressionAlgorithm(input: Buffer, filename: string): Promise<Buffer>;
17
+ runCompressionAlgorithm(input: Buffer, filename: string): Promise<Buffer<ArrayBufferLike>>;
19
18
  compress(compiler: Compiler, compilation: Compilation, assets: Assets): Promise<void>;
20
19
  apply(compiler: Compiler): void;
21
20
  }
@@ -1,13 +1,12 @@
1
1
  import { type Worker } from 'cluster';
2
2
  import { type ReactRefreshPluginOptions } from '@pmmmwh/react-refresh-webpack-plugin/types/lib/types';
3
- import { type Configuration, type CssExtractRspackPluginOptions, type DefinePlugin, type NormalModuleReplacementPlugin } from '@rspack/core';
4
- import { type BannerPluginOptions } from '@rspack/core/dist/builtin-plugin/BannerPlugin';
3
+ import { type BannerPluginArgument, type Configuration, type CssExtractRspackPluginOptions, type DefinePlugin, type NormalModuleReplacementPlugin } from '@rspack/core';
5
4
  import type AssetsPlugin from 'assets-webpack-plugin';
6
5
  import type CaseSensitivePathsPlugin from 'case-sensitive-paths-webpack-plugin';
7
6
  import type CompressionPlugin from 'compression-webpack-plugin';
8
- import { type ForkTsCheckerWebpackPluginOptions } from 'fork-ts-checker-webpack-plugin/lib/plugin-options';
9
7
  import type MiniCssExtractPlugin from 'mini-css-extract-plugin';
10
8
  import { type RunScriptWebpackPlugin } from 'run-script-webpack-plugin';
9
+ import { type TsCheckerRspackPluginOptions } from 'ts-checker-rspack-plugin/lib/plugin-options';
11
10
  import { type WebpackDeduplicationPlugin } from 'webpack-deduplication-plugin';
12
11
  import { type WebpackManifestPlugin } from 'webpack-manifest-plugin';
13
12
  type PluginsListClient = {
@@ -25,7 +24,7 @@ type PluginsListClient = {
25
24
  runtimeOptions: MiniCssExtractPlugin.RuntimeOptions;
26
25
  };
27
26
  ForkTsCheckerWebpackPlugin: {
28
- options: ForkTsCheckerWebpackPluginOptions;
27
+ options: TsCheckerRspackPluginOptions;
29
28
  };
30
29
  IgnorePlugin: {
31
30
  options: {
@@ -55,7 +54,7 @@ type PluginsListClient = {
55
54
  };
56
55
  type PluginsListServer = {
57
56
  BannerPlugin: {
58
- options: BannerPluginOptions;
57
+ options: BannerPluginArgument;
59
58
  };
60
59
  RunScriptWebpackPlugin: {
61
60
  options: ConstructorParameters<typeof RunScriptWebpackPlugin>[number];
@@ -75,11 +74,5 @@ type PluginsListServer = {
75
74
  };
76
75
  };
77
76
  type SelectedPluginsList<Type extends 'client' | 'server'> = Type extends 'client' ? PluginsListClient : PluginsListServer;
78
- /**
79
- *
80
- * @param config конфигурация webpack
81
- * @param pluginName имя плагина
82
- * @returns плагин или плагины, которые подошли под условие из testRule
83
- */
84
- 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][];
85
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 [];
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  // ignore attempts to require any types of assets
3
4
  (() => {
4
5
  // simply ignore css files, it wont cause any damage
@@ -0,0 +1 @@
1
+ export {};
@@ -1,16 +1,17 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  /* eslint-disable @typescript-eslint/no-var-requires */
3
4
  // Мы используем ts-node для работы c конфигами, описаными на ts
4
5
  require('ts-node').register({
5
6
  transpileOnly: true,
6
7
  ignore: [],
7
8
  compilerOptions: {
8
- target: 'ES2016',
9
- module: 'CommonJS',
9
+ target: 'esnext',
10
+ module: 'esnext',
10
11
  skipLibCheck: true,
11
12
  allowJs: false,
12
13
  allowSyntheticDefaultImports: true,
13
- moduleResolution: 'node',
14
+ moduleResolution: 'bundler',
14
15
  esModuleInterop: true,
15
16
  },
16
17
  skipProject: true,
@@ -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
  });
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -37,7 +47,7 @@ const assets_webpack_plugin_1 = __importDefault(require("assets-webpack-plugin")
37
47
  const case_sensitive_paths_webpack_plugin_1 = __importDefault(require("case-sensitive-paths-webpack-plugin"));
38
48
  const compression_webpack_plugin_1 = __importDefault(require("compression-webpack-plugin"));
39
49
  const css_minimizer_webpack_plugin_1 = __importDefault(require("css-minimizer-webpack-plugin"));
40
- 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");
41
51
  const html_webpack_plugin_1 = __importDefault(require("html-webpack-plugin"));
42
52
  const rspack_manifest_plugin_1 = require("rspack-manifest-plugin");
43
53
  const webpack_deduplication_plugin_1 = require("webpack-deduplication-plugin");
@@ -287,7 +297,7 @@ const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.ass
287
297
  (mode === 'prod' || !app_configs_1.configs.disableDevWebpackTypecheck) &&
288
298
  app_configs_1.configs.tsconfig !== null &&
289
299
  app_configs_1.configs.codeLoader !== 'tsc' &&
290
- new fork_ts_checker_webpack_plugin_1.default(),
300
+ new ts_checker_rspack_plugin_1.TsCheckerRspackPlugin(),
291
301
  // moment.js очень большая библиотека, которая включает в себя массу локализаций, которые мы не используем.
292
302
  // Поэтому мы их просто игнорируем, чтобы не включать в сборку.
293
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": "20.12.2",
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,9 +110,10 @@
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
- "ts-node": "9.1.1",
116
+ "ts-node": "10.9.2",
117
117
  "webpack-bundle-analyzer": "4.10.2",
118
118
  "webpack-deduplication-plugin": "^0.0.8",
119
119
  "webpack-manifest-plugin": "3.2.0",
@@ -140,7 +140,7 @@
140
140
  "@types/webpack-manifest-plugin": "3.0.5",
141
141
  "@types/webpack-node-externals": "^3.0.0",
142
142
  "type-fest": "2.19.0",
143
- "typescript": "5.6.3"
143
+ "typescript": "6.0.2"
144
144
  },
145
145
  "engines": {
146
146
  "node": ">=20"
@@ -161,7 +161,7 @@
161
161
  "imagemin-optipng": "^8.0.0",
162
162
  "react": ">=16.3.0",
163
163
  "react-dom": ">=16.3.0",
164
- "typescript": ">=4.0.0"
164
+ "typescript": ">=5.0.0"
165
165
  },
166
166
  "jest": {
167
167
  "testRegex": "src/.*/__tests__/.*\\.ts$",
@@ -170,7 +170,12 @@
170
170
  "js"
171
171
  ],
172
172
  "transform": {
173
- "^.+\\.tsx?$": "ts-jest"
173
+ "^.+\\.tsx?$": [
174
+ "ts-jest",
175
+ {
176
+ "tsconfig": "tsconfig-local.json"
177
+ }
178
+ ]
174
179
  }
175
180
  }
176
181
  }
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "extends": "./tsconfig.json",
3
3
  "compilerOptions": {
4
+ "lib": ["dom", "esnext"],
4
5
  "target": "ES2016",
5
- "module": "CommonJS",
6
+ "module": "NodeNext",
6
7
  "skipLibCheck": true,
7
8
  "outDir": "./build",
8
9
  "allowJs": true,
9
- "declaration": true
10
+ "rootDir": "./src",
11
+ "declaration": true,
12
+ "moduleResolution": "nodenext",
13
+ "types": ["jest", "node", "webpack-env"]
10
14
  },
11
15
  "include": ["src/**/*.ts", "src/**/*.js"],
12
16
  "exclude": ["build"]