@zohodesk/react-cli 1.1.16 → 1.1.18-exp.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +27 -0
- package/lib/babel/babel-option-utils/babel-preset-react-option.js +22 -0
- package/lib/babel/cmjs-plugins-presets.js +7 -1
- package/lib/babel/es-plugins-presets.js +7 -1
- package/lib/configs/webpack.dev.config.js +7 -2
- package/lib/configs/webpack.prod.config.js +9 -2
- package/lib/loaderUtils/getDevJsLoaders.js +5 -1
- package/lib/schemas/index.js +4 -0
- package/npm-shrinkwrap.json +42 -11
- package/package.json +4 -2
- 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
@@ -0,0 +1,44 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.configWebpackDevMiddleware = configWebpackDevMiddleware;
|
7
|
+
|
8
|
+
var _webpackDevMiddleware = _interopRequireDefault(require("webpack-dev-middleware"));
|
9
|
+
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
|
+
|
12
|
+
function configWebpackDevMiddleware({
|
13
|
+
publicPath,
|
14
|
+
writeToDisk,
|
15
|
+
enableDevCache,
|
16
|
+
disableWatch,
|
17
|
+
compress,
|
18
|
+
compiler
|
19
|
+
}) {
|
20
|
+
let webpackServerOptions = {
|
21
|
+
logLevel: 'error',
|
22
|
+
publicPath,
|
23
|
+
headers: {
|
24
|
+
'Access-Control-Allow-Origin': '*'
|
25
|
+
},
|
26
|
+
compress
|
27
|
+
};
|
28
|
+
|
29
|
+
if (enableDevCache) {
|
30
|
+
webpackServerOptions.headers['Cache-Control'] = 'public, max-age=604800';
|
31
|
+
}
|
32
|
+
|
33
|
+
if (disableWatch) {
|
34
|
+
webpackServerOptions.watchOptions = {
|
35
|
+
ignored: /./
|
36
|
+
};
|
37
|
+
}
|
38
|
+
|
39
|
+
if (writeToDisk) {
|
40
|
+
webpackServerOptions.writeToDisk = true;
|
41
|
+
}
|
42
|
+
|
43
|
+
return (0, _webpackDevMiddleware.default)(compiler, webpackServerOptions);
|
44
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.mockApiSupport = mockApiSupport;
|
7
|
+
|
8
|
+
var _httpProxyMiddleware = require("http-proxy-middleware");
|
9
|
+
|
10
|
+
function mockApiSupport(app, server) {
|
11
|
+
const {
|
12
|
+
mockPrefix,
|
13
|
+
mockPort
|
14
|
+
} = server;
|
15
|
+
app.use(mockPrefix, (0, _httpProxyMiddleware.createProxyMiddleware)({
|
16
|
+
target: 'ht' + `tp://localhost:${mockPort}`,
|
17
|
+
changeOrigin: true
|
18
|
+
}));
|
19
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.webpackConfig = webpackConfig;
|
7
|
+
|
8
|
+
var _webpack = _interopRequireDefault(require("webpack"));
|
9
|
+
|
10
|
+
var _compression = _interopRequireDefault(require("compression"));
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
14
|
+
function webpackConfig(mode, app) {
|
15
|
+
let config;
|
16
|
+
|
17
|
+
if (mode === 'prod') {
|
18
|
+
config = require('../../../src/configs/webpack.prod.config');
|
19
|
+
app.use((0, _compression.default)());
|
20
|
+
} else if (mode === 'dev' || mode === 'dev-no-warn') {
|
21
|
+
config = require('../../../src/configs/webpack.dev.config');
|
22
|
+
} else {
|
23
|
+
throw new Error('You must configure valid option in mode');
|
24
|
+
} // console.log({ contextURL });
|
25
|
+
|
26
|
+
|
27
|
+
let compiler = (0, _webpack.default)(config);
|
28
|
+
return {
|
29
|
+
config,
|
30
|
+
compiler
|
31
|
+
};
|
32
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.websocketMockSetup = websocketMockSetup;
|
7
|
+
|
8
|
+
var _path = _interopRequireDefault(require("path"));
|
9
|
+
|
10
|
+
var _ws = _interopRequireDefault(require("ws"));
|
11
|
+
|
12
|
+
var _utils = require("../../../src/utils");
|
13
|
+
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
|
+
|
16
|
+
function websocketMockSetup(app, httpsServer) {
|
17
|
+
app.use('/wms/*', (req, res) => {
|
18
|
+
res.sendFile(_path.default.join(__dirname, '..', '..', 'templates', 'wms', 'index.html'));
|
19
|
+
});
|
20
|
+
const wss = new _ws.default.Server({
|
21
|
+
server: httpsServer
|
22
|
+
});
|
23
|
+
let wsPool = [];
|
24
|
+
wss.on('connection', ws => {
|
25
|
+
wsPool.push(ws);
|
26
|
+
ws.on('close', () => {
|
27
|
+
wsPool = wsPool.filter(ws1 => ws1 !== ws);
|
28
|
+
});
|
29
|
+
ws.on('message', message => {
|
30
|
+
(0, _utils.log)('received: %s', message);
|
31
|
+
});
|
32
|
+
ws.send('something');
|
33
|
+
});
|
34
|
+
app.post('/wmsmockapi', (req, res) => {
|
35
|
+
wsPool.forEach(ws => {
|
36
|
+
let {
|
37
|
+
body
|
38
|
+
} = req;
|
39
|
+
|
40
|
+
try {
|
41
|
+
ws.send(JSON.stringify(body));
|
42
|
+
} catch (e) {
|
43
|
+
(0, _utils.log)(e, body);
|
44
|
+
}
|
45
|
+
});
|
46
|
+
res.send('success');
|
47
|
+
});
|
48
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.urlConcat = urlConcat;
|
7
|
+
|
8
|
+
/**
|
9
|
+
*
|
10
|
+
* @param {String} url
|
11
|
+
* @param {String} path
|
12
|
+
*/
|
13
|
+
function removeLastSlash(url) {
|
14
|
+
return url.replace(/\/+$/, '');
|
15
|
+
}
|
16
|
+
|
17
|
+
function urlConcat(url, path) {
|
18
|
+
url = removeLastSlash(url);
|
19
|
+
path = removeFrontSlash(path);
|
20
|
+
return `${url}/${path}`;
|
21
|
+
}
|
22
|
+
|
23
|
+
function removeFrontSlash(url) {
|
24
|
+
return url.replace(/^\/+/, '');
|
25
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";
|