@zohodesk/react-cli 1.1.18-exp.4 → 1.1.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. package/npm-shrinkwrap.json +2 -2
  2. package/package.json +1 -1
  3. package/packages/client_build_tool/lib/allCommandsConfigs.js +0 -23
  4. package/packages/client_build_tool/lib/buildToolLoggers.js +0 -32
  5. package/packages/client_build_tool/lib/commands/build/commandExecutor.js +0 -21
  6. package/packages/client_build_tool/lib/commands/build/config.js +0 -12
  7. package/packages/client_build_tool/lib/commands/build/errorHander.js +0 -10
  8. package/packages/client_build_tool/lib/commands/build/index.js +0 -35
  9. package/packages/client_build_tool/lib/commands/build/optionsProcesser.js +0 -40
  10. package/packages/client_build_tool/lib/commands/buildEs/commandExecutor.js +0 -17
  11. package/packages/client_build_tool/lib/commands/buildEs/config.js +0 -12
  12. package/packages/client_build_tool/lib/commands/buildLib/commandExecutor.js +0 -17
  13. package/packages/client_build_tool/lib/commands/buildLib/config.js +0 -12
  14. package/packages/client_build_tool/lib/commands/start/commandExecutor.js +0 -13
  15. package/packages/client_build_tool/lib/commands/start/config.js +0 -12
  16. package/packages/client_build_tool/lib/commands/start/deprecationHandler.js +0 -10
  17. package/packages/client_build_tool/lib/commands/start/errorHander.js +0 -10
  18. package/packages/client_build_tool/lib/commands/start/optionsProcesser.js +0 -36
  19. package/packages/client_build_tool/lib/commands/start/postProcesser.js +0 -10
  20. package/packages/client_build_tool/lib/commands/start/preProcesser.js +0 -10
  21. package/packages/client_build_tool/lib/commandsRouter.js +0 -71
  22. package/packages/client_build_tool/lib/shared/bundler/webpack/common/decidePublicPath.js +0 -44
  23. package/packages/client_build_tool/lib/shared/bundler/webpack/common/libAlias.js +0 -31
  24. package/packages/client_build_tool/lib/shared/bundler/webpack/common/nameTemplates.js +0 -51
  25. package/packages/client_build_tool/lib/shared/bundler/webpack/common/resourceBasedPublicPath.js +0 -21
  26. package/packages/client_build_tool/lib/shared/bundler/webpack/cssLoaders.js +0 -16
  27. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/CdnChangePlugin.js +0 -111
  28. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/EFCPlugin.js +0 -1
  29. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ContributionGuide.md +0 -11
  30. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nKeysIdentifer.js +0 -136
  31. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nSplit.md +0 -95
  32. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/README.md +0 -25
  33. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/constants.js +0 -29
  34. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/createHash.js +0 -24
  35. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nDependency.js +0 -99
  36. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nLoadingRuntimeModule.js +0 -81
  37. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nModule.js +0 -201
  38. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/index.js +0 -401
  39. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/optionsHandler.js +0 -67
  40. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/pathCreator.js +0 -23
  41. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/readI18nValues.js +0 -29
  42. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateFileName.js +0 -49
  43. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateHashHelpers.js +0 -77
  44. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/collectI18nKeys.js +0 -63
  45. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/hashUtils.js +0 -19
  46. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/index.js +0 -31
  47. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/propertiesUtils.js +0 -127
  48. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RTLSplitPlugin.js +0 -1
  49. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +0 -63
  50. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtlCssPlugin.js +0 -89
  51. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtrSplit.md +0 -34
  52. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/replaceCssDirTemplate.js +0 -15
  53. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ServiceWorkerPlugin.js +0 -155
  54. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin.js +0 -49
  55. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_postcss_loaders/ExcludePlugin.js +0 -58
  56. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_postcss_loaders/RTLSplitPlugin.js +0 -139
  57. package/packages/client_build_tool/lib/shared/bundler/webpack/devServerConfig.js +0 -34
  58. package/packages/client_build_tool/lib/shared/bundler/webpack/getCSSLoaders.js +0 -30
  59. package/packages/client_build_tool/lib/shared/bundler/webpack/jsLoaders.js +0 -17
  60. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/assetLoaders.js +0 -14
  61. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/babelLoaderConfig.js +0 -24
  62. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configHtmlTemplateLoader.js +0 -18
  63. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configWebWorkerLoader.js +0 -21
  64. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configsAssetsLoaders.js +0 -138
  65. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/cssClassNameGenerate.js +0 -83
  66. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/getCssLoaderOptions.js +0 -23
  67. package/packages/client_build_tool/lib/shared/bundler/webpack/loaders/workerLoader.js +0 -133
  68. package/packages/client_build_tool/lib/shared/bundler/webpack/optimizationConfig.js +0 -39
  69. package/packages/client_build_tool/lib/shared/bundler/webpack/outputConfig.js +0 -28
  70. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCdnChangePlugin.js +0 -18
  71. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCopyThirdpartyFile.js +0 -38
  72. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configEnvVariables.js +0 -24
  73. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configHtmlWebpackPlugin.js +0 -28
  74. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configI18nSplitPlugin.js +0 -35
  75. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configIgnorePlugin.js +0 -16
  76. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configMiniCSSExtractPlugin.js +0 -23
  77. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configProgressPlugin.js +0 -19
  78. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configRtlCssPlugin.js +0 -27
  79. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configServiceWorkerPlugin.js +0 -18
  80. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configUglifyCSSPlugin.js +0 -15
  81. package/packages/client_build_tool/lib/shared/bundler/webpack/plugins.js +0 -39
  82. package/packages/client_build_tool/lib/shared/bundler/webpack/postcssPlugins.js +0 -36
  83. package/packages/client_build_tool/lib/shared/bundler/webpack/resolvers.js +0 -42
  84. package/packages/client_build_tool/lib/shared/bundler/webpack/splitChunksConfig.js +0 -12
  85. package/packages/client_build_tool/lib/shared/bundler/webpack/webpack.dev.config.js +0 -17
  86. package/packages/client_build_tool/lib/shared/bundler/webpack/webpackBuild.js +0 -24
  87. package/packages/client_build_tool/lib/shared/bundler/webpack/webpackConfig.js +0 -50
  88. package/packages/client_build_tool/lib/shared/commands-utlis/doBasicRequiermentCheck.js +0 -16
  89. package/packages/client_build_tool/lib/shared/commands-utlis/getCliPath.js +0 -38
  90. package/packages/client_build_tool/lib/shared/commands-utlis/index.js +0 -29
  91. package/packages/client_build_tool/lib/shared/commands-utlis/log.js +0 -13
  92. package/packages/client_build_tool/lib/shared/commands-utlis/readArgsFormCommandLine.js +0 -11
  93. package/packages/client_build_tool/lib/shared/commands-utlis/readOptionFormCommandLine.js +0 -11
  94. package/packages/client_build_tool/lib/shared/commands-utlis/spanSync.js +0 -35
  95. package/packages/client_build_tool/lib/shared/constants.js +0 -33
  96. package/packages/client_build_tool/lib/shared/schemas/applyValuesToShema.js +0 -37
  97. package/packages/client_build_tool/lib/shared/schemas/cliArgsToObject.js +0 -37
  98. package/packages/client_build_tool/lib/shared/schemas/defaultConfigValues.js +0 -119
  99. package/packages/client_build_tool/lib/shared/schemas/deprecatedOptionsHandler.js +0 -65
  100. package/packages/client_build_tool/lib/shared/schemas/getCWD.js +0 -23
  101. package/packages/client_build_tool/lib/shared/schemas/getNpmVersion.js +0 -21
  102. package/packages/client_build_tool/lib/shared/schemas/npmConfigToObject.js +0 -32
  103. package/packages/client_build_tool/lib/shared/schemas/oldDefaultConfigValues.js +0 -480
  104. package/packages/client_build_tool/lib/shared/schemas/readOptions.js +0 -55
  105. package/packages/client_build_tool/lib/shared/schemas/readOptionsForPackageJson.js +0 -26
  106. package/packages/client_build_tool/lib/shared/schemas/readOptionsOld.js +0 -152
  107. package/packages/client_build_tool/lib/shared/server/cert/Tsicsezwild-22-23.crt +0 -37
  108. package/packages/client_build_tool/lib/shared/server/cert/Tsicsezwild-22-23.key +0 -27
  109. package/packages/client_build_tool/lib/shared/server/configWebpackDevMiddleware.js +0 -40
  110. package/packages/client_build_tool/lib/shared/server/corsHandleing.js +0 -28
  111. package/packages/client_build_tool/lib/shared/server/getIp.js +0 -30
  112. package/packages/client_build_tool/lib/shared/server/getServerURL.js +0 -29
  113. package/packages/client_build_tool/lib/shared/server/httpsOptions.js +0 -53
  114. package/packages/client_build_tool/lib/shared/server/initExpressApp.js +0 -19
  115. package/packages/client_build_tool/lib/shared/server/initialHTMLHandling.js +0 -66
  116. package/packages/client_build_tool/lib/shared/server/serveContextFiles.js +0 -24
  117. package/packages/client_build_tool/lib/shared/server/serverBywebpackDevMiddleware.js +0 -40
  118. package/packages/client_build_tool/lib/shared/server/startHttpServer.js +0 -26
  119. package/packages/client_build_tool/lib/shared/server/startHttpsServer.js +0 -34
  120. package/packages/client_build_tool/lib/shared/server/unwanted/addHttp2Server.js +0 -41
  121. package/packages/client_build_tool/lib/shared/server/unwanted/configWebpackDevMiddleware.js +0 -44
  122. package/packages/client_build_tool/lib/shared/server/unwanted/devServerUtlis.js +0 -1
  123. package/packages/client_build_tool/lib/shared/server/unwanted/mockApiSupport.js +0 -19
  124. package/packages/client_build_tool/lib/shared/server/unwanted/webpackConfig.js +0 -32
  125. package/packages/client_build_tool/lib/shared/server/unwanted/websocketMockSetup.js +0 -48
  126. package/packages/client_build_tool/lib/shared/server/urlConcat.js +0 -25
  127. package/packages/client_build_tool/lib/shared/utils/utils.js +0 -1
