@zohodesk/client_build_tool 0.0.10-exp.4 → 0.0.10-exp.7

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,16 +1,6 @@
1
1
  # Changelog and Release Notes
2
- # v0.0.10 (12-05-2025)
3
- **Feature:-**
4
- - `alias` support for `build:es` and `build:lib`
5
- - Add babel-plugin-module-resolver dependencies
6
- - Modify getBabelPlugin to include module resolver with aliases
7
2
 
8
- **Bug Fix:-**
9
- - Enhance runBabelForTSFile to handle both .tsx and .ts file extensions
10
- - Update mockApiHandler to ensure mock function is called correctly
11
3
 
12
- **Change:-**
13
- - Refactor defaultConfigValues.js to include cli options for enableRTLSplit
14
4
 
15
5
  **Feature:-**
16
6
  - externals was added to Prevent bundling of certain imported packages and retrieve these external dependencies at runtime.
package/README.md CHANGED
@@ -99,18 +99,8 @@ fixes :-
99
99
  - preload plc undefined url fixed
100
100
 
101
101
  # Changelog and Release Notes
102
- # v0.0.10 (12-05-2025)
103
- **Feature:-**
104
- - `alias` support for `build:es` and `build:lib`
105
- - Add babel-plugin-module-resolver dependencies
106
- - Modify getBabelPlugin to include module resolver with aliases
107
102
 
108
- **Bug Fix:-**
109
- - Enhance runBabelForTSFile to handle both .tsx and .ts file extensions
110
- - Update mockApiHandler to ensure mock function is called correctly
111
103
 
112
- **Change:-**
113
- - Refactor defaultConfigValues.js to include cli options for enableRTLSplit
114
104
 
115
105
  **Feature:-**
116
106
  - externals was added to Prevent bundling of certain imported packages and retrieve these external dependencies at runtime.
@@ -115,10 +115,7 @@ var _default = {
115
115
  // Name Suggestions `customizations` this will be easier then `plugin` to understand for developers
116
116
  plugins: {
117
117
  rtlSplit: {
118
- enableRTLSplit: {
119
- value: false,
120
- cli: 'enable_rtl_split'
121
- },
118
+ enableRTLSplit: false,
122
119
  templateLabel: '{{--dir}}',
123
120
  disableMinifySelector: false,
124
121
  dirVarName: 'document.dir'
@@ -20,14 +20,7 @@ function getBabelPlugin(options) {
20
20
  const {
21
21
  mode
22
22
  } = options;
23
- const {
24
- alias
25
- } = options.resolve; // let customPlugins = [];
26
-
27
- let customPlugins = [[require.resolve('babel-plugin-module-resolver'), {
28
- root: ['./'],
29
- alias
30
- }]];
23
+ let customPlugins = [];
31
24
  const {
32
25
  babelCustomizations
33
26
  } = options;
@@ -39,4 +32,6 @@ function getBabelPlugin(options) {
39
32
  }
40
33
 
41
34
  return customPlugins.filter(Boolean);
42
- }
35
+ }
36
+
37
+ ;
@@ -25,6 +25,6 @@ function runBabelForTSFile({
25
25
  // const jsSourceCode = readFileSync(filename).toString();
26
26
  const babelConfig = (0, _babelWebConfig.babelWebConfig)(options, mode);
27
27
  const result = (0, _core.transformFileSync)(filename, babelConfig);
28
- (0, _copyFile.writeFile)(outputFile.replace('.tsx', '.js').replace('.ts', '.js'), result.code);
28
+ (0, _copyFile.writeFile)(outputFile.replace('.tsx', '.js'), result.code);
29
29
  }
30
30
  }
@@ -7,6 +7,10 @@ exports.SourceMapPlugin = void 0;
7
7
 
8
8
  var _webpack = require("webpack");
9
9
 
10
+ var _path = _interopRequireDefault(require("path"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
10
14
  /* eslint-disable class-methods-use-this */
11
15
  function checkSmapFilePattern(assetName) {
12
16
  return /\.js$/.test(assetName) && !/\.i18n\.js$/.test(assetName) || /\.js\.map$/.test(assetName) && !/\.i18n\.js\.map$/.test(assetName);
@@ -44,6 +48,38 @@ class SourceMapPlugin {
44
48
  }
45
49
  }
46
50
  });
51
+ });
52
+ compilation.hooks.processAssets.tap({
53
+ name: 'CustomSourceMapPathPlugin',
54
+ stage: _webpack.Compilation.PROCESS_ASSETS_STAGE_REPORT
55
+ }, assets => {
56
+ const newAssets = {};
57
+
58
+ for (const [filename, asset] of Object.entries(assets)) {
59
+ if (!filename.endsWith('.map')) {
60
+ const source = asset.source().toString();
61
+ const updatedSource = source.replace(/\/\/# sourceMappingURL=(.*\.js\.map)/, `//# sourceMappingURL=../../js/$1`);
62
+ compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(updatedSource));
63
+ }
64
+
65
+ ;
66
+ const jsFile = filename.slice(0, -4);
67
+ const chunk = compilation.chunks.find(c => c.files.has(jsFile));
68
+
69
+ if (chunk) {
70
+ ;
71
+ const isInitial = chunk.canBeInitial();
72
+ const folder = isInitial ? 'js/' : 'js-chunks/';
73
+
74
+ const baseName = _path.default.basename(jsFile);
75
+
76
+ const newMapPath = folder + baseName + '.map';
77
+ newAssets[newMapPath] = asset;
78
+ delete compilation.assets[filename];
79
+ }
80
+ }
81
+
82
+ Object.assign(compilation.assets, newAssets);
47
83
  }); // if contenthash enabled we need to add this to include the runtime files
