@zohodesk/client_build_tool 0.0.12 → 0.0.13

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog and Release Notes
2
2
 
3
+ # v0.0.13 (02-09-2025)
4
+
5
+ **Adjustments:-**
6
+ - Source map files are created in the smap/ folder by default. However, they are also being created in the js/ folder to resolve the issue where Murphy was unable to locate them.
7
+
8
+ **Feature:-**
9
+ - Added support for Murphy to be built as a separate chunk and injected as the top script in the initial HTML.
10
+ - To enable this support , add this in your configuration
11
+
12
+ ```murphyBootstrapHtml{
13
+ enable: true,
14
+ chunkName: '',
15
+ filePath: ''
16
+ }```
17
+
18
+
19
+
3
20
  # v0.0.12 (14-08-2025)
4
21
 
5
22
  - Fixed the initial i18n loading issue caused by using the same function in both the i18nRuntimeDealer plugin and decidePublicPath
package/README.md CHANGED
@@ -294,6 +294,127 @@ For example
294
294
  - `customAttributes` support for add attributes to html, link , script tag in the output build.
295
295
 
296
296
 
297
+ ## v0.0.1 (18-04-2023)
298
+
299
+ First Release
300
+ **Features:-**
301
+
302
+ - 'start' command to run react app
303
+ - 'build' command to create build for react app
304
+ - 'build:lib' command to create lib for react library
305
+ - 'build:es' command to create es for react library
306
+ - 'templates' command to create es for react library
307
+ # Changelog and Release Notes
308
+
309
+ # v0.0.13 (02-09-2025)
310
+
311
+ **Adjustments:-**
312
+ - Source map files are created in the smap/ folder by default. However, they are also being created in the js/ folder to resolve the issue where Murphy was unable to locate them.
313
+
314
+ **Feature:-**
315
+ - Added support for Murphy to be built as a separate chunk and injected as the top script in the initial HTML.
316
+ - To enable this support , add this in your configuration
317
+
318
+ ```murphyBootstrapHtml{
319
+ enable: true,
320
+ chunkName: '',
321
+ filePath: ''
322
+ }```
323
+
324
+
325
+
326
+ # v0.0.12 (14-08-2025)
327
+
328
+ - Fixed the initial i18n loading issue caused by using the same function in both the i18nRuntimeDealer plugin and decidePublicPath
329
+
330
+ # v0.0.11 (07-08-2025) (had an issue while enable i18n chunk split plugin)
331
+ - remove babel-plugin-module-resolver dependencies
332
+
333
+ **Adjustments:-**
334
+ - Public Folder configuration is separated for development and production
335
+
336
+ **Bug Fix:-**
337
+ - Fixed the issue where the build log was not visible when `stats (bundle integrity)` was enabled. The problem was resolved by adding an error check in the `bundleIntegrity plugin`.
338
+ - Removed the babel-plugin-module-resolver dependency to resolve the alias resolution issue in the application.
339
+ - Fixed the issue where a space in the variable name causes it to return an undefined value.
340
+ - Fixed the URL path generation issue that occurred while using context in the development setup.
341
+
342
+
343
+ # v0.0.10 (12-05-2025)
344
+ **Feature:-**
345
+ - `alias` support for `build:es` and `build:lib`
346
+ - Add babel-plugin-module-resolver dependencies
347
+ - Modify getBabelPlugin to include module resolver with aliases
348
+
349
+ **Bug Fix:-**
350
+ - Enhance runBabelForTSFile to handle both .tsx and .ts file extensions
351
+ - Update mockApiHandler to ensure mock function is called correctly
352
+
353
+ **Change:-**
354
+ - Refactor defaultConfigValues.js to include cli options for enableRTLSplit
355
+
356
+ ## v0.0.9
357
+
358
+ **Feature:-**
359
+ - externals was added to Prevent bundling of certain imported packages and retrieve these external dependencies at runtime.
360
+ - to use externals, we use the following pattern in `app > externals` :
361
+
362
+ For example
363
+ ```
364
+ externals: {
365
+ <key> : <value>
366
+ }
367
+ ```
368
+
369
+ ## v0.0.6 (4-09-2023)
370
+
371
+ **Feature:-**
372
+ - Generating bundle integrity report json file for the build assets only in production mode. To use this feature we need to add `stats > enable` or cli flags `enable_stats`.
373
+ - Added Resource Cleanup plugin to cleanup resource retained by build tool. this plugin is controlled by efc flag resourcecleanup flag.
374
+ - added support for using regex expression to get group of chunks chunkId via Resource Hint plugin prefetch/preload hook.
375
+ only will be activate when `resourceHints` => `allowPrefetchingMultipleChunks` as `true`
376
+ - added support for glob pattern for custom chunks split logic.
377
+ - added options to split chunks base config in the key `app` => `customChunksBaseConfig` as object
378
+
379
+ **Change:-**
380
+ - i18n name not generated issue fix.
381
+ - public path not correctly set issue fix.
382
+ - changing plugin hook stages in i18nRuntimePlugin and sourceMapPlugin
383
+ ## v0.0.5 (6-08-2023)
384
+
385
+ **Changes:--**
386
+ - Typo fix in i18nRuntimeDealerPlugin.js
387
+ - fixing some bugs in resolvers.js file
388
+
389
+ ## v0.0.3 (1-08-2023)
390
+
391
+ **Changes:--**
392
+ - `devtool` default value changed from `hidden-cheap-source-map` to `source-map`
393
+ - unwanted files deleted from build
394
+
395
+ **Issue Fix:--**
396
+ - The issue with the source map not being created in the build has been fixed."
397
+
398
+
399
+ ## v0.0.2 (28-04-2023)
400
+
401
+ **Features:-**
402
+
403
+ - `devModeContentHashAllowedTypes` support added for some project there will be a need for hash even though they run dev mode. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#devModeContentHashAllowedTypes)
404
+ - `devLikeHash` support for disable content hash for file names in production mode. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#devLikeHash)
405
+ - `disableReactDevWarning` disable react dev warning such as prop-type warnings will be removed in dev mode build or server. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#disableReactDevWarning) can be enabled via `--disable_react_dev_warning` too.
406
+ - `statsLogConfig` support to customize default webpack log after build finished. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#statsLogConfig) can be enabled via `--disable_react_dev_warning` too.
407
+ - `enableChunkHash` renamed as `enableFileNameHashing`
408
+
409
+ - `pre_processor` command to run the preprocessor.js file.preProcessor runs in build, start, buildEs, buildLib commands bu default. and we have watch mode support as well with the option (`-w`)
410
+ - `createSeparateSmap` flag `source_map_enable` renamed as `enable_smap`
411
+ - `removeAttribute` option changes as `babelCustomizations.removeAttribute`
412
+ - `removePropTypes` support for remove the prop types package in the output build.
413
+ - `devConsoleExclude` support for remove the _console statements_ such as _console.log_, _console.warn_ in the output build.
414
+ - `manifestJson` default value set as false.
415
+ - `customAttributes` support for add attributes to html, link , script tag in the output build.
416
+
417
+
297
418
  ## v0.0.1 (18-04-2023)
