@zohodesk/react-cli 0.0.1-beta.17 → 0.0.1-beta.171
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 +1 -0
- package/.eslintrc.js +49 -10
- package/.prettierrc +6 -0
- package/CHANGELOG.md +5 -0
- package/README.md +859 -0
- package/bin/cli.js +215 -46
- package/cert/Tsicsezwild-22-23.crt +37 -0
- package/cert/Tsicsezwild-22-23.key +27 -0
- package/docs/CustomChunks.md +26 -0
- package/docs/DevStart.md +18 -0
- package/docs/HoverActive.md +12 -0
- package/docs/InstallNode.md +28 -0
- package/docs/TODOS.md +10 -0
- package/docs/ValueReplacer.md +60 -0
- package/docs/warnings_while_install.txt +35 -0
- package/files/eslintrc.js +62 -0
- package/files/prettierrc.js +3 -0
- package/lib/babel/cmjs-plugins-presets.js +24 -0
- package/lib/babel/es-plugins-presets.js +34 -0
- package/lib/common/getEntries.js +33 -46
- package/lib/common/getPublicPathConfig.js +40 -0
- package/lib/common/index.js +24 -19
- package/lib/common/splitChunks.js +110 -25
- package/lib/common/sslcertUpdater.js +59 -0
- package/lib/common/templateParameters.js +25 -0
- package/lib/common/testPattern.js +69 -0
- package/lib/common/valueReplacer.js +55 -0
- package/lib/configs/jest.config.js +31 -27
- package/lib/configs/libAlias.js +31 -0
- package/lib/configs/webpack.component.umd.config.js +46 -53
- package/lib/configs/webpack.css.umd.config.js +47 -46
- package/lib/configs/webpack.dev.config.js +99 -84
- package/lib/configs/webpack.docs.config.js +65 -57
- package/lib/configs/webpack.impact.config.js +109 -0
- package/lib/configs/webpack.prod.config.js +147 -104
- package/lib/hooks/docsProptypeHook.js +32 -38
- package/lib/jest/commitedFilesResult.js +144 -71
- package/lib/jest/coverageCollector.js +68 -35
- package/lib/jest/jsonMaker.js +54 -0
- package/lib/jest/preProcessors/cssPreprocessor.js +16 -18
- package/lib/jest/preProcessors/jsPreprocessor.js +5 -6
- package/lib/jest/preProcessors/otherFilesPreprocessor.js +5 -6
- package/lib/jest/result.js +92 -42
- package/lib/jest/run.js +75 -28
- package/lib/jest/setup.js +103 -102
- package/lib/loaderUtils/configsAssetsLoaders.js +117 -0
- package/lib/loaderUtils/getCSSLoaders.js +113 -0
- package/lib/loaderUtils/getDevJsLoaders.js +35 -23
- package/lib/loaderUtils/index.js +14 -7
- package/lib/loaders/docsLoader.js +15 -15
- package/lib/loaders/docsPropsLoader.js +14 -17
- package/lib/loaders/fileBountryLoader.js +17 -0
- package/lib/loaders/fileLoader.js +47 -38
- package/lib/loaders/scriptInstrumentLoader.js +23 -20
- package/lib/loaders/selectorMappingLoader.js +75 -0
- package/lib/loaders/workerLoader.js +136 -0
- package/lib/middlewares/HMRMiddleware.js +90 -72
- package/lib/middlewares/SSTMiddleware.js +21 -0
- package/lib/pluginUtils/getDevPlugins.js +177 -30
- package/lib/pluginUtils/getDocsPlugins.js +36 -15
- package/lib/pluginUtils/getLibraryImactPlugins.js +23 -0
- package/lib/pluginUtils/getLibraryPlugins.js +8 -10
- package/lib/pluginUtils/getProdPlugins.js +244 -37
- package/lib/pluginUtils/getServerPlugins.js +8 -11
- package/lib/pluginUtils/getUMDCSSPlugins.js +14 -18
- package/lib/pluginUtils/getUMDComponentPlugins.js +14 -9
- package/lib/pluginUtils/index.js +36 -43
- package/lib/plugins/CdnChangePlugin.js +77 -0
- package/lib/plugins/CleanupStatsPlugin.js +28 -0
- package/lib/plugins/EFCPlugin.js +241 -0
- package/lib/plugins/EFCPlugin.md +6 -0
- package/lib/plugins/EFCTemplatePlugin.js +151 -0
- package/lib/plugins/I18NInjectIntoIndexPlugin.js +141 -0
- package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +60 -0
- package/lib/plugins/I18nSplitPlugin/I18nDependency.js +44 -0
- package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +266 -0
- package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +183 -0
- package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +100 -0
- package/lib/plugins/I18nSplitPlugin/I18nSplit.md +95 -0
- package/lib/plugins/I18nSplitPlugin/README.md +25 -0
- package/lib/plugins/I18nSplitPlugin/index.js +185 -0
- package/lib/plugins/I18nSplitPlugin/utils/collectI18nKeys.js +64 -0
- package/lib/plugins/I18nSplitPlugin/utils/getI18nFileUrlPathTemplate.js +13 -0
- package/lib/plugins/I18nSplitPlugin/utils/getI18nKeysFormModules.js +26 -0
- package/lib/plugins/I18nSplitPlugin/utils/hashUtils.js +40 -0
- package/lib/plugins/I18nSplitPlugin/utils/index.js +31 -0
- package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +112 -0
- package/lib/plugins/ManifestPlugin.js +86 -0
- package/lib/plugins/ModuleStatsPlugin.js +98 -97
- package/lib/plugins/OptimizeJSPlugin.js +41 -0
- package/lib/plugins/PublicPathCallbackPlugin.js +63 -0
- package/lib/plugins/PublicPathChangePlugin.js +226 -0
- package/lib/plugins/ReportGeneratePlugin.js +181 -0
- package/lib/plugins/RequireVariablePublicPlugin.js +30 -0
- package/lib/plugins/ResourceHintsPlugin.js +67 -0
- package/lib/plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +80 -0
- package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +82 -0
- package/lib/plugins/RtlSplitPlugin/RtrSplit.md +30 -0
- package/lib/plugins/RtlSplitPlugin/replaceCssDirTemplate.js +26 -0
- package/lib/plugins/ScriptInstrumentPlugin.js +22 -37
- package/lib/plugins/ServiceWorkerPlugin.js +107 -0
- package/lib/plugins/ShadowDOMSupportPlugin.js +270 -0
- package/lib/plugins/SourceMapHookPlugin.js +25 -59
- package/lib/plugins/TPHashMappingPlugin.js +67 -0
- package/lib/plugins/UglifyCSSPlugin.js +39 -0
- package/lib/plugins/UnusedFilesFindPlugin.js +150 -97
- package/lib/plugins/index.js +127 -37
- package/lib/plugins/libraryImpactPlugin.js +190 -0
- package/lib/plugins/webpackwatchrunplugin.js +26 -0
- package/lib/postcss-plugins/ExcludePlugin.js +23 -0
- package/lib/postcss-plugins/RTLSplitPlugin.js +138 -0
- package/lib/postcss-plugins/ValueReplacer.js +46 -0
- package/lib/postcss-plugins/__test__/hoverActivePlugin.spec.js +22 -0
- package/lib/postcss-plugins/__test__/test1Input.css +39 -0
- package/lib/postcss-plugins/__test__/test1Output.css +39 -0
- package/lib/postcss-plugins/hoverActivePlugin.js +368 -0
- package/lib/postcss-plugins/variableModifier.js +243 -0
- package/lib/schemas/index.js +541 -65
- package/lib/servers/clusterHubServer.js +22 -26
- package/lib/servers/devBuild.js +102 -0
- package/lib/servers/docsServer.js +3 -5
- package/lib/servers/docsServerCore.js +94 -79
- package/lib/servers/getCliPath.js +28 -0
- package/lib/servers/helpServer.js +19 -21
- package/lib/servers/httpsOptions.js +18 -0
- package/lib/servers/impactServer.js +123 -115
- package/lib/servers/mockserver.js +44 -0
- package/lib/servers/nowatchserver.js +200 -0
- package/lib/servers/scrServer.js +147 -0
- package/lib/servers/server.js +134 -132
- package/lib/servers/ssServer.js +106 -70
- package/lib/sh/reportPublish.sh +16 -10
- package/lib/templates/CoverageScriptTemplate.js +45 -18
- package/lib/templates/WMSTemplate.js +17 -18
- package/lib/templates/linterConstant.js +10 -0
- package/lib/utils/babelPresets.js +12 -4
- package/lib/utils/buildstats.html +148 -0
- package/lib/utils/clean.js +12 -11
- package/lib/utils/copy.js +16 -109
- package/lib/utils/copyTimezones.js +21 -0
- package/lib/utils/createEventStream.js +24 -19
- package/lib/utils/cssClassNameGenerate.js +77 -0
- package/lib/utils/cssURLReplacer.js +136 -0
- package/lib/utils/dependencyPostPublish.js +42 -0
- package/lib/utils/fileUtils.js +125 -0
- package/lib/utils/folderIterator.js +47 -0
- package/lib/utils/getComponents.js +126 -0
- package/lib/utils/getCurrentBranch.js +11 -17
- package/lib/utils/getDependenciesImpactList.js +151 -0
- package/lib/utils/getHash.js +26 -0
- package/lib/utils/getIp.js +20 -0
- package/lib/utils/getOptions.js +113 -28
- package/lib/utils/getServerURL.js +25 -8
- package/lib/utils/index.js +283 -68
- package/lib/utils/init.js +2 -2
- package/lib/utils/initPreCommitHook.js +47 -27
- package/lib/utils/jsonHelper.js +106 -0
- package/lib/utils/libraryImpactConfig.js +63 -0
- package/lib/utils/lint/addScripts.js +27 -0
- package/lib/utils/lint/checkExistingConfig.js +67 -0
- package/lib/utils/lint/copyConfigs.js +24 -0
- package/lib/utils/lint/index.js +54 -0
- package/lib/utils/lint/lintScripts.js +11 -0
- package/lib/utils/lint/lintSetup.js +31 -0
- package/lib/utils/lint/lintStagedPreCommitHook.js +7 -0
- package/lib/utils/lint/question.js +30 -0
- package/lib/utils/lintReporter.js +142 -0
- package/lib/utils/mailSender.js +16 -25
- package/lib/utils/pullOrigin.js +28 -0
- package/lib/utils/reinstallDependencies.js +133 -0
- package/lib/utils/removeAttributes.js +25 -23
- package/lib/utils/repoClone.js +59 -63
- package/lib/utils/request.js +64 -77
- package/lib/utils/resultSchema.json +73 -0
- package/lib/utils/rtl.js +59 -0
- package/lib/utils/setEnvVariables.js +13 -0
- package/lib/utils/ssTestHack.js +48 -0
- package/lib/utils/switchBranch.js +28 -0
- package/lib/utils/urlConcat.js +22 -0
- package/lib/utils/useExitCleanup.js +55 -0
- package/npm8.md +9 -0
- package/package.json +96 -64
- package/postpublish.js +6 -0
- package/templates/app/.eslintrc.js +140 -0
- package/templates/app/README.md +12 -12
- package/templates/app/app/index.html +24 -8
- 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 -13
- package/templates/app/package.json +37 -17
- package/templates/app/src/actions/SampleActions/index.js +37 -0
- package/templates/app/src/actions/index.js +65 -0
- package/templates/app/src/appUrls.js +19 -0
- package/templates/app/src/components/Alert/Alert.js +134 -0
- package/templates/app/src/components/Alert/Alert.module.css +79 -0
- package/templates/app/src/components/FreezeLayer/FreezeLayer.css +37 -0
- package/templates/app/src/components/FreezeLayer/FreezeLayer.js +84 -0
- package/templates/app/src/components/Sample/Sample.module.css +11 -0
- package/templates/app/src/components/Sample/SampleList.js +61 -0
- package/templates/app/src/components/Slider/Slider.css +41 -0
- package/templates/app/src/components/Slider/Slider.js +55 -0
- package/templates/app/src/containers/AlertContainer/index.js +15 -0
- package/templates/app/src/containers/AppContainer/index.js +96 -0
- package/templates/app/src/containers/AppContainer/index.module.css +27 -0
- package/templates/app/src/containers/CustomMatch/index.js +65 -0
- package/templates/app/src/containers/DevTools/index.js +10 -0
- package/templates/app/src/containers/Header/index.js +67 -0
- package/templates/app/src/containers/Header/index.module.css +43 -0
- package/templates/app/src/containers/Redirect/index.js +63 -0
- package/templates/app/src/containers/Redirector/index.js +47 -0
- package/templates/app/src/containers/SampleListContainer/ListContainer.js +42 -0
- package/templates/app/src/containers/SampleListContainer/ListContainer.module.css +3 -0
- package/templates/app/src/historyChange.js +5 -0
- package/templates/app/src/index.html +10 -0
- package/templates/app/src/index.js +24 -0
- package/templates/app/src/middleware/PromiseMiddleware.js +59 -0
- package/templates/app/src/reducers/alertData.js +11 -0
- package/templates/app/src/reducers/index.js +6 -0
- package/templates/app/src/reducers/samples.js +19 -0
- package/templates/app/src/store/configureStore.dev.js +51 -0
- package/templates/app/src/store/configureStore.js +5 -0
- package/templates/app/src/store/configureStore.prod.js +26 -0
- package/templates/app/src/util/Common.js +5 -0
- package/templates/app/src/util/RequestAPI.js +132 -0
- package/templates/appold/README.md +12 -0
- package/templates/appold/app/index.html +8 -0
- package/templates/appold/app/properties/ApplicationResources_en_US.properties +1 -0
- package/templates/appold/app/properties/i18nkeys.json +3 -0
- package/templates/appold/docs/all.html +69 -0
- package/templates/appold/mockapi/index.js +13 -0
- package/templates/{app → appold}/mockapi/tickets.json +0 -0
- package/templates/appold/package.json +17 -0
- package/templates/appold/src/components/Text/Text.css +0 -0
- package/templates/appold/src/components/Text/Text.js +23 -0
- package/templates/appold/src/components/Text/__tests__/Text.spec.js +30 -0
- package/templates/appold/src/components/Text/docs/Text__default.docs.js +16 -0
- package/templates/appold/src/components/docs.js +1 -0
- package/templates/appold/src/components/index.js +5 -0
- package/templates/appold/src/index.js +13 -0
- package/templates/docs/all.html +1 -1
- package/templates/docs/component.html +110 -69
- package/templates/docs/components.html +221 -0
- package/templates/docs/css/component.css +12 -14
- package/templates/docs/css/componentTest.css +7 -0
- package/templates/docs/css/style.css +150 -206
- package/templates/docs/impactReportTemplate.html +154 -0
- package/templates/docs/index.html +1482 -1336
- package/templates/library/src/index.js +0 -0
- package/.npmignore +0 -3
- package/cert/cert.pem +0 -129
- package/cert/key.pem +0 -27
- package/lib/common/getInsertAt.js +0 -36
- package/lib/common/getInsertIntoFunction.js +0 -13
- package/lib/configs/webpack.server.config.js +0 -93
- package/lib/plugins/ChunkManifestReplacePlugin.js +0 -94
- package/lib/plugins/RuntimePublicPathPlugin.js +0 -46
- package/lib/rmcntrlm.sh +0 -14
- package/lib/servers/nodeServer.js +0 -238
- package/lib/templates/HMRTemplate.js +0 -256
- package/lib/templates/publicPathTemplate.js +0 -16
- package/lib/utils/setConfig.js +0 -14
- package/node_modules/history/CHANGES.md +0 -395
- package/node_modules/history/DOMUtils.js +0 -3
- package/node_modules/history/ExecutionEnvironment.js +0 -3
- package/node_modules/history/LICENSE +0 -21
- package/node_modules/history/LocationUtils.js +0 -3
- package/node_modules/history/PathUtils.js +0 -3
- package/node_modules/history/README.md +0 -282
- package/node_modules/history/cjs/history.js +0 -933
- package/node_modules/history/cjs/history.min.js +0 -1
- package/node_modules/history/createBrowserHistory.js +0 -3
- package/node_modules/history/createHashHistory.js +0 -3
- package/node_modules/history/createMemoryHistory.js +0 -3
- package/node_modules/history/createTransitionManager.js +0 -3
- package/node_modules/history/es/DOMUtils.js +0 -7
- package/node_modules/history/es/ExecutionEnvironment.js +0 -7
- package/node_modules/history/es/LocationUtils.js +0 -7
- package/node_modules/history/es/PathUtils.js +0 -7
- package/node_modules/history/es/createBrowserHistory.js +0 -7
- package/node_modules/history/es/createHashHistory.js +0 -7
- package/node_modules/history/es/createMemoryHistory.js +0 -7
- package/node_modules/history/es/createTransitionManager.js +0 -7
- package/node_modules/history/es/warnAboutDeprecatedESMImport.js +0 -35
- package/node_modules/history/esm/history.js +0 -904
- package/node_modules/history/index.js +0 -7
- package/node_modules/history/package.json +0 -134
- package/node_modules/history/umd/history.js +0 -1059
- package/node_modules/history/umd/history.min.js +0 -1
- package/node_modules/history/warnAboutDeprecatedCJSRequire.js +0 -35
- package/templates/app/.npmignore +0 -9
- package/templates/library/.npmignore +0 -9
@@ -1,138 +1,191 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
2
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
+
exports.default = void 0;
|
6
7
|
|
7
|
-
var
|
8
|
+
var _path = _interopRequireDefault(require("path"));
|
8
9
|
|
9
|
-
var
|
10
|
+
var _fs = _interopRequireDefault(require("fs"));
|
10
11
|
|
11
|
-
var
|
12
|
-
|
13
|
-
var _fs = require('fs');
|
14
|
-
|
15
|
-
var _fs2 = _interopRequireDefault(_fs);
|
16
|
-
|
17
|
-
var _utils = require('../utils');
|
12
|
+
var _utils = require("../utils");
|
18
13
|
|
19
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
20
15
|
|
21
|
-
|
16
|
+
let excludeDocsJSON = '{}';
|
22
17
|
|
23
|
-
|
24
|
-
|
25
|
-
return new RegExp(str);
|
26
|
-
});
|
27
|
-
};
|
18
|
+
if (_fs.default.existsSync('./__testUtils__/conf/excludeDocs.json')) {
|
19
|
+
excludeDocsJSON = _fs.default.readFileSync('./__testUtils__/conf/excludeDocs.json').toString();
|
28
20
|
|
29
|
-
|
30
|
-
|
31
|
-
|
21
|
+
if (excludeDocsJSON.indexOf('\\') !== -1) {
|
22
|
+
excludeDocsJSON = excludeDocsJSON.replace(/\\/g, '\\\\');
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
let excludeDocsArray = JSON.parse(excludeDocsJSON); // if (Object.keys(excludeDocsArray).length > 0) {
|
27
|
+
// }
|
32
28
|
|
33
|
-
|
29
|
+
let getRegex = regexString => regexString.map(str => new RegExp(str));
|
34
30
|
|
31
|
+
class UnusedFilesFindPlugin {
|
32
|
+
constructor(options = {}) {
|
35
33
|
this.usedFilesExcludes = getRegex(options.usedFilesExcludes);
|
36
34
|
this.appFilesExcludes = getRegex(options.appFilesExcludes);
|
37
35
|
this.origin = options.origin;
|
38
36
|
this.delete = options.delete;
|
37
|
+
this.sstest = options.ssTest || false;
|
39
38
|
this.outputFileName = options.outputFileName;
|
39
|
+
this.docsFilename = options.docsFilename || 'Undocsfiles.json';
|
40
|
+
|
40
41
|
if (!this.origin) {
|
41
42
|
throw new Error('You must provide origin point of the app');
|
42
43
|
}
|
43
44
|
}
|
44
45
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
}
|
55
|
-
}
|
56
|
-
return result;
|
57
|
-
}
|
58
|
-
}, {
|
59
|
-
key: 'isIgnoredAllFile',
|
60
|
-
value: function isIgnoredAllFile(file) {
|
61
|
-
var result = void 0;
|
62
|
-
for (var i = 0; i < this.appFilesExcludes.length; i++) {
|
63
|
-
var exclude = this.appFilesExcludes[i];
|
64
|
-
result = exclude.test(file);
|
65
|
-
if (result) {
|
66
|
-
break;
|
67
|
-
}
|
46
|
+
isIgnoredUsedFile(file) {
|
47
|
+
let result;
|
48
|
+
|
49
|
+
for (let i = 0; i < this.usedFilesExcludes.length; i++) {
|
50
|
+
let exclude = this.usedFilesExcludes[i];
|
51
|
+
result = exclude.test(file);
|
52
|
+
|
53
|
+
if (result) {
|
54
|
+
break;
|
68
55
|
}
|
69
|
-
return result;
|
70
56
|
}
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
57
|
+
|
58
|
+
return result;
|
59
|
+
}
|
60
|
+
|
61
|
+
unDocumentedFiles(outputPath) {
|
62
|
+
let status = _fs.default.existsSync(_path.default.join(outputPath, this.outputFileName));
|
63
|
+
|
64
|
+
let unDocsCompObj = {};
|
65
|
+
|
66
|
+
if (status) {
|
67
|
+
let data = _fs.default.readFileSync(_path.default.join(outputPath, this.outputFileName)).toString();
|
68
|
+
|
69
|
+
let walkSync = (dir, filelist = [], undocList = []) => {
|
70
|
+
let files = _fs.default.readdirSync(dir);
|
71
|
+
|
72
|
+
files.forEach(file => {
|
73
|
+
if (_fs.default.statSync(`${dir}/${file}`).isDirectory()) {
|
74
|
+
filelist = walkSync(`${dir}/${file}`, filelist, undocList); //eslint-disable-line
|
75
|
+
} else {
|
76
|
+
if (file.includes('.docs')) {
|
77
|
+
if (!(`${dir}/${file}` in JSON.parse(data))) {
|
78
|
+
filelist.push(`${dir.replace(_path.default.join(process.cwd(), 'src', 'components'), '')}/${file}`);
|
79
|
+
}
|
80
|
+
} else {
|
81
|
+
if (file.includes('.js') && !file.includes('.spec') && !file.includes('.json')) {
|
82
|
+
if (!files.includes('docs')) {
|
83
|
+
if (!excludeDocsArray.docs.exclude.includes(`${dir.replace(_path.default.join(process.cwd(), 'src', 'components'), '')}/${file}`)) {
|
84
|
+
undocList.push(`${dir.replace(_path.default.join(process.cwd(), 'src', 'components'), '')}/${file}`);
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
89
|
+
}
|
90
|
+
});
|
91
|
+
unDocsCompObj.withoutDocs = undocList;
|
92
|
+
return filelist;
|
93
|
+
};
|
94
|
+
|
95
|
+
unDocsCompObj.noEnteredComp = walkSync(_path.default.join(process.cwd(), 'src', 'components'), [], []);
|
96
|
+
(0, _utils.writeFile)(_path.default.join(outputPath, this.docsFilename), JSON.stringify(unDocsCompObj));
|
97
|
+
Object.keys(unDocsCompObj).forEach(key => {
|
98
|
+
if (unDocsCompObj[key].length > 0) {
|
99
|
+
if (key === 'withoutDocs') {
|
100
|
+
(0, _utils.log)('\x1b[36m%s\x1b[0m', '\nPlease write docs file for below componenst :- \n');
|
101
|
+
unDocsCompObj[key].forEach(value => {
|
102
|
+
if (!excludeDocsArray.docs.exclude.includes(value)) {
|
103
|
+
(0, _utils.log)('\x1b[33m%s\x1b[0m', `${value}`);
|
104
|
+
}
|
105
|
+
});
|
86
106
|
}
|
87
107
|
}
|
88
108
|
});
|
89
|
-
return allFiles;
|
90
109
|
}
|
91
|
-
}
|
92
|
-
key: 'apply',
|
93
|
-
value: function apply(compiler) {
|
94
|
-
var _this2 = this;
|
110
|
+
}
|
95
111
|
|
96
|
-
|
97
|
-
|
112
|
+
isIgnoredAllFile(file) {
|
113
|
+
let result;
|
98
114
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
}
|
103
|
-
return files;
|
104
|
-
}, {});
|
115
|
+
for (let i = 0; i < this.appFilesExcludes.length; i++) {
|
116
|
+
let exclude = this.appFilesExcludes[i];
|
117
|
+
result = exclude.test(file);
|
105
118
|
|
106
|
-
|
119
|
+
if (result) {
|
120
|
+
break;
|
121
|
+
}
|
122
|
+
}
|
107
123
|
|
108
|
-
|
109
|
-
|
110
|
-
if (!usedFiles[file]) {
|
111
|
-
unusedFiles.push(file);
|
112
|
-
}
|
113
|
-
});
|
124
|
+
return result;
|
125
|
+
}
|
114
126
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
127
|
+
getAllFiles(rootPath) {
|
128
|
+
let allFiles = [];
|
129
|
+
|
130
|
+
let files = _fs.default.readdirSync(rootPath).map(file => _path.default.join(rootPath, file));
|
131
|
+
|
132
|
+
files.forEach(file => {
|
133
|
+
if (_fs.default.statSync(file).isDirectory()) {
|
134
|
+
allFiles = allFiles.concat(this.getAllFiles(file));
|
135
|
+
} else {
|
136
|
+
if (!this.isIgnoredAllFile(file)) {
|
137
|
+
allFiles.push(file);
|
123
138
|
}
|
139
|
+
}
|
140
|
+
});
|
141
|
+
return allFiles;
|
142
|
+
}
|
124
143
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
144
|
+
apply(compiler) {
|
145
|
+
compiler.hooks.afterEmit.tap('UnusedFilesShowPlugin', compilation => {
|
146
|
+
let {
|
147
|
+
path: outputPath
|
148
|
+
} = compilation.compiler.options.output;
|
149
|
+
let usedFiles = Array.from(compilation.fileDependencies).reduce((files, usedFile) => {
|
150
|
+
if (!this.isIgnoredUsedFile(usedFile)) {
|
151
|
+
files[usedFile] = true;
|
152
|
+
}
|
153
|
+
|
154
|
+
return files;
|
155
|
+
}, {});
|
156
|
+
let allFiles = this.getAllFiles(this.origin);
|
157
|
+
let unusedFiles = [];
|
158
|
+
allFiles.forEach(file => {
|
159
|
+
if (!usedFiles[file]) {
|
160
|
+
unusedFiles.push(file);
|
130
161
|
}
|
131
162
|
});
|
132
|
-
}
|
133
|
-
}]);
|
134
163
|
|
135
|
-
|
136
|
-
|
164
|
+
if (!unusedFiles.length) {
|
165
|
+
(0, _utils.log)('There is no unused files');
|
166
|
+
} else {
|
167
|
+
if (this.outputFileName) {
|
168
|
+
(0, _utils.log)(`You can see unused files info from ${_path.default.join(outputPath, this.outputFileName)} path`);
|
169
|
+
(0, _utils.makeDir)(outputPath);
|
170
|
+
(0, _utils.writeFile)(_path.default.join(outputPath, this.outputFileName), JSON.stringify(unusedFiles)).then(() => {
|
171
|
+
if (this.sstest) {
|
172
|
+
this.unDocumentedFiles(outputPath);
|
173
|
+
}
|
174
|
+
});
|
175
|
+
}
|
176
|
+
}
|
177
|
+
|
178
|
+
if (this.delete) {
|
179
|
+
unusedFiles.forEach(file => {
|
180
|
+
_fs.default.unlinkSync(file);
|
181
|
+
|
182
|
+
(0, _utils.log)(`Deleted - ${file}`);
|
183
|
+
});
|
184
|
+
}
|
185
|
+
});
|
186
|
+
}
|
187
|
+
|
188
|
+
}
|
137
189
|
|
138
|
-
|
190
|
+
var _default = UnusedFilesFindPlugin;
|
191
|
+
exports.default = _default;
|
package/lib/plugins/index.js
CHANGED
@@ -1,61 +1,151 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
2
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
|
7
|
-
var _ChunkManifestReplacePlugin = require('./ChunkManifestReplacePlugin');
|
8
|
-
|
9
|
-
Object.defineProperty(exports, 'ChunkManifestReplacePlugin', {
|
6
|
+
Object.defineProperty(exports, "CdnChangePlugin", {
|
10
7
|
enumerable: true,
|
11
|
-
get: function
|
12
|
-
return
|
8
|
+
get: function () {
|
9
|
+
return _CdnChangePlugin.default;
|
13
10
|
}
|
14
11
|
});
|
15
|
-
|
16
|
-
var _RuntimePublicPathPlugin = require('./RuntimePublicPathPlugin');
|
17
|
-
|
18
|
-
Object.defineProperty(exports, 'RuntimePublicPathPlgin', {
|
12
|
+
Object.defineProperty(exports, "CleanUpStatsPlugin", {
|
19
13
|
enumerable: true,
|
20
|
-
get: function
|
21
|
-
return
|
14
|
+
get: function () {
|
15
|
+
return _CleanupStatsPlugin.default;
|
22
16
|
}
|
23
17
|
});
|
24
|
-
|
25
|
-
var _ModuleStatsPlugin = require('./ModuleStatsPlugin');
|
26
|
-
|
27
|
-
Object.defineProperty(exports, 'ModuleStatsPlugin', {
|
18
|
+
Object.defineProperty(exports, "EFCPlugin", {
|
28
19
|
enumerable: true,
|
29
|
-
get: function
|
30
|
-
return
|
20
|
+
get: function () {
|
21
|
+
return _EFCPlugin.default;
|
31
22
|
}
|
32
23
|
});
|
33
|
-
|
34
|
-
var _SourceMapHookPlugin = require('./SourceMapHookPlugin');
|
35
|
-
|
36
|
-
Object.defineProperty(exports, 'SourceMapHookPlugin', {
|
24
|
+
Object.defineProperty(exports, "I18NInjectIntoIndexPlugin", {
|
37
25
|
enumerable: true,
|
38
|
-
get: function
|
39
|
-
return
|
26
|
+
get: function () {
|
27
|
+
return _I18NInjectIntoIndexPlugin.default;
|
40
28
|
}
|
41
29
|
});
|
42
|
-
|
43
|
-
var _UnusedFilesFindPlugin = require('./UnusedFilesFindPlugin');
|
44
|
-
|
45
|
-
Object.defineProperty(exports, 'UnusedFilesFindPlugin', {
|
30
|
+
Object.defineProperty(exports, "ManifestPlugin", {
|
46
31
|
enumerable: true,
|
47
|
-
get: function
|
48
|
-
return
|
32
|
+
get: function () {
|
33
|
+
return _ManifestPlugin.default;
|
49
34
|
}
|
50
35
|
});
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
36
|
+
Object.defineProperty(exports, "ModuleStatsPlugin", {
|
37
|
+
enumerable: true,
|
38
|
+
get: function () {
|
39
|
+
return _ModuleStatsPlugin.default;
|
40
|
+
}
|
41
|
+
});
|
42
|
+
Object.defineProperty(exports, "OptimizeJSPlugin", {
|
43
|
+
enumerable: true,
|
44
|
+
get: function () {
|
45
|
+
return _OptimizeJSPlugin.default;
|
46
|
+
}
|
47
|
+
});
|
48
|
+
Object.defineProperty(exports, "PublicPathCallbackPlugin", {
|
49
|
+
enumerable: true,
|
50
|
+
get: function () {
|
51
|
+
return _PublicPathCallbackPlugin.default;
|
52
|
+
}
|
53
|
+
});
|
54
|
+
Object.defineProperty(exports, "PublicPathChangePlugin", {
|
55
|
+
enumerable: true,
|
56
|
+
get: function () {
|
57
|
+
return _PublicPathChangePlugin.default;
|
58
|
+
}
|
59
|
+
});
|
60
|
+
Object.defineProperty(exports, "ReportGeneratePlugin", {
|
61
|
+
enumerable: true,
|
62
|
+
get: function () {
|
63
|
+
return _ReportGeneratePlugin.default;
|
64
|
+
}
|
65
|
+
});
|
66
|
+
Object.defineProperty(exports, "ResourceHintsPlugin", {
|
67
|
+
enumerable: true,
|
68
|
+
get: function () {
|
69
|
+
return _ResourceHintsPlugin.default;
|
70
|
+
}
|
71
|
+
});
|
72
|
+
Object.defineProperty(exports, "ScriptInstrumentPlugin", {
|
73
|
+
enumerable: true,
|
74
|
+
get: function () {
|
75
|
+
return _ScriptInstrumentPlugin.default;
|
76
|
+
}
|
77
|
+
});
|
78
|
+
Object.defineProperty(exports, "ServiceWorkerPlugin", {
|
55
79
|
enumerable: true,
|
56
|
-
get: function
|
57
|
-
return
|
80
|
+
get: function () {
|
81
|
+
return _ServiceWorkerPlugin.default;
|
58
82
|
}
|
59
83
|
});
|
84
|
+
Object.defineProperty(exports, "ShadowDOMSupportPlugin", {
|
85
|
+
enumerable: true,
|
86
|
+
get: function () {
|
87
|
+
return _ShadowDOMSupportPlugin.default;
|
88
|
+
}
|
89
|
+
});
|
90
|
+
Object.defineProperty(exports, "SourceMapHookPlugin", {
|
91
|
+
enumerable: true,
|
92
|
+
get: function () {
|
93
|
+
return _SourceMapHookPlugin.default;
|
94
|
+
}
|
95
|
+
});
|
96
|
+
Object.defineProperty(exports, "TPHashMappingPlugin", {
|
97
|
+
enumerable: true,
|
98
|
+
get: function () {
|
99
|
+
return _TPHashMappingPlugin.default;
|
100
|
+
}
|
101
|
+
});
|
102
|
+
Object.defineProperty(exports, "UglifyCSSPlugin", {
|
103
|
+
enumerable: true,
|
104
|
+
get: function () {
|
105
|
+
return _UglifyCSSPlugin.default;
|
106
|
+
}
|
107
|
+
});
|
108
|
+
Object.defineProperty(exports, "UnusedFilesFindPlugin", {
|
109
|
+
enumerable: true,
|
110
|
+
get: function () {
|
111
|
+
return _UnusedFilesFindPlugin.default;
|
112
|
+
}
|
113
|
+
});
|
114
|
+
|
115
|
+
var _ModuleStatsPlugin = _interopRequireDefault(require("./ModuleStatsPlugin"));
|
116
|
+
|
117
|
+
var _SourceMapHookPlugin = _interopRequireDefault(require("./SourceMapHookPlugin"));
|
118
|
+
|
119
|
+
var _UnusedFilesFindPlugin = _interopRequireDefault(require("./UnusedFilesFindPlugin"));
|
120
|
+
|
121
|
+
var _ScriptInstrumentPlugin = _interopRequireDefault(require("./ScriptInstrumentPlugin"));
|
122
|
+
|
123
|
+
var _PublicPathChangePlugin = _interopRequireDefault(require("./PublicPathChangePlugin"));
|
124
|
+
|
125
|
+
var _OptimizeJSPlugin = _interopRequireDefault(require("./OptimizeJSPlugin"));
|
126
|
+
|
127
|
+
var _ResourceHintsPlugin = _interopRequireDefault(require("./ResourceHintsPlugin"));
|
128
|
+
|
129
|
+
var _UglifyCSSPlugin = _interopRequireDefault(require("./UglifyCSSPlugin"));
|
130
|
+
|
131
|
+
var _ManifestPlugin = _interopRequireDefault(require("./ManifestPlugin"));
|
132
|
+
|
133
|
+
var _CleanupStatsPlugin = _interopRequireDefault(require("./CleanupStatsPlugin"));
|
134
|
+
|
135
|
+
var _EFCPlugin = _interopRequireDefault(require("./EFCPlugin"));
|
136
|
+
|
137
|
+
var _PublicPathCallbackPlugin = _interopRequireDefault(require("./PublicPathCallbackPlugin"));
|
138
|
+
|
139
|
+
var _I18NInjectIntoIndexPlugin = _interopRequireDefault(require("./I18NInjectIntoIndexPlugin"));
|
140
|
+
|
141
|
+
var _ReportGeneratePlugin = _interopRequireDefault(require("./ReportGeneratePlugin"));
|
142
|
+
|
143
|
+
var _ShadowDOMSupportPlugin = _interopRequireDefault(require("./ShadowDOMSupportPlugin"));
|
144
|
+
|
145
|
+
var _ServiceWorkerPlugin = _interopRequireDefault(require("./ServiceWorkerPlugin"));
|
146
|
+
|
147
|
+
var _TPHashMappingPlugin = _interopRequireDefault(require("./TPHashMappingPlugin"));
|
148
|
+
|
149
|
+
var _CdnChangePlugin = _interopRequireDefault(require("./CdnChangePlugin"));
|
60
150
|
|
61
151
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
@@ -0,0 +1,190 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _path = _interopRequireDefault(require("path"));
|
9
|
+
|
10
|
+
var _fs = _interopRequireDefault(require("fs"));
|
11
|
+
|
12
|
+
var _webpackSources = require("webpack-sources");
|
13
|
+
|
14
|
+
var _jsonHelper = require("../utils/jsonHelper");
|
15
|
+
|
16
|
+
var _utils = require("../utils");
|
17
|
+
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
|
+
|
20
|
+
let resultFileName = `${process.cwd()}/result.json`;
|
21
|
+
let options = (0, _utils.getOptions)();
|
22
|
+
let {
|
23
|
+
ssTest: {
|
24
|
+
referBranch,
|
25
|
+
currentBranch,
|
26
|
+
serviceName,
|
27
|
+
tokenGit,
|
28
|
+
changesOnly
|
29
|
+
}
|
30
|
+
} = options;
|
31
|
+
(0, _jsonHelper.jsonHelper)(resultFileName, 'tests.libraryImpactOnSource.compareBranch', referBranch);
|
32
|
+
(0, _jsonHelper.jsonHelper)(resultFileName, 'tests.libraryImpactOnSource.TestBranch', currentBranch);
|
33
|
+
(0, _jsonHelper.jsonHelper)(resultFileName, 'tests.libraryImpactOnSource.isExecuted', true);
|
34
|
+
|
35
|
+
let isValidModule = name => {
|
36
|
+
if (name.includes('node_modules') && (name.includes(`@zohodesk${_path.default.sep}components`) || name.includes(`@zohodesk${_path.default.sep}dot`) || name.includes(`@zohodesk${_path.default.sep}icons`) || name.includes(`@zohodesk${_path.default.sep}svg`)) && !name.endsWith('docs.js')) {
|
37
|
+
return true;
|
38
|
+
}
|
39
|
+
|
40
|
+
return !name.includes('index.js') && !name.endsWith('.css') && !name.endsWith('.png') && !name.includes('node_modules') && name.includes('src');
|
41
|
+
};
|
42
|
+
|
43
|
+
let getModuleName = modulePath => {
|
44
|
+
let [name] = _path.default.parse(modulePath).name.split('.');
|
45
|
+
|
46
|
+
if (modulePath.includes(`@zohodesk${_path.default.sep}components`)) {
|
47
|
+
name = `@zohodesk/components/${name}`;
|
48
|
+
} else if (modulePath.includes(`@zohodesk${_path.default.sep}dot`)) {
|
49
|
+
name = `@zohodesk/dot/${name}`;
|
50
|
+
}
|
51
|
+
|
52
|
+
return name;
|
53
|
+
};
|
54
|
+
|
55
|
+
class LibraryImpactPlugin {
|
56
|
+
constructor(options = {}) {
|
57
|
+
this.options = options;
|
58
|
+
this.options.filename = options.filename || 'js/moduleStats.js';
|
59
|
+
this.topHtml = '<!DOCTYPE html><html><head><style>.sourcenameRow .methodDetail { clear: both; padding: 10px; position: relative;}.sourcenameRow.methodDetail > div{float: left; min-width: 50%; padding-bottom: 10px;}.noCoverage { color: red; width: 80%; padding: 10px;}.fl { float: left;}.fr { float: right ! important;}.pointer, #har tr[main] td { cursor: pointer;}.impactTestcaseRow { float: left; width: 45%; padding: 20px; margin-right: 5%; background: white; margin-bottom: 10px; box-sizing: border-box; border-bottom: 2px dotted #eee;}.anchorNone, .modifiedMethodRow:hover .anchorNone { text-decoration: none; color: #00bfff !important;}/* .impactTestcaseRow:hover { box-shadow: -3px 0px 10px #ddd, 2px 1px 3px #ddd;} */.impactedBy{ float: left; padding: 10px; margin-top: 11px; color: green; width: 80%;}div#impactTCListContainer { font-size: 15px;}.impactTestcaseRowContainer,.sourcenameRow{ display:flex; flex-direction:column;}summary{ outline:none;}details{ padding:25px 10px;}</style></head><body> <div class="sourcenameRow pointer bg-clr-hr">';
|
60
|
+
this.bottomHtml = '</div> <script type="text/javascript"> const details = document.querySelectorAll("details"); details.forEach((targetDetail) => { targetDetail.addEventListener("click", () => { // Close all the details that are not targetDetail. details.forEach((detail) => { if (detail !== targetDetail) { detail.removeAttribute("open"); } }); }); }); </script></body></html>';
|
61
|
+
this.resultJson = {};
|
62
|
+
}
|
63
|
+
|
64
|
+
apply(compiler) {
|
65
|
+
let loggedInfo = false;
|
66
|
+
compiler.hooks.beforeCompile.tap('LibraryImpactPlugin', () => {
|
67
|
+
(0, _jsonHelper.jsonHelper)(resultFileName, 'tests.libraryImpactOnSource.startTime', Date.now());
|
68
|
+
|
69
|
+
if (!loggedInfo) {
|
70
|
+
(0, _utils.log)('\x1b[33m%s\x1b[0m', '************************************************************ \n ');
|
71
|
+
(0, _utils.log)('\x1b[5m\x1b[44m%s\x1b[0m', 'Finding Impacted Source Files Please Wait ...');
|
72
|
+
loggedInfo = true;
|
73
|
+
}
|
74
|
+
});
|
75
|
+
compiler.hooks.emit.tap('LibraryImpactPlugin', compilation => {
|
76
|
+
let stats = compilation.getStats().toJson();
|
77
|
+
let results = {};
|
78
|
+
let {
|
79
|
+
modules
|
80
|
+
} = stats;
|
81
|
+
|
82
|
+
for (let module of modules) {
|
83
|
+
let {
|
84
|
+
name,
|
85
|
+
reasons
|
86
|
+
} = module;
|
87
|
+
|
88
|
+
if (isValidModule(name)) {
|
89
|
+
let references = new Set();
|
90
|
+
let referencedby = new Set();
|
91
|
+
let docsName;
|
92
|
+
let fileName;
|
93
|
+
compilation.modules.forEach(module => {
|
94
|
+
module.reasons.forEach(reason => {
|
95
|
+
let exportedValue = reason.dependency;
|
96
|
+
|
97
|
+
if (exportedValue.type === 'harmony export imported specifier') {
|
98
|
+
if (exportedValue.module.userRequest.includes(name.replace('.', ''))) {
|
99
|
+
docsName = exportedValue.name;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
});
|
103
|
+
});
|
104
|
+
let currentModuleName = name;
|
105
|
+
|
106
|
+
if (Array.isArray(reasons)) {
|
107
|
+
for (let reason of reasons) {
|
108
|
+
let {
|
109
|
+
moduleName
|
110
|
+
} = reason;
|
111
|
+
|
112
|
+
if (isValidModule(moduleName)) {
|
113
|
+
let reasonedModuleName = moduleName;
|
114
|
+
referencedby.add(reasonedModuleName);
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}
|
118
|
+
|
119
|
+
for (let subModule of modules) {
|
120
|
+
let {
|
121
|
+
name: subModuleName,
|
122
|
+
reasons
|
123
|
+
} = subModule;
|
124
|
+
|
125
|
+
if (isValidModule(subModuleName)) {
|
126
|
+
let currentModuleName = subModuleName;
|
127
|
+
|
128
|
+
if (Array.isArray(reasons)) {
|
129
|
+
for (let reason of reasons) {
|
130
|
+
let {
|
131
|
+
moduleName: reasonedModuleName
|
132
|
+
} = reason;
|
133
|
+
|
134
|
+
if (name === reasonedModuleName) {
|
135
|
+
references.add(currentModuleName);
|
136
|
+
}
|
137
|
+
}
|
138
|
+
}
|
139
|
+
}
|
140
|
+
}
|
141
|
+
|
142
|
+
results[currentModuleName] = {
|
143
|
+
name: currentModuleName,
|
144
|
+
references: Array.from(references),
|
145
|
+
referencedby: Array.from(referencedby),
|
146
|
+
docsName: docsName ? docsName : '',
|
147
|
+
fileName: name ? name : currentModuleName
|
148
|
+
};
|
149
|
+
}
|
150
|
+
}
|
151
|
+
|
152
|
+
(0, _utils.getDependenciesImpactList)(currentBranch, referBranch, tokenGit, serviceName).then(impactedList => {
|
153
|
+
this.resultJson = (0, _utils.getLibraryConflict)(JSON.stringify(results), impactedList, changesOnly);
|
154
|
+
(0, _jsonHelper.jsonHelper)(resultFileName, 'tests.libraryImpactOnSource.result', this.resultJson);
|
155
|
+
|
156
|
+
if (this.resultJson.result.status) {
|
157
|
+
(0, _utils.log)(this.resultJson.response);
|
158
|
+
this.resultJson.response.forEach(fileObject => {
|
159
|
+
this.topHtml = this.topHtml + '<details><summary><b>Source Name: </b>' + fileObject.sourceName + '</summary><div class="impactTestcaseRowContainer"><div class="impactedBy"> ImpactedBy :- </div>';
|
160
|
+
fileObject.impactedBy.forEach(fileName => {
|
161
|
+
this.topHtml = this.topHtml + '<div class="impactTestcaseRow"><a class="anchorNone">' + fileName + '</a></div>';
|
162
|
+
});
|
163
|
+
this.topHtml = this.topHtml + '</div></details>';
|
164
|
+
});
|
165
|
+
} else {
|
166
|
+
(0, _utils.log)('\n');
|
167
|
+
(0, _utils.log)(this.resultJson.result.message);
|
168
|
+
this.topHtml = this.topHtml + '<div style="font-size: xxx-large; text-align: center; padding-top: 50px;"> ' + this.resultJson.result.message + '</div>';
|
169
|
+
}
|
170
|
+
|
171
|
+
if (!_fs.default.existsSync('./coverageTest')) {
|
172
|
+
_fs.default.mkdirSync('./coverageTest');
|
173
|
+
|
174
|
+
_fs.default.writeFileSync('./coverageTest/impactLibrary.html', this.topHtml + this.bottomHtml, 'utf8');
|
175
|
+
} else {
|
176
|
+
_fs.default.writeFileSync('./coverageTest/impactLibrary.html', this.topHtml + this.bottomHtml, 'utf8');
|
177
|
+
}
|
178
|
+
|
179
|
+
(0, _jsonHelper.jsonHelper)(resultFileName, 'tests.libraryImpactOnSource.endTime', Date.now());
|
180
|
+
});
|
181
|
+
});
|
182
|
+
compiler.hooks.done.tap('LibraryImpactPlugin', () => {
|
183
|
+
(0, _utils.log)('\n');
|
184
|
+
(0, _utils.log)('Compilation finished!!!');
|
185
|
+
});
|
186
|
+
}
|
187
|
+
|
188
|
+
}
|
189
|
+
|
190
|
+
exports.default = LibraryImpactPlugin;
|