arui-scripts 20.2.1 → 20.4.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/.eslintrc.js +3 -3
- package/.prettierignore +2 -0
- package/.turbo/turbo-test.log +7 -7
- package/CHANGELOG.md +17 -0
- package/build/commands/build/client.js +2 -0
- package/build/commands/build/index.js +0 -2
- package/build/commands/build/server.js +2 -0
- package/build/commands/start/client.js +2 -0
- package/build/commands/start/index.js +0 -2
- package/build/commands/start/server.js +2 -0
- package/build/commands/start-prod/client.js +2 -0
- package/build/commands/start-prod/index.js +0 -2
- package/build/commands/start-prod/server.js +2 -0
- package/build/commands/util/client-assets-sizes.d.ts +1 -1
- package/build/commands/util/client-assets-sizes.js +8 -6
- package/build/commands/util/format-webpack-messages.d.ts +1 -1
- package/build/commands/util/format-webpack-messages.js +2 -1
- package/build/commands/util/load-browserslist.d.ts +1 -0
- package/build/commands/util/load-browserslist.js +15 -0
- package/build/commands/util/run-client-dev-server.d.ts +1 -1
- package/build/commands/util/run-server-watch-compiler.d.ts +1 -1
- package/build/configs/app-configs/calculate-dependent-config.d.ts +1 -1
- package/build/configs/app-configs/calculate-dependent-config.js +1 -2
- package/build/configs/app-configs/get-defaults.d.ts +1 -1
- package/build/configs/app-configs/index.d.ts +1 -1
- package/build/configs/app-configs/types.d.ts +2 -2
- package/build/configs/app-configs/update-with-config-file.d.ts +1 -1
- package/build/configs/app-configs/update-with-env.d.ts +1 -1
- package/build/configs/app-configs/update-with-package.d.ts +1 -1
- package/build/configs/app-configs/update-with-presets.d.ts +1 -1
- package/build/configs/app-configs/warn-about-deprecations.d.ts +1 -1
- package/build/configs/client-env-config/client-config-plugin.d.ts +1 -1
- package/build/configs/dev-server.d.ts +1 -1
- package/build/configs/modules.d.ts +1 -1
- package/build/configs/modules.js +1 -1
- package/build/configs/postcss.config.d.ts +1 -4
- package/build/configs/postcss.config.js +0 -4
- package/build/configs/process-assets-plugin-output.d.ts +1 -1
- package/build/configs/server-externals-exemptions.js +1 -0
- package/build/configs/stats-options.d.ts +1 -1
- package/build/configs/supporting-node.d.ts +1 -0
- package/build/configs/supporting-node.js +5 -0
- package/build/configs/swc.d.ts +1 -1
- package/build/configs/util/apply-overrides.d.ts +7 -6
- package/build/configs/util/compress-with-dcb.js +1 -5
- package/build/configs/util/compression-plugins-for-dictionaries.js +3 -6
- package/build/configs/util/dcb-compression-plugin.d.ts +3 -3
- package/build/configs/util/dcb-compression-plugin.js +12 -4
- package/build/configs/util/find-loader.d.ts +1 -1
- package/build/configs/util/find-plugin.d.ts +12 -12
- package/build/configs/util/get-polyfills.d.ts +1 -1
- package/build/configs/webpack.client.d.ts +2 -2
- package/build/configs/webpack.client.js +9 -12
- package/build/configs/webpack.server.d.ts +1 -1
- package/build/plugins/arui-runtime/index.d.ts +1 -1
- package/build/plugins/arui-runtime/index.js +1 -1
- package/build/plugins/postcss-global-variables/postcss-global-variables.d.ts +1 -1
- package/build/plugins/postcss-global-variables/utils/utils.d.ts +1 -1
- package/build/plugins/postcss-prefix-selector.d.ts +1 -1
- package/build/plugins/reload-server-plugin.d.ts +1 -1
- package/build/plugins/turn-off-split-remote-entry.d.ts +1 -1
- package/build/templates/nginx.conf.template.js +3 -1
- package/build/tsconfig-local.tsbuildinfo +1 -1
- package/docs/overrides.md +2 -0
- package/package.json +6 -10
- package/tsconfig-local.json +1 -4
- package/tsconfig.json +2 -5
- package/.browserslistrc +0 -5
package/.eslintrc.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
root: true,
|
|
3
|
-
extends: ['
|
|
3
|
+
extends: [require.resolve('arui-presets-lint/eslint')],
|
|
4
4
|
parserOptions: {
|
|
5
5
|
tsconfigRootDir: __dirname,
|
|
6
6
|
project: ['./tsconfig.eslint.json'],
|
|
7
7
|
},
|
|
8
8
|
ignorePatterns: ['./src/templates/dockerfile-compiled.template.ts', '.turbo'],
|
|
9
9
|
rules: {
|
|
10
|
-
'import/no-default-export': 'warn',
|
|
11
|
-
'import/no-named-as-default': 'warn',
|
|
12
10
|
// чтобы могли использовать for и генераторы
|
|
13
11
|
'no-restricted-syntax': 'off',
|
|
14
12
|
// проект - cli-тулза, и она должна писать в консоль
|
|
15
13
|
'no-console': 'off',
|
|
14
|
+
'import/no-cycle': 'off', // TODO: 7 ошибок, возможно их можно убрать
|
|
15
|
+
'no-restricted-imports': 'off', // TODO: 5 ошибок с импортом lodash.merge. Убрать отдельным пр
|
|
16
16
|
},
|
|
17
17
|
};
|
package/.prettierignore
ADDED
package/.turbo/turbo-test.log
CHANGED
|
@@ -5,20 +5,20 @@ ts-jest[versions] (WARN) Version 29.7.0 of jest installed has not been tested wi
|
|
|
5
5
|
ts-jest[versions] (WARN) Version 5.6.3 of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=4.3.0 <5.0.0-0). Please do not report issues in ts-jest if you are using unsupported versions.
|
|
6
6
|
ts-jest[versions] (WARN) Version 5.6.3 of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=4.3.0 <5.0.0-0). Please do not report issues in ts-jest if you are using unsupported versions.
|
|
7
7
|
ts-jest[versions] (WARN) Version 5.6.3 of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=4.3.0 <5.0.0-0). Please do not report issues in ts-jest if you are using unsupported versions.
|
|
8
|
-
PASS src/plugins/postcss-global-variables/utils/__tests__/add-global-variable.tests.ts (28.
|
|
9
|
-
PASS src/configs/app-configs/__tests__/update-with-presets.tests.ts (28.
|
|
8
|
+
PASS src/plugins/postcss-global-variables/utils/__tests__/add-global-variable.tests.ts (28.528 s)
|
|
9
|
+
PASS src/configs/app-configs/__tests__/update-with-presets.tests.ts (28.322 s)
|
|
10
10
|
PASS src/configs/util/__tests__/apply-overrides.tests.ts
|
|
11
|
-
PASS src/configs/app-configs/__tests__/update-with-package.tests.ts
|
|
12
11
|
PASS src/configs/app-configs/__tests__/update-with-env.tests.ts
|
|
13
|
-
PASS src/configs/
|
|
12
|
+
PASS src/configs/app-configs/__tests__/update-with-package.tests.ts
|
|
14
13
|
PASS src/configs/util/__tests__/get-polyfills.tests.ts
|
|
15
|
-
PASS src/
|
|
14
|
+
PASS src/configs/util/__tests__/compress-with-dcb.test.ts
|
|
16
15
|
PASS src/plugins/postcss-global-variables/utils/__tests__/parse-variables.tests.ts
|
|
16
|
+
PASS src/plugins/postcss-global-variables/utils/__tests__/get-media-query-name.tests.ts
|
|
17
17
|
PASS src/configs/app-configs/__tests__/validate-settings-keys.tests.ts
|
|
18
|
-
PASS src/configs/util/__tests__/find-plugin.tests.ts (
|
|
18
|
+
PASS src/configs/util/__tests__/find-plugin.tests.ts (31.127 s)
|
|
19
19
|
|
|
20
20
|
Test Suites: 11 passed, 11 total
|
|
21
21
|
Tests: 25 passed, 25 total
|
|
22
22
|
Snapshots: 0 total
|
|
23
|
-
Time:
|
|
23
|
+
Time: 32.068 s
|
|
24
24
|
Ran all test suites.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
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
|
+
## 20.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#362](https://github.com/core-ds/arui-scripts/pull/362) [`96b1f59`](https://github.com/core-ds/arui-scripts/commit/96b1f59e152187f93d60d2c6a1fbf0ff3e5c5af3) Thanks [@TheDiamondDoge](https://github.com/TheDiamondDoge)! - Добавление пакета @alfa-bank/app-html в serverExternalsExemptions
|
|
8
|
+
|
|
9
|
+
## 20.3.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#356](https://github.com/core-ds/arui-scripts/pull/356) [`542ea5b`](https://github.com/core-ds/arui-scripts/commit/542ea5b5804f2fdce06d0544892a3ba5964b18d5) Thanks [@heymdall-legal](https://github.com/heymdall-legal)! - Исправлена работа со списком поддерживаемых браузеров. Теперь он корректно берется из настройки supportingBrowsers.
|
|
14
|
+
|
|
15
|
+
Добавлена возможность загрузки списка поддерживаемых браузеров любым из поддерживаемых [browserslist](https://github.com/browserslist/browserslist) способом.
|
|
16
|
+
|
|
17
|
+
Добавлена отдельная конфигурация для списка поддерживаемых версий nodeJs. Теперь по умолчанию он будет равняться версии, используемой сейчас для сборки.
|
|
18
|
+
Вы можете изменить это используя оверрайд `supportingNode`.
|
|
19
|
+
|
|
3
20
|
## 20.2.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -17,6 +17,8 @@ const printBuildError_1 = __importDefault(require("react-dev-utils/printBuildErr
|
|
|
17
17
|
const build_wrapper_1 = __importDefault(require("./build-wrapper"));
|
|
18
18
|
const client_assets_sizes_1 = require("../util/client-assets-sizes");
|
|
19
19
|
const webpack_client_prod_1 = require("../../configs/webpack.client.prod");
|
|
20
|
+
const load_browserslist_1 = require("../util/load-browserslist");
|
|
21
|
+
(0, load_browserslist_1.loadBrowserslist)();
|
|
20
22
|
console.log(chalk_1.default.magenta('Building client...'));
|
|
21
23
|
function main() {
|
|
22
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -4,8 +4,6 @@ const run_compilers_1 = require("../util/run-compilers");
|
|
|
4
4
|
const app_configs_1 = require("../../configs/app-configs");
|
|
5
5
|
process.env.BABEL_ENV = 'production';
|
|
6
6
|
process.env.NODE_ENV = 'production';
|
|
7
|
-
process.env.BROWSERSLIST_CONFIG =
|
|
8
|
-
process.env.BROWSERSLIST_CONFIG || require.resolve('../../../.browserslistrc');
|
|
9
7
|
const compilersCommands = [require.resolve('./client')];
|
|
10
8
|
if (!app_configs_1.configs.clientOnly) {
|
|
11
9
|
compilersCommands.push(require.resolve('./server'));
|
|
@@ -7,6 +7,8 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
7
7
|
const printBuildError_1 = __importDefault(require("react-dev-utils/printBuildError"));
|
|
8
8
|
const build_wrapper_1 = __importDefault(require("./build-wrapper"));
|
|
9
9
|
const webpack_server_prod_1 = require("../../configs/webpack.server.prod");
|
|
10
|
+
const supporting_node_1 = require("../../configs/supporting-node");
|
|
11
|
+
process.env.BROWSERSLIST = supporting_node_1.supportingNode.join(',');
|
|
10
12
|
console.log(chalk_1.default.magenta('Building server...'));
|
|
11
13
|
(0, build_wrapper_1.default)(webpack_server_prod_1.webpackServerConfig)
|
|
12
14
|
.then(({ warnings }) => {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const webpack_client_dev_1 = require("../../configs/webpack.client.dev");
|
|
4
|
+
const load_browserslist_1 = require("../util/load-browserslist");
|
|
4
5
|
const run_client_dev_server_1 = require("../util/run-client-dev-server");
|
|
6
|
+
(0, load_browserslist_1.loadBrowserslist)();
|
|
5
7
|
(0, run_client_dev_server_1.runClientDevServer)(webpack_client_dev_1.config);
|
|
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const app_configs_1 = require("../../configs/app-configs");
|
|
4
4
|
const run_compilers_1 = require("../util/run-compilers");
|
|
5
5
|
const tsc_1 = require("../util/tsc");
|
|
6
|
-
process.env.BROWSERSLIST_CONFIG =
|
|
7
|
-
process.env.BROWSERSLIST_CONFIG || require.resolve('../../../.browserslistrc');
|
|
8
6
|
const compilersCommands = [require.resolve('./client')];
|
|
9
7
|
if (!app_configs_1.configs.clientOnly) {
|
|
10
8
|
compilersCommands.push(require.resolve('./server'));
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const supporting_node_1 = require("../../configs/supporting-node");
|
|
3
4
|
const webpack_server_dev_1 = require("../../configs/webpack.server.dev");
|
|
4
5
|
const run_server_watch_compiler_1 = require("../util/run-server-watch-compiler");
|
|
6
|
+
process.env.BROWSERSLIST = supporting_node_1.supportingNode.join(',');
|
|
5
7
|
(0, run_server_watch_compiler_1.runServerWatchCompiler)(webpack_server_dev_1.webpackServerConfig);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const webpack_client_prod_1 = require("../../configs/webpack.client.prod");
|
|
4
|
+
const load_browserslist_1 = require("../util/load-browserslist");
|
|
4
5
|
const run_client_dev_server_1 = require("../util/run-client-dev-server");
|
|
6
|
+
(0, load_browserslist_1.loadBrowserslist)();
|
|
5
7
|
(0, run_client_dev_server_1.runClientDevServer)(webpack_client_prod_1.webpackClientConfig);
|
|
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const app_configs_1 = require("../../configs/app-configs");
|
|
4
4
|
const run_compilers_1 = require("../util/run-compilers");
|
|
5
5
|
const tsc_1 = require("../util/tsc");
|
|
6
|
-
process.env.BROWSERSLIST_CONFIG =
|
|
7
|
-
process.env.BROWSERSLIST_CONFIG || require.resolve('../../../.browserslistrc');
|
|
8
6
|
const compilersCommands = [require.resolve('./client')];
|
|
9
7
|
if (!app_configs_1.configs.clientOnly) {
|
|
10
8
|
compilersCommands.push(require.resolve('./server'));
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const supporting_node_1 = require("../../configs/supporting-node");
|
|
3
4
|
const webpack_server_prod_1 = require("../../configs/webpack.server.prod");
|
|
4
5
|
const run_server_watch_compiler_1 = require("../util/run-server-watch-compiler");
|
|
6
|
+
process.env.BROWSERSLIST = supporting_node_1.supportingNode.join(',');
|
|
5
7
|
(0, run_server_watch_compiler_1.runServerWatchCompiler)(webpack_server_prod_1.webpackServerConfig);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Stats } from '@rspack/core';
|
|
1
|
+
import { type Stats } from '@rspack/core';
|
|
2
2
|
export declare function printAssetsSizes(webpackStats: Stats): void;
|
|
@@ -9,12 +9,10 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
9
9
|
const filesize_1 = __importDefault(require("filesize"));
|
|
10
10
|
const app_configs_1 = require("../../configs/app-configs");
|
|
11
11
|
function removeFileNameHash(fileName) {
|
|
12
|
-
const parts = fileName
|
|
13
|
-
.replace(/\\/g, '/')
|
|
14
|
-
.split('.');
|
|
12
|
+
const parts = fileName.replace(/\\/g, '/').split('.');
|
|
15
13
|
const id = parts[0];
|
|
16
14
|
const isChunk = fileName.includes('.chunk.');
|
|
17
|
-
const extension = parts.find(p => ['js', 'css'].includes(p));
|
|
15
|
+
const extension = parts.find((p) => ['js', 'css'].includes(p));
|
|
18
16
|
return `${id}${isChunk ? '.chunk' : ''}.${extension}`;
|
|
19
17
|
}
|
|
20
18
|
function printAssetsSizes(webpackStats) {
|
|
@@ -63,7 +61,11 @@ function printAssetsSizes(webpackStats) {
|
|
|
63
61
|
totalSizes.gzipSize += gzipSize;
|
|
64
62
|
totalSizes.brSize += brSize;
|
|
65
63
|
totalSizes.dcbSize += dcbSize;
|
|
66
|
-
console.log(` ${(0, filesize_1.default)(size)} (${(0, filesize_1.default)(gzipSize)} gzip, ${(0, filesize_1.default)(brSize)} br${app_configs_1.configs.dictionaryCompression.dictionaryPath.length > 0
|
|
64
|
+
console.log(` ${(0, filesize_1.default)(size)} (${(0, filesize_1.default)(gzipSize)} gzip, ${(0, filesize_1.default)(brSize)} br${app_configs_1.configs.dictionaryCompression.dictionaryPath.length > 0
|
|
65
|
+
? `, ${(0, filesize_1.default)(dcbSize)} dcb`
|
|
66
|
+
: ''}) ${chalk_1.default.cyan(assetName)}`);
|
|
67
67
|
});
|
|
68
|
-
console.log(`${chalk_1.default.blueBright('\nTotal size:\n')} ${(0, filesize_1.default)(totalSizes.size)} (${(0, filesize_1.default)(totalSizes.gzipSize)} gzip, ${(0, filesize_1.default)(totalSizes.brSize)} br${app_configs_1.configs.dictionaryCompression.dictionaryPath.length > 0
|
|
68
|
+
console.log(`${chalk_1.default.blueBright('\nTotal size:\n')} ${(0, filesize_1.default)(totalSizes.size)} (${(0, filesize_1.default)(totalSizes.gzipSize)} gzip, ${(0, filesize_1.default)(totalSizes.brSize)} br${app_configs_1.configs.dictionaryCompression.dictionaryPath.length > 0
|
|
69
|
+
? `, ${(0, filesize_1.default)(totalSizes.dcbSize)} dcb`
|
|
70
|
+
: ''})\n`);
|
|
69
71
|
}
|
|
@@ -20,6 +20,7 @@ function isLikelyASyntaxError(message) {
|
|
|
20
20
|
}
|
|
21
21
|
// Cleans up webpack error messages.
|
|
22
22
|
function formatMessage(message) {
|
|
23
|
+
var _a;
|
|
23
24
|
let newMessage = message;
|
|
24
25
|
if (typeof newMessage !== 'string') {
|
|
25
26
|
newMessage = newMessage.message;
|
|
@@ -62,7 +63,7 @@ function formatMessage(message) {
|
|
|
62
63
|
];
|
|
63
64
|
}
|
|
64
65
|
// Add helpful message for users trying to use Sass for the first time
|
|
65
|
-
if (lines[1]
|
|
66
|
+
if ((_a = lines[1]) === null || _a === void 0 ? void 0 : _a.match(/Cannot find module.+node-sass/)) {
|
|
66
67
|
lines[1] = 'To import Sass files, you first need to install node-sass.\n';
|
|
67
68
|
lines[1] += 'Run `npm install node-sass` or `yarn add node-sass` inside your workspace.';
|
|
68
69
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function loadBrowserslist(): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadBrowserslist = loadBrowserslist;
|
|
4
|
+
// это peer зависимость кучи других пакетов. Не будем добавлять её себе в прямые чтобы не ломать дерево
|
|
5
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
6
|
+
const browserslist_1 = require("browserslist");
|
|
7
|
+
const app_configs_1 = require("../../configs/app-configs");
|
|
8
|
+
const supporting_browsers_1 = require("../../configs/supporting-browsers");
|
|
9
|
+
function loadBrowserslist() {
|
|
10
|
+
if ((0, browserslist_1.loadConfig)({ path: app_configs_1.configs.cwd })) {
|
|
11
|
+
// если проект уже как то определяет список поддерживаемых браузеров - не делаем ничего
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
process.env.BROWSERSLIST = process.env.BROWSERSLIST || supporting_browsers_1.supportingBrowsers.join(',');
|
|
15
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Configuration } from '@rspack/core';
|
|
1
|
+
import { type Configuration } from '@rspack/core';
|
|
2
2
|
export declare function runClientDevServer(configuration: Configuration | Configuration[]): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Configuration } from '@rspack/core';
|
|
1
|
+
import { type Configuration } from '@rspack/core';
|
|
2
2
|
export declare function runServerWatchCompiler(config: Configuration): void;
|
|
@@ -34,8 +34,7 @@ function calculateDependentContext(config, context) {
|
|
|
34
34
|
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
|
35
35
|
babelRuntimeVersion = require('@babel/runtime/package.json').version;
|
|
36
36
|
}
|
|
37
|
-
const allDictionaryPath = config.dictionaryCompression.dictionaryPath
|
|
38
|
-
.map((p) => {
|
|
37
|
+
const allDictionaryPath = config.dictionaryCompression.dictionaryPath.map((p) => {
|
|
39
38
|
if (!path_1.default.isAbsolute(p)) {
|
|
40
39
|
return path_1.default.join(process.cwd(), p);
|
|
41
40
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppConfigs, AppContext } from './types';
|
|
1
|
+
import { type AppConfigs, type AppContext } from './types';
|
|
2
2
|
export declare const nginxConfigFileName = "nginx.conf";
|
|
3
3
|
export declare const baseNginxConfigFileName = "base-nginx.conf";
|
|
4
4
|
export declare function getDefaultAppConfig(): AppConfigs;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppConfigs, AppContext, AppContextWithConfigs } from './types';
|
|
1
|
+
import { type AppConfigs, type AppContext, type AppContextWithConfigs } from './types';
|
|
2
2
|
import '../util/register-ts-node';
|
|
3
3
|
export declare const appContext: AppContext;
|
|
4
4
|
export declare const appConfigs: AppConfigs;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DevTool, Shared } from '@rspack/core';
|
|
2
|
-
import { RspackDevServer } from '@rspack/dev-server';
|
|
1
|
+
import { type DevTool, type Shared } from '@rspack/core';
|
|
2
|
+
import { type RspackDevServer } from '@rspack/dev-server';
|
|
3
3
|
/**
|
|
4
4
|
* Конфигурация arui-scripts, которая может быть переопределена приложением
|
|
5
5
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AppConfigs, AppContext } from './types';
|
|
1
|
+
import { type AppConfigs, type AppContext } from './types';
|
|
2
2
|
export declare function updateWithConfigFile(config: AppConfigs, context: AppContext): any;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AppConfigs } from './types';
|
|
1
|
+
import { type AppConfigs } from './types';
|
|
2
2
|
export declare function updateWithEnv(config: AppConfigs): any;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AppConfigs, AppContext } from './types';
|
|
1
|
+
import { type AppConfigs, type AppContext } from './types';
|
|
2
2
|
export declare function updateWithPackage(config: AppConfigs, context: AppContext): any;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AppConfigs, AppContext } from './types';
|
|
1
|
+
import { type AppConfigs, type AppContext } from './types';
|
|
2
2
|
export declare function updateWithPresets(config: AppConfigs, context: AppContext): AppConfigs;
|
|
3
3
|
export declare function getPresetsConfigPath(config: AppConfigs, cwd: string): string | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AppContextWithConfigs } from './types';
|
|
1
|
+
import { type AppContextWithConfigs } from './types';
|
|
2
2
|
export declare function warnAboutDeprecations(config: AppContextWithConfigs): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Configuration } from '@rspack/dev-server';
|
|
1
|
+
import { type Configuration } from '@rspack/dev-server';
|
|
2
2
|
export declare const devServerConfig: Configuration;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as rspack from '@rspack/core';
|
|
2
|
-
import { CompatModuleConfig } from './app-configs/types';
|
|
2
|
+
import { type CompatModuleConfig } from './app-configs/types';
|
|
3
3
|
export declare function haveExposedDefaultModules(): Record<string, string> | undefined;
|
|
4
4
|
export declare const MODULES_ENTRY_NAME = "remoteEntry.js";
|
|
5
5
|
export declare function patchMainWebpackConfigForModules(webpackConf: rspack.Configuration): rspack.RspackOptions;
|
package/build/configs/modules.js
CHANGED
|
@@ -112,7 +112,7 @@ function addCssPrefix(webpackConf, cssPrefix) {
|
|
|
112
112
|
addPrefixCssRule(cssModulesRule, `:global(${cssPrefix})`);
|
|
113
113
|
}
|
|
114
114
|
function addPrefixCssRule(rule, prefix) {
|
|
115
|
-
if (!rule ||
|
|
115
|
+
if (!(rule === null || rule === void 0 ? void 0 : rule.use) || !Array.isArray(rule.use)) {
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
118
|
const postCssLoader = rule.use.find((loaderConfig) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type PluginCreator } from 'postcss';
|
|
2
2
|
type PostCssPluginName = string | PluginCreator<unknown>;
|
|
3
3
|
type PostcssPlugin = string | [string, unknown] | {
|
|
4
4
|
name: string;
|
|
@@ -29,8 +29,5 @@ export declare const postcssPluginsOptions: {
|
|
|
29
29
|
'postcss-custom-properties': {
|
|
30
30
|
preserve: boolean;
|
|
31
31
|
};
|
|
32
|
-
autoprefixer: {
|
|
33
|
-
overrideBrowserslist: string[];
|
|
34
|
-
};
|
|
35
32
|
};
|
|
36
33
|
export {};
|
|
@@ -8,7 +8,6 @@ exports.createPostcssConfig = createPostcssConfig;
|
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const postcss_global_variables_1 = require("../plugins/postcss-global-variables/postcss-global-variables");
|
|
10
10
|
const app_configs_1 = require("./app-configs");
|
|
11
|
-
const supporting_browsers_1 = require("./supporting-browsers");
|
|
12
11
|
/**
|
|
13
12
|
* Функция для создания конфигурационного файла postcss
|
|
14
13
|
* @param {PostCssPluginName[]} plugins список плагинов
|
|
@@ -63,7 +62,4 @@ exports.postcssPluginsOptions = {
|
|
|
63
62
|
'postcss-custom-properties': {
|
|
64
63
|
preserve: false,
|
|
65
64
|
},
|
|
66
|
-
autoprefixer: {
|
|
67
|
-
overrideBrowserslist: supporting_browsers_1.supportingBrowsers,
|
|
68
|
-
},
|
|
69
65
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Assets } from 'assets-webpack-plugin';
|
|
1
|
+
import { type Assets } from 'assets-webpack-plugin';
|
|
2
2
|
export declare function processAssetsPluginOutput(assets: Assets): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type RspackOptionsNormalized } from '@rspack/core';
|
|
2
2
|
export declare const statsOptions: RspackOptionsNormalized['stats'];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const supportingNode: string[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.supportingNode = void 0;
|
|
4
|
+
const apply_overrides_1 = require("./util/apply-overrides");
|
|
5
|
+
exports.supportingNode = (0, apply_overrides_1.applyOverrides)(['supportingNode'], ['current node']);
|
package/build/configs/swc.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type * as rspack from '@rspack/core';
|
|
2
|
-
import type
|
|
3
|
-
import type
|
|
4
|
-
import { AppContextWithConfigs } from '../app-configs/types';
|
|
5
|
-
import { createSingleClientWebpackConfig } from '../webpack.client';
|
|
6
|
-
import { findLoader } from './find-loader';
|
|
7
|
-
import { findPlugin } from './find-plugin';
|
|
2
|
+
import { type Configuration as RspackDevServerConfiguration } from '@rspack/dev-server';
|
|
3
|
+
import { type Options as SwcOptions } from '@swc/core';
|
|
4
|
+
import { type AppContextWithConfigs } from '../app-configs/types';
|
|
5
|
+
import { type createSingleClientWebpackConfig } from '../webpack.client';
|
|
6
|
+
import { type findLoader } from './find-loader';
|
|
7
|
+
import { type findPlugin } from './find-plugin';
|
|
8
8
|
type Overrides = {
|
|
9
9
|
webpack: rspack.Configuration | rspack.Configuration[];
|
|
10
10
|
webpackClient: rspack.Configuration | rspack.Configuration[];
|
|
@@ -28,6 +28,7 @@ type Overrides = {
|
|
|
28
28
|
postcss: any[];
|
|
29
29
|
browsers: string[];
|
|
30
30
|
supportingBrowsers: string[];
|
|
31
|
+
supportingNode: string[];
|
|
31
32
|
Dockerfile: string;
|
|
32
33
|
DockerfileCompiled: string;
|
|
33
34
|
nginx: string;
|
|
@@ -23,10 +23,6 @@ function compressWithDcb(inputFile, dictionaryData) {
|
|
|
23
23
|
const compressedData = yield (0, brotli_dict_1.compress)(inputFile, {
|
|
24
24
|
dictionary: dictionaryData,
|
|
25
25
|
});
|
|
26
|
-
return buffer_1.Buffer.concat([
|
|
27
|
-
magicNumberHeader,
|
|
28
|
-
dictionaryHash,
|
|
29
|
-
buffer_1.Buffer.from(compressedData),
|
|
30
|
-
]);
|
|
26
|
+
return buffer_1.Buffer.concat([magicNumberHeader, dictionaryHash, buffer_1.Buffer.from(compressedData)]);
|
|
31
27
|
});
|
|
32
28
|
}
|
|
@@ -34,7 +34,7 @@ function compressionPluginsForDictionaries() {
|
|
|
34
34
|
const dictionaries = fs_1.default.readdirSync(dictionaryPath);
|
|
35
35
|
const parsedDictionaries = dictionaries.reduce((map, current) => {
|
|
36
36
|
const parsed = parseFilename(current);
|
|
37
|
-
return
|
|
37
|
+
return Object.assign(Object.assign({}, map), { [`${parsed.stableName}.${parsed.ext}`]: parsed });
|
|
38
38
|
}, {});
|
|
39
39
|
return new dcb_compression_plugin_1.CustomCompressionPlugin({
|
|
40
40
|
test: /\.js$|\.css$/,
|
|
@@ -61,13 +61,10 @@ function compressionPluginsForDictionaries() {
|
|
|
61
61
|
catch (e) {
|
|
62
62
|
return input;
|
|
63
63
|
}
|
|
64
|
-
})
|
|
64
|
+
}),
|
|
65
65
|
});
|
|
66
66
|
});
|
|
67
|
-
return [
|
|
68
|
-
...predefinedPlugins,
|
|
69
|
-
...prevVersionPlugins,
|
|
70
|
-
];
|
|
67
|
+
return [...predefinedPlugins, ...prevVersionPlugins];
|
|
71
68
|
}
|
|
72
69
|
function parseFilename(filename) {
|
|
73
70
|
const parsedName = path_1.default.parse(filename);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Assets, Compilation, Compiler } from '@rspack/core';
|
|
2
|
-
import { PathData } from '@rspack/core/dist/Compilation';
|
|
3
|
-
import { Rules } from 'compression-webpack-plugin';
|
|
1
|
+
import { type Assets, type Compilation, type Compiler } from '@rspack/core';
|
|
2
|
+
import { type PathData } from '@rspack/core/dist/Compilation';
|
|
3
|
+
import { type Rules } from 'compression-webpack-plugin';
|
|
4
4
|
type DcbCompressionOptions = {
|
|
5
5
|
test?: Rules;
|
|
6
6
|
include?: Rules;
|
|
@@ -42,7 +42,8 @@ class CustomCompressionPlugin {
|
|
|
42
42
|
.createHash('md5')
|
|
43
43
|
.update((0, serialize_javascript_1.default)(this.options.filename))
|
|
44
44
|
.digest('hex')}`;
|
|
45
|
-
if (asset.info.related &&
|
|
45
|
+
if (asset.info.related &&
|
|
46
|
+
asset.info.related[relatedName]) {
|
|
46
47
|
return false;
|
|
47
48
|
}
|
|
48
49
|
const cacheItem = cache.getItemCache((0, serialize_javascript_1.default)({
|
|
@@ -69,7 +70,15 @@ class CustomCompressionPlugin {
|
|
|
69
70
|
return false;
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
|
-
return {
|
|
73
|
+
return {
|
|
74
|
+
name,
|
|
75
|
+
source: asset.source,
|
|
76
|
+
info: asset.info,
|
|
77
|
+
buffer,
|
|
78
|
+
output,
|
|
79
|
+
cacheItem,
|
|
80
|
+
relatedName,
|
|
81
|
+
};
|
|
73
82
|
})))).filter(Boolean);
|
|
74
83
|
const { RawSource } = compiler.webpack.sources;
|
|
75
84
|
const scheduledTasks = [];
|
|
@@ -89,8 +98,7 @@ class CustomCompressionPlugin {
|
|
|
89
98
|
return;
|
|
90
99
|
}
|
|
91
100
|
}
|
|
92
|
-
if (output.compressed.length / buffer.length >
|
|
93
|
-
this.options.minRatio) {
|
|
101
|
+
if (output.compressed.length / buffer.length > this.options.minRatio) {
|
|
94
102
|
yield cacheItem.storePromise({ compressed: output.compressed });
|
|
95
103
|
return;
|
|
96
104
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Configuration, type RuleSetRule } from '@rspack/core';
|
|
2
2
|
export declare function findLoader(config: Configuration, testRule: string): RuleSetRule | undefined;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Worker } from 'cluster';
|
|
2
|
-
import { ReactRefreshPluginOptions } from '@pmmmwh/react-refresh-webpack-plugin/types/lib/types';
|
|
3
|
-
import { type
|
|
4
|
-
import { BannerPluginOptions } from '@rspack/core/dist/builtin-plugin/BannerPlugin';
|
|
5
|
-
import AssetsPlugin from 'assets-webpack-plugin';
|
|
6
|
-
import CaseSensitivePathsPlugin from 'case-sensitive-paths-webpack-plugin';
|
|
7
|
-
import CompressionPlugin from 'compression-webpack-plugin';
|
|
8
|
-
import { ForkTsCheckerWebpackPluginOptions } from 'fork-ts-checker-webpack-plugin/lib/ForkTsCheckerWebpackPluginOptions';
|
|
9
|
-
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
10
|
-
import { RunScriptWebpackPlugin } from 'run-script-webpack-plugin';
|
|
11
|
-
import { WebpackDeduplicationPlugin } from 'webpack-deduplication-plugin';
|
|
12
|
-
import { WebpackManifestPlugin } from 'webpack-manifest-plugin';
|
|
1
|
+
import { type Worker } from 'cluster';
|
|
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';
|
|
5
|
+
import type AssetsPlugin from 'assets-webpack-plugin';
|
|
6
|
+
import type CaseSensitivePathsPlugin from 'case-sensitive-paths-webpack-plugin';
|
|
7
|
+
import type CompressionPlugin from 'compression-webpack-plugin';
|
|
8
|
+
import { type ForkTsCheckerWebpackPluginOptions } from 'fork-ts-checker-webpack-plugin/lib/ForkTsCheckerWebpackPluginOptions';
|
|
9
|
+
import type MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
10
|
+
import { type RunScriptWebpackPlugin } from 'run-script-webpack-plugin';
|
|
11
|
+
import { type WebpackDeduplicationPlugin } from 'webpack-deduplication-plugin';
|
|
12
|
+
import { type WebpackManifestPlugin } from 'webpack-manifest-plugin';
|
|
13
13
|
type PluginsListClient = {
|
|
14
14
|
AssetsWebpackPlugin: {
|
|
15
15
|
options: AssetsPlugin.Options;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AppConfigs } from '../app-configs/types';
|
|
1
|
+
import { type AppConfigs } from '../app-configs/types';
|
|
2
2
|
export declare function getPolyfills(config: AppConfigs): string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Configuration } from '@rspack/core';
|
|
2
|
-
import { Entry } from './util/get-entry';
|
|
1
|
+
import { type Configuration } from '@rspack/core';
|
|
2
|
+
import { type Entry } from './util/get-entry';
|
|
3
3
|
/**
|
|
4
4
|
* Создает конфигурацию для сборки клиентского кода. Может быть использована для создания дополнительных конфигураций.
|
|
5
5
|
* @param mode Режим сборки (dev или prod)
|