arui-scripts 19.0.1 → 19.0.3
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 +5 -5
- package/CHANGELOG.md +12 -0
- package/build/configs/modules.js +17 -14
- package/build/configs/webpack.server.js +17 -4
- package/build/plugins/turn-off-split-remote-entry.d.ts +11 -0
- package/build/plugins/turn-off-split-remote-entry.js +71 -0
- package/build/tsconfig-local.tsbuildinfo +1 -1
- package/package.json +1 -1
package/.turbo/turbo-test.log
CHANGED
|
@@ -5,19 +5,19 @@ 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/configs/app-configs/__tests__/update-with-presets.tests.ts (
|
|
9
|
-
PASS src/plugins/postcss-global-variables/utils/__tests__/add-global-variable.tests.ts (26.871 s)
|
|
8
|
+
PASS src/configs/app-configs/__tests__/update-with-presets.tests.ts (27.328 s)
|
|
10
9
|
PASS src/configs/util/__tests__/get-polyfills.tests.ts
|
|
11
|
-
PASS src/
|
|
10
|
+
PASS src/plugins/postcss-global-variables/utils/__tests__/add-global-variable.tests.ts (27.271 s)
|
|
12
11
|
PASS src/configs/util/__tests__/apply-overrides.tests.ts
|
|
12
|
+
PASS src/configs/app-configs/__tests__/update-with-env.tests.ts
|
|
13
13
|
PASS src/configs/app-configs/__tests__/update-with-package.tests.ts
|
|
14
14
|
PASS src/plugins/postcss-global-variables/utils/__tests__/parse-variables.tests.ts
|
|
15
15
|
PASS src/configs/app-configs/__tests__/validate-settings-keys.tests.ts
|
|
16
16
|
PASS src/plugins/postcss-global-variables/utils/__tests__/get-media-query-name.tests.ts
|
|
17
|
-
PASS src/configs/util/__tests__/find-plugin.tests.ts (
|
|
17
|
+
PASS src/configs/util/__tests__/find-plugin.tests.ts (30.299 s)
|
|
18
18
|
|
|
19
19
|
Test Suites: 10 passed, 10 total
|
|
20
20
|
Tests: 26 passed, 26 total
|
|
21
21
|
Snapshots: 0 total
|
|
22
|
-
Time:
|
|
22
|
+
Time: 31.278 s
|
|
23
23
|
Ran all test suites.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
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
|
+
## 19.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#306](https://github.com/core-ds/arui-scripts/pull/306) [`9c9b71d`](https://github.com/core-ds/arui-scripts/commit/9c9b71dcda22b2c391838094da680a6a3214a005) Thanks [@heymdall-legal](https://github.com/heymdall-legal)! - Исправлена загрузка картинок подключенных на сервере
|
|
8
|
+
|
|
9
|
+
## 19.0.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#304](https://github.com/core-ds/arui-scripts/pull/304) [`f97f2ba`](https://github.com/core-ds/arui-scripts/commit/f97f2ba9fd22473e2a3725dfc3699c6b0577ed15) Thanks [@heymdall-legal](https://github.com/heymdall-legal)! - Исправлена проблема с загрузкой WMF модулей в prod сборке
|
|
14
|
+
|
|
3
15
|
## 19.0.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/build/configs/modules.js
CHANGED
|
@@ -22,9 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
26
|
exports.MODULES_ENTRY_NAME = void 0;
|
|
30
27
|
exports.haveExposedDefaultModules = haveExposedDefaultModules;
|
|
@@ -36,32 +33,38 @@ exports.patchWebpackConfigForCompat = patchWebpackConfigForCompat;
|
|
|
36
33
|
/* eslint-disable no-param-reassign */
|
|
37
34
|
const rspack = __importStar(require("@rspack/core"));
|
|
38
35
|
const postcss_prefix_selector_1 = require("../plugins/postcss-prefix-selector");
|
|
36
|
+
const turn_off_split_remote_entry_1 = require("../plugins/turn-off-split-remote-entry");
|
|
39
37
|
const find_loader_1 = require("./util/find-loader");
|
|
40
|
-
const app_configs_1 =
|
|
38
|
+
const app_configs_1 = require("./app-configs");
|
|
41
39
|
function haveExposedDefaultModules() {
|
|
42
40
|
var _a;
|
|
43
|
-
return (_a = app_configs_1.
|
|
41
|
+
return (_a = app_configs_1.configs.modules) === null || _a === void 0 ? void 0 : _a.exposes;
|
|
44
42
|
}
|
|
45
43
|
exports.MODULES_ENTRY_NAME = 'remoteEntry.js';
|
|
46
44
|
function patchMainWebpackConfigForModules(webpackConf) {
|
|
45
|
+
var _a;
|
|
46
|
+
if (!((_a = webpackConf.module) === null || _a === void 0 ? void 0 : _a.rules) || !webpackConf.plugins) {
|
|
47
|
+
// делаем TS счастливым, на самом деле module и plugins у нас будут всегда
|
|
48
|
+
return webpackConf;
|
|
49
|
+
}
|
|
47
50
|
// Добавляем expose loader для библиотек, которые мы хотим вынести в глобальную область видимости
|
|
48
51
|
webpackConf.module.rules.unshift(...getExposeLoadersFormCompatModules());
|
|
49
|
-
if (!app_configs_1.
|
|
52
|
+
if (!app_configs_1.configs.modules || !webpackConf.output || !webpackConf.plugins) {
|
|
50
53
|
return webpackConf;
|
|
51
54
|
}
|
|
52
|
-
const { cssPrefix } = app_configs_1.
|
|
55
|
+
const { cssPrefix } = app_configs_1.configs.modules.options || {};
|
|
53
56
|
if (cssPrefix) {
|
|
54
57
|
addCssPrefix(webpackConf, cssPrefix);
|
|
55
58
|
}
|
|
56
59
|
webpackConf.output.publicPath = haveExposedDefaultModules()
|
|
57
60
|
? 'auto' // Для того чтобы модули могли подключаться из разных мест, нам необходимо использовать auto. Для корректной работы в IE надо подключaть https://github.com/amiller-gh/currentScript-polyfill
|
|
58
|
-
: app_configs_1.
|
|
61
|
+
: app_configs_1.configs.publicPath;
|
|
59
62
|
webpackConf.plugins.push(new rspack.container.ModuleFederationPlugin({
|
|
60
|
-
name: app_configs_1.
|
|
61
|
-
filename: app_configs_1.
|
|
62
|
-
shared: app_configs_1.
|
|
63
|
-
exposes: app_configs_1.
|
|
64
|
-
}));
|
|
63
|
+
name: app_configs_1.configs.modules.name || app_configs_1.configs.normalizedName,
|
|
64
|
+
filename: app_configs_1.configs.modules.exposes ? exports.MODULES_ENTRY_NAME : undefined,
|
|
65
|
+
shared: app_configs_1.configs.modules.shared,
|
|
66
|
+
exposes: app_configs_1.configs.modules.exposes,
|
|
67
|
+
}), new turn_off_split_remote_entry_1.TurnOffSplitRemoteEntry(app_configs_1.configs.modules.name || app_configs_1.configs.normalizedName));
|
|
65
68
|
return webpackConf;
|
|
66
69
|
}
|
|
67
70
|
function getCssPrefixForModule(module) {
|
|
@@ -75,7 +78,7 @@ function getCssPrefixForModule(module) {
|
|
|
75
78
|
}
|
|
76
79
|
function getExposeLoadersFormCompatModules() {
|
|
77
80
|
var _a;
|
|
78
|
-
const shared = (_a = app_configs_1.
|
|
81
|
+
const shared = (_a = app_configs_1.configs.compatModules) === null || _a === void 0 ? void 0 : _a.shared;
|
|
79
82
|
if (!shared) {
|
|
80
83
|
return [];
|
|
81
84
|
}
|
|
@@ -11,6 +11,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
11
11
|
const getCSSModuleLocalIdent_1 = __importDefault(require("react-dev-utils/getCSSModuleLocalIdent"));
|
|
12
12
|
const core_1 = require("@rspack/core");
|
|
13
13
|
const case_sensitive_paths_webpack_plugin_1 = __importDefault(require("case-sensitive-paths-webpack-plugin"));
|
|
14
|
+
const mini_svg_data_uri_1 = __importDefault(require("mini-svg-data-uri"));
|
|
14
15
|
const run_script_webpack_plugin_1 = require("run-script-webpack-plugin");
|
|
15
16
|
const webpack_node_externals_1 = __importDefault(require("webpack-node-externals"));
|
|
16
17
|
const reload_server_plugin_1 = require("../plugins/reload-server-plugin");
|
|
@@ -47,7 +48,7 @@ const createServerConfig = (mode) => ({
|
|
|
47
48
|
entry: (0, get_entry_1.default)(app_configs_1.default.serverEntry, getSingleEntry, mode),
|
|
48
49
|
context: app_configs_1.default.cwd,
|
|
49
50
|
output: {
|
|
50
|
-
assetModuleFilename:
|
|
51
|
+
assetModuleFilename: `${app_configs_1.default.assetsPath}/static/media/[name].[hash:8][ext]`,
|
|
51
52
|
// Add /* filename */ comments to generated require()s in the output.
|
|
52
53
|
pathinfo: true,
|
|
53
54
|
path: app_configs_1.default.serverOutputPath,
|
|
@@ -125,11 +126,23 @@ const createServerConfig = (mode) => ({
|
|
|
125
126
|
],
|
|
126
127
|
},
|
|
127
128
|
{
|
|
128
|
-
|
|
129
|
+
test: /\.svg/,
|
|
130
|
+
type: 'asset',
|
|
131
|
+
generator: {
|
|
132
|
+
dataUrl: (file) => (0, mini_svg_data_uri_1.default)(file.content.toString()),
|
|
133
|
+
publicPath: ''
|
|
134
|
+
},
|
|
135
|
+
parser: {
|
|
136
|
+
dataUrlCondition: {
|
|
137
|
+
maxSize: app_configs_1.default.dataUrlMaxSize,
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
exclude: [/\.(js|jsx|mjs|ts|tsx)$/, /\.(html|ejs)$/, /\.json$/, /\.svg$/],
|
|
129
143
|
type: 'asset/resource',
|
|
130
144
|
generator: {
|
|
131
|
-
|
|
132
|
-
publicPath: app_configs_1.default.publicPath,
|
|
145
|
+
publicPath: ''
|
|
133
146
|
},
|
|
134
147
|
},
|
|
135
148
|
].filter(Boolean),
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Compiler, RspackPluginInstance } from '@rspack/core';
|
|
2
|
+
/**
|
|
3
|
+
* Force remote entry not be affected by user's chunkSplit strategy,
|
|
4
|
+
* Otherwise, the remote chunk will not be loaded correctly.
|
|
5
|
+
* @see https://github.com/web-infra-dev/rsbuild/discussions/1461#discussioncomment-8329790
|
|
6
|
+
*/
|
|
7
|
+
export declare class TurnOffSplitRemoteEntry implements RspackPluginInstance {
|
|
8
|
+
name: string;
|
|
9
|
+
constructor(wmfContainerName: string);
|
|
10
|
+
apply(compiler: Compiler): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TurnOffSplitRemoteEntry = void 0;
|
|
4
|
+
const util_1 = require("util");
|
|
5
|
+
/**
|
|
6
|
+
* Force remote entry not be affected by user's chunkSplit strategy,
|
|
7
|
+
* Otherwise, the remote chunk will not be loaded correctly.
|
|
8
|
+
* @see https://github.com/web-infra-dev/rsbuild/discussions/1461#discussioncomment-8329790
|
|
9
|
+
*/
|
|
10
|
+
class TurnOffSplitRemoteEntry {
|
|
11
|
+
constructor(wmfContainerName) {
|
|
12
|
+
this.name = wmfContainerName;
|
|
13
|
+
}
|
|
14
|
+
apply(compiler) {
|
|
15
|
+
const { splitChunks } = compiler.options.optimization;
|
|
16
|
+
if (!splitChunks) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
/* eslint-disable no-param-reassign */
|
|
20
|
+
const applyPatch = (cacheGroup) => {
|
|
21
|
+
if (typeof cacheGroup !== 'object' || util_1.types.isRegExp(cacheGroup)) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
// cacheGroup.chunks will inherit splitChunks.chunks
|
|
25
|
+
// so we only need to modify the chunks that are set separately.
|
|
26
|
+
const { chunks } = cacheGroup;
|
|
27
|
+
if (!chunks || chunks === 'async') {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (typeof chunks === 'function') {
|
|
31
|
+
const prevChunks = chunks;
|
|
32
|
+
cacheGroup.chunks = (chunk) => {
|
|
33
|
+
if (chunk.name && chunk.name === this.name) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
return prevChunks(chunk);
|
|
37
|
+
};
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (chunks === 'all') {
|
|
41
|
+
cacheGroup.chunks = (chunk) => {
|
|
42
|
+
if (chunk.name && chunk.name === this.name) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
};
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (chunks === 'initial') {
|
|
50
|
+
cacheGroup.chunks = (chunk) => {
|
|
51
|
+
if (chunk.name && chunk.name === this.name) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
return chunk.isOnlyInitial();
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
/* eslint-enable no-param-reassign */
|
|
59
|
+
// patch splitChunk.chunks
|
|
60
|
+
applyPatch(splitChunks);
|
|
61
|
+
const { cacheGroups } = splitChunks;
|
|
62
|
+
if (!cacheGroups) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
// patch splitChunk.cacheGroups[key].chunks
|
|
66
|
+
for (const cacheGroupKey of Object.keys(cacheGroups)) {
|
|
67
|
+
applyPatch(cacheGroups[cacheGroupKey]);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.TurnOffSplitRemoteEntry = TurnOffSplitRemoteEntry;
|