arui-scripts 23.0.0 → 23.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.
@@ -1,22 +1,23 @@
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/plugins/postcss-global-variables/utils/__tests__/add-global-variable.tests.ts (23.435 s)
5
- PASS src/configs/app-configs/__tests__/update-with-presets.tests.ts (23.475 s)
4
+ PASS src/configs/app-configs/__tests__/update-with-presets.tests.ts (24.258 s)
6
5
  PASS src/configs/util/__tests__/create-watch-ignore-regex.tests.ts
7
6
  PASS src/configs/util/__tests__/apply-overrides.tests.ts
8
7
  PASS src/configs/app-configs/__tests__/update-with-env.tests.ts
8
+ PASS src/plugins/postcss-global-variables/utils/__tests__/add-global-variable.tests.ts (25.02 s)
9
9
  PASS src/configs/app-configs/__tests__/update-with-package.tests.ts
10
+ PASS src/configs/util/__tests__/compress-with-dcb.test.ts
10
11
  PASS src/configs/util/__tests__/get-polyfills.tests.ts
11
12
  PASS src/plugins/postcss-global-variables/utils/__tests__/parse-variables.tests.ts
12
- PASS src/configs/util/__tests__/compress-with-dcb.test.ts
13
13
  PASS src/plugins/postcss-global-variables/utils/__tests__/get-media-query-name.tests.ts
14
14
  PASS src/configs/app-configs/__tests__/validate-settings-keys.tests.ts
15
- PASS src/configs/util/__tests__/find-plugin.tests.ts (33.335 s)
15
+ PASS src/configs/__tests__/webpack-client-modules.tests.ts (15.294 s)
16
+ PASS src/configs/util/__tests__/find-plugin.tests.ts (41.04 s)
16
17
  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.
17
18
 
18
- Test Suites: 12 passed, 12 total
19
- Tests: 30 passed, 30 total
19
+ Test Suites: 13 passed, 13 total
20
+ Tests: 31 passed, 31 total
20
21
  Snapshots: 0 total
21
- Time: 35.323 s
22
+ Time: 42.937 s
22
23
  Ran all test suites.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # arui-scripts
2
2
 
3
+ ## 23.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#513](https://github.com/core-ds/arui-scripts/pull/513) [`fb3dcef`](https://github.com/core-ds/arui-scripts/commit/fb3dcef62e38e71da665175d2aef42fa00b95040) Thanks [@evK608](https://github.com/evK608)! - Исправление конфликта runtime-чанков между основной сборкой и отдельной WMF-сборкой при использовании modules.options.useSeparateBuild
8
+
3
9
  ## 23.0.0
4
10
 
5
11
  ### Major Changes
@@ -2,6 +2,7 @@ import * as rspack from '@rspack/core';
2
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
+ export declare const MODULES_SEPARATE_BUILD_NAME = "wmf";
5
6
  export declare function patchMainWebpackConfigForModules(webpackConf: rspack.Configuration, mode: 'consumer' | 'provider' | 'both'): rspack.RspackOptions;
6
7
  export declare function getCssPrefixForModule(module: CompatModuleConfig): string | undefined;
