@zohodesk/react-cli 1.1.8-exp.2 → 1.1.9
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 +1293 -1293
- package/bin/cli.js +501 -497
- package/docs/ComposeMinification.md +13 -13
- package/docs/CustomChunks.md +29 -29
- 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/MarkdownParser.md +17 -17
- package/docs/ReactLive.md +13 -13
- 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/patternFiltering.md +56 -56
- 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 +0 -18
- package/lib/configs/webpack.docs.config.js +0 -17
- package/lib/deprecationLogger.js +3 -3
- package/lib/loaderUtils/configsAssetsLoaders.js +33 -33
- package/lib/loaderUtils/getCSSLoaders.js +58 -62
- package/lib/loaders/workerLoader.js +9 -9
- package/lib/pluginUtils/getDevPlugins.js +5 -5
- package/lib/pluginUtils/getProdPlugins.js +5 -5
- package/lib/plugins/CustomAttributePlugin.md +35 -35
- 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/ReportGeneratePlugin.js +8 -6
- 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 +29 -29
- package/lib/plugins/ServiceWorkerPlugin.js +9 -9
- package/lib/plugins/TPHashMappingPlugin.js +4 -4
- package/lib/plugins/UnusedFilesFindPlugin.js +7 -5
- package/lib/plugins/VariableConversionCollector.js +59 -59
- package/lib/plugins/utils/fileHandling.js +8 -4
- package/lib/plugins/variableConvertorUtils.js +9 -9
- package/lib/postcss-plugins/RTLSplitPlugin.js +10 -10
- 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/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 +13 -13
- package/lib/utils/deprecationSupport.js +83 -78
- package/lib/utils/getOptions.js +2 -2
- package/lib/utils/index.js +14 -12
- package/lib/utils/initPreCommitHook.js +5 -5
- package/lib/utils/log.js +11 -0
- package/lib/utils/pullOrigin.js +3 -3
- package/lib/utils/reinstallDependencies.js +3 -3
- package/lib/utils/resultSchema.json +73 -73
- package/lib/utils/switchBranch.js +4 -2
- package/npm-shrinkwrap.json +33393 -14454
- package/npm8.md +9 -9
- package/package.json +123 -123
- 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 +250 -250
- package/templates/docs/component.html +179 -179
- package/templates/docs/components.html +222 -222
- 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/markdown.css +202 -202
- package/templates/docs/css/style.css +1022 -1022
- package/templates/docs/impactReportTemplate.html +154 -154
- package/templates/docs/index.html +1502 -1502
- 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/result.json +0 -1
- package/unittest/index.html +0 -37
|
@@ -1,148 +1,148 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
|
|
5
|
-
<style>
|
|
6
|
-
#file {
|
|
7
|
-
font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;
|
|
8
|
-
border-collapse: collapse;
|
|
9
|
-
width: 100%;
|
|
10
|
-
}
|
|
11
|
-
#redTd {
|
|
12
|
-
color: red;
|
|
13
|
-
}
|
|
14
|
-
#greenTD {
|
|
15
|
-
color: green;
|
|
16
|
-
}
|
|
17
|
-
#file td,
|
|
18
|
-
#file th {
|
|
19
|
-
border: 1px solid #ddd;
|
|
20
|
-
padding: 8px;
|
|
21
|
-
text-align: center;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
#file tr:nth-child(even) {
|
|
25
|
-
background-color: #f2f2f2;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
#file tr:hover {
|
|
29
|
-
background-color: #ddd;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
#file th {
|
|
33
|
-
padding-top: 12px;
|
|
34
|
-
padding-bottom: 12px;
|
|
35
|
-
background-color: #2a2d36;
|
|
36
|
-
color: white;
|
|
37
|
-
}
|
|
38
|
-
#sizeTable {
|
|
39
|
-
float: left;
|
|
40
|
-
width: 50%;
|
|
41
|
-
}
|
|
42
|
-
#hashTable {
|
|
43
|
-
display: inline-block;
|
|
44
|
-
width: 50%;
|
|
45
|
-
}
|
|
46
|
-
</style>
|
|
47
|
-
<script type="text/javascript" src="./buildtrack.js"></script>
|
|
48
|
-
</head>
|
|
49
|
-
<body>
|
|
50
|
-
<div>
|
|
51
|
-
<div style="float: left;margin-right: 10px;">Branch Name:</div>
|
|
52
|
-
<h4 id="h4" style="margin: 0px;"></h4>
|
|
53
|
-
</div>
|
|
54
|
-
<div id="sizeTable">
|
|
55
|
-
<div>
|
|
56
|
-
<h3>Size changes</h3>
|
|
57
|
-
<h3></h3>
|
|
58
|
-
</div>
|
|
59
|
-
<table id="file" class="table table-bordered table-hover table-condensed">
|
|
60
|
-
<thead>
|
|
61
|
-
<tr>
|
|
62
|
-
<th title="Field #1">Name</th>
|
|
63
|
-
<th title="Field #2">Size / Diff</th>
|
|
64
|
-
<th title="Field #3">Size / Old</th>
|
|
65
|
-
<th title="Field #4">Size / New</th>
|
|
66
|
-
</tr>
|
|
67
|
-
</thead>
|
|
68
|
-
<tbody id="sizeTbody"></tbody>
|
|
69
|
-
</table>
|
|
70
|
-
</div>
|
|
71
|
-
<div id="hashTable">
|
|
72
|
-
<div>
|
|
73
|
-
<h3>Hash changes</h3>
|
|
74
|
-
<h3></h3>
|
|
75
|
-
</div>
|
|
76
|
-
<table id="file" class="table table-bordered table-hover table-condensed">
|
|
77
|
-
<thead>
|
|
78
|
-
<tr>
|
|
79
|
-
<th style="background-color: #4CAF50;" title="Field #1">Name</th>
|
|
80
|
-
<th style="background-color: #4CAF50;" title="Field #2">
|
|
81
|
-
Hash / Old
|
|
82
|
-
</th>
|
|
83
|
-
<th style="background-color: #4CAF50;" title="Field #3">
|
|
84
|
-
Hash / New
|
|
85
|
-
</th>
|
|
86
|
-
</tr>
|
|
87
|
-
</thead>
|
|
88
|
-
<tbody id="hashTbody"></tbody>
|
|
89
|
-
</table>
|
|
90
|
-
</div>
|
|
91
|
-
|
|
92
|
-
<script type="text/javascript">
|
|
93
|
-
function load() {
|
|
94
|
-
if (statsJson) {
|
|
95
|
-
var tdStringSize = '';
|
|
96
|
-
var tdStringHash = '';
|
|
97
|
-
if (statsJson.increased.length > 0) {
|
|
98
|
-
statsJson.increased.forEach(fileObj => {
|
|
99
|
-
let colorTD = '</td><td>';
|
|
100
|
-
if (fileObj.size.diff.split(' ').length > 2) {
|
|
101
|
-
colorTD = '</td><td id="greenTd">';
|
|
102
|
-
} else {
|
|
103
|
-
colorTD = '</td><td id="redTd">';
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
tdStringSize =
|
|
107
|
-
tdStringSize +
|
|
108
|
-
'<tr><td>' +
|
|
109
|
-
fileObj.name +
|
|
110
|
-
colorTD +
|
|
111
|
-
fileObj.size.diff +
|
|
112
|
-
'</td><td>' +
|
|
113
|
-
fileObj.size.old +
|
|
114
|
-
'</td><td>' +
|
|
115
|
-
fileObj.size.new +
|
|
116
|
-
'</td><tr>';
|
|
117
|
-
});
|
|
118
|
-
} else {
|
|
119
|
-
tdStringSize = '<tr><td></td><td></td><td></td></tr>';
|
|
120
|
-
}
|
|
121
|
-
document.getElementById('sizeTbody').innerHTML = tdStringSize;
|
|
122
|
-
if (statsJson.hashChanged.length > 0) {
|
|
123
|
-
statsJson.hashChanged.forEach(fileObj => {
|
|
124
|
-
tdStringHash =
|
|
125
|
-
tdStringHash +
|
|
126
|
-
'<tr><td>' +
|
|
127
|
-
fileObj.name +
|
|
128
|
-
'</td><td>' +
|
|
129
|
-
fileObj.hash.old +
|
|
130
|
-
'</td><td>' +
|
|
131
|
-
fileObj.hash.new +
|
|
132
|
-
'</td><tr>';
|
|
133
|
-
});
|
|
134
|
-
} else {
|
|
135
|
-
tdStringHash = '<tr><td></td><td></td><td></td></tr>';
|
|
136
|
-
}
|
|
137
|
-
document.getElementById('hashTbody').innerHTML = tdStringHash;
|
|
138
|
-
if (statsJson.branchName) {
|
|
139
|
-
document.getElementById('h4').innerHTML = statsJson.branchName;
|
|
140
|
-
} else {
|
|
141
|
-
document.getElementById('h4').innerHTML = 'Not specified';
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
load();
|
|
146
|
-
</script>
|
|
147
|
-
</body>
|
|
148
|
-
</html>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
|
|
5
|
+
<style>
|
|
6
|
+
#file {
|
|
7
|
+
font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;
|
|
8
|
+
border-collapse: collapse;
|
|
9
|
+
width: 100%;
|
|
10
|
+
}
|
|
11
|
+
#redTd {
|
|
12
|
+
color: red;
|
|
13
|
+
}
|
|
14
|
+
#greenTD {
|
|
15
|
+
color: green;
|
|
16
|
+
}
|
|
17
|
+
#file td,
|
|
18
|
+
#file th {
|
|
19
|
+
border: 1px solid #ddd;
|
|
20
|
+
padding: 8px;
|
|
21
|
+
text-align: center;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
#file tr:nth-child(even) {
|
|
25
|
+
background-color: #f2f2f2;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
#file tr:hover {
|
|
29
|
+
background-color: #ddd;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
#file th {
|
|
33
|
+
padding-top: 12px;
|
|
34
|
+
padding-bottom: 12px;
|
|
35
|
+
background-color: #2a2d36;
|
|
36
|
+
color: white;
|
|
37
|
+
}
|
|
38
|
+
#sizeTable {
|
|
39
|
+
float: left;
|
|
40
|
+
width: 50%;
|
|
41
|
+
}
|
|
42
|
+
#hashTable {
|
|
43
|
+
display: inline-block;
|
|
44
|
+
width: 50%;
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
47
|
+
<script type="text/javascript" src="./buildtrack.js"></script>
|
|
48
|
+
</head>
|
|
49
|
+
<body>
|
|
50
|
+
<div>
|
|
51
|
+
<div style="float: left;margin-right: 10px;">Branch Name:</div>
|
|
52
|
+
<h4 id="h4" style="margin: 0px;"></h4>
|
|
53
|
+
</div>
|
|
54
|
+
<div id="sizeTable">
|
|
55
|
+
<div>
|
|
56
|
+
<h3>Size changes</h3>
|
|
57
|
+
<h3></h3>
|
|
58
|
+
</div>
|
|
59
|
+
<table id="file" class="table table-bordered table-hover table-condensed">
|
|
60
|
+
<thead>
|
|
61
|
+
<tr>
|
|
62
|
+
<th title="Field #1">Name</th>
|
|
63
|
+
<th title="Field #2">Size / Diff</th>
|
|
64
|
+
<th title="Field #3">Size / Old</th>
|
|
65
|
+
<th title="Field #4">Size / New</th>
|
|
66
|
+
</tr>
|
|
67
|
+
</thead>
|
|
68
|
+
<tbody id="sizeTbody"></tbody>
|
|
69
|
+
</table>
|
|
70
|
+
</div>
|
|
71
|
+
<div id="hashTable">
|
|
72
|
+
<div>
|
|
73
|
+
<h3>Hash changes</h3>
|
|
74
|
+
<h3></h3>
|
|
75
|
+
</div>
|
|
76
|
+
<table id="file" class="table table-bordered table-hover table-condensed">
|
|
77
|
+
<thead>
|
|
78
|
+
<tr>
|
|
79
|
+
<th style="background-color: #4CAF50;" title="Field #1">Name</th>
|
|
80
|
+
<th style="background-color: #4CAF50;" title="Field #2">
|
|
81
|
+
Hash / Old
|
|
82
|
+
</th>
|
|
83
|
+
<th style="background-color: #4CAF50;" title="Field #3">
|
|
84
|
+
Hash / New
|
|
85
|
+
</th>
|
|
86
|
+
</tr>
|
|
87
|
+
</thead>
|
|
88
|
+
<tbody id="hashTbody"></tbody>
|
|
89
|
+
</table>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<script type="text/javascript">
|
|
93
|
+
function load() {
|
|
94
|
+
if (statsJson) {
|
|
95
|
+
var tdStringSize = '';
|
|
96
|
+
var tdStringHash = '';
|
|
97
|
+
if (statsJson.increased.length > 0) {
|
|
98
|
+
statsJson.increased.forEach(fileObj => {
|
|
99
|
+
let colorTD = '</td><td>';
|
|
100
|
+
if (fileObj.size.diff.split(' ').length > 2) {
|
|
101
|
+
colorTD = '</td><td id="greenTd">';
|
|
102
|
+
} else {
|
|
103
|
+
colorTD = '</td><td id="redTd">';
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
tdStringSize =
|
|
107
|
+
tdStringSize +
|
|
108
|
+
'<tr><td>' +
|
|
109
|
+
fileObj.name +
|
|
110
|
+
colorTD +
|
|
111
|
+
fileObj.size.diff +
|
|
112
|
+
'</td><td>' +
|
|
113
|
+
fileObj.size.old +
|
|
114
|
+
'</td><td>' +
|
|
115
|
+
fileObj.size.new +
|
|
116
|
+
'</td><tr>';
|
|
117
|
+
});
|
|
118
|
+
} else {
|
|
119
|
+
tdStringSize = '<tr><td></td><td></td><td></td></tr>';
|
|
120
|
+
}
|
|
121
|
+
document.getElementById('sizeTbody').innerHTML = tdStringSize;
|
|
122
|
+
if (statsJson.hashChanged.length > 0) {
|
|
123
|
+
statsJson.hashChanged.forEach(fileObj => {
|
|
124
|
+
tdStringHash =
|
|
125
|
+
tdStringHash +
|
|
126
|
+
'<tr><td>' +
|
|
127
|
+
fileObj.name +
|
|
128
|
+
'</td><td>' +
|
|
129
|
+
fileObj.hash.old +
|
|
130
|
+
'</td><td>' +
|
|
131
|
+
fileObj.hash.new +
|
|
132
|
+
'</td><tr>';
|
|
133
|
+
});
|
|
134
|
+
} else {
|
|
135
|
+
tdStringHash = '<tr><td></td><td></td><td></td></tr>';
|
|
136
|
+
}
|
|
137
|
+
document.getElementById('hashTbody').innerHTML = tdStringHash;
|
|
138
|
+
if (statsJson.branchName) {
|
|
139
|
+
document.getElementById('h4').innerHTML = statsJson.branchName;
|
|
140
|
+
} else {
|
|
141
|
+
document.getElementById('h4').innerHTML = 'Not specified';
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
load();
|
|
146
|
+
</script>
|
|
147
|
+
</body>
|
|
148
|
+
</html>
|
|
@@ -54,19 +54,19 @@ var _default = (unique = true, {
|
|
|
54
54
|
const cleanFileName = fileNameWithoutExt.replace(/-/g, '_').toLowerCase();
|
|
55
55
|
|
|
56
56
|
const relativePath = _path.default.relative(context.rootContext, context.resourcePath);
|
|
57
|
-
/*
|
|
58
|
-
input :
|
|
59
|
-
context.resourcePath : 'D:/MyWork/..../desk_client_app/supportapp/src/components/Avatar/Avatar.module.css,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
// include src folder, include deskapp folder, exclude node modules
|
|
63
|
-
"cssUniqueness": [
|
|
64
|
-
"src",
|
|
65
|
-
"deskapp",
|
|
66
|
-
"!node_modules"
|
|
67
|
-
]
|
|
68
|
-
|
|
69
|
-
true or false
|
|
57
|
+
/*
|
|
58
|
+
input :
|
|
59
|
+
context.resourcePath : 'D:/MyWork/..../desk_client_app/supportapp/src/components/Avatar/Avatar.module.css,
|
|
60
|
+
|
|
61
|
+
patterns.cssVariableReplacement:
|
|
62
|
+
// include src folder, include deskapp folder, exclude node modules
|
|
63
|
+
"cssUniqueness": [
|
|
64
|
+
"src",
|
|
65
|
+
"deskapp",
|
|
66
|
+
"!node_modules"
|
|
67
|
+
]
|
|
68
|
+
output :
|
|
69
|
+
true or false
|
|
70
70
|
*/
|
|
71
71
|
|
|
72
72
|
|
|
@@ -7,107 +7,110 @@ exports.deprecationSupport = deprecationSupport;
|
|
|
7
7
|
|
|
8
8
|
var _path = _interopRequireDefault(require("path"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var deprecationHandlers = _interopRequireWildcard(require("../deprecationLogger"));
|
|
11
|
+
|
|
12
|
+
var _windowsModification = require("../loaderUtils/windowsModification");
|
|
13
|
+
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
17
|
|
|
12
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
19
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// if (selectn(options, ".app.hasRTL") === true) {
|
|
20
|
+
let {
|
|
21
|
+
deprecateMessage,
|
|
22
|
+
deprecateOption,
|
|
23
|
+
deprecationLoggerEnd
|
|
24
|
+
} = deprecationHandlers;
|
|
25
|
+
|
|
26
|
+
function modifyCssArr(arr) {
|
|
27
|
+
return arr.map(x => {
|
|
28
|
+
const includeCss = !x.startsWith('!');
|
|
29
|
+
const modifier = includeCss ? '/*.css' : '';
|
|
30
|
+
const filePath = x.replace(/^!/, ''); // Remove the "!" symbol if present
|
|
31
|
+
|
|
32
|
+
return (0, _windowsModification.windowsModificationFile)(_path.default.join(includeCss ? '**' : '!**', filePath, '**', modifier));
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const defaultPostCssPluginOptions = {
|
|
37
|
+
valueReplacer: null,
|
|
38
|
+
hasRTL: false,
|
|
39
|
+
selectorReplace: null,
|
|
40
|
+
hoverActive: false,
|
|
41
|
+
combinerMediaQuery: false,
|
|
42
|
+
cssVariableReplacement: false,
|
|
43
|
+
selectorWeight: false,
|
|
44
|
+
minifier: false,
|
|
45
|
+
composeMinification: false
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
function deprecationSupport(options, disableDeprecationWarning) {
|
|
49
|
+
if (disableDeprecationWarning) {
|
|
50
|
+
/* eslint-disable no-empty-function */
|
|
51
|
+
deprecateMessage = () => {};
|
|
52
|
+
|
|
53
|
+
deprecateOption = () => {};
|
|
54
|
+
|
|
55
|
+
deprecationLoggerEnd = () => {};
|
|
56
|
+
/* eslint-enable no-empty-function */
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
options.app.plugins = options.app.plugins || defaultPostCssPluginOptions;
|
|
61
|
+
options.docs.plugins = options.docs.plugins || defaultPostCssPluginOptions;
|
|
62
|
+
options.css.plugins = options.css.plugins || defaultPostCssPluginOptions; // if (selectn(options, ".app.hasRTL") === true) {
|
|
58
63
|
|
|
59
64
|
if (options.app.hasRTL === true) {
|
|
60
|
-
|
|
65
|
+
deprecateOption('app.hasRTL', 'app.plugins.hasRTL');
|
|
61
66
|
options.app.plugins.hasRTL = true;
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
if (options.docs.hasRTL === true) {
|
|
65
|
-
|
|
70
|
+
deprecateOption('docs.hasRTL', 'docs.plugins.hasRTL');
|
|
66
71
|
options.docs.plugins.hasRTL = true;
|
|
67
72
|
}
|
|
68
73
|
|
|
69
|
-
if (options.app.
|
|
70
|
-
(
|
|
71
|
-
options.app.exclude.rtl = options.app.rtlExclude;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (options.docs.rtlExclude.length > 0) {
|
|
75
|
-
(0, _deprecationLogger.deprecateOption)('docs.rtlExclude', 'docs.exclude.rtl');
|
|
76
|
-
options.docs.exclude.rtl = options.docs.rtlExclude;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (options.app.selectorReplace !== null) {
|
|
80
|
-
(0, _deprecationLogger.deprecateMessage)('when you use app.selectorReplace mention enable or disable app.plugins.selectorReplace by setting value to true or false');
|
|
74
|
+
if (options.app.selectorReplace !== null && options.app.plugins && (options.app.plugins.selectorReplace === null || options.app.plugins.selectorReplace === undefined)) {
|
|
75
|
+
deprecateMessage('when you use app.selectorReplace mention enable or disable app.plugins.selectorReplace by setting value to true or false');
|
|
81
76
|
options.app.plugins.selectorReplace = true;
|
|
82
77
|
}
|
|
83
78
|
|
|
84
|
-
if (options.docs.selectorReplace !== null) {
|
|
85
|
-
|
|
79
|
+
if (options.docs.selectorReplace !== null && options.docs.plugins && (options.docs.plugins.selectorReplace === null || options.docs.plugins.selectorReplace === undefined)) {
|
|
80
|
+
deprecateMessage('when you use docs.selectorReplace mention enable or disable docs.plugins.selectorReplace by setting value to true or false');
|
|
86
81
|
options.docs.plugins.selectorReplace = true;
|
|
87
82
|
}
|
|
88
83
|
|
|
89
|
-
if (options.css.valueReplacer !== null) {
|
|
90
|
-
|
|
84
|
+
if (options.css.valueReplacer !== null && options.css.plugins && (options.app.plugins.valueReplacer === null || options.app.plugins.valueReplacer === undefined)) {
|
|
85
|
+
deprecateMessage('when you use app.valueReplacer mention enable or disable app.plugins.valueReplacer by setting value to true or false');
|
|
91
86
|
options.app.plugins.valueReplacer = true;
|
|
92
87
|
}
|
|
93
88
|
|
|
94
|
-
if (options.app.exclude && options.app.exclude.hasRTL && options.app.exclude.rtl && options.app.exclude.hasRTL.length === 0 && options.app.exclude.rtl.length > 0) {
|
|
95
|
-
(0, _deprecationLogger.deprecateOption)('app.hasRTL', 'app.plugins.hasRTL');
|
|
96
|
-
options.app.exclude.hasRTL = options.app.exclude.rtl;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (options.docs.exclude && options.docs.exclude.hasRTL && options.docs.exclude.rtl && options.docs.exclude.hasRTL.length === 0 && options.docs.exclude.rtl.length > 0) {
|
|
100
|
-
(0, _deprecationLogger.deprecateOption)('docs.hasRTL', 'docs.plugins.hasRTL');
|
|
101
|
-
options.docs.exclude.hasRTL = options.docs.exclude.rtl;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
89
|
if (!options.app.patterns) {
|
|
105
90
|
options.app.patterns = {};
|
|
106
91
|
}
|
|
107
92
|
|
|
108
|
-
function
|
|
109
|
-
|
|
93
|
+
function handleRTL(rtlExclude, rtl, hasRTL, type) {
|
|
94
|
+
if (rtlExclude && rtlExclude.length > 0) {
|
|
95
|
+
options[type].patterns.hasRTL = modifyCssArr(rtlExclude);
|
|
96
|
+
deprecateOption(`${type}.rtlExclude`, `${type}.patterns.hasRTL`);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (rtl && rtl.length > 0) {
|
|
100
|
+
options[type].patterns.hasRTL = modifyCssArr(rtl);
|
|
101
|
+
deprecateOption(`${type}.exclude.rtl`, `${type}.patterns.hasRTL`);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (hasRTL && hasRTL.length > 0) {
|
|
105
|
+
options[type].patterns.hasRTL = modifyCssArr(hasRTL);
|
|
106
|
+
deprecateOption(`${type}.exclude.hasRTL`, `${type}.patterns.hasRTL`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function addExcludesToPattern(patterns, exclude, type) {
|
|
111
|
+
Object.keys(defaultPostCssPluginOptions).forEach(key => {
|
|
110
112
|
if (exclude[key] && patterns[key].length === 0) {
|
|
113
|
+
deprecateOption(`${type}.exclude.${key}`, `${type}.patterns.${key}`);
|
|
111
114
|
let tempArr = exclude[key];
|
|
112
115
|
tempArr = tempArr.map(x => _path.default.join('!**', x, '**')); // Since patterns[key] is empty we need to wildcard for allow all others.
|
|
113
116
|
|
|
@@ -117,7 +120,9 @@ function deprecationSupport(options) {
|
|
|
117
120
|
});
|
|
118
121
|
}
|
|
119
122
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
(
|
|
123
|
+
handleRTL(options.app.rtlExclude, options.app.exclude.rtl, options.app.exclude.hasRTL, 'app');
|
|
124
|
+
handleRTL(options.docs.rtlExclude, options.docs.exclude.rtl, options.docs.exclude.hasRTL, 'docs');
|
|
125
|
+
addExcludesToPattern(options.app.patterns, options.app.exclude, 'app');
|
|
126
|
+
addExcludesToPattern(options.docs.patterns, options.docs.exclude, 'docs');
|
|
127
|
+
deprecationLoggerEnd();
|
|
123
128
|
}
|
package/lib/utils/getOptions.js
CHANGED
|
@@ -142,7 +142,7 @@ const getOptionsFromConfigFile = (appPath, configFileName) => {
|
|
|
142
142
|
return null;
|
|
143
143
|
};
|
|
144
144
|
|
|
145
|
-
const getOptions =
|
|
145
|
+
const getOptions = fromRoot => {
|
|
146
146
|
if (global.reactCLIOptions) {
|
|
147
147
|
return global.reactCLIOptions;
|
|
148
148
|
}
|
|
@@ -160,7 +160,7 @@ const getOptions = () => {
|
|
|
160
160
|
|
|
161
161
|
options.npmVersion = getNpmVersion();
|
|
162
162
|
options.cwd = getCWD();
|
|
163
|
-
(0, _deprecationSupport.deprecationSupport)(options);
|
|
163
|
+
(0, _deprecationSupport.deprecationSupport)(options, options.disableDeprecationWarning || !fromRoot);
|
|
164
164
|
options.packageVersion = process.env.npm_package_version;
|
|
165
165
|
global.reactCLIOptions = options;
|
|
166
166
|
return options;
|
package/lib/utils/index.js
CHANGED
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
|
-
log: true,
|
|
8
7
|
writeFile: true,
|
|
9
8
|
makeDir: true,
|
|
10
9
|
getInfoFromPublicPaths: true,
|
|
11
10
|
getLibraryConflict: true,
|
|
11
|
+
log: true,
|
|
12
12
|
getOptions: true,
|
|
13
13
|
createEventStream: true,
|
|
14
14
|
getServerURL: true,
|
|
@@ -64,7 +64,13 @@ Object.defineProperty(exports, "jsonHelper", {
|
|
|
64
64
|
return _jsonHelper.default;
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
|
-
exports
|
|
67
|
+
Object.defineProperty(exports, "log", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function () {
|
|
70
|
+
return _log.log;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
exports.makeDir = void 0;
|
|
68
74
|
Object.defineProperty(exports, "pullOrigin", {
|
|
69
75
|
enumerable: true,
|
|
70
76
|
get: function () {
|
|
@@ -95,6 +101,8 @@ var _stream = require("stream");
|
|
|
95
101
|
|
|
96
102
|
var _fs = _interopRequireDefault(require("fs"));
|
|
97
103
|
|
|
104
|
+
var _log = require("./log");
|
|
105
|
+
|
|
98
106
|
var _getOptions = _interopRequireDefault(require("./getOptions"));
|
|
99
107
|
|
|
100
108
|
var _createEventStream = _interopRequireDefault(require("./createEventStream"));
|
|
@@ -161,13 +169,7 @@ var _ssTestHack = _interopRequireDefault(require("./ssTestHack"));
|
|
|
161
169
|
|
|
162
170
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
163
171
|
|
|
164
|
-
|
|
165
|
-
let print = console;
|
|
166
|
-
print.log(...info);
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
exports.log = log;
|
|
170
|
-
|
|
172
|
+
// eslint-disable-next-line no-duplicate-imports
|
|
171
173
|
let writeFile = (outputPath, src, isPath = false) => new Promise((resolve, reject) => {
|
|
172
174
|
let inStr;
|
|
173
175
|
|
|
@@ -314,9 +316,9 @@ let getLibraryConflict = (moduleObject, impactObj, changesOnly) => {
|
|
|
314
316
|
whichLibrary = "No component file changes!";
|
|
315
317
|
}
|
|
316
318
|
|
|
317
|
-
log('\n');
|
|
318
|
-
log('You can see the HTML out at coverageTest/impactLibrary.html!');
|
|
319
|
-
log('\x1b[33m%s\x1b[0m', '************************************************************ \n ');
|
|
319
|
+
(0, _log.log)('\n');
|
|
320
|
+
(0, _log.log)('You can see the HTML out at coverageTest/impactLibrary.html!');
|
|
321
|
+
(0, _log.log)('\x1b[33m%s\x1b[0m', '************************************************************ \n ');
|
|
320
322
|
return {
|
|
321
323
|
response: allImpactArray,
|
|
322
324
|
result: {
|
|
@@ -11,7 +11,7 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
11
11
|
|
|
12
12
|
var _child_process = require("child_process");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _log = require("./log");
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
@@ -38,7 +38,7 @@ let copyEslintConfig = rootDir => {
|
|
|
38
38
|
|
|
39
39
|
_fs.default.writeFileSync(targetPath, src);
|
|
40
40
|
|
|
41
|
-
(0,
|
|
41
|
+
(0, _log.log)('Eslint config added in project root path');
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
|
|
@@ -58,7 +58,7 @@ let initPreCommitHook = (forReactCLI = false) => {
|
|
|
58
58
|
|
|
59
59
|
_fs.default.writeFileSync(targetPath, precommit);
|
|
60
60
|
|
|
61
|
-
(0,
|
|
61
|
+
(0, _log.log)('pre-commit hook added');
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
let packagePath = _path.default.join(process.cwd(), 'package.json');
|
|
@@ -71,10 +71,10 @@ let initPreCommitHook = (forReactCLI = false) => {
|
|
|
71
71
|
|
|
72
72
|
_fs.default.writeFileSync(packagePath, JSON.stringify(packageJson, null, 2));
|
|
73
73
|
|
|
74
|
-
(0,
|
|
74
|
+
(0, _log.log)('lint script added in your package.json');
|
|
75
75
|
}
|
|
76
76
|
} catch (e) {
|
|
77
|
-
(0,
|
|
77
|
+
(0, _log.log)('package.json not found');
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
};
|