48
84
  // compilation.hooks.processAssets.tap(
49
85
  // {
@@ -44,13 +44,6 @@ function handleMockApi(mockEntryFile, app) {
44
44
  const entryFilePath = (0, _constants.joinWithAppPath)(mockEntryFile); // eslint-disable-next-line no-use-before-define
45
45
 
46
46
  const mockFunc = safeRequire(entryFilePath);
47
-
48
- if (typeof mockFunc === 'function') {
49
- // eslint-disable-next-line no-use-before-define
50
- mockFunc(app);
51
- return;
52
- }
53
-
54
47
  mockFunc?.mockApi?.(app);
55
48
  } // function handleMockApi(params) {
56
49
  // }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/client_build_tool",
3
- "version": "0.0.10-exp.3",
3
+ "version": "0.0.6-exp.43",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
@@ -1961,52 +1961,6 @@
1961
1961
  "object.assign": "^4.1.0"
1962
1962
  }
1963
1963
  },
1964
- "babel-plugin-module-resolver": {
1965
- "version": "5.0.2",
1966
- "resolved": "https://registry.npmjs.org/babel-plugin-module-resolver/-/babel-plugin-module-resolver-5.0.2.tgz",
1967
- "integrity": "sha512-9KtaCazHee2xc0ibfqsDeamwDps6FZNo5S0Q81dUqEuFzVwPhcT4J5jOqIVvgCA3Q/wO9hKYxN/Ds3tIsp5ygg==",
1968
- "requires": {
1969
- "find-babel-config": "^2.1.1",
1970
- "glob": "^9.3.3",
1971
- "pkg-up": "^3.1.0",
1972
- "reselect": "^4.1.7",
1973
- "resolve": "^1.22.8"
1974
- },
1975
- "dependencies": {
1976
- "brace-expansion": {
1977
- "version": "2.0.1",
1978
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
1979
- "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
1980
- "requires": {
1981
- "balanced-match": "^1.0.0"
1982
- }
1983
- },
1984
- "glob": {
1985
- "version": "9.3.5",
1986
- "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz",
1987
- "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==",
1988
- "requires": {
1989
- "fs.realpath": "^1.0.0",
1990
- "minimatch": "^8.0.2",
1991
- "minipass": "^4.2.4",
1992
- "path-scurry": "^1.6.1"
1993
- }
1994
- },
1995
- "minimatch": {
1996
- "version": "8.0.4",
1997
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz",
1998
- "integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==",
1999
- "requires": {
2000
- "brace-expansion": "^2.0.1"
2001
- }
2002
- },
2003
- "reselect": {
2004
- "version": "4.1.8",
2005
- "resolved": "https://registry.npmjs.org/reselect/-/reselect-4.1.8.tgz",
2006
- "integrity": "sha512-ab9EmR80F/zQTMNeneUr4cv+jSwPJgIlvEmVwLerwrWVbpLlBuls9XHzIeTFy4cegU2NHBp3va0LKOzU5qFEYQ=="
2007
- }
2008
- }
2009
- },
2010
1964
  "babel-plugin-polyfill-corejs2": {
2011
1965
  "version": "0.3.1",
2012
1966
  "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.1.tgz",
@@ -2988,14 +2942,6 @@
2988
2942
  }
