@zohodesk/react-cli 1.1.29-exp.2 → 1.1.29-exp.3
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/README.md +18 -0
- package/lib/babel/babel-option-utils/babel-preset-react-option.js +3 -0
- package/lib/babel/cmjs-plugins-presets.js +13 -2
- package/lib/babel/es-plugins-presets.js +14 -3
- package/lib/common/buildEs.js +0 -1
- package/lib/common/getEntries.js +13 -2
- package/lib/common/getPublicPathConfig.js +6 -0
- package/lib/common/index.js +6 -1
- package/lib/common/runPreProcess.js +15 -6
- package/lib/common/splitChunks.js +21 -2
- package/lib/common/sslcertUpdater.js +18 -7
- package/lib/common/templateParameters.js +2 -0
- package/lib/common/testPattern.js +21 -10
- package/lib/common/valueReplacer.js +16 -1
- package/lib/configs/jest.config.js +11 -2
- package/lib/configs/libAlias.js +16 -10
- package/lib/configs/resolvers.js +16 -6
- package/lib/configs/webpack.component.umd.config.js +6 -1
- package/lib/configs/webpack.css.umd.config.js +14 -6
- package/lib/configs/webpack.dev.config.js +14 -1
- package/lib/configs/webpack.docs.config.js +9 -1
- package/lib/configs/webpack.impact.config.js +8 -1
- package/lib/configs/webpack.prod.config.js +17 -4
- package/lib/constants.js +18 -9
- package/lib/deprecationLogger.js +7 -0
- package/lib/hooks/docsProptypeHook.js +8 -4
- package/lib/jest/commitedFilesResult.js +46 -4
- package/lib/jest/coverageCollector.js +12 -1
- package/lib/jest/jsonMaker.js +6 -0
- package/lib/jest/preProcessors/cssPreprocessor.js +9 -1
- package/lib/jest/preProcessors/jsPreprocessor.js +11 -2
- package/lib/jest/preProcessors/otherFilesPreprocessor.js +4 -1
- package/lib/jest/result.js +23 -1
- package/lib/jest/run.js +18 -7
- package/lib/jest/setup.js +60 -8
- package/lib/loaderUtils/configsAssetsLoaders.js +12 -2
- package/lib/loaderUtils/getCSSLoaders.js +22 -10
- package/lib/loaderUtils/getDevJsLoaders.js +13 -4
- package/lib/loaderUtils/index.js +4 -1
- package/lib/loaderUtils/tests/windowsModification.test.js +1 -0
- package/lib/loaderUtils/windowsModification.js +3 -2
- package/lib/loaders/__test__/markdownLoader.spec.js +1 -0
- package/lib/loaders/composeLoader.js +37 -13
- package/lib/loaders/docsLoader.js +12 -1
- package/lib/loaders/docsPropsLoader.js +8 -4
- package/lib/loaders/enhancedReactLiveConverter.js +23 -2
- package/lib/loaders/fileBountryLoader.js +3 -1
- package/lib/loaders/fileLoader.js +23 -12
- package/lib/loaders/markdownLoader.js +19 -14
- package/lib/loaders/reactLiveConvertor.js +15 -5
- package/lib/loaders/scriptInstrumentLoader.js +16 -7
- package/lib/loaders/selectorMappingLoader.js +26 -7
- package/lib/loaders/workerLoader.js +24 -9
- package/lib/logger.js +4 -0
- package/lib/middlewares/HMRMiddleware.js +27 -13
- package/lib/middlewares/SSTMiddleware.js +5 -1
- package/lib/pluginUtils/configHtmlWebpackPlugins.js +24 -1
- package/lib/pluginUtils/getDevPlugins.js +42 -9
- package/lib/pluginUtils/getDocsPlugins.js +13 -3
- package/lib/pluginUtils/getLibraryImactPlugins.js +6 -5
- package/lib/pluginUtils/getLibraryPlugins.js +8 -2
- package/lib/pluginUtils/getProdPlugins.js +47 -8
- package/lib/pluginUtils/getServerPlugins.js +8 -2
- package/lib/pluginUtils/getUMDCSSPlugins.js +10 -2
- package/lib/pluginUtils/getUMDComponentPlugins.js +10 -2
- package/lib/pluginUtils/index.js +9 -1
- package/lib/plugins/CdnChangePlugin.js +18 -2
- package/lib/plugins/CleanupStatsPlugin.js +5 -0
- package/lib/plugins/CssOrderControlPlugin.js +6 -3
- package/lib/plugins/CustomAttributePlugin.js +19 -14
- package/lib/plugins/CustomScriptLoadingStrategyPlugin.js +23 -3
- package/lib/plugins/EFCPlugin.js +34 -20
- package/lib/plugins/EFCTemplatePlugin.js +30 -19
- package/lib/plugins/EfcResourceCleanupPlugin.js +3 -0
- package/lib/plugins/EventsHandlingPlugin.js +4 -2
- package/lib/plugins/I18NInjectIntoIndexPlugin.js +37 -14
- package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +15 -10
- package/lib/plugins/I18nSplitPlugin/I18nDependency.js +10 -4
- package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +155 -78
- package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +81 -198
- package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +23 -12
- package/lib/plugins/I18nSplitPlugin/index.js +24 -13
- package/lib/plugins/I18nSplitPlugin/utils/collectI18nKeys.js +12 -2
- package/lib/plugins/I18nSplitPlugin/utils/getI18nFileUrlPathTemplate.js +1 -0
- package/lib/plugins/I18nSplitPlugin/utils/getI18nKeysFormModules.js +5 -0
- package/lib/plugins/I18nSplitPlugin/utils/hashUtils.js +8 -1
- package/lib/plugins/I18nSplitPlugin/utils/index.js +4 -0
- package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +20 -0
- package/lib/plugins/I18nSplitPlugin/utils/unicodeConversion.js +1 -0
- package/lib/plugins/ManifestPlugin.js +18 -1
- package/lib/plugins/MinifyPlugin.js +10 -1
- package/lib/plugins/ModuleStatsPlugin.js +24 -1
- package/lib/plugins/OptimizeJSPlugin.js +10 -2
- package/lib/plugins/PublicPathCallbackPlugin.js +12 -1
- package/lib/plugins/PublicPathChangePlugin.js +39 -6
- package/lib/plugins/ReportGeneratePlugin.js +32 -5
- package/lib/plugins/RequireVariablePublicPlugin.js +8 -1
- package/lib/plugins/ResourceHintsPlugin.js +13 -4
- package/lib/plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +17 -12
- package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +17 -10
- package/lib/plugins/RtlSplitPlugin/replaceCssDirTemplate.js +5 -2
- package/lib/plugins/ScriptInstrumentPlugin.js +8 -1
- package/lib/plugins/SelectorPlugin.js +32 -6
- package/lib/plugins/ServiceWorkerPlugin.js +22 -5
- package/lib/plugins/ShadowDOMSupportPlugin.js +41 -4
- package/lib/plugins/SourceMapHookPlugin.js +12 -2
- package/lib/plugins/StatsPlugin.js +14 -0
- package/lib/plugins/TPHashMappingPlugin.js +18 -3
- package/lib/plugins/UnusedFilesFindPlugin.js +39 -4
- package/lib/plugins/VariableConversionCollector.js +42 -15
- package/lib/plugins/index.js +20 -1
- package/lib/plugins/libraryImpactPlugin.js +33 -1
- package/lib/plugins/utils/classHandling.js +6 -0
- package/lib/plugins/utils/fileHandling.js +15 -6
- package/lib/plugins/utils/tests/fileHandling.test.js +4 -0
- package/lib/plugins/variableConvertorUtils.js +29 -14
- package/lib/plugins/webpackwatchrunplugin.js +5 -0
- package/lib/postcss-plugins/EmptyPlugin.js +4 -3
- package/lib/postcss-plugins/ExcludePlugin.js +5 -1
- package/lib/postcss-plugins/IncludePlugin.js +5 -1
- package/lib/postcss-plugins/RTLSplitPlugin.js +27 -14
- package/lib/postcss-plugins/SelectorReplace.js +16 -1
- package/lib/postcss-plugins/ValueReplacer.js +6 -7
- package/lib/postcss-plugins/__test__/hoverActivePlugin.spec.js +3 -0
- package/lib/postcss-plugins/__test__/selectorReplace.test.js +3 -6
- package/lib/postcss-plugins/__test__/valueReplacer.spec.js +5 -2
- package/lib/postcss-plugins/hoverActivePlugin.js +67 -31
- package/lib/postcss-plugins/variableModificationPlugin/ErrorHandler.js +7 -0
- package/lib/postcss-plugins/variableModificationPlugin/index.js +49 -28
- package/lib/schemas/index.js +10 -3
- package/lib/servers/clusterHubServer.js +11 -1
- package/lib/servers/devBuild.js +26 -14
- package/lib/servers/docsServer.js +3 -1
- package/lib/servers/docsServerCore.js +22 -1
- package/lib/servers/getCliPath.js +9 -0
- package/lib/servers/helpServer.js +6 -1
- package/lib/servers/httpsOptions.js +8 -2
- package/lib/servers/impactServer.js +35 -3
- package/lib/servers/mockserver.js +10 -1
- package/lib/servers/nowatchserver.js +37 -12
- package/lib/servers/requireLocalOrGlobal.js +17 -6
- package/lib/servers/scrServer.js +21 -14
- package/lib/servers/server.js +36 -6
- package/lib/servers/ssServer.js +17 -1
- package/lib/templates/CoverageScriptTemplate.js +14 -0
- package/lib/templates/WMSTemplate.js +13 -7
- package/lib/templates/linterConstant.js +4 -2
- package/lib/utils/babelPresets.js +7 -3
- package/lib/utils/clean.js +9 -3
- package/lib/utils/copy.js +7 -1
- package/lib/utils/copyTimezones.js +9 -1
- package/lib/utils/createEventStream.js +6 -1
- package/lib/utils/cssClassNameGenerate.js +30 -10
- package/lib/utils/cssURLReplacer.js +22 -1
- package/lib/utils/dependencyPostPublish.js +10 -1
- package/lib/utils/deprecationSupport.js +32 -7
- package/lib/utils/fileUtils.js +28 -1
- package/lib/utils/folderIterator.js +13 -2
- package/lib/utils/getComponents.js +21 -0
- package/lib/utils/getCurrentBranch.js +5 -0
- package/lib/utils/getDependenciesImpactList.js +22 -1
- package/lib/utils/getFileType.js +10 -2
- package/lib/utils/getHash.js +8 -1
- package/lib/utils/getIp.js +2 -0
- package/lib/utils/getOptions.js +53 -16
- package/lib/utils/getServerURL.js +10 -1
- package/lib/utils/index.js +51 -4
- package/lib/utils/init.js +1 -0
- package/lib/utils/initPreCommitHook.js +30 -7
- package/lib/utils/jsonHelper.js +22 -3
- package/lib/utils/libraryImpactConfig.js +5 -2
- package/lib/utils/lint/addScripts.js +5 -2
- package/lib/utils/lint/checkExistingConfig.js +12 -3
- package/lib/utils/lint/copyConfigs.js +3 -0
- package/lib/utils/lint/index.js +9 -0
- package/lib/utils/lint/lintScripts.js +1 -0
- package/lib/utils/lint/lintSetup.js +4 -3
- package/lib/utils/lint/lintStagedPreCommitHook.js +1 -0
- package/lib/utils/lint/question.js +7 -0
- package/lib/utils/lintReporter.js +20 -0
- package/lib/utils/log.js +1 -0
- package/lib/utils/mailSender.js +8 -1
- package/lib/utils/object-manipulation.js +17 -1
- package/lib/utils/pullOrigin.js +4 -0
- package/lib/utils/reinstallDependencies.js +29 -1
- package/lib/utils/removeAttributes.js +8 -1
- package/lib/utils/repoClone.js +28 -3
- package/lib/utils/request.js +12 -0
- package/lib/utils/rtl.js +17 -5
- package/lib/utils/selectorReplacer.js +16 -10
- package/lib/utils/setEnvVariables.js +2 -0
- package/lib/utils/ssTestHack.js +11 -1
- package/lib/utils/switchBranch.js +5 -0
- package/lib/utils/typeCheck.js +1 -0
- package/lib/utils/urlConcat.js +4 -0
- package/lib/utils/useExitCleanup.js +10 -9
- package/lib/utils/variableConverter.js +31 -22
- package/{package-lock.json → npm-shrinkwrap.json} +2333 -2101
- package/package.json +3 -2
- package/lib/plugins/I18nSplitPlugin/utils/applyMetaManifest.js +0 -279
- package/lib/plugins/I18nSplitPlugin/utils/createMetaManifest.js +0 -51
- package/lib/plugins/I18nSplitPlugin/utils/createRegularManifest.js +0 -48
- package/lib/plugins/newi18nsplitplugin/18nPlugin1.js +0 -306
- package/lib/plugins/newi18nsplitplugin/18nPlugin2.js +0 -363
- package/lib/plugins/newi18nsplitplugin/18nPlugin3.js +0 -694
- package/lib/plugins/newi18nsplitplugin/18nPlugin_hashed.js +0 -1258
- package/lib/plugins/newi18nsplitplugin/18nPlugin_working.js +0 -542
- package/lib/plugins/newi18nsplitplugin/18nplugin.js +0 -974
- package/lib/plugins/newi18nsplitplugin/ChunkManager.js +0 -131
- package/lib/plugins/newi18nsplitplugin/GenerateModuleIdToKeysMapPlugin.js +0 -59
- package/lib/plugins/newi18nsplitplugin/I18nDiffPlugin.js +0 -262
- package/lib/plugins/newi18nsplitplugin/I18nDownloadLogic.js +0 -166
- package/lib/plugins/newi18nsplitplugin/I18nPropertiesPlugin.js +0 -111
- package/lib/plugins/newi18nsplitplugin/KeyCollector.js +0 -163
- package/lib/plugins/newi18nsplitplugin/ManifestGenerator.js +0 -88
- package/lib/plugins/newi18nsplitplugin/UnicodeConversionPlugin.js +0 -101
- package/lib/plugins/newi18nsplitplugin/constants.js +0 -162
- package/lib/plugins/newi18nsplitplugin/utils/I18nKeyHasher.js +0 -78
- package/lib/plugins/newi18nsplitplugin/utils/getJsResourceKeys.js +0 -22
- package/lib/plugins/newi18nsplitplugin/utils/i18nChunkUtils.js +0 -18
- package/lib/plugins/newi18nsplitplugin/utils/manifestGenerator.js +0 -580
- package/lib/plugins/newi18nsplitplugin/utils/propertiesUtils.js +0 -54
package/README.md
CHANGED
@@ -44,6 +44,24 @@ Now to run app
|
|
44
44
|
|
45
45
|
# Change Logs
|
46
46
|
|
47
|
+
# 1.1.28 (29-01-2025)
|
48
|
+
|
49
|
+
**Fixes**
|
50
|
+
|
51
|
+
- We've changed the i18n Unicode conversion process. Instead of converting the Unicode at runtime, we now convert it to the corresponding language during the build process and emit the final build
|
52
|
+
- Added @zohodesk-private in transformIgnorePatterns in jest.config.js file , fix in jest
|
53
|
+
|
54
|
+
**changes**
|
55
|
+
|
56
|
+
- separate the disableES5Transpile flag as two flags disableES5Transpile and disableES5Import
|
57
|
+
- disableES5Import flag handles the alias part
|
58
|
+
- disableES5Transpile flag handles the esmodules or common modules conversion part
|
59
|
+
|
60
|
+
|
61
|
+
# 1.1.27 (16-12-2024)
|
62
|
+
|
63
|
+
- While rendering i18n keys at runtime, we convert any keys containing Unicode to their corresponding language characters before rendering. This enhances performance and reduces file size.
|
64
|
+
|
47
65
|
# 1.1.26 (06-09-2024)
|
48
66
|
|
49
67
|
**Features**
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = getReactPreset;
|
7
|
+
|
7
8
|
function getReactPresetOptions() {
|
8
9
|
return {
|
9
10
|
runtime: 'classic',
|
@@ -11,9 +12,11 @@ function getReactPresetOptions() {
|
|
11
12
|
useSpread: true
|
12
13
|
};
|
13
14
|
}
|
15
|
+
|
14
16
|
function getReactPreset({
|
15
17
|
disableES5Transpile
|
16
18
|
}) {
|
17
19
|
const reactPreset = require.resolve('@babel/preset-react');
|
20
|
+
|
18
21
|
return disableES5Transpile ? [reactPreset, getReactPresetOptions()] : reactPreset;
|
19
22
|
}
|
@@ -4,9 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
+
|
7
8
|
var _utils = require("../utils");
|
9
|
+
|
8
10
|
var _babelPresetReactOption = _interopRequireDefault(require("./babel-option-utils/babel-preset-react-option"));
|
9
|
-
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
10
14
|
const {
|
11
15
|
module: {
|
12
16
|
mode
|
@@ -26,17 +30,24 @@ const defaultPlugins = [[require.resolve('babel-plugin-transform-define'), isPro
|
|
26
30
|
}]];
|
27
31
|
const resolvedPlugins = [];
|
28
32
|
babelPlugins.forEach(plugin => {
|
29
|
-
|
33
|
+
if (Array.isArray(plugin)) {
|
34
|
+
resolvedPlugins.push([require.resolve(plugin[0]), plugin[1]]);
|
35
|
+
} else {
|
36
|
+
resolvedPlugins.push(require.resolve(plugin));
|
37
|
+
}
|
30
38
|
});
|
31
39
|
const plugins = [...defaultPlugins, ...resolvedPlugins];
|
32
40
|
const presets = [require.resolve('@babel/preset-env'), (0, _babelPresetReactOption.default)({
|
33
41
|
disableES5Transpile: false
|
34
42
|
})];
|
43
|
+
|
35
44
|
if (enableTypeScript) {
|
36
45
|
presets.push(require.resolve('@babel/preset-typescript'));
|
37
46
|
}
|
47
|
+
|
38
48
|
var _default = () => ({
|
39
49
|
presets: presets,
|
40
50
|
plugins: plugins
|
41
51
|
});
|
52
|
+
|
42
53
|
exports.default = _default;
|
@@ -4,9 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
+
|
7
8
|
var _utils = require("../utils");
|
9
|
+
|
8
10
|
var _babelPresetReactOption = _interopRequireDefault(require("./babel-option-utils/babel-preset-react-option"));
|
9
|
-
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
10
14
|
const {
|
11
15
|
module: {
|
12
16
|
mode,
|
@@ -22,12 +26,16 @@ const isProd = mode.toLowerCase() === 'prod';
|
|
22
26
|
const defaultPlugins = [[require.resolve('babel-plugin-transform-define'), isProd ? {
|
23
27
|
__DOCS__: false
|
24
28
|
} : {}], require.resolve('@babel/plugin-syntax-dynamic-import'), [require.resolve('babel-plugin-module-resolver'), {
|
25
|
-
|
29
|
+
'root': ['./'],
|
26
30
|
alias
|
27
31
|
}]];
|
28
32
|
const resolvedPlugins = [];
|
29
33
|
babelPlugins.forEach(plugin => {
|
30
|
-
|
34
|
+
if (Array.isArray(plugin)) {
|
35
|
+
resolvedPlugins.push([require.resolve(plugin[0]), plugin[1]]);
|
36
|
+
} else {
|
37
|
+
resolvedPlugins.push(require.resolve(plugin));
|
38
|
+
}
|
31
39
|
});
|
32
40
|
const plugins = [...defaultPlugins, ...resolvedPlugins];
|
33
41
|
const presets = [[require.resolve('@babel/preset-env'), disableES5Transpile ? {
|
@@ -42,11 +50,14 @@ const presets = [[require.resolve('@babel/preset-env'), disableES5Transpile ? {
|
|
42
50
|
}], (0, _babelPresetReactOption.default)({
|
43
51
|
disableES5Transpile
|
44
52
|
})];
|
53
|
+
|
45
54
|
if (enableTypeScript) {
|
46
55
|
presets.push(require.resolve('@babel/preset-typescript'));
|
47
56
|
}
|
57
|
+
|
48
58
|
var _default = () => ({
|
49
59
|
presets: presets,
|
50
60
|
plugins: plugins
|
51
61
|
});
|
62
|
+
|
52
63
|
exports.default = _default;
|
package/lib/common/buildEs.js
CHANGED
package/lib/common/getEntries.js
CHANGED
@@ -4,9 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
+
|
7
8
|
var _path = _interopRequireDefault(require("path"));
|
9
|
+
|
8
10
|
var _utils = require("../utils");
|
9
|
-
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
10
14
|
let getEntries = (appSchemas, mode) => {
|
11
15
|
let appPath = process.cwd();
|
12
16
|
let {
|
@@ -26,16 +30,23 @@ let getEntries = (appSchemas, mode) => {
|
|
26
30
|
let entry = {
|
27
31
|
main: mainJs
|
28
32
|
};
|
33
|
+
|
29
34
|
if (mode === 'dev' || mode === 'dev-no-warn') {
|
30
35
|
mainJs.push(`${_path.default.join(__dirname, '..', 'templates', 'WMSTemplate')}?wmsPath=wss:${(0, _utils.getServerURL)(server)}`);
|
31
36
|
}
|
37
|
+
|
32
38
|
mainJs.push(_path.default.join(appPath, folder, isReactMig ? 'migration.js' : 'index.js'));
|
39
|
+
|
33
40
|
if (hasWidget) {
|
34
41
|
entry.widget = [_path.default.join(appPath, folder, 'widget.js')];
|
35
42
|
}
|
43
|
+
|
36
44
|
if (hasEFC) {
|
37
45
|
entry.efc = [_path.default.join(appPath, folder, 'efc.js')];
|
38
46
|
}
|
47
|
+
|
39
48
|
return entry;
|
40
49
|
};
|
41
|
-
|
50
|
+
|
51
|
+
var _default = getEntries;
|
52
|
+
exports.default = _default;
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
+
|
7
8
|
var _utils = require("../utils");
|
9
|
+
|
8
10
|
let {
|
9
11
|
app: {
|
10
12
|
publicPaths,
|
@@ -18,8 +20,10 @@ let {
|
|
18
20
|
}
|
19
21
|
} = (0, _utils.getOptions)();
|
20
22
|
let isDevelopment = mode === 'dev' || mode === 'prod' || mode === 'dev-no-warn';
|
23
|
+
|
21
24
|
var _default = url => {
|
22
25
|
let type = (0, _utils.getFileType)(url);
|
26
|
+
|
23
27
|
if (!isDevelopment) {
|
24
28
|
if (publicPaths && publicPaths.callback) {
|
25
29
|
return `${publicPaths.callback}(${JSON.stringify(type)}) + ${JSON.stringify(url)}`;
|
@@ -29,6 +33,8 @@ var _default = url => {
|
|
29
33
|
return `__REACT_CLI_${type.toUpperCase()}_PUBLIC_PATH__ + ${JSON.stringify(url)}`;
|
30
34
|
}
|
31
35
|
}
|
36
|
+
|
32
37
|
return `__webpack_public_path__ + ${JSON.stringify(url)}`;
|
33
38
|
};
|
39
|
+
|
34
40
|
exports.default = _default;
|
package/lib/common/index.js
CHANGED
@@ -27,8 +27,13 @@ Object.defineProperty(exports, "templateParameters", {
|
|
27
27
|
return _templateParameters.default;
|
28
28
|
}
|
29
29
|
});
|
30
|
+
|
30
31
|
var _splitChunks = _interopRequireDefault(require("./splitChunks"));
|
32
|
+
|
31
33
|
var _getEntries = _interopRequireDefault(require("./getEntries"));
|
34
|
+
|
32
35
|
var _getPublicPathConfig = _interopRequireDefault(require("./getPublicPathConfig"));
|
36
|
+
|
33
37
|
var _templateParameters = _interopRequireDefault(require("./templateParameters"));
|
34
|
-
|
38
|
+
|
39
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
@@ -4,11 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.runPreProcess = runPreProcess;
|
7
|
+
|
7
8
|
var _path = _interopRequireWildcard(require("path"));
|
9
|
+
|
8
10
|
var _fs = require("fs");
|
11
|
+
|
9
12
|
var _child_process = require("child_process");
|
10
|
-
|
11
|
-
function
|
13
|
+
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
15
|
+
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
17
|
+
|
12
18
|
function runPreProcess({
|
13
19
|
options,
|
14
20
|
option,
|
@@ -20,20 +26,22 @@ function runPreProcess({
|
|
20
26
|
} = options;
|
21
27
|
const preprocessorPath = preprocess.runner ? _path.default.join(process.cwd(), preprocess.runner) : '';
|
22
28
|
const preprocessCli = preprocess.stopNodemon ? 'node' : nodemon;
|
29
|
+
|
23
30
|
if (preprocessorPath && (0, _fs.existsSync)(preprocessorPath)) {
|
24
31
|
const preprocessorDirPath = (0, _path.dirname)(preprocessorPath);
|
25
|
-
const watchOptions = preprocessCli === nodemon ? ['--watch', preprocessorDirPath] : [];
|
26
|
-
|
32
|
+
const watchOptions = preprocessCli === nodemon ? ['--watch', preprocessorDirPath] : []; // eslint-disable-next-line default-case
|
33
|
+
|
27
34
|
switch (option) {
|
28
35
|
case 'start':
|
29
36
|
case 'docs':
|
30
37
|
(0, _child_process.spawn)(preprocessCli, [preprocessorPath, ...watchOptions], {
|
31
38
|
stdio: 'inherit',
|
32
39
|
cwd: preprocessorDirPath
|
33
|
-
});
|
34
|
-
// NOTE: it's ok if we not close this here
|
40
|
+
}); // NOTE: it's ok if we not close this here
|
35
41
|
// Because when node server stops this program will be closed So this nodemon will be killed as well
|
42
|
+
|
36
43
|
break;
|
44
|
+
|
37
45
|
case 'nowatchstart':
|
38
46
|
case 'devbuild':
|
39
47
|
case 'build:library:es':
|
@@ -45,6 +53,7 @@ function runPreProcess({
|
|
45
53
|
cwd: preprocessorPath.slice(0, preprocessorPath.lastIndexOf('/') + 1)
|
46
54
|
});
|
47
55
|
break;
|
56
|
+
|
48
57
|
case 'preprocessor':
|
49
58
|
{
|
50
59
|
const result = spawnSync(preprocessCli, [preprocessorPath, ...watchOptions], {
|
@@ -4,11 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
+
|
7
8
|
var _path = _interopRequireDefault(require("path"));
|
9
|
+
|
8
10
|
var _os = _interopRequireDefault(require("os"));
|
11
|
+
|
9
12
|
var _utils = require("../utils");
|
13
|
+
|
10
14
|
var _testPattern = require("./testPattern");
|
11
|
-
|
15
|
+
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
|
+
|
12
18
|
const isWindows = _os.default.platform().toLowerCase() === 'win32';
|
13
19
|
const ps = _path.default.sep;
|
14
20
|
const options = (0, _utils.getOptions)();
|
@@ -23,29 +29,35 @@ const {
|
|
23
29
|
const reactBundleIncludeList = ['react', 'react-dom', 'react-redux', 'react-transition-group', 'scheduler', 'prop-types'];
|
24
30
|
const vendorExcludeList = ['script-loader', 'raw-loader', ...reactBundleIncludeList, ...vendorExclude.map(vendorPath => vendorPath.replace(/[/\\]/g, _path.default.sep))];
|
25
31
|
const vendorIncludeList = [...vendorInclude].map(vendorPath => vendorPath.replace(/[/\\]/g, _path.default.sep));
|
32
|
+
|
26
33
|
const isVendor = function isVendor(module) {
|
27
34
|
const {
|
28
35
|
userRequest
|
29
36
|
} = module;
|
30
37
|
return userRequest && (vendorIncludeList.some(item => userRequest.indexOf(item) !== -1) || userRequest.indexOf('node_modules') >= 0 && userRequest.endsWith('.css') === false && userRequest.endsWith('publicPathConfig.js') === false && vendorExcludeList.every(item => userRequest.indexOf(`node_modules${ps}${item}${ps}`) === -1));
|
31
38
|
};
|
39
|
+
|
32
40
|
const isReact = module => {
|
33
41
|
const {
|
34
42
|
userRequest
|
35
43
|
} = module;
|
36
44
|
return userRequest && reactBundleIncludeList.some(pkg => userRequest.indexOf(`node_modules${ps}${pkg}${ps}`) >= 0);
|
37
45
|
};
|
46
|
+
|
38
47
|
function rulesMatcher(pattern) {
|
39
48
|
if (typeof pattern === 'function') {
|
40
49
|
return pattern;
|
41
50
|
}
|
51
|
+
|
42
52
|
if (Array.isArray(pattern)) {
|
43
53
|
return ({
|
44
54
|
userRequest
|
45
55
|
}) => (0, _testPattern.testPattern)(userRequest, pattern);
|
46
56
|
}
|
57
|
+
|
47
58
|
return new RegExp(isWindows ? pattern.replace(/\//g, '\\') : pattern);
|
48
59
|
}
|
60
|
+
|
49
61
|
const baseSplitChunkConfig = Object.assign({
|
50
62
|
minSize: 15000
|
51
63
|
}, customChunksBaseConfig);
|
@@ -101,21 +113,27 @@ customChunks.map((obj, index) => ({
|
|
101
113
|
minChunks,
|
102
114
|
priority
|
103
115
|
};
|
116
|
+
|
104
117
|
if (minSize !== undefined) {
|
105
118
|
obj.minSize = minSize;
|
106
119
|
}
|
120
|
+
|
107
121
|
if (maxSize !== undefined) {
|
108
122
|
obj.maxSize = maxSize;
|
109
123
|
}
|
124
|
+
|
110
125
|
if (enforce !== false) {
|
111
126
|
obj.enforce = true;
|
112
127
|
}
|
128
|
+
|
113
129
|
if (name !== undefined) {
|
114
130
|
obj.name = name;
|
115
131
|
}
|
132
|
+
|
116
133
|
if (reuseExistingChunk !== undefined) {
|
117
134
|
obj.reuseExistingChunk = reuseExistingChunk;
|
118
135
|
}
|
136
|
+
|
119
137
|
customChunksConfig[cacheGroupName] = obj;
|
120
138
|
});
|
121
139
|
const splitChunkConfig = Object.assign({}, baseSplitChunkConfig, {
|
@@ -124,4 +142,5 @@ const splitChunkConfig = Object.assign({}, baseSplitChunkConfig, {
|
|
124
142
|
vendors: false
|
125
143
|
}, specificCacheGroupConfig, customChunksConfig)
|
126
144
|
});
|
127
|
-
var _default =
|
145
|
+
var _default = splitChunkConfig;
|
146
|
+
exports.default = _default;
|
@@ -1,16 +1,25 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _https = _interopRequireDefault(require("https"));
|
4
|
+
|
4
5
|
var _http = _interopRequireDefault(require("http"));
|
6
|
+
|
5
7
|
var _path = _interopRequireDefault(require("path"));
|
8
|
+
|
6
9
|
var _fs = _interopRequireDefault(require("fs"));
|
10
|
+
|
7
11
|
var _getOptions = _interopRequireDefault(require("../utils/getOptions"));
|
12
|
+
|
8
13
|
var _urlConcat = require("../utils/urlConcat");
|
9
|
-
|
14
|
+
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
16
|
+
|
10
17
|
const {
|
11
18
|
sslCertURL
|
12
19
|
} = (0, _getOptions.default)();
|
20
|
+
|
13
21
|
const CRET_FOLDER_PATH = _path.default.join(__dirname, '..', '..', 'cert');
|
22
|
+
|
14
23
|
console.log({
|
15
24
|
CRET_FOLDER_PATH,
|
16
25
|
sslCertURL
|
@@ -18,6 +27,7 @@ console.log({
|
|
18
27
|
const CERT_PATH = 'cert.pem';
|
19
28
|
const KEY_PATH = 'key.pem';
|
20
29
|
const PASSPHRASE_PATH = 'passphrase.pem';
|
30
|
+
|
21
31
|
function updateSSlFile(sslCertURL, filename) {
|
22
32
|
let url = (0, _urlConcat.urlConcat)(sslCertURL, filename);
|
23
33
|
console.log({
|
@@ -25,24 +35,25 @@ function updateSSlFile(sslCertURL, filename) {
|
|
25
35
|
});
|
26
36
|
(url.startsWith('https://') ? _https.default : _http.default).get(url, resp => {
|
27
37
|
let fpath = _path.default.join(CRET_FOLDER_PATH, filename);
|
28
|
-
|
29
|
-
// A chunk of data has been received.
|
38
|
+
|
39
|
+
let data = ''; // A chunk of data has been received.
|
40
|
+
|
30
41
|
resp.on('data', chunk => {
|
31
42
|
data += chunk;
|
32
|
-
});
|
43
|
+
}); // The whole response has been received. Print out the result.
|
33
44
|
|
34
|
-
// The whole response has been received. Print out the result.
|
35
45
|
resp.on('end', () => {
|
36
46
|
_fs.default.writeFileSync(fpath, data);
|
37
|
-
});
|
38
|
-
// return;
|
47
|
+
}); // return;
|
39
48
|
}).on('error', err => {
|
40
49
|
console.log(`Error: ${err.message}`);
|
41
50
|
});
|
42
51
|
}
|
52
|
+
|
43
53
|
if (!sslCertURL) {
|
44
54
|
throw 'sslCertURL not given';
|
45
55
|
}
|
56
|
+
|
46
57
|
updateSSlFile(sslCertURL, PASSPHRASE_PATH);
|
47
58
|
updateSSlFile(sslCertURL, CERT_PATH);
|
48
59
|
updateSSlFile(sslCertURL, KEY_PATH);
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
+
|
7
8
|
var _default = (compilation, assets, assetTags, options) => {
|
8
9
|
Object.keys(assetTags).forEach(rootTag => {
|
9
10
|
assetTags[rootTag].forEach(tag => {
|
@@ -20,4 +21,5 @@ var _default = (compilation, assets, assetTags, options) => {
|
|
20
21
|
}
|
21
22
|
};
|
22
23
|
};
|
24
|
+
|
23
25
|
exports.default = _default;
|
@@ -6,51 +6,62 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.isDependency = isDependency;
|
7
7
|
exports.isRelatedPackage = exports.isRelated = void 0;
|
8
8
|
exports.testPattern = testPattern;
|
9
|
+
|
9
10
|
var _path = require("path");
|
11
|
+
|
10
12
|
// in our development we only use windows, mac and linux
|
11
|
-
const isWindows = _path.sep !== '/';
|
13
|
+
const isWindows = _path.sep !== '/'; // this function will return true if pattern matched
|
12
14
|
|
13
|
-
// this function will return true if pattern matched
|
14
15
|
function _testPattern(req, pattern) {
|
15
16
|
let modifiedPattern = pattern;
|
17
|
+
|
16
18
|
if (/[*.$^]/.test(modifiedPattern)) {
|
17
19
|
if (isWindows) {
|
18
20
|
// modifiedPattern = pattern.replace(/\//g, ps.replace(/\\/g, '\\\\'));
|
19
21
|
modifiedPattern = modifiedPattern.replace(/\//g, '\\\\');
|
20
22
|
}
|
23
|
+
|
21
24
|
modifiedPattern = modifiedPattern.replace(/\./g, '\\.').replace(/\*/g, '.*');
|
22
25
|
const re = new RegExp(modifiedPattern);
|
23
26
|
return re.test(req);
|
24
27
|
}
|
28
|
+
|
25
29
|
if (isWindows) {
|
26
30
|
// modifiedPattern = pattern.replace(/\//g, ps.replace(/\\/g, '\\\\'));
|
27
31
|
modifiedPattern = modifiedPattern.replace(/\//g, '\\');
|
28
32
|
}
|
33
|
+
|
29
34
|
return req.indexOf(modifiedPattern) !== -1;
|
30
35
|
}
|
36
|
+
|
31
37
|
function testPattern(req, pattern) {
|
32
38
|
if (!req || !pattern) {
|
33
39
|
return false;
|
34
40
|
}
|
41
|
+
|
35
42
|
if (Array.isArray(pattern)) {
|
36
43
|
// eslint-disable-next-line no-unused-vars
|
37
44
|
return pattern.every(p => testPattern(req, p));
|
38
45
|
}
|
46
|
+
|
39
47
|
if (pattern[0] === '!') {
|
40
48
|
return !_testPattern(req, pattern.slice(1));
|
41
49
|
}
|
50
|
+
|
42
51
|
return _testPattern(req, pattern);
|
43
52
|
}
|
44
|
-
|
45
|
-
// export const isRelated = (req, item) => testPattern(req, item);
|
53
|
+
|
54
|
+
const isRelated = (req, item) => req && req.indexOf(item) !== -1; // export const isRelated = (req, item) => testPattern(req, item);
|
55
|
+
|
56
|
+
|
46
57
|
exports.isRelated = isRelated;
|
47
|
-
|
48
|
-
// export const isRelated = (req, item) => testPattern(req, item);
|
58
|
+
|
59
|
+
const isRelatedPackage = (req, item) => isRelated(req, `node_modules${_path.sep}${item}${_path.sep}`) !== -1; // export const isRelated = (req, item) => testPattern(req, item);
|
60
|
+
|
61
|
+
|
49
62
|
exports.isRelatedPackage = isRelatedPackage;
|
63
|
+
|
50
64
|
function isDependency(m, excludeList) {
|
51
65
|
return m.reasons.some(r => excludeList.some(item => r.module && isRelated(r.module.userRequest, item)));
|
52
|
-
}
|
53
|
-
|
54
|
-
// export function queryHandler(conditions, pattern) {
|
55
|
-
|
66
|
+
} // export function queryHandler(conditions, pattern) {
|
56
67
|
// }
|
@@ -1,36 +1,51 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _postcss = _interopRequireDefault(require("postcss"));
|
4
|
+
|
4
5
|
var _path = _interopRequireDefault(require("path"));
|
6
|
+
|
5
7
|
var _fs = _interopRequireDefault(require("fs"));
|
8
|
+
|
6
9
|
var _folderIterator = _interopRequireDefault(require("../utils/folderIterator"));
|
10
|
+
|
7
11
|
var _utils = require("../utils");
|
8
|
-
|
12
|
+
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
14
|
+
|
9
15
|
const cwd = process.cwd();
|
16
|
+
|
10
17
|
const src = _path.default.join(cwd, process.argv[2]);
|
18
|
+
|
11
19
|
const dist = _path.default.join(cwd, process.argv[3]);
|
20
|
+
|
12
21
|
const docopy = process.argv[4] === 'true';
|
13
22
|
const {
|
14
23
|
css: {
|
15
24
|
valueReplacer
|
16
25
|
}
|
17
26
|
} = (0, _utils.getOptions)();
|
27
|
+
|
18
28
|
if (!_fs.default.existsSync(dist)) {
|
19
29
|
_fs.default.mkdirSync(dist, {
|
20
30
|
recursive: true
|
21
31
|
});
|
22
32
|
}
|
33
|
+
|
23
34
|
(0, _folderIterator.default)(src, dist, docopy ? false : ['.css'], false, (fromPath, toPath) => {
|
24
35
|
const css = _fs.default.readFileSync(fromPath);
|
36
|
+
|
25
37
|
if (docopy && !fromPath.endsWith('.css')) {
|
26
38
|
_fs.default.writeFileSync(toPath, css);
|
39
|
+
|
27
40
|
return;
|
28
41
|
}
|
42
|
+
|
29
43
|
(0, _postcss.default)([valueReplacer && require('../postcss-plugins/ValueReplacer')(valueReplacer)]).process(css, {
|
30
44
|
from: fromPath,
|
31
45
|
to: toPath
|
32
46
|
}).then(result => {
|
33
47
|
_fs.default.writeFile(toPath, result.css, () => true);
|
48
|
+
|
34
49
|
if (result.map) {
|
35
50
|
_fs.default.writeFile(`${toPath}.map`, result.map, () => true);
|
36
51
|
}
|
@@ -1,11 +1,17 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _fs = require("fs");
|
4
|
+
|
4
5
|
var _path = _interopRequireDefault(require("path"));
|
6
|
+
|
5
7
|
var _libAlias = require("./libAlias");
|
6
|
-
|
8
|
+
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
10
|
+
|
7
11
|
const appPath = process.cwd();
|
12
|
+
|
8
13
|
const appGlobals = _path.default.resolve(appPath, '__testUtils__', 'globals.js');
|
14
|
+
|
9
15
|
const commonConfig = {
|
10
16
|
coverageReporters: ['json', 'html', 'json-summary', 'text'],
|
11
17
|
collectCoverage: true,
|
@@ -20,7 +26,7 @@ const commonConfig = {
|
|
20
26
|
// ...moduleNameMapper,
|
21
27
|
// '\\.(css|less)$': 'identity-obj-proxy'
|
22
28
|
// },
|
23
|
-
transformIgnorePatterns: ['/node_modules/(?!(@zohodesk)/)'],
|
29
|
+
transformIgnorePatterns: ['/node_modules/(?!(@zohodesk|@zohodesk-private)/)'],
|
24
30
|
// transformIgnorePatterns: ['/node_modules.*?.js$'],
|
25
31
|
moduleFileExtensions: ['js', 'ts', 'tsx'],
|
26
32
|
setupFiles: [(0, _fs.existsSync)(appGlobals) && appGlobals, _path.default.resolve(__dirname, '..', 'jest', 'setup.js')].filter(Boolean),
|
@@ -30,14 +36,17 @@ const commonConfig = {
|
|
30
36
|
__TEST__: true
|
31
37
|
}
|
32
38
|
};
|
39
|
+
|
33
40
|
module.exports = (...args) => {
|
34
41
|
const [appFolder, forCommittedFiles = false] = args;
|
42
|
+
|
35
43
|
if (forCommittedFiles) {
|
36
44
|
return Object.assign({}, commonConfig, {
|
37
45
|
coverageDirectory: _path.default.resolve(appPath, 'commitCoverage'),
|
38
46
|
testResultsProcessor: _path.default.resolve(__dirname, '..', 'jest', 'commitedFilesResult.js')
|
39
47
|
});
|
40
48
|
}
|
49
|
+
|
41
50
|
return Object.assign({}, commonConfig, {
|
42
51
|
rootDir: appPath,
|
43
52
|
testPathIgnorePatterns: ['/node_modules/', 'docs'],
|