@zohodesk/client_build_tool 0.0.1-0.exp.0.0.8 → 0.0.1-0.exp.1.0.3

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 (28) hide show
  1. package/CHANGELOG.md +0 -10
  2. package/README.md +0 -10
  3. package/lib/schemas/defaultConfigValues.js +14 -63
  4. package/lib/schemas/defaultConfigValuesOnly.js +6 -10
  5. package/lib/shared/babel/getBabelPlugin.js +4 -9
  6. package/lib/shared/babel/runBabelForTsFile.js +1 -1
  7. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexHtmlInjectorPlugin.js +14 -12
  8. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexPlugin.js +90 -426
  9. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexPlugin_simplified.js +129 -0
  10. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/i18nDataLoader.js +134 -0
  11. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/utils/i18nDataLoader.js +113 -0
  12. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nFilesEmitPlugin.js +5 -66
  13. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/optionsHandler.js +0 -3
  14. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/collectAstKeys.js +4 -6
  15. package/lib/shared/bundler/webpack/custom_plugins/getInitialI18nAssetsArrayStr.js +1 -6
  16. package/lib/shared/bundler/webpack/jsLoaders.js +12 -7
  17. package/lib/shared/bundler/webpack/loaderConfigs/i18nIdReplaceLoaderConfig.js +37 -88
  18. package/lib/shared/bundler/webpack/loaders/i18nIdReplaceLoader.js +67 -191
  19. package/lib/shared/bundler/webpack/pluginConfigs/configI18nNumericIndexPlugin.js +27 -99
  20. package/lib/shared/bundler/webpack/pluginConfigs/configI18nSplitPlugin.js +1 -4
  21. package/lib/shared/bundler/webpack/plugins.js +3 -20
  22. package/lib/shared/bundler/webpack/utils/i18n/collectAstKeys.js +96 -0
  23. package/lib/shared/bundler/webpack/utils/propertiesParser.js +1 -1
  24. package/lib/shared/server/mockApiHandler.js +0 -7
  25. package/npm-shrinkwrap.json +32 -8225
  26. package/package.json +5 -6
  27. package/lib/shared/bundler/webpack/common/hashUtils.js +0 -20
  28. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/CLAUDE.md +0 -0
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'
@@ -175,67 +172,21 @@ var _default = {
175
172
  jsonpFunc: 'console.log',
176
173
  jsResource: null,
177
174
  propertiesFolder: null,
178
- propertiesPattern: '',
179
- // NEW OPTIONS FOR NUMERIC INDEXING IN CHUNK SPLIT
180
- useNumericIndexing: {
181
- value: false,
182
- cli: 'i18n_split_use_numeric'
183
- },
184
- numericMapPath: {
185
- value: './deskapp/properties/i18n-numeric-map.json',
186
- cli: 'i18n_split_numeric_map_path'
187
- }
175
+ useNumericIndexing: false
188
176
  },
189
177
  i18nIndexing: {
190
- enable: {
191
- value: false,
192
- cli: 'i18n_idx_enable'
193
- },
194
- jsResourcePath: {
195
- value: './deskapp/properties/JSResources.properties',
196
- cli: 'i18n_idx_js_resource_path'
197
- },
198
- propertiesFolderPath: {
199
- value: './deskapp/properties',
200
- cli: 'i18n_idx_properties_folder_path'
201
- },
202
- numericMapPath: {
203
- value: './deskapp/properties/i18n-numeric-map.json',
204
- cli: 'i18n_idx_numeric_map_path'
205
- },
206
- numericFilenameTemplate: {
207
- value: 'i18n-chunks/[locale]/numeric.[contenthash].js',
208
- cli: 'i18n_idx_numeric_filename_template'
209
- },
210
- dynamicFilenameTemplate: {
211
- value: 'i18n-chunks/[locale]/dynamic.[contenthash].js',
212
- cli: 'i18n_idx_dynamic_filename_template'
213
- },
214
- jsonpFunc: {
215
- value: 'window.loadI18nChunk',
216
- cli: 'i18n_idx_jsonp_func'
217
- },
218
- htmlTemplateLabel: {
219
- value: '{{--user-locale}}',
220
- cli: 'i18n_idx_html_template_label'
221
- },
222
- localeVarName: {
223
- value: 'window.userLangCode',
224
- cli: 'i18n_idx_locale_var_name'
225
- },
226
- // NEW LOADER CONFIGURATION OPTIONS
227
- retainLines: {
228
- value: false,
229
- cli: 'i18n_idx_retain_lines'
230
- },
231
- preserveComments: {
232
- value: true,
233
- cli: 'i18n_idx_preserve_comments'
234
- },
235
- babelPlugins: {
236
- value: null,
237
- cli: 'i18n_idx_babel_plugins'
238
- }
178
+ enable: false,
179
+ jsResourcePath: './deskapp/properties/JSResources.properties',
180
+ propertiesFolderPath: './deskapp/properties',
181
+ numericMapPath: './deskapp/properties/i18n-numeric-map.json',
182
+ numericFilenameTemplate: 'i18n-chunk/[locale]/numeric.i18n.js',
183
+ dynamicFilenameTemplate: 'i18n-chunk/[locale]/dynamic.i18n.js',
184
+ jsonpFunc: 'window.loadI18nChunk',
185
+ htmlTemplateLabel: '{{--user-locale}}',
186
+ localeVarName: 'window.userLangCode',
187
+ singleFile: false,
188
+ includeContentHash: false,
189
+ generateManifest: false
239
190
  },
