@zohodesk/react-cli 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. package/README.md +19 -0
  2. package/lib/common/testPattern.js +0 -2
  3. package/lib/common/valueReplacer.js +1 -3
  4. package/lib/configs/resolvers.js +14 -3
  5. package/lib/loaderUtils/getCSSLoaders.js +2 -7
  6. package/lib/loaders/selectorMappingLoader.js +9 -9
  7. package/lib/logger.js +20 -0
  8. package/lib/pluginUtils/getDevPlugins.js +5 -0
  9. package/lib/pluginUtils/getProdPlugins.js +4 -0
  10. package/lib/plugins/CustomAttributePlugin.js +82 -0
  11. package/lib/plugins/CustomAttributePlugin.md +35 -0
  12. package/lib/plugins/EFCPlugin.js +9 -9
  13. package/lib/plugins/EFCTemplatePlugin.js +10 -12
  14. package/lib/plugins/I18NInjectIntoIndexPlugin.js +8 -9
  15. package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +2 -3
  16. package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +2 -7
  17. package/lib/plugins/I18nSplitPlugin/index.js +1 -1
  18. package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +8 -8
  19. package/lib/plugins/SelectorPlugin.js +4 -10
  20. package/lib/plugins/VariableConversionCollector.js +0 -4
  21. package/lib/postcss-plugins/IncludePlugin.js +0 -1
  22. package/lib/postcss-plugins/RTLSplitPlugin.js +4 -10
  23. package/lib/postcss-plugins/ValueReplacer.js +2 -4
  24. package/lib/postcss-plugins/hoverActivePlugin.js +0 -6
  25. package/lib/postcss-plugins/variableModificationPlugin/index.js +1 -2
  26. package/lib/postcss-plugins/variableModifier.js +24 -58
  27. package/lib/schemas/index.js +8 -1
  28. package/lib/servers/devBuild.js +13 -11
  29. package/lib/servers/httpsOptions.js +12 -13
  30. package/lib/servers/nowatchserver.js +5 -3
  31. package/lib/servers/requireLocalOrGlobal.js +61 -0
  32. package/lib/servers/server.js +1 -3
  33. package/lib/utils/cssClassNameGenerate.js +9 -10
  34. package/package-lock.json +14407 -0
  35. package/package.json +2 -2
  36. package/result.json +0 -1
  37. package/unittest/index.html +0 -37
@@ -13,9 +13,9 @@ var _getHash = _interopRequireDefault(require("./getHash"));
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
16
- let isWindows = _os.default.platform().toLowerCase() === 'win32';
16
+ const isWindows = _os.default.platform().toLowerCase() === 'win32';
17
17
 
18
- let isSelectorPackage = (resourcePath, packages) => {
18
+ const isSelectorPackage = (resourcePath, packages) => {
19
19
  if (!resourcePath.includes('node_modules')) {
20
20
  return false;
21
21
  }
@@ -43,9 +43,8 @@ var _default = (unique = true, {
43
43
  // NOTE: in build macine we use date as folder path.
44
44
  // So every time we create new build there is path will alway different
45
45
  // in order to minmaze that problem we try in relative path;
46
- // console.log('context.resourcePath', context.resourcePath, context);
47
46
  // let contextResourcePath = context.resourcePath;
48
- let relativePath = _path.default.relative(context.rootContext, context.resourcePath);
47
+ const relativePath = _path.default.relative(context.rootContext, context.resourcePath);
49
48
 
50
49
  if (context.resourcePath.endsWith('.plain.css')) {
51
50
  return localName;
@@ -54,20 +53,20 @@ var _default = (unique = true, {
54
53
 
55
54
 
56
55
  if (unique) {
57
- let h = (0, _getHash.default)(`${relativePath}-${localName}`, 10);
56
+ const h = (0, _getHash.default)(`${relativePath}-${localName}`, 10);
58
57
  return `${classNamePrefix}${h}`;
59
58
  }
60
59
  /* old production mode end*/
61
60
 
62
61
 
63
- let filePaths = context.resourcePath.split(_path.default.sep);
64
- let fileName = filePaths[filePaths.length - 1];
65
- let [fileNameWithoutExt] = fileName.split('.');
66
- let cleanFileName = fileNameWithoutExt.replace(/-/g, '_').toLowerCase(); //css file has casesensitive selector issue so can't toLowerCase
62
+ const filePaths = context.resourcePath.split(_path.default.sep);
63
+ const fileName = filePaths[filePaths.length - 1];
64
+ const [fileNameWithoutExt] = fileName.split('.');
65
+ const cleanFileName = fileNameWithoutExt.replace(/-/g, '_').toLowerCase(); //css file has casesensitive selector issue so can't toLowerCase
67
66
  //let local = localName.toLowerCase()
68
67
 
69
68
  if (isSelectorPackage(context.resourcePath, packages) || filenames.indexOf(cleanFileName) !== -1) {
70
- let h = (0, _getHash.default)(`${relativePath}-${localName}`, 10);
69
+ const h = (0, _getHash.default)(`${relativePath}-${localName}`, 10);
71
70
  return `${classNamePrefix}${h}`;
72
71
  }
73
72