2989
2943
  }
2990
2944
  },
2991
- "find-babel-config": {
2992
- "version": "2.1.2",
2993
- "resolved": "https://registry.npmjs.org/find-babel-config/-/find-babel-config-2.1.2.tgz",
2994
- "integrity": "sha512-ZfZp1rQyp4gyuxqt1ZqjFGVeVBvmpURMqdIWXbPRfB97Bf6BzdK/xSIbylEINzQ0kB5tlDQfn9HkNXXWsqTqLg==",
2995
- "requires": {
2996
- "json5": "^2.2.3"
2997
- }
2998
- },
2999
2945
  "find-up": {
3000
2946
  "version": "4.1.0",
3001
2947
  "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
@@ -3042,9 +2988,9 @@
3042
2988
  "optional": true
3043
2989
  },
3044
2990
  "function-bind": {
3045
- "version": "1.1.2",
3046
- "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
3047
- "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="
2991
+ "version": "1.1.1",
2992
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
2993
+ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
3048
2994
  },
3049
2995
  "fz-i18n": {
3050
2996
  "version": "1.2.0-beta.15",
@@ -3165,14 +3111,6 @@
3165
3111
  "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
3166
3112
  "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A=="
3167
3113
  },
3168
- "hasown": {
3169
- "version": "2.0.2",
3170
- "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
3171
- "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
3172
- "requires": {
3173
- "function-bind": "^1.1.2"
3174
- }
3175
- },
3176
3114
  "he": {
3177
3115
  "version": "1.2.0",
3178
3116
  "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
@@ -3382,11 +3320,11 @@
3382
3320
  }
3383
3321
  },
3384
3322
  "is-core-module": {
3385
- "version": "2.16.1",
3386
- "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz",
3387
- "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==",
3323
+ "version": "2.9.0",
3324
+ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz",
3325
+ "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==",
3388
3326
  "requires": {
3389
- "hasown": "^2.0.2"
3327
+ "has": "^1.0.3"
3390
3328
  }
3391
3329
  },
3392
3330
  "is-extglob": {
@@ -3777,11 +3715,6 @@
3777
3715
  "brace-expansion": "^1.1.7"
3778
3716
  }
3779
3717
  },
3780
- "minipass": {
3781
- "version": "4.2.8",
3782
- "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.8.tgz",
3783
- "integrity": "sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ=="
3784
- },
3785
3718
  "moment": {
3786
3719
  "version": "2.29.4",
3787
3720
  "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
@@ -4053,27 +3986,6 @@
4053
3986
  "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
4054
3987
  "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
4055
3988
  },
4056
- "path-scurry": {
4057
- "version": "1.11.1",
4058
- "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",
4059
- "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",
4060
- "requires": {
4061
- "lru-cache": "^10.2.0",
4062
- "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
4063
- },
4064
- "dependencies": {
4065
- "lru-cache": {
4066
- "version": "10.4.3",
4067
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",
4068
- "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="
4069
- },
4070
- "minipass": {
4071
- "version": "7.1.2",
4072
- "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",
4073
- "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw=="
4074
- }
4075
- }
4076
- },
4077
3989
  "path-to-regexp": {
4078
3990
  "version": "0.1.7",
4079
3991
  "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
@@ -4107,46 +4019,6 @@
4107
4019
  "find-up": "^4.0.0"
4108
4020
  }