240
191
  publicFolders: ['...'],
241
192
  app: {
@@ -95,25 +95,21 @@ var _default = {
95
95
  jsonpFunc: 'console.log',
96
96
  jsResource: null,
97
97
  propertiesFolder: null,
98
- propertiesPattern: '',
99
- // NEW OPTIONS FOR NUMERIC INDEXING IN CHUNK SPLIT
100
- useNumericIndexing: false,
101
- numericMapPath: './deskapp/properties/i18n-numeric-map.json'
98
+ useNumericIndexing: false
102
99
  },
103
100
  i18nIndexing: {
104
101
  enable: false,
105
102
  jsResourcePath: './deskapp/properties/JSResources.properties',
106
103
  propertiesFolderPath: './deskapp/properties',
107
104
  numericMapPath: './deskapp/properties/i18n-numeric-map.json',
108
- numericFilenameTemplate: 'i18n-chunks/[locale]/numeric.[contenthash].js',
109
- dynamicFilenameTemplate: 'i18n-chunks/[locale]/dynamic.[contenthash].js',
105
+ numericFilenameTemplate: 'i18n-chunk/[locale]/numeric.i18n.js',
106
+ dynamicFilenameTemplate: 'i18n-chunk/[locale]/dynamic.i18n.js',
110
107
  jsonpFunc: 'window.loadI18nChunk',
111
108
  htmlTemplateLabel: '{{--user-locale}}',
112
109
  localeVarName: 'window.userLangCode',
113
- // NEW LOADER CONFIGURATION OPTIONS
114
- retainLines: false,
115
- preserveComments: true,
116
- babelPlugins: null
110
+ singleFile: false,
111
+ includeContentHash: false,
112
+ generateManifest: false
117
113
  },
118
114
  publicFolders: ['...', {
119
115
  source: './deskapp/tp/',
@@ -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
  }
@@ -2,10 +2,6 @@
2
2
 
3
3
  const HtmlWebpackPlugin = require('html-webpack-plugin');
4
4
 
5
- var {
6
- urlConcat
7
- } = require("../../../../server/urlConcat");
8
-
9
5
  const pluginName = 'I18nNumericIndexHtmlInjectorPlugin';
10
6
 
11
7
  class I18nNumericIndexHtmlInjectorPlugin {
@@ -20,19 +16,25 @@ class I18nNumericIndexHtmlInjectorPlugin {
20
16
  assets
21
17
  } = hookData;
22
18
  const {
19
+ numericFilenameTemplate,
20
+ dynamicFilenameTemplate,
21
+ htmlTemplateLabel,
23
22
  i18nAssetsPublicPathPrefix = ''
24
23
  } = this.options;
25
- const DEFAULT_LOCALE = '{{--user-locale}}';
26
- const NUMERIC_FILENAME = `i18n-chunks/${DEFAULT_LOCALE}/numeric.i18n.js`;
27
- const DYNAMIC_FILENAME = `i18n-chunks/${DEFAULT_LOCALE}/dynamic.i18n.js`;
28
24
  const newI18nAssetUrlsToAdd = [];
29
- const numericAssetUrl = urlConcat('', NUMERIC_FILENAME);
30
- newI18nAssetUrlsToAdd.push(numericAssetUrl);
31
- const dynamicAssetUrl = urlConcat('', DYNAMIC_FILENAME);
32
- newI18nAssetUrlsToAdd.push(dynamicAssetUrl);
25
+
26
+ if (numericFilenameTemplate) {
27
+ const numericFilename = numericFilenameTemplate.replace(/\[locale\]/g, htmlTemplateLabel);
28
+ newI18nAssetUrlsToAdd.push(numericFilename);
29
+ }
30
+
31
+ if (dynamicFilenameTemplate) {
32
+ const dynamicFilename = dynamicFilenameTemplate.replace(/\[locale\]/g, htmlTemplateLabel);
33
+ newI18nAssetUrlsToAdd.push(dynamicFilename);
34
+ }
33
35
 
34
36
  if (newI18nAssetUrlsToAdd.length > 0) {
35
- assets.js = [...newI18nAssetUrlsToAdd, ...assets.js];
37
+ assets.js = [...assets.js, ...newI18nAssetUrlsToAdd];
36
38
  }
37
39
 
38
40
  cb(null, hookData);