@zohodesk/react-cli 0.0.1-beta.164 → 0.0.1-beta.167

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 (79) hide show
  1. package/README.md +63 -0
  2. package/bin/cli.js +28 -2
  3. package/cert/Tsicsezwild-22-23.crt +37 -0
  4. package/cert/Tsicsezwild-22-23.key +27 -0
  5. package/docs/CustomChunks.md +26 -0
  6. package/docs/DevStart.md +18 -0
  7. package/docs/TODOS.md +10 -0
  8. package/docs/ValueReplacer.md +60 -0
  9. package/docs/warnings_while_install.txt +35 -0
  10. package/eslint/React_CDN.zip +0 -0
  11. package/eslint/a23.c +16 -0
  12. package/eslint/a28.c +25 -0
  13. package/eslint/a29.c +25 -0
  14. package/eslint/a30.c +29 -0
  15. package/eslint/a31.c +23 -0
  16. package/eslint/a35.c +23 -0
  17. package/eslint/a36.c +18 -0
  18. package/eslint/a37.c +25 -0
  19. package/eslint/a38.c +28 -0
  20. package/eslint/a39.c +17 -0
  21. package/eslint/a40.c +32 -0
  22. package/eslint/temp/a +0 -0
  23. package/eslint/temp/a.der +0 -0
  24. package/eslint/temp/a.jks +0 -0
  25. package/eslint/temp/a.p12 +0 -0
  26. package/eslint/temp/a.pfx +0 -0
  27. package/eslint/temp/c.jks +0 -0
  28. package/eslint/temp/package.json +15 -0
  29. package/eslint/temp/pkcs12.keystore +0 -0
  30. package/eslint/temp/pkk.pfx +0 -0
  31. package/eslint/temp/sas.keystore +0 -0
  32. package/eslint/temp/sas.keystore.old +0 -0
  33. package/eslint/testa/build1/index.html +12 -0
  34. package/eslint/testa/build1/js/2_.js +15 -0
  35. package/eslint/testa/build1/js/2_.js.map +1 -0
  36. package/eslint/testa/build1/js/main_.js +40 -0
  37. package/eslint/testa/build1/js/main_.js.map +1 -0
  38. package/eslint/testa/build1/js/runtime~main_.js +251 -0
  39. package/eslint/testa/build1/js/runtime~main_.js.map +1 -0
  40. package/eslint/testa/build2/index.html +12 -0
  41. package/eslint/testa/build2/js/2_.js +15 -0
  42. package/eslint/testa/build2/js/2_.js.map +1 -0
  43. package/eslint/testa/build2/js/3_.js +15 -0
  44. package/eslint/testa/build2/js/3_.js.map +1 -0
  45. package/eslint/testa/build2/js/main_.js +46 -0
  46. package/eslint/testa/build2/js/main_.js.map +1 -0
  47. package/eslint/testa/build2/js/runtime~main_.js +251 -0
  48. package/eslint/testa/build2/js/runtime~main_.js.map +1 -0
  49. package/eslint/testa/package.json +22 -0
  50. package/eslint/testa/scr/chunk1.js +3 -0
  51. package/eslint/testa/scr/chunk2.js +3 -0
  52. package/eslint/testa/scr/index.html +12 -0
  53. package/eslint/testa/scr/index.js +4 -0
  54. package/eslint/testa/scr/utlis.js +12 -0
  55. package/eslint/testa/src/chunk1.js +3 -0
  56. package/eslint/testa/src/index.html +12 -0
  57. package/eslint/testa/src/index.js +3 -0
  58. package/eslint/testa/src/utlis.js +7 -0
  59. package/lib/common/splitChunks.js +57 -10
  60. package/lib/common/testPattern.js +69 -0
  61. package/lib/common/valueReplacer.js +55 -0
  62. package/lib/configs/jest.config.js +6 -1
  63. package/lib/configs/webpack.dev.config.js +3 -2
  64. package/lib/configs/webpack.docs.config.js +31 -26
  65. package/lib/configs/webpack.prod.config.js +4 -3
  66. package/lib/loaderUtils/getCSSLoaders.js +17 -13
  67. package/lib/postcss-plugins/ValueReplacer.js +46 -0
  68. package/lib/schemas/index.js +21 -0
  69. package/lib/servers/devBuild.js +102 -0
  70. package/lib/servers/getCliPath.js +24 -0
  71. package/lib/servers/httpsOptions.js +2 -3
  72. package/lib/servers/nowatchserver.js +9 -84
  73. package/lib/servers/server.js +20 -5
  74. package/lib/utils/repoClone.js +5 -2
  75. package/lib/utils/rtl.js +19 -2
  76. package/lib/utils/useExitCleanup.js +55 -0
  77. package/npm8.md +9 -0
  78. package/package.json +2 -1
  79. package/postpublish.js +6 -0