4109
4021
  },
4110
- "pkg-up": {
4111
- "version": "3.1.0",
4112
- "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz",
4113
- "integrity": "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==",
4114
- "requires": {
4115
- "find-up": "^3.0.0"
4116
- },
4117
- "dependencies": {
4118
- "find-up": {
4119
- "version": "3.0.0",
4120
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
4121
- "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
4122
- "requires": {
4123
- "locate-path": "^3.0.0"
4124
- }
4125
- },
4126
- "locate-path": {
4127
- "version": "3.0.0",
4128
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
4129
- "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
4130
- "requires": {
4131
- "p-locate": "^3.0.0",
4132
- "path-exists": "^3.0.0"
4133
- }
4134
- },
4135
- "p-locate": {
4136
- "version": "3.0.0",
4137
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
4138
- "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
4139
- "requires": {
4140
- "p-limit": "^2.0.0"
4141
- }
4142
- },
4143
- "path-exists": {
4144
- "version": "3.0.0",
4145
- "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
4146
- "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ=="
4147
- }
4148
- }
4149
- },
4150
4022
  "postcss": {
4151
4023
  "version": "8.4.21",
4152
4024
  "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.21.tgz",
@@ -4779,11 +4651,11 @@
4779
4651
  "integrity": "sha512-qUgANli03jjAyGlnbYVAV5vvnOmJnODyABz51RdBN7M4WaVu8mecZWgyQNkG8Yqe3KRGRt0l4K4B3XVEULC4CA=="
4780
4652
  },
4781
4653
  "resolve": {
4782
- "version": "1.22.10",
4783
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz",
4784
- "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==",
4654
+ "version": "1.22.1",
4655
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz",
4656
+ "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==",
4785
4657
  "requires": {
4786
- "is-core-module": "^2.16.0",
4658
+ "is-core-module": "^2.9.0",
4787
4659
  "path-parse": "^1.0.7",
4788
4660
  "supports-preserve-symlinks-flag": "^1.0.0"
4789
4661
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/client_build_tool",
3
- "version": "0.0.10-exp.4",
3
+ "version": "0.0.10-exp.7",
4
4
  "description": "A CLI tool to build web applications and client libraries",
5
5
  "main": "lib/index.js",
6
6
  "bin": {
@@ -31,10 +31,8 @@
31
31
  "@babel/core": "7.18.5",
32
32
  "@babel/preset-env": "7.18.2",
33
33
  "@babel/preset-react": "7.17.12",
34
- "@babel/preset-typescript": "7.23.2",
35
34
  "@zohodesk/client_packages_group": "1.0.2",
36
35
  "babel-loader": "9.1.2",
37
- "babel-plugin-module-resolver": "5.0.2",
38
36
  "babel-plugin-transform-react-remove-prop-types": "0.4.24",
39
37
  "babel-plugin-transform-remove-console": "6.9.4",
40
38
  "copy-webpack-plugin": "11.0.0",
@@ -52,13 +50,14 @@
52
50
  "postcss": "8.4.21",
53
51
  "postcss-loader": "7.0.2",
54
52
  "postcss-rtl": "2.0.0",
55
- "ts-loader": "8.2.0",
56
- "typescript": "5.2.2",
57
53
  "uglifycss": "0.0.29",
58
54
  "watcher": "1.2.0",
59
55
  "webpack": "5.79.0",
60
56
  "webpack-bundle-analyzer": "4.8.0",
61
57
  "webpack-cli": "4.10.0",
62
- "webpack-dev-middleware": "6.1.1"
58
+ "webpack-dev-middleware": "6.1.1",
59
+ "typescript": "5.2.2",
60
+ "ts-loader": "8.2.0",
61
+ "@babel/preset-typescript": "7.23.2"
63
62
  }
64
63
  }