@zohodesk/react-cli 0.0.1-exp.175.1 → 0.0.1-exp.176.11
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +35 -40
- package/docs/SelectorWeight.md +6 -0
- package/docs/VariableConversion.md +33 -1
- package/lib/babel/cmjs-plugins-presets.js +4 -0
- package/lib/babel/es-plugins-presets.js +4 -0
- package/lib/common/getEntries.js +10 -0
- package/lib/common/getPublicPathConfig.js +6 -0
- package/lib/common/index.js +5 -0
- package/lib/common/splitChunks.js +13 -2
- package/lib/common/sslcertUpdater.js +17 -6
- package/lib/common/templateParameters.js +2 -0
- package/lib/common/testPattern.js +21 -10
- package/lib/common/valueReplacer.js +15 -0
- package/lib/configs/jest.config.js +9 -0
- package/lib/configs/libAlias.js +2 -4
- package/lib/configs/webpack.component.umd.config.js +5 -0
- package/lib/configs/webpack.css.umd.config.js +13 -5
- package/lib/configs/webpack.dev.config.js +36 -2
- package/lib/configs/webpack.docs.config.js +21 -1
- package/lib/configs/webpack.impact.config.js +19 -1
- package/lib/configs/webpack.prod.config.js +37 -3
- package/lib/hooks/docsProptypeHook.js +7 -3
- package/lib/jest/commitedFilesResult.js +45 -3
- package/lib/jest/coverageCollector.js +11 -0
- package/lib/jest/jsonMaker.js +6 -0
- package/lib/jest/preProcessors/cssPreprocessor.js +8 -0
- package/lib/jest/preProcessors/jsPreprocessor.js +2 -0
- package/lib/jest/preProcessors/otherFilesPreprocessor.js +3 -0
- package/lib/jest/result.js +22 -0
- package/lib/jest/run.js +17 -6
- package/lib/jest/setup.js +57 -5
- package/lib/loaderUtils/configsAssetsLoaders.js +11 -1
- package/lib/loaderUtils/getCSSLoaders.js +35 -20
- package/lib/loaderUtils/getDevJsLoaders.js +8 -0
- package/lib/loaderUtils/index.js +3 -0
- package/lib/loaderUtils/windowsModification.js +11 -0
- package/lib/loaders/docsLoader.js +7 -0
- package/lib/loaders/docsPropsLoader.js +7 -3
- package/lib/loaders/fileBountryLoader.js +2 -0
- package/lib/loaders/fileLoader.js +22 -11
- package/lib/loaders/scriptInstrumentLoader.js +13 -5
- package/lib/loaders/selectorMappingLoader.js +25 -7
- package/lib/loaders/workerLoader.js +20 -4
- package/lib/middlewares/HMRMiddleware.js +26 -13
- package/lib/middlewares/SSTMiddleware.js +3 -0
- package/lib/pluginUtils/configHtmlWebpackPlugins.js +9 -3
- package/lib/pluginUtils/getDevPlugins.js +63 -17
- package/lib/pluginUtils/getDocsPlugins.js +10 -1
- package/lib/pluginUtils/getLibraryImactPlugins.js +5 -4
- package/lib/pluginUtils/getLibraryPlugins.js +5 -0
- package/lib/pluginUtils/getProdPlugins.js +72 -23
- package/lib/pluginUtils/getServerPlugins.js +5 -0
- package/lib/pluginUtils/getUMDCSSPlugins.js +7 -0
- package/lib/pluginUtils/getUMDComponentPlugins.js +7 -0
- package/lib/pluginUtils/index.js +8 -0
- package/lib/plugins/CdnChangePlugin.js +14 -0
- package/lib/plugins/CleanupStatsPlugin.js +5 -0
- package/lib/plugins/EFCPlugin.js +34 -23
- package/lib/plugins/EFCTemplatePlugin.js +32 -23
- package/lib/plugins/I18NInjectIntoIndexPlugin.js +34 -8
- package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +17 -12
- package/lib/plugins/I18nSplitPlugin/I18nDependency.js +10 -4
- package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +39 -8
- package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +29 -14
- package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +22 -13
- package/lib/plugins/I18nSplitPlugin/index.js +23 -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 +6 -0
- package/lib/plugins/I18nSplitPlugin/utils/index.js +4 -0
- package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +20 -2
- package/lib/plugins/ManifestPlugin.js +17 -0
- package/lib/plugins/ModuleStatsPlugin.js +23 -0
- package/lib/plugins/OptimizeJSPlugin.js +7 -0
- package/lib/plugins/PublicPathCallbackPlugin.js +10 -0
- package/lib/plugins/PublicPathChangePlugin.js +36 -4
- package/lib/plugins/ReportGeneratePlugin.js +30 -4
- package/lib/plugins/RequireVariablePublicPlugin.js +6 -0
- package/lib/plugins/ResourceHintsPlugin.js +10 -3
- package/lib/plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +17 -12
- package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +16 -9
- package/lib/plugins/RtlSplitPlugin/replaceCssDirTemplate.js +5 -2
- package/lib/plugins/ScriptInstrumentPlugin.js +7 -0
- package/lib/plugins/SelectorPlugin.js +97 -0
- package/lib/plugins/ServiceWorkerPlugin.js +20 -4
- package/lib/plugins/ShadowDOMSupportPlugin.js +40 -3
- package/lib/plugins/SourceMapHookPlugin.js +9 -0
- package/lib/plugins/TPHashMappingPlugin.js +15 -1
- package/lib/plugins/UglifyCSSPlugin.js +9 -0
- package/lib/plugins/UnusedFilesFindPlugin.js +35 -2
- package/lib/plugins/VariableConversionCollector.js +252 -0
- package/lib/plugins/composeCommonPlugin.js +30 -0
- package/lib/plugins/index.js +19 -0
- package/lib/plugins/libraryImpactPlugin.js +32 -0
- package/lib/plugins/webpackwatchrunplugin.js +5 -0
- package/lib/postcss-plugins/ExcludePlugin.js +4 -0
- package/lib/postcss-plugins/RTLSplitPlugin.js +27 -14
- package/lib/postcss-plugins/ValueReplacer.js +6 -9
- package/lib/postcss-plugins/__test__/hoverActivePlugin.spec.js +3 -0
- package/lib/postcss-plugins/hoverActivePlugin.js +66 -30
- package/lib/postcss-plugins/variableModificationPlugin/ErrorHandler.js +40 -13
- package/lib/postcss-plugins/variableModificationPlugin/index.js +215 -141
- package/lib/postcss-plugins/variableModifier.js +20 -13
- package/lib/schemas/index.js +23 -4
- package/lib/servers/clusterHubServer.js +10 -0
- package/lib/servers/devBuild.js +24 -13
- package/lib/servers/docsServer.js +2 -0
- package/lib/servers/docsServerCore.js +21 -0
- package/lib/servers/getCliPath.js +9 -0
- package/lib/servers/helpServer.js +5 -0
- package/lib/servers/httpsOptions.js +4 -0
- package/lib/servers/impactServer.js +34 -2
- package/lib/servers/mockserver.js +9 -0
- package/lib/servers/nowatchserver.js +34 -12
- package/lib/servers/scrServer.js +20 -13
- package/lib/servers/server.js +35 -7
- package/lib/servers/ssServer.js +16 -0
- package/lib/templates/CoverageScriptTemplate.js +14 -0
- package/lib/templates/WMSTemplate.js +12 -6
- package/lib/utils/babelPresets.js +2 -0
- package/lib/utils/clean.js +8 -2
- package/lib/utils/copy.js +6 -0
- package/lib/utils/copyTimezones.js +8 -0
- package/lib/utils/createEventStream.js +4 -0
- package/lib/utils/cssClassNameGenerate.js +19 -3
- package/lib/utils/cssURLReplacer.js +50 -38
- package/lib/utils/dependencyPostPublish.js +9 -0
- package/lib/utils/fileUtils.js +26 -0
- package/lib/utils/folderIterator.js +10 -0
- package/lib/utils/getComponents.js +21 -0
- package/lib/utils/getCurrentBranch.js +5 -0
- package/lib/utils/getDependenciesImpactList.js +21 -0
- package/lib/utils/getFileType.js +49 -0
- package/lib/utils/getHash.js +7 -0
- package/lib/utils/getIp.js +2 -0
- package/lib/utils/getOptions.js +39 -14
- package/lib/utils/getServerURL.js +7 -0
- package/lib/utils/index.js +47 -2
- package/lib/utils/init.js +1 -0
- package/lib/utils/initPreCommitHook.js +29 -6
- package/lib/utils/jsonHelper.js +19 -2
- package/lib/utils/libraryImpactConfig.js +2 -0
- 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/mailSender.js +7 -0
- package/lib/utils/pullOrigin.js +4 -0
- package/lib/utils/reinstallDependencies.js +28 -0
- package/lib/utils/removeAttributes.js +7 -0
- package/lib/utils/repoClone.js +27 -2
- package/lib/utils/request.js +12 -0
- package/lib/utils/rtl.js +16 -4
- package/lib/utils/setEnvVariables.js +2 -0
- package/lib/utils/ssTestHack.js +10 -0
- package/lib/utils/switchBranch.js +4 -0
- package/lib/utils/urlConcat.js +4 -0
- package/lib/utils/useExitCleanup.js +10 -9
- package/package.json +10 -9
package/README.md
CHANGED
@@ -2,70 +2,67 @@
|
|
2
2
|
|
3
3
|
A CLI tool for build modern web application and libraries
|
4
4
|
|
5
|
-
# 0.0.1-exp.
|
6
|
-
|
7
|
-
**
|
8
|
-
|
9
|
-
|
5
|
+
# 0.0.1-exp.176.11
|
6
|
+
**Issue Fix:**
|
7
|
+
* When we use `react-cli.app.publicPaths.callback` this option and video files import, in place of publicPath url, **null** was there instead of file type `video` issue fixed.
|
8
|
+
|
9
|
+
# 0.0.1-beta.176
|
10
|
+
**Features:**
|
11
|
+
* we have added feature to **increase Selector weight** for all css classes in your project during build time.
|
12
|
+
To enable this feature you have to `react-cli.app.plugins.selectorWeight` set as `true` in **package.json**.
|
13
|
+
For more [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/SelectorWeight.md)
|
14
|
+
* Updates to variable replacement are given :
|
15
|
+
* css variables with -- are now supported due to the webpack plugin `VariableConversionCollector` that is generated for the same.
|
16
|
+
* `DECIMAL_CHECK`, `DECIMAL_REJECT` are two new errors supported.
|
17
|
+
* support for text-indent, clip, flex, flex-basis, row-gap, column-gap, gap properties are now given.
|
18
|
+
For an more information and reference, refer to `[details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/ValueReplaVariableConversioncer.md)
|
10
19
|
|
11
20
|
# 0.0.1-beta.175
|
12
|
-
|
13
21
|
**Issue Fix:-**
|
22
|
+
* When we use "hoverActive" @import in css not working issue fixed
|
14
23
|
|
15
|
-
|
16
|
-
|
17
|
-
**Features:**
|
18
|
-
|
19
|
-
- `minifiy` option supported for minimize index.html file in during build time. You can use this option as "react-cli.app.htmlTemplate.minify" the options are same as https://github.com/jantimon/html-webpack-plugin#minification
|
24
|
+
**Features:**
|
25
|
+
* `minifiy` option supported for minimize index.html file in during build time. You can use this option as "react-cli.app.htmlTemplate.minify" the options are same as https://github.com/jantimon/html-webpack-plugin#minification
|
20
26
|
|
21
27
|
# 0.0.1-beta.174
|
22
28
|
|
23
29
|
cli has been updated to fix compose issue faced when classname:hover exists and classname does not before compose
|
24
30
|
|
25
31
|
**Issue Fix:-**
|
32
|
+
* In react-cli version `0.0.1-beta.173`, when we use `start` command throws error issue fixed
|
33
|
+
* while using `cssVariableReplacementOptions`, compose issue faced in css files, when classname:hover exists and classname does not exist issue fixed
|
26
34
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
**Feature:-**
|
31
|
-
|
32
|
-
- `react-cli.test.classnameFormat` option added to change CssModules (Ex: import style from "./a.module.css" ) className transform template unittest case.
|
33
|
-
`classnameFormat` default value `[classname]` you can customize it. Example: `[classname]-[hash]`
|
35
|
+
**Feature:-**
|
36
|
+
* `react-cli.test.classnameFormat` option added to change CssModules (Ex: import style from "./a.module.css" ) className transform template unittest case.
|
37
|
+
`classnameFormat` default value `[classname]` you can customize it. Example: `[classname]-[hash]`
|
34
38
|
|
35
39
|
**Changes:-**
|
36
|
-
|
37
|
-
- `jsonFile_test_*.json` files deleted after they used.
|
40
|
+
* `jsonFile_test_*.json` files deleted after they used.
|
38
41
|
|
39
42
|
# 0.0.1-beta.173
|
40
43
|
|
41
|
-
|
42
|
-
|
43
|
-
**
|
44
|
+
**Features:**
|
45
|
+
* we have added feature to **convert px to custom variables** for all css files in your project during build time.
|
46
|
+
To enable this feature you have to set `react-cli.app.plugins.cssVariableReplacement` as `true` in **package.json**.
|
44
47
|
|
45
|
-
|
46
|
-
2. To enable the error log generation `errorLog` is to be made `true` in `cssVariableReplacementOptions.json` ( it will take a little longer than usual build time )
|
47
|
-
3. To enable the console display of errors that are generated, `errorInConsole` is to be made `true` in `cssVariableReplacementOptions.json`
|
48
|
-
4. To enable specific errors in the error log generation / error display on console, `DECLARATION_IGNORED`(for ignoring that particular line / declaration),`UNIT_ERROR` (when the Unit doesnt match the available units for the property),`RANGE_ERROR` (when the value does not fall within the range that is given for the property), `VARIABLE_PRESENT`(whether the value supposed to be in px for conversion sake is not converted from var() to px or if it's properly converted to px for conversion from px to var through our plugin) are to be individually made `true` in `cssVariableReplacementOptions.json`
|
48
|
+
Conversion for css Variables from Variables to px in Supportapp completed (`variableIgnore.js` && `pxParserPostcss.js` to be referred to), and px to custom variables through the new `variableModificationPlugin`. Error Log generation can also be converted on enabling
|
49
49
|
|
50
|
-
For an more information and reference, refer to
|
50
|
+
For an more information and reference, refer to `[details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/ValueReplaVariableConversioncer.md)
|
51
51
|
|
52
52
|
# 0.0.1-beta.172
|
53
|
-
|
54
53
|
We have renamed some options, For Our future features convenience.
|
55
54
|
We have given fallback support.
|
56
|
-
Deprecation Warnings:-
|
55
|
+
Deprecation Warnings:-
|
56
|
+
* `react-cli.app.hasRTL` ==> `react-cli.app.plugins.hasRTL`
|
57
|
+
* `react-cli.app.rtlExclude` ==> `react-cli.app.exclude.rtl`
|
57
58
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
- `react-cli.docs.hasRTL` ==> `react-cli.docs.plugins.hasRTL`
|
62
|
-
- `react-cli.docs.rtlExclude` ==> `react-cli.docs.exclude.rtl`
|
63
|
-
these options have fallback support.
|
59
|
+
* `react-cli.docs.hasRTL` ==> `react-cli.docs.plugins.hasRTL`
|
60
|
+
* `react-cli.docs.rtlExclude` ==> `react-cli.docs.exclude.rtl`
|
61
|
+
these options have fallback support.
|
64
62
|
|
65
63
|
# 0.0.1-beta.171
|
66
64
|
|
67
65
|
Features added :
|
68
|
-
|
69
66
|
1. `react-cli.app.mediaQueryHoverActiveString` and `react-cli.docs.mediaQueryHoverActiveString` templates support added for @media(hover: hover) and @media(hover: none) queries. We can modify these to modify respective queries.
|
70
67
|
|
71
68
|
# 0.0.1-beta.170
|
@@ -120,12 +117,10 @@ Changes:-
|
|
120
117
|
1. `enableChunkHash` option enabled for dev mode, use it as `react-cli.app.enableChunkHash` in `package.json`
|
121
118
|
2. `--enable_efc=true` option added to enable efc by terminal
|
122
119
|
3. unwanted pem files removed
|
123
|
-
|
124
120
|
# 0.0.1-exp.167.1
|
125
|
-
|
126
121
|
Features:-
|
122
|
+
* In docs we have added `Description` for Component Props- check out it in `PropTypes` tab
|
127
123
|
|
128
|
-
- In docs we have added `Description` for Component Props- check out it in `PropTypes` tab
|
129
124
|
|
130
125
|
# 0.0.1-beta.167
|
131
126
|
|
@@ -0,0 +1,6 @@
|
|
1
|
+
|
2
|
+
-- Selector weight plugin --
|
3
|
+
* Plugin implementation for the execution of a Selector weight to be added to all classes of multiple files is included in the react-cli setup. This can be activated when the `selectorWeight` variable in `package.json` is set to true.
|
4
|
+
* all classes in all files will be added with the `defaultSelector` provided in package.json to increase selector weight
|
5
|
+
* in case a specific chunk file is supposed to have a different selector, it can be mentioned in the `customFileSelectorWeight.json`. This will add the new selector to that particular chunk file.
|
6
|
+
* `excludeStrings` is an array used to exclude selectors that should not be converted. Default selectors such as body, html are excluded through this way.
|
@@ -1,5 +1,23 @@
|
|
1
1
|
# Variable Conversion
|
2
2
|
|
3
|
+
## Overview
|
4
|
+
|
5
|
+
Conversion for Variables from Variables to px in Supportapp completed (`variableIgnore.js` && `pxParserPostcss.js` to be referred to), and px to custom variables through the new `variableModificationPlugin`. Error Log generation can also be converted on enabling
|
6
|
+
|
7
|
+
**Features:**
|
8
|
+
below features are added form `0.0.1-beta.173`
|
9
|
+
1. variables are converted from px to custom variables ( options are consumed from `cssVariableReplacementOptions.json` present in source folder )
|
10
|
+
2. To enable the error log generation `errorLog` is to be made `true` in `cssVariableReplacementOptions.json` ( it will take a little longer than usual build time )
|
11
|
+
3. To enable the console display of errors that are generated, `errorInConsole` is to be made `true` in `cssVariableReplacementOptions.json`
|
12
|
+
4. To enable specific errors in the error log generation / error display on console, `DECLARATION_IGNORED`(for ignoring that particular line / declaration),`UNIT_ERROR` (when the Unit doesnt match the available units for the property),`RANGE_ERROR` (when the value does not fall within the range that is given for the property), `VARIABLE_PRESENT`(whether the value supposed to be in px for conversion sake is not converted from var() to px or if it's properly converted to px for conversion from px to var through our plugin) are to be individually made `true` in `cssVariableReplacementOptions.json`
|
13
|
+
|
14
|
+
below features are added form `0.0.1-beta.176`
|
15
|
+
|
16
|
+
* variables with -- are now supported due to the webpack plugin `VariableConversionCollector` that is generated for the same.
|
17
|
+
* `DECIMAL_CHECK`, `DECIMAL_REJECT` are two new errors supported.
|
18
|
+
* support for text-indent, clip, flex, flex-basis, row-gap, column-gap, gap properties are now given.
|
19
|
+
|
20
|
+
|
3
21
|
<!-- file paths :
|
4
22
|
|
5
23
|
# react - cli :
|
@@ -12,7 +30,7 @@ jsapps\supportapp\plugins\variableIgnore.js ( adding variable:ignore comment to
|
|
12
30
|
|
13
31
|
-->
|
14
32
|
|
15
|
-
# Added support for Properties ( Cut 1 ) :
|
33
|
+
# Added support for Properties ( Cut 1 ) : (0.0.1-beta.173)
|
16
34
|
|
17
35
|
* font-size
|
18
36
|
* margin
|
@@ -36,6 +54,16 @@ jsapps\supportapp\plugins\variableIgnore.js ( adding variable:ignore comment to
|
|
36
54
|
* min-height
|
37
55
|
* max-height
|
38
56
|
|
57
|
+
# Added support for Properties ( Cut 2 ) : (0.0.1-beta.176)
|
58
|
+
|
59
|
+
* text-indent
|
60
|
+
* clip
|
61
|
+
* flex
|
62
|
+
* flex-basis
|
63
|
+
* row-gap
|
64
|
+
* column-gap
|
65
|
+
* gap
|
66
|
+
|
39
67
|
# Css variable conversion consists of three steps :
|
40
68
|
|
41
69
|
. addition of comment variable:ignore for the seperation of values to be considered for the conversion and the ones that are not to be considered for conversion. ( `variableIgnore.js` )
|
@@ -659,6 +687,8 @@ Consider the below mentioned :
|
|
659
687
|
"DECLARATION_IGNORED" : true,
|
660
688
|
"UNIT_ERROR" : true,
|
661
689
|
"RANGE_ERROR" : true,
|
690
|
+
"DECIMAL_CHECK":true,
|
691
|
+
"DECIMAL_REJECT":true,
|
662
692
|
"VARIABLE_PRESENT" : true
|
663
693
|
},
|
664
694
|
```
|
@@ -671,6 +701,8 @@ Consider the below mentioned :
|
|
671
701
|
=> `DECLARATION_IGNORED` : Lines that succeed the /*Variable:Ignore*/ comment.
|
672
702
|
=> `UNIT_ERROR` : the units that are not present in the corresponding property's `allowed` array are used.
|
673
703
|
=> `RANGE_ERROR` : numerical values that are not present within the range of the corresponding property's `range` is used.
|
704
|
+
=> `DECIMAL_CHECK` : Decimal values containing . will be shown
|
705
|
+
=> `DECIMAL_REJECT` : Decimal values such as .em which are to be rejected are shown
|
674
706
|
=> `VARIABLE_PRESENT` : conversion to px (Step 2) wasn't done properly and hence there are residues that contain `var` in it are found.
|
675
707
|
|
676
708
|
|
@@ -4,17 +4,21 @@ 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
|
module: {
|
10
12
|
mode
|
11
13
|
}
|
12
14
|
} = (0, _utils.getOptions)();
|
13
15
|
let isProd = mode.toLowerCase() === 'prod';
|
16
|
+
|
14
17
|
var _default = () => ({
|
15
18
|
presets: [require.resolve('@babel/preset-env'), require.resolve('@babel/preset-react')],
|
16
19
|
plugins: [[require.resolve('babel-plugin-transform-define'), isProd ? {
|
17
20
|
__DOCS__: false
|
18
21
|
} : {}]]
|
19
22
|
});
|
23
|
+
|
20
24
|
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
|
module: {
|
10
12
|
mode,
|
@@ -12,6 +14,7 @@ let {
|
|
12
14
|
}
|
13
15
|
} = (0, _utils.getOptions)();
|
14
16
|
let isProd = mode.toLowerCase() === 'prod';
|
17
|
+
|
15
18
|
var _default = () => ({
|
16
19
|
presets: [[require.resolve('@babel/preset-env'), disableES5Transpile ? {
|
17
20
|
modules: false,
|
@@ -27,4 +30,5 @@ var _default = () => ({
|
|
27
30
|
__DOCS__: false
|
28
31
|
} : {}], require.resolve('@babel/plugin-syntax-dynamic-import')]
|
29
32
|
});
|
33
|
+
|
30
34
|
exports.default = _default;
|
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");
|
11
|
+
|
9
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,17 +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
|
};
|
50
|
+
|
41
51
|
var _default = getEntries;
|
42
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"));
|
38
|
+
|
34
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.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");
|
15
|
+
|
11
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
|
+
|
12
18
|
let isWindows = _os.default.platform().toLowerCase() === 'win32';
|
13
19
|
let ps = _path.default.sep;
|
14
20
|
let options = (0, _utils.getOptions)();
|
@@ -19,6 +25,7 @@ let {
|
|
19
25
|
vendorInclude
|
20
26
|
}
|
21
27
|
} = options;
|
28
|
+
|
22
29
|
let isVendor = function isVendor(module) {
|
23
30
|
let {
|
24
31
|
userRequest
|
@@ -27,6 +34,7 @@ let isVendor = function isVendor(module) {
|
|
27
34
|
excludeList = [...excludeList, ...vendorExclude];
|
28
35
|
return userRequest && (vendorInclude.some(item => userRequest.indexOf(item) !== -1) || userRequest.indexOf('node_modules') >= 0 && userRequest.endsWith('.css') === false && userRequest.endsWith('publicPathConfig.js') === false && excludeList.every(item => userRequest.indexOf(`node_modules${ps}${item}${ps}`) === -1));
|
29
36
|
};
|
37
|
+
|
30
38
|
let isReact = module => {
|
31
39
|
let {
|
32
40
|
userRequest
|
@@ -34,6 +42,7 @@ let isReact = module => {
|
|
34
42
|
let reactBundle = ['react', 'react-dom'];
|
35
43
|
return userRequest && reactBundle.some(pkg => userRequest.indexOf(`node_modules${ps}${pkg}${ps}`) >= 0);
|
36
44
|
};
|
45
|
+
|
37
46
|
let defaultChunks = {
|
38
47
|
'react.vendor': {
|
39
48
|
name: 'react.vendor',
|
@@ -86,8 +95,7 @@ customChunks.map((obj, index) => ({
|
|
86
95
|
const {
|
87
96
|
userRequest
|
88
97
|
} = m;
|
89
|
-
return (0, _testPattern.testPattern)(userRequest, rules);
|
90
|
-
// return (
|
98
|
+
return (0, _testPattern.testPattern)(userRequest, rules); // return (
|
91
99
|
// pkgs.some(p => isRelated(userRequest, p)) ||
|
92
100
|
// (includeDepenency && isDependency(m, pkgs))
|
93
101
|
// );
|
@@ -97,12 +105,15 @@ customChunks.map((obj, index) => ({
|
|
97
105
|
minChunks,
|
98
106
|
priority
|
99
107
|
};
|
108
|
+
|
100
109
|
if (minSize !== undefined) {
|
101
110
|
obj.minSize = minSize;
|
102
111
|
}
|
112
|
+
|
103
113
|
if (maxSize !== undefined) {
|
104
114
|
obj.maxSize = maxSize;
|
105
115
|
}
|
116
|
+
|
106
117
|
return customChunksConfig[name] = obj;
|
107
118
|
});
|
108
119
|
var _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");
|
14
|
+
|
9
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,53 +6,64 @@ 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 modifyedPattern = pattern;
|
17
|
+
|
16
18
|
if (/[*.$^]/.test(modifyedPattern)) {
|
17
19
|
if (isWindows) {
|
18
20
|
// modifyedPattern = pattern.replace(/\//g, ps.replace(/\\/g, '\\\\'));
|
19
21
|
modifyedPattern = modifyedPattern.replace(/\//g, '\\\\');
|
20
22
|
}
|
23
|
+
|
21
24
|
modifyedPattern = modifyedPattern.replace(/\./g, '\\.').replace(/\*/g, '.*');
|
22
25
|
const re = new RegExp(modifyedPattern);
|
23
26
|
return re.test(req);
|
24
27
|
}
|
28
|
+
|
25
29
|
if (isWindows) {
|
26
30
|
// modifyedPattern = pattern.replace(/\//g, ps.replace(/\\/g, '\\\\'));
|
27
31
|
modifyedPattern = modifyedPattern.replace(/\//g, '\\');
|
28
32
|
}
|
33
|
+
|
29
34
|
return req.indexOf(modifyedPattern) !== -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
|
// let reasons = m.reasons.map(r => r.module.userRequest);
|
52
66
|
// m.reasons.some(r => !r.module || !r.module.userRequest) && console.log(m.reasons);
|
53
67
|
return m.reasons.some(r => excludeList.some(item => r.module && isRelated(r.module.userRequest, item)));
|
54
|
-
}
|
55
|
-
|
56
|
-
// export function queryHandler(conditions, pattern) {
|
57
|
-
|
68
|
+
} // export function queryHandler(conditions, pattern) {
|
58
69
|
// }
|
@@ -1,38 +1,53 @@
|
|
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");
|
12
|
+
|
8
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
|
//console.log({ fromPath: fromPath, toPath: toPath });
|
25
36
|
let css = _fs.default.readFileSync(fromPath);
|
37
|
+
|
26
38
|
if (docopy && !fromPath.endsWith('.css')) {
|
27
39
|
//console.log(toPath,'....');
|
28
40
|
_fs.default.writeFileSync(toPath, css);
|
41
|
+
|
29
42
|
return;
|
30
43
|
}
|
44
|
+
|
31
45
|
(0, _postcss.default)([valueReplacer && require('../postcss-plugins/ValueReplacer')(valueReplacer)]).process(css, {
|
32
46
|
from: fromPath,
|
33
47
|
to: toPath
|
34
48
|
}).then(result => {
|
35
49
|
_fs.default.writeFile(toPath, result.css, () => true);
|
50
|
+
|
36
51
|
if (result.map) {
|
37
52
|
_fs.default.writeFile(`${toPath}.map`, result.map, () => true);
|
38
53
|
}
|
@@ -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");
|
8
|
+
|
6
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,
|
@@ -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'],
|
package/lib/configs/libAlias.js
CHANGED
@@ -9,7 +9,6 @@ exports.libAlias = exports.jestModuleNameMapper = void 0;
|
|
9
9
|
// FIXME: But there is a posiblity when these package does not have lib,
|
10
10
|
// app will work because of alias, But may be jest won't work because of not alais
|
11
11
|
// So need to think about use alais in jest
|
12
|
-
|
13
12
|
const libAlias = {
|
14
13
|
'@zohodesk/components/lib': '@zohodesk/components/es',
|
15
14
|
// '@zohodesk/zc-custom/lib': '@zohodesk/zc-custom/es',
|
@@ -28,10 +27,9 @@ const libAlias = {
|
|
28
27
|
'@zohodesk/timetracker/lib': '@zohodesk/timetracker/es',
|
29
28
|
'@zohodesk/variables/lib': '@zohodesk/variables/es',
|
30
29
|
'@zohodesk/virtualizer/lib': '@zohodesk/virtualizer/es'
|
31
|
-
};
|
32
|
-
|
33
|
-
// '^@root(.*)$': '<rootDir>/src$1',
|
30
|
+
}; // '^@root(.*)$': '<rootDir>/src$1',
|
34
31
|
// '^@components(.*)$': '<rootDir>/src/components$1',
|
32
|
+
|
35
33
|
exports.libAlias = libAlias;
|
36
34
|
const jestModuleNameMapper = Object.keys(libAlias).reduce((previousValue, key) => {
|
37
35
|
previousValue[`^${key}(.*)$`] = `${libAlias[key]}$1`;
|