@zohodesk/react-cli 0.0.1-exp.166.1 → 0.0.1-exp.167.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. package/README.md +39 -0
  2. package/bin/cli.js +6 -1
  3. package/cert/Tsicsezwild-22-23.crt +37 -0
  4. package/cert/Tsicsezwild-22-23.key +27 -0
  5. package/docs/DevStart.md +18 -0
  6. package/eslint/React_CDN.zip +0 -0
  7. package/eslint/a.sh +14 -0
  8. package/eslint/testa/build.sh +7 -0
  9. package/eslint/testa/build1/index.html +12 -0
  10. package/eslint/testa/build1/js/2_.js +15 -0
  11. package/eslint/testa/build1/js/2_.js.map +1 -0
  12. package/eslint/testa/build1/js/main_.js +40 -0
  13. package/eslint/testa/build1/js/main_.js.map +1 -0
  14. package/eslint/testa/build1/js/runtime~main_.js +251 -0
  15. package/eslint/testa/build1/js/runtime~main_.js.map +1 -0
  16. package/eslint/testa/build2/index.html +12 -0
  17. package/eslint/testa/build2/js/2_.js +15 -0
  18. package/eslint/testa/build2/js/2_.js.map +1 -0
  19. package/eslint/testa/build2/js/3_.js +15 -0
  20. package/eslint/testa/build2/js/3_.js.map +1 -0
  21. package/eslint/testa/build2/js/main_.js +46 -0
  22. package/eslint/testa/build2/js/main_.js.map +1 -0
  23. package/eslint/testa/build2/js/runtime~main_.js +251 -0
  24. package/eslint/testa/build2/js/runtime~main_.js.map +1 -0
  25. package/eslint/testa/build3/index.710b00fba04c6c594ad3.html +12 -0
  26. package/eslint/testa/build3/js/2.321b867f0966f9c9cdfd_.js +1 -0
  27. package/eslint/testa/build3/js/main.eb2aec4c9f1c16a385e0_.js +1 -0
  28. package/eslint/testa/build3/js/runtime~main.fafbbe7484e9c126f4f7_.js +1 -0
  29. package/eslint/testa/build3/manifest.json +1 -0
  30. package/eslint/testa/build4/index.9ff03a2ccdc9b904f1fe.html +12 -0
  31. package/eslint/testa/build4/js/2.8b63ce57af6dd2bac274_.js +1 -0
  32. package/eslint/testa/build4/js/3.5208acbe37a44362090e_.js +1 -0
  33. package/eslint/testa/build4/js/main.a934d6c2e2329d97269e_.js +1 -0
  34. package/eslint/testa/build4/js/runtime~main.5b85dd9ab73069c1455a_.js +1 -0
  35. package/eslint/testa/build4/manifest.json +1 -0
  36. package/eslint/testa/package.json +24 -0
  37. package/eslint/testa/scr/chunk1.js +3 -0
  38. package/eslint/testa/scr/chunk2.js +3 -0
  39. package/eslint/testa/scr/index.html +12 -0
  40. package/eslint/testa/scr/index.js +4 -0
  41. package/eslint/testa/scr/utlis.js +12 -0
  42. package/eslint/testa/src/chunk1.js +3 -0
  43. package/eslint/testa/src/index.html +12 -0
  44. package/eslint/testa/src/index.js +3 -0
  45. package/eslint/testa/src/utlis.js +7 -0
  46. package/lib/configs/webpack.dev.config.js +3 -2
  47. package/lib/configs/webpack.docs.config.js +5 -4
  48. package/lib/configs/webpack.prod.config.js +4 -3
  49. package/lib/schemas/index.js +10 -0
  50. package/lib/servers/{devBulid.js → devBuild.js} +7 -3
  51. package/lib/servers/httpsOptions.js +2 -3
  52. package/lib/servers/nowatchserver.js +2 -2
  53. package/lib/servers/server.js +11 -3
  54. package/lib/utils/repoClone.js +5 -2
  55. package/lib/utils/rtl.js +19 -2
  56. package/lib/utils/useExitCleanup.js +55 -0
  57. package/package.json +2 -1
  58. package/postpublish.js +6 -0
  59. package/templates/docs/css/style.css +1 -1
  60. package/templates/docs/index.html +9 -1
  61. package/DOTO.md +0 -13
@@ -69,7 +69,8 @@ if (mode === 'prod') {
69
69
  config = require('../configs/webpack.dev.config');
70
70
  } else {
71
71
  throw new Error('You must configure valid option in mode');
72
- }
72
+ } // console.log({ contextURL });
73
+
73
74
 
74
75
  let compiler = (0, _webpack.default)(config);