298
419
 
299
420
  First Release
package/README_backup.md CHANGED
@@ -190,6 +190,110 @@ For example
190
190
  - `customAttributes` support for add attributes to html, link , script tag in the output build.
191
191
 
192
192
 
193
+ ## v0.0.1 (18-04-2023)
194
+
195
+ First Release
196
+ **Features:-**
197
+
198
+ - 'start' command to run react app
199
+ - 'build' command to create build for react app
200
+ - 'build:lib' command to create lib for react library
201
+ - 'build:es' command to create es for react library
202
+ - 'templates' command to create es for react library
203
+ # Changelog and Release Notes
204
+
205
+ # v0.0.12 (14-08-2025)
206
+
207
+ - Fixed the initial i18n loading issue caused by using the same function in both the i18nRuntimeDealer plugin and decidePublicPath
208
+
209
+ # v0.0.11 (07-08-2025) (had an issue while enable i18n chunk split plugin)
210
+ - remove babel-plugin-module-resolver dependencies
211
+
212
+ **Adjustments:-**
213
+ - Public Folder configuration is separated for development and production
214
+
215
+ **Bug Fix:-**
216
+ - Fixed the issue where the build log was not visible when `stats (bundle integrity)` was enabled. The problem was resolved by adding an error check in the `bundleIntegrity plugin`.
217
+ - Removed the babel-plugin-module-resolver dependency to resolve the alias resolution issue in the application.
218
+ - Fixed the issue where a space in the variable name causes it to return an undefined value.
219
+ - Fixed the URL path generation issue that occurred while using context in the development setup.
220
+
221
+
222
+ # v0.0.10 (12-05-2025)
223
+ **Feature:-**
224
+ - `alias` support for `build:es` and `build:lib`
225
+ - Add babel-plugin-module-resolver dependencies
226
+ - Modify getBabelPlugin to include module resolver with aliases
227
+
228
+ **Bug Fix:-**
229
+ - Enhance runBabelForTSFile to handle both .tsx and .ts file extensions
230
+ - Update mockApiHandler to ensure mock function is called correctly
231
+
232
+ **Change:-**
233
+ - Refactor defaultConfigValues.js to include cli options for enableRTLSplit
234
+
235
+ ## v0.0.9
236
+
237
+ **Feature:-**
238
+ - externals was added to Prevent bundling of certain imported packages and retrieve these external dependencies at runtime.
239
+ - to use externals, we use the following pattern in `app > externals` :
240
+
241
+ For example
242
+ ```
243
+ externals: {
244
+ <key> : <value>
245
+ }
246
+ ```
247
+
248
+ ## v0.0.6 (4-09-2023)
249
+
250
+ **Feature:-**
251
+ - Generating bundle integrity report json file for the build assets only in production mode. To use this feature we need to add `stats > enable` or cli flags `enable_stats`.
252
+ - Added Resource Cleanup plugin to cleanup resource retained by build tool. this plugin is controlled by efc flag resourcecleanup flag.
253
+ - added support for using regex expression to get group of chunks chunkId via Resource Hint plugin prefetch/preload hook.
254
+ only will be activate when `resourceHints` => `allowPrefetchingMultipleChunks` as `true`
255
+ - added support for glob pattern for custom chunks split logic.
256
+ - added options to split chunks base config in the key `app` => `customChunksBaseConfig` as object
257
+
258
+ **Change:-**
259
+ - i18n name not generated issue fix.
260
+ - public path not correctly set issue fix.
261
+ - changing plugin hook stages in i18nRuntimePlugin and sourceMapPlugin
262
+ ## v0.0.5 (6-08-2023)
263
+
264
+ **Changes:--**
265
+ - Typo fix in i18nRuntimeDealerPlugin.js
266
+ - fixing some bugs in resolvers.js file
267
+
268
+ ## v0.0.3 (1-08-2023)
269
+
270
+ **Changes:--**
271
+ - `devtool` default value changed from `hidden-cheap-source-map` to `source-map`
272
+ - unwanted files deleted from build
273
+
274
+ **Issue Fix:--**
275
+ - The issue with the source map not being created in the build has been fixed."
276
+
277
+
278
+ ## v0.0.2 (28-04-2023)
279
+
280
+ **Features:-**
281
+
282
+ - `devModeContentHashAllowedTypes` support added for some project there will be a need for hash even though they run dev mode. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#devModeContentHashAllowedTypes)
283
+ - `devLikeHash` support for disable content hash for file names in production mode. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#devLikeHash)
284
+ - `disableReactDevWarning` disable react dev warning such as prop-type warnings will be removed in dev mode build or server. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#disableReactDevWarning) can be enabled via `--disable_react_dev_warning` too.
285
+ - `statsLogConfig` support to customize default webpack log after build finished. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#statsLogConfig) can be enabled via `--disable_react_dev_warning` too.
286
+ - `enableChunkHash` renamed as `enableFileNameHashing`
287
+
288
+ - `pre_processor` command to run the preprocessor.js file.preProcessor runs in build, start, buildEs, buildLib commands bu default. and we have watch mode support as well with the option (`-w`)
289
+ - `createSeparateSmap` flag `source_map_enable` renamed as `enable_smap`
290
+ - `removeAttribute` option changes as `babelCustomizations.removeAttribute`
291
+ - `removePropTypes` support for remove the prop types package in the output build.
292
+ - `devConsoleExclude` support for remove the _console statements_ such as _console.log_, _console.warn_ in the output build.
293
+ - `manifestJson` default value set as false.
294
+ - `customAttributes` support for add attributes to html, link , script tag in the output build.
295
+
296
+
193
297
  ## v0.0.1 (18-04-2023)
