@zohodesk/react-cli 0.0.1-beta.16 → 0.0.1-beta.160
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/.eslintignore +1 -0
- package/.eslintrc.js +46 -3
- package/CHANGELOG.md +5 -0
- package/README.md +650 -0
- package/bin/cli.js +134 -27
- package/cert/cert.pem +37 -129
- package/cert/key.pem +27 -27
- package/cert/passphrase.pem +1 -0
- package/files/eslintrc.js +62 -0
- package/files/prettierrc.js +3 -0
- package/lib/babel/cmjs-plugins-presets.js +16 -9
- package/lib/babel/es-plugins-presets.js +26 -14
- package/lib/common/getEntries.js +33 -24
- package/lib/common/getPublicPathConfig.js +40 -0
- package/lib/common/index.js +27 -13
- package/lib/common/splitChunks.js +64 -26
- package/lib/common/sslcertUpdater.js +59 -0
- package/lib/common/templateParameters.js +25 -0
- package/lib/configs/jest.config.js +18 -28
- package/lib/configs/webpack.component.umd.config.js +31 -37
- package/lib/configs/webpack.css.umd.config.js +44 -44
- package/lib/configs/webpack.dev.config.js +113 -57
- package/lib/configs/webpack.docs.config.js +104 -98
- package/lib/configs/webpack.impact.config.js +116 -0
- package/lib/configs/webpack.prod.config.js +154 -86
- package/lib/hooks/docsProptypeHook.js +32 -38
- package/lib/jest/commitedFilesResult.js +144 -71
- package/lib/jest/coverageCollector.js +62 -29
- package/lib/jest/jsonMaker.js +54 -0
- package/lib/jest/preProcessors/cssPreprocessor.js +16 -18
- package/lib/jest/preProcessors/jsPreprocessor.js +5 -6
- package/lib/jest/preProcessors/otherFilesPreprocessor.js +5 -6
- package/lib/jest/result.js +91 -41
- package/lib/jest/run.js +74 -27
- package/lib/jest/setup.js +103 -102
- package/lib/loaderUtils/getCSSLoaders.js +77 -0
- package/lib/loaderUtils/getDevJsLoaders.js +30 -23
- package/lib/loaderUtils/index.js +14 -7
- package/lib/loaders/docsLoader.js +15 -15
- package/lib/loaders/docsPropsLoader.js +14 -17
- package/lib/loaders/fileBountryLoader.js +17 -0
- package/lib/loaders/fileLoader.js +47 -38
- package/lib/loaders/scriptInstrumentLoader.js +21 -20
- package/lib/loaders/selectorMappingLoader.js +75 -0
- package/lib/loaders/workerLoader.js +136 -0
- package/lib/middlewares/HMRMiddleware.js +59 -41
- package/lib/middlewares/SSTMiddleware.js +21 -0
- package/lib/pluginUtils/getDevPlugins.js +173 -26
- package/lib/pluginUtils/getDocsPlugins.js +32 -17
- package/lib/pluginUtils/getLibraryImactPlugins.js +23 -0
- package/lib/pluginUtils/getLibraryPlugins.js +8 -10
- package/lib/pluginUtils/getProdPlugins.js +238 -37
- package/lib/pluginUtils/getServerPlugins.js +8 -11
- package/lib/pluginUtils/getUMDCSSPlugins.js +11 -15
- package/lib/pluginUtils/getUMDComponentPlugins.js +11 -15
- package/lib/pluginUtils/index.js +36 -43
- package/lib/plugins/CdnChangePlugin.js +77 -0
- package/lib/plugins/CleanupStatsPlugin.js +28 -0
- package/lib/plugins/EFCPlugin.js +211 -0
- package/lib/plugins/EFCPlugin.md +6 -0
- package/lib/plugins/I18NInjectIntoIndexPlugin.js +141 -0
- package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +60 -0
- package/lib/plugins/I18nSplitPlugin/I18nDependency.js +44 -0
- package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +266 -0
- package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +183 -0
- package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +100 -0
- package/lib/plugins/I18nSplitPlugin/I18nSplit.md +86 -0
- package/lib/plugins/I18nSplitPlugin/README.md +25 -0
- package/lib/plugins/I18nSplitPlugin/index.js +185 -0
- package/lib/plugins/I18nSplitPlugin/utils/collectI18nKeys.js +64 -0
- package/lib/plugins/I18nSplitPlugin/utils/getI18nFileUrlPathTemplate.js +13 -0
- package/lib/plugins/I18nSplitPlugin/utils/getI18nKeysFormModules.js +26 -0
- package/lib/plugins/I18nSplitPlugin/utils/hashUtils.js +40 -0
- package/lib/plugins/I18nSplitPlugin/utils/index.js +31 -0
- package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +112 -0
- package/lib/plugins/ManifestPlugin.js +52 -63
- package/lib/plugins/ModuleStatsPlugin.js +98 -97
- package/lib/plugins/OptimizeJSPlugin.js +24 -41
- package/lib/plugins/PublicPathCallbackPlugin.js +63 -0
- package/lib/plugins/PublicPathChangePlugin.js +187 -174
- package/lib/plugins/ReportGeneratePlugin.js +181 -0
- package/lib/plugins/RequireVariablePublicPlugin.js +30 -0
- package/lib/plugins/ResourceHintsPlugin.js +53 -35
- package/lib/plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +80 -0
- package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +82 -0
- package/lib/plugins/RtlSplitPlugin/RtrSplit.md +30 -0
- package/lib/plugins/RtlSplitPlugin/replaceCssDirTemplate.js +26 -0
- package/lib/plugins/ScriptInstrumentPlugin.js +22 -37
- package/lib/plugins/ServiceWorkerPlugin.js +107 -0
- package/lib/plugins/ShadowDOMSupportPlugin.js +270 -0
- package/lib/plugins/SourceMapHookPlugin.js +25 -31
- package/lib/plugins/TPHashMappingPlugin.js +67 -0
- package/lib/plugins/UglifyCSSPlugin.js +23 -30
- package/lib/plugins/UnusedFilesFindPlugin.js +150 -97
- package/lib/plugins/index.js +118 -55
- package/lib/plugins/libraryImpactPlugin.js +190 -0
- package/lib/plugins/webpackwatchrunplugin.js +26 -0
- package/lib/postcss-plugins/ExcludeRTLPlugin.js +23 -0
- package/lib/postcss-plugins/RTLSplitPlugin.js +138 -0
- package/lib/schemas/index.js +463 -52
- package/lib/servers/clusterHubServer.js +22 -26
- package/lib/servers/docsServer.js +3 -5
- package/lib/servers/docsServerCore.js +93 -85
- package/lib/servers/helpServer.js +19 -21
- package/lib/servers/httpsOptions.js +19 -0
- package/lib/servers/impactServer.js +99 -92
- package/lib/servers/mockserver.js +44 -0
- package/lib/servers/nowatchserver.js +275 -0
- package/lib/servers/scrServer.js +147 -0
- package/lib/servers/server.js +118 -124
- package/lib/servers/ssServer.js +107 -65
- package/lib/sh/reportPublish.sh +16 -10
- package/lib/templates/CoverageScriptTemplate.js +45 -18
- package/lib/templates/WMSTemplate.js +17 -18
- package/lib/templates/linterConstant.js +10 -0
- package/lib/utils/babelPresets.js +12 -5
- package/lib/utils/buildstats.html +148 -0
- package/lib/utils/clean.js +12 -11
- package/lib/utils/copy.js +13 -127
- package/lib/utils/copyTimezones.js +21 -0
- package/lib/utils/createEventStream.js +24 -19
- package/lib/utils/cssClassNameGenerate.js +70 -0
- package/lib/utils/cssURLReplacer.js +67 -54
- package/lib/utils/dependencyPostPublish.js +42 -0
- package/lib/utils/fileUtils.js +125 -0
- package/lib/utils/folderIterator.js +47 -0
- package/lib/utils/getComponents.js +126 -0
- package/lib/utils/getCurrentBranch.js +11 -17
- package/lib/utils/getDependenciesImpactList.js +151 -0
- package/lib/utils/getHash.js +26 -0
- package/lib/utils/getIp.js +20 -0
- package/lib/utils/getOptions.js +55 -30
- package/lib/utils/getServerURL.js +25 -8
- package/lib/utils/index.js +259 -82
- package/lib/utils/init.js +2 -2
- package/lib/utils/initPreCommitHook.js +40 -31
- package/lib/utils/jsonHelper.js +97 -0
- package/lib/utils/libraryImpactConfig.js +63 -0
- package/lib/utils/lint/addScripts.js +27 -0
- package/lib/utils/lint/checkExistingConfig.js +67 -0
- package/lib/utils/lint/copyConfigs.js +24 -0
- package/lib/utils/lint/index.js +54 -0
- package/lib/utils/lint/lintScripts.js +11 -0
- package/lib/utils/lint/lintSetup.js +31 -0
- package/lib/utils/lint/lintStagedPreCommitHook.js +7 -0
- package/lib/utils/lint/question.js +30 -0
- package/lib/utils/lintReporter.js +142 -0
- package/lib/utils/mailSender.js +16 -25
- package/lib/utils/pullOrigin.js +28 -0
- package/lib/utils/reinstallDependencies.js +133 -0
- package/lib/utils/removeAttributes.js +25 -23
- package/lib/utils/repoClone.js +56 -63
- package/lib/utils/request.js +64 -77
- package/lib/utils/resultSchema.json +73 -0
- package/lib/utils/rtl.js +42 -0
- package/lib/utils/setEnvVariables.js +5 -6
- package/lib/utils/ssTestHack.js +48 -0
- package/lib/utils/switchBranch.js +28 -0
- package/lib/utils/urlConcat.js +22 -0
- package/package.json +92 -64
- package/templates/app/.eslintrc.js +140 -0
- package/templates/app/README.md +12 -12
- package/templates/app/app/index.html +24 -8
- package/templates/app/app/properties/ApplicationResources_en_US.properties +1 -1
- package/templates/app/app/properties/i18nkeys.json +3 -3
- package/templates/app/docs/all.html +69 -69
- package/templates/app/mockapi/index.js +18 -13
- package/templates/app/package.json +37 -17
- package/templates/app/src/actions/SampleActions/index.js +37 -0
- package/templates/app/src/actions/index.js +65 -0
- package/templates/app/src/appUrls.js +19 -0
- package/templates/app/src/components/Alert/Alert.js +134 -0
- package/templates/app/src/components/Alert/Alert.module.css +79 -0
- package/templates/app/src/components/FreezeLayer/FreezeLayer.css +37 -0
- package/templates/app/src/components/FreezeLayer/FreezeLayer.js +84 -0
- package/templates/app/src/components/Sample/Sample.module.css +11 -0
- package/templates/app/src/components/Sample/SampleList.js +61 -0
- package/templates/app/src/components/Slider/Slider.css +41 -0
- package/templates/app/src/components/Slider/Slider.js +55 -0
- package/templates/app/src/containers/AlertContainer/index.js +15 -0
- package/templates/app/src/containers/AppContainer/index.js +96 -0
- package/templates/app/src/containers/AppContainer/index.module.css +27 -0
- package/templates/app/src/containers/CustomMatch/index.js +65 -0
- package/templates/app/src/containers/DevTools/index.js +10 -0
- package/templates/app/src/containers/Header/index.js +67 -0
- package/templates/app/src/containers/Header/index.module.css +43 -0
- package/templates/app/src/containers/Redirect/index.js +63 -0
- package/templates/app/src/containers/Redirector/index.js +47 -0
- package/templates/app/src/containers/SampleListContainer/ListContainer.js +42 -0
- package/templates/app/src/containers/SampleListContainer/ListContainer.module.css +3 -0
- package/templates/app/src/historyChange.js +5 -0
- package/templates/app/src/index.html +10 -0
- package/templates/app/src/index.js +24 -0
- package/templates/app/src/middleware/PromiseMiddleware.js +59 -0
- package/templates/app/src/reducers/alertData.js +11 -0
- package/templates/app/src/reducers/index.js +6 -0
- package/templates/app/src/reducers/samples.js +19 -0
- package/templates/app/src/store/configureStore.dev.js +51 -0
- package/templates/app/src/store/configureStore.js +5 -0
- package/templates/app/src/store/configureStore.prod.js +26 -0
- package/templates/app/src/util/Common.js +5 -0
- package/templates/app/src/util/RequestAPI.js +132 -0
- package/templates/appold/README.md +12 -0
- package/templates/appold/app/index.html +8 -0
- package/templates/appold/app/properties/ApplicationResources_en_US.properties +1 -0
- package/templates/appold/app/properties/i18nkeys.json +3 -0
- package/templates/appold/docs/all.html +69 -0
- package/templates/appold/mockapi/index.js +13 -0
- package/templates/{app → appold}/mockapi/tickets.json +0 -0
- package/templates/appold/package.json +17 -0
- package/templates/appold/src/components/Text/Text.css +0 -0
- package/templates/appold/src/components/Text/Text.js +23 -0
- package/templates/appold/src/components/Text/__tests__/Text.spec.js +30 -0
- package/templates/appold/src/components/Text/docs/Text__default.docs.js +16 -0
- package/templates/appold/src/components/docs.js +1 -0
- package/templates/appold/src/components/index.js +5 -0
- package/templates/appold/src/index.js +13 -0
- package/templates/docs/all.html +1 -1
- package/templates/docs/component.html +110 -69
- package/templates/docs/components.html +221 -0
- package/templates/docs/css/component.css +12 -14
- package/templates/docs/css/componentTest.css +7 -0
- package/templates/docs/css/style.css +150 -206
- package/templates/docs/impactReportTemplate.html +154 -0
- package/templates/docs/index.html +1482 -1336
- package/templates/library/src/index.js +0 -0
@@ -1,42 +1,42 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
2
|
|
3
|
-
var _path = require(
|
3
|
+
var _path = _interopRequireDefault(require("path"));
|
4
4
|
|
5
|
-
var
|
5
|
+
var _miniCssExtractPlugin = _interopRequireDefault(require("mini-css-extract-plugin"));
|
6
6
|
|
7
|
-
var
|
7
|
+
var _utils = require("../utils");
|
8
8
|
|
9
|
-
var
|
9
|
+
var _cssClassNameGenerate = _interopRequireDefault(require("../utils/cssClassNameGenerate"));
|
10
10
|
|
11
|
-
var
|
12
|
-
|
13
|
-
var _pluginUtils = require('../pluginUtils');
|
11
|
+
var _pluginUtils = require("../pluginUtils");
|
14
12
|
|
15
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
16
14
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
15
|
+
let options = (0, _utils.getOptions)();
|
16
|
+
let {
|
17
|
+
umd: {
|
18
|
+
css: {
|
19
|
+
umdVar,
|
20
|
+
watch,
|
21
|
+
outputFolder,
|
22
|
+
cssUniqueness,
|
23
|
+
folder,
|
24
|
+
publicPath,
|
25
|
+
cssHashSelectors,
|
26
|
+
classNamePrefix
|
27
|
+
}
|
28
|
+
},
|
29
|
+
packageVersion
|
30
|
+
} = options;
|
31
|
+
let appPath = process.cwd();
|
32
|
+
let publicPathStr = `${publicPath || `${'//js.zohostatic.com/support/zohodeskcomponent@'}${packageVersion}`}/${outputFolder}/`;
|
33
33
|
module.exports = {
|
34
34
|
watch: watch,
|
35
35
|
entry: {
|
36
|
-
main:
|
36
|
+
main: _path.default.join(appPath, folder, 'css.js')
|
37
37
|
},
|
38
38
|
output: {
|
39
|
-
path:
|
39
|
+
path: _path.default.resolve(appPath, outputFolder),
|
40
40
|
filename: '[name].js',
|
41
41
|
library: umdVar,
|
42
42
|
libraryTarget: 'umd',
|
@@ -58,33 +58,33 @@ module.exports = {
|
|
58
58
|
use: [{
|
59
59
|
loader: 'babel-loader',
|
60
60
|
options: {
|
61
|
-
presets: [[require.resolve('babel
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
regenerator: false,
|
66
|
-
moduleName: 'babel-runtime'
|
67
|
-
}]],
|
61
|
+
presets: [[require.resolve('@babel/preset-env'), {
|
62
|
+
modules: false
|
63
|
+
}], require.resolve('@babel/preset-react')],
|
64
|
+
plugins: [require.resolve('@babel/plugin-proposal-object-rest-spread')],
|
68
65
|
cacheDirectory: true
|
69
66
|
}
|
70
67
|
}],
|
71
|
-
include:
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
68
|
+
include: _path.default.join(appPath, 'src')
|
69
|
+
}
|
70
|
+
/*,
|
71
|
+
{
|
72
|
+
test: /\.css$/,
|
73
|
+
use: [MiniCssExtractPlugin.loader, 'css-loader']
|
74
|
+
}*/
|
75
|
+
, {
|
77
76
|
test: /(\.module)?\.css$/,
|
78
77
|
use: [{
|
79
|
-
loader:
|
78
|
+
loader: _miniCssExtractPlugin.default.loader,
|
80
79
|
options: {
|
81
80
|
publicPath: '../'
|
82
81
|
}
|
83
82
|
}, {
|
84
83
|
loader: 'css-loader',
|
85
84
|
options: {
|
86
|
-
modules:
|
87
|
-
|
85
|
+
modules: {
|
86
|
+
getLocalIdent: (0, _cssClassNameGenerate.default)(cssUniqueness, cssHashSelectors, classNamePrefix)
|
87
|
+
}
|
88
88
|
}
|
89
89
|
}]
|
90
90
|
}, {
|
@@ -108,9 +108,9 @@ module.exports = {
|
|
108
108
|
}]
|
109
109
|
},
|
110
110
|
resolve: {
|
111
|
-
modules: [
|
111
|
+
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
112
112
|
},
|
113
113
|
resolveLoader: {
|
114
|
-
modules: [
|
114
|
+
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
115
115
|
}
|
116
116
|
};
|
@@ -1,79 +1,96 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
2
|
|
3
|
-
var _path = require(
|
3
|
+
var _path = _interopRequireDefault(require("path"));
|
4
4
|
|
5
|
-
var
|
5
|
+
var _utils = require("../utils");
|
6
6
|
|
7
|
-
var
|
7
|
+
var _common = require("../common");
|
8
8
|
|
9
|
-
var
|
9
|
+
var _pluginUtils = require("../pluginUtils");
|
10
10
|
|
11
|
-
var
|
12
|
-
|
13
|
-
var _miniCssExtractPlugin2 = _interopRequireDefault(_miniCssExtractPlugin);
|
14
|
-
|
15
|
-
var _pluginUtils = require('../pluginUtils');
|
16
|
-
|
17
|
-
var _loaderUtils = require('../loaderUtils');
|
11
|
+
var _loaderUtils = require("../loaderUtils");
|
18
12
|
|
19
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
20
14
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
15
|
+
let options = (0, _utils.getOptions)();
|
16
|
+
let {
|
17
|
+
app: {
|
18
|
+
folder,
|
19
|
+
context,
|
20
|
+
server,
|
21
|
+
outputFolder,
|
22
|
+
rtlExclude,
|
23
|
+
hasRTL,
|
24
|
+
cssUniqueness,
|
25
|
+
seperateCssModules,
|
26
|
+
changeRuntimeChunkChar,
|
27
|
+
cssHashSelectors,
|
28
|
+
classNamePrefix,
|
29
|
+
selectorReplace,
|
30
|
+
disableES5Transpile,
|
31
|
+
devConsoleExculde,
|
32
|
+
sourcemap,
|
33
|
+
crossorigin
|
34
|
+
}
|
35
|
+
} = options;
|
36
|
+
let {
|
37
|
+
disableContextURL
|
38
|
+
} = server;
|
39
|
+
let appPath = process.cwd();
|
40
|
+
let contextURL = disableContextURL ? '' : context;
|
41
|
+
let serverUrl = (0, _utils.getServerURL)(server, 'https');
|
42
|
+
let output = {
|
43
|
+
path: _path.default.join(appPath, outputFolder),
|
36
44
|
filename: 'js/[name].js',
|
37
45
|
chunkFilename: 'js/[name].js',
|
38
|
-
publicPath: [serverUrl, contextURL].filter(
|
39
|
-
|
40
|
-
}).join('/') + '/',
|
41
|
-
jsonpFunction: context + 'Jsonp'
|
46
|
+
publicPath: `${[serverUrl, contextURL].filter(a => a).join('/')}/`,
|
47
|
+
jsonpFunction: `${context}Jsonp`
|
42
48
|
};
|
43
49
|
|
50
|
+
if (crossorigin) {
|
51
|
+
output.crossOriginLoading = 'anonymous';
|
52
|
+
}
|
53
|
+
|
44
54
|
module.exports = {
|
45
55
|
entry: (0, _common.getEntries)(options, 'dev'),
|
46
|
-
devtool:
|
56
|
+
devtool: sourcemap,
|
47
57
|
mode: 'development',
|
48
|
-
output
|
49
|
-
|
50
|
-
|
58
|
+
output,
|
59
|
+
stats: options.app.disableWatch ? 'errors-only' : {
|
60
|
+
children: false
|
61
|
+
},
|
62
|
+
optimization: {
|
63
|
+
splitChunks: _common.splitChunks,
|
64
|
+
moduleIds: 'named',
|
65
|
+
runtimeChunk: {
|
66
|
+
name: entrypoint => changeRuntimeChunkChar ? `./runtime-${entrypoint.name}` : `./runtime~${entrypoint.name}`
|
67
|
+
}
|
68
|
+
},
|
69
|
+
plugins: (0, _pluginUtils.getDevPlugins)(options, output.publicPath),
|
51
70
|
module: {
|
52
71
|
/* strictExportPresence for break the build when imported module not present in respective file */
|
53
72
|
strictExportPresence: true,
|
54
73
|
rules: [{
|
55
74
|
test: /\.js$/,
|
56
75
|
use: (0, _loaderUtils.getDevJsLoaders)(options),
|
57
|
-
include:
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
test: /(\.module)?\.css$/,
|
65
|
-
use: [{
|
66
|
-
loader: _miniCssExtractPlugin2.default.loader,
|
67
|
-
options: {
|
68
|
-
publicPath: '../'
|
69
|
-
}
|
70
|
-
}, {
|
71
|
-
loader: 'css-loader',
|
72
|
-
options: {
|
73
|
-
modules: true,
|
74
|
-
localIdentName: '[name]__[local]__[hash:base64:5]'
|
76
|
+
include: module => {
|
77
|
+
let srcPath = _path.default.join(appPath, folder);
|
78
|
+
|
79
|
+
let depsPath = _path.default.join(appPath, 'node_modules', '@zohodesk');
|
80
|
+
|
81
|
+
if (module.includes(srcPath) || devConsoleExculde && module.includes(depsPath)) {
|
82
|
+
return true;
|
75
83
|
}
|
76
|
-
|
84
|
+
|
85
|
+
return false;
|
86
|
+
}
|
87
|
+
}, seperateCssModules ? {
|
88
|
+
test: /\.css$/,
|
89
|
+
exclude: /\.module\.css$/,
|
90
|
+
use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, '[local]', false, null)
|
91
|
+
} : null, {
|
92
|
+
test: seperateCssModules ? /\.module\.css$/ : /(\.module)?\.css$/,
|
93
|
+
use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, null, cssUniqueness, selectorReplace, cssHashSelectors, classNamePrefix)
|
77
94
|
}, {
|
78
95
|
test: /\.jpe?g$|\.gif$|\.png$/,
|
79
96
|
use: ['url-loader?limit=1000&name=./images/[name].[ext]']
|
@@ -83,15 +100,54 @@ module.exports = {
|
|
83
100
|
}, {
|
84
101
|
test: /\.svg$/,
|
85
102
|
use: ['url-loader?limit=1&name=./fonts/[name].[ext]']
|
86
|
-
}
|
103
|
+
}, {
|
104
|
+
test: /\.ogg$/,
|
105
|
+
use: ['file-loader?name=./fonts/[name].[ext]']
|
106
|
+
}, {
|
107
|
+
test: /\.tmpl$/,
|
108
|
+
use: [{
|
109
|
+
loader: 'html-loader',
|
110
|
+
options: {
|
111
|
+
minimize: true
|
112
|
+
}
|
113
|
+
}]
|
114
|
+
}, {
|
115
|
+
test: /\.worker.js$/,
|
116
|
+
use: {
|
117
|
+
loader: require.resolve('../loaders/workerLoader.js'),
|
118
|
+
options: {
|
119
|
+
esModule: true,
|
120
|
+
filename: 'js/[name].js'
|
121
|
+
}
|
122
|
+
}
|
123
|
+
}].filter(Boolean)
|
87
124
|
},
|
88
125
|
externals: {
|
89
126
|
ZC: '$ZC'
|
90
127
|
},
|
91
128
|
resolve: {
|
92
|
-
modules: [
|
129
|
+
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules'],
|
130
|
+
alias: disableES5Transpile ? {
|
131
|
+
'@zohodesk/components/lib': '@zohodesk/components/es',
|
132
|
+
// "@zohodesk/zc-custom/lib": "@zohodesk/zc-custom/es",
|
133
|
+
'@zohodesk/dot/lib': '@zohodesk/dot/es',
|
134
|
+
'@zohodesk/i18n/lib': '@zohodesk/i18n/es',
|
135
|
+
'@zohodesk/icons/lib': '@zohodesk/icons/es',
|
136
|
+
'@zohodesk/normalizer/lib': '@zohodesk/normalizer/es',
|
137
|
+
'@zohodesk/perf-components/lib': '@zohodesk/perf-components/es',
|
138
|
+
'@zohodesk/perf-middleware/lib': '@zohodesk/perf-middleware/es',
|
139
|
+
'@zohodesk/permissions/lib': '@zohodesk/permissions/es',
|
140
|
+
'@zohodesk/platform-middleware/lib': '@zohodesk/platform-middleware/es',
|
141
|
+
'@zohodesk/react-dnd/lib': '@zohodesk/react-dnd/es',
|
142
|
+
'@zohodesk/router-middleware/lib': '@zohodesk/router-middleware/es',
|
143
|
+
'@zohodesk/storage/lib': '@zohodesk/storage/es',
|
144
|
+
'@zohodesk/svg/lib': '@zohodesk/svg/es',
|
145
|
+
'@zohodesk/timetracker/lib': '@zohodesk/timetracker/es',
|
146
|
+
'@zohodesk/variables/lib': '@zohodesk/variables/es',
|
147
|
+
'@zohodesk/virtualizer/lib': '@zohodesk/virtualizer/es'
|
148
|
+
} : {}
|
93
149
|
},
|
94
150
|
resolveLoader: {
|
95
|
-
modules: [
|
151
|
+
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
96
152
|
}
|
97
153
|
};
|
@@ -1,109 +1,115 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
2
|
|
3
|
-
var _path = require(
|
3
|
+
var _path = _interopRequireDefault(require("path"));
|
4
4
|
|
5
|
-
var
|
5
|
+
var _utils = require("../utils");
|
6
6
|
|
7
|
-
var
|
7
|
+
var _pluginUtils = require("../pluginUtils");
|
8
8
|
|
9
|
-
var
|
10
|
-
|
11
|
-
var _utils = require('../utils');
|
12
|
-
|
13
|
-
var _pluginUtils = require('../pluginUtils');
|
9
|
+
var _loaderUtils = require("../loaderUtils");
|
14
10
|
|
15
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
16
12
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
componentFolder
|
21
|
-
cssUniqueness
|
22
|
-
|
13
|
+
let options = (0, _utils.getOptions)();
|
14
|
+
let {
|
15
|
+
docs: {
|
16
|
+
componentFolder,
|
17
|
+
cssUniqueness,
|
18
|
+
hasRTL,
|
19
|
+
rtlExclude,
|
20
|
+
cssHashSelectors,
|
21
|
+
classNamePrefix
|
22
|
+
},
|
23
|
+
app: {
|
24
|
+
folder
|
25
|
+
}
|
26
|
+
} = options;
|
27
|
+
let appPath = process.cwd();
|
23
28
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
29
|
+
module.exports = isSSTest => ({
|
30
|
+
entry: {
|
31
|
+
main: [_path.default.resolve(__dirname, "..", "hooks", "docsProptypeHook.js"), _path.default.join(appPath, componentFolder, "index.js")],
|
32
|
+
vendor: ["react", "react-dom", "redux", "react-redux"]
|
33
|
+
},
|
34
|
+
devtool: "none",
|
35
|
+
mode: "development",
|
36
|
+
output: {
|
37
|
+
path: _path.default.join(appPath, "build"),
|
38
|
+
filename: "js/[name].js",
|
39
|
+
publicPath: "/docs/",
|
40
|
+
library: "Component",
|
41
|
+
libraryTarget: "umd"
|
42
|
+
},
|
43
|
+
plugins: (0, _pluginUtils.getDocsPlugins)(isSSTest, options),
|
44
|
+
module: {
|
45
|
+
rules: [{
|
46
|
+
test: /\.js$/,
|
47
|
+
use: [{
|
48
|
+
loader: "babel-loader",
|
49
|
+
options: {
|
50
|
+
presets: [[require.resolve("@babel/preset-env"), {
|
51
|
+
modules: false
|
52
|
+
}], require.resolve("@babel/preset-react")],
|
53
|
+
plugins: [[require.resolve("@babel/plugin-transform-runtime"), {
|
54
|
+
helpers: true,
|
55
|
+
regenerator: false
|
56
|
+
}], require.resolve("@babel/plugin-syntax-dynamic-import"), require.resolve("@babel/plugin-syntax-object-rest-spread")],
|
57
|
+
cacheDirectory: true
|
58
|
+
}
|
59
|
+
}],
|
60
|
+
include: _path.default.join(appPath, folder)
|
61
|
+
}, {
|
62
|
+
test: /\.docs\.js$/,
|
63
|
+
use: require.resolve("../loaders/docsLoader.js"),
|
64
|
+
include: _path.default.join(appPath, folder),
|
65
|
+
exclude: /node_modules/
|
66
|
+
}, {
|
67
|
+
test: /(\.module)?\.css$/,
|
68
|
+
use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, false, cssUniqueness, null, cssHashSelectors, classNamePrefix)
|
69
|
+
}, {
|
70
|
+
test: /\.jpe?g$|\.gif$|\.png$/,
|
71
|
+
use: ["url-loader?limit=1000&name=./images/[name].[ext]"]
|
72
|
+
}, {
|
73
|
+
test: /\.woff2|\.woff$|\.ttf$|\.eot$/,
|
74
|
+
use: ["url-loader?limit=1000&name=./fonts/[name].[ext]"]
|
75
|
+
}, {
|
76
|
+
test: /\.svg$/,
|
77
|
+
use: ["url-loader?limit=1&name=./fonts/[name].[ext]"]
|
78
|
+
}, {
|
79
|
+
test: /\.html$/,
|
80
|
+
use: {
|
81
|
+
loader: "html-loader",
|
82
|
+
options: {
|
83
|
+
attrs: [":data-src"],
|
84
|
+
interpolate: "require"
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}, {
|
88
|
+
test: /\.ogg$/,
|
89
|
+
use: ["file-loader?name=./fonts/[name].[ext]"]
|
90
|
+
}, {
|
91
|
+
test: /\.tmpl$/,
|
92
|
+
use: [{
|
93
|
+
loader: "html-loader",
|
94
|
+
options: {
|
95
|
+
minimize: {
|
96
|
+
removeComments: true,
|
97
|
+
collapseWhitespace: false,
|
98
|
+
removeAttributeQuotes: false,
|
99
|
+
minifyCSS: false,
|
100
|
+
minifyJS: false
|
95
101
|
}
|
96
102
|
}
|
97
103
|
}]
|
98
|
-
}
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
}
|
109
|
-
};
|
104
|
+
}]
|
105
|
+
},
|
106
|
+
externals: {
|
107
|
+
ZC: "$ZC"
|
108
|
+
},
|
109
|
+
resolve: {
|
110
|
+
modules: [_path.default.resolve(__dirname, "..", "..", "node_modules"), "node_modules"]
|
111
|
+
},
|
112
|
+
resolveLoader: {
|
113
|
+
modules: [_path.default.resolve(__dirname, "..", "..", "node_modules"), "node_modules"]
|
114
|
+
}
|
115
|
+
});
|
@@ -0,0 +1,116 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _path = _interopRequireDefault(require("path"));
|
4
|
+
|
5
|
+
var _utils = require("../utils");
|
6
|
+
|
7
|
+
var _loaderUtils = require("../loaderUtils");
|
8
|
+
|
9
|
+
var _getLibraryImactPlugins = _interopRequireDefault(require("../pluginUtils/getLibraryImactPlugins"));
|
10
|
+
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12
|
+
|
13
|
+
let options = (0, _utils.getOptions)();
|
14
|
+
let {
|
15
|
+
docs: {
|
16
|
+
componentFolder,
|
17
|
+
cssUniqueness,
|
18
|
+
hasRTL,
|
19
|
+
rtlExclude,
|
20
|
+
cssHashSelectors,
|
21
|
+
classNamePrefix
|
22
|
+
},
|
23
|
+
app: {
|
24
|
+
folder
|
25
|
+
}
|
26
|
+
} = options;
|
27
|
+
let appPath = process.cwd();
|
28
|
+
module.exports = {
|
29
|
+
entry: {
|
30
|
+
main: [_path.default.resolve(__dirname, '..', 'hooks', 'docsProptypeHook.js'), _path.default.join(appPath, componentFolder, 'index.js')],
|
31
|
+
vendor: ['react', 'react-dom', 'redux', 'react-redux']
|
32
|
+
},
|
33
|
+
devtool: 'none',
|
34
|
+
mode: 'development',
|
35
|
+
output: {
|
36
|
+
path: _path.default.join(appPath, 'build'),
|
37
|
+
filename: 'js/[name].js',
|
38
|
+
publicPath: '/docs/',
|
39
|
+
library: 'Component',
|
40
|
+
libraryTarget: 'umd'
|
41
|
+
},
|
42
|
+
plugins: (0, _getLibraryImactPlugins.default)(options),
|
43
|
+
module: {
|
44
|
+
rules: [{
|
45
|
+
test: /\.js$/,
|
46
|
+
use: [{
|
47
|
+
loader: 'babel-loader',
|
48
|
+
options: {
|
49
|
+
presets: [[require.resolve('@babel/preset-env'), {
|
50
|
+
modules: false
|
51
|
+
}], require.resolve('@babel/preset-react')],
|
52
|
+
plugins: [[require.resolve('@babel/plugin-transform-runtime'), {
|
53
|
+
helpers: true,
|
54
|
+
regenerator: false
|
55
|
+
}], require.resolve('@babel/plugin-syntax-dynamic-import'), require.resolve('@babel/plugin-syntax-object-rest-spread')],
|
56
|
+
cacheDirectory: true
|
57
|
+
}
|
58
|
+
}],
|
59
|
+
include: _path.default.join(appPath, folder)
|
60
|
+
}, {
|
61
|
+
test: /\.docs\.js$/,
|
62
|
+
use: require.resolve('../loaders/docsLoader.js'),
|
63
|
+
include: _path.default.join(appPath, folder),
|
64
|
+
exclude: /node_modules/
|
65
|
+
}, {
|
66
|
+
test: /(\.module)?\.css$/,
|
67
|
+
use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, false, cssUniqueness, null, cssHashSelectors, classNamePrefix)
|
68
|
+
}, {
|
69
|
+
test: /\.jpe?g$|\.gif$|\.png$/,
|
70
|
+
use: ['url-loader?limit=1000&name=./images/[name].[ext]']
|
71
|
+
}, {
|
72
|
+
test: /\.woff2|\.woff$|\.ttf$|\.eot$/,
|
73
|
+
use: ['url-loader?limit=1000&name=./fonts/[name].[ext]']
|
74
|
+
}, {
|
75
|
+
test: /\.svg$/,
|
76
|
+
use: ['url-loader?limit=1&name=./fonts/[name].[ext]']
|
77
|
+
}, {
|
78
|
+
test: /\.html$/,
|
79
|
+
use: {
|
80
|
+
loader: 'html-loader',
|
81
|
+
options: {
|
82
|
+
attrs: [':data-src'],
|
83
|
+
interpolate: 'require'
|
84
|
+
}
|
85
|
+
}
|
86
|
+
}, {
|
87
|
+
test: /\.ogg$/,
|
88
|
+
use: ['file-loader?name=./fonts/[name].[ext]']
|
89
|
+
}, {
|
90
|
+
test: /\.tmpl$/,
|
91
|
+
use: [{
|
92
|
+
loader: 'html-loader',
|
93
|
+
options: {
|
94
|
+
interpolate: 'require',
|
95
|
+
ignoreCustomFragments: [/\{\{.*?}}/, /\$\{.*?}/],
|
96
|
+
minimize: true,
|
97
|
+
removeComments: true,
|
98
|
+
collapseWhitespace: false,
|
99
|
+
removeAttributeQuotes: false,
|
100
|
+
minifyCSS: false,
|
101
|
+
minifyJS: false
|
102
|
+
}
|
103
|
+
}]
|
104
|
+
}]
|
105
|
+
},
|
106
|
+
externals: {
|
107
|
+
ZC: '$ZC'
|
108
|
+
},
|
109
|
+
resolve: {
|
110
|
+
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
111
|
+
},
|
112
|
+
resolveLoader: {
|
113
|
+
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
114
|
+
},
|
115
|
+
stats: 'errors-only'
|
116
|
+
};
|