75
76
  let webpackServerOptions = {
@@ -144,15 +145,22 @@ app.post('/wmsmockapi', (req, res) => {
144
145
  res.send('success');
145
146
  });
146
147
  let webpackCompilation;
148
+ let initalHTML;
147
149
  compiler.hooks.afterCompile.tap('ReactCLI', compilation => {
148
150
  webpackCompilation = compilation;
149
151
  });
152
+ compiler.hooks.done.tap('ReactCLI', () => {
153
+ const indexHtml = webpackCompilation.assets['index.html'];
154
+
155
+ if (indexHtml) {
156
+ initalHTML = indexHtml.source();
157
+ }
158
+ });
150
159
 
151
160
  if (contextURL) {
152
161
  app.use(contextURL, _express.default.static(context));
153
162
  app.use(`${contextURL}/*`, (req, res) => {
154
- let indexHtml = webpackCompilation.assets['index.html'];
155
- res.send(indexHtml && indexHtml.source());
163
+ res.send(initalHTML);
156
164
  });
157
165
  } else {
158
166
  app.use(_express.default.static(context));
@@ -28,6 +28,7 @@ let {
28
28
  branch,
29
29
  revision,
30
30
  projectName,
31
+ shallowClone,
31
32
  cacheDir,
32
33
  remoteName,
33
34
  shouldDelete
@@ -73,9 +74,11 @@ let cloneRepo = () => {
73
74
  }
74
75
  }
75
76
 
76
- (0, _index.log)(`Going to clone ${url} repo to ${cacheDir} path`); // this is for some time error will because of hg or git so we addid error log for this
77
+ (0, _index.log)(`Going to clone ${url} repo to ${cacheDir} path`); // this is for some time error will because of hg or git so we addid error log for this
77
78
 
78
- spawnSyncWithErrorLog(type, ['clone', url, revisionOrBranch, projectName], {
79
+ let oargs = ['clone', url, revisionOrBranch, projectName];
80
+ type === 'git' && shallowClone && oargs.push('--depth=1');
81
+ spawnSyncWithErrorLog(type, oargs, {
79
82
  cwd: cacheDir,
80
83
  stdio: 'inherit'
81
84
  });
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/react-cli",
3
- "version": "0.0.1-exp.166.1",
3
+ "version": "0.0.1-exp.167.1",
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' });
@@ -660,8 +660,8 @@ section {
660
660
  flex: 1;
661
661
  overflow: hidden;
662
662
  text-overflow: ellipsis;
663
- white-space: nowrap;
664
663
  word-wrap: normal;
664
+ word-break: break-word;
665
665
  border-right: 1px solid #ebedf0;
666
666
  padding: 16px 24px;
667
667
  text-align: left;
@@ -438,6 +438,7 @@
438
438
  Components[propComName].propTypes) ||
439
439
  {};
440
440
  let currentCompProps = Object.keys(propsObj) || [];
441
+ let currentCompPropsDescription = window.componentList && window.componentList[propComName] && window.componentList[propComName].propsDescription || (Components[propComName] && Components[propComName].propsDescription) || {};
441
442
  let currentCompDefault = Window.componentList && window.componentList[propComName] && window.componentList[propComName].defaultProps || (Components[propComName] && Components[propComName].defaultProps) || {};
442
443
  let componentsObj=componentObj && this.filter(Object.keys(componentObj),'').map((item,i)=>{
443
444
  return ({key:item,value:componentObj[item],length:Object.keys(componentObj[item]).length})
@@ -767,6 +768,7 @@
767
768
  <span className="brR">Type</span>
768
769
  <span className="brR">isRequired</span>
769
770
  <span className="brR ">Default Props</span>
771
+ <span className="brR ">Description</span>
770
772
  </div>
771
773
  {
772
774
  currentCompProps.map((value, i) => {
@@ -796,9 +798,15 @@
796
798
  </span>
797
799
  <span className="defaultProps">
798
800
  <div className="bn">
799
- {JSON.stringify(currentCompDefault[value])}
801
+ {JSON.stringify(currentCompDefault[value] || '')}
800
802
  </div>
801
803
  </span>
804
+ <span className="defaultProps">
805
+ <div className="bn">
806
+ {JSON.stringify(currentCompPropsDescription[value] || '')}
807
+ </div>
808
+ </span>
809
+
802
810
  </div>
803
811
  );
804
812
  })
package/DOTO.md DELETED
@@ -1,13 +0,0 @@
1
- Things that can be done
2
-
3
- 1. react-cli total revamp dependency packages version update (must for future (2-4 months) But not problem for now)
4
- 1. when we do revamp we may can to create a document with full detailed.
5
- 2. react-cli find the chain set for 0.0.1-alpha.113 version (must for future( 20 may 2022 ) But not problem for now) -- DONE
6
- 3. react version update 17 or 18 (must for future (until desk as efc or until get confilct with gc or some kind) But not problem for now)
7
- 1. if we move react 18, may be I can remove some hacks form virtualizer. we put hacks for batching since react 18 has auto batch we can remove that
8
- 2. same for react-dnd
9
- 4. react-cli package split (good to have)
10
- 5. efc unification (must for good future (2-4 months) But not problem for now)
11
- 6. i18n build as separate then client build I have some Ideas with some drawbacks (good to have)
12
- 7. react own implmention (good to have and also have a posiblity for Diamonds since it can lead as to some thing great for example preformance enforceing like always PureComponent , built in context optimazation, and issue fix we found in react reorder preformance problem. In my point of view react highly focus on declarative rather then preformance in some places may be there is reason but we may not have a use for that reason, and in some place I need to bend like hell to make what I want)
13
- 8. all repo links and build process and documention for steps