@zohodesk/react-cli 1.1.27-exp.2 → 1.1.27-exp.3
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/configs/libAlias.js +2 -2
- package/lib/configs/resolvers.js +2 -2
- package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +5 -2
- package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +1 -4
- package/lib/plugins/I18nSplitPlugin/utils/unicodeConversion.js +8 -6
- package/lib/schemas/index.js +1 -0
- package/npm-shrinkwrap.json +4 -4
- package/package.json +1 -1
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/index.js +0 -4
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/VariableModificationPlugin/index.js +6 -2
package/lib/configs/libAlias.js
CHANGED
@@ -23,7 +23,7 @@ const {
|
|
23
23
|
app
|
24
24
|
} = (0, _utils.getOptions)();
|
25
25
|
const {
|
26
|
-
|
26
|
+
disableES5Import
|
27
27
|
} = app;
|
28
28
|
|
29
29
|
function aliasPathCreation(customAlias) {
|
@@ -64,7 +64,7 @@ const libAlias = {
|
|
64
64
|
// '^@components(.*)$': '<rootDir>/src/components$1',
|
65
65
|
|
66
66
|
exports.libAlias = libAlias;
|
67
|
-
const totalAlias =
|
67
|
+
const totalAlias = disableES5Import ? Object.assign({}, libAlias, aliasPathCreation(alias)) : aliasPathCreation(alias);
|
68
68
|
const jestModuleNameMapper = Object.keys(totalAlias).reduce((previousValue, key) => {
|
69
69
|
previousValue[`^${key}(.*)$`] = `${totalAlias[key]}$1`;
|
70
70
|
return previousValue;
|
package/lib/configs/resolvers.js
CHANGED
@@ -19,7 +19,7 @@ var _client_packages_group = require("@zohodesk/client_packages_group");
|
|
19
19
|
function moduleResolver(options) {
|
20
20
|
const {
|
21
21
|
moduleResolvePath,
|
22
|
-
|
22
|
+
disableES5Import
|
23
23
|
} = options.app;
|
24
24
|
const customAlias = options.alias;
|
25
25
|
let required = moduleResolvePath && (0, _requireLocalOrGlobal.requireLocal)(moduleResolvePath);
|
@@ -33,7 +33,7 @@ function moduleResolver(options) {
|
|
33
33
|
}
|
34
34
|
|
35
35
|
const nodeModulesPath = required ? required.nodeModulesPath : _client_packages_group.nodeModulesPath;
|
36
|
-
const totalAlias =
|
36
|
+
const totalAlias = disableES5Import ? Object.assign({}, _libAlias.libAlias, (0, _libAlias.aliasPathCreation)(customAlias)) : (0, _libAlias.aliasPathCreation)(customAlias);
|
37
37
|
return {
|
38
38
|
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
39
39
|
modules: [nodeModulesPath, _constants.cliNodeModulesPath, 'node_modules'].filter(Boolean),
|
@@ -11,6 +11,8 @@ var _utils = require("./utils");
|
|
11
11
|
|
12
12
|
var _getI18nKeysFormModules = _interopRequireDefault(require("./utils/getI18nKeysFormModules"));
|
13
13
|
|
14
|
+
var _unicodeConversion = require("./utils/unicodeConversion");
|
15
|
+
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
17
|
|
16
18
|
/**
|
@@ -58,8 +60,9 @@ class I18nFilesEmitter {
|
|
58
60
|
}
|
59
61
|
|
60
62
|
getTemplateString(i18nKeys, locale) {
|
61
|
-
|
62
|
-
|
63
|
+
const i18nObject = this.getI18nObjectByLocale(i18nKeys, locale);
|
64
|
+
const convertedI18nObject = (0, _unicodeConversion.convertUnicode)(JSON.stringify(i18nObject, null, 0));
|
65
|
+
return `${this.jsonpFunc}(${convertedI18nObject});`; // return `${this.jsonpFunc}(JSON.parse(${JSON.stringify(jsonToString(i18nObject))}));`;
|
63
66
|
}
|
64
67
|
|
65
68
|
renderI18nLocaleChunk(chunk, locale, i18nKeys) {
|
@@ -13,8 +13,6 @@ var _path = require("path");
|
|
13
13
|
|
14
14
|
var _logger = require("../../../logger");
|
15
15
|
|
16
|
-
var _unicodeConversion = require("./unicodeConversion");
|
17
|
-
|
18
16
|
function isComment(line) {
|
19
17
|
return line[0] === '#';
|
20
18
|
}
|
@@ -33,8 +31,7 @@ function getPropertiesAsJSON(filePath) {
|
|
33
31
|
|
34
32
|
const ind = line.indexOf('=');
|
35
33
|
const key = line.slice(0, ind).replace(/\\ /g, ' ');
|
36
|
-
|
37
|
-
value = (0, _unicodeConversion.convertUnicode)(value);
|
34
|
+
const value = line.slice(ind + 1);
|
38
35
|
|
39
36
|
if (key && value) {
|
40
37
|
i18nObj[key] = value;
|
@@ -4,11 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.convertUnicode = convertUnicode;
|
7
|
+
const UNICODE_PATTERN = /\\+u([0-9a-fA-F]{4})/g;
|
7
8
|
|
8
|
-
function convertUnicode(
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
function convertUnicode(jsonStr) {
|
10
|
+
if (!jsonStr.includes('\\u')) {
|
11
|
+
return jsonStr;
|
12
|
+
}
|
13
|
+
|
14
|
+
UNICODE_PATTERN.lastIndex = 0;
|
15
|
+
return jsonStr.replace(UNICODE_PATTERN, (_, hex) => String.fromCharCode(Number.parseInt(hex, 16)));
|
14
16
|
}
|
package/lib/schemas/index.js
CHANGED
package/npm-shrinkwrap.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@zohodesk/react-cli",
|
3
|
-
"version": "1.1.27-exp.
|
3
|
+
"version": "1.1.27-exp.3",
|
4
4
|
"lockfileVersion": 1,
|
5
5
|
"requires": true,
|
6
6
|
"dependencies": {
|
@@ -12874,7 +12874,7 @@
|
|
12874
12874
|
"sprintf-js": {
|
12875
12875
|
"version": "1.0.3",
|
12876
12876
|
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
12877
|
-
"integrity": "
|
12877
|
+
"integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="
|
12878
12878
|
},
|
12879
12879
|
"sshpk": {
|
12880
12880
|
"version": "1.17.0",
|
@@ -13312,7 +13312,7 @@
|
|
13312
13312
|
"text-table": {
|
13313
13313
|
"version": "0.2.0",
|
13314
13314
|
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
|
13315
|
-
"integrity": "
|
13315
|
+
"integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw=="
|
13316
13316
|
},
|
13317
13317
|
"throat": {
|
13318
13318
|
"version": "5.0.0",
|
@@ -14834,7 +14834,7 @@
|
|
14834
14834
|
"wrappy": {
|
14835
14835
|
"version": "1.0.2",
|
14836
14836
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
14837
|
-
"integrity": "
|
14837
|
+
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
|
14838
14838
|
},
|
14839
14839
|
"write": {
|
14840
14840
|
"version": "1.0.3",
|
package/package.json
CHANGED
@@ -43,10 +43,6 @@ class SelectorWeightPlugin {
|
|
43
43
|
mods.forEach(module => {
|
44
44
|
const filename = module.issuer.resource;
|
45
45
|
|
46
|
-
if (filename == '/Users/zt375-t/work/desk_client_app/jsapps/supportapp/src/components/Subtab/chatGPT/chatGptCard/css/ChatGptCard.module.css') {
|
47
|
-
console.log(module.content.toString());
|
48
|
-
}
|
49
|
-
|
50
46
|
if (!(0, _checkIsPatternsMatchFilename.checkIsPatternsMatchFilename)(patterns, filename)) {
|
51
47
|
return;
|
52
48
|
}
|
@@ -108,6 +108,10 @@ const singleConvertor = (value, changeVal, details, range) => {
|
|
108
108
|
}
|
109
109
|
}
|
110
110
|
|
111
|
+
if (value == '0px') {
|
112
|
+
value = value.replace('px', '');
|
113
|
+
}
|
114
|
+
|
111
115
|
if (getNumericValue(value) >= range.start && getNumericValue(value) <= range.end || getNumericValue(value) === 0) {
|
112
116
|
let retVal = value.replace(/(\d+)px/gi, changeVal.replace('$$', '$1'));
|
113
117
|
|
@@ -216,7 +220,7 @@ var _default = ({
|
|
216
220
|
return;
|
217
221
|
}
|
218
222
|
|
219
|
-
if (settingsObject[decl.prop] && !decl.value.includes('var(--')
|
223
|
+
if (settingsObject[decl.prop] && !decl.value.includes('var(--')) {
|
220
224
|
const settings = settingsObject[decl.prop]; // console.log(settings)
|
221
225
|
|
222
226
|
const {
|
@@ -306,7 +310,7 @@ var _default = ({
|
|
306
310
|
range
|
307
311
|
} = settings;
|
308
312
|
const convertedVals = valArr.map(val => {
|
309
|
-
if (val.includes('px')
|
313
|
+
if (val.includes('px')) {
|
310
314
|
const convertedVal = singleConvertor(val, settings.replacements.px, {
|
311
315
|
decl,
|
312
316
|
filename,
|