arui-scripts 15.6.0 → 15.6.2

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,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.updateWithConfigFile = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
+ const lodash_merge_1 = __importDefault(require("lodash.merge"));
8
9
  const resolve_1 = require("../util/resolve");
9
10
  const validate_settings_keys_1 = require("./validate-settings-keys");
10
11
  function updateWithConfigFile(config, context) {
@@ -16,7 +17,7 @@ function updateWithConfigFile(config, context) {
16
17
  appSettings = appSettings.default;
17
18
  }
18
19
  (0, validate_settings_keys_1.validateSettingsKeys)(config, appSettings, appConfigPath);
19
- return Object.assign(Object.assign({}, config), appSettings);
20
+ return (0, lodash_merge_1.default)(config, appSettings);
20
21
  }
21
22
  return config;
22
23
  }
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.updateWithEnv = void 0;
7
+ const lodash_merge_1 = __importDefault(require("lodash.merge"));
4
8
  const validate_settings_keys_1 = require("./validate-settings-keys");
5
9
  function updateWithEnv(config) {
6
10
  if (!process.env.ARUI_SCRIPTS_CONFIG) {
@@ -10,7 +14,7 @@ function updateWithEnv(config) {
10
14
  console.warn('Используйте ARUI_SCRIPTS_CONFIG только для отладки');
11
15
  const envSettings = JSON.parse(process.env.ARUI_SCRIPTS_CONFIG);
12
16
  (0, validate_settings_keys_1.validateSettingsKeys)(config, envSettings, 'ENV');
13
- return Object.assign(Object.assign({}, config), envSettings);
17
+ return (0, lodash_merge_1.default)(config, envSettings);
14
18
  }
15
19
  catch (e) {
16
20
  console.error(e);
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.updateWithPackage = void 0;
7
+ const lodash_merge_1 = __importDefault(require("lodash.merge"));
4
8
  const validate_settings_keys_1 = require("./validate-settings-keys");
5
9
  function updateWithPackage(config, context) {
6
10
  const packageSettings = context.appPackage.aruiScripts || {};
7
11
  (0, validate_settings_keys_1.validateSettingsKeys)(config, packageSettings, 'package.json');
8
- return Object.assign(Object.assign({}, config), packageSettings);
12
+ return (0, lodash_merge_1.default)(config, packageSettings);
9
13
  }
10
14
  exports.updateWithPackage = updateWithPackage;
@@ -1,8 +1,12 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.updateWithPresets = void 0;
4
7
  const resolve_1 = require("../util/resolve");
5
8
  const validate_settings_keys_1 = require("./validate-settings-keys");
9
+ const lodash_merge_1 = __importDefault(require("lodash.merge"));
6
10
  function updateWithPresets(config, context) {
7
11
  if (!config.presets) {
8
12
  return config;
@@ -16,7 +20,7 @@ function updateWithPresets(config, context) {
16
20
  presetsSettings = presetsSettings.default;
17
21
  }
18
22
  (0, validate_settings_keys_1.validateSettingsKeys)(config, presetsSettings, presetsConfigPath);
19
- config = Object.assign(Object.assign({}, config), presetsSettings);
23
+ config = (0, lodash_merge_1.default)(config, presetsSettings);
20
24
  }
21
25
  if (presetsOverridesPath) {
22
26
  context.overridesPath.unshift(presetsOverridesPath);
@@ -78,15 +78,21 @@ function addPrefixCssRule(rule, prefix) {
78
78
  if (!postCssLoader || typeof postCssLoader !== 'object' || !postCssLoader.options || typeof postCssLoader.options !== 'object') {
79
79
  return;
80
80
  }
81
- function transform(incomingPrefix, selector, prefixedSelector) {
81
+ function transform(incomingPrefix, selector, prefixedSelector, file, rule) {
82
82
  if (selector === ':root') {
83
+ // :root фактически должен заменяться на название класса модуля
83
84
  return incomingPrefix;
84
85
  }
86
+ if (rule.parent.parent && rule.parent.type !== 'atrule') {
87
+ // если у селектора родителем явлеется не root - значит он часть нестинга и его не надо префиксить
88
+ // исключение - если родитель @-правило, типа @media
89
+ return selector;
90
+ }
85
91
  return prefixedSelector;
86
92
  }
87
93
  postCssLoader.options.postcssOptions.plugins = [
88
94
  ...postCssLoader.options.postcssOptions.plugins,
89
- (0, postcss_prefix_selector_1.default)({ prefix, transform }),
95
+ (0, postcss_prefix_selector_1.default)({ prefix, transform: transform }),
90
96
  ];
91
97
  }
92
98
  function patchWebpackConfigForCompat(module, webpackConf) {