194
298
 
195
299
  First Release
@@ -350,6 +350,11 @@ var _default = {
350
350
  customScriptLoadingStrategey: {
351
351
  enable: false,
352
352
  options: null
353
+ },
354
+ murphyBootstrapHtml: {
355
+ enable: false,
356
+ chunkName: '',
357
+ filePath: ''
353
358
  }
354
359
  };
355
360
  exports.default = _default;
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _SingleEntryPlugin = _interopRequireDefault(require("webpack/lib/SingleEntryPlugin.js"));
9
+
10
+ var _nameTemplates = require("../../common/nameTemplates");
11
+
12
+ var _htmlWebpackPlugin = _interopRequireDefault(require("html-webpack-plugin"));
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ const pluginName = 'MurphyInjectorPlugin';
17
+
18
+ class MurphyInjectorPlugin {
19
+ constructor(entries = [], options) {
20
+ this.entries = entries;
21
+ this.options = options;
22
+ this.jsTemplate = options.cdnMapping.jsTemplate || '{{__JS_CDN__}}';
23
+ this.cdnMapping = options.cdnMapping;
24
+ }
25
+
26
+ apply(compiler) {
27
+ compiler.hooks.thisCompilation.tap(pluginName, compilation => {
28
+ this.entries.forEach(({
29
+ name,
30
+ file
31
+ }) => {
32
+ // Create child compiler for this entry
33
+ const childCompiler = compilation.createChildCompiler(`additional-entry ${name}`, {
34
+ filename: (0, _nameTemplates.nameTemplates)('js', this.options),
35
+ // output filename
36
+ chunkFilename: `${name}.[id].js`,
37
+ publicPath: compiler.options.output.publicPath,
38
+ globalObject: "self" // safe for workers too
39
+
40
+ }); // Attach the entry point
41
+
42
+ new _SingleEntryPlugin.default(compiler.context, file, name).apply(childCompiler); // Run the child compiler
43
+
44
+ childCompiler.runAsChild((err, entries, childCompilation) => {
45
+ if (err) {
46
+ compilation.errors.push(err);
47
+ return;
48
+ }
49
+
50
+ if (childCompilation.errors && childCompilation.errors.length) {
51
+ compilation.errors.push(...childCompilation.errors);
52
+ } // Files are emitted automatically by child compiler
53
+ // ⚡ Hook HtmlWebpackPlugin and inject this file
54
+
55
+
56
+ _htmlWebpackPlugin.default.getHooks(compilation).alterAssetTags.tapAsync(pluginName, (data, cb) => {
57
+ let fileName = '';
58
+ const childFiles = childCompilation.entrypoints.get(name).getFiles();
59
+
60
+ if (childFiles.length !== 1) {
61
+ compilation.errors.push(new Error(`${pluginName}: Expected exactly 1 child file for entry "${name}", but got ${childFiles.length}.`));
62
+ }
63
+
64
+ if (this.cdnMapping.isCdnEnabled) {
65
+ fileName = `${this.jsTemplate}${childFiles[0]}`;
66
+ }
67
+
68
+ ;
69
+ data.assetTags.scripts.unshift({
70
+ tagName: "script",
71
+ voidTag: false,
72
+ attributes: {
73
+ src: fileName
74
+ },
75
+ meta: {
76
+ plugin: pluginName
77
+ }
78
+ });
79
+ cb(null, data);
80
+ });
81
+ });
82
+ });
83
+ });
84
+ }
85
+
86
+ }
87
+
88
+ var _default = MurphyInjectorPlugin;
89
+ exports.default = _default;
@@ -44,6 +44,18 @@ class SourceMapPlugin {
44
44
  }
