arui-scripts 21.0.4 → 22.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.
- package/.turbo/turbo-test.log +8 -7
- package/CHANGELOG.md +27 -1
- package/README.md +12 -2
- package/build/configs/app-configs/types.d.ts +2 -2
- package/build/configs/dev-server.js +31 -28
- package/build/configs/postcss.config.d.ts +3 -1
- package/build/configs/postcss.d.ts +6 -1
- package/build/configs/postcss.js +17 -2
- package/build/configs/webpack.client.d.ts +1 -1
- package/build/configs/webpack.client.dev.d.ts +1 -1
- package/build/configs/webpack.client.js +3 -3
- package/build/configs/webpack.client.prod.d.ts +1 -1
- package/build/configs/webpack.server.dev.d.ts +1 -1
- package/build/configs/webpack.server.js +2 -2
- package/build/configs/webpack.server.prod.d.ts +1 -1
- package/docs/presets.md +2 -2
- package/docs/settings.md +3 -1
- package/package.json +35 -11
- package/tsconfig-local.tsbuildinfo +1 -1
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
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/
|
|
5
|
-
PASS src/
|
|
4
|
+
PASS src/plugins/postcss-global-variables/utils/__tests__/add-global-variable.tests.ts (23.129 s)
|
|
5
|
+
PASS src/configs/app-configs/__tests__/update-with-presets.tests.ts (23.21 s)
|
|
6
6
|
PASS src/configs/util/__tests__/create-watch-ignore-regex.tests.ts
|
|
7
|
-
PASS src/configs/util/__tests__/apply-overrides.tests.ts
|
|
8
7
|
PASS src/configs/app-configs/__tests__/update-with-env.tests.ts
|
|
9
8
|
PASS src/configs/app-configs/__tests__/update-with-package.tests.ts
|
|
9
|
+
PASS src/configs/util/__tests__/apply-overrides.tests.ts
|
|
10
10
|
PASS src/configs/util/__tests__/get-polyfills.tests.ts
|
|
11
|
-
PASS src/plugins/postcss-global-variables/utils/__tests__/parse-variables.tests.ts
|
|
12
11
|
PASS src/configs/util/__tests__/compress-with-dcb.test.ts
|
|
13
|
-
PASS src/plugins/postcss-global-variables/utils/__tests__/
|
|
12
|
+
PASS src/plugins/postcss-global-variables/utils/__tests__/parse-variables.tests.ts
|
|
14
13
|
PASS src/configs/app-configs/__tests__/validate-settings-keys.tests.ts
|
|
15
|
-
PASS src/
|
|
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 (31.51 s)
|
|
16
|
+
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.
|
|
16
17
|
|
|
17
18
|
Test Suites: 12 passed, 12 total
|
|
18
19
|
Tests: 30 passed, 30 total
|
|
19
20
|
Snapshots: 0 total
|
|
20
|
-
Time:
|
|
21
|
+
Time: 32.544 s
|
|
21
22
|
Ran all test suites.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# arui-scripts
|
|
2
|
+
|
|
3
|
+
## 22.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#470](https://github.com/core-ds/arui-scripts/pull/470) [`6f3178f`](https://github.com/core-ds/arui-scripts/commit/6f3178f9e6e37d4b21d1bcd08a9ad6c469ae59c2) Thanks [@dmitrbrvsk](https://github.com/dmitrbrvsk)! - В **arui-scripts** переведены инструменты сборки на **Rspack 2** и **@rspack/dev-server 2**.
|
|
8
|
+
|
|
9
|
+
## Почему мажорный релиз
|
|
10
|
+
|
|
11
|
+
Поднято требование к node.js: для разработки теперь требуется **20.19.0 и выше** или **22.12.0 и выше** (см. поле `engines` в `package.json`). На **node.js 18** и на **20.0–20.18** новая версия не рассчитана, потому что этого требует сам Rspack 2 и dev-server 2.
|
|
12
|
+
|
|
13
|
+
## Что это означает для проектов на arui-scripts
|
|
14
|
+
|
|
15
|
+
- **Обычный сценарий** (настройки из доки, без своих оверрайдов webpack/rspack/devServer): после обновления пакета достаточно **поднять версию node.js** до поддерживаемой версии и прогнать `yarn start` / `yarn build`.
|
|
16
|
+
- **Если в проекте есть оверрайды** (`arui-scripts` override с `devServer`, `proxy`, `webpackClient` и тд.): часть старых опций пропала или переименована в Rspack 2 и в dev-server 2. Например, в прокси dev-сервера больше нет `bypass`, вместо него теперь используются фильтры путей и колбэки в `on.*`. Подробнее про это в ссылка ниже.
|
|
17
|
+
|
|
18
|
+
## Ссылки про миграцию
|
|
19
|
+
|
|
20
|
+
- [Rspack: обновление с 1.x на 2.0](https://rspack.rs/guide/migration/rspack_1.x)
|
|
21
|
+
- [@rspack/dev-server: с v1 на v2](https://github.com/rstackjs/rspack-dev-server/blob/main/docs/migrate-v1-to-v2.md)
|
|
22
|
+
|
|
23
|
+
## 21.0.5
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- [#480](https://github.com/core-ds/arui-scripts/pull/480) [`54ee0bf`](https://github.com/core-ds/arui-scripts/commit/54ee0bf09c5fae5ff329bdf7394044d2b0aab851) Thanks [@dmitrbrvsk](https://github.com/dmitrbrvsk)! - Отключен autoprefixer в cерверной конфигурации postcss, чтобы CSS modules в server сборке не генерировали предупреждения при таргете `current node`.
|
|
2
28
|
|
|
3
29
|
## 21.0.4
|
|
4
30
|
|
package/README.md
CHANGED
|
@@ -27,9 +27,19 @@ npm install arui-scripts --save-dev
|
|
|
27
27
|
2. Создайте необходимые файлы
|
|
28
28
|
- `src/index.{js,jsx,ts,tsx}` - входная точка для клиентского приложения.
|
|
29
29
|
- `src/server/index.{js,jsx,tsx}` - входная точка для серверного приложения.
|
|
30
|
-
|
|
30
|
+
Если нужен только клиент, смотреть [Режим clientOnly](./docs/client-only.md).
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
**Полифилы (опционально).**
|
|
33
|
+
Отдельный бандл полифилов не обязателен: по умолчанию [clientPolyfillsEntry](docs/settings.md#clientpolyfillsentry) не задан. Для большинства целей по браузерам (их можно сузить или расширить через overrides `supporting-browsers`, см. [Тонкая настройка](docs/overrides.md#тонкая-настройка)) можно не подключать отдельный файл полифилов.
|
|
34
|
+
|
|
35
|
+
Если полифилы все же нужны (старые браузеры или режим `entry` у SWC/Babel с `core-js`):
|
|
36
|
+
|
|
37
|
+
- добавьте в проект зависимость `core-js` (при необходимости)
|
|
38
|
+
- создайте файл, например `src/polyfills.ts`, с импортом `import 'core-js/stable';`
|
|
39
|
+
- укажите в [arui-scripts.config](docs/settings.md) или в `package.json` в секции `aruiScripts`: `clientPolyfillsEntry: './src/polyfills'`
|
|
40
|
+
|
|
41
|
+
Пути ко входным точкам и полифилам можно переопределить через настройки.
|
|
42
|
+
Полный список в [документации по настройкам](docs/settings.md).
|
|
33
43
|
|
|
34
44
|
3. Используйте команды из `arui-scripts`!
|
|
35
45
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DevTool, type Shared } from '@rspack/core';
|
|
2
|
-
import { type
|
|
2
|
+
import { type Configuration as DevServerConfiguration } from '@rspack/dev-server';
|
|
3
3
|
import { type PluginOptions as ReactCompilerOptions } from 'babel-plugin-react-compiler';
|
|
4
4
|
/**
|
|
5
5
|
* Конфигурация arui-scripts, которая может быть переопределена приложением
|
|
@@ -12,7 +12,7 @@ export type AppConfigs = {
|
|
|
12
12
|
devServerCors: boolean;
|
|
13
13
|
useServerHMR: boolean;
|
|
14
14
|
presets: string | null;
|
|
15
|
-
proxy:
|
|
15
|
+
proxy: DevServerConfiguration['proxy'];
|
|
16
16
|
clientOnly: boolean;
|
|
17
17
|
buildPath: string;
|
|
18
18
|
assetsPath: string;
|
|
@@ -8,34 +8,37 @@ const path_1 = __importDefault(require("path"));
|
|
|
8
8
|
const apply_overrides_1 = require("./util/apply-overrides");
|
|
9
9
|
const app_configs_1 = require("./app-configs");
|
|
10
10
|
const client_env_config_1 = require("./client-env-config");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
function getServerToClientProxyConfig() {
|
|
12
|
+
const assetsRoot = path_1.default.normalize(`/${app_configs_1.configs.publicPath}`).replace(/\\/g, '/');
|
|
13
|
+
return Object.assign({ target: `http://127.0.0.1:${app_configs_1.configs.serverPort}`,
|
|
14
|
+
// В @rspack/dev-server v2 (http-proxy-middleware) опции bypass нет. Аналог pathFilter
|
|
15
|
+
// на бэкенд уходят только запросы, чей path не относится к клиентской статике (префикс publicPath).
|
|
16
|
+
pathFilter: (pathname) => !pathname.startsWith(assetsRoot) }, ((app_configs_1.configs.devSourceMaps && app_configs_1.configs.devSourceMaps.includes('eval')) ||
|
|
17
|
+
app_configs_1.configs.devServerCors
|
|
18
|
+
? {
|
|
19
|
+
on: {
|
|
20
|
+
proxyRes: (proxyRes, req) => {
|
|
21
|
+
// Для дев режима, когда мы используем в качестве соурсмапов что-то, основанное на eval - нужно
|
|
22
|
+
// разрешить браузеру исполнять наш код, даже когда content-security-policy приложения не позволяет этого делать.
|
|
23
|
+
if (app_configs_1.configs.devSourceMaps && app_configs_1.configs.devSourceMaps.includes('eval')) {
|
|
24
|
+
const cspHeader = proxyRes.headers['content-security-policy'];
|
|
25
|
+
if (typeof cspHeader === 'string' &&
|
|
26
|
+
!cspHeader.includes('unsafe-eval')) {
|
|
27
|
+
// eslint-disable-next-line no-param-reassign
|
|
28
|
+
proxyRes.headers['content-security-policy'] = cspHeader.replace(/script-src/, "script-src 'unsafe-eval'");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// если включен devServerCors, то нужно принудительно менять статус ответа на 200, чтобы
|
|
32
|
+
// браузер не отклонял ответы с CORS
|
|
33
|
+
if (app_configs_1.configs.devServerCors && req.method === 'OPTIONS') {
|
|
34
|
+
// eslint-disable-next-line no-param-reassign
|
|
35
|
+
proxyRes.statusCode = 200;
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
},
|
|
16
39
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
? {
|
|
20
|
-
onProxyRes: (proxyRes) => {
|
|
21
|
-
// Для дев режима, когда мы используем в качестве соурсмапов что-то, основанное на eval - нужно
|
|
22
|
-
// разрешить браузеру исполнять наш код, даже когда content-security-policy приложения не позволяет этого делать.
|
|
23
|
-
if (app_configs_1.configs.devSourceMaps && app_configs_1.configs.devSourceMaps.includes('eval')) {
|
|
24
|
-
const cspHeader = proxyRes.headers['content-security-policy'];
|
|
25
|
-
if (typeof cspHeader === 'string' && !cspHeader.includes('unsafe-eval')) {
|
|
26
|
-
// eslint-disable-next-line no-param-reassign
|
|
27
|
-
proxyRes.headers['content-security-policy'] = cspHeader.replace(/script-src/, "script-src 'unsafe-eval'");
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
// если включен devServerCors, то нужно принудительно менять статус ответа на 200, чтобы
|
|
31
|
-
// браузер не отклонял ответы с CORS
|
|
32
|
-
if (app_configs_1.configs.devServerCors && proxyRes.method === 'OPTIONS') {
|
|
33
|
-
// eslint-disable-next-line no-param-reassign
|
|
34
|
-
proxyRes.statusCode = 200;
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
}
|
|
38
|
-
: {}));
|
|
40
|
+
: {}));
|
|
41
|
+
}
|
|
39
42
|
exports.devServerConfig = (0, apply_overrides_1.applyOverrides)('devServer', {
|
|
40
43
|
port: app_configs_1.configs.clientServerPort,
|
|
41
44
|
liveReload: false,
|
|
@@ -66,7 +69,7 @@ function getProxyConfig() {
|
|
|
66
69
|
const proxyConfig = [];
|
|
67
70
|
const userProxyConfig = app_configs_1.configs.proxy;
|
|
68
71
|
if (!app_configs_1.configs.clientOnly) {
|
|
69
|
-
proxyConfig.push(
|
|
72
|
+
proxyConfig.push(getServerToClientProxyConfig());
|
|
70
73
|
}
|
|
71
74
|
if (Array.isArray(userProxyConfig)) {
|
|
72
75
|
proxyConfig.unshift(...userProxyConfig);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type PluginCreator } from 'postcss';
|
|
2
2
|
type PostCssPluginName = string | PluginCreator<unknown>;
|
|
3
|
-
type PostcssPlugin = string | [string, unknown] | {
|
|
3
|
+
export type PostcssPlugin = string | [string, unknown] | {
|
|
4
4
|
name: string;
|
|
5
5
|
plugin: PluginCreator<unknown>;
|
|
6
6
|
options?: unknown;
|
|
7
|
+
} | {
|
|
8
|
+
postcssPlugin: string;
|
|
7
9
|
};
|
|
8
10
|
/**
|
|
9
11
|
* Функция для создания конфигурационного файла postcss
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export declare const postcssConfig: (string | import("postcss").Processor |
|
|
1
|
+
export declare const postcssConfig: (string | import("postcss").Processor | [string, unknown] | {
|
|
2
|
+
postcssPlugin: string;
|
|
3
|
+
})[];
|
|
4
|
+
export declare const serverPostcssConfig: (string | import("postcss").Processor | [string, unknown] | {
|
|
5
|
+
postcssPlugin: string;
|
|
6
|
+
})[];
|
package/build/configs/postcss.js
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.postcssConfig = void 0;
|
|
3
|
+
exports.serverPostcssConfig = exports.postcssConfig = void 0;
|
|
4
4
|
const apply_overrides_1 = require("./util/apply-overrides");
|
|
5
5
|
const postcss_config_1 = require("./postcss.config");
|
|
6
|
-
|
|
6
|
+
const postcssConfigWithOverrides = (0, apply_overrides_1.applyOverrides)('postcss', (0, postcss_config_1.createPostcssConfig)(postcss_config_1.postcssPlugins, postcss_config_1.postcssPluginsOptions));
|
|
7
|
+
const isResolvedPostcssPlugin = (plugin) => typeof plugin === 'object' && !Array.isArray(plugin) && 'postcssPlugin' in plugin;
|
|
8
|
+
const resolvePostcssConfig = (plugins) => plugins.map((plugin) => typeof plugin === 'string' || Array.isArray(plugin) || isResolvedPostcssPlugin(plugin)
|
|
9
|
+
? plugin
|
|
10
|
+
: plugin.plugin(plugin.options));
|
|
11
|
+
const isAutoprefixerPlugin = (plugin) => {
|
|
12
|
+
if (plugin === 'autoprefixer') {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
if (Array.isArray(plugin)) {
|
|
16
|
+
return plugin[0] === 'autoprefixer';
|
|
17
|
+
}
|
|
18
|
+
return isResolvedPostcssPlugin(plugin) && plugin.postcssPlugin === 'autoprefixer';
|
|
19
|
+
};
|
|
20
|
+
exports.postcssConfig = resolvePostcssConfig(postcssConfigWithOverrides);
|
|
21
|
+
exports.serverPostcssConfig = resolvePostcssConfig(postcssConfigWithOverrides.filter((plugin) => !isAutoprefixerPlugin(plugin)));
|
|
@@ -7,4 +7,4 @@ import { type Entry } from './util/get-entry';
|
|
|
7
7
|
* @param configName Имя конфигурации, если не указано, то используется имя по умолчанию
|
|
8
8
|
*/
|
|
9
9
|
export declare const createSingleClientWebpackConfig: (mode: "dev" | "prod", entry: Entry, configName?: string) => Configuration;
|
|
10
|
-
export declare const createClientWebpackConfig: (mode: "dev" | "prod") => import("@rspack/core").RspackOptions | import("@rspack/core").RspackOptions[];
|
|
10
|
+
export declare const createClientWebpackConfig: (mode: "dev" | "prod") => import("@rspack/core", { with: { "resolution-mode": "import" } }).RspackOptions | import("@rspack/core", { with: { "resolution-mode": "import" } }).RspackOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const config: import("@rspack/core").RspackOptions | import("@rspack/core").RspackOptions[];
|
|
1
|
+
export declare const config: import("@rspack/core", { with: { "resolution-mode": "import" } }).RspackOptions | import("@rspack/core", { with: { "resolution-mode": "import" } }).RspackOptions[];
|
|
@@ -41,7 +41,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
41
41
|
const zlib = __importStar(require("zlib"));
|
|
42
42
|
const react_refresh_typescript_1 = __importDefault(require("react-refresh-typescript"));
|
|
43
43
|
const core_1 = require("@rspack/core");
|
|
44
|
-
const plugin_react_refresh_1 =
|
|
44
|
+
const plugin_react_refresh_1 = require("@rspack/plugin-react-refresh");
|
|
45
45
|
const assets_webpack_plugin_1 = __importDefault(require("assets-webpack-plugin"));
|
|
46
46
|
const case_sensitive_paths_webpack_plugin_1 = __importDefault(require("case-sensitive-paths-webpack-plugin"));
|
|
47
47
|
const compression_webpack_plugin_1 = __importDefault(require("compression-webpack-plugin"));
|
|
@@ -168,7 +168,7 @@ const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.ass
|
|
|
168
168
|
}
|
|
169
169
|
: false, nodeEnv: mode === 'prod' ? 'production' : false,
|
|
170
170
|
// Оптимизации времени билда, см https://webpack.js.org/guides/build-performance/
|
|
171
|
-
|
|
171
|
+
removeEmptyChunks: mode !== 'dev' }), resolve: {
|
|
172
172
|
// This allows you to set a fallback for where Webpack should look for modules.
|
|
173
173
|
// We placed these paths second because we want `node_modules` to "win"
|
|
174
174
|
// if there are any conflicts. This matches Node resolution mechanism.
|
|
@@ -316,7 +316,7 @@ const createSingleClientWebpackConfig = (mode, entry, configName) => (Object.ass
|
|
|
316
316
|
rootPath: app_configs_1.configs.cwd,
|
|
317
317
|
}),
|
|
318
318
|
// dev plugins:
|
|
319
|
-
mode === 'dev' && new plugin_react_refresh_1.
|
|
319
|
+
mode === 'dev' && new plugin_react_refresh_1.ReactRefreshRspackPlugin(),
|
|
320
320
|
// Watcher doesn't work well if you mistype casing in a path so we use
|
|
321
321
|
// a plugin that prints an error when you attempt to do this.
|
|
322
322
|
// See https://github.com/facebookincubator/create-react-app/issues/240
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const webpackClientConfig: import("@rspack/core").RspackOptions | import("@rspack/core").RspackOptions[];
|
|
1
|
+
export declare const webpackClientConfig: import("@rspack/core", { with: { "resolution-mode": "import" } }).RspackOptions | import("@rspack/core", { with: { "resolution-mode": "import" } }).RspackOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const webpackServerConfig: import("@rspack/core").RspackOptions;
|
|
1
|
+
export declare const webpackServerConfig: import("@rspack/core", { with: { "resolution-mode": "import" } }).RspackOptions;
|
|
@@ -10,6 +10,7 @@ const core_1 = require("@rspack/core");
|
|
|
10
10
|
const case_sensitive_paths_webpack_plugin_1 = __importDefault(require("case-sensitive-paths-webpack-plugin"));
|
|
11
11
|
const run_script_webpack_plugin_1 = require("run-script-webpack-plugin");
|
|
12
12
|
const webpack_node_externals_1 = __importDefault(require("webpack-node-externals"));
|
|
13
|
+
const get_local_ident_1 = require("../commands/util/get-local-ident");
|
|
13
14
|
const reload_server_plugin_1 = require("../plugins/reload-server-plugin");
|
|
14
15
|
const watch_missing_node_modules_plugin_1 = require("../plugins/watch-missing-node-modules-plugin");
|
|
15
16
|
const create_watch_ignore_regex_1 = require("./util/create-watch-ignore-regex");
|
|
@@ -20,7 +21,6 @@ const babel_server_1 = require("./babel-server");
|
|
|
20
21
|
const postcss_1 = require("./postcss");
|
|
21
22
|
const server_externals_exemptions_1 = require("./server-externals-exemptions");
|
|
22
23
|
const swc_1 = require("./swc");
|
|
23
|
-
const get_local_ident_1 = require("../commands/util/get-local-ident");
|
|
24
24
|
const assetsIgnoreBanner = fs_1.default.readFileSync(require.resolve('./util/node-assets-ignore'), 'utf8');
|
|
25
25
|
const sourceMapSupportBanner = fs_1.default.readFileSync(require.resolve('./util/install-sourcemap-support'), 'utf8');
|
|
26
26
|
// style files regexes
|
|
@@ -117,7 +117,7 @@ const createServerConfig = (mode) => ({
|
|
|
117
117
|
loader: require.resolve('postcss-loader'),
|
|
118
118
|
options: {
|
|
119
119
|
postcssOptions: {
|
|
120
|
-
plugins: postcss_1.
|
|
120
|
+
plugins: postcss_1.serverPostcssConfig,
|
|
121
121
|
},
|
|
122
122
|
},
|
|
123
123
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const webpackServerConfig: import("@rspack/core").RspackOptions;
|
|
1
|
+
export declare const webpackServerConfig: import("@rspack/core", { with: { "resolution-mode": "import" } }).RspackOptions;
|
package/docs/presets.md
CHANGED
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
от папки, содержащей package.json. Так что это может быть как папка в проекте, так и пакет из node_modules).
|
|
18
18
|
|
|
19
19
|
Сам пакет с пресетами может содержать два файла:
|
|
20
|
-
- `arui-
|
|
21
|
-
- `arui-scripts.overrides.js` (или `arui-
|
|
20
|
+
- `arui-scripts.config.js` (или `arui-scripts.config.ts`)
|
|
21
|
+
- `arui-scripts.overrides.js` (или `arui-scripts.overrides.ts`)
|
|
22
22
|
|
|
23
23
|
### arui-scripts.config (js | ts)
|
|
24
24
|
С помощью этого файла можно задать любые ключи [конфигурации](settings.md).
|
package/docs/settings.md
CHANGED
|
@@ -142,7 +142,9 @@ export default settings;
|
|
|
142
142
|
Имя файла для компиляции сервера, по умолчанию `server.js`
|
|
143
143
|
|
|
144
144
|
#### clientPolyfillsEntry
|
|
145
|
-
Точка входа для полифилов. Будет подключаться до основной точки
|
|
145
|
+
Точка входа для полифилов. Будет подключаться до основной клиентской точки входа (можно передать одну строку или массив путей или не задавать, тогда отдельный бандл полифилов не добавляется).
|
|
146
|
+
|
|
147
|
+
По умолчанию ключ не задан: для многих проектов отдельный файл не нужен. Если нужны полифилы при `codeLoader: 'swc'` или Babel с `useBuiltIns: 'entry'`, обычно создают файл с `import 'core-js/stable'` и указывают путь в этом поле (пакет `core-js` должен быть в зависимостях приложения). Пример для новых проектов см. в [README](../README.md).
|
|
146
148
|
|
|
147
149
|
#### clientEntry
|
|
148
150
|
Точка входа для клиентского приложения. По умолчанию `./src/index`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arui-scripts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "22.0.0",
|
|
4
4
|
"main": "./build/index.js",
|
|
5
5
|
"typings": "./build/index.d.ts",
|
|
6
6
|
"license": "MPL-2.0",
|
|
@@ -36,12 +36,13 @@
|
|
|
36
36
|
"@babel/preset-react": "^7.23.3",
|
|
37
37
|
"@babel/preset-typescript": "^7.23.3",
|
|
38
38
|
"@babel/runtime": "^7.26.10",
|
|
39
|
+
"@module-federation/runtime-tools": "^2.0.0",
|
|
39
40
|
"@pmmmwh/react-refresh-webpack-plugin": "0.6.2",
|
|
40
|
-
"@rsdoctor/rspack-plugin": "1.5.
|
|
41
|
-
"@rspack/cli": "
|
|
42
|
-
"@rspack/core": "
|
|
43
|
-
"@rspack/dev-server": "
|
|
44
|
-
"@rspack/plugin-react-refresh": "
|
|
41
|
+
"@rsdoctor/rspack-plugin": "1.5.9",
|
|
42
|
+
"@rspack/cli": "2.0.0",
|
|
43
|
+
"@rspack/core": "2.0.0",
|
|
44
|
+
"@rspack/dev-server": "2.0.0",
|
|
45
|
+
"@rspack/plugin-react-refresh": "2.0.0",
|
|
45
46
|
"@swc/core": "1.15.1",
|
|
46
47
|
"@swc/jest": "0.2.39",
|
|
47
48
|
"assets-webpack-plugin": "7.1.1",
|
|
@@ -76,7 +77,7 @@
|
|
|
76
77
|
"mini-svg-data-uri": "^1.4.4",
|
|
77
78
|
"null-loader": "0.1.1",
|
|
78
79
|
"pnp-webpack-plugin": "1.7.0",
|
|
79
|
-
"postcss": "^8.
|
|
80
|
+
"postcss": "^8.5.10",
|
|
80
81
|
"postcss-calc": "^9.0.0",
|
|
81
82
|
"postcss-color-function": "^4.0.0",
|
|
82
83
|
"postcss-color-mod-function": "^3.0.0",
|
|
@@ -99,7 +100,7 @@
|
|
|
99
100
|
"react-refresh": "0.10.0",
|
|
100
101
|
"react-refresh-typescript": "2.0.2",
|
|
101
102
|
"rimraf": "^2.7.1",
|
|
102
|
-
"rspack-manifest-plugin": "5.
|
|
103
|
+
"rspack-manifest-plugin": "5.2.1",
|
|
103
104
|
"run-script-webpack-plugin": "0.0.11",
|
|
104
105
|
"semver": "^7.5.4",
|
|
105
106
|
"serialize-javascript": "^7.0.5",
|
|
@@ -126,7 +127,7 @@
|
|
|
126
127
|
"@types/fs-extra": "^9.0.13",
|
|
127
128
|
"@types/jest": "^29.5.14",
|
|
128
129
|
"@types/lodash.merge": "^4.6.7",
|
|
129
|
-
"@types/node": "
|
|
130
|
+
"@types/node": "^20.19.0",
|
|
130
131
|
"@types/postcss-media-query-parser": "0.2.4",
|
|
131
132
|
"@types/semver": "^7.5.0",
|
|
132
133
|
"@types/serialize-javascript": "^5.0.4",
|
|
@@ -138,11 +139,12 @@
|
|
|
138
139
|
"@types/webpack-dev-server": "4.7.2",
|
|
139
140
|
"@types/webpack-manifest-plugin": "3.0.5",
|
|
140
141
|
"@types/webpack-node-externals": "^3.0.0",
|
|
142
|
+
"babel-plugin-transform-import-meta": "^2.3.3",
|
|
141
143
|
"type-fest": "2.19.0",
|
|
142
144
|
"typescript": "6.0.2"
|
|
143
145
|
},
|
|
144
146
|
"engines": {
|
|
145
|
-
"node": ">=
|
|
147
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
146
148
|
},
|
|
147
149
|
"scripts": {
|
|
148
150
|
"build": "sh bin/build.sh",
|
|
@@ -174,7 +176,29 @@
|
|
|
174
176
|
{
|
|
175
177
|
"tsconfig": "tsconfig-local.json"
|
|
176
178
|
}
|
|
179
|
+
],
|
|
180
|
+
"/node_modules/@rspack/.+\\.(mjs|js)$": [
|
|
181
|
+
"babel-jest",
|
|
182
|
+
{
|
|
183
|
+
"presets": [
|
|
184
|
+
[
|
|
185
|
+
"@babel/preset-env",
|
|
186
|
+
{
|
|
187
|
+
"targets": {
|
|
188
|
+
"node": "20"
|
|
189
|
+
},
|
|
190
|
+
"modules": "commonjs"
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
],
|
|
194
|
+
"plugins": [
|
|
195
|
+
"babel-plugin-transform-import-meta"
|
|
196
|
+
]
|
|
197
|
+
}
|
|
177
198
|
]
|
|
178
|
-
}
|
|
199
|
+
},
|
|
200
|
+
"transformIgnorePatterns": [
|
|
201
|
+
"/node_modules/(?!@rspack/)"
|
|
202
|
+
]
|
|
179
203
|
}
|
|
180
204
|
}
|