@zohodesk/react-cli 0.0.1-exp.164.2 → 0.0.1-exp.168.1

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.
Files changed (51) hide show
  1. package/.prettierrc +5 -0
  2. package/README.md +77 -1
  3. package/bin/cli.js +19 -15
  4. package/cert/Tsicsezwild-22-23.crt +37 -0
  5. package/cert/Tsicsezwild-22-23.key +27 -0
  6. package/docs/CustomChunks.md +26 -0
  7. package/docs/DevStart.md +18 -0
  8. package/docs/InstallNode.md +28 -0
  9. package/docs/TODOS.md +10 -0
  10. package/docs/ValueReplacer.md +60 -0
  11. package/docs/warnings_while_install.txt +35 -0
  12. package/lib/common/splitChunks.js +57 -10
  13. package/lib/common/testPattern.js +69 -0
  14. package/lib/common/valueReplacer.js +55 -0
  15. package/lib/configs/jest.config.js +6 -1
  16. package/lib/configs/webpack.dev.config.js +9 -15
  17. package/lib/configs/webpack.docs.config.js +32 -35
  18. package/lib/configs/webpack.impact.config.js +5 -13
  19. package/lib/configs/webpack.prod.config.js +4 -3
  20. package/lib/loaderUtils/configsAssetsLoaders.js +88 -0
  21. package/lib/loaderUtils/getCSSLoaders.js +17 -13
  22. package/lib/postcss-plugins/ValueReplacer.js +46 -0
  23. package/lib/schemas/index.js +34 -3
  24. package/lib/servers/{devBulid.js → devBuild.js} +7 -3
  25. package/lib/servers/getCliPath.js +8 -2
  26. package/lib/servers/httpsOptions.js +2 -3
  27. package/lib/servers/nowatchserver.js +2 -2
  28. package/lib/servers/server.js +20 -5
  29. package/lib/utils/repoClone.js +5 -2
  30. package/lib/utils/rtl.js +19 -2
  31. package/lib/utils/useExitCleanup.js +55 -0
  32. package/npm8.md +9 -0
  33. package/package.json +2 -1
  34. package/postpublish.js +6 -0
  35. package/cert/cert.pem +0 -37
  36. package/cert/key.pem +0 -27
  37. package/cert/passphrase.pem +0 -1
  38. package/eslint/NOTES.md +0 -3
  39. package/eslint/a23.c +0 -16
  40. package/eslint/a28.c +0 -25
  41. package/eslint/a29.c +0 -25
  42. package/eslint/a30.c +0 -29
  43. package/eslint/a31.c +0 -23
  44. package/eslint/a35.c +0 -23
  45. package/eslint/a36.c +0 -18
  46. package/eslint/a37.c +0 -25
  47. package/eslint/a38.c +0 -28
  48. package/eslint/a39.c +0 -17
  49. package/eslint/a40.c +0 -32
  50. package/eslint/mockapi.html +0 -18
  51. package/eslint/mockapi.md +0 -5
package/.prettierrc ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "trailingComma": "none",
3
+ "singleQuote": true,
4
+ "jsxSingleQuote": true
5
+ }
package/README.md CHANGED
@@ -2,6 +2,82 @@
2
2
 
3
3
  A CLI tool for build modern web application and libraries
4
4
 
