@zohodesk/react-cli 1.1.18-exp.2 → 1.1.18-exp.4
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +6 -0
- package/bin/cli.js +0 -4
- package/lib/babel/babel-option-utils/babel-preset-react-option.js +22 -0
- package/lib/babel/cmjs-plugins-presets.js +12 -11
- package/lib/babel/es-plugins-presets.js +12 -12
- package/lib/configs/webpack.dev.config.js +0 -4
- package/lib/configs/webpack.prod.config.js +9 -6
- package/lib/loaderUtils/getDevJsLoaders.js +7 -2
- package/lib/schemas/index.js +0 -3
- package/npm-shrinkwrap.json +29 -1074
- package/package.json +1 -6
- 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
package/bin/cli.js
CHANGED
@@ -300,8 +300,6 @@ switch (option) {
|
|
300
300
|
'src',
|
301
301
|
'-d',
|
302
302
|
'lib',
|
303
|
-
'--extensions',
|
304
|
-
'.js,.ts,.tsx',
|
305
303
|
`--presets=${require.resolve('../lib/babel/cmjs-plugins-presets.js')}`,
|
306
304
|
'--copy-files'
|
307
305
|
].concat(args),
|
@@ -318,8 +316,6 @@ switch (option) {
|
|
318
316
|
'src',
|
319
317
|
'--out-dir',
|
320
318
|
'es',
|
321
|
-
'--extensions',
|
322
|
-
'.js,.ts,.tsx',
|
323
319
|
`--presets=${require.resolve('../lib/babel/es-plugins-presets.js')}`,
|
324
320
|
'--copy-files'
|
325
321
|
].concat(args),
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = getReactPreset;
|
7
|
+
|
8
|
+
function getReactPresetOptions() {
|
9
|
+
return {
|
10
|
+
runtime: 'classic',
|
11
|
+
// change it to 'automatic', when react version updated to 18.
|
12
|
+
useSpread: true
|
13
|
+
};
|
14
|
+
}
|
15
|
+
|
16
|
+
function getReactPreset({
|
17
|
+
disableES5Transpile
|
18
|
+
}) {
|
19
|
+
const reactPreset = require.resolve('@babel/preset-react');
|
20
|
+
|
21
|
+
return disableES5Transpile ? [reactPreset, getReactPresetOptions()] : reactPreset;
|
22
|
+
}
|
@@ -7,23 +7,24 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _utils = require("../utils");
|
9
9
|
|
10
|
-
|
10
|
+
var _babelPresetReactOption = _interopRequireDefault(require("./babel-option-utils/babel-preset-react-option"));
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
14
|
+
let {
|
11
15
|
module: {
|
12
16
|
mode
|
13
|
-
},
|
14
|
-
babelCustomizationForLibrary: {
|
15
|
-
babelPlugins
|
16
17
|
}
|
17
18
|
} = (0, _utils.getOptions)();
|
18
|
-
|
19
|
-
const defaultPlugins = [[require.resolve('babel-plugin-transform-define'), isProd ? {
|
20
|
-
__DOCS__: false
|
21
|
-
} : {}], require.resolve('@babel/plugin-syntax-dynamic-import'), require.resolve('@babel/plugin-proposal-optional-chaining'), require.resolve('@babel/plugin-proposal-class-properties')];
|
22
|
-
const plugins = [...babelPlugins, ...defaultPlugins];
|
19
|
+
let isProd = mode.toLowerCase() === 'prod';
|
23
20
|
|
24
21
|
var _default = () => ({
|
25
|
-
presets: [require.resolve('@babel/preset-env'),
|
26
|
-
|
22
|
+
presets: [require.resolve('@babel/preset-env'), (0, _babelPresetReactOption.default)({
|
23
|
+
disableES5Transpile: false
|
24
|
+
})],
|
25
|
+
plugins: [[require.resolve('babel-plugin-transform-define'), isProd ? {
|
26
|
+
__DOCS__: false
|
27
|
+
} : {}]]
|
27
28
|
});
|
28
29
|
|
29
30
|
exports.default = _default;
|
@@ -7,21 +7,17 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _utils = require("../utils");
|
9
9
|
|
10
|
-
|
10
|
+
var _babelPresetReactOption = _interopRequireDefault(require("./babel-option-utils/babel-preset-react-option"));
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
14
|
+
let {
|
11
15
|
module: {
|
12
16
|
mode,
|
13
17
|
disableES5Transpile
|
14
|
-
},
|
15
|
-
babelCustomizationForLibrary: {
|
16
|
-
babelPlugins
|
17
18
|
}
|
18
19
|
} = (0, _utils.getOptions)();
|
19
|
-
|
20
|
-
const defaultPlugins = [[require.resolve('babel-plugin-transform-define'), isProd ? {
|
21
|
-
__DOCS__: false
|
22
|
-
} : {}], require.resolve('@babel/plugin-syntax-dynamic-import'), require.resolve('@babel/plugin-proposal-optional-chaining'), require.resolve('@babel/plugin-proposal-class-properties')];
|
23
|
-
const plugins = [...babelPlugins, ...defaultPlugins];
|
24
|
-
console.log(disableES5Transpile);
|
20
|
+
let isProd = mode.toLowerCase() === 'prod';
|
25
21
|
|
26
22
|
var _default = () => ({
|
27
23
|
presets: [[require.resolve('@babel/preset-env'), disableES5Transpile ? {
|
@@ -33,8 +29,12 @@ var _default = () => ({
|
|
33
29
|
}
|
34
30
|
} : {
|
35
31
|
modules: false
|
36
|
-
}],
|
37
|
-
|
32
|
+
}], (0, _babelPresetReactOption.default)({
|
33
|
+
disableES5Transpile
|
34
|
+
})],
|
35
|
+
plugins: [[require.resolve('babel-plugin-transform-define'), isProd ? {
|
36
|
+
__DOCS__: false
|
37
|
+
} : {}], require.resolve('@babel/plugin-syntax-dynamic-import')]
|
38
38
|
});
|
39
39
|
|
40
40
|
exports.default = _default;
|
@@ -14,6 +14,8 @@ var _configsAssetsLoaders = require("../loaderUtils/configsAssetsLoaders");
|
|
14
14
|
|
15
15
|
var _resolvers = require("./resolvers");
|
16
16
|
|
17
|
+
var _babelPresetReactOption = _interopRequireDefault(require("../babel/babel-option-utils/babel-preset-react-option"));
|
18
|
+
|
17
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
18
20
|
|
19
21
|
// import TerserPlugin from 'terser-webpack-plugin';
|
@@ -127,8 +129,13 @@ module.exports = {
|
|
127
129
|
}
|
128
130
|
} : {
|
129
131
|
modules: false
|
130
|
-
}],
|
131
|
-
|
132
|
+
}], (0, _babelPresetReactOption.default)({
|
133
|
+
disableES5Transpile
|
134
|
+
})],
|
135
|
+
plugins: disableES5Transpile ? [removeAttribute ? require.resolve('../utils/removeAttributes') : false, require.resolve('@babel/plugin-syntax-dynamic-import'), require.resolve('babel-plugin-lodash'), // require.resolve(
|
136
|
+
// '@babel/plugin-proposal-object-rest-spread'
|
137
|
+
// ), REMOVING IT, BECAUSE WE ALREADY SUPPORT SPREAD SYNTAX FROM LIBRARIES.
|
138
|
+
shouldRemovePropTypes ? [require.resolve('babel-plugin-transform-react-remove-prop-types'), removePropTypes] : false, devConsoleExculde ? [require.resolve('babel-plugin-transform-remove-console'), {
|
132
139
|
exclude: ['error', 'log']
|
133
140
|
}] : 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
141
|
helpers: true,
|
@@ -230,10 +237,6 @@ module.exports = {
|
|
230
237
|
minimize: false
|
231
238
|
}
|
232
239
|
}]
|
233
|
-
}, {
|
234
|
-
test: /\.ts$/,
|
235
|
-
use: 'ts-loader',
|
236
|
-
include: _path.default.join(appPath, folder)
|
237
240
|
}, {
|
238
241
|
test: /\.worker.js$/,
|
239
242
|
use: {
|
@@ -7,6 +7,8 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _path = _interopRequireDefault(require("path"));
|
9
9
|
|
10
|
+
var _babelPresetReactOption = _interopRequireDefault(require("../babel/babel-option-utils/babel-preset-react-option"));
|
11
|
+
|
10
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
13
|
|
12
14
|
let getDevJsLoaders = options => {
|
@@ -40,8 +42,11 @@ let getDevJsLoaders = options => {
|
|
40
42
|
}
|
41
43
|
} : {
|
42
44
|
modules: false
|
43
|
-
}],
|
44
|
-
|
45
|
+
}], (0, _babelPresetReactOption.default)({
|
46
|
+
disableES5Transpile
|
47
|
+
})],
|
48
|
+
plugins: disableES5Transpile ? [require.resolve('@babel/plugin-syntax-dynamic-import'), require.resolve('babel-plugin-lodash'), // require.resolve('@babel/plugin-proposal-object-rest-spread'),
|
49
|
+
devConsoleExculde ? [require.resolve('babel-plugin-transform-remove-console'), {
|
45
50
|
exclude: ['error', 'log']
|
46
51
|
}] : null].filter(Boolean) : [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'), {
|
47
52
|
exclude: ['error', 'log']
|