@zohodesk/client_build_tool 0.0.11-exp.9 → 0.0.12
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 +30 -0
- package/README.md +132 -0
- package/README_backup.md +102 -0
- package/lib/schemas/defaultConfigValues.js +8 -18
- package/lib/schemas/defaultConfigValuesOnly.js +4 -19
- package/lib/shared/babel/getBabelPlugin.js +3 -4
- package/lib/shared/babel/runBabelForTsFile.js +1 -1
- package/lib/shared/bundler/webpack/common/decidePublicPath.js +2 -2
- package/lib/shared/bundler/webpack/custom_plugins/BundleIntegrityReport/index.js +10 -0
- package/lib/shared/bundler/webpack/jsLoaders.js +2 -20
- package/lib/shared/bundler/webpack/pluginConfigs/configCopyPublicFolders.js +3 -2
- package/lib/shared/bundler/webpack/plugins.js +1 -3
- package/lib/shared/postcss/custom_postcss_plugins/VariableModificationPlugin/index.js +1 -1
- package/lib/shared/server/mockApiHandler.js +7 -0
- package/lib/shared/server/urlConcat.js +13 -1
- package/npm-shrinkwrap.json +354 -38
- package/package.json +6 -5
- package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexHtmlInjectorPlugin.js +0 -49
- package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexPlugin.js +0 -174
- package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/utils/i18nDataLoader.js +0 -108
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/collectAstKeys.js +0 -96
- package/lib/shared/bundler/webpack/loaderConfigs/i18nIdReplaceLoaderConfig.js +0 -74
- package/lib/shared/bundler/webpack/loaders/i18nIdReplaceLoader.js +0 -105
- package/lib/shared/bundler/webpack/pluginConfigs/configI18nNumericIndexPlugin.js +0 -79
- package/lib/shared/bundler/webpack/utils/propertiesParser.js +0 -103
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Shared properties file parsing utility
|
|
5
|
-
* Handles consistent parsing across all i18n tools
|
|
6
|
-
*/
|
|
7
|
-
// Decode Unicode escape sequences (for values only)
|
|
8
|
-
function decodeUnicodeEscapes(str) {
|
|
9
|
-
if (typeof str !== 'string') {
|
|
10
|
-
return str;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return str.replace(/\\u([0-9a-fA-F]{4})/g, (match, hex) => {
|
|
14
|
-
return String.fromCharCode(parseInt(hex, 16));
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Parse properties file content into key-value pairs
|
|
19
|
-
* @param {string} content - Properties file content
|
|
20
|
-
* @returns {Object} Parsed key-value pairs
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function parseProperties(content) {
|
|
25
|
-
const lines = content.split(/\r?\n/);
|
|
26
|
-
const data = {};
|
|
27
|
-
lines.forEach(line => {
|
|
28
|
-
const trimmedLine = line.trim();
|
|
29
|
-
|
|
30
|
-
if (trimmedLine.startsWith('#') || trimmedLine.startsWith('!') || trimmedLine === '') {
|
|
31
|
-
return;
|
|
32
|
-
} // Find unescaped separator (= or :)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
let separatorIndex = -1;
|
|
36
|
-
|
|
37
|
-
for (let i = 0; i < trimmedLine.length; i++) {
|
|
38
|
-
if ((trimmedLine[i] === '=' || trimmedLine[i] === ':') && (i === 0 || trimmedLine[i - 1] !== '\\')) {
|
|
39
|
-
separatorIndex = i;
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (separatorIndex > 0) {
|
|
45
|
-
let key = trimmedLine.substring(0, separatorIndex).trim();
|
|
46
|
-
let value = trimmedLine.substring(separatorIndex + 1).trim();
|
|
47
|
-
|
|
48
|
-
if (key) {
|
|
49
|
-
// Handle escaped spaces in keys only
|
|
50
|
-
key = key.replace(/\\ /g, ' '); // Decode Unicode escape sequences ONLY in values, not keys
|
|
51
|
-
|
|
52
|
-
value = decodeUnicodeEscapes(value);
|
|
53
|
-
data[key] = value;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
return data;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Parse properties file content into a Set of keys only
|
|
61
|
-
* @param {string} content - Properties file content
|
|
62
|
-
* @returns {Set<string>} Set of keys
|
|
63
|
-
*/
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
function parsePropertiesToKeySet(content) {
|
|
67
|
-
const lines = content.split(/\r?\n/);
|
|
68
|
-
const keys = new Set();
|
|
69
|
-
lines.forEach(line => {
|
|
70
|
-
const trimmedLine = line.trim();
|
|
71
|
-
|
|
72
|
-
if (trimmedLine.startsWith('#') || trimmedLine.startsWith('!') || trimmedLine === '') {
|
|
73
|
-
return;
|
|
74
|
-
} // Find unescaped separator (= or :)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
let separatorIndex = -1;
|
|
78
|
-
|
|
79
|
-
for (let i = 0; i < trimmedLine.length; i++) {
|
|
80
|
-
if ((trimmedLine[i] === '=' || trimmedLine[i] === ':') && (i === 0 || trimmedLine[i - 1] !== '\\')) {
|
|
81
|
-
separatorIndex = i;
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (separatorIndex > 0) {
|
|
87
|
-
let key = trimmedLine.substring(0, separatorIndex).trim();
|
|
88
|
-
|
|
89
|
-
if (key) {
|
|
90
|
-
// Handle escaped spaces in keys only
|
|
91
|
-
key = key.replace(/\\ /g, ' ');
|
|
92
|
-
keys.add(key);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
return keys;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
module.exports = {
|
|
100
|
-
parseProperties,
|
|
101
|
-
parsePropertiesToKeySet,
|
|
102
|
-
decodeUnicodeEscapes
|
|
103
|
-
};
|