5
+ # 0.0.1-exp.168.1
6
+
7
+ Changes:-
8
+
9
+ 1. `cliRootPath` option removed `react-cli.app.cliRootPath` in `package.json`
10
+ Due to the reason we updated our logic to find package's executable path.
11
+ 2. `--efc_output_file=efc-sdk-[version].js` option added to modify efc output file by terminal
12
+ 3. added logic to print error message during command run, Previously when executable not found error messages not printed
13
+
14
+ # 0.0.1-beta.168
15
+
16
+ Changes:-
17
+
18
+ 1. `enableChunkHash` option enabled for dev mode, use it as `react-cli.app.enableChunkHash` in `package.json`
19
+ 2. `--enable_efc=true` option added to enable efc by terminal
20
+ 3. unwanted pem files removed
21
+
22
+ # 0.0.1-beta.167
23
+
24
+ SSL certificate update
25
+ this version has same as `0.0.1-exp.166.1`, `0.0.1-exp.166.2` and below and some minor changes
26
+ Features:-
27
+
28
+ - `--shallow_clone` option to `react-cli clone` this option will be usefull for shallow cloning repos in build time we don't need commit messages it will be 2x fast this way
29
+ - Example `react-cli clone --clone_type=git --clone_url=https://some.url --shallow_clone`
30
+ - `cliRootPath` option added for npm workspace related path problems
31
+ - Usage `package.json` , "react-cli" => "cliRootPath" stright key
32
+ - `unstableDepsInverse` option added for use app need library first priority over react-cli packages
33
+ - Usage `package.json` , "react-cli" => "unstableDepsInverse" stright key
34
+
35
+ Issue Fix :-
36
+
37
+ - In devmode initial html not recived after second rebuild issue fix.
38
+ - typo fix `devBulid` to `devBuild`.
39
+ - `disableES5Transpile` option missed in docs now added.
40
+ - docs libAlias not work as app for example in app we always take `es` folder to build for treshaking and reasons,
41
+ But that option not enabled in docs. now it is enabled.
42
+ - In `react-cli devbuild` command options not working properly,
43
+ when above command run via terminal not via npm run script options not working
44
+ So we send that options to webpack then it works as expected.
45
+ this behaviour need to check across os and need to be cross check with other commends as well for now we only fixed this
46
+
47
+ # 0.0.1-exp.166.2
48
+
49
+ Changes:-
50
+
51
+ - `-w` option (watch option) added for `react-cli rtl`
52
+ - Example `react-cli rtl ./src ./lib -w`
53
+ <!-- need to handle `react-cli rtl` options correctly -->
54
+ - disableES5Transpile option libAlias added for docs
55
+
56
+ # 0.0.1-exp.166.1
57
+
58
+ Changes:-
59
+
60
+ - `__testUtils__/globals.js` to jest is not mantatory
61
+ - disableES5Transpile option libAlias added
62
+
63
+ # 0.0.1-beta.166
64
+
65
+ this version has same as `# 0.0.1-exp.164.1`, `# 0.0.1-exp.164.2` and below and some minor changes
66
+
67
+ - google chorme cors preflight issue fix
68
+
69
+ # 0.0.1-beta.165
70
+
71
+ - `valueReplacer` option added in shemas for font name replace related issue handling, for more [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/ValueReplacer.md)
72
+ - `valuereplacer` option added in react-cli it takes three
73
+ 1. sourceDir
74
+ 2. distDir
75
+ 3. `copyAll` is boolean flag which is for copy all other file or not. "true" means copy all files.
76
+
77
+ # 0.0.1-exp.164.1
78
+
79
+ - extra features in custom chunks reffer [this](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/CustomChunks.md)
80
+
5
81
  # 0.0.1-exp.164.2
6
82
 
7
83
  - `devbuild` option add to react cli
@@ -90,7 +166,7 @@ A CLI tool for build modern web application and libraries
90
166
 
91
167
  # 0.0.1-exp.159
92
168
 
93
- - isse fix:-
169
+ - issue fix:-
94
170
  - when rtl ltr css split enable manifest json css filename keys comes with hash .
95
171
 
96
172
  # 0.0.1-beta.158
package/bin/cli.js CHANGED
@@ -1,16 +1,24 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const path = require('path');
4
- const os = require('os');
5
4
  const { existsSync } = require('fs');
6
- const { spawnSync, spawn } = require('child_process');
5
+ const { spawnSync: _spawnSync, spawn } = require('child_process');
7
6
  const { getOptions } = require('../lib/utils/index.js');
