@zohodesk/react-cli 0.0.1-beta.17 → 0.0.1-beta.170
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 +49 -10
- package/.prettierrc +6 -0
- package/CHANGELOG.md +5 -0
- package/README.md +855 -0
- package/bin/cli.js +215 -46
- package/cert/Tsicsezwild-22-23.crt +37 -0
- package/cert/Tsicsezwild-22-23.key +27 -0
- package/docs/CustomChunks.md +26 -0
- package/docs/DevStart.md +18 -0
- package/docs/HoverActive.md +12 -0
- package/docs/InstallNode.md +28 -0
- package/docs/TODOS.md +10 -0
- package/docs/ValueReplacer.md +60 -0
- package/docs/warnings_while_install.txt +35 -0
- package/files/eslintrc.js +62 -0
- package/files/prettierrc.js +3 -0
- package/lib/babel/cmjs-plugins-presets.js +24 -0
- package/lib/babel/es-plugins-presets.js +34 -0
- package/lib/common/getEntries.js +33 -46
- package/lib/common/getPublicPathConfig.js +40 -0
- package/lib/common/index.js +24 -19
- package/lib/common/splitChunks.js +110 -25
- package/lib/common/sslcertUpdater.js +59 -0
- package/lib/common/templateParameters.js +25 -0
- package/lib/common/testPattern.js +69 -0
- package/lib/common/valueReplacer.js +55 -0
- package/lib/configs/jest.config.js +31 -27
- package/lib/configs/libAlias.js +31 -0
- package/lib/configs/webpack.component.umd.config.js +46 -53
- package/lib/configs/webpack.css.umd.config.js +47 -46
- package/lib/configs/webpack.dev.config.js +98 -84
- package/lib/configs/webpack.docs.config.js +64 -57
- package/lib/configs/webpack.impact.config.js +108 -0
- package/lib/configs/webpack.prod.config.js +146 -104
- package/lib/hooks/docsProptypeHook.js +32 -38
- package/lib/jest/commitedFilesResult.js +144 -71
- package/lib/jest/coverageCollector.js +68 -35
- 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 +92 -42
- package/lib/jest/run.js +75 -28
- package/lib/jest/setup.js +103 -102
- package/lib/loaderUtils/configsAssetsLoaders.js +117 -0
- package/lib/loaderUtils/getCSSLoaders.js +113 -0
- package/lib/loaderUtils/getDevJsLoaders.js +35 -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 +23 -20
- package/lib/loaders/selectorMappingLoader.js +75 -0
- package/lib/loaders/workerLoader.js +136 -0
- package/lib/middlewares/HMRMiddleware.js +90 -72
- package/lib/middlewares/SSTMiddleware.js +21 -0
- package/lib/pluginUtils/getDevPlugins.js +177 -30
- package/lib/pluginUtils/getDocsPlugins.js +36 -15
- package/lib/pluginUtils/getLibraryImactPlugins.js +23 -0
- package/lib/pluginUtils/getLibraryPlugins.js +8 -10
- package/lib/pluginUtils/getProdPlugins.js +244 -37
- package/lib/pluginUtils/getServerPlugins.js +8 -11
- package/lib/pluginUtils/getUMDCSSPlugins.js +14 -18
- package/lib/pluginUtils/getUMDComponentPlugins.js +14 -9
- 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 +241 -0
- package/lib/plugins/EFCPlugin.md +6 -0
- package/lib/plugins/EFCTemplatePlugin.js +151 -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 +95 -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 +86 -0
- package/lib/plugins/ModuleStatsPlugin.js +98 -97
- package/lib/plugins/OptimizeJSPlugin.js +41 -0
- package/lib/plugins/PublicPathCallbackPlugin.js +63 -0
- package/lib/plugins/PublicPathChangePlugin.js +226 -0
- package/lib/plugins/ReportGeneratePlugin.js +181 -0
- package/lib/plugins/RequireVariablePublicPlugin.js +30 -0
- package/lib/plugins/ResourceHintsPlugin.js +67 -0
- 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 -59
- package/lib/plugins/TPHashMappingPlugin.js +67 -0
- package/lib/plugins/UglifyCSSPlugin.js +39 -0
- package/lib/plugins/UnusedFilesFindPlugin.js +150 -97
- package/lib/plugins/index.js +127 -37
- package/lib/plugins/libraryImpactPlugin.js +190 -0
- package/lib/plugins/webpackwatchrunplugin.js +26 -0
- package/lib/postcss-plugins/ExcludePlugin.js +23 -0
- package/lib/postcss-plugins/RTLSplitPlugin.js +138 -0
- package/lib/postcss-plugins/ValueReplacer.js +46 -0
- package/lib/postcss-plugins/__test__/hoverActivePlugin.spec.js +22 -0
- package/lib/postcss-plugins/__test__/test1Input.css +39 -0
- package/lib/postcss-plugins/__test__/test1Output.css +39 -0
- package/lib/postcss-plugins/hoverActivePlugin.js +365 -0
- package/lib/postcss-plugins/variableModifier.js +243 -0
- package/lib/schemas/index.js +534 -66
- package/lib/servers/clusterHubServer.js +22 -26
- package/lib/servers/devBuild.js +102 -0
- package/lib/servers/docsServer.js +3 -5
- package/lib/servers/docsServerCore.js +94 -79
- package/lib/servers/getCliPath.js +28 -0
- package/lib/servers/helpServer.js +19 -21
- package/lib/servers/httpsOptions.js +18 -0
- package/lib/servers/impactServer.js +123 -115
- package/lib/servers/mockserver.js +44 -0
- package/lib/servers/nowatchserver.js +200 -0
- package/lib/servers/scrServer.js +147 -0
- package/lib/servers/server.js +134 -132
- package/lib/servers/ssServer.js +106 -70
- 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 -4
- package/lib/utils/buildstats.html +148 -0
- package/lib/utils/clean.js +12 -11
- package/lib/utils/copy.js +16 -109
- package/lib/utils/copyTimezones.js +21 -0
- package/lib/utils/createEventStream.js +24 -19
- package/lib/utils/cssClassNameGenerate.js +77 -0
- package/lib/utils/cssURLReplacer.js +136 -0
- 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 +113 -28
- package/lib/utils/getServerURL.js +25 -8
- package/lib/utils/index.js +283 -68
- package/lib/utils/init.js +2 -2
- package/lib/utils/initPreCommitHook.js +47 -27
- package/lib/utils/jsonHelper.js +106 -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 +59 -63
- package/lib/utils/request.js +64 -77
- package/lib/utils/resultSchema.json +73 -0
- package/lib/utils/rtl.js +59 -0
- package/lib/utils/setEnvVariables.js +13 -0
- package/lib/utils/ssTestHack.js +48 -0
- package/lib/utils/switchBranch.js +28 -0
- package/lib/utils/urlConcat.js +22 -0
- package/lib/utils/useExitCleanup.js +55 -0
- package/npm8.md +9 -0
- package/package.json +96 -64
- package/postpublish.js +6 -0
- 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
- package/.npmignore +0 -3
- package/cert/cert.pem +0 -129
- package/cert/key.pem +0 -27
- package/lib/common/getInsertAt.js +0 -36
- package/lib/common/getInsertIntoFunction.js +0 -13
- package/lib/configs/webpack.server.config.js +0 -93
- package/lib/plugins/ChunkManifestReplacePlugin.js +0 -94
- package/lib/plugins/RuntimePublicPathPlugin.js +0 -46
- package/lib/rmcntrlm.sh +0 -14
- package/lib/servers/nodeServer.js +0 -238
- package/lib/templates/HMRTemplate.js +0 -256
- package/lib/templates/publicPathTemplate.js +0 -16
- package/lib/utils/setConfig.js +0 -14
- package/node_modules/history/CHANGES.md +0 -395
- package/node_modules/history/DOMUtils.js +0 -3
- package/node_modules/history/ExecutionEnvironment.js +0 -3
- package/node_modules/history/LICENSE +0 -21
- package/node_modules/history/LocationUtils.js +0 -3
- package/node_modules/history/PathUtils.js +0 -3
- package/node_modules/history/README.md +0 -282
- package/node_modules/history/cjs/history.js +0 -933
- package/node_modules/history/cjs/history.min.js +0 -1
- package/node_modules/history/createBrowserHistory.js +0 -3
- package/node_modules/history/createHashHistory.js +0 -3
- package/node_modules/history/createMemoryHistory.js +0 -3
- package/node_modules/history/createTransitionManager.js +0 -3
- package/node_modules/history/es/DOMUtils.js +0 -7
- package/node_modules/history/es/ExecutionEnvironment.js +0 -7
- package/node_modules/history/es/LocationUtils.js +0 -7
- package/node_modules/history/es/PathUtils.js +0 -7
- package/node_modules/history/es/createBrowserHistory.js +0 -7
- package/node_modules/history/es/createHashHistory.js +0 -7
- package/node_modules/history/es/createMemoryHistory.js +0 -7
- package/node_modules/history/es/createTransitionManager.js +0 -7
- package/node_modules/history/es/warnAboutDeprecatedESMImport.js +0 -35
- package/node_modules/history/esm/history.js +0 -904
- package/node_modules/history/index.js +0 -7
- package/node_modules/history/package.json +0 -134
- package/node_modules/history/umd/history.js +0 -1059
- package/node_modules/history/umd/history.min.js +0 -1
- package/node_modules/history/warnAboutDeprecatedCJSRequire.js +0 -35
- package/templates/app/.npmignore +0 -9
- package/templates/library/.npmignore +0 -9
@@ -1,25 +1,39 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
2
|
|
3
|
-
var
|
3
|
+
var _fs = require("fs");
|
4
4
|
|
5
|
-
var
|
5
|
+
var _path = _interopRequireDefault(require("path"));
|
6
|
+
|
7
|
+
var _libAlias = require("./libAlias");
|
6
8
|
|
7
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8
10
|
|
9
|
-
|
11
|
+
let appPath = process.cwd(); // '^@root(.*)$': '<rootDir>/src$1',
|
12
|
+
// '^@components(.*)$': '<rootDir>/src/components$1',
|
13
|
+
|
14
|
+
let moduleNameMapper = Object.keys(_libAlias.libAlias).reduce((previousValue, key) => {
|
15
|
+
previousValue[`^${key}(.*)$`] = `${_libAlias.libAlias[key]}$1`;
|
16
|
+
return previousValue;
|
17
|
+
}, {});
|
10
18
|
|
11
|
-
|
19
|
+
const appGlobals = _path.default.resolve(appPath, '__testUtils__', 'globals.js');
|
20
|
+
|
21
|
+
let commonConfig = {
|
12
22
|
coverageReporters: ['json', 'html', 'json-summary', 'text'],
|
13
23
|
collectCoverage: true,
|
14
|
-
moduleDirectories: [
|
24
|
+
moduleDirectories: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules'],
|
15
25
|
transform: {
|
16
|
-
'^.+\\.(js|jsx)$':
|
17
|
-
'^.+\\.css$':
|
18
|
-
'^(?!.*\\.(js|jsx|css|json)$)':
|
26
|
+
'^.+\\.(js|jsx)$': _path.default.resolve(__dirname, '..', 'jest', 'preProcessors', 'jsPreprocessor.js'),
|
27
|
+
'^.+\\.css$': _path.default.resolve(__dirname, '..', 'jest', 'preProcessors', 'cssPreprocessor.js'),
|
28
|
+
'^(?!.*\\.(js|jsx|css|json)$)': _path.default.resolve(__dirname, '..', 'jest', 'preProcessors', 'otherFilesPreprocessor.js')
|
29
|
+
},
|
30
|
+
moduleNameMapper: { ...moduleNameMapper,
|
31
|
+
'\\.(css|less)$': 'identity-obj-proxy'
|
19
32
|
},
|
20
|
-
transformIgnorePatterns: ['/node_modules
|
33
|
+
transformIgnorePatterns: ['/node_modules/(?!(@zohodesk)/)'],
|
34
|
+
// transformIgnorePatterns: ['/node_modules.*?.js$'],
|
21
35
|
moduleFileExtensions: ['js'],
|
22
|
-
setupFiles: [
|
36
|
+
setupFiles: [(0, _fs.existsSync)(appGlobals) && appGlobals, _path.default.resolve(__dirname, '..', 'jest', 'setup.js')].filter(Boolean),
|
23
37
|
globals: {
|
24
38
|
__DEVELOPMENT__: true,
|
25
39
|
__DOCS__: false,
|
@@ -27,20 +41,13 @@ var commonConfig = {
|
|
27
41
|
}
|
28
42
|
};
|
29
43
|
|
30
|
-
module.exports =
|
31
|
-
|
32
|
-
args[_key] = arguments[_key];
|
33
|
-
}
|
34
|
-
|
35
|
-
var appFolder = args[0],
|
36
|
-
_args$ = args[1],
|
37
|
-
forCommittedFiles = _args$ === undefined ? false : _args$;
|
38
|
-
|
44
|
+
module.exports = (...args) => {
|
45
|
+
let [appFolder, forCommittedFiles = false] = args;
|
39
46
|
|
40
47
|
if (forCommittedFiles) {
|
41
48
|
return Object.assign({}, commonConfig, {
|
42
|
-
coverageDirectory:
|
43
|
-
testResultsProcessor:
|
49
|
+
coverageDirectory: _path.default.resolve(appPath, 'commitCoverage'),
|
50
|
+
testResultsProcessor: _path.default.resolve(__dirname, '..', 'jest', 'commitedFilesResult.js')
|
44
51
|
});
|
45
52
|
}
|
46
53
|
|
@@ -48,11 +55,8 @@ module.exports = function () {
|
|
48
55
|
rootDir: appPath,
|
49
56
|
testPathIgnorePatterns: ['/node_modules/', 'docs'],
|
50
57
|
unmockedModulePathPatterns: ['__tests__', 'node_modules', '.*'],
|
51
|
-
roots: [
|
58
|
+
roots: [`<rootDir>/${appFolder}/`],
|
52
59
|
testRegex: '(/__tests__/.*|\\.(test|spec))\\.(jsx|js|json|node)$',
|
53
|
-
|
54
|
-
'\\.(css|less)$': 'identity-obj-proxy'
|
55
|
-
},
|
56
|
-
testResultsProcessor: _path2.default.resolve(__dirname, '..', 'jest', 'result.js')
|
60
|
+
testResultsProcessor: _path.default.resolve(__dirname, '..', 'jest', 'result.js')
|
57
61
|
});
|
58
62
|
};
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.libAlias = void 0;
|
7
|
+
// the reason for alias at the time was code tree shaking
|
8
|
+
// tree shaking was most compactable with ES module system
|
9
|
+
// FIXME: But there is a posiblity when these package does not have lib,
|
10
|
+
// app will work because of alias, But may be jest won't work because of not alais
|
11
|
+
// So need to think about use alais in jest
|
12
|
+
const libAlias = {
|
13
|
+
'@zohodesk/components/lib': '@zohodesk/components/es',
|
14
|
+
// '@zohodesk/zc-custom/lib': '@zohodesk/zc-custom/es',
|
15
|
+
'@zohodesk/dot/lib': '@zohodesk/dot/es',
|
16
|
+
'@zohodesk/i18n/lib': '@zohodesk/i18n/es',
|
17
|
+
'@zohodesk/icons/lib': '@zohodesk/icons/es',
|
18
|
+
'@zohodesk/normalizer/lib': '@zohodesk/normalizer/es',
|
19
|
+
'@zohodesk/perf-components/lib': '@zohodesk/perf-components/es',
|
20
|
+
'@zohodesk/perf-middleware/lib': '@zohodesk/perf-middleware/es',
|
21
|
+
'@zohodesk/permissions/lib': '@zohodesk/permissions/es',
|
22
|
+
'@zohodesk/platform-middleware/lib': '@zohodesk/platform-middleware/es',
|
23
|
+
'@zohodesk/react-dnd/lib': '@zohodesk/react-dnd/es',
|
24
|
+
'@zohodesk/router-middleware/lib': '@zohodesk/router-middleware/es',
|
25
|
+
'@zohodesk/storage/lib': '@zohodesk/storage/es',
|
26
|
+
'@zohodesk/svg/lib': '@zohodesk/svg/es',
|
27
|
+
'@zohodesk/timetracker/lib': '@zohodesk/timetracker/es',
|
28
|
+
'@zohodesk/variables/lib': '@zohodesk/variables/es',
|
29
|
+
'@zohodesk/virtualizer/lib': '@zohodesk/virtualizer/es'
|
30
|
+
};
|
31
|
+
exports.libAlias = libAlias;
|
@@ -1,49 +1,39 @@
|
|
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 _utils = require(
|
7
|
+
var _utils = require("../utils");
|
8
8
|
|
9
|
-
var _pluginUtils = require(
|
9
|
+
var _pluginUtils = require("../pluginUtils");
|
10
10
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
var styleLoaderOption = {
|
30
|
-
singleton: singleStyleTag
|
31
|
-
};
|
32
|
-
|
33
|
-
// let publicPath =
|
34
|
-
// `${process.env.npm_config_public_path ||
|
35
|
-
// `${'//js.zohostatic.com/support/zohodeskcomponent' +
|
36
|
-
// '@'}${
|
37
|
-
// process.env.npm_package_version}` }/dist/`;
|
38
|
-
|
13
|
+
let options = (0, _utils.getOptions)();
|
14
|
+
let {
|
15
|
+
umd: {
|
16
|
+
component: {
|
17
|
+
umdVar,
|
18
|
+
isHtml,
|
19
|
+
isDocs,
|
20
|
+
watch,
|
21
|
+
outputFolder,
|
22
|
+
cssUniqueness,
|
23
|
+
folder
|
24
|
+
}
|
25
|
+
}
|
26
|
+
} = options;
|
27
|
+
let appPath = process.cwd();
|
28
|
+
let className = cssUniqueness ? 'fz__[hash:base64:5]' : '[name]__[local]';
|
39
29
|
module.exports = {
|
40
30
|
watch: watch,
|
41
31
|
entry: {
|
42
|
-
main:
|
32
|
+
main: _path.default.join(appPath, folder, isHtml ? 'html.js' : 'index.js')
|
43
33
|
},
|
44
34
|
output: {
|
45
|
-
path:
|
46
|
-
filename: '[name].js',
|
35
|
+
path: _path.default.join(appPath, outputFolder),
|
36
|
+
filename: 'js/[name].js',
|
47
37
|
library: umdVar,
|
48
38
|
libraryTarget: 'umd'
|
49
39
|
},
|
@@ -54,38 +44,41 @@ module.exports = {
|
|
54
44
|
plugins: (0, _pluginUtils.getUMDComponentPlugins)(isDocs),
|
55
45
|
module: {
|
56
46
|
rules: [{
|
57
|
-
include: /\.json$/,
|
58
|
-
use: [{
|
59
|
-
loader: 'json-loader'
|
60
|
-
}]
|
61
|
-
}, {
|
62
47
|
test: /\.js$/,
|
63
48
|
use: [{
|
64
49
|
loader: 'babel-loader',
|
65
50
|
options: {
|
66
|
-
presets: [[require.resolve('babel
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
regenerator: false,
|
71
|
-
moduleName: 'babel-runtime'
|
72
|
-
}]],
|
51
|
+
presets: [[require.resolve('@babel/preset-env'), {
|
52
|
+
modules: false
|
53
|
+
}], require.resolve('@babel/preset-react')],
|
54
|
+
plugins: [require.resolve('@babel/plugin-proposal-object-rest-spread')],
|
73
55
|
cacheDirectory: true
|
74
56
|
}
|
75
57
|
}],
|
76
|
-
include:
|
58
|
+
include: _path.default.join(appPath, 'src')
|
77
59
|
}, {
|
78
|
-
test:
|
79
|
-
use: [{
|
60
|
+
test: /(\.module)?\.css$/,
|
61
|
+
use: [{
|
62
|
+
loader: _miniCssExtractPlugin.default.loader,
|
63
|
+
options: {
|
64
|
+
publicPath: '../'
|
65
|
+
}
|
66
|
+
}, {
|
67
|
+
loader: 'css-loader',
|
68
|
+
options: {
|
69
|
+
modules: true,
|
70
|
+
localIdentName: className
|
71
|
+
}
|
72
|
+
}]
|
80
73
|
}, isDocs ? {
|
81
74
|
test: /\.docs\.js$/,
|
82
|
-
use: require.resolve('../docsLoader.js'),
|
75
|
+
use: require.resolve('../loaders/docsLoader.js'),
|
83
76
|
exclude: /node_modules/
|
84
77
|
} : {}, {
|
85
78
|
test: /\.jpe?g$|\.gif$|\.png$/,
|
86
79
|
use: ['url-loader?limit=10000&name=./images/[name].[ext]']
|
87
80
|
}, {
|
88
|
-
test: /\.woff$|\.ttf$|\.eot$/,
|
81
|
+
test: /\.woff$|\.woff2$|\.ttf$|\.eot$/,
|
89
82
|
use: ['url-loader?limit=10000&name=./fonts/[name].[ext]']
|
90
83
|
}, {
|
91
84
|
test: /\.svg$/,
|
@@ -102,9 +95,9 @@ module.exports = {
|
|
102
95
|
}]
|
103
96
|
},
|
104
97
|
resolve: {
|
105
|
-
modules: [
|
98
|
+
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
106
99
|
},
|
107
100
|
resolveLoader: {
|
108
|
-
modules: [
|
101
|
+
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
109
102
|
}
|
110
103
|
};
|
@@ -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,39 +58,40 @@ 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
|
-
|
68
|
+
include: _path.default.join(appPath, 'src')
|
69
|
+
}
|
70
|
+
/*,
|
71
|
+
{
|
72
|
+
test: /\.css$/,
|
73
|
+
use: [MiniCssExtractPlugin.loader, 'css-loader']
|
74
|
+
}*/
|
75
|
+
, {
|
76
|
+
test: /(\.module)?\.css$/,
|
74
77
|
use: [{
|
75
|
-
loader:
|
78
|
+
loader: _miniCssExtractPlugin.default.loader,
|
76
79
|
options: {
|
77
|
-
|
78
|
-
// by default it use publicPath in webpackOptions.output
|
79
|
-
//publicPath: '../'
|
80
|
+
publicPath: '../'
|
80
81
|
}
|
81
82
|
}, {
|
82
83
|
loader: 'css-loader',
|
83
84
|
options: {
|
84
|
-
modules:
|
85
|
-
|
86
|
-
|
85
|
+
modules: {
|
86
|
+
getLocalIdent: (0, _cssClassNameGenerate.default)(cssUniqueness, cssHashSelectors, classNamePrefix)
|
87
|
+
}
|
87
88
|
}
|
88
89
|
}]
|
89
90
|
}, {
|
90
91
|
test: /\.jpe?g$|\.gif$|\.png$/,
|
91
92
|
use: ['url-loader?limit=10000&name=./images/[name].[ext]']
|
92
93
|
}, {
|
93
|
-
test: /\.woff$|\.ttf$|\.eot$/,
|
94
|
+
test: /\.woff$|\.woff2$|\.ttf$|\.eot$/,
|
94
95
|
use: ['url-loader?limit=10000&name=./fonts/[name].[ext]']
|
95
96
|
}, {
|
96
97
|
test: /\.svg$/,
|
@@ -107,9 +108,9 @@ module.exports = {
|
|
107
108
|
}]
|
108
109
|
},
|
109
110
|
resolve: {
|
110
|
-
modules: [
|
111
|
+
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
111
112
|
},
|
112
113
|
resolveLoader: {
|
113
|
-
modules: [
|
114
|
+
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
114
115
|
}
|
115
116
|
};
|
@@ -1,120 +1,134 @@
|
|
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
|
11
|
+
var _loaderUtils = require("../loaderUtils");
|
12
12
|
|
13
|
-
var
|
13
|
+
var _libAlias = require("./libAlias");
|
14
14
|
|
15
|
-
var
|
16
|
-
|
17
|
-
var _loaderUtils = require('../loaderUtils');
|
15
|
+
var _configsAssetsLoaders = require("../loaderUtils/configsAssetsLoaders");
|
18
16
|
|
19
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
20
18
|
|
21
|
-
|
22
|
-
|
23
|
-
|
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
|
-
var output = {
|
56
|
-
path: _path2.default.join(appPath, outputFolder),
|
19
|
+
let options = (0, _utils.getOptions)();
|
20
|
+
let {
|
21
|
+
unstableDepsInverse,
|
22
|
+
app: {
|
23
|
+
folder,
|
24
|
+
context,
|
25
|
+
server,
|
26
|
+
outputFolder,
|
27
|
+
plugins,
|
28
|
+
exclude,
|
29
|
+
cssUniqueness,
|
30
|
+
seperateCssModules,
|
31
|
+
changeRuntimeChunkChar,
|
32
|
+
// we are going to use this for fonts file name collide in issue in devmode
|
33
|
+
enableChunkHash,
|
34
|
+
cssHashSelectors,
|
35
|
+
classNamePrefix,
|
36
|
+
selectorReplace,
|
37
|
+
disableES5Transpile,
|
38
|
+
devConsoleExculde,
|
39
|
+
sourcemap,
|
40
|
+
crossorigin
|
41
|
+
}
|
42
|
+
} = options;
|
43
|
+
let {
|
44
|
+
disableContextURL
|
45
|
+
} = server;
|
46
|
+
let appPath = process.cwd();
|
47
|
+
let contextURL = disableContextURL ? '' : context;
|
48
|
+
let serverUrl = (0, _utils.getServerURL)(server, 'https');
|
49
|
+
let output = {
|
50
|
+
path: _path.default.join(appPath, outputFolder),
|
57
51
|
filename: 'js/[name].js',
|
58
52
|
chunkFilename: 'js/[name].js',
|
59
|
-
publicPath: [serverUrl, contextURL].filter(
|
60
|
-
|
61
|
-
}).join('/') + '/',
|
62
|
-
jsonpFunction: context + 'Jsonp'
|
53
|
+
publicPath: `${[serverUrl, contextURL].filter(a => a).join('/')}/`,
|
54
|
+
jsonpFunction: `${context}Jsonp`
|
63
55
|
};
|
56
|
+
const nameTemplate = (0, _configsAssetsLoaders.createNameTemplate)(enableChunkHash);
|
64
57
|
|
65
|
-
if (
|
66
|
-
output.
|
67
|
-
return _path2.default.resolve(info.absoluteResourcePath);
|
68
|
-
};
|
58
|
+
if (crossorigin) {
|
59
|
+
output.crossOriginLoading = 'anonymous';
|
69
60
|
}
|
70
61
|
|
71
62
|
module.exports = {
|
72
|
-
entry: (0, _common.getEntries)(options, '
|
73
|
-
devtool:
|
63
|
+
entry: (0, _common.getEntries)(options, 'dev'),
|
64
|
+
devtool: sourcemap,
|
74
65
|
mode: 'development',
|
75
|
-
|
76
|
-
|
77
|
-
|
66
|
+
// watchOptions: {
|
67
|
+
// ignored: /node_modules.(?!@zohodesk)/
|
68
|
+
// },
|
69
|
+
output,
|
70
|
+
stats: options.app.disableWatch ? 'errors-only' : {
|
71
|
+
children: false
|
72
|
+
},
|
73
|
+
optimization: {
|
74
|
+
splitChunks: _common.splitChunks,
|
75
|
+
moduleIds: 'named',
|
76
|
+
runtimeChunk: {
|
77
|
+
name: entrypoint => changeRuntimeChunkChar ? `./runtime-${entrypoint.name}` : `./runtime~${entrypoint.name}`
|
78
|
+
}
|
79
|
+
},
|
80
|
+
plugins: (0, _pluginUtils.getDevPlugins)(options, output.publicPath),
|
78
81
|
module: {
|
82
|
+
/* strictExportPresence for break the build when imported module not present in respective file */
|
83
|
+
strictExportPresence: true,
|
79
84
|
rules: [{
|
80
85
|
test: /\.js$/,
|
81
|
-
use: (0, _loaderUtils.getDevJsLoaders)(
|
82
|
-
|
83
|
-
|
84
|
-
|
86
|
+
use: (0, _loaderUtils.getDevJsLoaders)(options),
|
87
|
+
include: module => {
|
88
|
+
let srcPath = _path.default.join(appPath, folder);
|
89
|
+
|
90
|
+
let depsPath = _path.default.join(appPath, 'node_modules', '@zohodesk');
|
91
|
+
|
92
|
+
if (module.includes(srcPath) || devConsoleExculde && module.includes(depsPath)) {
|
93
|
+
return true;
|
94
|
+
}
|
95
|
+
|
96
|
+
return false;
|
97
|
+
}
|
98
|
+
}, seperateCssModules ? {
|
85
99
|
test: /\.css$/,
|
100
|
+
exclude: /\.module\.css$/,
|
101
|
+
use: (0, _loaderUtils.getCSSLoaders)(plugins, exclude, '[local]', false, null)
|
102
|
+
} : null, {
|
103
|
+
test: seperateCssModules ? /\.module\.css$/ : /(\.module)?\.css$/,
|
104
|
+
use: (0, _loaderUtils.getCSSLoaders)(plugins, exclude, null, cssUniqueness, selectorReplace, cssHashSelectors, classNamePrefix)
|
105
|
+
}, (0, _configsAssetsLoaders.configImageLoader)(nameTemplate), (0, _configsAssetsLoaders.configFontLoader)(nameTemplate), (0, _configsAssetsLoaders.configSVGLoader)(nameTemplate), (0, _configsAssetsLoaders.configVideoLoader)(nameTemplate), (0, _configsAssetsLoaders.configAudioLoader)(nameTemplate), {
|
106
|
+
test: /\.tmpl$/,
|
86
107
|
use: [{
|
87
|
-
loader:
|
108
|
+
loader: 'html-loader',
|
88
109
|
options: {
|
89
|
-
|
90
|
-
// by default it use publicPath in webpackOptions.output
|
91
|
-
//publicPath: '../'
|
92
|
-
}
|
93
|
-
}, {
|
94
|
-
loader: 'css-loader',
|
95
|
-
options: {
|
96
|
-
modules: true,
|
97
|
-
localIdentName: '[name]__[local]__[hash:base64:5]'
|
110
|
+
minimize: true
|
98
111
|
}
|
99
112
|
}]
|
100
113
|
}, {
|
101
|
-
test: /\.
|
102
|
-
use:
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
}]
|
114
|
+
test: /\.worker.js$/,
|
115
|
+
use: {
|
116
|
+
loader: require.resolve('../loaders/workerLoader.js'),
|
117
|
+
options: {
|
118
|
+
esModule: true,
|
119
|
+
filename: 'js/[name].js'
|
120
|
+
}
|
121
|
+
}
|
122
|
+
}].filter(Boolean)
|
110
123
|
},
|
111
124
|
externals: {
|
112
125
|
ZC: '$ZC'
|
113
126
|
},
|
114
127
|
resolve: {
|
115
|
-
modules: [
|
128
|
+
modules: unstableDepsInverse ? ['node_modules', _path.default.resolve(__dirname, '..', '..', 'node_modules')] : [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules'],
|
129
|
+
alias: disableES5Transpile ? _libAlias.libAlias : {}
|
116
130
|
},
|
117
131
|
resolveLoader: {
|
118
|
-
modules: [
|
132
|
+
modules: unstableDepsInverse ? ['node_modules', _path.default.resolve(__dirname, '..', '..', 'node_modules')] : [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
119
133
|
}
|
120
134
|
};
|