@zohodesk/client_build_tool 0.0.1 → 0.0.2
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/CHANGELOG.md +25 -4
- package/ConfigurationDocumentation.md +239 -73
- package/README.md +27 -4
- package/README_backup.md +2 -0
- package/TODO.md +1 -1
- package/coverage/addFilesNamesToManifestJson.js.html +148 -0
- package/coverage/bundler/webpack/custom_plugins/AddManifestJson/addFilesNamesToManifestJson.js.html +148 -0
- package/coverage/bundler/webpack/custom_plugins/AddManifestJson/createInitialEntries.js.html +136 -0
- package/coverage/bundler/webpack/custom_plugins/AddManifestJson/createManifestJson.js.html +181 -0
- package/coverage/bundler/webpack/custom_plugins/AddManifestJson/findInitialFileNames.js.html +133 -0
- package/coverage/bundler/webpack/custom_plugins/AddManifestJson/index.html +146 -0
- package/coverage/bundler/webpack/custom_plugins/AddManifestJson/index.js.html +199 -0
- package/coverage/bundler/webpack/custom_plugins/AddManifestJson/removeHashFromFileName.js.html +127 -0
- package/coverage/bundler/webpack/custom_plugins/VariableConversionCollector/ErrorHandler.js.html +346 -0
- package/coverage/bundler/webpack/custom_plugins/VariableConversionCollector/index.html +116 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/constants.js.html +94 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/handleIgnores.js.html +259 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/index.html +236 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/index.js.html +442 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/insertBefore.js.html +154 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/isPreviouslyProcessed.js.html +142 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/replaceUtils.js.html +127 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/separateHoveredSelectorAndNormalSelector.js.html +139 -0
- package/coverage/{updateArrayWithDefault.js.html → bundler/webpack/custom_postcss_plugins/HoverActivePlugin/specialCases.js.html} +55 -67
- package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/typeCheckUtils.js.html +193 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/SelectorReplace.js.html +292 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/ValueReplacer.js.html +223 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/VariableModificationPlugin/index.html +116 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/VariableModificationPlugin/index.js.html +1126 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/index.html +131 -0
- package/coverage/bundler/webpack/loaderConfigs/getSpecificPostCssPlugin.js.html +247 -0
- package/coverage/bundler/webpack/loaderConfigs/index.html +116 -0
- package/coverage/coverage-final.json +3 -1
- package/coverage/coverage-summary.json +4 -2
- package/coverage/createInitialEntries.js.html +136 -0
- package/coverage/dummy.js.html +238 -0
- package/coverage/index.html +51 -21
- package/coverage/index.js.html +169 -0
- package/coverage/isObject.js.html +94 -0
- package/coverage/isValid.js.html +106 -0
- package/coverage/removeHashFromFileName.js.html +127 -0
- package/docs/BabelCustomizations.md +55 -0
- package/lib/commands/build/preProcessor.js +12 -0
- package/lib/commands/buildEs/preProcessor.js +17 -0
- package/lib/commands/buildLib/preProcessor.js +17 -0
- package/lib/commands/pre_process/commandExecutor.js +18 -0
- package/lib/commands/pre_process/config.js +12 -0
- package/lib/commands/start/preProcessor.js +3 -1
- package/lib/schemas/defaultConfigValues.js +65 -29
- package/lib/schemas/defaultConfigValuesOnly.js +20 -1
- package/lib/shared/babel/addDefaultPlugins.js +15 -0
- package/lib/shared/babel/babelWebConfig.js +2 -2
- package/lib/shared/babel/getBabelPlugin.js +37 -0
- package/lib/shared/bundler/webpack/common/nameTemplates.js +31 -8
- package/lib/shared/bundler/webpack/configCustomLoaders.js +1 -1
- package/lib/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/index.js +1 -1
- package/lib/shared/bundler/webpack/custom_plugins/custom_attribute_plugin/index.js +80 -0
- package/lib/shared/bundler/webpack/getCSSLoaders.js +2 -0
- package/lib/shared/bundler/webpack/loaderConfigs/configsAssetsLoaders.js +1 -53
- package/lib/shared/bundler/webpack/loaders/miniCssFallBackLoader.js +7 -0
- package/lib/shared/bundler/webpack/outputConfig.js +9 -2
- package/lib/shared/bundler/webpack/pluginConfigs/configCustomAttributesPlugin.js +20 -0
- package/lib/shared/bundler/webpack/pluginConfigs/configEnvVariables.js +25 -10
- package/lib/shared/bundler/webpack/pluginConfigs/configTPHashMappingPlugin.js +2 -2
- package/lib/shared/bundler/webpack/pluginConfigs/dummy.js +23 -0
- package/lib/shared/bundler/webpack/plugins.js +3 -1
- package/lib/shared/bundler/webpack/statsConfig.js +11 -2
- package/lib/shared/commands-utils/spawnSyncIO.js +5 -5
- package/lib/shared/pre_process/runPreProcess.js +58 -0
- package/lib/shared/server/mockApiHandler.js +1 -1
- package/npm-shrinkwrap.json +552 -2209
- package/package.json +8 -3
- package/result.json +1 -1
- package/unittest/index.html +33 -35
- package/lib/shared/babel/defaultBabelPlugins.js +0 -26
|
@@ -24,15 +24,15 @@ function spawnSyncIO(commandName, args, spawnSyncOptions = defaultSpawnSyncOptio
|
|
|
24
24
|
|
|
25
25
|
if (result.error || result.stderr) {
|
|
26
26
|
(0, _logger.errorLogger)(result.error || result.stderr);
|
|
27
|
-
}
|
|
27
|
+
}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
process.exit(result.status);
|
|
29
|
+
return result;
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
function spawnIO(commandName, args, cb) {
|
|
34
|
-
// const result =
|
|
35
|
-
|
|
33
|
+
const command = (0, _getCliPath.getCliPath)(commandName); // const result =
|
|
34
|
+
|
|
35
|
+
return (0, _child_process.spawn)(command, args, {
|
|
36
36
|
stdio: 'inherit'
|
|
37
37
|
}, cb); // process.exit(result.status);
|
|
38
38
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.runPreProcess = runPreProcess;
|
|
7
|
+
|
|
8
|
+
var _path = require("path");
|
|
9
|
+
|
|
10
|
+
var _fs = require("fs");
|
|
11
|
+
|
|
12
|
+
var _spawnSyncIO = require("../commands-utils/spawnSyncIO");
|
|
13
|
+
|
|
14
|
+
var _logger = require("../../logger");
|
|
15
|
+
|
|
16
|
+
var _constants = require("../constants");
|
|
17
|
+
|
|
18
|
+
function runPreProcess(options, runnerCli = 'node') {
|
|
19
|
+
const {
|
|
20
|
+
preProcess
|
|
21
|
+
} = options;
|
|
22
|
+
const {
|
|
23
|
+
enable,
|
|
24
|
+
runner,
|
|
25
|
+
stopNodemon
|
|
26
|
+
} = preProcess;
|
|
27
|
+
|
|
28
|
+
if (!enable || !runner) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const preprocessorPath = (0, _constants.joinWithAppPath)(runner);
|
|
33
|
+
let result = null;
|
|
34
|
+
|
|
35
|
+
if ((0, _fs.existsSync)(preprocessorPath)) {
|
|
36
|
+
const preprocessorDirPath = (0, _path.dirname)(preprocessorPath);
|
|
37
|
+
const watchOptions = ['--watch', preprocessorDirPath];
|
|
38
|
+
const preprocessCli = stopNodemon ? 'node' : runnerCli;
|
|
39
|
+
|
|
40
|
+
if (preprocessCli === 'node') {
|
|
41
|
+
result = (0, _spawnSyncIO.spawnSyncIO)(preprocessCli, [preprocessorPath], {
|
|
42
|
+
stdio: 'inherit',
|
|
43
|
+
cwd: preprocessorDirPath
|
|
44
|
+
});
|
|
45
|
+
(0, _logger.messageLogger)('pre_processor ran successfully');
|
|
46
|
+
} else {
|
|
47
|
+
result = (0, _spawnSyncIO.spawnIO)(preprocessCli, [preprocessorPath, ...watchOptions], {
|
|
48
|
+
stdio: 'inherit',
|
|
49
|
+
cwd: preprocessorDirPath
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
} else {
|
|
53
|
+
(0, _logger.errorLogger)(`preProcessor not exists ${preprocessorPath}`);
|
|
54
|
+
process.exit(0);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
@@ -44,7 +44,6 @@ function handleMockApi(mockEntryFile, app) {
|
|
|
44
44
|
const entryFilePath = (0, _constants.joinWithAppPath)(mockEntryFile); // eslint-disable-next-line no-use-before-define
|
|
45
45
|
|
|
46
46
|
const mockFunc = safeRequire(entryFilePath);
|
|
47
|
-
console.log(mockFunc);
|
|
48
47
|
mockFunc?.mockApi?.(app);
|
|
49
48
|
} // function handleMockApi(params) {
|
|
50
49
|
// }
|
|
@@ -52,6 +51,7 @@ function handleMockApi(mockEntryFile, app) {
|
|
|
52
51
|
|
|
53
52
|
function safeRequire(entryFilePath) {
|
|
54
53
|
if (!(0, _fs.existsSync)(entryFilePath)) {
|
|
54
|
+
(0, _logger.errorLogger)(`${entryFilePath} file not exists for mockapi, Please check the file presence`);
|
|
55
55
|
return null;
|
|
56
56
|
} // eslint-disable-next-line import/no-dynamic-require, global-require
|
|
57
57
|
|