@@ -1,155 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _fs = _interopRequireDefault(require("fs"));
9
-
10
- var _path = _interopRequireDefault(require("path"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- //import { getI18nFileUrlPathTemplate } from './I18nSplitPlugin/utils/getI18nFileUrlPathTemplate';
15
- //import { getOptions } from '../utils';
16
- //import I18nKeysIdentifer from './I18nSplitPlugin/I18nKeysIdentifer';
17
- //import { replaceCssDirTemplateMapper } from './RtlSplitPlugin/replaceCssDirTemplate';
18
- // const {
19
- // css: { enableRTLSplit },
20
- // i18n: { chunkSplitEnable }
21
- // } = getOptions();
22
- class ServiceWorkerPlugin {
23
- constructor(options) {
24
- this.i18nFileNameTemplate = options.i18nFileNameTemplate;
25
- this.fileName = options.fileName;
26
- this.serviceWorkerPath = options.filePath;
27
- this.writePath = options.exitPath;
28
- this.replaceText = options.replaceText; // this.publicPaths = options.publicPaths;
29
- }
30
-
31
- isInitialChunk(chunk) {
32
- if ('canBeInitial' in chunk) {
33
- return chunk.canBeInitial();
34
- }
35
-
36
- return chunk.isInitial();
37
- }
38
-
39
- apply(compiler) {
40
- compiler.hooks.emit.tap('ServiceWorkerPlugin', compilation => {
41
- _fs.default.readFile(this.serviceWorkerPath, 'utf-8', (err, data) => {
42
- if (err) {
43
- throw new Error(err);
44
- } else {
45
- /* const extractedChunks = compilation.chunks.filter(chunk => {
46
- if ('canBeInitial' in chunk) {
47
- return chunk.canBeInitial();
48
- }
49
- return chunk.isInitial();
50
- }); */
51
- // let [js, css, , , i18nPublicPath] = this.publicPaths;
52
- // let initialChunkUrls = [];
53
- let allChunkUrls = [];
54
- let allI18nAssets = [];
55
- let entrypoint = compilation.entrypoints.get('main');
56
- let initialChunkUrls = entrypoint.getFiles();
57
- const cssDirTemplate = '@dir@';
58
- /**
59
- * NOTE:
60
- * if chunkSplitEnable is false means,
61
- * serviceWorker will get i18n files path for html
62
- */
63
- // let initalI18nAssets = chunkSplitEnable
64
- // ? entrypoint.chunks
65
- // //.filter(chunk => I18nKeysIdentifer.isChunkHasI18n(chunk))
66
- // .map(chunk =>
67
- // getI18nFileUrlPathTemplate(
68
- // compilation,
69
- // chunk,
70
- // this.i18nFileNameTemplate,
71
- // '@locale@'
72
- // )
73
- // )
74
- // : [];
75
-
76
- let initalI18nAssets = []; //chunkSplitEnable &&
77
-
78
- compilation.chunks.filter(c => !this.isInitialChunk(c)) //.filter(chunk => I18nKeysIdentifer.isChunkHasI18n(chunk))
79
- .forEach(chunk => {
80
- // let isInitial = this.isInitialChunk(chunk);
81
- allChunkUrls = allChunkUrls.concat(chunk.files); // allI18nAssets.push(
82
- // getI18nFileUrlPathTemplate(
83
- // compilation,
84
- // chunk,
85
- // this.i18nFileNameTemplate,
86
- // '@locale@'
87
- // )
88
- // );
89
- });
90
- /** Removing source map files from getting added */
91
-
92
- initialChunkUrls = initialChunkUrls.filter(fileName => !fileName.endsWith('.map'));
93
- allChunkUrls = allChunkUrls.filter(fileName => !fileName.endsWith('.map')); // if (enableRTLSplit) {
94
- // initialChunkUrls = replaceCssDirTemplateMapper(
95
- // initialChunkUrls,
96
- // cssDirTemplate
97
- // );
98
- // allChunkUrls = replaceCssDirTemplateMapper(
99
- // allChunkUrls,
100
- // cssDirTemplate
101
- // );
102
- // }
103
-
104
- let mod = data.replace(this.replaceText, `self.assets = ${JSON.stringify(initialChunkUrls.concat(initalI18nAssets))};self.allChunks = ${JSON.stringify(allChunkUrls.concat(allI18nAssets))};`);
105
-
106
- if (!_fs.default.existsSync(this.writePath)) {
107
- _fs.default.mkdirSync(this.writePath, {
108
- recursive: true
109
- });
110
- }
111
-
112
- _fs.default.writeFileSync(_path.default.join(this.writePath, `${this.fileName}`), mod);
113
- }
114
- });
115
- });
116
- }
117
-
118
- } // compiler.hooks.thisCompilation.tap('AddAssetPlugin', compilation => {
119
- // compilation.hooks.processAssets.tapPromise(tapOptions, async () => {
120
- // let source;
121
- // if (typeof this.source === 'string') {
122
- // if (compilation.getAsset(this.filePath)) {
123
- // // Skip emitting the asset again because it's immutable
124
- // return;
125
- // }
126
- // source = this.source;
127
- // } else {
128
- // source = await this.source(compilation);
129
- // }
130
- // compilation.emitAsset(this.filePath, new RawSource(source));
131
- // });
132
- // });
133
- // getContentHash(compiler, compilation, source) {
134
- // const { outputOptions } = compilation;
135
- // const { hashDigest, hashDigestLength, hashFunction, hashSalt } =
136
- // outputOptions;
137
- // const hash = compiler.webpack.util.createHash(
138
- // /** @type {string} */ (hashFunction)
139
- // );
140
- // if (hashSalt) {
141
- // hash.update(hashSalt);
142
- // }
143
- // hash.update(source);
144
- // const fullContentHash = hash.digest(hashDigest);
145
- // return fullContentHash.toString().slice(0, hashDigestLength);
146
- // }
147
- // const contentHash = CopyPlugin.getContentHash(
148
- // compiler,
149
- // compilation,
150
- // source.buffer()
151
- // );
152
- //hash same as index.html file ??
153
-
154
-
155
- exports.default = ServiceWorkerPlugin;
@@ -1,49 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _uglifycss = _interopRequireDefault(require("uglifycss"));
9
-
10
- var _webpack = require("webpack");
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- /* eslint-disable class-methods-use-this */
15
- // import { RawSource } from 'webpack-sources';
16
- const pluginName = 'UglifyCSSPlugin'; // TODO: Check for css minimizer plugin
17
-
18
- class UglifyCSSPlugin {
19
- apply(compiler) {
20
- const {
21
- RawSource
22
- } = compiler.webpack.sources;
23
- compiler.hooks.emit.tap(pluginName, compilation => {
24
- compilation.hooks.processAssets.tapAsync({
25
- name: pluginName,
26
- stage: _webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE
27
- }, assets => {
28
- Object.keys(assets).filter(filename => /\.css$/.test(filename)).forEach(filename => {
29
- try {
30
- let asset = compilation.assets[filename].source();
31
-
32
- if (typeof asset !== 'string') {
33
- asset = asset.toString();
34
- }
35
-
36
- const result = _uglifycss.default.processString(asset);
37
-
38
- compilation.updateAsset(filename, new RawSource(result));
39
- } catch (e) {
40
- compilation.errors.push(e);
41
- }
42
- });
43
- });
44
- });
45
- }
46
-
47
- }
48
-
49
- exports.default = UglifyCSSPlugin;
@@ -1,58 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- exports.excludeEmptyCheckPlugin = excludeEmptyCheckPlugin;
8
-
9
- var _postcss = _interopRequireDefault(require("postcss"));
10
-
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
-
13
- const ExcludePlugin = opts => {
14
- const {
15
- plugins,
16
- exclude
17
- } = opts;
18
- return {
19
- postcssPlugin: 'postcss-dark-theme-class',
20
-
21
- Once(root, {
22
- result
23
- }) {
24
- const inputFile = root.source.input.file;
25
- const isIgnoredFile = exclude.some(file => inputFile.indexOf(file) !== -1);
26
-
27
- if (!isIgnoredFile) {
28
- const handler = response => response.messages.forEach(msg => result.messages.push(msg));
29
-
30
- return (0, _postcss.default)(plugins).process(root, {
31
- from: undefined
32
- }).then(handler);
33
- }
34
-
35
- return root;
36
- }
37
-
38
- };
39
- };
40
-
41
- ExcludePlugin.postcss = true;
42
- var _default = ExcludePlugin;
43
- exports.default = _default;
44
-
45
- function excludeEmptyCheckPlugin({
46
- enable,
47
- exclude,
48
- plugins
49
- }) {
50
- if (!enable) {
51
- return [];
52
- }
53
-
54
- return exclude.length === 0 ? plugins : [ExcludePlugin({
55
- exclude,
56
- plugins
57
- })];
58
- }
@@ -1,139 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.separateRtlAndLtr = separateRtlAndLtr;
7
- exports.separateSingleDir = separateSingleDir;
8
-
9
- var postcss = _interopRequireWildcard(require("postcss"));
10
-
11
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
-
13
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
-
15
- /* eslint-disable no-param-reassign */
16
- const oppositeDir = {
17
- ltr: 'rtl',
18
- rtl: 'ltr'
19
- };
20
-
21
- function compareSelector(selector1, selector2) {
22
- // console.log({ selector1, selector2 }, selector1 === selector2);
23
- return selector1 === selector2;
24
- }
25
-
26
- const directionRegexs = {
27
- ltr: /\[dir=ltr\]/,
28
- rtl: /\[dir=rtl\]/
29
- };
30
-
31
- const getRegex = dir => directionRegexs[dir];
32
-
33
- const getOppositeRegex = dir => getRegex(oppositeDir[dir]);
34
-
35
- function selectorMinifySameDir(selector, direction) {
36
- // NOTE: if this rule is same dir as current need
37
- // then we can just remove that [dir=ltr] or [dir=rtl]
38
- // it just for minimaze selector
39
- const regex = getRegex(direction);
40
- return selector.replace(regex, '').trim();
41
- }
42
- /**
43
- * this funtion will remove given rule,
44
- * if given selector and it's previous sibiling rule selector are same
45
- * current rule properties will move to previous sibiling rule.
46
- * @param {Rule} rule current rule
47
- */
48
-
49
-
50
- function mergeIfSameSelector(rule) {
51
- // NOTE: to merge dublicate selector rules
52
- const prev = rule.prev();
53
-
54
- if (prev && compareSelector(prev.selector, rule.selector)) {
55
- rule.each(decl => {
56
- prev.append(decl);
57
- });
58
- rule.remove();
59
- }
60
- }
61
- /**
62
- * this funtion will remove given rule,
63
- * if given selector and it's previous sibiling rule selector are same
64
- * current rule properties will move to previous sibiling rule.
65
- * @param {Rule} rule current rule
66
- */
67
-
68
-
69
- function removeIfOppsiteDirRule(rule, direction, rootOptions) {
70
- // console.log({ rule, type: rule.type });
71
- const selectors = rule.selector.split(/\s*,\s*/); // NOTE: if we use opposite dir selector as custom override reason,
72
- // and compain normal selector with it, In this case
73
- // we just a have to remove that selector only not full rule
74
-
75
- const oppositeDirRegex = getOppositeRegex(direction);
76
- let remainingSelectors = selectors.filter(selector => !oppositeDirRegex.test(selector));
77
-
78
- if (!rootOptions.disableMinifySelector) {
79
- remainingSelectors = remainingSelectors.map(selector => selectorMinifySameDir(selector, direction));
80
- }
81
-
82
- if (remainingSelectors.length) {
83
- rule.selector = remainingSelectors.join(', ');
84
- } else {
85
- // NOTE: every selector is opposite dir then we have to remove the rule
86
- rule.remove();
87
- }
88
- }
89
-
90
- function removeIfOppsiteDirKeyframe(rule, direction) {
91
- const name = rule.params;
92
- const keyFrameDirName = name.slice(name.lastIndexOf('-') + 1);
93
-
94
- if (keyFrameDirName === oppositeDir[direction]) {
95
- // console.log({ m: 'removed', keyFrameName: rule.params });
96
- rule.remove();
97
- }
98
- }
99
-
100
- function separateSingleDir(root, direction, rootOptions) {
101
- root.walkRules(rule => {
102
- removeIfOppsiteDirRule(rule, direction, rootOptions);
103
- mergeIfSameSelector(rule);
104
- });
105
- root.walkAtRules(rule => {
106
- removeIfOppsiteDirKeyframe(rule, direction);
107
- });
108
- return root;
109
- }
110
-
111
- function separateRtlAndLtr(css, rootOptions) {
112
- // let processor = postcss([]).process(css);
113
- const root = postcss.parse(css); // let { root } = processor;
114
- // console.log(processor, root);
115
- // NOTE: I did first rtl then ltr , Because for ltr I use original root ref
116
-
117
- const rtlRoot = separateSingleDir(root.clone(), 'rtl', rootOptions); // console.log('############################');
118
-
119
- const ltrRoot = separateSingleDir(root, 'ltr', rootOptions);
120
- return {
121
- ltrRoot,
122
- rtlRoot,
123
- ltr: ltrRoot.toString(),
124
- rtl: rtlRoot.toString()
125
- };
126
- } // NOTE: to test in https://astexplorer.net/
127
- // you can test with sample input https://astexplorer.net/#/gist/a892a509eb585099355ef53ef094f836/1ca70d5f7af3b88ca4910296e12f118e9712c874
128
- // export default postcss.plugin('postcss-rtl-remove', (options = {}) =>
129
- // // Work with options here
130
- // root => {
131
- // const rtlRoot = separateSingleDir(root.clone(), 'rtl');
132
- // const ltrRoot = separateSingleDir(root, 'ltr');
133
- // // root.append(postcss.comment({ text: 'comment' }));
134
- // root.append(postcss.comment({ text: 'this is spliting part ' }));
135
- // root.append(rtlRoot);
136
- // //console.log({root, roots:root+""}, root+"")
137
- // // Transform CSS AST here
138
- // }
139
- // );
@@ -1,34 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.devServerConfig = devServerConfig;
7
-
8
- var _path = require("path");
9
-
10
- var _constants = require("../../constants");
11
-
12
- // import { httpsOptions } from '../../server/httpsOptions';
13
- function devServerConfig(options) {
14
- const {
15
- context,
16
- server
17
- } = options;
18
- const {
19
- port
20
- } = server;
21
- return {
22
- static: {
23
- directory: (0, _path.join)(_constants.appPath, context)
24
- },
25
- allowedHosts: 'all',
26
- // https: httpsOptions(options),
27
- client: {
28
- logging: 'error',
29
- overlay: true
30
- },
31
- // contentBase: "app"
32
- port
33
- };
34
- }
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getCSSLoaders = getCSSLoaders;
7
-
8
- var _miniCssExtractPlugin = _interopRequireDefault(require("mini-css-extract-plugin"));
9
-
10
- var _getCssLoaderOptions = require("./loaderConfigs/getCssLoaderOptions");
11
-
12
- var _postcssPlugins = require("./postcssPlugins");
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- function getCSSLoaders(options) {
17
- const neededPostCssPlugins = (0, _postcssPlugins.postcssPlugins)(options);
18
- const cssLoaderOptions = (0, _getCssLoaderOptions.getCssLoaderOptions)(options);
19
- return [_miniCssExtractPlugin.default.loader, {
20
- loader: 'css-loader',
21
- options: cssLoaderOptions
22
- }, neededPostCssPlugins.length && {
23
- loader: 'postcss-loader',
24
- options: {
25
- postcssOptions: {
26
- plugins: neededPostCssPlugins
27
- }
28
- }
29
- }].filter(Boolean);
30
- }
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.jsLoaders = jsLoaders;
7
-
8
- var _babelLoaderConfig = require("./loaderConfigs/babelLoaderConfig");
9
-
10
- function jsLoaders(options) {
11
- return [{
12
- test: /\.js$/,
13
- exclude: /node_modules/,
14
- use: [(0, _babelLoaderConfig.babelLoaderConfig)(options)] // include: path.join(appPath, folder)
15
-
16
- }];
17
- }
@@ -1,14 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.assetLoaders = assetLoaders;
7
-
8
- var _configsAssetsLoaders = require("./configsAssetsLoaders");
9
-
10
- function assetLoaders(options) {
11
- // const { enableChunkHash } = options;
12
- // const nameTemplate = createNameTemplate(enableChunkHash);
13
- return [(0, _configsAssetsLoaders.configImageLoader)(options), (0, _configsAssetsLoaders.configFontLoader)(options), (0, _configsAssetsLoaders.configSVGLoader)(options), (0, _configsAssetsLoaders.configAudioLoader)(options), (0, _configsAssetsLoaders.configVideoLoader)(options)];
14
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.babelLoaderConfig = babelLoaderConfig;
7
- const supportedBrowserVersions = ['last 3 Chrome versions', 'last 3 Firefox versions', 'last 3 Edge versions', 'last 3 Safari versions'];
8
-
9
- function babelLoaderConfig(options) {
10
- return {
11
- loader: 'babel-loader',
12
- options: {
13
- presets: [[require.resolve('@babel/preset-env'), {
14
- modules: false,
15
- useBuiltIns: 'usage',
16
- corejs: 3,
17
- targets: {
18
- browsers: supportedBrowserVersions
19
- }
20
- }], require.resolve('@babel/preset-react')],
21
- cacheDirectory: true
22
- }
23
- };
24
- }
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.configHtmlTemplateLoader = configHtmlTemplateLoader;
7
-
8
- function configHtmlTemplateLoader(options) {
9
- return {
10
- test: /\.tmpl$/,
11
- use: [{
12
- loader: 'html-loader',
13
- options: {
14
- minimize: true
15
- }
16
- }]
17
- };
18
- }
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.configWebWorkerLoader = configWebWorkerLoader;
7
-
8
- var _nameTemplates = require("../common/nameTemplates");
9
-
10
- function configWebWorkerLoader(options) {
11
- return {
12
- test: /\.worker.js$/,
13
- use: {
14
- loader: require.resolve('../loaders/workerLoader.js'),
15
- options: {
16
- esModule: true,
17
- filename: (0, _nameTemplates.nameTemplates)('workerjs', options)
18
- }
19
- }
20
- };
21
- }