arui-scripts 20.12.1 → 21.0.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.
@@ -1,18 +1,21 @@
1
- PASS src/plugins/postcss-global-variables/utils/__tests__/add-global-variable.tests.ts (28.055 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.894 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 (28.62 s)
4
6
  PASS src/configs/util/__tests__/apply-overrides.tests.ts
5
7
  PASS src/configs/app-configs/__tests__/update-with-env.tests.ts
6
8
  PASS src/configs/app-configs/__tests__/update-with-package.tests.ts
7
- PASS src/configs/util/__tests__/get-polyfills.tests.ts
8
9
  PASS src/configs/util/__tests__/compress-with-dcb.test.ts
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)
9
12
  PASS src/plugins/postcss-global-variables/utils/__tests__/parse-variables.tests.ts
10
- PASS src/plugins/postcss-global-variables/utils/__tests__/get-media-query-name.tests.ts
11
13
  PASS src/configs/app-configs/__tests__/validate-settings-keys.tests.ts
12
- PASS src/configs/util/__tests__/find-plugin.tests.ts (30.944 s)
14
+ 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
16
 
14
17
  Test Suites: 12 passed, 12 total
15
18
  Tests: 30 passed, 30 total
16
19
  Snapshots: 0 total
17
- Time: 31.805 s
20
+ Time: 27.674 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.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#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.
8
+
9
+ В базовом tsconfig.json значение `compilerOptions.moduleResolution` изменено с "node" на "bundler".
10
+ Режим bundler включает поддержку современных механизмов резолва пакетов — в первую очередь поля exports в package.json зависимостей.
11
+ Это приближает поведение TypeScript к тому, как модули реально резолвятся rspack.
12
+
13
+ ### Что может сломаться
14
+
15
+ **Импорты по путям, не объявленным в `exports` зависимости**
16
+
17
+ Это основная причина возможных ошибок. Если у пакета в `package.json` есть поле `exports`, TypeScript теперь использует **только его** для резолва. Прямые импорты внутренностей пакета, не описанные в `exports`, перестанут резолвиться:
18
+
19
+ ```
20
+ TS2307: Cannot find module 'some-lib/dist/utils' or its corresponding type declarations.
21
+ ```
22
+
23
+ Примеры импортов, которые могут сломаться:
24
+
25
+ ```ts
26
+ // Импорт из внутренней директории пакета
27
+ import { helper } from 'some-lib/dist/internal/utils';
28
+
29
+ // Субпутевой импорт, не описанный в exports
30
+ import { Component } from '@scope/ui-kit/some-undeclared-path';
31
+ ```
32
+
33
+ **Изменение приоритета `typesVersions` vs `exports`**
34
+
35
+ Если зависимость использует одновременно `typesVersions` и `exports` с условием `types`, то в режиме `bundler` приоритет получает `exports`. В редких случаях это может привести к подхвату других типов.
36
+
37
+ **Пакеты с неполными `exports` (только `require`)**
38
+
39
+ Если зависимость в `exports` указала только условие `require` без `import` или `default`, импорт может не зарезолвиться. На практике это редкость.
40
+
41
+ ## 20.12.2
42
+
43
+ ### Patch Changes
44
+
45
+ - [#458](https://github.com/core-ds/arui-scripts/pull/458) [`13b7c96`](https://github.com/core-ds/arui-scripts/commit/13b7c96ec280322649f4e30f413187c4e8c6f8df) Thanks [@ngg-dev](https://github.com/ngg-dev)! - обновлены версии внутренних зависимостей для фикса уязвимостей связанных с пакетом ajv
46
+
3
47
  ## 20.12.1
4
48
 
5
49
  ### Patch Changes
@@ -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;
@@ -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,11 +1,10 @@
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/ForkTsCheckerWebpackPluginOptions';
7
+ import { type ForkTsCheckerWebpackPluginOptions } from 'fork-ts-checker-webpack-plugin/lib/plugin-options';
9
8
  import type MiniCssExtractPlugin from 'mini-css-extract-plugin';
10
9
  import { type RunScriptWebpackPlugin } from 'run-script-webpack-plugin';
11
10
  import { type WebpackDeduplicationPlugin } from 'webpack-deduplication-plugin';
@@ -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];
@@ -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,
@@ -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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arui-scripts",
3
- "version": "20.12.1",
3
+ "version": "21.0.0",
4
4
  "main": "./build/index.js",
5
5
  "typings": "./build/index.d.ts",
6
6
  "license": "MPL-2.0",
@@ -36,7 +36,7 @@
36
36
  "@babel/preset-react": "^7.23.3",
37
37
  "@babel/preset-typescript": "^7.23.3",
38
38
  "@babel/runtime": "^7.26.10",
39
- "@pmmmwh/react-refresh-webpack-plugin": "0.5.11",
39
+ "@pmmmwh/react-refresh-webpack-plugin": "0.6.2",
40
40
  "@rsdoctor/rspack-plugin": "1.5.2",
41
41
  "@rspack/cli": "1.7.6",
42
42
  "@rspack/core": "1.7.3",
@@ -61,7 +61,7 @@
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": "6.5.3",
64
+ "fork-ts-checker-webpack-plugin": "9.1.0",
65
65
  "fs-extra": "6.0.1",
66
66
  "html-webpack-plugin": "^5.6.0",
67
67
  "image-minimizer-webpack-plugin": "^3.8.3",
@@ -113,7 +113,7 @@
113
113
  "terser-webpack-plugin": "5.3.14",
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"]