@zohodesk/react-cli 1.0.1 → 1.0.2-exp.2
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/.eslintignore +7 -7
- package/.eslintrc.js +180 -180
- package/.prettierrc +6 -6
- package/Changelog.md +1019 -1019
- package/README.md +1165 -1160
- package/bin/cli.js +483 -483
- package/docs/CustomChunks.md +26 -26
- package/docs/DevServerPort.md +39 -39
- package/docs/DevStart.md +18 -18
- package/docs/HoverActive.md +12 -12
- package/docs/InstallNode.md +28 -28
- package/docs/SelectorWeight.md +8 -8
- package/docs/TODOS.md +10 -10
- package/docs/ValueReplacer.md +60 -60
- package/docs/VariableConversion.md +729 -729
- package/docs/warnings_while_install.txt +35 -35
- package/files/eslintrc.js +62 -62
- package/files/prettierrc.js +3 -3
- package/lib/configs/webpack.css.umd.config.js +4 -4
- package/lib/configs/webpack.dev.config.js +6 -0
- package/lib/configs/webpack.docs.config.js +4 -0
- package/lib/configs/webpack.impact.config.js +4 -0
- package/lib/configs/webpack.prod.config.js +6 -0
- package/lib/loaderUtils/configsAssetsLoaders.js +33 -33
- package/lib/loaderUtils/getCSSLoaders.js +79 -50
- package/lib/loaderUtils/tests/windowsModification.test.js +10 -0
- package/lib/loaderUtils/windowsModification.js +6 -1
- package/lib/loaders/composeLoader.js +175 -0
- package/lib/loaders/workerLoader.js +9 -9
- package/lib/pluginUtils/getDevPlugins.js +18 -7
- package/lib/pluginUtils/getProdPlugins.js +6 -6
- package/lib/pluginUtils/getUMDCSSPlugins.js +1 -1
- package/lib/pluginUtils/getUMDComponentPlugins.js +1 -1
- package/lib/plugins/EFCPlugin.md +6 -6
- package/lib/plugins/I18NInjectIntoIndexPlugin.js +4 -4
- package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +38 -38
- package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +30 -30
- package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +8 -8
- package/lib/plugins/I18nSplitPlugin/I18nSplit.md +95 -95
- package/lib/plugins/I18nSplitPlugin/README.md +25 -25
- package/lib/plugins/I18nSplitPlugin/index.js +57 -57
- package/lib/plugins/{UglifyCSSPlugin.js → MinifyPlugin.js} +3 -3
- package/lib/plugins/ResourceHintsPlugin.js +17 -17
- package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +6 -6
- package/lib/plugins/RtlSplitPlugin/RtrSplit.md +30 -30
- package/lib/plugins/SelectorPlugin.js +56 -45
- package/lib/plugins/ServiceWorkerPlugin.js +9 -9
- package/lib/plugins/TPHashMappingPlugin.js +4 -4
- package/lib/plugins/VariableConversionCollector.js +93 -84
- package/lib/plugins/index.js +7 -7
- package/lib/plugins/utils/classHandling.js +20 -0
- package/lib/plugins/utils/fileHandling.js +92 -0
- package/lib/plugins/utils/tests/fileHandling.test.js +30 -0
- package/lib/postcss-plugins/EmptyPlugin.js +8 -0
- package/lib/postcss-plugins/ExcludePlugin.js +1 -1
- package/lib/postcss-plugins/RTLSplitPlugin.js +10 -10
- package/lib/postcss-plugins/SelectorReplace.js +80 -0
- package/lib/postcss-plugins/ValueReplacer.js +2 -13
- package/lib/postcss-plugins/__test__/selectorReplace.test.js +28 -0
- package/lib/postcss-plugins/__test__/test1Input.css +38 -38
- package/lib/postcss-plugins/__test__/test1Output.css +38 -38
- package/lib/postcss-plugins/hoverActivePlugin.js +3 -3
- package/lib/postcss-plugins/variableModificationPlugin/index.js +1 -19
- package/lib/postcss-plugins/variableModifier.js +1 -1
- package/lib/schemas/index.js +34 -3
- package/lib/servers/server.js +2 -2
- package/lib/sh/pre-commit.sh +34 -34
- package/lib/sh/reportPublish.sh +45 -45
- package/lib/utils/buildstats.html +148 -148
- package/lib/utils/cssClassNameGenerate.js +35 -7
- package/lib/utils/resultSchema.json +73 -73
- package/npm8.md +9 -9
- package/package.json +122 -121
- package/postpublish.js +8 -8
- package/templates/app/.eslintrc.js +140 -140
- package/templates/app/README.md +12 -12
- package/templates/app/app/index.html +24 -24
- package/templates/app/app/properties/ApplicationResources_en_US.properties +1 -1
- package/templates/app/app/properties/i18nkeys.json +3 -3
- package/templates/app/docs/all.html +69 -69
- package/templates/app/mockapi/index.js +18 -18
- package/templates/app/package.json +37 -37
- package/templates/app/src/actions/SampleActions/index.js +37 -37
- package/templates/app/src/actions/index.js +65 -65
- package/templates/app/src/appUrls.js +19 -19
- package/templates/app/src/components/Alert/Alert.js +134 -134
- package/templates/app/src/components/Alert/Alert.module.css +79 -79
- package/templates/app/src/components/FreezeLayer/FreezeLayer.css +37 -37
- package/templates/app/src/components/FreezeLayer/FreezeLayer.js +84 -84
- package/templates/app/src/components/Sample/Sample.module.css +11 -11
- package/templates/app/src/components/Sample/SampleList.js +61 -61
- package/templates/app/src/components/Slider/Slider.css +41 -41
- package/templates/app/src/components/Slider/Slider.js +55 -55
- package/templates/app/src/containers/AlertContainer/index.js +15 -15
- package/templates/app/src/containers/AppContainer/index.js +96 -96
- package/templates/app/src/containers/AppContainer/index.module.css +27 -27
- package/templates/app/src/containers/CustomMatch/index.js +65 -65
- package/templates/app/src/containers/DevTools/index.js +10 -10
- package/templates/app/src/containers/Header/index.js +67 -67
- package/templates/app/src/containers/Header/index.module.css +43 -43
- package/templates/app/src/containers/Redirect/index.js +63 -63
- package/templates/app/src/containers/Redirector/index.js +47 -47
- package/templates/app/src/containers/SampleListContainer/ListContainer.js +42 -42
- package/templates/app/src/containers/SampleListContainer/ListContainer.module.css +3 -3
- package/templates/app/src/historyChange.js +5 -5
- package/templates/app/src/index.html +10 -10
- package/templates/app/src/index.js +24 -24
- package/templates/app/src/middleware/PromiseMiddleware.js +59 -59
- package/templates/app/src/reducers/alertData.js +11 -11
- package/templates/app/src/reducers/index.js +6 -6
- package/templates/app/src/reducers/samples.js +19 -19
- package/templates/app/src/store/configureStore.dev.js +51 -51
- package/templates/app/src/store/configureStore.js +5 -5
- package/templates/app/src/store/configureStore.prod.js +26 -26
- package/templates/app/src/util/Common.js +5 -5
- package/templates/app/src/util/RequestAPI.js +132 -132
- package/templates/docs/all.html +249 -249
- package/templates/docs/component.html +178 -178
- package/templates/docs/components.html +221 -221
- package/templates/docs/css/b.min.css +6 -6
- package/templates/docs/css/component.css +42 -42
- package/templates/docs/css/componentTest.css +6 -6
- package/templates/docs/css/hopscotch.css +585 -585
- package/templates/docs/css/style.css +1022 -1022
- package/templates/docs/impactReportTemplate.html +154 -154
- package/templates/docs/index.html +1501 -1501
- package/templates/docs/js/active-line.js +72 -72
- package/templates/docs/js/b.min.js +7 -7
- package/templates/docs/js/codemirror.js +9680 -9680
- package/templates/docs/js/designTokens.js +334 -334
- package/templates/docs/js/j.min.js +4 -4
- package/templates/docs/js/javascript.js +874 -874
- package/templates/docs/js/matchbrackets.js +145 -145
- package/.vscode/settings.json +0 -11
- package/lib/plugins/composeCommonPlugin.js +0 -30
- package/result.json +0 -1
- package/unittest/index.html +0 -37
|
@@ -38,11 +38,11 @@ function selectorMinifySameDir(selector, direction) {
|
|
|
38
38
|
const regex = getRegex(direction);
|
|
39
39
|
return selector.replace(regex, '').trim();
|
|
40
40
|
}
|
|
41
|
-
/**
|
|
42
|
-
* this funtion will remove given rule,
|
|
43
|
-
* if given selector and it's previous sibiling rule selector are same
|
|
44
|
-
* current rule properties will move to previous sibiling rule.
|
|
45
|
-
* @param {Rule} rule current rule
|
|
41
|
+
/**
|
|
42
|
+
* this funtion will remove given rule,
|
|
43
|
+
* if given selector and it's previous sibiling rule selector are same
|
|
44
|
+
* current rule properties will move to previous sibiling rule.
|
|
45
|
+
* @param {Rule} rule current rule
|
|
46
46
|
*/
|
|
47
47
|
|
|
48
48
|
|
|
@@ -57,11 +57,11 @@ function mergeIfSameSelector(rule) {
|
|
|
57
57
|
rule.remove();
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
/**
|
|
61
|
-
* this funtion will remove given rule,
|
|
62
|
-
* if given selector and it's previous sibiling rule selector are same
|
|
63
|
-
* current rule properties will move to previous sibiling rule.
|
|
64
|
-
* @param {Rule} rule current rule
|
|
60
|
+
/**
|
|
61
|
+
* this funtion will remove given rule,
|
|
62
|
+
* if given selector and it's previous sibiling rule selector are same
|
|
63
|
+
* current rule properties will move to previous sibiling rule.
|
|
64
|
+
* @param {Rule} rule current rule
|
|
65
65
|
*/
|
|
66
66
|
|
|
67
67
|
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _postcss = _interopRequireDefault(require("postcss"));
|
|
4
|
+
|
|
5
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
6
|
+
|
|
7
|
+
function validator(opts) {
|
|
8
|
+
if (!opts || typeof opts !== 'object') {
|
|
9
|
+
throw new Error('Always requires argment');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
before,
|
|
14
|
+
after
|
|
15
|
+
} = opts;
|
|
16
|
+
|
|
17
|
+
if (!before || !after) {
|
|
18
|
+
throw new Error('Be sure to have "before" and "after" object names');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (!Array.isArray(before) || !Array.isArray(after)) {
|
|
22
|
+
throw new Error('Objects "before" and "after" must be of type Array');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (before.length !== after.length) {
|
|
26
|
+
throw new Error('Length of before and after options must be the same');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (before.length === 0) {
|
|
30
|
+
throw new Error('Array length is 1 or more');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
before.forEach((beforeOpt, idx) => {
|
|
34
|
+
const afterOpt = after[idx];
|
|
35
|
+
|
|
36
|
+
switch (true) {
|
|
37
|
+
case typeof beforeOpt === 'string':
|
|
38
|
+
{
|
|
39
|
+
if (!typeof afterOpt === 'string') {
|
|
40
|
+
throw new Error(`The after option ${afterOpt} must be a string. If you want to apply the replace callback function, then use a RegExp for the before option`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
case beforeOpt instanceof RegExp:
|
|
47
|
+
{
|
|
48
|
+
if (!typeof afterOpt === 'string' && !typeof afterOpt === 'function') {
|
|
49
|
+
throw new Error(`The after option ${afterOpt} must be either a string, or a function`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
default:
|
|
56
|
+
throw new Error(`The before option ${beforeOpt} must be either a string, or a RegExp`);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
module.exports = _postcss.default.plugin('postcss-selector-replace-new', opts => {
|
|
62
|
+
validator(opts);
|
|
63
|
+
const {
|
|
64
|
+
before,
|
|
65
|
+
after
|
|
66
|
+
} = opts;
|
|
67
|
+
return root => {
|
|
68
|
+
root.walkRules(rule => {
|
|
69
|
+
before.forEach((beforeOpt, idx) => {
|
|
70
|
+
const afterOpt = after[idx];
|
|
71
|
+
|
|
72
|
+
if (typeof beforeOpt === 'string') {
|
|
73
|
+
rule.selector = rule.selector.split(beforeOpt).join(afterOpt);
|
|
74
|
+
} else {
|
|
75
|
+
rule.selector = rule.selector.replace(beforeOpt, afterOpt);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
});
|
|
@@ -18,7 +18,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
18
18
|
// }
|
|
19
19
|
// };
|
|
20
20
|
// });
|
|
21
|
-
// export default
|
|
21
|
+
// export default
|
|
22
22
|
module.exports = _postcss.default.plugin('postcss-value-replacer', (valueReplacer = {}) => // Work with options here
|
|
23
23
|
root => {
|
|
24
24
|
root.walkDecls(decl => {
|
|
@@ -31,16 +31,5 @@ root => {
|
|
|
31
31
|
}
|
|
32
32
|
}); //console.log({root, roots:root+""}, root+"")
|
|
33
33
|
// Transform CSS AST here
|
|
34
|
-
});
|
|
35
|
-
// valueReplacer.forEach(obj => {
|
|
36
|
-
// if (
|
|
37
|
-
// obj.props.indexOf(decl.prop) !== -1 &&
|
|
38
|
-
// obj.values[decl.value] !== undefined
|
|
39
|
-
// ) {
|
|
40
|
-
// decl.value = obj.values[decl.value];
|
|
41
|
-
// }
|
|
42
|
-
// });
|
|
43
|
-
// //console.log({root, roots:root+""}, root+"")
|
|
44
|
-
// // Transform CSS AST here
|
|
45
|
-
// });
|
|
34
|
+
});
|
|
46
35
|
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
let settings1 = {
|
|
4
|
+
selectorReplace: {
|
|
5
|
+
before: [':root', 'data-mode', 'data-theme'],
|
|
6
|
+
after: [':global .zohodesk_controlpanel,:global .wms-mainui,:global .wms-hysearch, :global .mcf1ee8b17_overlay,:global .wms-hvalign, :global .KB_Editor_UploadImage,:global .zdeskEditor_popup, :global .ze_dd, :global .__baseZC_Container__', 'data-desk-mode', 'data-desk-theme']
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
let settings2 = {
|
|
10
|
+
selectorReplace: {
|
|
11
|
+
before: [':root', 'data-'],
|
|
12
|
+
after: [':global .zohodesk_controlpanel,:global .wms-mainui,:global .wms-hysearch, :global .mcf1ee8b17_overlay,:global .wms-hvalign, :global .KB_Editor_UploadImage,:global .zdeskEditor_popup, :global .ze_dd, :global .__baseZC_Container__', 'test-']
|
|
13
|
+
}
|
|
14
|
+
}; //error case
|
|
15
|
+
|
|
16
|
+
let settings3 = {
|
|
17
|
+
selectorReplace: {
|
|
18
|
+
before: [':root', 'data-'],
|
|
19
|
+
after: [':global .zohodesk_controlpanel,:global .wms-mainui,:global .wms-hysearch, :global .mcf1ee8b17_overlay,:global .wms-hvalign, :global .KB_Editor_UploadImage,:global .zdeskEditor_popup, :global .ze_dd, :global .__baseZC_Container__']
|
|
20
|
+
}
|
|
21
|
+
}; //error case
|
|
22
|
+
|
|
23
|
+
let settings4 = {
|
|
24
|
+
selectorReplace: {
|
|
25
|
+
before: [':root'],
|
|
26
|
+
after: [':global .zohodesk_controlpanel,:global .wms-mainui,:global .wms-hysearch, :global .mcf1ee8b17_overlay,:global .wms-hvalign, :global .KB_Editor_UploadImage,:global .zdeskEditor_popup, :global .ze_dd, :global .__baseZC_Container__', 'test-']
|
|
27
|
+
}
|
|
28
|
+
}; // here conversion happens for data from one index to another
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
/*Hover_active:ignore*/
|
|
2
|
-
g,a:hover{
|
|
3
|
-
color : red
|
|
4
|
-
}
|
|
5
|
-
/*Hover:ignore*/
|
|
6
|
-
h:hover{
|
|
7
|
-
background : yellow
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/* Hover_active:ignore */
|
|
11
|
-
g,d+e:hover{
|
|
12
|
-
color : black
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
g,d e:hover{
|
|
16
|
-
color : black
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@media screen and (max-width:61.25em){
|
|
20
|
-
/* Hover_active:ignore */
|
|
21
|
-
a,b,a:hover, b:hover{
|
|
22
|
-
background-color : blue
|
|
23
|
-
}
|
|
24
|
-
a + b,a:hover + b:hover{
|
|
25
|
-
background-color : blue
|
|
26
|
-
}
|
|
27
|
-
a b:hover{
|
|
28
|
-
background-color : blue
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.cc:hover {
|
|
32
|
-
color: red;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
c:hover{
|
|
36
|
-
color : red
|
|
37
|
-
}
|
|
38
|
-
|
|
1
|
+
/*Hover_active:ignore*/
|
|
2
|
+
g,a:hover{
|
|
3
|
+
color : red
|
|
4
|
+
}
|
|
5
|
+
/*Hover:ignore*/
|
|
6
|
+
h:hover{
|
|
7
|
+
background : yellow
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* Hover_active:ignore */
|
|
11
|
+
g,d+e:hover{
|
|
12
|
+
color : black
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
g,d e:hover{
|
|
16
|
+
color : black
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@media screen and (max-width:61.25em){
|
|
20
|
+
/* Hover_active:ignore */
|
|
21
|
+
a,b,a:hover, b:hover{
|
|
22
|
+
background-color : blue
|
|
23
|
+
}
|
|
24
|
+
a + b,a:hover + b:hover{
|
|
25
|
+
background-color : blue
|
|
26
|
+
}
|
|
27
|
+
a b:hover{
|
|
28
|
+
background-color : blue
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.cc:hover {
|
|
32
|
+
color: red;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
c:hover{
|
|
36
|
+
color : red
|
|
37
|
+
}
|
|
38
|
+
|
|
39
39
|
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
/*Hover_active:ignore*/
|
|
2
|
-
g,a:hover{
|
|
3
|
-
color : red
|
|
4
|
-
}
|
|
5
|
-
/*Hover:ignore*/
|
|
6
|
-
h:hover{
|
|
7
|
-
background : yellow
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/* Hover_active:ignore */
|
|
11
|
-
g,d+e:hover{
|
|
12
|
-
color : black
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
g,d e:hover{
|
|
16
|
-
color : black
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@media screen and (max-width:61.25em){
|
|
20
|
-
/* Hover_active:ignore */
|
|
21
|
-
a,b,a:hover, b:hover{
|
|
22
|
-
background-color : blue
|
|
23
|
-
}
|
|
24
|
-
a + b,a:hover + b:hover{
|
|
25
|
-
background-color : blue
|
|
26
|
-
}
|
|
27
|
-
a b:hover{
|
|
28
|
-
background-color : blue
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.cc:hover {
|
|
32
|
-
color: red;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
c:hover{
|
|
36
|
-
color : red
|
|
37
|
-
}
|
|
38
|
-
|
|
1
|
+
/*Hover_active:ignore*/
|
|
2
|
+
g,a:hover{
|
|
3
|
+
color : red
|
|
4
|
+
}
|
|
5
|
+
/*Hover:ignore*/
|
|
6
|
+
h:hover{
|
|
7
|
+
background : yellow
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* Hover_active:ignore */
|
|
11
|
+
g,d+e:hover{
|
|
12
|
+
color : black
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
g,d e:hover{
|
|
16
|
+
color : black
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@media screen and (max-width:61.25em){
|
|
20
|
+
/* Hover_active:ignore */
|
|
21
|
+
a,b,a:hover, b:hover{
|
|
22
|
+
background-color : blue
|
|
23
|
+
}
|
|
24
|
+
a + b,a:hover + b:hover{
|
|
25
|
+
background-color : blue
|
|
26
|
+
}
|
|
27
|
+
a b:hover{
|
|
28
|
+
background-color : blue
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.cc:hover {
|
|
32
|
+
color: red;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
c:hover{
|
|
36
|
+
color : red
|
|
37
|
+
}
|
|
38
|
+
|
|
39
39
|
}
|
|
@@ -4,9 +4,9 @@ var _postcss = _interopRequireDefault(require("postcss"));
|
|
|
4
4
|
|
|
5
5
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* we have give support for ignore(exclude) comments
|
|
9
|
-
* These are the comments' keyword
|
|
7
|
+
/**
|
|
8
|
+
* we have give support for ignore(exclude) comments
|
|
9
|
+
* These are the comments' keyword
|
|
10
10
|
*/
|
|
11
11
|
const hoverIgnoreQuery = 'Hover:ignore',
|
|
12
12
|
activeIgnoreQuery = 'Active:ignore',
|
|
@@ -127,25 +127,7 @@ const singleConvertor = (value, changeVal, details, range) => {
|
|
|
127
127
|
path: path
|
|
128
128
|
};
|
|
129
129
|
errHandler.errorTable.push(errObj);
|
|
130
|
-
errHandler.errorFunction(errObj);
|
|
131
|
-
// {
|
|
132
|
-
// decl,
|
|
133
|
-
// type: 'RANGE_ERROR',
|
|
134
|
-
// filename,
|
|
135
|
-
// message: `value (${value}) (${typeof value}) not within range (${
|
|
136
|
-
// range.start
|
|
137
|
-
// },${range.end})\r`,
|
|
138
|
-
// path: path
|
|
139
|
-
// },
|
|
140
|
-
// 'RANGE_ERROR'
|
|
141
|
-
// );
|
|
142
|
-
// }
|
|
143
|
-
// addError(` prop: ${decl.prop} ,\n value : ${decl.value} ,\n filename : ${filename} ,\n filepath : ${path} ,\n line : ${decl.source.start.line} ,\n message : value (${value}) not within range (${range.start},${range.end})\r`)
|
|
144
|
-
// return value;
|
|
145
|
-
// } else {
|
|
146
|
-
// console.log('++++++++++++++++++++++rect val!', value);
|
|
147
|
-
// }
|
|
148
|
-
|
|
130
|
+
errHandler.errorFunction(errObj);
|
|
149
131
|
return;
|
|
150
132
|
};
|
|
151
133
|
|
|
@@ -101,7 +101,7 @@ module.exports = postcss.plugin('postcss-variable-report', () => rootOriginal =>
|
|
|
101
101
|
rule.walkDecls((decl, position) => {
|
|
102
102
|
// case font-size
|
|
103
103
|
if (!hasIgnoreComment(rule.nodes[position - 1])) {
|
|
104
|
-
console.log(settings)
|
|
104
|
+
// console.log(settings)
|
|
105
105
|
let unit = decl.value.replace(/[0-9]/g, '');
|
|
106
106
|
let settings = numberObject[decl.prop];
|
|
107
107
|
let path = rootOriginal.source.input.from;
|
package/lib/schemas/index.js
CHANGED
|
@@ -222,12 +222,28 @@ var _default = {
|
|
|
222
222
|
cli: 'enable_smaphook'
|
|
223
223
|
},
|
|
224
224
|
plugins: {
|
|
225
|
+
valueReplacer: false,
|
|
226
|
+
selectorReplace: false,
|
|
225
227
|
hasRTL: false,
|
|
226
228
|
hoverActive: false,
|
|
227
229
|
combinerMediaQuery: false,
|
|
228
230
|
cssVariableReplacement: false,
|
|
229
|
-
selectorWeight: false
|
|
231
|
+
selectorWeight: false,
|
|
232
|
+
minifier: false,
|
|
233
|
+
composeMinification: false
|
|
230
234
|
},
|
|
235
|
+
patterns: {
|
|
236
|
+
valueReplacer: [],
|
|
237
|
+
selectorReplace: [],
|
|
238
|
+
hoverActive: [],
|
|
239
|
+
combinerMediaQuery: [],
|
|
240
|
+
hasRTL: [],
|
|
241
|
+
cssVariableReplacement: [],
|
|
242
|
+
selectorWeight: [],
|
|
243
|
+
cssUniqueness: [],
|
|
244
|
+
composeMinification: []
|
|
245
|
+
},
|
|
246
|
+
patternsRootDir: '',
|
|
231
247
|
exclude: {
|
|
232
248
|
rtl: [],
|
|
233
249
|
hoverActive: [],
|
|
@@ -235,6 +251,10 @@ var _default = {
|
|
|
235
251
|
cssVariableReplacement: [],
|
|
236
252
|
selectorWeight: []
|
|
237
253
|
},
|
|
254
|
+
include: {
|
|
255
|
+
cssVariableReplacement: [],
|
|
256
|
+
selectorWeight: []
|
|
257
|
+
},
|
|
238
258
|
cssVariableReplacementConfig: '',
|
|
239
259
|
selectorWeightConfig: {
|
|
240
260
|
defaultSelector: '',
|
|
@@ -319,11 +339,22 @@ var _default = {
|
|
|
319
339
|
hasRTL: false,
|
|
320
340
|
rtlExclude: [],
|
|
321
341
|
plugins: {
|
|
322
|
-
|
|
342
|
+
rtl: false,
|
|
323
343
|
hoverActive: false,
|
|
324
344
|
combinerMediaQuery: false,
|
|
325
345
|
cssVariableReplacement: false,
|
|
326
|
-
selectorWeight: false
|
|
346
|
+
selectorWeight: false,
|
|
347
|
+
minifier: false
|
|
348
|
+
},
|
|
349
|
+
patternsRootDir: '',
|
|
350
|
+
patterns: {
|
|
351
|
+
valueReplacer: [],
|
|
352
|
+
selectorReplace: [],
|
|
353
|
+
hoverActive: [],
|
|
354
|
+
combinerMediaQuery: [],
|
|
355
|
+
hasRTL: [],
|
|
356
|
+
cssVariableReplacement: [],
|
|
357
|
+
selectorWeight: []
|
|
327
358
|
},
|
|
328
359
|
exclude: {
|
|
329
360
|
rtl: [],
|
package/lib/servers/server.js
CHANGED
|
@@ -204,8 +204,8 @@ if (httpsOptions) {
|
|
|
204
204
|
port: http2Port
|
|
205
205
|
}, 'htt' + 'ps')}${contextURL}/`, 'http2 server');
|
|
206
206
|
});
|
|
207
|
-
} else {
|
|
208
|
-
(0, _utils.log)(
|
|
207
|
+
} else if (httpsOptions) {
|
|
208
|
+
(0, _utils.log)('Your node version didn\'t adopted http2 support. Kindly update that to 8 LTS or above you can engage the http2');
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
|
package/lib/sh/pre-commit.sh
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
|
|
3
|
-
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E "\.(js)$") # Get staged files
|
|
4
|
-
|
|
5
|
-
CURRENT_BRANCH=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') # Get branch name
|
|
6
|
-
|
|
7
|
-
echo "Branch Name - $CURRENT_BRANCH"
|
|
8
|
-
|
|
9
|
-
if [[ "$STAGED_FILES" = "" ]]; then
|
|
10
|
-
exit 0
|
|
11
|
-
fi
|
|
12
|
-
|
|
13
|
-
IS_FAILED=false
|
|
14
|
-
FILES=""
|
|
15
|
-
|
|
16
|
-
for FILE in $STAGED_FILES # Add files with space separation
|
|
17
|
-
do
|
|
18
|
-
FILES+="$FILE "
|
|
19
|
-
done
|
|
20
|
-
|
|
21
|
-
npm run lint --prefix ${PREFIX_PATH} $FILES # Run ESLint
|
|
22
|
-
|
|
23
|
-
if [[ "$?" != 0 ]]; then
|
|
24
|
-
IS_FAILED=true
|
|
25
|
-
fi
|
|
26
|
-
|
|
27
|
-
if $IS_FAILED; then
|
|
28
|
-
echo "\033[41mCOMMIT FAILED:\033[0m Your commit contains files that should pass ESLint but do not. Please fix the ESLint errors and try again.\n"
|
|
29
|
-
exit 1
|
|
30
|
-
else
|
|
31
|
-
echo "\033[42mCOMMIT SUCCEEDED\033[0m\n"
|
|
32
|
-
fi
|
|
33
|
-
|
|
34
|
-
exit $?
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E "\.(js)$") # Get staged files
|
|
4
|
+
|
|
5
|
+
CURRENT_BRANCH=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') # Get branch name
|
|
6
|
+
|
|
7
|
+
echo "Branch Name - $CURRENT_BRANCH"
|
|
8
|
+
|
|
9
|
+
if [[ "$STAGED_FILES" = "" ]]; then
|
|
10
|
+
exit 0
|
|
11
|
+
fi
|
|
12
|
+
|
|
13
|
+
IS_FAILED=false
|
|
14
|
+
FILES=""
|
|
15
|
+
|
|
16
|
+
for FILE in $STAGED_FILES # Add files with space separation
|
|
17
|
+
do
|
|
18
|
+
FILES+="$FILE "
|
|
19
|
+
done
|
|
20
|
+
|
|
21
|
+
npm run lint --prefix ${PREFIX_PATH} $FILES # Run ESLint
|
|
22
|
+
|
|
23
|
+
if [[ "$?" != 0 ]]; then
|
|
24
|
+
IS_FAILED=true
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
if $IS_FAILED; then
|
|
28
|
+
echo "\033[41mCOMMIT FAILED:\033[0m Your commit contains files that should pass ESLint but do not. Please fix the ESLint errors and try again.\n"
|
|
29
|
+
exit 1
|
|
30
|
+
else
|
|
31
|
+
echo "\033[42mCOMMIT SUCCEEDED\033[0m\n"
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
exit $?
|
package/lib/sh/reportPublish.sh
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
branchName=$2
|
|
3
|
-
url=$1
|
|
4
|
-
zipUrl=$3
|
|
5
|
-
unique=$(date +"%d_%m_%y_Time_%H_%M_%S")
|
|
6
|
-
publishFolder=$branchName"_"$unique
|
|
7
|
-
|
|
8
|
-
rm -rf ./reports
|
|
9
|
-
rm -rf ./scrTemplate
|
|
10
|
-
rm -rf ./errTemplate
|
|
11
|
-
rm -rf ./css
|
|
12
|
-
rm -rf ./js
|
|
13
|
-
rm -rf ./index.html
|
|
14
|
-
|
|
15
|
-
curl $zipUrl | tar xz
|
|
16
|
-
|
|
17
|
-
cp -rf ./reports/css ./css
|
|
18
|
-
cp -rf ./reports/js ./js
|
|
19
|
-
cp -rf ./reports/index.html ./index.html
|
|
20
|
-
if [ -d "./screenShots" ] ; then
|
|
21
|
-
cp -rf ./scrTemplate/* ./screenShots/
|
|
22
|
-
else
|
|
23
|
-
mkdir ./screenShots
|
|
24
|
-
cp -rf ./scrTemplate/* ./screenShots/
|
|
25
|
-
fi
|
|
26
|
-
|
|
27
|
-
[ ! -f "./result.json" ] && touch result.json && cp -rf ./errTemplate/* ./result.json
|
|
28
|
-
[ ! -d "./commitCoverage" ] && mkdir commitCoverage && cp -rf ./errTemplate/* ./commitCoverage/
|
|
29
|
-
[ ! -d "./unittest" ] && mkdir unittest && cp -rf ./errTemplate/* ./unittest/
|
|
30
|
-
[ ! -d "./coverageTest" ] && mkdir coverageTest && cp -rf ./errTemplate/* ./coverageTest/
|
|
31
|
-
[ ! -d "./coverage" ] && mkdir coverage && cp -rf ./errTemplate/* ./coverage/
|
|
32
|
-
|
|
33
|
-
tar -czvf $publishFolder.tar.gz coverage screenShots unittest coverageTest commitCoverage ./css ./js ./index.html ./result.json
|
|
34
|
-
|
|
35
|
-
curl -i -F name=file -F file=@$publishFolder.tar.gz $url"/cgi-bin/upload.py"
|
|
36
|
-
replace=$publishFolder
|
|
37
|
-
reportUrl=$url"/"$replace
|
|
38
|
-
subject="Client Report - React - $publishFolder"
|
|
39
|
-
msg="<p><b>Report URL - <a href='$reportUrl'>Link</a></b></p>
|
|
40
|
-
<p><b>Report Branchname - $branchName</b></p>
|
|
41
|
-
<p><b>Report Unique ID - $unique</b></p>
|
|
42
|
-
<p><b>Report Developer - $6</b></p>"
|
|
43
|
-
#node mailSender.js <from> <pass> <to> <subject> <text>
|
|
44
|
-
BASEDIR=$(dirname "$0")
|
|
45
|
-
node $BASEDIR"/../utils/mailSender" $4 $5 $6 "$subject" "$msg" $7 $8 "$reportUrl"
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
branchName=$2
|
|
3
|
+
url=$1
|
|
4
|
+
zipUrl=$3
|
|
5
|
+
unique=$(date +"%d_%m_%y_Time_%H_%M_%S")
|
|
6
|
+
publishFolder=$branchName"_"$unique
|
|
7
|
+
|
|
8
|
+
rm -rf ./reports
|
|
9
|
+
rm -rf ./scrTemplate
|
|
10
|
+
rm -rf ./errTemplate
|
|
11
|
+
rm -rf ./css
|
|
12
|
+
rm -rf ./js
|
|
13
|
+
rm -rf ./index.html
|
|
14
|
+
|
|
15
|
+
curl $zipUrl | tar xz
|
|
16
|
+
|
|
17
|
+
cp -rf ./reports/css ./css
|
|
18
|
+
cp -rf ./reports/js ./js
|
|
19
|
+
cp -rf ./reports/index.html ./index.html
|
|
20
|
+
if [ -d "./screenShots" ] ; then
|
|
21
|
+
cp -rf ./scrTemplate/* ./screenShots/
|
|
22
|
+
else
|
|
23
|
+
mkdir ./screenShots
|
|
24
|
+
cp -rf ./scrTemplate/* ./screenShots/
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
[ ! -f "./result.json" ] && touch result.json && cp -rf ./errTemplate/* ./result.json
|
|
28
|
+
[ ! -d "./commitCoverage" ] && mkdir commitCoverage && cp -rf ./errTemplate/* ./commitCoverage/
|
|
29
|
+
[ ! -d "./unittest" ] && mkdir unittest && cp -rf ./errTemplate/* ./unittest/
|
|
30
|
+
[ ! -d "./coverageTest" ] && mkdir coverageTest && cp -rf ./errTemplate/* ./coverageTest/
|
|
31
|
+
[ ! -d "./coverage" ] && mkdir coverage && cp -rf ./errTemplate/* ./coverage/
|
|
32
|
+
|
|
33
|
+
tar -czvf $publishFolder.tar.gz coverage screenShots unittest coverageTest commitCoverage ./css ./js ./index.html ./result.json
|
|
34
|
+
|
|
35
|
+
curl -i -F name=file -F file=@$publishFolder.tar.gz $url"/cgi-bin/upload.py"
|
|
36
|
+
replace=$publishFolder
|
|
37
|
+
reportUrl=$url"/"$replace
|
|
38
|
+
subject="Client Report - React - $publishFolder"
|
|
39
|
+
msg="<p><b>Report URL - <a href='$reportUrl'>Link</a></b></p>
|
|
40
|
+
<p><b>Report Branchname - $branchName</b></p>
|
|
41
|
+
<p><b>Report Unique ID - $unique</b></p>
|
|
42
|
+
<p><b>Report Developer - $6</b></p>"
|
|
43
|
+
#node mailSender.js <from> <pass> <to> <subject> <text>
|
|
44
|
+
BASEDIR=$(dirname "$0")
|
|
45
|
+
node $BASEDIR"/../utils/mailSender" $4 $5 $6 "$subject" "$msg" $7 $8 "$reportUrl"
|