@zohodesk/react-cli 0.0.1-exp.175.1 → 0.0.1-exp.176.11
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +35 -40
- package/docs/SelectorWeight.md +6 -0
- package/docs/VariableConversion.md +33 -1
- package/lib/babel/cmjs-plugins-presets.js +4 -0
- package/lib/babel/es-plugins-presets.js +4 -0
- package/lib/common/getEntries.js +10 -0
- package/lib/common/getPublicPathConfig.js +6 -0
- package/lib/common/index.js +5 -0
- package/lib/common/splitChunks.js +13 -2
- package/lib/common/sslcertUpdater.js +17 -6
- package/lib/common/templateParameters.js +2 -0
- package/lib/common/testPattern.js +21 -10
- package/lib/common/valueReplacer.js +15 -0
- package/lib/configs/jest.config.js +9 -0
- package/lib/configs/libAlias.js +2 -4
- package/lib/configs/webpack.component.umd.config.js +5 -0
- package/lib/configs/webpack.css.umd.config.js +13 -5
- package/lib/configs/webpack.dev.config.js +36 -2
- package/lib/configs/webpack.docs.config.js +21 -1
- package/lib/configs/webpack.impact.config.js +19 -1
- package/lib/configs/webpack.prod.config.js +37 -3
- package/lib/hooks/docsProptypeHook.js +7 -3
- package/lib/jest/commitedFilesResult.js +45 -3
- package/lib/jest/coverageCollector.js +11 -0
- package/lib/jest/jsonMaker.js +6 -0
- package/lib/jest/preProcessors/cssPreprocessor.js +8 -0
- package/lib/jest/preProcessors/jsPreprocessor.js +2 -0
- package/lib/jest/preProcessors/otherFilesPreprocessor.js +3 -0
- package/lib/jest/result.js +22 -0
- package/lib/jest/run.js +17 -6
- package/lib/jest/setup.js +57 -5
- package/lib/loaderUtils/configsAssetsLoaders.js +11 -1
- package/lib/loaderUtils/getCSSLoaders.js +35 -20
- package/lib/loaderUtils/getDevJsLoaders.js +8 -0
- package/lib/loaderUtils/index.js +3 -0
- package/lib/loaderUtils/windowsModification.js +11 -0
- package/lib/loaders/docsLoader.js +7 -0
- package/lib/loaders/docsPropsLoader.js +7 -3
- package/lib/loaders/fileBountryLoader.js +2 -0
- package/lib/loaders/fileLoader.js +22 -11
- package/lib/loaders/scriptInstrumentLoader.js +13 -5
- package/lib/loaders/selectorMappingLoader.js +25 -7
- package/lib/loaders/workerLoader.js +20 -4
- package/lib/middlewares/HMRMiddleware.js +26 -13
- package/lib/middlewares/SSTMiddleware.js +3 -0
- package/lib/pluginUtils/configHtmlWebpackPlugins.js +9 -3
- package/lib/pluginUtils/getDevPlugins.js +63 -17
- package/lib/pluginUtils/getDocsPlugins.js +10 -1
- package/lib/pluginUtils/getLibraryImactPlugins.js +5 -4
- package/lib/pluginUtils/getLibraryPlugins.js +5 -0
- package/lib/pluginUtils/getProdPlugins.js +72 -23
- package/lib/pluginUtils/getServerPlugins.js +5 -0
- package/lib/pluginUtils/getUMDCSSPlugins.js +7 -0
- package/lib/pluginUtils/getUMDComponentPlugins.js +7 -0
- package/lib/pluginUtils/index.js +8 -0
- package/lib/plugins/CdnChangePlugin.js +14 -0
- package/lib/plugins/CleanupStatsPlugin.js +5 -0
- package/lib/plugins/EFCPlugin.js +34 -23
- package/lib/plugins/EFCTemplatePlugin.js +32 -23
- package/lib/plugins/I18NInjectIntoIndexPlugin.js +34 -8
- package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +17 -12
- package/lib/plugins/I18nSplitPlugin/I18nDependency.js +10 -4
- package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +39 -8
- package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +29 -14
- package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +22 -13
- package/lib/plugins/I18nSplitPlugin/index.js +23 -13
- package/lib/plugins/I18nSplitPlugin/utils/collectI18nKeys.js +12 -2
- package/lib/plugins/I18nSplitPlugin/utils/getI18nFileUrlPathTemplate.js +1 -0
- package/lib/plugins/I18nSplitPlugin/utils/getI18nKeysFormModules.js +5 -0
- package/lib/plugins/I18nSplitPlugin/utils/hashUtils.js +6 -0
- package/lib/plugins/I18nSplitPlugin/utils/index.js +4 -0
- package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +20 -2
- package/lib/plugins/ManifestPlugin.js +17 -0
- package/lib/plugins/ModuleStatsPlugin.js +23 -0
- package/lib/plugins/OptimizeJSPlugin.js +7 -0
- package/lib/plugins/PublicPathCallbackPlugin.js +10 -0
- package/lib/plugins/PublicPathChangePlugin.js +36 -4
- package/lib/plugins/ReportGeneratePlugin.js +30 -4
- package/lib/plugins/RequireVariablePublicPlugin.js +6 -0
- package/lib/plugins/ResourceHintsPlugin.js +10 -3
- package/lib/plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +17 -12
- package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +16 -9
- package/lib/plugins/RtlSplitPlugin/replaceCssDirTemplate.js +5 -2
- package/lib/plugins/ScriptInstrumentPlugin.js +7 -0
- package/lib/plugins/SelectorPlugin.js +97 -0
- package/lib/plugins/ServiceWorkerPlugin.js +20 -4
- package/lib/plugins/ShadowDOMSupportPlugin.js +40 -3
- package/lib/plugins/SourceMapHookPlugin.js +9 -0
- package/lib/plugins/TPHashMappingPlugin.js +15 -1
- package/lib/plugins/UglifyCSSPlugin.js +9 -0
- package/lib/plugins/UnusedFilesFindPlugin.js +35 -2
- package/lib/plugins/VariableConversionCollector.js +252 -0
- package/lib/plugins/composeCommonPlugin.js +30 -0
- package/lib/plugins/index.js +19 -0
- package/lib/plugins/libraryImpactPlugin.js +32 -0
- package/lib/plugins/webpackwatchrunplugin.js +5 -0
- package/lib/postcss-plugins/ExcludePlugin.js +4 -0
- package/lib/postcss-plugins/RTLSplitPlugin.js +27 -14
- package/lib/postcss-plugins/ValueReplacer.js +6 -9
- package/lib/postcss-plugins/__test__/hoverActivePlugin.spec.js +3 -0
- package/lib/postcss-plugins/hoverActivePlugin.js +66 -30
- package/lib/postcss-plugins/variableModificationPlugin/ErrorHandler.js +40 -13
- package/lib/postcss-plugins/variableModificationPlugin/index.js +215 -141
- package/lib/postcss-plugins/variableModifier.js +20 -13
- package/lib/schemas/index.js +23 -4
- package/lib/servers/clusterHubServer.js +10 -0
- package/lib/servers/devBuild.js +24 -13
- package/lib/servers/docsServer.js +2 -0
- package/lib/servers/docsServerCore.js +21 -0
- package/lib/servers/getCliPath.js +9 -0
- package/lib/servers/helpServer.js +5 -0
- package/lib/servers/httpsOptions.js +4 -0
- package/lib/servers/impactServer.js +34 -2
- package/lib/servers/mockserver.js +9 -0
- package/lib/servers/nowatchserver.js +34 -12
- package/lib/servers/scrServer.js +20 -13
- package/lib/servers/server.js +35 -7
- package/lib/servers/ssServer.js +16 -0
- package/lib/templates/CoverageScriptTemplate.js +14 -0
- package/lib/templates/WMSTemplate.js +12 -6
- package/lib/utils/babelPresets.js +2 -0
- package/lib/utils/clean.js +8 -2
- package/lib/utils/copy.js +6 -0
- package/lib/utils/copyTimezones.js +8 -0
- package/lib/utils/createEventStream.js +4 -0
- package/lib/utils/cssClassNameGenerate.js +19 -3
- package/lib/utils/cssURLReplacer.js +50 -38
- package/lib/utils/dependencyPostPublish.js +9 -0
- package/lib/utils/fileUtils.js +26 -0
- package/lib/utils/folderIterator.js +10 -0
- package/lib/utils/getComponents.js +21 -0
- package/lib/utils/getCurrentBranch.js +5 -0
- package/lib/utils/getDependenciesImpactList.js +21 -0
- package/lib/utils/getFileType.js +49 -0
- package/lib/utils/getHash.js +7 -0
- package/lib/utils/getIp.js +2 -0
- package/lib/utils/getOptions.js +39 -14
- package/lib/utils/getServerURL.js +7 -0
- package/lib/utils/index.js +47 -2
- package/lib/utils/init.js +1 -0
- package/lib/utils/initPreCommitHook.js +29 -6
- package/lib/utils/jsonHelper.js +19 -2
- package/lib/utils/libraryImpactConfig.js +2 -0
- package/lib/utils/lint/addScripts.js +5 -2
- package/lib/utils/lint/checkExistingConfig.js +12 -3
- package/lib/utils/lint/copyConfigs.js +3 -0
- package/lib/utils/lint/index.js +9 -0
- package/lib/utils/lint/lintScripts.js +1 -0
- package/lib/utils/lint/lintSetup.js +4 -3
- package/lib/utils/lint/lintStagedPreCommitHook.js +1 -0
- package/lib/utils/lint/question.js +7 -0
- package/lib/utils/lintReporter.js +20 -0
- package/lib/utils/mailSender.js +7 -0
- package/lib/utils/pullOrigin.js +4 -0
- package/lib/utils/reinstallDependencies.js +28 -0
- package/lib/utils/removeAttributes.js +7 -0
- package/lib/utils/repoClone.js +27 -2
- package/lib/utils/request.js +12 -0
- package/lib/utils/rtl.js +16 -4
- package/lib/utils/setEnvVariables.js +2 -0
- package/lib/utils/ssTestHack.js +10 -0
- package/lib/utils/switchBranch.js +4 -0
- package/lib/utils/urlConcat.js +4 -0
- package/lib/utils/useExitCleanup.js +10 -9
- package/package.json +10 -9
package/lib/utils/ssTestHack.js
CHANGED
@@ -4,14 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
+
|
7
8
|
var _fs = _interopRequireDefault(require("fs"));
|
9
|
+
|
8
10
|
var _path = _interopRequireDefault(require("path"));
|
11
|
+
|
9
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
10
14
|
function iterateDir(srcPath, callback) {
|
11
15
|
function iterate(srcPath) {
|
12
16
|
if (_fs.default.existsSync(srcPath)) {
|
13
17
|
_fs.default.readdirSync(srcPath).forEach(fileOrDir => {
|
14
18
|
let fromPath = _path.default.join(srcPath, fileOrDir);
|
19
|
+
|
15
20
|
if (_fs.default.statSync(fromPath).isDirectory()) {
|
16
21
|
iterate(fromPath);
|
17
22
|
} else {
|
@@ -20,19 +25,24 @@ function iterateDir(srcPath, callback) {
|
|
20
25
|
});
|
21
26
|
}
|
22
27
|
}
|
28
|
+
|
23
29
|
iterate(srcPath);
|
24
30
|
}
|
31
|
+
|
25
32
|
var _default = () => {
|
26
33
|
let dependencyFolders = [_path.default.join(process.cwd(), 'node_modules', '@zohodesk', 'components', 'lib'), _path.default.join(process.cwd(), 'node_modules', '@zohodesk', 'dot', 'lib'), _path.default.join(process.cwd(), 'node_modules', '@zohodesk', 'icons', 'lib'), _path.default.join(process.cwd(), 'node_modules', '@zohodesk', 'svg', 'lib'), _path.default.join(process.cwd(), 'node_modules', '@zohodesk', 'variables', 'lib')];
|
27
34
|
let pattern = /if.*\(false\)/g;
|
28
35
|
dependencyFolders.forEach(componentsFolder => {
|
29
36
|
iterateDir(componentsFolder, filepath => {
|
30
37
|
let src = _fs.default.readFileSync(filepath).toString();
|
38
|
+
|
31
39
|
if (pattern.test(src)) {
|
32
40
|
src = src.replace(pattern, 'if (true)');
|
41
|
+
|
33
42
|
_fs.default.writeFileSync(filepath, src);
|
34
43
|
}
|
35
44
|
});
|
36
45
|
});
|
37
46
|
};
|
47
|
+
|
38
48
|
exports.default = _default;
|
@@ -4,8 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
+
|
7
8
|
var _child_process = require("child_process");
|
9
|
+
|
8
10
|
var _utils = require("../utils");
|
11
|
+
|
9
12
|
var _default = (type = 'git', branchName) => new Promise(resolve => {
|
10
13
|
if (type === 'git') {
|
11
14
|
(0, _utils.log)((0, _utils.getCurrentBranch)(type, process.cwd()), 'Before the branch switch');
|
@@ -21,4 +24,5 @@ var _default = (type = 'git', branchName) => new Promise(resolve => {
|
|
21
24
|
(0, _utils.pullOrigin)(type, branchName).then(resolve);
|
22
25
|
}
|
23
26
|
});
|
27
|
+
|
24
28
|
exports.default = _default;
|
package/lib/utils/urlConcat.js
CHANGED
@@ -4,15 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.urlConcat = urlConcat;
|
7
|
+
|
7
8
|
function urlConcat(p1 = '', p2 = '') {
|
8
9
|
if (p1[p1.length - 1] === '/') {
|
9
10
|
if (p2[0] === '/') {
|
10
11
|
return p1 + p2.slice(1);
|
11
12
|
}
|
13
|
+
|
12
14
|
return p1 + p2;
|
13
15
|
}
|
16
|
+
|
14
17
|
if (p2[0] === '/') {
|
15
18
|
return p1 + p2;
|
16
19
|
}
|
20
|
+
|
17
21
|
return `${p1}/${p2}`;
|
18
22
|
}
|
@@ -5,50 +5,51 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.useExitCleanup = useExitCleanup;
|
7
7
|
//so the program will not close instantly
|
8
|
-
|
9
8
|
let listeners = [];
|
10
9
|
let hasCalled = false;
|
10
|
+
|
11
11
|
function useExitCleanup(listener) {
|
12
12
|
if (!hasCalled) {
|
13
13
|
process.stdin.resume();
|
14
14
|
hasCalled = true;
|
15
15
|
}
|
16
|
+
|
16
17
|
listeners.push(listeners);
|
17
18
|
return () => {
|
18
19
|
listeners = listeners.filter(l => l !== listener);
|
19
20
|
};
|
20
21
|
}
|
22
|
+
|
21
23
|
function exitHandler(options, exitCode) {
|
22
24
|
if (options.cleanup) {
|
23
25
|
console.log('clean');
|
24
26
|
}
|
27
|
+
|
25
28
|
if (exitCode || exitCode === 0) {
|
26
29
|
console.log(exitCode);
|
27
30
|
}
|
31
|
+
|
28
32
|
if (options.exit) {
|
29
33
|
process.exit();
|
30
34
|
}
|
31
|
-
}
|
35
|
+
} //do something when app is closing
|
36
|
+
|
32
37
|
|
33
|
-
//do something when app is closing
|
34
38
|
process.on('exit', exitHandler.bind(null, {
|
35
39
|
cleanup: true
|
36
|
-
}));
|
40
|
+
})); //catches ctrl+c event
|
37
41
|
|
38
|
-
//catches ctrl+c event
|
39
42
|
process.on('SIGINT', exitHandler.bind(null, {
|
40
43
|
exit: true
|
41
|
-
}));
|
44
|
+
})); // catches "kill pid" (for example: nodemon restart)
|
42
45
|
|
43
|
-
// catches "kill pid" (for example: nodemon restart)
|
44
46
|
process.on('SIGUSR1', exitHandler.bind(null, {
|
45
47
|
exit: true
|
46
48
|
}));
|
47
49
|
process.on('SIGUSR2', exitHandler.bind(null, {
|
48
50
|
exit: true
|
49
|
-
}));
|
51
|
+
})); //catches uncaught exceptions
|
50
52
|
|
51
|
-
//catches uncaught exceptions
|
52
53
|
process.on('uncaughtException', exitHandler.bind(null, {
|
53
54
|
exit: true
|
54
55
|
}));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@zohodesk/react-cli",
|
3
|
-
"version": "0.0.1-exp.
|
3
|
+
"version": "0.0.1-exp.176.11",
|
4
4
|
"description": "A CLI tool for build modern web application and libraries",
|
5
5
|
"scripts": {
|
6
6
|
"init": "node ./lib/utils/init.js",
|
@@ -9,6 +9,7 @@
|
|
9
9
|
"start": "babel src -d lib -w --copy-files",
|
10
10
|
"build": "babel src -d lib --copy-files",
|
11
11
|
"prepare": "npm run clean && npm run build",
|
12
|
+
"prepublish": "npm prune now",
|
12
13
|
"lint": "eslint src ./bin/cli.js",
|
13
14
|
"postpublish": "node postpublish.js",
|
14
15
|
"expublish": "npm publish --tag experimental-version"
|
@@ -28,14 +29,14 @@
|
|
28
29
|
},
|
29
30
|
"homepage": "https://git.csez.zohocorpin.com/zohodesk/react-cli/blob/2.0.0/README.md",
|
30
31
|
"dependencies": {
|
31
|
-
"@babel/cli": "7.
|
32
|
-
"@babel/core": "7.
|
33
|
-
"@babel/plugin-proposal-object-rest-spread": "7.
|
32
|
+
"@babel/cli": "7.10.5",
|
33
|
+
"@babel/core": "7.11.1",
|
34
|
+
"@babel/plugin-proposal-object-rest-spread": "7.11.0",
|
34
35
|
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
35
|
-
"@babel/plugin-transform-runtime": "7.
|
36
|
-
"@babel/preset-env": "7.
|
37
|
-
"@babel/preset-react": "7.
|
38
|
-
"@babel/runtime": "7.
|
36
|
+
"@babel/plugin-transform-runtime": "7.11.0",
|
37
|
+
"@babel/preset-env": "7.11.0",
|
38
|
+
"@babel/preset-react": "7.10.4",
|
39
|
+
"@babel/runtime": "7.11.2",
|
39
40
|
"@zohodesk/datetimejs": "1.0.0-beta.8",
|
40
41
|
"@zohodesk/eslint-plugin-react-performance": "1.0.3",
|
41
42
|
"@zohodesk/eslint-plugin-zsecurity": "0.0.1-beta.4",
|
@@ -45,7 +46,7 @@
|
|
45
46
|
"@zohodesk/screenshot-test": "0.0.1-beta.20",
|
46
47
|
"babel-eslint": "10.1.0",
|
47
48
|
"babel-jest": "26.3.0",
|
48
|
-
"babel-loader": "
|
49
|
+
"babel-loader": "8.1.0",
|
49
50
|
"babel-plugin-lodash": "3.3.4",
|
50
51
|
"babel-plugin-transform-define": "2.0.0",
|
51
52
|
"babel-plugin-transform-dynamic-import": "2.1.0",
|