@zohodesk/react-cli 1.0.2-exp.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. package/.eslintignore +7 -7
  2. package/.eslintrc.js +180 -180
  3. package/.prettierrc +6 -6
  4. package/Changelog.md +1019 -1019
  5. package/README.md +1184 -1165
  6. package/bin/cli.js +483 -483
  7. package/docs/CustomChunks.md +26 -26
  8. package/docs/DevServerPort.md +39 -39
  9. package/docs/DevStart.md +18 -18
  10. package/docs/HoverActive.md +12 -12
  11. package/docs/InstallNode.md +28 -28
  12. package/docs/SelectorWeight.md +8 -8
  13. package/docs/TODOS.md +10 -10
  14. package/docs/ValueReplacer.md +60 -60
  15. package/docs/VariableConversion.md +729 -729
  16. package/docs/warnings_while_install.txt +35 -35
  17. package/files/eslintrc.js +62 -62
  18. package/files/prettierrc.js +3 -3
  19. package/lib/common/testPattern.js +0 -2
  20. package/lib/common/valueReplacer.js +1 -3
  21. package/lib/configs/resolvers.js +14 -3
  22. package/lib/configs/webpack.css.umd.config.js +4 -4
  23. package/lib/configs/webpack.dev.config.js +0 -6
  24. package/lib/configs/webpack.docs.config.js +0 -4
  25. package/lib/configs/webpack.impact.config.js +0 -4
  26. package/lib/configs/webpack.prod.config.js +0 -6
  27. package/lib/loaderUtils/configsAssetsLoaders.js +33 -33
  28. package/lib/loaderUtils/getCSSLoaders.js +47 -81
  29. package/lib/loaderUtils/windowsModification.js +1 -6
  30. package/lib/loaders/selectorMappingLoader.js +9 -9
  31. package/lib/loaders/workerLoader.js +9 -9
  32. package/lib/logger.js +20 -0
  33. package/lib/pluginUtils/getDevPlugins.js +12 -18
  34. package/lib/pluginUtils/getProdPlugins.js +10 -6
  35. package/lib/pluginUtils/getUMDCSSPlugins.js +1 -1
  36. package/lib/pluginUtils/getUMDComponentPlugins.js +1 -1
  37. package/lib/plugins/CustomAttributePlugin.js +82 -0
  38. package/lib/plugins/CustomAttributePlugin.md +35 -0
  39. package/lib/plugins/EFCPlugin.js +9 -9
  40. package/lib/plugins/EFCPlugin.md +6 -6
  41. package/lib/plugins/EFCTemplatePlugin.js +10 -12
  42. package/lib/plugins/I18NInjectIntoIndexPlugin.js +12 -13
  43. package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +2 -3
  44. package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +38 -38
  45. package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +30 -30
  46. package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +10 -15
  47. package/lib/plugins/I18nSplitPlugin/I18nSplit.md +95 -95
  48. package/lib/plugins/I18nSplitPlugin/README.md +25 -25
  49. package/lib/plugins/I18nSplitPlugin/index.js +57 -57
  50. package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +8 -8
  51. package/lib/plugins/ResourceHintsPlugin.js +17 -17
  52. package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +6 -6
  53. package/lib/plugins/RtlSplitPlugin/RtrSplit.md +30 -30
  54. package/lib/plugins/SelectorPlugin.js +36 -53
  55. package/lib/plugins/ServiceWorkerPlugin.js +9 -9
  56. package/lib/plugins/TPHashMappingPlugin.js +4 -4
  57. package/lib/plugins/{MinifyPlugin.js → UglifyCSSPlugin.js} +3 -3
  58. package/lib/plugins/VariableConversionCollector.js +84 -97
  59. package/lib/plugins/composeCommonPlugin.js +30 -0
  60. package/lib/plugins/index.js +7 -7
  61. package/lib/postcss-plugins/ExcludePlugin.js +1 -1
  62. package/lib/postcss-plugins/IncludePlugin.js +0 -1
  63. package/lib/postcss-plugins/RTLSplitPlugin.js +14 -20
  64. package/lib/postcss-plugins/ValueReplacer.js +14 -5
  65. package/lib/postcss-plugins/__test__/test1Input.css +38 -38
  66. package/lib/postcss-plugins/__test__/test1Output.css +38 -38
  67. package/lib/postcss-plugins/hoverActivePlugin.js +3 -9
  68. package/lib/postcss-plugins/variableModificationPlugin/index.js +20 -3
  69. package/lib/postcss-plugins/variableModifier.js +24 -58
  70. package/lib/schemas/index.js +11 -35
  71. package/lib/servers/devBuild.js +13 -11
  72. package/lib/servers/httpsOptions.js +12 -13
  73. package/lib/servers/nowatchserver.js +5 -3
  74. package/lib/servers/requireLocalOrGlobal.js +61 -0
  75. package/lib/servers/server.js +3 -5
  76. package/lib/sh/pre-commit.sh +34 -34
  77. package/lib/sh/reportPublish.sh +45 -45
  78. package/lib/utils/buildstats.html +148 -148
  79. package/lib/utils/cssClassNameGenerate.js +12 -41
  80. package/lib/utils/resultSchema.json +73 -73
  81. package/npm8.md +9 -9
  82. package/package-lock.json +14407 -0
  83. package/package.json +120 -122
  84. package/postpublish.js +8 -8
  85. package/templates/app/.eslintrc.js +140 -140
  86. package/templates/app/README.md +12 -12
  87. package/templates/app/app/index.html +24 -24
  88. package/templates/app/app/properties/ApplicationResources_en_US.properties +1 -1
  89. package/templates/app/app/properties/i18nkeys.json +3 -3
  90. package/templates/app/docs/all.html +69 -69
  91. package/templates/app/mockapi/index.js +18 -18
  92. package/templates/app/package.json +37 -37
  93. package/templates/app/src/actions/SampleActions/index.js +37 -37
  94. package/templates/app/src/actions/index.js +65 -65
  95. package/templates/app/src/appUrls.js +19 -19
  96. package/templates/app/src/components/Alert/Alert.js +134 -134
  97. package/templates/app/src/components/Alert/Alert.module.css +79 -79
  98. package/templates/app/src/components/FreezeLayer/FreezeLayer.css +37 -37
  99. package/templates/app/src/components/FreezeLayer/FreezeLayer.js +84 -84
  100. package/templates/app/src/components/Sample/Sample.module.css +11 -11
  101. package/templates/app/src/components/Sample/SampleList.js +61 -61
  102. package/templates/app/src/components/Slider/Slider.css +41 -41
  103. package/templates/app/src/components/Slider/Slider.js +55 -55
  104. package/templates/app/src/containers/AlertContainer/index.js +15 -15
  105. package/templates/app/src/containers/AppContainer/index.js +96 -96
  106. package/templates/app/src/containers/AppContainer/index.module.css +27 -27
  107. package/templates/app/src/containers/CustomMatch/index.js +65 -65
  108. package/templates/app/src/containers/DevTools/index.js +10 -10
  109. package/templates/app/src/containers/Header/index.js +67 -67
  110. package/templates/app/src/containers/Header/index.module.css +43 -43
  111. package/templates/app/src/containers/Redirect/index.js +63 -63
  112. package/templates/app/src/containers/Redirector/index.js +47 -47
  113. package/templates/app/src/containers/SampleListContainer/ListContainer.js +42 -42
  114. package/templates/app/src/containers/SampleListContainer/ListContainer.module.css +3 -3
  115. package/templates/app/src/historyChange.js +5 -5
  116. package/templates/app/src/index.html +10 -10
  117. package/templates/app/src/index.js +24 -24
  118. package/templates/app/src/middleware/PromiseMiddleware.js +59 -59
  119. package/templates/app/src/reducers/alertData.js +11 -11
  120. package/templates/app/src/reducers/index.js +6 -6
  121. package/templates/app/src/reducers/samples.js +19 -19
  122. package/templates/app/src/store/configureStore.dev.js +51 -51
  123. package/templates/app/src/store/configureStore.js +5 -5
  124. package/templates/app/src/store/configureStore.prod.js +26 -26
  125. package/templates/app/src/util/Common.js +5 -5
  126. package/templates/app/src/util/RequestAPI.js +132 -132
  127. package/templates/docs/all.html +249 -249
  128. package/templates/docs/component.html +178 -178
  129. package/templates/docs/components.html +221 -221
  130. package/templates/docs/css/b.min.css +6 -6
  131. package/templates/docs/css/component.css +42 -42
  132. package/templates/docs/css/componentTest.css +6 -6
  133. package/templates/docs/css/hopscotch.css +585 -585
  134. package/templates/docs/css/style.css +1022 -1022
  135. package/templates/docs/impactReportTemplate.html +154 -154
  136. package/templates/docs/index.html +1501 -1501
  137. package/templates/docs/js/active-line.js +72 -72
  138. package/templates/docs/js/b.min.js +7 -7
  139. package/templates/docs/js/codemirror.js +9680 -9680
  140. package/templates/docs/js/designTokens.js +334 -334
  141. package/templates/docs/js/j.min.js +4 -4
  142. package/templates/docs/js/javascript.js +874 -874
  143. package/templates/docs/js/matchbrackets.js +145 -145
  144. package/lib/loaderUtils/tests/windowsModification.test.js +0 -10
  145. package/lib/loaders/composeLoader.js +0 -175
  146. package/lib/plugins/utils/classHandling.js +0 -20
  147. package/lib/plugins/utils/fileHandling.js +0 -92
  148. package/lib/plugins/utils/tests/fileHandling.test.js +0 -30
  149. package/lib/postcss-plugins/EmptyPlugin.js +0 -8