package/lib/utils/rtl.js CHANGED
@@ -18,7 +18,10 @@ let src = _path.default.join(cwd, process.argv[2]);
18
18
 
19
19
  let dist = _path.default.join(cwd, process.argv[3]);
20
20
 
21
- (0, _folderIterator.default)(src, dist, ['.css'], false, (fromPath, toPath) => {
21
+ let canWacth = '-w' === process.argv[4];
22
+
23
+ // import { useExitCleanup } from './useExitCleanup';
24
+ function watchHandler(fromPath, toPath) {
22
25
  let css = _fs.default.readFileSync(fromPath);
23
26
 
24
27
  (0, _postcss.default)([(0, _postcssRtl.default)({
@@ -39,4 +42,18 @@ let dist = _path.default.join(cwd, process.argv[3]);
39
42
  _fs.default.writeFile(`${toPath}.map`, result.map, () => true);
40
43
  }
41
44
  });
42
- });
45
+ }
46
+
47
+ (0, _folderIterator.default)(src, dist, ['.css'], false, (fromPath, toPath) => {
48
+ if (canWacth && fromPath) {
49
+ _fs.default.watchFile(fromPath, () => {
50
+ watchHandler(fromPath, toPath);
51
+ });
52
+ }
53
+
54
+ watchHandler(fromPath, toPath);
55
+ }); // if (canWacth) {
56
+ // useExitCleanup(() => {
57
+ // fs.unwatchFile(src, watchHandler);
58
+ // });
59
+ // }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useExitCleanup = useExitCleanup;
7
+ //so the program will not close instantly
8
+ let listeners = [];
9
+ let hasCalled = false;
10
+
11
+ function useExitCleanup(listener) {
12
+ if (!hasCalled) {
13
+ process.stdin.resume();
14
+ hasCalled = true;
15
+ }
16
+
17
+ listeners.push(listeners);
18
+ return () => {
19
+ listeners = listeners.filter(l => l !== listener);
20
+ };
21
+ }
22
+
23
+ function exitHandler(options, exitCode) {
24
+ if (options.cleanup) {
25
+ console.log('clean');
26
+ }
27
+
28
+ if (exitCode || exitCode === 0) {
29
+ console.log(exitCode);
30
+ }
31
+
32
+ if (options.exit) {
33
+ process.exit();
34
+ }
35
+ } //do something when app is closing
36
+
37
+
38
+ process.on('exit', exitHandler.bind(null, {
39
+ cleanup: true
40
+ })); //catches ctrl+c event
41
+
42
+ process.on('SIGINT', exitHandler.bind(null, {
43
+ exit: true
44
+ })); // catches "kill pid" (for example: nodemon restart)
45
+
46
+ process.on('SIGUSR1', exitHandler.bind(null, {
47
+ exit: true
48
+ }));
49
+ process.on('SIGUSR2', exitHandler.bind(null, {
50
+ exit: true
51
+ })); //catches uncaught exceptions
52
+
53
+ process.on('uncaughtException', exitHandler.bind(null, {
54
+ exit: true
55
+ }));
package/npm8.md ADDED
@@ -0,0 +1,9 @@
1
+ # npm 8 change related things
2
+
3
+ 1. in npm run script config options `:` not working (properly|correctly), So we need to use `_` in the place of `:`
4
+ For Example:
5
+ - `--app:port` wouldn't work we have to do like this `--app_port`
6
+ - `--clone:proj:name` wouldn't work we have to do like this `----clone_proj_name`
7
+
8
+ @zohodes/react-cli or fz-react-cli regardless of what cli you use.
9
+ So, we need to change all package.json script which is using this (`:`) we need to change as (`_`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/react-cli",
3
- "version": "0.0.1-beta.164",
3
+ "version": "0.0.1-beta.167",
4
4
  "description": "A CLI tool for build modern web application and libraries",
5
5
  "scripts": {
6
6
  "init": "node ./lib/utils/init.js",
@@ -10,6 +10,7 @@
10
10
  "build": "babel src -d lib --copy-files",
11
11
  "prepare": "npm run clean && npm run build",
12
12
  "lint": "eslint src ./bin/cli.js",
13
+ "postpublish": "node postpublish.js",
13
14
  "expublish": "npm publish --tag experimental-version"
14
15
  },
15
16
  "engines": {
package/postpublish.js ADDED
@@ -0,0 +1,6 @@
1
+ const { execSync } = require('child_process');
2
+ const { version } = require('./package.json');
3
+ console.log(`going to add git tag... v${version}`);
4
+
5
+ execSync(`git tag -a v${version}`, { stdio: 'inherit' });
6
+ execSync(`git push origin v${version}`, { stdio: 'inherit' });