@zohodesk/react-cli 1.1.16-exp.10 → 1.1.16-exp.11
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +0 -14
- package/lib/configs/webpack.dev.config.js +2 -7
- package/lib/configs/webpack.prod.config.js +1 -1
- package/lib/schemas/index.js +0 -4
- package/npm-shrinkwrap.json +13 -8
- package/package.json +2 -1
- package/packages/client_build_tool/lib/allCommandsConfigs.js +23 -0
- package/packages/client_build_tool/lib/buildToolLoggers.js +32 -0
- package/packages/client_build_tool/lib/commands/build/commandExecutor.js +21 -0
- package/packages/client_build_tool/lib/commands/build/config.js +12 -0
- package/packages/client_build_tool/lib/commands/build/errorHander.js +10 -0
- package/packages/client_build_tool/lib/commands/build/index.js +35 -0
- package/packages/client_build_tool/lib/commands/build/optionsProcesser.js +40 -0
- package/packages/client_build_tool/lib/commands/buildEs/commandExecutor.js +17 -0
- package/packages/client_build_tool/lib/commands/buildEs/config.js +12 -0
- package/packages/client_build_tool/lib/commands/buildLib/commandExecutor.js +17 -0
- package/packages/client_build_tool/lib/commands/buildLib/config.js +12 -0
- package/packages/client_build_tool/lib/commands/start/commandExecutor.js +13 -0
- package/packages/client_build_tool/lib/commands/start/config.js +12 -0
- package/packages/client_build_tool/lib/commands/start/deprecationHandler.js +10 -0
- package/packages/client_build_tool/lib/commands/start/errorHander.js +10 -0
- package/packages/client_build_tool/lib/commands/start/optionsProcesser.js +36 -0
- package/packages/client_build_tool/lib/commands/start/postProcesser.js +10 -0
- package/packages/client_build_tool/lib/commands/start/preProcesser.js +10 -0
- package/packages/client_build_tool/lib/commandsRouter.js +71 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/common/decidePublicPath.js +44 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/common/libAlias.js +31 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/common/nameTemplates.js +51 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/common/resourceBasedPublicPath.js +21 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/cssLoaders.js +16 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/CdnChangePlugin.js +111 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/EFCPlugin.js +1 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ContributionGuide.md +11 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nKeysIdentifer.js +136 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nSplit.md +95 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/README.md +25 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/constants.js +29 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/createHash.js +24 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nDependency.js +99 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nLoadingRuntimeModule.js +81 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nModule.js +201 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/index.js +401 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/optionsHandler.js +67 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/pathCreator.js +23 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/readI18nValues.js +29 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateFileName.js +49 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateHashHelpers.js +77 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/collectI18nKeys.js +63 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/hashUtils.js +19 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/index.js +31 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/propertiesUtils.js +127 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RTLSplitPlugin.js +1 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +63 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtlCssPlugin.js +89 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtrSplit.md +34 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/replaceCssDirTemplate.js +15 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ServiceWorkerPlugin.js +155 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin.js +49 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_postcss_loaders/ExcludePlugin.js +58 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_postcss_loaders/RTLSplitPlugin.js +139 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/devServerConfig.js +34 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/getCSSLoaders.js +30 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/jsLoaders.js +17 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/assetLoaders.js +14 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/babelLoaderConfig.js +24 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configHtmlTemplateLoader.js +18 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configWebWorkerLoader.js +21 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configsAssetsLoaders.js +138 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/cssClassNameGenerate.js +83 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/getCssLoaderOptions.js +23 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaders/workerLoader.js +133 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/optimizationConfig.js +39 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/outputConfig.js +28 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCdnChangePlugin.js +18 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCopyThirdpartyFile.js +38 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configEnvVariables.js +24 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configHtmlWebpackPlugin.js +28 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configI18nSplitPlugin.js +35 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configIgnorePlugin.js +16 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configMiniCSSExtractPlugin.js +23 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configProgressPlugin.js +19 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configRtlCssPlugin.js +27 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configServiceWorkerPlugin.js +18 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configUglifyCSSPlugin.js +15 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/plugins.js +39 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/postcssPlugins.js +36 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/resolvers.js +42 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/splitChunksConfig.js +12 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/webpack.dev.config.js +17 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/webpackBuild.js +24 -0
- package/packages/client_build_tool/lib/shared/bundler/webpack/webpackConfig.js +50 -0
- package/packages/client_build_tool/lib/shared/commands-utlis/doBasicRequiermentCheck.js +16 -0
- package/packages/client_build_tool/lib/shared/commands-utlis/getCliPath.js +38 -0
- package/packages/client_build_tool/lib/shared/commands-utlis/index.js +29 -0
- package/packages/client_build_tool/lib/shared/commands-utlis/log.js +13 -0
- package/packages/client_build_tool/lib/shared/commands-utlis/readArgsFormCommandLine.js +11 -0
- package/packages/client_build_tool/lib/shared/commands-utlis/readOptionFormCommandLine.js +11 -0
- package/packages/client_build_tool/lib/shared/commands-utlis/spanSync.js +35 -0
- package/packages/client_build_tool/lib/shared/constants.js +33 -0
- package/packages/client_build_tool/lib/shared/schemas/applyValuesToShema.js +37 -0
- package/packages/client_build_tool/lib/shared/schemas/cliArgsToObject.js +37 -0
- package/packages/client_build_tool/lib/shared/schemas/defaultConfigValues.js +119 -0
- package/packages/client_build_tool/lib/shared/schemas/deprecatedOptionsHandler.js +65 -0
- package/packages/client_build_tool/lib/shared/schemas/getCWD.js +23 -0
- package/packages/client_build_tool/lib/shared/schemas/getNpmVersion.js +21 -0
- package/packages/client_build_tool/lib/shared/schemas/npmConfigToObject.js +32 -0
- package/packages/client_build_tool/lib/shared/schemas/oldDefaultConfigValues.js +480 -0
- package/packages/client_build_tool/lib/shared/schemas/readOptions.js +55 -0
- package/packages/client_build_tool/lib/shared/schemas/readOptionsForPackageJson.js +26 -0
- package/packages/client_build_tool/lib/shared/schemas/readOptionsOld.js +152 -0
- package/packages/client_build_tool/lib/shared/server/cert/Tsicsezwild-22-23.crt +37 -0
- package/packages/client_build_tool/lib/shared/server/cert/Tsicsezwild-22-23.key +27 -0
- package/packages/client_build_tool/lib/shared/server/configWebpackDevMiddleware.js +40 -0
- package/packages/client_build_tool/lib/shared/server/corsHandleing.js +28 -0
- package/packages/client_build_tool/lib/shared/server/getIp.js +30 -0
- package/packages/client_build_tool/lib/shared/server/getServerURL.js +29 -0
- package/packages/client_build_tool/lib/shared/server/httpsOptions.js +53 -0
- package/packages/client_build_tool/lib/shared/server/initExpressApp.js +19 -0
- package/packages/client_build_tool/lib/shared/server/initialHTMLHandling.js +66 -0
- package/packages/client_build_tool/lib/shared/server/serveContextFiles.js +24 -0
- package/packages/client_build_tool/lib/shared/server/serverBywebpackDevMiddleware.js +40 -0
- package/packages/client_build_tool/lib/shared/server/startHttpServer.js +26 -0
- package/packages/client_build_tool/lib/shared/server/startHttpsServer.js +34 -0
- package/packages/client_build_tool/lib/shared/server/unwanted/addHttp2Server.js +41 -0
- package/packages/client_build_tool/lib/shared/server/unwanted/configWebpackDevMiddleware.js +44 -0
- package/packages/client_build_tool/lib/shared/server/unwanted/devServerUtlis.js +1 -0
- package/packages/client_build_tool/lib/shared/server/unwanted/mockApiSupport.js +19 -0
- package/packages/client_build_tool/lib/shared/server/unwanted/webpackConfig.js +32 -0
- package/packages/client_build_tool/lib/shared/server/unwanted/websocketMockSetup.js +48 -0
- package/packages/client_build_tool/lib/shared/server/urlConcat.js +25 -0
- package/packages/client_build_tool/lib/shared/utils/utils.js +1 -0
package/README.md
CHANGED
@@ -44,20 +44,6 @@ Now to run app
|
|
44
44
|
|
45
45
|
# Change Logs
|
46
46
|
|
47
|
-
# 1.1.17 (4-01-2024)
|
48
|
-
|
49
|
-
**Feature:-**
|
50
|
-
|
51
|
-
- MJS loader support added.
|
52
|
-
- We can enable/disable this feature by `npm run start --enableMjsLoader=true/false` default value will be `false`.
|
53
|
-
|
54
|
-
```
|
55
|
-
app: {
|
56
|
-
enableMjsLoader : true/false
|
57
|
-
}
|
58
|
-
|
59
|
-
```
|
60
|
-
|
61
47
|
# 1.1.16 (25-10-2023)
|
62
48
|
|
63
49
|
**Feature:-**
|
@@ -42,8 +42,7 @@ const {
|
|
42
42
|
sourcemap,
|
43
43
|
crossorigin,
|
44
44
|
postCssPluginOrder,
|
45
|
-
externals
|
46
|
-
enableMjsLoader
|
45
|
+
externals
|
47
46
|
}
|
48
47
|
} = options;
|
49
48
|
const {
|
@@ -101,11 +100,7 @@ module.exports = {
|
|
101
100
|
|
102
101
|
return false;
|
103
102
|
}
|
104
|
-
},
|
105
|
-
test: /\.mjs$/,
|
106
|
-
include: /node_modules/,
|
107
|
-
type: 'javascript/auto'
|
108
|
-
} : null, seperateCssModules ? {
|
103
|
+
}, seperateCssModules ? {
|
109
104
|
test: /\.css$/,
|
110
105
|
exclude: /\.module\.css$/,
|
111
106
|
use: (0, _loaderUtils.getCSSLoaders)({
|
@@ -128,7 +128,7 @@ module.exports = {
|
|
128
128
|
} : {
|
129
129
|
modules: false
|
130
130
|
}], require.resolve('@babel/preset-react')],
|
131
|
-
plugins: disableES5Transpile ? [removeAttribute ? require.resolve('../utils/removeAttributes') : false, require.resolve('@babel/plugin-syntax-dynamic-import'), require.resolve('babel-plugin-lodash'), require.resolve('@babel/plugin-proposal-object-rest-spread'), devConsoleExculde ? [require.resolve('babel-plugin-transform-remove-console'), {
|
131
|
+
plugins: disableES5Transpile ? [removeAttribute ? require.resolve('../utils/removeAttributes') : false, require.resolve('@babel/plugin-syntax-dynamic-import'), require.resolve('babel-plugin-lodash'), require.resolve('@babel/plugin-proposal-object-rest-spread'), shouldRemovePropTypes ? [require.resolve('babel-plugin-transform-react-remove-prop-types'), removePropTypes] : false, devConsoleExculde ? [require.resolve('babel-plugin-transform-remove-console'), {
|
132
132
|
exclude: ['error', 'log']
|
133
133
|
}] : null].filter(Boolean) : [removeAttribute ? require.resolve('../utils/removeAttributes') : false, shouldRemovePropTypes ? [require.resolve('babel-plugin-transform-react-remove-prop-types'), removePropTypes] : false, [require.resolve('@babel/plugin-transform-runtime'), {
|
134
134
|
helpers: true,
|
package/lib/schemas/index.js
CHANGED
@@ -129,10 +129,6 @@ var _default = {
|
|
129
129
|
value: '@zohodesk/client_packages_group',
|
130
130
|
cli: 'module_resolve_path'
|
131
131
|
},
|
132
|
-
enableMjsLoader: {
|
133
|
-
value: false,
|
134
|
-
cli: 'enableMjsLoader'
|
135
|
-
},
|
136
132
|
customClassNamePrefix: [],
|
137
133
|
// this option only for impact testing
|
138
134
|
devCssFileBountry: {
|
package/npm-shrinkwrap.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@zohodesk/react-cli",
|
3
|
-
"version": "1.1.16-exp.
|
3
|
+
"version": "1.1.16-exp.11",
|
4
4
|
"lockfileVersion": 2,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "@zohodesk/react-cli",
|
9
|
-
"version": "1.1.16-exp.
|
9
|
+
"version": "1.1.16-exp.11",
|
10
10
|
"license": "ISC",
|
11
11
|
"dependencies": {
|
12
12
|
"@babel/cli": "7.10.5",
|
@@ -31,6 +31,7 @@
|
|
31
31
|
"babel-plugin-transform-dynamic-import": "2.1.0",
|
32
32
|
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
|
33
33
|
"babel-plugin-transform-remove-console": "6.9.4",
|
34
|
+
"caniuse-lite": "1.0.30001579",
|
34
35
|
"case-sensitive-paths-webpack-plugin": "2.3.0",
|
35
36
|
"compression": "1.7.4",
|
36
37
|
"copy-webpack-plugin": "5.1.2",
|
@@ -4678,9 +4679,9 @@
|
|
4678
4679
|
}
|
4679
4680
|
},
|
4680
4681
|
"node_modules/caniuse-lite": {
|
4681
|
-
"version": "1.0.
|
4682
|
-
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.
|
4683
|
-
"integrity": "sha512-
|
4682
|
+
"version": "1.0.30001579",
|
4683
|
+
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001579.tgz",
|
4684
|
+
"integrity": "sha512-u5AUVkixruKHJjw/pj9wISlcMpgFWzSrczLZbrqBSxukQixmg0SJ5sZTpvaFvxU0HoQKd4yoyAogyrAz9pzJnA==",
|
4684
4685
|
"funding": [
|
4685
4686
|
{
|
4686
4687
|
"type": "opencollective",
|
@@ -4689,6 +4690,10 @@
|
|
4689
4690
|
{
|
4690
4691
|
"type": "tidelift",
|
4691
4692
|
"url": "https://tidelift.com/funding/github/npm/caniuse-lite"
|
4693
|
+
},
|
4694
|
+
{
|
4695
|
+
"type": "github",
|
4696
|
+
"url": "https://github.com/sponsors/ai"
|
4692
4697
|
}
|
4693
4698
|
]
|
4694
4699
|
},
|
@@ -22518,9 +22523,9 @@
|
|
22518
22523
|
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg=="
|
22519
22524
|
},
|
22520
22525
|
"caniuse-lite": {
|
22521
|
-
"version": "1.0.
|
22522
|
-
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.
|
22523
|
-
"integrity": "sha512-
|
22526
|
+
"version": "1.0.30001579",
|
22527
|
+
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001579.tgz",
|
22528
|
+
"integrity": "sha512-u5AUVkixruKHJjw/pj9wISlcMpgFWzSrczLZbrqBSxukQixmg0SJ5sZTpvaFvxU0HoQKd4yoyAogyrAz9pzJnA=="
|
22524
22529
|
},
|
22525
22530
|
"capture-exit": {
|
22526
22531
|
"version": "2.0.0",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@zohodesk/react-cli",
|
3
|
-
"version": "1.1.16-exp.
|
3
|
+
"version": "1.1.16-exp.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",
|
@@ -54,6 +54,7 @@
|
|
54
54
|
"babel-plugin-transform-dynamic-import": "2.1.0",
|
55
55
|
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
|
56
56
|
"babel-plugin-transform-remove-console": "6.9.4",
|
57
|
+
"caniuse-lite": "1.0.30001579",
|
57
58
|
"case-sensitive-paths-webpack-plugin": "2.3.0",
|
58
59
|
"compression": "1.7.4",
|
59
60
|
"copy-webpack-plugin": "5.1.2",
|
@@ -0,0 +1,23 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _fs = require("fs");
|
9
|
+
|
10
|
+
var _path = require("path");
|
11
|
+
|
12
|
+
const allConfigs = [];
|
13
|
+
(0, _fs.readdirSync)((0, _path.join)(__dirname, 'commands')).forEach(folderName => {
|
14
|
+
const modulePath = (0, _path.join)(__dirname, './commands/' + folderName + '/config.js');
|
15
|
+
|
16
|
+
if ((0, _fs.existsSync)(modulePath)) {
|
17
|
+
const config = require(modulePath).default;
|
18
|
+
|
19
|
+
allConfigs.push(config);
|
20
|
+
}
|
21
|
+
});
|
22
|
+
var _default = allConfigs;
|
23
|
+
exports.default = _default;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.debugLogger = debugLogger;
|
7
|
+
exports.errorLogger = errorLogger;
|
8
|
+
exports.messageLogger = messageLogger;
|
9
|
+
exports.verboseLogger = verboseLogger;
|
10
|
+
exports.warnLogger = warnLogger;
|
11
|
+
|
12
|
+
/* eslint-disable no-console */
|
13
|
+
function verboseLogger(...args) {// TODO: need to be remove when publish happens
|
14
|
+
// console.log(...args);
|
15
|
+
console.log(...args);
|
16
|
+
}
|
17
|
+
|
18
|
+
function warnLogger(...args) {
|
19
|
+
console.warn(...args);
|
20
|
+
}
|
21
|
+
|
22
|
+
function messageLogger(...args) {
|
23
|
+
console.log(...args);
|
24
|
+
}
|
25
|
+
|
26
|
+
function debugLogger(...args) {// TODO: need to be remove when publish happens
|
27
|
+
// console.log(...args);
|
28
|
+
}
|
29
|
+
|
30
|
+
function errorLogger(...args) {
|
31
|
+
console.error(...args);
|
32
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.commandExecutor = commandExecutor;
|
7
|
+
|
8
|
+
var _buildToolLoggers = require("../../buildToolLoggers");
|
9
|
+
|
10
|
+
var _webpackBuild = _interopRequireDefault(require("../../shared/bundler/webpack/webpackBuild"));
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
14
|
+
// import { spawnSyncIO } from '../../shared/commands-utlis/spanSync';
|
15
|
+
function commandExecutor(options) {
|
16
|
+
(0, _buildToolLoggers.messageLogger)('Build is runnning');
|
17
|
+
(0, _webpackBuild.default)(options); // spawnSyncIO('webpack', [
|
18
|
+
// '--config',
|
19
|
+
// require.resolve('../../shared/bundler/webpack/webpack.dev.config.js')
|
20
|
+
// ]);
|
21
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.configs = void 0;
|
7
|
+
|
8
|
+
var _commandExecutor = require("./commandExecutor");
|
9
|
+
|
10
|
+
var _errorHander = require("./errorHander");
|
11
|
+
|
12
|
+
var _optionsProcesser = require("./optionsProcesser");
|
13
|
+
|
14
|
+
// import { spawnSyncIO } from '../commands-utlis/spanSync.js';
|
15
|
+
function run(options) {
|
16
|
+
// const { disableWatch } = options.app;
|
17
|
+
// spawnSyncIO('node', [
|
18
|
+
// require.resolve(
|
19
|
+
// disableWatch ? '../servers/nowatchserver' : '../servers/server'
|
20
|
+
// ),
|
21
|
+
// '--expose-http2',
|
22
|
+
// ...args
|
23
|
+
// ]);
|
24
|
+
(0, _commandExecutor.commandExecutor)(options).then(console.log).catch(e => {
|
25
|
+
(0, _errorHander.errorHander)(e);
|
26
|
+
});
|
27
|
+
}
|
28
|
+
|
29
|
+
const configs = {
|
30
|
+
name: 'devSeverStart',
|
31
|
+
alias: ['start'],
|
32
|
+
optionsProcesser: _optionsProcesser.optionsProcesser,
|
33
|
+
run
|
34
|
+
};
|
35
|
+
exports.configs = configs;
|
@@ -0,0 +1,40 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.optionsProcesser = optionsProcesser;
|
7
|
+
|
8
|
+
var _path = require("path");
|
9
|
+
|
10
|
+
var _decidePublicPath = require("../../shared/bundler/webpack/common/decidePublicPath");
|
11
|
+
|
12
|
+
var _urlConcat = require("../../shared/server/urlConcat");
|
13
|
+
|
14
|
+
function optionsProcesser(options) {
|
15
|
+
const {
|
16
|
+
server,
|
17
|
+
context
|
18
|
+
} = options;
|
19
|
+
const {
|
20
|
+
disableContextURL
|
21
|
+
} = server;
|
22
|
+
const serverExtras = (0, _decidePublicPath.modifiedServerOptions)(options);
|
23
|
+
const publicPath = (0, _decidePublicPath.decidePublicPath)(serverExtras);
|
24
|
+
const contextURL = disableContextURL ? '' : `/${context}`;
|
25
|
+
const serverURL = (0, _urlConcat.urlConcat)(publicPath, contextURL);
|
26
|
+
const contextFolderPath = (0, _path.join)(process.cwd(), context);
|
27
|
+
console.log({
|
28
|
+
serverURL,
|
29
|
+
publicPath
|
30
|
+
});
|
31
|
+
const defaultApplyedOptions = { ...options,
|
32
|
+
serverExtras,
|
33
|
+
publicPath,
|
34
|
+
contextURL,
|
35
|
+
serverURL,
|
36
|
+
contextFolderPath,
|
37
|
+
httpsOptions: serverExtras.httpsOptions
|
38
|
+
};
|
39
|
+
return defaultApplyedOptions;
|
40
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.commandExecutor = commandExecutor;
|
7
|
+
|
8
|
+
var _spanSync = require("../../shared/commands-utlis/spanSync");
|
9
|
+
|
10
|
+
var _constants = require("../../shared/constants");
|
11
|
+
|
12
|
+
function commandExecutor(options) {
|
13
|
+
const {
|
14
|
+
extraArgs
|
15
|
+
} = options;
|
16
|
+
(0, _spanSync.spawnSyncIO)("babel", ["src", "--out-dir", "es", "--copy-files", "--config-file=" + _constants.babelrcPath, ...extraArgs]);
|
17
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.commandExecutor = commandExecutor;
|
7
|
+
|
8
|
+
var _spanSync = require("../../shared/commands-utlis/spanSync");
|
9
|
+
|
10
|
+
var _constants = require("../../shared/constants");
|
11
|
+
|
12
|
+
function commandExecutor(options) {
|
13
|
+
const {
|
14
|
+
extraArgs
|
15
|
+
} = options;
|
16
|
+
(0, _spanSync.spawnSyncIO)("babel", ["src", "--out-dir", "lib", "--copy-files", "--config-file=" + _constants.babelrcPath, ...extraArgs]);
|
17
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.commandExecutor = commandExecutor;
|
7
|
+
|
8
|
+
var _serverBywebpackDevMiddleware = require("../../shared/server/serverBywebpackDevMiddleware");
|
9
|
+
|
10
|
+
function commandExecutor(options) {
|
11
|
+
// require("../../shared/server/devServer").run(options);
|
12
|
+
(0, _serverBywebpackDevMiddleware.run)(options);
|
13
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.deprecationHandler = deprecationHandler;
|
7
|
+
|
8
|
+
function deprecationHandler(options) {// options.app.deprecated &&
|
9
|
+
// console.log('options.app.deprecated this option was deprecated since V1.3.1' );
|
10
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.optionsProcesser = optionsProcesser;
|
7
|
+
|
8
|
+
var _path = require("path");
|
9
|
+
|
10
|
+
var _decidePublicPath = require("../../shared/bundler/webpack/common/decidePublicPath");
|
11
|
+
|
12
|
+
var _urlConcat = require("../../shared/server/urlConcat");
|
13
|
+
|
14
|
+
function optionsProcesser(options) {
|
15
|
+
const {
|
16
|
+
server,
|
17
|
+
context
|
18
|
+
} = options;
|
19
|
+
const {
|
20
|
+
disableContextURL
|
21
|
+
} = server;
|
22
|
+
const serverExtras = (0, _decidePublicPath.modifiedServerOptions)(options);
|
23
|
+
const publicPath = (0, _decidePublicPath.decidePublicPath)(serverExtras);
|
24
|
+
const contextURL = disableContextURL ? '' : `/${context}`;
|
25
|
+
const serverURL = (0, _urlConcat.urlConcat)(publicPath, contextURL);
|
26
|
+
const contextFolderPath = (0, _path.join)(process.cwd(), context);
|
27
|
+
const defaultApplyedOptions = { ...options,
|
28
|
+
serverExtras,
|
29
|
+
publicPath,
|
30
|
+
contextURL,
|
31
|
+
serverURL,
|
32
|
+
contextFolderPath,
|
33
|
+
httpsOptions: serverExtras.httpsOptions
|
34
|
+
};
|
35
|
+
return defaultApplyedOptions;
|
36
|
+
}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.route = route;
|
7
|
+
|
8
|
+
var _fs = require("fs");
|
9
|
+
|
10
|
+
var _path = require("path");
|
11
|
+
|
12
|
+
var _allCommandsConfigs = _interopRequireDefault(require("./allCommandsConfigs"));
|
13
|
+
|
14
|
+
var _buildToolLoggers = require("./buildToolLoggers");
|
15
|
+
|
16
|
+
var _readOptions = require("./shared/schemas/readOptions");
|
17
|
+
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
|
+
|
20
|
+
function runCommand(commandConfig) {
|
21
|
+
const options = (0, _readOptions.getOptions)();
|
22
|
+
const {
|
23
|
+
dirname
|
24
|
+
} = commandConfig;
|
25
|
+
|
26
|
+
function runRespectiveFile(name, data) {
|
27
|
+
const commandExecutorPath = (0, _path.join)(dirname, name + ".js");
|
28
|
+
|
29
|
+
if ((0, _fs.existsSync)(commandExecutorPath)) {
|
30
|
+
const commandExecutor = require(commandExecutorPath);
|
31
|
+
|
32
|
+
return (commandExecutor[name] || commandExecutor.default)(data);
|
33
|
+
} else {
|
34
|
+
(0, _buildToolLoggers.debugLogger)("file not found", commandExecutorPath);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
const processedOption = runRespectiveFile("optionsProcesser", options) || options;
|
39
|
+
runRespectiveFile("deprecationHandler", processedOption); // runRespectiveFile("errorHandler", () => {
|
40
|
+
|
41
|
+
runRespectiveFile("preProcesser", processedOption);
|
42
|
+
runRespectiveFile("commandExecutor", processedOption);
|
43
|
+
runRespectiveFile("postProcesser", processedOption); // });
|
44
|
+
}
|
45
|
+
|
46
|
+
function route(option, args) {
|
47
|
+
// TODO: need to modify this log
|
48
|
+
(0, _buildToolLoggers.debugLogger)("the command was " + option, args);
|
49
|
+
const commandConfig = findCommandConfig(option);
|
50
|
+
|
51
|
+
if (commandConfig) {
|
52
|
+
try {
|
53
|
+
runCommand(commandConfig);
|
54
|
+
} catch (error) {
|
55
|
+
console.error(error);
|
56
|
+
}
|
57
|
+
} else {
|
58
|
+
// TODO: need to write proper error message
|
59
|
+
(0, _buildToolLoggers.warnLogger)("Un known command", option, "please check the document");
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
function findCommandConfig(option) {
|
64
|
+
for (const commandConfig of _allCommandsConfigs.default) {
|
65
|
+
if (commandConfig.name === option || commandConfig.alias.includes(option)) {
|
66
|
+
return commandConfig;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
return null;
|
71
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.decidePublicPath = decidePublicPath;
|
7
|
+
exports.modifiedServerOptions = modifiedServerOptions;
|
8
|
+
|
9
|
+
var _getServerURL = require("../../../server/getServerURL");
|
10
|
+
|
11
|
+
var _httpsOptions = require("../../../server/httpsOptions");
|
12
|
+
|
13
|
+
function decidePublicPath(serverExtras) {
|
14
|
+
return serverExtras.isHttps ? serverExtras.httpsUrl : serverExtras.httpUrl;
|
15
|
+
}
|
16
|
+
|
17
|
+
function modifiedServerOptions(options) {
|
18
|
+
const {
|
19
|
+
server
|
20
|
+
} = options;
|
21
|
+
const {
|
22
|
+
port
|
23
|
+
} = server;
|
24
|
+
const httpsOptions = (0, _httpsOptions.httpsOptionsWithUserFriendlyError)(options);
|
25
|
+
const machineDomain = (0, _getServerURL.getServerDomain)(server);
|
26
|
+
const httpPort = port + 1;
|
27
|
+
return {
|
28
|
+
httpsOptions,
|
29
|
+
machineDomain,
|
30
|
+
httpsPort: port,
|
31
|
+
httpPort,
|
32
|
+
httpsUrl: (0, _getServerURL.getServerUrl)({
|
33
|
+
domain: machineDomain,
|
34
|
+
port,
|
35
|
+
protocol: 'https'
|
36
|
+
}),
|
37
|
+
httpUrl: (0, _getServerURL.getServerUrl)({
|
38
|
+
domain: machineDomain,
|
39
|
+
port: httpPort,
|
40
|
+
protocol: 'http'
|
41
|
+
}),
|
42
|
+
isHttps: !!httpsOptions
|
43
|
+
};
|
44
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.libAlias = void 0;
|
7
|
+
// the reason for alias at the time was code tree shaking
|
8
|
+
// tree shaking was most compactable with ES module system
|
9
|
+
// FIXME: But there is a posiblity when these package does not have lib,
|
10
|
+
// app will work because of alias, But may be jest won't work because of not alais
|
11
|
+
// So need to think about use alais in jest
|
12
|
+
const libAlias = {
|
13
|
+
'@zohodesk/components/lib': '@zohodesk/components/es',
|
14
|
+
// '@zohodesk/zc-custom/lib': '@zohodesk/zc-custom/es',
|
15
|
+
'@zohodesk/dot/lib': '@zohodesk/dot/es',
|
16
|
+
'@zohodesk/i18n/lib': '@zohodesk/i18n/es',
|
17
|
+
'@zohodesk/icons/lib': '@zohodesk/icons/es',
|
18
|
+
'@zohodesk/normalizer/lib': '@zohodesk/normalizer/es',
|
19
|
+
'@zohodesk/perf-components/lib': '@zohodesk/perf-components/es',
|
20
|
+
'@zohodesk/perf-middleware/lib': '@zohodesk/perf-middleware/es',
|
21
|
+
'@zohodesk/permissions/lib': '@zohodesk/permissions/es',
|
22
|
+
'@zohodesk/platform-middleware/lib': '@zohodesk/platform-middleware/es',
|
23
|
+
'@zohodesk/react-dnd/lib': '@zohodesk/react-dnd/es',
|
24
|
+
'@zohodesk/router-middleware/lib': '@zohodesk/router-middleware/es',
|
25
|
+
'@zohodesk/storage/lib': '@zohodesk/storage/es',
|
26
|
+
'@zohodesk/svg/lib': '@zohodesk/svg/es',
|
27
|
+
'@zohodesk/timetracker/lib': '@zohodesk/timetracker/es',
|
28
|
+
'@zohodesk/variables/lib': '@zohodesk/variables/es',
|
29
|
+
'@zohodesk/virtualizer/lib': '@zohodesk/virtualizer/es'
|
30
|
+
};
|
31
|
+
exports.libAlias = libAlias;
|