@zohodesk/react-cli 0.0.1-exp.166.2 → 0.0.1-exp.168.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. package/.eslintignore +7 -7
  2. package/.eslintrc.js +179 -179
  3. package/README.md +925 -877
  4. package/bin/cli.js +492 -487
  5. package/cert/Tsicsezwild-22-23.crt +37 -0
  6. package/cert/Tsicsezwild-22-23.key +27 -0
  7. package/docs/CustomChunks.md +26 -26
  8. package/docs/DevStart.md +18 -0
  9. package/docs/InstallNode.md +28 -0
  10. package/docs/TODOS.md +10 -10
  11. package/docs/ValueReplacer.md +60 -60
  12. package/docs/warnings_while_install.txt +35 -35
  13. package/files/eslintrc.js +62 -62
  14. package/files/prettierrc.js +3 -3
  15. package/lib/configs/webpack.css.umd.config.js +4 -4
  16. package/lib/configs/webpack.dev.config.js +13 -17
  17. package/lib/configs/webpack.docs.config.js +11 -16
  18. package/lib/configs/webpack.impact.config.js +6 -14
  19. package/lib/configs/webpack.prod.config.js +8 -5
  20. package/lib/loaderUtils/configsAssetsLoaders.js +88 -0
  21. package/lib/loaderUtils/getCSSLoaders.js +5 -3
  22. package/lib/loaders/workerLoader.js +9 -9
  23. package/lib/pluginUtils/getDevPlugins.js +5 -5
  24. package/lib/pluginUtils/getProdPlugins.js +5 -5
  25. package/lib/plugins/EFCPlugin.md +6 -6
  26. package/lib/plugins/I18NInjectIntoIndexPlugin.js +4 -4
  27. package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +38 -38
  28. package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +30 -30
  29. package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +8 -8
  30. package/lib/plugins/I18nSplitPlugin/I18nSplit.md +86 -86
  31. package/lib/plugins/I18nSplitPlugin/README.md +25 -25
  32. package/lib/plugins/I18nSplitPlugin/index.js +57 -57
  33. package/lib/plugins/ResourceHintsPlugin.js +17 -17
  34. package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +6 -6
  35. package/lib/plugins/RtlSplitPlugin/RtrSplit.md +30 -30
  36. package/lib/plugins/ServiceWorkerPlugin.js +9 -9
  37. package/lib/plugins/TPHashMappingPlugin.js +4 -4
  38. package/lib/postcss-plugins/RTLSplitPlugin.js +10 -10
  39. package/lib/postcss-plugins/hoverActivePlugin.js +357 -0
  40. package/lib/postcss-plugins/keyframesPlugin.js +126 -0
  41. package/lib/schemas/index.js +23 -2
  42. package/lib/servers/{devBulid.js → devBuild.js} +7 -3
  43. package/lib/servers/httpsOptions.js +2 -3
  44. package/lib/servers/nowatchserver.js +2 -2
  45. package/lib/servers/server.js +11 -3
  46. package/lib/sh/pre-commit.sh +34 -34
  47. package/lib/sh/reportPublish.sh +45 -45
  48. package/lib/utils/buildstats.html +148 -148
  49. package/lib/utils/repoClone.js +5 -2
  50. package/lib/utils/resultSchema.json +73 -73
  51. package/npm8.md +9 -9
  52. package/package.json +148 -144
  53. package/postpublish.js +6 -0
  54. package/templates/app/.eslintrc.js +140 -140
  55. package/templates/app/README.md +12 -12
  56. package/templates/app/app/index.html +24 -24
  57. package/templates/app/app/properties/ApplicationResources_en_US.properties +1 -1
  58. package/templates/app/app/properties/i18nkeys.json +3 -3
  59. package/templates/app/docs/all.html +69 -69
  60. package/templates/app/mockapi/index.js +18 -18
  61. package/templates/app/package.json +37 -37
  62. package/templates/app/src/actions/SampleActions/index.js +37 -37
  63. package/templates/app/src/actions/index.js +65 -65
  64. package/templates/app/src/appUrls.js +19 -19
  65. package/templates/app/src/components/Alert/Alert.js +134 -134
  66. package/templates/app/src/components/Alert/Alert.module.css +79 -79
  67. package/templates/app/src/components/FreezeLayer/FreezeLayer.css +37 -37
  68. package/templates/app/src/components/FreezeLayer/FreezeLayer.js +84 -84
  69. package/templates/app/src/components/Sample/Sample.module.css +11 -11
  70. package/templates/app/src/components/Sample/SampleList.js +61 -61
  71. package/templates/app/src/components/Slider/Slider.css +41 -41
  72. package/templates/app/src/components/Slider/Slider.js +55 -55
  73. package/templates/app/src/containers/AlertContainer/index.js +15 -15
  74. package/templates/app/src/containers/AppContainer/index.js +96 -96
  75. package/templates/app/src/containers/AppContainer/index.module.css +27 -27
  76. package/templates/app/src/containers/CustomMatch/index.js +65 -65
  77. package/templates/app/src/containers/DevTools/index.js +10 -10
  78. package/templates/app/src/containers/Header/index.js +67 -67
  79. package/templates/app/src/containers/Header/index.module.css +43 -43
  80. package/templates/app/src/containers/Redirect/index.js +63 -63
  81. package/templates/app/src/containers/Redirector/index.js +47 -47
  82. package/templates/app/src/containers/SampleListContainer/ListContainer.js +42 -42
  83. package/templates/app/src/containers/SampleListContainer/ListContainer.module.css +3 -3
  84. package/templates/app/src/historyChange.js +5 -5
  85. package/templates/app/src/index.html +10 -10
  86. package/templates/app/src/index.js +24 -24
  87. package/templates/app/src/middleware/PromiseMiddleware.js +59 -59
  88. package/templates/app/src/reducers/alertData.js +11 -11
  89. package/templates/app/src/reducers/index.js +6 -6
  90. package/templates/app/src/reducers/samples.js +19 -19
  91. package/templates/app/src/store/configureStore.dev.js +51 -51
  92. package/templates/app/src/store/configureStore.js +5 -5
  93. package/templates/app/src/store/configureStore.prod.js +26 -26
  94. package/templates/app/src/util/Common.js +5 -5
  95. package/templates/app/src/util/RequestAPI.js +132 -132
  96. package/templates/docs/all.html +249 -249
  97. package/templates/docs/component.html +178 -178
  98. package/templates/docs/components.html +221 -221
  99. package/templates/docs/css/b.min.css +6 -6
  100. package/templates/docs/css/component.css +42 -42
  101. package/templates/docs/css/componentTest.css +6 -6
  102. package/templates/docs/css/hopscotch.css +585 -585
  103. package/templates/docs/css/style.css +1022 -1022
  104. package/templates/docs/impactReportTemplate.html +154 -154
  105. package/templates/docs/index.html +1493 -1493
  106. package/templates/docs/js/active-line.js +72 -72
  107. package/templates/docs/js/b.min.js +7 -7
  108. package/templates/docs/js/codemirror.js +9680 -9680
  109. package/templates/docs/js/designTokens.js +334 -334
  110. package/templates/docs/js/j.min.js +4 -4
  111. package/templates/docs/js/javascript.js +874 -874
  112. package/templates/docs/js/matchbrackets.js +145 -145
  113. package/DOTO.md +0 -13
  114. package/cert/cert.pem +0 -37
  115. package/cert/key.pem +0 -27
  116. package/cert/passphrase.pem +0 -1
  117. package/eslint/NOTES.md +0 -3
  118. package/eslint/a23.c +0 -16
  119. package/eslint/a28.c +0 -25
  120. package/eslint/a29.c +0 -25
  121. package/eslint/a30.c +0 -29
  122. package/eslint/a31.c +0 -23
  123. package/eslint/a35.c +0 -23
  124. package/eslint/a36.c +0 -18
  125. package/eslint/a37.c +0 -25
  126. package/eslint/a38.c +0 -28
  127. package/eslint/a39.c +0 -17
  128. package/eslint/a40.c +0 -32
  129. package/eslint/mockapi.html +0 -18
  130. package/eslint/mockapi.md +0 -5