45
45
  }
46
46
  });
47
+ });
48
+ compilation.hooks.processAssets.tap({
49
+ name: pluginName,
50
+ stage: _webpack.Compilation.PROCESS_ASSETS_STAGE_REPORT
51
+ }, assets => {
52
+ Object.keys(assets).forEach(assetName => {
53
+ const assetCode = assets[assetName].source();
54
+
55
+ if (/\.map$/.test(assetName)) {
56
+ compilation.emitAsset(assetName.split('smap/')[1], new RawSource(assetCode));
57
+ }
58
+ });
47
59
  }); // if contenthash enabled we need to add this to include the runtime files
48
60
  // compilation.hooks.processAssets.tap(
49
61
  // {
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.configMurphyInjectorPlugin = configMurphyInjectorPlugin;
7
+
8
+ var _constants = require("../../../constants");
9
+
10
+ var _MurphyInjectorPlugin = _interopRequireDefault(require("../custom_plugins/MurphyInjectorPlugin"));
11
+
12
+ var _path = _interopRequireDefault(require("path"));
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ function configMurphyInjectorPlugin(options) {
17
+ const {
18
+ enable,
19
+ chunkName,
20
+ filePath
21
+ } = options.murphyBootstrapHtml;
22
+
23
+ if (enable) {
24
+ return new _MurphyInjectorPlugin.default([{
25
+ name: chunkName,
26
+ file: _path.default.join(_constants.appPath, filePath)
27
+ }], options);
28
+ }
29
+
30
+ return null;
31
+ }
@@ -47,6 +47,8 @@ var _configBundleIntegrityReport = require("./pluginConfigs/configBundleIntegrit
47
47
 
48
48
  var _configRuntimeResourceCleanup = require("./pluginConfigs/configRuntimeResourceCleanup");
49
49
 
50
+ var _configMurphyInjectorPlugin = require("./pluginConfigs/configMurphyInjectorPlugin");
51
+
50
52
  var _configCustomScriptLoadingStrategyPlugin = require("./pluginConfigs/configCustomScriptLoadingStrategyPlugin");
51
53
 
52
54
  // import { IgnorePlugin } from 'webpack';
@@ -54,5 +56,5 @@ function plugins(options) {
54
56
  const {
55
57
  webpackPlugins
56
58
  } = options;
57
- return [(0, _configEnvVariables.configEnvVariables)(options), (0, _configCustomAttributesPlugin.configCustomAttributesPlugin)(options), (0, _configTPHashMappingPlugin.configTPHashMappingPlugin)(options), (0, _configCopyPublicFolders.configCopyPublicFolders)(options), (0, _configIgnorePlugin.configIgnorePlugin)(options), (0, _configMiniCSSExtractPlugin.configMiniCSSExtractPlugin)(options), (0, _configSelectorWeightPlugin.configSelectorWeightPlugin)(options), (0, _configVariableConversionPlugin.configVariableConversionPlugin)(options), (0, _configI18nSplitPlugin.configI18nSplitPlugin)(options), (0, _configRtlCssPlugin.configRtlCssPlugin)(options), (0, _configHtmlWebpackPlugin.configHtmlWebpackPlugin)(options), (0, _configCustomScriptLoadingStrategyPlugin.configCustomScriptLoadingStrategyPlugin)(options), (0, _configCdnChangePlugin.configCdnChangePlugin)(options), (0, _configServiceWorkerPlugin.configServiceWorkerPlugin)(options), (0, _configEFCTemplatePlugin.configEFCTemplatePlugin)(options), (0, _configResourceHintsPlugin.configResourceHintsPlugin)(options), (0, _configBundleAnalyzer.configBundleAnalyzer)(options), (0, _configManifestJsonPlugin.configManifestJsonPlugin)(options), (0, _configSourceMapPlugin.configSourceMapPlugin)(options), (0, _configProgressPlugin.configProgressPlugin)(options), (0, _configBundleIntegrityReport.configBundleIntegrityReport)(options), (0, _configRuntimeResourceCleanup.configRuntimeResourceCleanup)(options), ...webpackPlugins].filter(Boolean);
59
+ return [(0, _configEnvVariables.configEnvVariables)(options), (0, _configCustomAttributesPlugin.configCustomAttributesPlugin)(options), (0, _configTPHashMappingPlugin.configTPHashMappingPlugin)(options), (0, _configCopyPublicFolders.configCopyPublicFolders)(options), (0, _configIgnorePlugin.configIgnorePlugin)(options), (0, _configMiniCSSExtractPlugin.configMiniCSSExtractPlugin)(options), (0, _configSelectorWeightPlugin.configSelectorWeightPlugin)(options), (0, _configVariableConversionPlugin.configVariableConversionPlugin)(options), (0, _configI18nSplitPlugin.configI18nSplitPlugin)(options), (0, _configRtlCssPlugin.configRtlCssPlugin)(options), (0, _configHtmlWebpackPlugin.configHtmlWebpackPlugin)(options), (0, _configCustomScriptLoadingStrategyPlugin.configCustomScriptLoadingStrategyPlugin)(options), (0, _configCdnChangePlugin.configCdnChangePlugin)(options), (0, _configServiceWorkerPlugin.configServiceWorkerPlugin)(options), (0, _configEFCTemplatePlugin.configEFCTemplatePlugin)(options), (0, _configResourceHintsPlugin.configResourceHintsPlugin)(options), (0, _configBundleAnalyzer.configBundleAnalyzer)(options), (0, _configManifestJsonPlugin.configManifestJsonPlugin)(options), (0, _configSourceMapPlugin.configSourceMapPlugin)(options), (0, _configProgressPlugin.configProgressPlugin)(options), (0, _configBundleIntegrityReport.configBundleIntegrityReport)(options), (0, _configRuntimeResourceCleanup.configRuntimeResourceCleanup)(options), (0, _configMurphyInjectorPlugin.configMurphyInjectorPlugin)(options), ...webpackPlugins].filter(Boolean);
58
60
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/client_build_tool",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "A CLI tool to build web applications and client libraries",
5
5
  "main": "lib/index.js",
6
6
  "bin": {