arui-scripts 19.0.2 → 19.0.4

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.
@@ -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 (26.411 s)
8
+ PASS src/plugins/postcss-global-variables/utils/__tests__/add-global-variable.tests.ts (25.927 s)
9
+ PASS src/configs/app-configs/__tests__/update-with-presets.tests.ts (26.065 s)
9
10
  PASS src/configs/util/__tests__/get-polyfills.tests.ts
10
- PASS src/plugins/postcss-global-variables/utils/__tests__/add-global-variable.tests.ts (26.868 s)
11
11
  PASS src/configs/util/__tests__/apply-overrides.tests.ts
12
12
  PASS src/configs/app-configs/__tests__/update-with-package.tests.ts
13
13
  PASS src/configs/app-configs/__tests__/update-with-env.tests.ts
14
- PASS src/plugins/postcss-global-variables/utils/__tests__/parse-variables.tests.ts
15
14
  PASS src/configs/app-configs/__tests__/validate-settings-keys.tests.ts
15
+ PASS src/plugins/postcss-global-variables/utils/__tests__/parse-variables.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 (29.062 s)
17
+ PASS src/configs/util/__tests__/find-plugin.tests.ts (28.015 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: 29.89 s
22
+ Time: 28.849 s
23
23
  Ran all test suites.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
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.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#309](https://github.com/core-ds/arui-scripts/pull/309) [`9d7c3c5`](https://github.com/core-ds/arui-scripts/commit/9d7c3c5072b9940e4236714e432c3d5c0d8c7902) Thanks [@heymdall-legal](https://github.com/heymdall-legal)! - Исправлена работа с wmf модулями в случае, если в проекте полностью отсутствует конфигурация для WMF модулей.
8
+ Добавлена настройка `disableModulesSupport`, которая полностью исключает работу arui-scripts с любыми плагинами, связанными с wmf.
9
+
10
+ ## 19.0.3
11
+
12
+ ### Patch Changes
13
+
14
+ - [#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)! - Исправлена загрузка картинок подключенных на сервере
15
+
3
16
  ## 19.0.2
4
17
 
5
18
  ### Patch Changes
@@ -80,6 +80,7 @@ function getDefaultAppConfig() {
80
80
  componentsTheme: null,
81
81
  keepCssVars: false,
82
82
  // Modules
83
+ disableModulesSupport: false,
83
84
  compatModules: null,
84
85
  modules: null,
85
86
  };
@@ -64,6 +64,7 @@ export type AppConfigs = {
64
64
  };
65
65
  componentsTheme: string | null;
66
66
  keepCssVars: boolean;
67
+ disableModulesSupport: boolean;
67
68
  compatModules: {
68
69
  shared?: {
69
70
  [libraryName: string]: string;
@@ -43,6 +43,10 @@ function haveExposedDefaultModules() {
43
43
  exports.MODULES_ENTRY_NAME = 'remoteEntry.js';
44
44
  function patchMainWebpackConfigForModules(webpackConf) {
45
45
  var _a;
46
+ if (app_configs_1.configs.disableModulesSupport) {
47
+ // проект хочет сам разбираться с WMF и прочими вещами, полностью отключаем обработку модулей на своей стороне
48
+ return webpackConf;
49
+ }
46
50
  if (!((_a = webpackConf.module) === null || _a === void 0 ? void 0 : _a.rules) || !webpackConf.plugins) {
47
51
  // делаем TS счастливым, на самом деле module и plugins у нас будут всегда
48
52
  return webpackConf;
@@ -50,6 +54,9 @@ function patchMainWebpackConfigForModules(webpackConf) {
50
54
  // Добавляем expose loader для библиотек, которые мы хотим вынести в глобальную область видимости
51
55
  webpackConf.module.rules.unshift(...getExposeLoadersFormCompatModules());
52
56
  if (!app_configs_1.configs.modules || !webpackConf.output || !webpackConf.plugins) {
57
+ // webpack по умолчанию всегда добавлял runtime для шаринга, даже когда модули не включены.
58
+ // Rspack этого больше не делает, поэтому добавляем плагин для рантайма самостоятельно
59
+ webpackConf.plugins.push(new rspack.sharing.ProvideSharedPlugin({ provides: {} }));
53
60
  return webpackConf;
54
61
  }
55
62
  const { cssPrefix } = app_configs_1.configs.modules.options || {};
@@ -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: 'static/media/[name].[hash:8][ext]',
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
- exclude: [/\.(js|jsx|mjs|ts|tsx)$/, /\.(html|ejs)$/, /\.json$/],
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
- outputPath: app_configs_1.default.publicPath,
132
- publicPath: app_configs_1.default.publicPath,
145
+ publicPath: ''
133
146
  },
134
147
  },
135
148
  ].filter(Boolean),