@@ -10,15 +10,21 @@ var _loaderUtils = require("../loaderUtils");
10
10
 
11
11
  var _libAlias = require("./libAlias");
12
12
 
13
+ var _configsAssetsLoaders = require("../loaderUtils/configsAssetsLoaders");
14
+
13
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
16
 
15
17
  let options = (0, _utils.getOptions)();
16
18
  let {
19
+ unstableDepsInverse,
17
20
  docs: {
18
21
  componentFolder,
19
22
  disableES5Transpile,
23
+ enableChunkHash,
20
24
  cssUniqueness,
25
+ combinerMq,
21
26
  hasRTL,
27
+ hoverActive,
22
28
  rtlExclude,
23
29
  cssHashSelectors,
24
30
  classNamePrefix
@@ -28,6 +34,7 @@ let {
28
34
  }
29
35
  } = options;
30
36
  let appPath = process.cwd();
37
+ const nameTemplate = (0, _configsAssetsLoaders.createNameTemplate)(enableChunkHash);
31
38
 
32
39
  module.exports = isSSTest => ({
33
40
  entry: {
@@ -68,17 +75,8 @@ module.exports = isSSTest => ({
68
75
  exclude: /node_modules/
69
76
  }, {
70
77
  test: /(\.module)?\.css$/,
71
- use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, false, cssUniqueness, null, cssHashSelectors, classNamePrefix)
72
- }, {
73
- test: /\.jpe?g$|\.gif$|\.png$/,
74
- use: ['url-loader?limit=1000&name=./images/[name].[ext]']
75
- }, {
76
- test: /\.woff2|\.woff$|\.ttf$|\.eot$/,
77
- use: ['url-loader?limit=1000&name=./fonts/[name].[ext]']
78
- }, {
79
- test: /\.svg$/,
80
- use: ['url-loader?limit=1&name=./fonts/[name].[ext]']
81
- }, {
78
+ use: (0, _loaderUtils.getCSSLoaders)(hasRTL, combinerMq, rtlExclude, hoverActive, false, cssUniqueness, null, cssHashSelectors, classNamePrefix)
79
+ }, (0, _configsAssetsLoaders.configImageLoader)(nameTemplate), (0, _configsAssetsLoaders.configFontLoader)(nameTemplate), (0, _configsAssetsLoaders.configSVGLoader)(nameTemplate), (0, _configsAssetsLoaders.configAudioLoader)(nameTemplate), {
82
80
  test: /\.html$/,
83
81
  use: {
84
82
  loader: 'html-loader',
@@ -87,9 +85,6 @@ module.exports = isSSTest => ({
87
85
  interpolate: 'require'
88
86
  }
89
87
  }
90
- }, {
91
- test: /\.ogg$/,
92
- use: ['file-loader?name=./fonts/[name].[ext]']
93
88
  }, {
94
89
  test: /\.tmpl$/,
95
90
  use: [{
@@ -110,10 +105,10 @@ module.exports = isSSTest => ({
110
105
  ZC: '$ZC'
111
106
  },
112
107
  resolve: {
113
- modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules'],
108
+ modules: unstableDepsInverse ? ['node_modules', _path.default.resolve(__dirname, '..', '..', 'node_modules')] : [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules'],
114
109
  alias: disableES5Transpile ? _libAlias.libAlias : {}
115
110
  },
116
111
  resolveLoader: {
117
- modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
112
+ modules: unstableDepsInverse ? ['node_modules', _path.default.resolve(__dirname, '..', '..', 'node_modules')] : [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
118
113
  }
119
114
  });
@@ -8,6 +8,8 @@ var _loaderUtils = require("../loaderUtils");
8
8
 
9
9
  var _getLibraryImactPlugins = _interopRequireDefault(require("../pluginUtils/getLibraryImactPlugins"));
10
10
 
11
+ var _configsAssetsLoaders = require("../loaderUtils/configsAssetsLoaders");
12
+
11
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
14
 
13
15
  let options = (0, _utils.getOptions)();
@@ -18,6 +20,7 @@ let {
18
20
  hasRTL,
19
21
  rtlExclude,
20
22
  cssHashSelectors,
23
+ enableChunkHash,
21
24
  classNamePrefix
22
25
  },
23
26
  app: {
@@ -25,6 +28,7 @@ let {
25
28
  }
26
29
  } = options;
27
30
  let appPath = process.cwd();
31
+ const nameTemplate = (0, _configsAssetsLoaders.createNameTemplate)(enableChunkHash);
28
32
  module.exports = {
29
33
  entry: {
30
34
  main: [_path.default.resolve(__dirname, '..', 'hooks', 'docsProptypeHook.js'), _path.default.join(appPath, componentFolder, 'index.js')],
@@ -64,17 +68,8 @@ module.exports = {
64
68
  exclude: /node_modules/
65
69
  }, {
66
70
  test: /(\.module)?\.css$/,
67
- use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, false, cssUniqueness, null, cssHashSelectors, classNamePrefix)
68
- }, {
69
- test: /\.jpe?g$|\.gif$|\.png$/,
70
- use: ['url-loader?limit=1000&name=./images/[name].[ext]']
71
- }, {
72
- test: /\.woff2|\.woff$|\.ttf$|\.eot$/,
73
- use: ['url-loader?limit=1000&name=./fonts/[name].[ext]']
74
- }, {
75
- test: /\.svg$/,
76
- use: ['url-loader?limit=1&name=./fonts/[name].[ext]']
77
- }, {
71
+ use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, combinerMq, hoverActive, false, cssUniqueness, null, cssHashSelectors, classNamePrefix)
72
+ }, (0, _configsAssetsLoaders.configImageLoader)(nameTemplate), (0, _configsAssetsLoaders.configFontLoader)(nameTemplate), (0, _configsAssetsLoaders.configSVGLoader)(nameTemplate), (0, _configsAssetsLoaders.configAudioLoader)(nameTemplate), {
78
73
  test: /\.html$/,
79
74
  use: {
80
75
  loader: 'html-loader',
@@ -83,9 +78,6 @@ module.exports = {
83
78
  interpolate: 'require'
84
79
  }
85
80
  }
86
- }, {
87
- test: /\.ogg$/,
88
- use: ['file-loader?name=./fonts/[name].[ext]']
89
81
  }, {
90
82
  test: /\.tmpl$/,
91
83
  use: [{
@@ -17,6 +17,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
17
17
  // import TerserPlugin from 'terser-webpack-plugin';
18
18
  let options = (0, _utils.getOptions)();
19
19
  let {
20
+ unstableDepsInverse,
20
21
  app: {
21
22
  folder,
22
23
  context,
@@ -26,8 +27,10 @@ let {
26
27
  removeAttribute,
27
28
  enableSMap,
28
29
  server,
30
+ combinerMq,
29
31
  hasRTL,
30
32
  rtlExclude,
33
+ hoverActive,
31
34
  cssUniqueness,
32
35
  server: {
33
36
  mode
@@ -80,7 +83,7 @@ module.exports = {
80
83
  concatenateModules: true,
81
84
  minimize: true,
82
85
  // by default if minimize: true in webpack minimize then webpack automaticaly add TerserPlugin,
83
- // So we are overrideing it.
86
+ // So we are overrideing it.
84
87
  // minimizer: [
85
88
  // new TerserPlugin({
86
89
  // cache: true,
@@ -143,10 +146,10 @@ module.exports = {
143
146
  }, seperateCssModules ? {
144
147
  test: /\.css$/,
145
148
  exclude: /\.module\.css$/,
146
- use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, '[local]', false, null)
149
+ use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, hoverActive, combinerMq, keyframesRedMtn, '[local]', false, null)
147
150
  } : null, {
148
151
  test: seperateCssModules ? /\.module\.css$/ : /\.css$/,
149
- use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, false, cssUniqueness, selectorReplace, cssHashSelectors, classNamePrefix)
152
+ use: (0, _loaderUtils.getCSSLoaders)(hasRTL, combinerMq, rtlExclude, hoverActive, false, cssUniqueness, selectorReplace, cssHashSelectors, classNamePrefix)
150
153
  }, {
151
154
  test: /\.jpe?g$|\.gif$|\.png$/,
152
155
  use: [{
@@ -208,10 +211,10 @@ module.exports = {
208
211
  ZC: '$ZC'
209
212
  },
210
213
  resolve: {
211
- modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules'],
214
+ modules: unstableDepsInverse ? ['node_modules', _path.default.resolve(__dirname, '..', '..', 'node_modules')] : [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules'],
212
215
  alias: disableES5Transpile ? _libAlias.libAlias : {}
213
216
  },
214
217
  resolveLoader: {
215
- modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
218
+ modules: unstableDepsInverse ? ['node_modules', _path.default.resolve(__dirname, '..', '..', 'node_modules')] : [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
216
219
  }
217
220
  };
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.configAudioLoader = configAudioLoader;
7
+ exports.configFontLoader = configFontLoader;
8
+ exports.configImageLoader = configImageLoader;
9
+ exports.configSVGLoader = configSVGLoader;
10
+ exports.createNameTemplate = createNameTemplate;
11
+ // function getLoaderOptionQueryString(params) {
12
+ const ImageExtRegex = /\.jpe?g$|\.gif$|\.png$/;
13
+ const FontExtRegex = /\.woff2|\.woff$|\.ttf$|\.eot$/;
14
+ const SVGExtRegex = /\.svg$/;
15
+ const AudioExtRegex = /\.ogg$/;
16
+
17
+ function createLoaderOptionQueryString(loaderName, nameTemplate, limit = 1000) {
18
+ return `${loaderName}?limit=${limit}&name=${nameTemplate}`;
19
+ }
20
+
21
+ function configImageLoader(nameTemplate) {
22
+ return {
23
+ test: ImageExtRegex,
24
+ use: createLoaderOptionQueryString('url-loader', `./images/${nameTemplate}`)
25
+ };
26
+ }
27
+
28
+ function configFontLoader(nameTemplate) {
29
+ return {
30
+ test: FontExtRegex,
31
+ use: createLoaderOptionQueryString('url-loader', `./fonts/${nameTemplate}`)
32
+ };
33
+ }
34
+
35
+ function configSVGLoader(nameTemplate) {
36
+ return {
37
+ test: SVGExtRegex,
38
+ use: createLoaderOptionQueryString('url-loader', `./fonts/${nameTemplate}`, 1)
39
+ };
40
+ }
41
+
42
+ function configAudioLoader(nameTemplate) {
43
+ return {
44
+ test: AudioExtRegex,
45
+ use: createLoaderOptionQueryString('file-loader', `./fonts/${nameTemplate}`, 1)
46
+ };
47
+ }
48
+
49
+ function createNameTemplate(enableChunkHash) {
50
+ const ext = `${enableChunkHash ? '.[hash:20]' : ''}.[ext]`;
51
+ return `[name]${ext}`;
52
+ }
53
+ /*
54
+ export function createImageAndFontsAndSVGLoaders(enableChunkHash) {
55
+ const nameTemplate = createNameTemplate(enableChunkHash);
56
+ return [
57
+ configImageLoader(nameTemplate),
58
+ configFontLoader(nameTemplate),
59
+ configSVGLoader(nameTemplate),
60
+ configAudioLoader(nameTemplate)
61
+ ];
62
+ }
63
+ */
64
+
65
+ /*
66
+ export function createLoaderOptionObject(
67
+ loaderName,
68
+ nameTemplate,
69
+ fallback,
70
+ limit = 1000
71
+ ) {
72
+ return {
73
+ loader: loaderName,
74
+ options: {
75
+ limit,
76
+ name: nameTemplate,
77
+ fallback
78
+ }
79
+ };
80
+ }
81
+
82
+ function configLoaderObject(filter, loaderAndOptions) {
83
+ return {
84
+ test: filter,
85
+ use: loaderAndOptions
86
+ };
87
+ }
88
+ */
@@ -16,7 +16,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
16
16
  let options = (0, _utils.getOptions)();
17
17
  let isWin = process.platform === 'win32';
18
18
 
19
- let getCSSLoaders = (hasRTL, rtlExclude, classNameBlob, cssUniqueness, selectorReplace, cssHashSelectors, classNamePrefix) => {
19
+ let getCSSLoaders = (hasRTL, combinerMq, rtlExclude, hoverActive, classNameBlob, cssUniqueness, selectorReplace, cssHashSelectors, classNamePrefix) => {
20
20
  const {
21
21
  devCssFileBountry
22
22
  } = options.app;
@@ -28,7 +28,8 @@ let getCSSLoaders = (hasRTL, rtlExclude, classNameBlob, cssUniqueness, selectorR
28
28
  } = options.impactService;
29
29
  let rtlExcludeLocal = isWin ? rtlExclude.map(r => r.replace(/\//g, '\\')) : rtlExclude;
30
30
  let cssLoaderOptions = {
31
- importLoaders: hasRTL ? 1 : 0,
31
+ // importLoaders: hasRTL||hoverActive ? 1 : 0,
32
+ importLoaders: 1,
32
33
  modules: {},
33
34
  sourceMap: true
34
35
  };
@@ -50,7 +51,8 @@ let getCSSLoaders = (hasRTL, rtlExclude, classNameBlob, cssUniqueness, selectorR
50
51
  return `${prefix} ${selector}`; // Make selectors like [dir=rtl] > .selector
51
52
  }
52
53
  })]
53
- })].filter(Boolean);
54
+ }), // require('postcss-import')(),
55
+ combinerMq && require('postcss-combine-media-query')(), hoverActive && require('../postcss-plugins/hoverActivePlugin')()].filter(Boolean);
54
56
  return [cssSelectorZipPath && {
55
57
  loader: require.resolve('../loaders/selectorMappingLoader')
56
58
  }, {
@@ -16,7 +16,7 @@ var _SingleEntryPlugin = _interopRequireDefault(require("webpack/lib/SingleEntry
16
16
 
17
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
18
 
19
- /* import WebWorkerTemplatePlugin from 'webpack/lib/webworker/WebWorkerTemplatePlugin';
19
+ /* import WebWorkerTemplatePlugin from 'webpack/lib/webworker/WebWorkerTemplatePlugin';
20
20
  import ExternalsPlugin from 'webpack/lib/ExternalsPlugin'; */
21
21
  const schema = {
22
22
  'type': 'object',
@@ -80,14 +80,14 @@ function pitch(request) {
80
80
  globalObject: 'self'
81
81
  };
82
82
  workerContext.compiler = this._compilation.createChildCompiler(`worker-loader ${request}`, workerContext.options);
83
- /*
84
- new WebWorkerTemplatePlugin().apply(workerContext.compiler);
85
-
86
- if (compilerOptions.externals) {
87
- new ExternalsPlugin(
88
- getExternalsType(compilerOptions),
89
- compilerOptions.externals
90
- ).apply(workerContext.compiler);
83
+ /*
84
+ new WebWorkerTemplatePlugin().apply(workerContext.compiler);
85
+
86
+ if (compilerOptions.externals) {
87
+ new ExternalsPlugin(
88
+ getExternalsType(compilerOptions),
89
+ compilerOptions.externals
90
+ ).apply(workerContext.compiler);
91
91
  } */
92
92
 
93
93
  new _SingleEntryPlugin.default(this.context, `!!${request}`, _path.default.parse(this.resourcePath).name).apply(workerContext.compiler);
@@ -103,11 +103,11 @@ let getDevPlugins = (options, publicPath) => {
103
103
  }
104
104
 
105
105
  const i18nManifestFileName = 'i18n-manifest.json';
106
- /**
107
- * NOTE:
108
- * this file name ext .i18n.js added
109
- * Because, in service worker they maintain cache as file name based
110
- * So, to make differce we added .i18n.js ext.
106
+ /**
107
+ * NOTE:
108
+ * this file name ext .i18n.js added
109
+ * Because, in service worker they maintain cache as file name based
110
+ * So, to make differce we added .i18n.js ext.
111
111
  */
112
112
 
113
113
  const i18nFileNameTemplate = 'i18n-chunk/[locale]/[name].i18n.js';
@@ -108,11 +108,11 @@ let getProdPlugins = (options, publicPath = '') => {
108
108
  }
109
109
 
110
110
  const i18nManifestFileName = 'i18n-manifest.json';
111
- /**
112
- * NOTE:
113
- * this file name ext .i18n.js added
114
- * Because, in service worker they maintain cache as file name based
115
- * So, to make differce we added .i18n.js ext.
111
+ /**
112
+ * NOTE:
113
+ * this file name ext .i18n.js added
114
+ * Because, in service worker they maintain cache as file name based
115
+ * So, to make differce we added .i18n.js ext.
116
116
  */
117
117
 
118
118
  const i18nFileNameTemplate = 'i18n-chunk/[locale]/[name].[chunkhash].i18n.js';
@@ -1,6 +1,6 @@
1
- # EFC Plugin
2
-
3
- In EFC plugin we are create sdk file for efc related purpose
4
-
5
-
6
- # document will be soon
1
+ # EFC Plugin
2
+
3
+ In EFC plugin we are create sdk file for efc related purpose
4
+
5
+
6
+ # document will be soon
@@ -116,10 +116,10 @@ class I18NInjectIntoIndexPlugin {
116
116
  i18nObj = i18nFiles.reduce((res, next) => {
117
117
  let fileName = next.replace(`i18n${_path.default.sep}`, '');
118
118
  let splittedFileName = fileName.split('.');
119
- /* if (this.isDevelopment) {
120
- res[splittedFileName[0]] = `${this.publicPath}/i18n/${fileName}`;
121
- } else {
122
- res[splittedFileName[0]] = fileName;
119
+ /* if (this.isDevelopment) {
120
+ res[splittedFileName[0]] = `${this.publicPath}/i18n/${fileName}`;
121
+ } else {
122
+ res[splittedFileName[0]] = fileName;
123
123
  } */
124
124
 
125
125
  res[splittedFileName[0]] = `${this.publicPath}/i18n/${fileName}`;
@@ -13,23 +13,23 @@ var _hashUtils = require("./utils/hashUtils");
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
16
- /**
17
- * this plugin for the download i18n files
18
- * So, if need to downoad i18n in browser this plugin handle that
19
- *
20
- *
21
- * this plugin works
22
- * how it works?
23
- * this plugin hook the requireEnsure method and we write logic for current compiled file download logic
24
- *
25
- * hinds:-
26
- * requireEnsure method was loader for all js chunk's ,
27
- * which means if we use dynamic import then this function will create script tag for that dynamic resource
28
- * so every dynamic js chunk will load by this function,
29
- * So we update this function with when dynamic jschunk call the nour code also execute
30
- *
31
- * some thing missing in this definetion
32
- *
16
+ /**
17
+ * this plugin for the download i18n files
18
+ * So, if need to downoad i18n in browser this plugin handle that
19
+ *
20
+ *
21
+ * this plugin works
22
+ * how it works?
23
+ * this plugin hook the requireEnsure method and we write logic for current compiled file download logic
24
+ *
25
+ * hinds:-
26
+ * requireEnsure method was loader for all js chunk's ,
27
+ * which means if we use dynamic import then this function will create script tag for that dynamic resource
28
+ * so every dynamic js chunk will load by this function,
29
+ * So we update this function with when dynamic jschunk call the nour code also execute
30
+ *
31
+ * some thing missing in this definetion
32
+ *
33
33
  */
34
34
  // import { REGEXP_HASH, REGEXP_CHUNKHASH } from './utils/hashUtils';
35
35
  const pluginName = 'DownloadLogicOfI18n'; // const pluginName = 'i18n-plugin';
@@ -126,20 +126,20 @@ class I18nDownlodLogic {
126
126
  return _webpack.Template.asString([source, '', '// object to store loaded I18N chunks', 'var installedI18nChunks = {', _webpack.Template.indent(mainChunk.ids.map(id => `${JSON.stringify(id)}: 0`).join(',\n')), '};']);
127
127
  });
128
128
  mainTemplate.hooks.requireEnsure.tap(pluginName, (source, mainChunk, hash) => {
129
- /**
130
- * for Information this is tapped in mainTemplate ,
131
- * So this hooks argument chunk is main chunk means entry chunk mostly.
132
- * if any chunk has i18n then we must write our download i18n logic,
129
+ /**
130
+ * for Information this is tapped in mainTemplate ,
131
+ * So this hooks argument chunk is main chunk means entry chunk mostly.
132
+ * if any chunk has i18n then we must write our download i18n logic,
133
133
  */
134
134
  const chunkMap = this.getI18nChunkObject(mainChunk);
135
135
 
136
136
  if (!Object.keys(chunkMap).length) {
137
137
  return source;
138
138
  }
139
- /**
140
- * chunkMaps has
141
- * @property {Object} hash [it has key as chunk id and value as chunkHash ]
142
- * @property {Object} name [it has key as chunk id and value as chunk name ]
139
+ /**
140
+ * chunkMaps has
141
+ * @property {Object} hash [it has key as chunk id and value as chunkHash ]
142
+ * @property {Object} name [it has key as chunk id and value as chunk name ]
143
143
  */
144
144
 
145
145
 
@@ -176,22 +176,22 @@ class I18nDownlodLogic {
176
176
  },
177
177
  contentHashType: MODULE_TYPE
178
178
  });
179
- /** IDEA:
180
- * as my suggestion ignore this `jsop` approch,
181
- * Because json parse is faster then js parse.
182
- * my suggestion is make ajax or fetch request
179
+ /** IDEA:
180
+ * as my suggestion ignore this `jsop` approch,
181
+ * Because json parse is faster then js parse.
182
+ * my suggestion is make ajax or fetch request
183
183
  */
184
184
 
185
185
  const buf = [];
186
- /*
187
- if (REGEXP_HASH.test(filenameTemplate)) {
188
- buf.push(
189
- `var hash = ${mainTemplate.renderCurrentHashCode(hash)};`
190
- );
191
- }
192
- if (REGEXP_CHUNKHASH.test(filenameTemplate)) {
193
- buf.push(`var chunkHashes = ${JSON.stringify(chunkMaps.hash)};`);
194
- }
186
+ /*
187
+ if (REGEXP_HASH.test(filenameTemplate)) {
188
+ buf.push(
189
+ `var hash = ${mainTemplate.renderCurrentHashCode(hash)};`
190
+ );
191
+ }
192
+ if (REGEXP_CHUNKHASH.test(filenameTemplate)) {
193
+ buf.push(`var chunkHashes = ${JSON.stringify(chunkMaps.hash)};`);
194
+ }
195
195
  */
196
196
 
197
197
  if ((0, _hashUtils.hasContentHash)(filenameTemplate)) {
@@ -13,8 +13,8 @@ var _getI18nKeysFormModules = _interopRequireDefault(require("./utils/getI18nKey
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
16
- /**
17
- * this plugin was creating the chunk specific i18n chunk's.
16
+ /**
17
+ * this plugin was creating the chunk specific i18n chunk's.
18
18
  */
19
19
  // this plugin's kick starter is apply method
20
20
  const pluginName = 'I18nFilesEmitter';
@@ -141,40 +141,40 @@ class I18nFilesEmitter {
141
141
  }
142
142
 
143
143
  apply(compiler) {
144
- /*
145
- compiler.hooks.thisCompilation.tap(pluginName, compilation => {
146
- compilation.mainTemplate.hooks.renderManifest.tap(
147
- pluginName,
148
- (result, { chunk }) => {
149
- this.renderChunk(result, compilation, chunk);
150
- }
151
- );
152
- compilation.chunkTemplate.hooks.renderManifest.tap(
153
- pluginName,
154
- (result, { chunk }) => {
155
- this.renderChunk(result, compilation, chunk);
156
- }
157
- );
158
- });
144
+ /*
145
+ compiler.hooks.thisCompilation.tap(pluginName, compilation => {
146
+ compilation.mainTemplate.hooks.renderManifest.tap(
147
+ pluginName,
148
+ (result, { chunk }) => {
149
+ this.renderChunk(result, compilation, chunk);
150
+ }
151
+ );
152
+ compilation.chunkTemplate.hooks.renderManifest.tap(
153
+ pluginName,
154
+ (result, { chunk }) => {
155
+ this.renderChunk(result, compilation, chunk);
156
+ }
157
+ );
158
+ });
159
159
  */
160
160
  // this below hook was tapped for create asssets(file) for chunk specific i18nChunk Files
161
161
  compiler.hooks.emit.tap(pluginName, compilation => {
162
162
  this.emitI18nAssert(compilation);
163
163
  });
164
164
  }
165
- /*
166
- renderChunk(result, compilation, chunk) {
167
- const i18nKeys = getI18nKeysFormModules(chunk.modulesIterable);
168
- // TODO: need to discuss with vimal ji can we chose this place for add i18n locale files ????
169
- // IDEA: we chose this place for add i18n locale files ????
170
- if (i18nKeys.length > 0) {
171
- Object.keys(this.allI18nObject).forEach(locale => {
172
- result.push(
173
- this.renderI18nLocaleChunk(chunk, locale, i18nKeys, compilation)
174
- );
175
- });
176
- }
177
- }
165
+ /*
166
+ renderChunk(result, compilation, chunk) {
167
+ const i18nKeys = getI18nKeysFormModules(chunk.modulesIterable);
168
+ // TODO: need to discuss with vimal ji can we chose this place for add i18n locale files ????
169
+ // IDEA: we chose this place for add i18n locale files ????
170
+ if (i18nKeys.length > 0) {
171
+ Object.keys(this.allI18nObject).forEach(locale => {
172
+ result.push(
173
+ this.renderI18nLocaleChunk(chunk, locale, i18nKeys, compilation)
174
+ );
175
+ });
176
+ }
177
+ }
178
178
  */
179
179
 
180
180
 
@@ -14,14 +14,14 @@ var _NullFactory = _interopRequireDefault(require("webpack/lib/NullFactory"));
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
16
16
  const pluginName = 'I18nKeysIdentifer';
17
- /**
18
- * this plugin search the i18 keys and make it as I18nDependency.
19
- * how it works?
20
- * this plugin get jsResourceI18nKeys in constructor.
21
- * we walk throught the js files AST
22
- * if any string literal in that AST is in jsResourceI18nKeys then we consider that string as I18n key
23
- * after the walk of AST we get some I18n keys
24
- * then we make it as I18nDependency.
17
+ /**
18
+ * this plugin search the i18 keys and make it as I18nDependency.
19
+ * how it works?
20
+ * this plugin get jsResourceI18nKeys in constructor.
21
+ * we walk throught the js files AST
22
+ * if any string literal in that AST is in jsResourceI18nKeys then we consider that string as I18n key
23
+ * after the walk of AST we get some I18n keys
24
+ * then we make it as I18nDependency.
25
25
  */
26
26
 
27
27
  class I18nKeysIdentifer {