@zohodesk/react-cli 1.0.2 → 1.0.3-beta.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.
Files changed (38) hide show
  1. package/README.md +24 -0
  2. package/bin/cli.js +1 -1
  3. package/lib/common/testPattern.js +0 -2
  4. package/lib/common/valueReplacer.js +1 -3
  5. package/lib/configs/resolvers.js +14 -3
  6. package/lib/loaderUtils/getCSSLoaders.js +2 -7
  7. package/lib/loaders/selectorMappingLoader.js +9 -9
  8. package/lib/logger.js +20 -0
  9. package/lib/pluginUtils/getDevPlugins.js +5 -0
  10. package/lib/pluginUtils/getProdPlugins.js +4 -0
  11. package/lib/plugins/CustomAttributePlugin.js +82 -0
  12. package/lib/plugins/CustomAttributePlugin.md +35 -0
  13. package/lib/plugins/EFCPlugin.js +9 -9
  14. package/lib/plugins/EFCTemplatePlugin.js +10 -12
  15. package/lib/plugins/I18NInjectIntoIndexPlugin.js +8 -9
  16. package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +2 -3
  17. package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +2 -7
  18. package/lib/plugins/I18nSplitPlugin/index.js +1 -1
  19. package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +8 -8
  20. package/lib/plugins/SelectorPlugin.js +4 -10
  21. package/lib/plugins/VariableConversionCollector.js +0 -4
  22. package/lib/postcss-plugins/IncludePlugin.js +0 -1
  23. package/lib/postcss-plugins/RTLSplitPlugin.js +4 -10
  24. package/lib/postcss-plugins/ValueReplacer.js +2 -4
  25. package/lib/postcss-plugins/hoverActivePlugin.js +0 -6
  26. package/lib/postcss-plugins/variableModificationPlugin/index.js +1 -2
  27. package/lib/postcss-plugins/variableModifier.js +24 -58
  28. package/lib/schemas/index.js +8 -1
  29. package/lib/servers/devBuild.js +13 -11
  30. package/lib/servers/httpsOptions.js +12 -13
  31. package/lib/servers/nowatchserver.js +5 -3
  32. package/lib/servers/requireLocalOrGlobal.js +61 -0
  33. package/lib/servers/server.js +1 -3
  34. package/lib/utils/cssClassNameGenerate.js +11 -12
  35. package/npm-shrinkwrap.json +14407 -0
  36. package/package.json +3 -2
  37. package/result.json +0 -1
  38. package/unittest/index.html +0 -37
@@ -70,8 +70,7 @@ if (mode === 'prod') {
70
70
  config = require('../configs/webpack.dev.config');
71
71
  } else {
72
72
  throw new Error('You must configure valid option in mode');
73
- } // console.log({ contextURL });
74
-
73
+ }
75
74
 
76
75
  const compiler = (0, _webpack.default)(config);
77
76
  const webpackServerOptions = {
@@ -101,7 +100,6 @@ app.use((0, _HMRMiddleware.default)(compiler, {
101
100
  path: '/sockjs-node/info'
102
101
  }));
103
102
  app.use((req, res, next) => {
104
- //console.log('origin', req.get('origin'));
105
103
  res.setHeader('Access-Control-Allow-Origin', req.get('origin') || '*'); // res.setHeader('Access-Control-Allow-Origin', req.get('origin'));
106
104
 
107
105
  res.setHeader('Access-Control-Allow-Private-Network', true);
@@ -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
  }
@@ -40,12 +40,11 @@ var _default = (unique = true, {
40
40
  filenames,
41
41
  packages
42
42
  }, classNamePrefix) => (context, localIdentName, localName) => {
43
- // NOTE: in build macine we use date as folder path.
43
+ // NOTE: in build machine we use date as folder path.
44
44
  // So every time we create new build there is path will alway different
45
- // in order to minmaze that problem we try in relative path;
46
- // console.log('context.resourcePath', context.resourcePath, context);
45
+ // in order to minimize that problem we try in relative path;
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 case sensitive 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