7
8
  export declare function getExposeLoadersFormCompatModules(): {
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.MODULES_ENTRY_NAME = void 0;
36
+ exports.MODULES_SEPARATE_BUILD_NAME = exports.MODULES_ENTRY_NAME = void 0;
37
37
  exports.haveExposedDefaultModules = haveExposedDefaultModules;
38
38
  exports.patchMainWebpackConfigForModules = patchMainWebpackConfigForModules;
39
39
  exports.getCssPrefixForModule = getCssPrefixForModule;
@@ -49,6 +49,14 @@ function haveExposedDefaultModules() {
49
49
  return (_a = app_configs_1.configs.modules) === null || _a === void 0 ? void 0 : _a.exposes;
50
50
  }
51
51
  exports.MODULES_ENTRY_NAME = 'remoteEntry.js';
52
+ exports.MODULES_SEPARATE_BUILD_NAME = 'wmf';
53
+ function getModuleFederationContainerName() {
54
+ var _a;
55
+ return ((_a = app_configs_1.configs.modules) === null || _a === void 0 ? void 0 : _a.name) || app_configs_1.configs.normalizedName;
56
+ }
57
+ function getSeparateBuildRuntimeName() {
58
+ return `${getModuleFederationContainerName().replace(/\W/g, '_')}_${exports.MODULES_SEPARATE_BUILD_NAME}`;
59
+ }
52
60
  function patchMainWebpackConfigForModules(webpackConf, mode) {
53
61
  var _a, _b;
54
62
  /* eslint-disable no-param-reassign */
@@ -81,14 +89,18 @@ function patchMainWebpackConfigForModules(webpackConf, mode) {
81
89
  webpackConf.output.publicPath = haveExposedDefaultModules()
82
90
  ? 'auto' // Для того чтобы модули могли подключаться из разных мест, нам необходимо использовать auto. Для корректной работы в IE надо подключaть https://github.com/amiller-gh/currentScript-polyfill
83
91
  : app_configs_1.configs.publicPath;
92
+ if (mode === 'provider') {
93
+ const uniqueName = getSeparateBuildRuntimeName();
94
+ webpackConf.output = Object.assign(Object.assign({}, webpackConf.output), { uniqueName, chunkLoadingGlobal: `rspackChunk${uniqueName}` });
95
+ }
84
96
  webpackConf.plugins.push(new rspack.container.ModuleFederationPlugin({
85
- name: app_configs_1.configs.modules.name || app_configs_1.configs.normalizedName,
97
+ name: getModuleFederationContainerName(),
86
98
  filename: isProvider && app_configs_1.configs.modules.exposes ? exports.MODULES_ENTRY_NAME : undefined,
87
99
  shared: (mode === 'provider' && ((_b = app_configs_1.configs.modules.options) === null || _b === void 0 ? void 0 : _b.separateBuildShared)) ||
88
100
  app_configs_1.configs.modules.shared,
89
101
  exposes: isProvider ? app_configs_1.configs.modules.exposes : {},
90
102
  shareScope: app_configs_1.configs.modules.shareScope,
91
- }), new turn_off_split_remote_entry_1.TurnOffSplitRemoteEntry(app_configs_1.configs.modules.name || app_configs_1.configs.normalizedName));
103
+ }), new turn_off_split_remote_entry_1.TurnOffSplitRemoteEntry(getModuleFederationContainerName()));
92
104
  return webpackConf;
93
105
  /* eslint-enable no-param-reassign */
94
106
  }
@@ -382,7 +382,7 @@ const createClientWebpackConfig = (mode) => {
382
382
  const baseWebpackConfig = [(0, exports.createSingleClientWebpackConfig)(mode, app_configs_1.configs.clientEntry)];
383
383
  if ((_b = (_a = app_configs_1.configs.modules) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.useSeparateBuild) {
384
384
  baseWebpackConfig[0] = (0, modules_1.patchMainWebpackConfigForModules)(baseWebpackConfig[0], 'consumer');
385
- baseWebpackConfig.push((0, modules_1.patchMainWebpackConfigForModules)((0, exports.createSingleClientWebpackConfig)(mode, {}, 'wmf'), 'provider'));
385
+ baseWebpackConfig.push((0, modules_1.patchMainWebpackConfigForModules)((0, exports.createSingleClientWebpackConfig)(mode, {}, modules_1.MODULES_SEPARATE_BUILD_NAME), 'provider'));
386
386
  }
387
387
  else {
388
388
  baseWebpackConfig[0] = (0, modules_1.patchMainWebpackConfigForModules)(baseWebpackConfig[0], 'both');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arui-scripts",
3
- "version": "23.0.0",
3
+ "version": "23.0.1",
4
4
  "main": "./build/index.js",
5
5
  "typings": "./build/index.d.ts",
6
6
  "exports": {