8
7
 
9
8
  const { log } = require('../lib/utils');
9
+ const { getCliPath } = require('../lib/servers/getCliPath.js');
10
10
  //initPreCommitHook();
11
11
 
12
12
  const options = getOptions();
13
13
 
14
+ function spawnSync(...args) {
15
+ const result = _spawnSync(...args);
16
+ if (result.error) {
17
+ console.error(result.error);
18
+ }
19
+ return result;
20
+ }
21
+
14
22
  const { esLint: esLintOptions } = options || {};
15
23
  const { preprocess } = options;
16
24
  const {
@@ -20,23 +28,10 @@ const {
20
28
  reportPath: reportPath
21
29
  } = esLintOptions || {};
22
30
 
23
- const isWindows = os.platform().toLowerCase() === 'win32';
24
-
25
31
  const [, , option] = process.argv;
26
32
  const args = process.argv.slice(3);
27
33
  const appPath = process.cwd();
28
34
 
29
- const isNodeModuleUnderAppFolder = __dirname.indexOf(appPath) !== -1;
30
-
31
- const _getCliPath = !isNodeModuleUnderAppFolder
32
- ? libName => path.join(__dirname, '..', 'node_modules', '.bin', libName)
33
- : libName => libName;
34
- const suffixExt = isWindows ? '.cmd' : '';
35
-
36
- function getCliPath(libName) {
37
- return _getCliPath(libName) + suffixExt;
38
- }
39
-
40
35
  const webpack = getCliPath('webpack');
41
36
 
42
37
  const nodemon = getCliPath('nodemon');
@@ -121,6 +116,15 @@ switch (option) {
121
116
  { stdio: 'inherit' }
122
117
  );
123
118
 
119
+ process.exit(result.status);
120
+ break;
121
+ case 'valuereplacer':
122
+ result = spawnSync(
123
+ 'node',
124
+ [require.resolve('../lib/common/valueReplacer')].concat(args),
125
+ { stdio: 'inherit' }
126
+ );
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+
3
+ In react-cli we provide options to create custom chunks.
4
+ This Custom Chunk Option is array of Object
5
+ that Object keys are
6
+
7
+ - `pattern` regex pattern as string
8
+ - `name` chunk name
9
+ - `size` is count which is minmum chunk dublicated or need in chunks
10
+
11
+ > Since 0.0.1-exp.164.1
12
+
13
+ extra features in custom chunks :-
14
+ for more details [SplitChunkPlugin](https://webpack.js.org/plugins/split-chunks-plugin/) webpack
15
+
16
+ - `minChunks`: `minChunks` is alies of `size` default value is `2`,
17
+ - `rules`: `rules` is same as `pattern` with some easy hooks
18
+ - use `/` for both windows and linux we will replace internally
19
+ - for `.*` we need to use `*`
20
+ - we can consider rules as regex when the `rules-string` has any of these `*`, `^`, `$`. So if you want regex then kindly use `*` in your `rules-string` for force regex
21
+ - `chunks`: by this option we can specify , default value is `all`,
22
+ - `priority`: priority default value is `-10 * (index + 2)`,
23
+ - `enforce`: enforce default value is true,
24
+ - `maxSize`: maxSize, default value is 0,
25
+ - `minSize`: minSize, default value is 20000,
26
+ includeDepenency: includeDepenency default value is false
@@ -0,0 +1,18 @@
1
+ # DevServer Start
2
+
3
+ ## command
4
+
5
+ > `react-cli start`
6
+
7
+ ## Options
8
+
9
+ we have to typs of options command line arguments and package.json option specifying
10
+
11
+ ### First package.json option specifying
12
+
13
+ 1. `react-cli.app.context`
14
+ 1. `react-cli.app.server`
15
+ 1. `react-cli.app.server`
16
+ 1. `react-cli.app.server`
17
+ 1. `react-cli.app.server`
18
+ 1. `react-cli.app.server`
@@ -0,0 +1,28 @@
1
+ ### Step 1: Update APT index
2
+
3
+ Run the apt update command on your Ubuntu Linux to update package repository contents database.
4
+
5
+ > sudo apt update
6
+
7
+ ### Step 2: Install Node.js 14 on Ubuntu 22.04|20.04|18.04
8
+
9
+ After system update, install Node.js 14 on Ubuntu 22.04|20.04|18.04 by first installing the required repository.
10
+
11
+ > curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
12
+
13
+ The script above will create apt sources list file for the NodeSource Node.js 14.x repo:
14
+
15
+ > \# Ubuntu 20.04 example
16
+ >
17
+ > $ cat /etc/apt/sources.list.d/nodesource.list
18
+ > deb https://deb.nodesource.com/node_14.x focal main
19
+ > deb-src https://deb.nodesource.com/node_14.x focal main
20
+
21
+ Once the repository is added, you can begin the installation of Node.js 14 on Ubuntu Linux:
22
+
23
+ > sudo apt -y install nodejs
24
+
25
+ Verify the version of Node.js installed.
26
+
27
+ > $ node -v
28
+ > v14.17.5
package/docs/TODOS.md ADDED
@@ -0,0 +1,10 @@
1
+ we need to fix all the warning print while install react-cli
2
+
3
+ 1. npm WARN deprecated `babel-eslint@10.1.0`: babel-eslint is now `@babel/eslint-parser`. This package will no longer receive updates.
4
+ to resolve this warning use https://tjaddison.com/blog/2021/03/updating-babel-eslint-to-babeleslint-parser-for-react-apps/
5
+
6
+ 2. npm WARN deprecated eslint-loader@4.0.2: This loader has been deprecated. Please use eslint-webpack-plugin.
7
+ for this warning we need to confirm `is eslint-loader need while build` it's simplely waste of time if you ask me.
8
+ 3. gitlab@14.2.2: The gitlab package has found a new home in the @gitbeaker organization. For the latest gitlab node library, check out @gitbeaker/node
9
+ for this warning we need to check with gitbeaker and impact team as well.
10
+ 4. `fsevents@1.2.13` and `chokidar@2.1.8` these are just dependent packages need to check parent package of this package
@@ -0,0 +1,60 @@
1
+ # value replacer
2
+
3
+ <!-- file paths
4
+ 1. src/postcss-plugins/ValueReplacer.js
5
+ 2. src/common/valueReplacer.js
6
+ -->
7
+
8
+ this option is array of objects which will have a two keys
9
+ new option `valueReplacer` added for replace css property value while build running
10
+
11
+ - this option is array of object, that object two keys
12
+ 1. `props` key for array of property names
13
+ 2. `values` key is object ,this object key contents will be replaced as value content
14
+ - this option wiil be work for below
15
+
16
+ - `start`
17
+ - `docs`
18
+ - `nowatchstart`
19
+ - `devbuild`
20
+ - `build:library:es`
21
+ - `build:component:es`
22
+ - `build:library:cmjs`
23
+ - `build:component:cmjs`
24
+ Example data:-
25
+
26
+ ```json
27
+ {
28
+ "react-cli": {
29
+ "css": {
30
+ "valueReplacer": [
31
+ {
32
+ "props": ["font", "font-family"],
33
+ "values": {
34
+ "zdfonts-rCallBar": "zdf-rCallBar_1",
35
+ "zdfonts-rPuvi": "zdf-rPuvi_1"
36
+ }
37
+ // ,suffix: '0'
38
+ }
39
+ ]
40
+ }
41
+ }
42
+ }
43
+ ```
44
+
45
+ Example Replace:-
46
+ before replace
47
+
48
+ ```css
49
+ .some-selector {
50
+ font: zdfonts-rCallBar !important;
51
+ }
52
+ ```
53
+
54
+ after replace
55
+
56
+ ```css
57
+ .some-selector {
58
+ font: zdf-rCallBar_1 !important;
59
+ }
60
+ ```
@@ -0,0 +1,35 @@
1
+ npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
2
+ npm WARN deprecated eslint-loader@4.0.2: This loader has been deprecated. Please use eslint-webpack-plugin
3
+ npm WARN deprecated gitlab@14.2.2: The gitlab package has found a new home in the @gitbeaker organization. For the latest gitlab node library, check out @gitbeaker/node. A full list of the features can be found here: https://github.com/jdalrymple/gitbeaker#readme
4
+ npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
5
+ npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
6
+ npm WARN deprecated webdriverio@4.14.4: outdated version, please use @next
7
+ npm WARN deprecated mkdirp@0.3.5: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
8
+ npm WARN deprecated cross-spawn-async@1.0.1: cross-spawn no longer requires a build toolchain, use it instead
9
+ npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
10
+ npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
11
+ npm WARN deprecated har-validator@5.1.5: this library is no longer supported
12
+ npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
13
+ npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
14
+ npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
15
+ npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
16
+ npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
17
+ npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents):
18
+ npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
19
+ npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^2.1.2 (node_modules/jest-haste-map/node_modules/fsevents):
20
+ npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
21
+ npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/nodemon/node_modules/chokidar/node_modules/fsevents):
22
+ npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
23
+ npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/watchpack/node_modules/chokidar/node_modules/fsevents):
24
+ npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
25
+ npm WARN check2@1.0.0 No description
26
+ npm WARN check2@1.0.0 No repository field.
27
+
28
+ + @zohodesk/react-cli@0.0.1-beta.165
29
+ updated 1 package and audited 1899 packages in 51.509s
30
+
31
+ 21 packages are looking for funding
32
+ run `npm fund` for details
33
+
34
+ found 42 vulnerabilities (2 low, 20 moderate, 8 high, 12 critical)
35
+ run `npm audit fix` to fix them, or `npm audit` for details
@@ -7,9 +7,11 @@ exports.default = void 0;
7
7
 
