@zohodesk/react-cli 0.0.1-exp.166.2 → 0.0.1-exp.168.3
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintignore +7 -7
- package/.eslintrc.js +179 -179
- package/README.md +925 -877
- package/bin/cli.js +492 -487
- package/cert/Tsicsezwild-22-23.crt +37 -0
- package/cert/Tsicsezwild-22-23.key +27 -0
- package/docs/CustomChunks.md +26 -26
- package/docs/DevStart.md +18 -0
- package/docs/InstallNode.md +28 -0
- package/docs/TODOS.md +10 -10
- package/docs/ValueReplacer.md +60 -60
- 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 +13 -17
- package/lib/configs/webpack.docs.config.js +11 -16
- package/lib/configs/webpack.impact.config.js +6 -14
- package/lib/configs/webpack.prod.config.js +8 -5
- package/lib/loaderUtils/configsAssetsLoaders.js +88 -0
- package/lib/loaderUtils/getCSSLoaders.js +5 -3
- package/lib/loaders/workerLoader.js +9 -9
- package/lib/pluginUtils/getDevPlugins.js +5 -5
- package/lib/pluginUtils/getProdPlugins.js +5 -5
- 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 +86 -86
- package/lib/plugins/I18nSplitPlugin/README.md +25 -25
- package/lib/plugins/I18nSplitPlugin/index.js +57 -57
- 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/ServiceWorkerPlugin.js +9 -9
- package/lib/plugins/TPHashMappingPlugin.js +4 -4
- package/lib/postcss-plugins/RTLSplitPlugin.js +10 -10
- package/lib/postcss-plugins/hoverActivePlugin.js +357 -0
- package/lib/postcss-plugins/keyframesPlugin.js +126 -0
- package/lib/schemas/index.js +23 -2
- package/lib/servers/{devBulid.js → devBuild.js} +7 -3
- package/lib/servers/httpsOptions.js +2 -3
- package/lib/servers/nowatchserver.js +2 -2
- package/lib/servers/server.js +11 -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/repoClone.js +5 -2
- package/lib/utils/resultSchema.json +73 -73
- package/npm8.md +9 -9
- package/package.json +148 -144
- package/postpublish.js +6 -0
- 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 +1493 -1493
- 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/DOTO.md +0 -13
- package/cert/cert.pem +0 -37
- package/cert/key.pem +0 -27
- package/cert/passphrase.pem +0 -1
- package/eslint/NOTES.md +0 -3
- package/eslint/a23.c +0 -16
- package/eslint/a28.c +0 -25
- package/eslint/a29.c +0 -25
- package/eslint/a30.c +0 -29
- package/eslint/a31.c +0 -23
- package/eslint/a35.c +0 -23
- package/eslint/a36.c +0 -18
- package/eslint/a37.c +0 -25
- package/eslint/a38.c +0 -28
- package/eslint/a39.c +0 -17
- package/eslint/a40.c +0 -32
- package/eslint/mockapi.html +0 -18
- package/eslint/mockapi.md +0 -5
@@ -0,0 +1,357 @@
|
|
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 previousNodeCheck(nodes, index) {
|
8
|
+
return nodes !== undefined && nodes[index - 1] !== undefined && nodes[index - 1] && nodes[index - 1].text !== undefined;
|
9
|
+
}
|
10
|
+
|
11
|
+
function isComment(node) {
|
12
|
+
return node !== undefined && node.type === 'comment';
|
13
|
+
}
|
14
|
+
|
15
|
+
function isHoverPresent(atrule) {
|
16
|
+
let hoverPresent = false;
|
17
|
+
atrule.walkRules(rule => {
|
18
|
+
if (rule.selector.includes('hover')) {
|
19
|
+
hoverPresent = true;
|
20
|
+
}
|
21
|
+
});
|
22
|
+
return hoverPresent;
|
23
|
+
}
|
24
|
+
|
25
|
+
module.exports = _postcss.default.plugin('postcss-mobile-hover', () => rootOriginal => {
|
26
|
+
const hoverRules = [];
|
27
|
+
let positionsObj = {};
|
28
|
+
const hoverIgnoreQuery = 'Hover:ignore',
|
29
|
+
activeIgnoreQuery = 'Active:ignore',
|
30
|
+
hoverActiveIgnoreQuery = 'HoverActive:ignore';
|
31
|
+
const medHoverIgnoreQuery = 'MedHover:ignore',
|
32
|
+
medActiveIgnoreQuery = 'MedActive:ignore',
|
33
|
+
medHoverActiveIgnoreQuery = 'MedHoverActive:ignore';
|
34
|
+
|
35
|
+
function QueryIgnoreCheck(index, type) {
|
36
|
+
if (previousNodeCheck(rootOriginal.nodes, index)) {
|
37
|
+
return rootOriginal.nodes[index - 1].text === type;
|
38
|
+
}
|
39
|
+
|
40
|
+
return false;
|
41
|
+
}
|
42
|
+
|
43
|
+
function mediaQueryIgnoreCheck(node, type) {
|
44
|
+
if (isComment(node)) {
|
45
|
+
return node.text === type;
|
46
|
+
}
|
47
|
+
|
48
|
+
return false;
|
49
|
+
}
|
50
|
+
|
51
|
+
function handleIgnore({
|
52
|
+
index,
|
53
|
+
atrule,
|
54
|
+
type
|
55
|
+
}) {
|
56
|
+
if (type.match(/(Hover:ignore|Active:ignore|HoverActive:ignore)/g)) {
|
57
|
+
return QueryIgnoreCheck(index, type);
|
58
|
+
}
|
59
|
+
|
60
|
+
if (type.match(/(MedHover:ignore|MedActive:ignore|MedHoverActive:ignore)/g)) {
|
61
|
+
return mediaQueryIgnoreCheck(atrule.nodes[index - 1], type.slice(3));
|
62
|
+
}
|
63
|
+
}
|
64
|
+
|
65
|
+
function returnPositions(parent) {
|
66
|
+
let positions = {
|
67
|
+
hovMed: rootOriginal.nodes[positionsObj[`${parent.params} and all and (min--moz-device-pixel-ratio:0) and (hover: hover), (hover: hover)`] - 1],
|
68
|
+
actMed: rootOriginal.nodes[positionsObj[`${parent.params} and (hover: none)`] - 1]
|
69
|
+
};
|
70
|
+
return positions;
|
71
|
+
}
|
72
|
+
|
73
|
+
function handleMedHoverAndHoverActiveIgnore(atrule, index) {
|
74
|
+
return !handleIgnore({
|
75
|
+
atrule,
|
76
|
+
index,
|
77
|
+
type: medHoverIgnoreQuery
|
78
|
+
}) && !handleIgnore({
|
79
|
+
atrule,
|
80
|
+
index,
|
81
|
+
type: medHoverActiveIgnoreQuery
|
82
|
+
});
|
83
|
+
}
|
84
|
+
|
85
|
+
function handleMedActiveAndHoverActiveIgnore(atrule, index) {
|
86
|
+
return !handleIgnore({
|
87
|
+
atrule,
|
88
|
+
index,
|
89
|
+
type: medActiveIgnoreQuery
|
90
|
+
}) && !handleIgnore({
|
91
|
+
atrule,
|
92
|
+
index,
|
93
|
+
type: medHoverActiveIgnoreQuery
|
94
|
+
});
|
95
|
+
}
|
96
|
+
|
97
|
+
function handleHoverAndHoverActiveIgnore(index) {
|
98
|
+
return !handleIgnore({
|
99
|
+
index,
|
100
|
+
type: hoverIgnoreQuery
|
101
|
+
}) && !handleIgnore({
|
102
|
+
index,
|
103
|
+
type: hoverActiveIgnoreQuery
|
104
|
+
});
|
105
|
+
}
|
106
|
+
|
107
|
+
function handleActiveAndHoverActiveIgnore(index) {
|
108
|
+
return !handleIgnore({
|
109
|
+
index,
|
110
|
+
type: activeIgnoreQuery
|
111
|
+
}) && !handleIgnore({
|
112
|
+
index,
|
113
|
+
type: hoverActiveIgnoreQuery
|
114
|
+
});
|
115
|
+
}
|
116
|
+
|
117
|
+
function handleAllIgnoreCases(index) {
|
118
|
+
return !handleIgnore({
|
119
|
+
index,
|
120
|
+
type: activeIgnoreQuery
|
121
|
+
}) && !handleIgnore({
|
122
|
+
index,
|
123
|
+
type: hoverIgnoreQuery
|
124
|
+
}) && !handleIgnore({
|
125
|
+
index,
|
126
|
+
type: hoverActiveIgnoreQuery
|
127
|
+
});
|
128
|
+
}
|
129
|
+
|
130
|
+
function mediaCommaQuery(rule, index) {
|
131
|
+
if (rule.parent.params !== undefined && !rule.parent.params.includes('hover')) {
|
132
|
+
//console.log(hovMed, actMed);
|
133
|
+
let newSelector = '';
|
134
|
+
let {
|
135
|
+
hovMed,
|
136
|
+
actMed
|
137
|
+
} = returnPositions(rule.parent);
|
138
|
+
let hovQueries = [];
|
139
|
+
let actQueries = [];
|
140
|
+
rule.selector.split(/\s*,\s*/).forEach(_subrule => {
|
141
|
+
let subrule = _subrule.trim();
|
142
|
+
|
143
|
+
let clone = rule.clone();
|
144
|
+
|
145
|
+
if (subrule.includes('hover')) {
|
146
|
+
clone.selector = subrule;
|
147
|
+
|
148
|
+
if (handleMedHoverAndHoverActiveIgnore(rule.parent, index)) {
|
149
|
+
hovQueries.push(subrule);
|
150
|
+
}
|
151
|
+
|
152
|
+
if (handleMedActiveAndHoverActiveIgnore(rule.parent, index)) {
|
153
|
+
actQueries.push(subrule);
|
154
|
+
}
|
155
|
+
} else {
|
156
|
+
newSelector += `${subrule}, `;
|
157
|
+
}
|
158
|
+
});
|
159
|
+
|
160
|
+
if (hovQueries.length > 0) {
|
161
|
+
let clone = rule.clone();
|
162
|
+
clone.selector = hovQueries.join(',');
|
163
|
+
hovMed.append(clone);
|
164
|
+
}
|
165
|
+
|
166
|
+
if (actQueries.length > 0) {
|
167
|
+
let clone = rule.clone();
|
168
|
+
clone.selector = actQueries.join(',');
|
169
|
+
actMed.append(clone.clone({
|
170
|
+
selector: clone.selector.replace(/:hover/gi, ':active')
|
171
|
+
}));
|
172
|
+
}
|
173
|
+
|
174
|
+
if (handleMedHoverAndHoverActiveIgnore(rule.parent, index)) {
|
175
|
+
rule.selector = newSelector.substring(0, newSelector.length - 2);
|
176
|
+
}
|
177
|
+
|
178
|
+
if (rule.selector === '') {
|
179
|
+
rule.remove();
|
180
|
+
}
|
181
|
+
}
|
182
|
+
}
|
183
|
+
|
184
|
+
function mediaQuery(rule, index) {
|
185
|
+
// console.log(rule.parent.params + " and all and (min--moz-device-pixel-ratio:0) and (hover: hover), (hover: hover)");
|
186
|
+
if (rule.parent.params !== undefined && !rule.parent.params.includes('hover')) {
|
187
|
+
let {
|
188
|
+
hovMed,
|
189
|
+
actMed
|
190
|
+
} = returnPositions(rule.parent);
|
191
|
+
|
192
|
+
if (rule.selector.includes('hover') && hovMed !== undefined && rule.parent.type === 'atrule') {
|
193
|
+
if (handleMedHoverAndHoverActiveIgnore(rule.parent, index)) {
|
194
|
+
hovMed.append(rule);
|
195
|
+
}
|
196
|
+
|
197
|
+
if (handleMedActiveAndHoverActiveIgnore(rule.parent, index)) {
|
198
|
+
actMed.append(rule.clone({
|
199
|
+
selector: rule.selector.replace(/:hover/gi, ':active')
|
200
|
+
}));
|
201
|
+
}
|
202
|
+
}
|
203
|
+
}
|
204
|
+
}
|
205
|
+
|
206
|
+
function commaQuery(rule, index) {
|
207
|
+
//console.log("comma" , rule.selector.split('\n'));
|
208
|
+
let newSelector = '';
|
209
|
+
let hovQueries = [];
|
210
|
+
rule.selector.split(/\s*,\s*/).forEach(_subrule => {
|
211
|
+
let subrule = _subrule.trim();
|
212
|
+
|
213
|
+
if (subrule.includes('hover')) {
|
214
|
+
// hoverRules.push({ rule: clone, index });
|
215
|
+
hovQueries.push(subrule);
|
216
|
+
} else {
|
217
|
+
newSelector += `${subrule}, `;
|
218
|
+
}
|
219
|
+
});
|
220
|
+
|
221
|
+
if (hovQueries.length > 0) {
|
222
|
+
let clone = rule.clone();
|
223
|
+
clone.selector = hovQueries.join(',');
|
224
|
+
hoverRules.push({
|
225
|
+
rule: clone,
|
226
|
+
index
|
227
|
+
});
|
228
|
+
}
|
229
|
+
|
230
|
+
if (handleHoverAndHoverActiveIgnore(index)) {
|
231
|
+
rule.selector = newSelector.substring(0, newSelector.length - 2).trim();
|
232
|
+
}
|
233
|
+
|
234
|
+
if (rule.selector === '') {
|
235
|
+
rule.remove();
|
236
|
+
}
|
237
|
+
} // Start by identifying all :hover rules
|
238
|
+
|
239
|
+
|
240
|
+
rootOriginal.walkAtRules(atrule => {
|
241
|
+
//console.log(positions[`${atrule.params} and all and (min--moz-device-pixel-ratio:0) and (hover: hover), (hover: hover)`])
|
242
|
+
const hoverQuery = `${atrule.params} and all and (min--moz-device-pixel-ratio:0) and (hover: hover), (hover: hover)`;
|
243
|
+
const activeQuery = `${atrule.params} and (hover: none)`;
|
244
|
+
|
245
|
+
if (isHoverPresent(atrule)) {
|
246
|
+
if (!positionsObj[hoverQuery] && !positionsObj[activeQuery]) {
|
247
|
+
rootOriginal.append({
|
248
|
+
name: 'media',
|
249
|
+
params: hoverQuery
|
250
|
+
});
|
251
|
+
positionsObj[hoverQuery] = rootOriginal.nodes.length - 1;
|
252
|
+
rootOriginal.append({
|
253
|
+
name: 'media',
|
254
|
+
params: activeQuery
|
255
|
+
});
|
256
|
+
positionsObj[activeQuery] = rootOriginal.nodes.length - 1;
|
257
|
+
}
|
258
|
+
}
|
259
|
+
});
|
260
|
+
rootOriginal.walkRules(/:hover/i, (rule, index) => {
|
261
|
+
// console.log({ rule, index });
|
262
|
+
// media hover query with ',' ' ' '+'
|
263
|
+
// console.log("media query" , rule.selector)
|
264
|
+
if (rule.parent.type === 'atrule' && rule.selector.includes(',')) {
|
265
|
+
//console.log("media comma", rule.selector)
|
266
|
+
mediaCommaQuery(rule, index);
|
267
|
+
} else {
|
268
|
+
// plus, space and other media queries
|
269
|
+
//console.log("media", rule.selector)
|
270
|
+
mediaQuery(rule, index);
|
271
|
+
} // usual hover query
|
272
|
+
|
273
|
+
|
274
|
+
if (!rule.selector.match(/,+| +|\++/g) && rule.parent !== undefined && rule.parent.name === undefined) {
|
275
|
+
hoverRules.push({
|
276
|
+
rule,
|
277
|
+
index
|
278
|
+
});
|
279
|
+
} //usual hover query with ',' ' ' '+'
|
280
|
+
|
281
|
+
|
282
|
+
if (rule.selector.match(/,+| +|\++/g) && rule.parent.name === undefined) {
|
283
|
+
if (rule.selector.includes(',')) {
|
284
|
+
commaQuery(rule, index);
|
285
|
+
} else if (rule.selector.match(/ +|\++/g)) {
|
286
|
+
//console.log("plus or space" , rule.selector);
|
287
|
+
if (rule.selector.includes('hover')) {
|
288
|
+
hoverRules.push({
|
289
|
+
rule,
|
290
|
+
index
|
291
|
+
}); //rule.remove();
|
292
|
+
}
|
293
|
+
}
|
294
|
+
}
|
295
|
+
}); // If there are any :hover rules in the input, then create media queries
|
296
|
+
// to automatically translate it into :active on touch-based devices
|
297
|
+
|
298
|
+
if (hoverRules.length > 0) {
|
299
|
+
// Create a media query targetting devices that actually support
|
300
|
+
// hover
|
301
|
+
const hoverQuery = rootOriginal.append({
|
302
|
+
name: 'media',
|
303
|
+
params: 'all and (min--moz-device-pixel-ratio:0) and (hover: hover), (hover: hover)'
|
304
|
+
}).last; // Create a media query targetting devices that don't support hover
|
305
|
+
// (ie. devices where we should fall back to :active instead)
|
306
|
+
|
307
|
+
const activeQuery = rootOriginal.append({
|
308
|
+
name: 'media',
|
309
|
+
params: '(hover: none)'
|
310
|
+
}).last; // Loop through the hover rules and apply them to each of the media
|
311
|
+
// queries
|
312
|
+
// eslint-disable-next-line no-labels
|
313
|
+
|
314
|
+
outerLoop: for (const hoverRule of hoverRules) {
|
315
|
+
// determine if the rule has been nested inside another media
|
316
|
+
// query; in that case bail out as we have no way of reliably
|
317
|
+
// nesting these queries
|
318
|
+
let parentRule = hoverRule.rule.parent;
|
319
|
+
|
320
|
+
while (parentRule) {
|
321
|
+
if (parentRule.type === 'atrule' && parentRule.name === 'media') {
|
322
|
+
// eslint-disable-next-line no-labels
|
323
|
+
continue outerLoop;
|
324
|
+
}
|
325
|
+
|
326
|
+
parentRule = parentRule.parent;
|
327
|
+
} // Push a clone of the :hover rule 'as is' to queries where we
|
328
|
+
// expect the user's device to support hover
|
329
|
+
// ieQuery.append(hoverRule.clone());
|
330
|
+
|
331
|
+
|
332
|
+
if (handleHoverAndHoverActiveIgnore(hoverRule.index)) {
|
333
|
+
hoverQuery.append(hoverRule.rule.clone());
|
334
|
+
} // Push a clone of the :hover rule, where we transform the
|
335
|
+
// selector to :active to the query targetting devices that
|
336
|
+
// don't support hover
|
337
|
+
|
338
|
+
|
339
|
+
if (handleActiveAndHoverActiveIgnore(hoverRule.index)) {
|
340
|
+
activeQuery.append(hoverRule.rule.clone({
|
341
|
+
selector: hoverRule.rule.selector.replace(/:hover/gi, ':active')
|
342
|
+
}));
|
343
|
+
} // remove legacy rule from output
|
344
|
+
|
345
|
+
|
346
|
+
if (handleAllIgnoreCases(hoverRule.index)) {
|
347
|
+
hoverRule.rule.remove();
|
348
|
+
}
|
349
|
+
}
|
350
|
+
}
|
351
|
+
|
352
|
+
rootOriginal.walkAtRules(atrule => {
|
353
|
+
if (atrule !== undefined && atrule.nodes !== undefined && atrule.nodes.length === 0 || atrule.nodes === undefined) {
|
354
|
+
atrule.remove();
|
355
|
+
}
|
356
|
+
});
|
357
|
+
});
|
@@ -0,0 +1,126 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _postcss = _interopRequireWildcard(require("postcss"));
|
4
|
+
|
5
|
+
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); }
|
6
|
+
|
7
|
+
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; }
|
8
|
+
|
9
|
+
module.exports = _postcss.default.plugin('postcss-reduced-motion', () => {
|
10
|
+
function animDeclPosn(rule) {
|
11
|
+
let posn = -1;
|
12
|
+
rule.walkDecls((decl, index) => {
|
13
|
+
//console.log(decl.prop, " " , decl.value);
|
14
|
+
if (decl.prop.includes('animation')) {
|
15
|
+
//console.log(decl.prop," selected")
|
16
|
+
posn = index;
|
17
|
+
}
|
18
|
+
});
|
19
|
+
return posn;
|
20
|
+
}
|
21
|
+
|
22
|
+
return root => {
|
23
|
+
let redRules = [];
|
24
|
+
root.walkAtRules((atrule, index) => {
|
25
|
+
if (index !== 0) {
|
26
|
+
//ignore case
|
27
|
+
let ignore = false;
|
28
|
+
|
29
|
+
if (root.nodes[index - 1].type === 'comment') {
|
30
|
+
ignore = root.nodes[index - 1].text.includes('reduced-motion:ignore');
|
31
|
+
} //animation none push to reduced motion
|
32
|
+
|
33
|
+
|
34
|
+
if (!ignore) {
|
35
|
+
//console.log(atrule)
|
36
|
+
atrule.walkRules(rule => {
|
37
|
+
let pos = animDeclPosn(rule);
|
38
|
+
|
39
|
+
if (pos !== -1) {
|
40
|
+
let ruleNew = rule.clone();
|
41
|
+
let decl = ruleNew.nodes[pos];
|
42
|
+
let declClone = decl.clone();
|
43
|
+
declClone.value = 'none';
|
44
|
+
ruleNew.walkDecls(declVal => declVal.remove());
|
45
|
+
ruleNew.append(declClone);
|
46
|
+
let atRuleNew = atrule.clone();
|
47
|
+
atRuleNew.nodes = [];
|
48
|
+
atRuleNew.push(ruleNew);
|
49
|
+
redRules.push(atRuleNew);
|
50
|
+
}
|
51
|
+
});
|
52
|
+
}
|
53
|
+
} else {
|
54
|
+
//animation none push to reduced motion
|
55
|
+
//console.log(atrule)
|
56
|
+
atrule.walkRules(rule => {
|
57
|
+
let pos = animDeclPosn(rule);
|
58
|
+
|
59
|
+
if (pos !== -1) {
|
60
|
+
let ruleNew = rule.clone();
|
61
|
+
let decl = ruleNew.nodes[pos];
|
62
|
+
let declClone = decl.clone();
|
63
|
+
declClone.value = 'none';
|
64
|
+
ruleNew.walkDecls(declVal => declVal.remove());
|
65
|
+
ruleNew.append(declClone);
|
66
|
+
let atRuleNew = atrule.clone();
|
67
|
+
atRuleNew.nodes = [];
|
68
|
+
atRuleNew.push(ruleNew);
|
69
|
+
redRules.push(atRuleNew);
|
70
|
+
}
|
71
|
+
});
|
72
|
+
}
|
73
|
+
});
|
74
|
+
root.walkRules((rule, index) => {
|
75
|
+
if (rule.type === 'rule' && rule.parent.name === undefined) {
|
76
|
+
if (index !== 0) {
|
77
|
+
//ignore case
|
78
|
+
let ignore = false;
|
79
|
+
|
80
|
+
if (root.nodes[index - 1].type === 'comment') {
|
81
|
+
ignore = root.nodes[index - 1].text.includes('reduced-motion:ignore');
|
82
|
+
} //animation none push to reduced motion
|
83
|
+
|
84
|
+
|
85
|
+
if (!ignore) {
|
86
|
+
//console.log(atrule)
|
87
|
+
rule.walkDecls(decl => {
|
88
|
+
if (decl !== undefined && decl.prop.includes('animation')) {
|
89
|
+
let declClone = decl.clone();
|
90
|
+
let newRule = rule.clone();
|
91
|
+
declClone.value = 'none';
|
92
|
+
newRule.walkDecls(declVal => declVal.remove());
|
93
|
+
newRule.append(declClone);
|
94
|
+
redRules.push(newRule);
|
95
|
+
}
|
96
|
+
});
|
97
|
+
}
|
98
|
+
} else {
|
99
|
+
//animation none push to reduced motion
|
100
|
+
//console.log(atrule)
|
101
|
+
rule.walkDecls(decl => {
|
102
|
+
if (decl !== undefined && decl.prop.includes('animation')) {
|
103
|
+
let declClone = decl.clone();
|
104
|
+
let newRule = rule.clone();
|
105
|
+
declClone.value = 'none';
|
106
|
+
newRule.walkDecls(declVal => declVal.remove());
|
107
|
+
newRule.append(declClone);
|
108
|
+
redRules.push(newRule);
|
109
|
+
}
|
110
|
+
});
|
111
|
+
}
|
112
|
+
}
|
113
|
+
});
|
114
|
+
|
115
|
+
if (redRules.length > 0) {
|
116
|
+
let redMtnQuery = (0, _postcss.atRule)({
|
117
|
+
name: 'media',
|
118
|
+
params: '(prefers-reduced-motion)'
|
119
|
+
});
|
120
|
+
root.append(redMtnQuery).last;
|
121
|
+
redRules.forEach(rule => {
|
122
|
+
redMtnQuery.append(rule);
|
123
|
+
});
|
124
|
+
}
|
125
|
+
};
|
126
|
+
});
|
package/lib/schemas/index.js
CHANGED
@@ -14,6 +14,11 @@ var _getCurrentBranch = _interopRequireDefault(require("../utils/getCurrentBranc
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
15
|
|
16
16
|
var _default = {
|
17
|
+
cliRootPath: null,
|
18
|
+
unstableDepsInverse: {
|
19
|
+
value: false,
|
20
|
+
cli: 'unstable_deps_inverse'
|
21
|
+
},
|
17
22
|
sslCertURL: {
|
18
23
|
value: null,
|
19
24
|
cli: 'ssl_cert_url'
|
@@ -60,7 +65,10 @@ var _default = {
|
|
60
65
|
dirVarName: 'document.dir'
|
61
66
|
},
|
62
67
|
efc: {
|
63
|
-
hasEFC:
|
68
|
+
hasEFC: {
|
69
|
+
value: false,
|
70
|
+
cli: 'enable_efc'
|
71
|
+
},
|
64
72
|
createSDkFile: false,
|
65
73
|
nameScope: 'ZOHODESK',
|
66
74
|
version: 'default',
|
@@ -148,7 +156,10 @@ var _default = {
|
|
148
156
|
disableES5Transpile: false,
|
149
157
|
isReactMig: false,
|
150
158
|
hasWidget: false,
|
151
|
-
hasEFC:
|
159
|
+
hasEFC: {
|
160
|
+
value: false,
|
161
|
+
cli: 'enable_efc'
|
162
|
+
},
|
152
163
|
enableChunkHash: {
|
153
164
|
value: false,
|
154
165
|
cli: 'hash_enable'
|
@@ -204,6 +215,8 @@ var _default = {
|
|
204
215
|
value: 'zd',
|
205
216
|
cli: 'class_prefix'
|
206
217
|
},
|
218
|
+
combinerMq: false,
|
219
|
+
hoverActive: false,
|
207
220
|
selectorReplace: null,
|
208
221
|
devConsoleExculde: {
|
209
222
|
value: false,
|
@@ -256,6 +269,10 @@ var _default = {
|
|
256
269
|
value: true,
|
257
270
|
cli: 'css_unique'
|
258
271
|
},
|
272
|
+
enableChunkHash: false,
|
273
|
+
combinerMq: false,
|
274
|
+
hoverActive: false,
|
275
|
+
keyframesRedMtn: false,
|
259
276
|
folder: 'src',
|
260
277
|
disableES5Transpile: false,
|
261
278
|
hasRTL: false,
|
@@ -554,6 +571,10 @@ var _default = {
|
|
554
571
|
value: null,
|
555
572
|
cli: 'clone_revision'
|
556
573
|
},
|
574
|
+
shallowClone: {
|
575
|
+
value: false,
|
576
|
+
cli: 'shallow_clone'
|
577
|
+
},
|
557
578
|
projectName: {
|
558
579
|
value: null,
|
559
580
|
cli: 'clone_proj_name'
|
@@ -18,6 +18,9 @@ var _getCliPath = require("./getCliPath");
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
19
|
|
20
20
|
const options = (0, _utils.getOptions)(); // const args = process.argv.slice(3);
|
21
|
+
// NOTE: need to discuss about in below codes,
|
22
|
+
// when we run webpack the usable options that comes for npm run not working as automatical
|
23
|
+
// we are use this option always --disable_watch=true reason for now no need for
|
21
24
|
|
22
25
|
const {
|
23
26
|
app: {
|
@@ -61,8 +64,9 @@ const startTime = Date.now(); // const result = spawnSync(
|
|
61
64
|
// ),
|
62
65
|
// { stdio: 'inherit' }
|
63
66
|
// );
|
67
|
+
// --disable_watch=true
|
64
68
|
|
65
|
-
const result = execSyncDefalut(`${webpack} --config ${require.resolve('../configs/webpack.dev.config.js')}`);
|
69
|
+
const result = execSyncDefalut(`${webpack} --config ${require.resolve('../configs/webpack.dev.config.js')} ${process.argv.slice(2).map(o => o.replace(/(.*?)=(.*)/, '$1="$2"')).join(' ')} `);
|
66
70
|
result && console.log(result);
|
67
71
|
|
68
72
|
if (result && result.stderr) {
|
@@ -83,8 +87,8 @@ if (zipname) {
|
|
83
87
|
} else {
|
84
88
|
console.log('zip file created', cssSelectorZipPath);
|
85
89
|
}
|
86
|
-
} // npm run start --app:domain=tsi --impact:cssbountry="{$@&&@$}" --disable-watch --dev-cache --cssselector_zip=css-source-map.zip
|
87
|
-
// npm run start --app_domain=tsi --impact_cssbountry="{$@&&@$}" --disable-watch --dev-cache --cssselector_zip=css-source-map.zip
|
90
|
+
} // npm run start --app:domain=tsi --impact:cssbountry="{$@&&@$}" --disable-watch --dev-cache --cssselector_zip=css-source-map.zip
|
91
|
+
// npm run start --app_domain=tsi --impact_cssbountry="{$@&&@$}" --disable-watch --dev-cache --cssselector_zip=css-source-map.zip
|
88
92
|
|
89
93
|
|
90
94
|
console.log(`compailation done in ${Date.now() - startTime}ms`);
|
@@ -12,8 +12,7 @@ var _path = _interopRequireDefault(require("path"));
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
13
|
|
14
14
|
const httpsOptions = {
|
15
|
-
key: _fs.default.readFileSync(_path.default.join(__dirname, '../../cert/key
|
16
|
-
cert: _fs.default.readFileSync(_path.default.join(__dirname, '../../cert/
|
17
|
-
passphrase: _fs.default.readFileSync(_path.default.join(__dirname, '../../cert/passphrase.pem')).toString()
|
15
|
+
key: _fs.default.readFileSync(_path.default.join(__dirname, '../../cert/Tsicsezwild-22-23.key')),
|
16
|
+
cert: _fs.default.readFileSync(_path.default.join(__dirname, '../../cert/Tsicsezwild-22-23.crt'))
|
18
17
|
};
|
19
18
|
exports.httpsOptions = httpsOptions;
|
@@ -14,7 +14,7 @@ var _utils = require("../utils");
|
|
14
14
|
|
15
15
|
var _httpsOptions = require("./httpsOptions");
|
16
16
|
|
17
|
-
var
|
17
|
+
var _devBuild = require("./devBuild");
|
18
18
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
20
20
|
|
@@ -42,7 +42,7 @@ const {
|
|
42
42
|
zipname,
|
43
43
|
cssSelectorZipPath,
|
44
44
|
outputFolderLocation
|
45
|
-
} = (0,
|
45
|
+
} = (0, _devBuild.getPaths)();
|
46
46
|
const app = (0, _express.default)();
|
47
47
|
|
48
48
|
if (hasMock) {
|
package/lib/servers/server.js
CHANGED
@@ -69,7 +69,8 @@ if (mode === 'prod') {
|
|
69
69
|
config = require('../configs/webpack.dev.config');
|
70
70
|
} else {
|
71
71
|
throw new Error('You must configure valid option in mode');
|
72
|
-
}
|
72
|
+
} // console.log({ contextURL });
|
73
|
+
|
73
74
|
|
74
75
|
let compiler = (0, _webpack.default)(config);
|
75
76
|
let webpackServerOptions = {
|
@@ -144,15 +145,22 @@ app.post('/wmsmockapi', (req, res) => {
|
|
144
145
|
res.send('success');
|
145
146
|
});
|
146
147
|
let webpackCompilation;
|
148
|
+
let initalHTML;
|
147
149
|
compiler.hooks.afterCompile.tap('ReactCLI', compilation => {
|
148
150
|
webpackCompilation = compilation;
|
149
151
|
});
|
152
|
+
compiler.hooks.done.tap('ReactCLI', () => {
|
153
|
+
const indexHtml = webpackCompilation.assets['index.html'];
|
154
|
+
|
155
|
+
if (indexHtml) {
|
156
|
+
initalHTML = indexHtml.source();
|
157
|
+
}
|
158
|
+
});
|
150
159
|
|
151
160
|
if (contextURL) {
|
152
161
|
app.use(contextURL, _express.default.static(context));
|
153
162
|
app.use(`${contextURL}/*`, (req, res) => {
|
154
|
-
|
155
|
-
res.send(indexHtml && indexHtml.source());
|
163
|
+
res.send(initalHTML);
|
156
164
|
});
|
157
165
|
} else {
|
158
166
|
app.use(_express.default.static(context));
|