@@ -1,145 +1,145 @@
1
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
- // Distributed under an MIT license: http://codemirror.net/LICENSE
3
-
4
- (function(mod) {
5
- if (typeof exports == "object" && typeof module == "object") // CommonJS
6
- mod(require("../../lib/codemirror"));
7
- else if (typeof define == "function" && define.amd) // AMD
8
- define(["../../lib/codemirror"], mod);
9
- else // Plain browser env
10
- mod(CodeMirror);
11
- })(function(CodeMirror) {
12
- var ie_lt8 = /MSIE \d/.test(navigator.userAgent) &&
13
- (document.documentMode == null || document.documentMode < 8);
14
-
15
- var Pos = CodeMirror.Pos;
16
-
17
- var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
18
-
19
- function findMatchingBracket(cm, where, config) {
20
- var line = cm.getLineHandle(where.line), pos = where.ch - 1;
21
- var afterCursor = config && config.afterCursor
22
- if (afterCursor == null)
23
- afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className)
24
-
25
- // A cursor is defined as between two characters, but in in vim command mode
26
- // (i.e. not insert mode), the cursor is visually represented as a
27
- // highlighted box on top of the 2nd character. Otherwise, we allow matches
28
- // from before or after the cursor.
29
- var match = (!afterCursor && pos >= 0 && matching[line.text.charAt(pos)]) ||
30
- matching[line.text.charAt(++pos)];
31
- if (!match) return null;
32
- var dir = match.charAt(1) == ">" ? 1 : -1;
33
- if (config && config.strict && (dir > 0) != (pos == where.ch)) return null;
34
- var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));
35
-
36
- var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);
37
- if (found == null) return null;
38
- return {from: Pos(where.line, pos), to: found && found.pos,
39
- match: found && found.ch == match.charAt(0), forward: dir > 0};
40
- }
41
-
42
- // bracketRegex is used to specify which type of bracket to scan
43
- // should be a regexp, e.g. /[[\]]/
44
- //
45
- // Note: If "where" is on an open bracket, then this bracket is ignored.
46
- //
47
- // Returns false when no bracket was found, null when it reached
48
- // maxScanLines and gave up
49
- function scanForBracket(cm, where, dir, style, config) {
50
- var maxScanLen = (config && config.maxScanLineLength) || 10000;
51
- var maxScanLines = (config && config.maxScanLines) || 1000;
52
-
53
- var stack = [];
54
- var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/;
55
- var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)
56
- : Math.max(cm.firstLine() - 1, where.line - maxScanLines);
57
- for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {
58
- var line = cm.getLine(lineNo);
59
- if (!line) continue;
60
- var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;
61
- if (line.length > maxScanLen) continue;
62
- if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);
63
- for (; pos != end; pos += dir) {
64
- var ch = line.charAt(pos);
65
- if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {
66
- var match = matching[ch];
67
- if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch);
68
- else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};
69
- else stack.pop();
70
- }
71
- }
72
- }
73
- return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;
74
- }
75
-
76
- function matchBrackets(cm, autoclear, config) {
77
- // Disable brace matching in long lines, since it'll cause hugely slow updates
78
- var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
79
- var marks = [], ranges = cm.listSelections();
80
- for (var i = 0; i < ranges.length; i++) {
81
- var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config);
82
- if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {
83
- var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
84
- marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));
85
- if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)
86
- marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));
87
- }
88
- }
89
-
90
- if (marks.length) {
91
- // Kludge to work around the IE bug from issue #1193, where text
92
- // input stops going to the textare whever this fires.
93
- if (ie_lt8 && cm.state.focused) cm.focus();
94
-
95
- var clear = function() {
96
- cm.operation(function() {
97
- for (var i = 0; i < marks.length; i++) marks[i].clear();
98
- });
99
- };
100
- if (autoclear) setTimeout(clear, 800);
101
- else return clear;
102
- }
103
- }
104
-
105
- function doMatchBrackets(cm) {
106
- cm.operation(function() {
107
- if (cm.state.matchBrackets.currentlyHighlighted) {
108
- cm.state.matchBrackets.currentlyHighlighted();
109
- cm.state.matchBrackets.currentlyHighlighted = null;
110
- }
111
- cm.state.matchBrackets.currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);
112
- });
113
- }
114
-
115
- CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
116
- if (old && old != CodeMirror.Init) {
117
- cm.off("cursorActivity", doMatchBrackets);
118
- if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) {
119
- cm.state.matchBrackets.currentlyHighlighted();
120
- cm.state.matchBrackets.currentlyHighlighted = null;
121
- }
122
- }
123
- if (val) {
124
- cm.state.matchBrackets = typeof val == "object" ? val : {};
125
- cm.on("cursorActivity", doMatchBrackets);
126
- }
127
- });
128
-
129
- CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
130
- CodeMirror.defineExtension("findMatchingBracket", function(pos, config, oldConfig){
131
- // Backwards-compatibility kludge
132
- if (oldConfig || typeof config == "boolean") {
133
- if (!oldConfig) {
134
- config = config ? {strict: true} : null
135
- } else {
136
- oldConfig.strict = config
137
- config = oldConfig
138
- }
139
- }
140
- return findMatchingBracket(this, pos, config)
141
- });
142
- CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){
143
- return scanForBracket(this, pos, dir, style, config);
144
- });
145
- });
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ var ie_lt8 = /MSIE \d/.test(navigator.userAgent) &&
13
+ (document.documentMode == null || document.documentMode < 8);
14
+
15
+ var Pos = CodeMirror.Pos;
16
+
17
+ var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
18
+
19
+ function findMatchingBracket(cm, where, config) {
20
+ var line = cm.getLineHandle(where.line), pos = where.ch - 1;
21
+ var afterCursor = config && config.afterCursor
22
+ if (afterCursor == null)
23
+ afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className)
24
+
25
+ // A cursor is defined as between two characters, but in in vim command mode
26
+ // (i.e. not insert mode), the cursor is visually represented as a
27
+ // highlighted box on top of the 2nd character. Otherwise, we allow matches
28
+ // from before or after the cursor.
29
+ var match = (!afterCursor && pos >= 0 && matching[line.text.charAt(pos)]) ||
30
+ matching[line.text.charAt(++pos)];
31
+ if (!match) return null;
32
+ var dir = match.charAt(1) == ">" ? 1 : -1;
33
+ if (config && config.strict && (dir > 0) != (pos == where.ch)) return null;
34
+ var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));
35
+
36
+ var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);
37
+ if (found == null) return null;
38
+ return {from: Pos(where.line, pos), to: found && found.pos,
39
+ match: found && found.ch == match.charAt(0), forward: dir > 0};
40
+ }
41
+
42
+ // bracketRegex is used to specify which type of bracket to scan
43
+ // should be a regexp, e.g. /[[\]]/
44
+ //
45
+ // Note: If "where" is on an open bracket, then this bracket is ignored.
46
+ //
47
+ // Returns false when no bracket was found, null when it reached
48
+ // maxScanLines and gave up
49
+ function scanForBracket(cm, where, dir, style, config) {
50
+ var maxScanLen = (config && config.maxScanLineLength) || 10000;
51
+ var maxScanLines = (config && config.maxScanLines) || 1000;
52
+
53
+ var stack = [];
54
+ var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/;
55
+ var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)
56
+ : Math.max(cm.firstLine() - 1, where.line - maxScanLines);
57
+ for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {
58
+ var line = cm.getLine(lineNo);
59
+ if (!line) continue;
60
+ var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;
61
+ if (line.length > maxScanLen) continue;
62
+ if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);
63
+ for (; pos != end; pos += dir) {
64
+ var ch = line.charAt(pos);
65
+ if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {
66
+ var match = matching[ch];
67
+ if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch);
68
+ else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};
69
+ else stack.pop();
70
+ }
71
+ }
72
+ }
73
+ return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;
74
+ }
75
+
76
+ function matchBrackets(cm, autoclear, config) {
77
+ // Disable brace matching in long lines, since it'll cause hugely slow updates
78
+ var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
79
+ var marks = [], ranges = cm.listSelections();
80
+ for (var i = 0; i < ranges.length; i++) {
81
+ var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config);
82
+ if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {
83
+ var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
84
+ marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));
85
+ if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)
86
+ marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));
87
+ }
88
+ }
89
+
90
+ if (marks.length) {
91
+ // Kludge to work around the IE bug from issue #1193, where text
92
+ // input stops going to the textare whever this fires.
93
+ if (ie_lt8 && cm.state.focused) cm.focus();
94
+
95
+ var clear = function() {
96
+ cm.operation(function() {
97
+ for (var i = 0; i < marks.length; i++) marks[i].clear();
98
+ });
99
+ };
100
+ if (autoclear) setTimeout(clear, 800);
101
+ else return clear;
102
+ }
103
+ }
104
+
105
+ function doMatchBrackets(cm) {
106
+ cm.operation(function() {
107
+ if (cm.state.matchBrackets.currentlyHighlighted) {
108
+ cm.state.matchBrackets.currentlyHighlighted();
109
+ cm.state.matchBrackets.currentlyHighlighted = null;
110
+ }
111
+ cm.state.matchBrackets.currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);
112
+ });
113
+ }
114
+
115
+ CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
116
+ if (old && old != CodeMirror.Init) {
117
+ cm.off("cursorActivity", doMatchBrackets);
118
+ if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) {
119
+ cm.state.matchBrackets.currentlyHighlighted();
120
+ cm.state.matchBrackets.currentlyHighlighted = null;
121
+ }
122
+ }
123
+ if (val) {
124
+ cm.state.matchBrackets = typeof val == "object" ? val : {};
125
+ cm.on("cursorActivity", doMatchBrackets);
126
+ }
127
+ });
128
+
129
+ CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
130
+ CodeMirror.defineExtension("findMatchingBracket", function(pos, config, oldConfig){
131
+ // Backwards-compatibility kludge
132
+ if (oldConfig || typeof config == "boolean") {
133
+ if (!oldConfig) {
134
+ config = config ? {strict: true} : null
135
+ } else {
136
+ oldConfig.strict = config
137
+ config = oldConfig
138
+ }
139
+ }
140
+ return findMatchingBracket(this, pos, config)
141
+ });
142
+ CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){
143
+ return scanForBracket(this, pos, dir, style, config);
144
+ });
145
+ });
@@ -1,10 +0,0 @@
1
- "use strict";
2
-
3
- const {
4
- windowsModificationFile
5
- } = require('../windowsModification');
6
-
7
- const tests = ['D:\\MyWork\\React Build\\desk_client_app\\jsapps\\supportapp\\src\\components\\Accessibility\\Accessibility.module.css', 'D:/MyWork/React Build/desk_client_app/jsapps/supportapp/src/components/Accessibility/Accessibility.module.css', 'desk_client_app\\jsapps\\supportapp\\src\\components\\Accessibility\\Accessibility.module.css', 'desk_client_app/jsapps/supportapp/src/components/Accessibility/Accessibility.module.css', 'src\\components\\Accessibility\\Accessibility.module.css', 'src/components/Accessibility/Accessibility.module.css', 'Accessibility.module.css', ''];
8
- tests.forEach(test => {
9
- console.log(windowsModificationFile(test));
10
- });
@@ -1,175 +0,0 @@
1
- "use strict";
2
-
3
- var _path = _interopRequireDefault(require("path"));
4
-
5
- var _postcss = _interopRequireDefault(require("postcss"));
6
-
7
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
-
9
- const supportedProps = ['margin-top', 'margin-bottom', 'margin-left', 'margin-right', // 'margin',
10
- 'padding-top', 'padding-bottom', 'padding-left', 'padding-right', // 'padding',
11
- 'top', 'bottom', 'left', 'right', 'height', 'width', 'min-height', 'min-width', 'max-height', 'max-width'];
12
- const renameProps = {
13
- 'margin-top': {
14
- pos: 'mt',
15
- neg: 'mt_'
16
- },
17
- 'margin-bottom': {
18
- pos: 'mb',
19
- neg: 'mb_'
20
- },
21
- 'margin-left': {
22
- pos: 'ml',
23
- neg: 'ml_'
24
- },
25
- 'margin-right': {
26
- pos: 'mr',
27
- neg: 'mr_'
28
- },
29
- margin: {
30
- pos: 'm',
31
- neg: 'm_'
32
- },
33
- 'padding-top': {
34
- pos: 'pt',
35
- neg: 'pt_'
36
- },
37
- 'padding-bottom': {
38
- pos: 'pb',
39
- neg: 'pb_'
40
- },
41
- 'padding-left': {
42
- pos: 'pl',
43
- neg: 'pl_'
44
- },
45
- 'padding-right': {
46
- pos: 'pr',
47
- neg: 'pr_'
48
- },
49
- padding: {
50
- pos: 'p',
51
- neg: 'p_'
52
- },
53
- top: {
54
- pos: 'post',
55
- neg: 'post_'
56
- },
57
- bottom: {
58
- pos: 'posb',
59
- neg: 'posb_'
60
- },
61
- left: {
62
- pos: 'posl',
63
- neg: 'posl_'
64
- },
65
- right: {
66
- pos: 'posr',
67
- neg: 'posr_'
68
- },
69
- height: {
70
- pos: 'h',
71
- neg: 'h_'
72
- },
73
- width: {
74
- pos: 'w',
75
- neg: 'w_'
76
- },
77
- 'min-height': {
78
- pos: 'minh',
79
- neg: 'minh_'
80
- },
81
- 'min-width': {
82
- pos: 'minw',
83
- neg: 'minw_'
84
- },
85
- 'max-height': {
86
- pos: 'maxh',
87
- neg: 'maxh_'
88
- },
89
- 'max-width': {
90
- pos: 'maxw',
91
- neg: 'maxw_'
92
- }
93
- };
94
-
95
- function objToClassName(prop, data) {
96
- return renameProps[prop] ? data < 0 ? renameProps[prop].neg ? `${renameProps[prop].neg}${data * -1}` : `undef${data * -1}` : renameProps[prop].pos ? `${renameProps[prop].pos}${data}` : `undef${data}` : `undef${data}`;
97
- }
98
-
99
- const commonFilePath = {
100
- 'margin-left': 'src/common/css/margin.css',
101
- 'margin-right': 'src/common/css/margin.css',
102
- 'margin-top': 'src/common/css/margin.css',
103
- 'margin-bottom': 'src/common/css/margin.css',
104
- 'padding-left': 'src/common/css/padding.css',
105
- 'padding-right': 'src/common/css/padding.css',
106
- 'padding-top': 'src/common/css/padding.css',
107
- 'padding-bottom': 'src/common/css/padding.css',
108
- top: 'src/common/css/position.css',
109
- bottom: 'src/common/css/position.css',
110
- left: 'src/common/css/position.css',
111
- right: 'src/common/css/position.css',
112
- height: 'src/common/css/height.css',
113
- width: 'src/common/css/width.css',
114
- 'min-height': 'src/common/css/height.css',
115
- 'min-width': 'src/common/css/width.css',
116
- 'max-height': 'src/common/css/height.css',
117
- 'max-width': 'src/common/css/width.css'
118
- };
119
- const preNames = {
120
- height: 'zd-height-',
121
- 'max-height': 'zd-height-',
122
- 'min-height': 'zd-height-',
123
- width: 'zd-width-',
124
- 'max-width': 'zd-width-',
125
- 'min-width': 'zd-width-',
126
- top: 'zd-position-',
127
- bottom: 'zd-position-',
128
- left: 'zd-position-',
129
- right: 'zd-position-',
130
- 'padding-top': 'zd-padding-',
131
- 'padding-bottom': 'zd-padding-',
132
- 'padding-left': 'zd-padding-',
133
- 'padding-right': 'zd-padding-',
134
- 'margin-top': 'zd-margin-',
135
- 'margin-bottom': 'zd-margin-',
136
- 'margin-left': 'zd-margin-',
137
- 'margin-right': 'zd-margin-'
138
- };
139
-
140
- function allowParent(rule) {
141
- return rule.parent.type === 'root' || rule.parent.type === 'atrule' && rule.parent.name === 'media';
142
- }
143
-
144
- module.exports = function (source) {
145
- const {
146
- rootContext,
147
- resourcePath,
148
- query
149
- } = this;
150
-
151
- let root = _postcss.default.parse(source);
152
-
153
- root.walkRules(rule => {
154
- rule.walkDecls(decl => {
155
- if (!allowParent(rule)) {
156
- return;
157
- }
158
-
159
- if (supportedProps.includes(decl.prop) && /px$/gi.test(decl.value) && !/^--/gi.test(decl.prop) && commonFilePath[decl.prop] && !decl.value.includes('calc') && !/[,\s+]+|(\w+)\.|:|(\d+)%/gi.test(rule.selector)) {
160
- let composeString = `from "${_path.default.relative(_path.default.parse(resourcePath).dir, // resourcePath
161
- commonFilePath[decl.prop]).replace(/\\/gi, '/')}"`; // n++ < 10 && console.log(composeString);
162
-
163
- if (!composeString.includes('src')) {
164
- const cls = objToClassName(decl.prop, parseInt(decl.value));
165
- composeString = `${cls} ${composeString}`;
166
- decl.value = composeString;
167
- decl.prop = 'composes'; // n < 10 && console.log(rule.selector, decl.prop, decl.value);
168
- }
169
- }
170
- });
171
- });
172
- const output = root.toString(); // console.log(output);
173
-
174
- return output;
175
- };
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.hasPrevNodeIgnore = hasPrevNodeIgnore;
7
- exports.isAtRule = isAtRule;
8
- exports.isInsideMediaQuery = isInsideMediaQuery;
9
-
10
- function hasPrevNodeIgnore(index, prevNode, ignoreComment) {
11
- return index !== 0 && prevNode && prevNode.type && prevNode.type === 'comment' && prevNode.text.toLowerCase() === ignoreComment;
12
- }
13
-
14
- function isAtRule(rule) {
15
- return rule.parent && rule.parent.type === 'atrule';
16
- }
17
-
18
- function isInsideMediaQuery(rule) {
19
- return isAtRule(rule) && rule.parent && rule.parent.name === 'media' ? true : false;
20
- }
@@ -1,92 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isFileNameMatchingPattern = isFileNameMatchingPattern;
7
- exports.isFileNameMatchingPluginPattern = isFileNameMatchingPluginPattern;
8
-
9
- var _windowsModification = require("../../loaderUtils/windowsModification");
10
-
11
- var _ignore = _interopRequireDefault(require("ignore"));
12
-
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
-
15
- let aliasNames = {
16
- valueReplacer: 'postcss-value-replacer',
17
- selectorReplace: 'postcss-selector-replace-new',
18
- hasRTL: 'postcss-rtl',
19
- combinerMediaQuery: 'postcss-combine-media-query',
20
- hoverActive: 'postcss-mobile-hover',
21
- cssVariableReplacement: 'postcss-variable-report',
22
- composeMinification: 'postcss-compose-plugin'
23
- };
24
- /*
25
-
26
- unique scenario
27
-
28
- */
29
- // export function filterFileCssUniqueness(filename, filterObj) {
30
- // let rootDir = 'supportapp';
31
- // let include = false;
32
- // const regex = `^(.+?)${rootDir}?\\\\`;
33
- // const newFilename = windowsModificationFile(filename).replace(
34
- // new RegExp(regex, 'gi'),
35
- // ''
36
- // );
37
- // Object.keys(filterObj).forEach(key => {
38
- // const ig = ignore().add(filterObj[key]);
39
- // if (ig.ignores(newFilename)) {
40
- // include = true;
41
- // }
42
- // });
43
- // return include;
44
- // }
45
-
46
- function isFileNameMatchingPattern({
47
- filename,
48
- filterObject,
49
- plugins,
50
- rootDir
51
- }) {
52
- const finalPlugins = []; // console.log(rootDir);
53
-
54
- const regex = `^(.+?)${rootDir}?\\\\`;
55
- const newFilename = (0, _windowsModification.windowsModificationFile)(filename).replace(new RegExp(regex, 'gi'), '');
56
- Object.keys(filterObject).forEach(key => {
57
- plugins.forEach(x => {
58
- // console.log(key, x.postcssPlugin);
59
- if (aliasNames[key] === x.postcssPlugin) {
60
- const ig = (0, _ignore.default)().add(filterObject[key]);
61
-
62
- if (ig.ignores(newFilename)) {
63
- // console.log(newFilename);
64
- finalPlugins.push(x);
65
- }
66
- }
67
- });
68
- }); // console.log(filename);
69
- // console.log(finalPlugins);
70
- // console.log('----------------------------------------------------------------------')
71
-
72
- return finalPlugins; // console.log(filename, filterObject);
73
- }
74
-
75
- function isFileNameMatchingPluginPattern({
76
- filename,
77
- filterArr,
78
- rootDir
79
- }) {
80
- let include = true; // console.log(rootDir);
81
-
82
- const regex = `^(.+?)${rootDir}?\\\\`; // console.log(plugin);
83
-
84
- const newFilename = (0, _windowsModification.windowsModificationFile)(filename).replace(new RegExp(regex, 'gi'), '');
85
- const ig = (0, _ignore.default)().add(filterArr);
86
-
87
- if (!ig.ignores(newFilename)) {
88
- include = false;
89
- }
90
-
91
- return include;
92
- }
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- const ignore = require('ignore');
4
-
5
- const ignoreArr1 = ['src', '!src\\components', 'src\\Accessibility'];
6
- const ignoreArr2 = ['src\\', '!node_modules\\'];
7
- const ignoreArr3 = ['*'];
8
-
9
- const {
10
- windowsModificationFile
11
- } = require('../../../../lib/loaderUtils/windowsModification');
12
-
13
- const files = ['D:\\MyWork\\React Build\\desk_client_app\\jsapps\\supportapp\\src\\components\\Accessibility\\Accessibility.module.css', 'D:\\MyWork\\React Build\\desk_client_app\\jsapps\\supportapp\\src\\components\\Avatar\\Avatar.module.css', 'D:/MyWork/React Build/desk_client_app/jsapps/supportapp/src/components/Accessibility/Accessibility.module.css', 'D:/MyWork/React Build/desk_client_app/jsapps/supportapp/src/components/Accessibility/AccessibilityNavigation.module.css', 'desk_client_app\\jsapps\\supportapp\\src\\components\\Test.module.css', 'desk_client_app\\jsapps\\supportapp\\src\\components\\Accessibility\\Accessibility.module.css', 'desk_client_app/jsapps/supportapp/src/components/Accessibility/Accessibility.module.css', 'src\\components\\Accessibility\\Accessibility.module.css', 'src/components/Accessibility/Accessibility.module.css', 'Accessibility.module.css', ''];
14
- const ignore1 = ignore().add(ignoreArr1);
15
- const ignore2 = ignore().add(ignoreArr2);
16
- const ignore3 = ignore().add(ignoreArr3);
17
- files.forEach(file => {
18
- // console.log(file);
19
- const rootDir = 'supportapp';
20
- const regex = `^(.+?)${rootDir}?\\\\`;
21
- const newFilename = windowsModificationFile(file).replace(new RegExp(regex, 'gi'), '');
22
- console.log(newFilename);
23
-
24
- if (newFilename.trim() !== '') {
25
- console.log(ignore1.ignores(newFilename));
26
- console.log(ignore2.ignores(newFilename));
27
- console.log(ignore3.ignores(newFilename));
28
- console.log('--------------------------------------------------------------------');
29
- }
30
- });
@@ -1,8 +0,0 @@
1
- "use strict";
2
-
3
- var _postcss = _interopRequireDefault(require("postcss"));
4
-
5
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6
-
7
- module.exports = _postcss.default.plugin('postcss-empty', () => (root, result) => {// console.log(root.source.input.from, result);
8
- });