8
8
  var _path = _interopRequireDefault(require("path"));
9
9
 
10
+ var _os = _interopRequireDefault(require("os"));
11
+
10
12
  var _utils = require("../utils");
11
13
 
12
- var _os = _interopRequireDefault(require("os"));
14
+ var _testPattern = require("./testPattern");
13
15
 
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
@@ -47,30 +49,75 @@ let defaultChunks = {
47
49
  chunks: 'all',
48
50
  minChunks: 1,
49
51
  test: isReact,
52
+ enforce: true,
53
+ // priority: 10
50
54
  priority: -10
51
55
  },
52
56
  vendor: {
53
57
  name: 'vendor',
54
58
  chunks: 'all',
59
+ // chunks: 'initial',
55
60
  minChunks: 1,
56
61
  test: isVendor,
62
+ // priority: 19,
57
63
  priority: -10
58
64
  }
59
65
  };
60
66
  let customChunksConfig = {};
61
- customChunks.map(({
67
+ customChunks.map((obj, index) => ({
68
+ name: obj.name,
69
+ pattern: obj.pattern,
70
+ minChunks: obj.minChunks || obj.size || 2,
71
+ rules: obj.rules,
72
+ // includeDepenency: obj.includeDepenency || false,
73
+ priority: obj.priority || -10 * (index + 2),
74
+ enforce: obj.enforce || true,
75
+ maxSize: obj.maxSize,
76
+ // || 0,
77
+ minSize: obj.minSize,
78
+ // || 20000,
79
+ chunks: obj.chunks || 'all'
80
+ })).map(({
62
81
  name,
63
82
  pattern,
64
- size = 2
65
- }, index) => customChunksConfig[name] = {
66
- name,
67
- test: new RegExp(isWindows ? pattern.replace(/\//g, '\\') : pattern),
68
- chunks: 'all',
69
- enforce: true,
70
- minChunks: size,
71
- priority: -10 * (index + 2)
83
+ minChunks,
84
+ rules,
85
+ priority,
86
+ // includeDepenency,
87
+ enforce,
88
+ minSize,
89
+ maxSize,
90
+ chunks = 'all'
91
+ }) => {
92
+ let obj = {
93
+ name,
94
+ test: rules ? m => {
95
+ const {
96
+ userRequest
97
+ } = m;
98
+ return (0, _testPattern.testPattern)(userRequest, rules); // return (
99
+ // pkgs.some(p => isRelated(userRequest, p)) ||
100
+ // (includeDepenency && isDependency(m, pkgs))
101
+ // );
102
+ } : new RegExp(isWindows ? pattern.replace(/\//g, '\\') : pattern),
103
+ chunks,
104
+ enforce,
105
+ minChunks,
106
+ priority
107
+ };
108
+
109
+ if (minSize !== undefined) {
110
+ obj.minSize = minSize;
111
+ }
112
+
113
+ if (maxSize !== undefined) {
114
+ obj.maxSize = maxSize;
115
+ }
116
+
117
+ return customChunksConfig[name] = obj;
72
118
  });
73
119
  var _default = {
120
+ minSize: 12000,
74
121
  cacheGroups: Object.assign({
75
122
  default: false,
76
123
  vendors: false
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isDependency = isDependency;
7
+ exports.isRelatedPackage = exports.isRelated = void 0;
8
+ exports.testPattern = testPattern;
9
+
10
+ var _path = require("path");
11
+
12
+ // in our development we only use windows, mac and linux
13
+ const isWindows = _path.sep !== '/'; // this function will return true if pattern matched
14
+
15
+ function _testPattern(req, pattern) {
16
+ let modifyedPattern = pattern;
17
+
18
+ if (/[*.$^]/.test(modifyedPattern)) {
19
+ if (isWindows) {
20
+ // modifyedPattern = pattern.replace(/\//g, ps.replace(/\\/g, '\\\\'));
21
+ modifyedPattern = modifyedPattern.replace(/\//g, '\\\\');
22
+ }
23
+
24
+ modifyedPattern = modifyedPattern.replace(/\./g, '\\.').replace(/\*/g, '.*');
25
+ const re = new RegExp(modifyedPattern);
26
+ return re.test(req);
27
+ }
28
+
29
+ if (isWindows) {
30
+ // modifyedPattern = pattern.replace(/\//g, ps.replace(/\\/g, '\\\\'));
31
+ modifyedPattern = modifyedPattern.replace(/\//g, '\\');
32
+ }
33
+
34
+ return req.indexOf(modifyedPattern) !== -1;
35
+ }
36
+
37
+ function testPattern(req, pattern) {
38
+ if (!req || !pattern) {
39
+ return false;
40
+ }
41
+
42
+ if (Array.isArray(pattern)) {
43
+ // eslint-disable-next-line no-unused-vars
44
+ return pattern.every(p => testPattern(req, p));
45
+ }
46
+
47
+ if (pattern[0] === '!') {
48
+ return !_testPattern(req, pattern.slice(1));
49
+ }
50
+
51
+ return _testPattern(req, pattern);
52
+ }
53
+
54
+ const isRelated = (req, item) => req && req.indexOf(item) !== -1; // export const isRelated = (req, item) => testPattern(req, item);
55
+
56
+
57
+ exports.isRelated = isRelated;
58
+
59
+ const isRelatedPackage = (req, item) => isRelated(req, `node_modules${_path.sep}${item}${_path.sep}`) !== -1; // export const isRelated = (req, item) => testPattern(req, item);
60
+
61
+
62
+ exports.isRelatedPackage = isRelatedPackage;
63
+
64
+ function isDependency(m, excludeList) {
65
+ // let reasons = m.reasons.map(r => r.module.userRequest);
66
+ // m.reasons.some(r => !r.module || !r.module.userRequest) && console.log(m.reasons);
67
+ return m.reasons.some(r => excludeList.some(item => r.module && isRelated(r.module.userRequest, item)));
68
+ } // export function queryHandler(conditions, pattern) {
69
+ // }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ var _postcss = _interopRequireDefault(require("postcss"));
4
+
5
+ var _path = _interopRequireDefault(require("path"));
6
+
7
+ var _fs = _interopRequireDefault(require("fs"));
8
+
9
+ var _folderIterator = _interopRequireDefault(require("../utils/folderIterator"));
10
+
11
+ var _utils = require("../utils");
12
+
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+
15
+ const cwd = process.cwd();
16
+
17
+ const src = _path.default.join(cwd, process.argv[2]);
18
+
19
+ const dist = _path.default.join(cwd, process.argv[3]);
20
+
21
+ const docopy = process.argv[4] === 'true';
22
+ const {
23
+ css: {
24
+ valueReplacer
25
+ }
26
+ } = (0, _utils.getOptions)();
27
+
28
+ if (!_fs.default.existsSync(dist)) {
29
+ _fs.default.mkdirSync(dist, {
30
+ recursive: true
31
+ });
32
+ }
33
+
34
+ (0, _folderIterator.default)(src, dist, docopy ? false : ['.css'], false, (fromPath, toPath) => {
35
+ //console.log({ fromPath: fromPath, toPath: toPath });
36
+ let css = _fs.default.readFileSync(fromPath);
37
+
38
+ if (docopy && !fromPath.endsWith('.css')) {
39
+ //console.log(toPath,'....');
40
+ _fs.default.writeFileSync(toPath, css);
41
+
42
+ return;
43
+ }
44
+
45
+ (0, _postcss.default)([valueReplacer && require('../postcss-plugins/ValueReplacer')(valueReplacer)]).process(css, {
46
+ from: fromPath,
47
+ to: toPath
48
+ }).then(result => {
49
+ _fs.default.writeFile(toPath, result.css, () => true);
50
+
51
+ if (result.map) {
52
+ _fs.default.writeFile(`${toPath}.map`, result.map, () => true);
53
+ }
54
+ });
55
+ });
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ var _fs = require("fs");
4
+
3
5
  var _path = _interopRequireDefault(require("path"));
4
6
 
5
7
  var _libAlias = require("./libAlias");
@@ -13,6 +15,9 @@ let moduleNameMapper = Object.keys(_libAlias.libAlias).reduce((previousValue, ke
13
15
  previousValue[`^${key}(.*)$`] = `${_libAlias.libAlias[key]}$1`;
14
16
  return previousValue;
15
17
  }, {});
18
+
19
+ const appGlobals = _path.default.resolve(appPath, '__testUtils__', 'globals.js');
20
+
16
21
  let commonConfig = {
17
22
  coverageReporters: ['json', 'html', 'json-summary', 'text'],
18
23
  collectCoverage: true,
@@ -28,7 +33,7 @@ let commonConfig = {
28
33
  transformIgnorePatterns: ['/node_modules/(?!(@zohodesk)/)'],
29
34
  // transformIgnorePatterns: ['/node_modules.*?.js$'],
30
35
  moduleFileExtensions: ['js'],
31
- setupFiles: [_path.default.resolve(appPath, '__testUtils__', 'globals.js'), _path.default.resolve(__dirname, '..', 'jest', 'setup.js')],
36
+ setupFiles: [(0, _fs.existsSync)(appGlobals) && appGlobals, _path.default.resolve(__dirname, '..', 'jest', 'setup.js')].filter(Boolean),
32
37
  globals: {
33
38
  __DEVELOPMENT__: true,
34
39
  __DOCS__: false,