Browse Source

Initial refactor

master
ポール ウェッブ 3 months ago
parent
commit
9063053072
100 changed files with 14300 additions and 376 deletions
  1. 13
    13
      .eslintrc
  2. 22
    22
      app.js
  3. 3
    3
      components/Footer/footer.scss
  4. 12
    12
      components/Footer/index.js
  5. 2
    2
      components/Header/header.scss
  6. 11
    10
      components/Header/index.js
  7. 2
    2
      components/Help/help.scss
  8. 32
    32
      components/Help/index.js
  9. 15
    15
      components/Login/index.js
  10. 8
    8
      components/NoItems/index.js
  11. 2
    2
      components/NotFound/404.scss
  12. 10
    12
      components/NotFound/index.js
  13. 9
    9
      components/Package/index.js
  14. 3
    3
      components/Package/package.scss
  15. 8
    8
      components/PackageDetail/index.js
  16. 2
    2
      components/PackageDetail/packageDetail.scss
  17. 15
    16
      components/PackageList/index.js
  18. 2
    2
      components/PackageList/packageList.scss
  19. 4
    4
      components/PackageSidebar/Module/index.jsx
  20. 3
    4
      components/PackageSidebar/Module/style.scss
  21. 5
    4
      components/PackageSidebar/ModuleContentPlaceholder/index.jsx
  22. 1
    1
      components/PackageSidebar/ModuleContentPlaceholder/style.scss
  23. 17
    17
      components/PackageSidebar/index.jsx
  24. 10
    9
      components/PackageSidebar/modules/Dependencies/index.jsx
  25. 1
    1
      components/PackageSidebar/modules/Dependencies/style.scss
  26. 16
    15
      components/PackageSidebar/modules/Infos/index.jsx
  27. 3
    3
      components/PackageSidebar/modules/Infos/style.scss
  28. 8
    7
      components/PackageSidebar/modules/LastSync/index.jsx
  29. 1
    1
      components/PackageSidebar/modules/LastSync/style.scss
  30. 9
    7
      components/PackageSidebar/modules/Maintainers/MaintainerInfo/index.jsx
  31. 8
    8
      components/PackageSidebar/modules/Maintainers/MaintainerInfo/style.scss
  32. 22
    21
      components/PackageSidebar/modules/Maintainers/index.jsx
  33. 4
    4
      components/PackageSidebar/modules/Maintainers/style.scss
  34. 5
    5
      components/PackageSidebar/modules/PeerDependencies/index.jsx
  35. 5
    5
      components/Readme/index.js
  36. 1
    1
      components/Readme/readme.scss
  37. 19
    19
      components/Search/index.js
  38. 1
    1
      components/Search/search.scss
  39. 7
    7
      index.js
  40. 4
    5
      modules/detail/detail.scss
  41. 27
    23
      modules/detail/index.jsx
  42. 32
    31
      modules/home/index.js
  43. 1
    0
      node_modules/.bin/acorn
  44. 1
    0
      node_modules/.bin/eslint
  45. 1
    0
      node_modules/.bin/esparse
  46. 1
    0
      node_modules/.bin/esvalidate
  47. 1
    0
      node_modules/.bin/husky-upgrade
  48. 1
    0
      node_modules/.bin/is-ci
  49. 1
    0
      node_modules/.bin/js-yaml
  50. 1
    0
      node_modules/.bin/loose-envify
  51. 1
    0
      node_modules/.bin/mkdirp
  52. 1
    0
      node_modules/.bin/npm-run-all
  53. 1
    0
      node_modules/.bin/pidtree
  54. 1
    0
      node_modules/.bin/rimraf
  55. 1
    0
      node_modules/.bin/run-node
  56. 1
    0
      node_modules/.bin/run-p
  57. 1
    0
      node_modules/.bin/run-s
  58. 1
    0
      node_modules/.bin/semver
  59. 1
    0
      node_modules/.bin/snazzy
  60. 1
    0
      node_modules/.bin/standard
  61. 1
    0
      node_modules/.bin/standard-json
  62. 1
    0
      node_modules/.bin/standardx
  63. 1
    0
      node_modules/.bin/updates
  64. 1
    0
      node_modules/.bin/which
  65. 22
    0
      node_modules/@babel/code-frame/LICENSE
  66. 19
    0
      node_modules/@babel/code-frame/README.md
  67. 173
    0
      node_modules/@babel/code-frame/lib/index.js
  68. 49
    0
      node_modules/@babel/code-frame/package.json
  69. 22
    0
      node_modules/@babel/highlight/LICENSE
  70. 19
    0
      node_modules/@babel/highlight/README.md
  71. 129
    0
      node_modules/@babel/highlight/lib/index.js
  72. 151
    0
      node_modules/@babel/highlight/node_modules/js-tokens/CHANGELOG.md
  73. 21
    0
      node_modules/@babel/highlight/node_modules/js-tokens/LICENSE
  74. 240
    0
      node_modules/@babel/highlight/node_modules/js-tokens/README.md
  75. 23
    0
      node_modules/@babel/highlight/node_modules/js-tokens/index.js
  76. 64
    0
      node_modules/@babel/highlight/node_modules/js-tokens/package.json
  77. 50
    0
      node_modules/@babel/highlight/package.json
  78. 9
    0
      node_modules/@inc/eslint-config/LICENSE
  79. 58
    0
      node_modules/@inc/eslint-config/README.md
  80. 19
    0
      node_modules/@inc/eslint-config/browser.js
  81. 55
    0
      node_modules/@inc/eslint-config/esnext.js
  82. 140
    0
      node_modules/@inc/eslint-config/index.js
  83. 83
    0
      node_modules/@inc/eslint-config/package.json
  84. 19
    0
      node_modules/acorn-jsx/LICENSE
  85. 44
    0
      node_modules/acorn-jsx/README.md
  86. 441
    0
      node_modules/acorn-jsx/index.js
  87. 55
    0
      node_modules/acorn-jsx/package.json
  88. 255
    0
      node_modules/acorn-jsx/xhtml.js
  89. 462
    0
      node_modules/acorn/CHANGELOG.md
  90. 19
    0
      node_modules/acorn/LICENSE
  91. 269
    0
      node_modules/acorn/README.md
  92. 4
    0
      node_modules/acorn/bin/acorn
  93. 209
    0
      node_modules/acorn/dist/acorn.d.ts
  94. 5333
    0
      node_modules/acorn/dist/acorn.js
  95. 1
    0
      node_modules/acorn/dist/acorn.js.map
  96. 5302
    0
      node_modules/acorn/dist/acorn.mjs
  97. 1
    0
      node_modules/acorn/dist/acorn.mjs.map
  98. 68
    0
      node_modules/acorn/dist/bin.js
  99. 66
    0
      node_modules/acorn/package.json
  100. 0
    0
      node_modules/agent-base/.travis.yml

+ 13
- 13
.eslintrc View File

@@ -1,25 +1,25 @@
1 1
 {
2
-  "env": {
3
-    "browser": true,
4
-    "node": true,
5
-    "jest": true,
6
-    "es6": true
2
+  env: {
3
+    browser: true,
4
+    node: true,
5
+    jest: true,
6
+    es6: true
7 7
   },
8
-  "globals": {
9
-    "__DEBUG__": true
8
+  extends: "@inc",
9
+  globals: {
10
+    __DEBUG__: true
10 11
   },
11
-  "rules": {
12
+  rules: {
12 13
     "require-jsdoc": 0,
13 14
     "no-console": 2,
14 15
     "no-unused-vars": [
15
-      2,
16
-      {
17
-        "vars": "all",
18
-        "args": "all"
16
+      2, {
17
+        args: "all",
18
+        vars: "all"
19 19
       }
20 20
     ],
21 21
     "comma-dangle": 0,
22
-    "semi": 1,
22
+    semi: 1,
23 23
     "react/no-danger-with-children": 1,
24 24
     "react/no-string-refs": 1,
25 25
     "react/prefer-es6-class": [

+ 22
- 22
app.js View File

@@ -1,30 +1,30 @@
1
-import React, {Component} from 'react';
2
-import isNil from 'lodash/isNil';
3
-import 'element-theme-default';
4
-import {i18n} from 'element-react';
5
-import locale from 'element-react/src/locale/lang/en';
1
+import React, {Component} from "react";
2
+import isNil from "lodash/isNil";
3
+import "element-theme-default";
4
+import {i18n} from "element-react";
5
+import locale from "element-react/src/locale/lang/en";
6 6
 
7
-import storage from './utils/storage';
8
-import logo from './utils/logo';
9
-import {makeLogin, isTokenExpire} from './utils/login';
7
+import storage from "./utils/storage";
8
+import logo from "./utils/logo";
9
+import {makeLogin, isTokenExpire} from "./utils/login";
10 10
 
11
-import Header from './components/Header';
12
-import Footer from './components/Footer';
13
-import LoginModal from './components/Login';
11
+import Header from "./components/Header";
12
+import Footer from "./components/Footer";
13
+import LoginModal from "./components/Login";
14 14
 
15 15
 i18n.use(locale);
16 16
 
17
-import Route from './router';
17
+import Route from "./router";
18 18
 
19
-import './styles/main.scss';
20
-import 'normalize.css';
19
+import "./styles/main.scss";
20
+import "normalize.css";
21 21
 
22 22
 export default class App extends Component {
23 23
   state = {
24 24
     error: {},
25
-    logoUrl: '',
25
+    logoUrl: "",
26 26
     user: {},
27
-    scope: (window.VERDACCIO_SCOPE) ? `${window.VERDACCIO_SCOPE}:` : '',
27
+    scope: (window.VERDACCIO_SCOPE) ? `${window.VERDACCIO_SCOPE}:` : "",
28 28
     showLoginModal: false,
29 29
     isUserLoggedIn: false
30 30
   };
@@ -45,8 +45,8 @@ export default class App extends Component {
45 45
 
46 46
   isUserAlreadyLoggedIn() {
47 47
     // checks for token validity
48
-    const token = storage.getItem('token');
49
-    const username = storage.getItem('username');
48
+    const token = storage.getItem("token");
49
+    const username = storage.getItem("username");
50 50
 
51 51
     if (isTokenExpire(token) || isNil(username)) {
52 52
       this.handleLogout();
@@ -91,8 +91,8 @@ export default class App extends Component {
91 91
           token
92 92
         }
93 93
       });
94
-      storage.setItem('username', username);
95
-      storage.setItem('token', token);
94
+      storage.setItem("username", username);
95
+      storage.setItem("token", token);
96 96
       // close login modal after successful login
97 97
       // set isUserLoggedin to true
98 98
       this.setState({
@@ -114,8 +114,8 @@ export default class App extends Component {
114 114
    * Required by: <Header />
115 115
    */
116 116
   handleLogout() {
117
-    storage.removeItem('username');
118
-    storage.removeItem('token');
117
+    storage.removeItem("username");
118
+    storage.removeItem("token");
119 119
     this.setState({
120 120
       user: {},
121 121
       isUserLoggedIn: false

+ 3
- 3
components/Footer/footer.scss View File

@@ -1,5 +1,5 @@
1
-@import '../../styles/variables';
2
-@import '../../styles/mixins';
1
+@import "../../styles/variables";
2
+@import "../../styles/mixins";
3 3
 
4 4
 .wrap {
5 5
   margin-top: auto;
@@ -35,7 +35,7 @@ footer.footer {
35 35
     transform-origin: left;
36 36
 
37 37
     &:before {
38
-      content: '';
38
+      content: "";
39 39
       position: absolute;
40 40
       top: 3px;
41 41
       left: -7px;

+ 12
- 12
components/Footer/index.js View File

@@ -1,16 +1,16 @@
1
-import React, {Component} from 'react';
1
+import React, { Component } from "react";
2 2
 
3
-import classes from './footer.scss';
4
-import logo from './logo.svg';
5
-import earth from './earth.svg';
3
+import classes from "./footer.scss";
4
+import logo from "./logo.svg";
5
+import earth from "./earth.svg";
6 6
 
7 7
 // Vectors from Twitter Emoji (Open Source)
8
-import brazilFlag from './flags/brazil-1f1e7-1f1f7.svg';
9
-import chinaFlag from './flags/china-1f1e8-1f1f3.svg';
10
-import indiaFlag from './flags/india-1f1ee-1f1f3.svg';
11
-import nicaraguaFlag from './flags/nicaragua-1f1f3-1f1ee.svg';
12
-import pakistanFlag from './flags/pakistan-1f1f5-1f1f0.svg';
13
-import spainFlag from './flags/spain-1f1ea-1f1f8.svg';
8
+import brazilFlag from "./flags/brazil-1f1e7-1f1f7.svg";
9
+import chinaFlag from "./flags/china-1f1e8-1f1f3.svg";
10
+import indiaFlag from "./flags/india-1f1ee-1f1f3.svg";
11
+import nicaraguaFlag from "./flags/nicaragua-1f1f3-1f1ee.svg";
12
+import pakistanFlag from "./flags/pakistan-1f1f5-1f1f0.svg";
13
+import spainFlag from "./flags/spain-1f1ea-1f1f8.svg";
14 14
 
15 15
 export default class Footer extends Component {
16 16
   constructor(props) {
@@ -49,13 +49,13 @@ export default class Footer extends Component {
49 49
 
50 50
           <div className={classes.right}>
51 51
             Powered by&nbsp;
52
-            { /* Can't switch to HTTPS due it hosted on GitHub Pages */ }
52
+            { /* Cannot switch to HTTPS due it hosted on GitHub Pages */ }
53 53
             <a href="http://www.verdaccio.org/">
54 54
               <img className={classes.logo} src={logo} alt="Verdaccio" title="Verdaccio"/>
55 55
             </a>
56 56
             &nbsp;/&nbsp;
57 57
             {__APP_VERSION__}
58
-            </div>
58
+          </div>
59 59
         </footer>
60 60
       </div>
61 61
     );

+ 2
- 2
components/Header/header.scss View File

@@ -1,5 +1,5 @@
1
-@import '../../styles/variables';
2
-@import '../../styles/mixins';
1
+@import "../../styles/variables";
2
+@import "../../styles/mixins";
3 3
 
4 4
 .header {
5 5
   display: flex;

+ 11
- 10
components/Header/index.js View File

@@ -1,19 +1,20 @@
1
-import React from 'react';
2
-import PropTypes from 'prop-types';
3
-import {Button} from 'element-react';
4
-import capitalize from 'lodash/capitalize';
5
-import {getRegistryURL} from '../../utils/url';
6
-import classes from './header.scss';
7
-import './logo.png';
1
+import React from "react";
2
+import PropTypes from "prop-types";
3
+import { Button } from "element-react";
4
+import capitalize from "lodash/capitalize";
5
+import { getRegistryURL } from "../../utils/url";
6
+import classes from "./header.scss";
7
+import "./logo.png";
8 8
 
9 9
 const Header = ({
10
-  logo = '',
11
-  scope = '',
12
-  username = '',
10
+  logo = "",
11
+  scope = "",
12
+  username = "",
13 13
   handleLogout = () => {},
14 14
   toggleLoginModal = () => {}
15 15
 }) => {
16 16
   const registryUrl = getRegistryURL();
17
+
17 18
   return (
18 19
     <header className={classes.header}>
19 20
       <div className={classes.headerWrap}>

+ 2
- 2
components/Help/help.scss View File

@@ -1,5 +1,5 @@
1
-@import '../../styles/variables';
2
-@import '../../styles/mixins';
1
+@import "../../styles/variables";
2
+@import "../../styles/mixins";
3 3
 
4 4
 .help {
5 5
   .noPkg {

+ 32
- 32
components/Help/index.js View File

@@ -1,42 +1,42 @@
1
-import React from 'react';
2
-import SyntaxHighlighter, {registerLanguage} from 'react-syntax-highlighter/dist/light';
3
-import sunburst from 'react-syntax-highlighter/src/styles/sunburst';
4
-import js from 'react-syntax-highlighter/dist/languages/javascript';
1
+import React from "react";
2
+import SyntaxHighlighter, { registerLanguage } from "react-syntax-highlighter/dist/light";
3
+import sunburst from "react-syntax-highlighter/src/styles/sunburst";
4
+import js from "react-syntax-highlighter/dist/languages/javascript";
5 5
 
6
-import classes from './help.scss';
7
-import {getRegistryURL} from '../../utils/url';
6
+import classes from "./help.scss";
7
+import { getRegistryURL } from "../../utils/url";
8 8
 
9
-registerLanguage('javascript', js);
9
+registerLanguage("javascript", js);
10 10
 
11 11
 const Help = () => {
12 12
   const registryURL = getRegistryURL();
13 13
 
14
-    return (
15
-      <div className={classes.help}>
16
-        <li className={classes.noPkg}>
17
-          <h1 className={classes.noPkgTitle}>
18
-            No Package Published Yet
19
-          </h1>
20
-          <div className={classes.noPkgIntro}>
21
-            <div>
22
-              To publish your first package just:
23
-            </div>
24
-            <br/>
25
-            <strong>
26
-              1. Login
27
-            </strong>
28
-            <SyntaxHighlighter language='javascript' style={sunburst} id="adduser">
29
-              {`npm adduser --registry  ${registryURL}`}
30
-            </SyntaxHighlighter>
31
-            <strong>2. Publish</strong>
32
-            <SyntaxHighlighter language='javascript' style={sunburst} id="publish">
33
-              {`npm publish --registry ${registryURL}`}
34
-            </SyntaxHighlighter>
35
-            <strong>3. Refresh this page!</strong>
14
+  return (
15
+    <div className={classes.help}>
16
+      <li className={classes.noPkg}>
17
+        <h1 className={classes.noPkgTitle}>
18
+          No Package Published Yet
19
+        </h1>
20
+        <div className={classes.noPkgIntro}>
21
+          <div>
22
+            To publish your first package just:
36 23
           </div>
37
-        </li>
38
-      </div>
39
-    );
24
+          <br/>
25
+          <strong>
26
+            1. Login
27
+          </strong>
28
+          <SyntaxHighlighter language="javascript" style={sunburst} id="adduser">
29
+            {`npm adduser --registry  ${registryURL}`}
30
+          </SyntaxHighlighter>
31
+          <strong>2. Publish</strong>
32
+          <SyntaxHighlighter language="javascript" style={sunburst} id="publish">
33
+            {`npm publish --registry ${registryURL}`}
34
+          </SyntaxHighlighter>
35
+          <strong>3. Refresh this page!</strong>
36
+        </div>
37
+      </li>
38
+    </div>
39
+  );
40 40
 };
41 41
 
42 42
 export default Help;

+ 15
- 15
components/Login/index.js View File

@@ -1,6 +1,6 @@
1
-import React, {Component, createRef} from 'react';
2
-import PropTypes from 'prop-types';
3
-import {Form, Button, Dialog, Input, Alert} from 'element-react';
1
+import React, {Component, createRef} from "react";
2
+import PropTypes from "prop-types";
3
+import {Form, Button, Dialog, Input, Alert} from "element-react";
4 4
 
5 5
 export default class LoginModal extends Component {
6 6
   static propTypes = {
@@ -19,22 +19,22 @@ export default class LoginModal extends Component {
19 19
 
20 20
   state = {
21 21
     form: {
22
-      username: '',
23
-      password: ''
22
+      username: "",
23
+      password: ""
24 24
     },
25 25
     rules: {
26 26
       username: [
27 27
         {
28 28
           required: true,
29
-          message: 'Please input the username',
30
-          trigger: 'change'
29
+          message: "Please input the username",
30
+          trigger: "change"
31 31
         }
32 32
       ],
33 33
       password: [
34 34
         {
35 35
           required: true,
36
-          message: 'Please input the password',
37
-          trigger: 'change'
36
+          message: "Please input the password",
37
+          trigger: "change"
38 38
         }
39 39
       ]
40 40
     }
@@ -48,7 +48,7 @@ export default class LoginModal extends Component {
48 48
   }
49 49
 
50 50
   /**
51
-   * set login modal's username and password to current state
51
+   * set login modal username and password to current state
52 52
    * Required by: <LoginModal />
53 53
    */
54 54
   setCredentials(key, value) {
@@ -89,10 +89,10 @@ export default class LoginModal extends Component {
89 89
         description={description}
90 90
         showIcon={true}
91 91
         closable={false}
92
-        style={{lineHeight: '10px'}}
92
+        style={{lineHeight: "10px"}}
93 93
       />
94 94
     ) : (
95
-      ''
95
+      ""
96 96
     );
97 97
   }
98 98
 
@@ -122,7 +122,7 @@ export default class LoginModal extends Component {
122 122
                   name="username"
123 123
                   placeholder="Type your username"
124 124
                   value={username}
125
-                  onChange={this.setCredentials.bind(this, 'username')}
125
+                  onChange={this.setCredentials.bind(this, "username")}
126 126
                 />
127 127
               </Form.Item>
128 128
               <Form.Item prop="password">
@@ -131,10 +131,10 @@ export default class LoginModal extends Component {
131 131
                   type="password"
132 132
                   placeholder="Type your password"
133 133
                   value={password}
134
-                  onChange={this.setCredentials.bind(this, 'password')}
134
+                  onChange={this.setCredentials.bind(this, "password")}
135 135
                 />
136 136
               </Form.Item>
137
-              <Form.Item style={{float: 'right'}}>
137
+              <Form.Item style={{float: "right"}}>
138 138
                 <Button onClick={onCancel} className="cancel-login-button">
139 139
                   Cancel
140 140
                 </Button>

+ 8
- 8
components/NoItems/index.js View File

@@ -1,14 +1,14 @@
1
-import React from 'react';
2
-import PropTypes from 'prop-types';
1
+import React from "react";
2
+import PropTypes from "prop-types";
3 3
 
4
-import classes from './noItems.scss';
4
+import classes from "./noItems.scss";
5 5
 
6 6
 const NoItems = (props) => {
7
-    return (
8
-      <div className={classes.noItems}>
9
-        <h2>{props.text}</h2>
10
-      </div>
11
-    );
7
+  return (
8
+    <div className={classes.noItems}>
9
+      <h2>{props.text}</h2>
10
+    </div>
11
+  );
12 12
 };
13 13
 
14 14
 NoItems.propTypes = {

+ 2
- 2
components/NotFound/404.scss View File

@@ -1,5 +1,5 @@
1
-@import '../../styles/variables';
2
-@import '../../styles/mixins';
1
+@import "../../styles/variables";
2
+@import "../../styles/mixins";
3 3
 
4 4
 .notFound {
5 5
   width: 100%;

+ 10
- 12
components/NotFound/index.js View File

@@ -1,19 +1,17 @@
1 1
 
2
-import React from 'react';
3
-import PropTypes from 'prop-types';
2
+import React from "react";
3
+import PropTypes from "prop-types";
4 4
 
5
-import classes from './404.scss';
5
+import classes from "./404.scss";
6 6
 
7 7
 const NotFound = (props) => {
8
-    return (
9
-      <div className={classes.notFound}>
10
-        <h1>Error 404 - {props.pkg}</h1>
11
-        <hr/>
12
-        <p>
13
-          Oops, The package you are trying to access does not exist.
14
-        </p>
15
-      </div>
16
-    );
8
+  return (
9
+    <div className={classes.notFound}>
10
+      <h1>Error 404 - {props.pkg}</h1>
11
+      <hr/>
12
+      <p>Oops, The package you are trying to access does not exist.</p>
13
+    </div>
14
+  );
17 15
 };
18 16
 
19 17
 NotFound.propTypes = {

+ 9
- 9
components/Package/index.js View File

@@ -1,13 +1,13 @@
1
-import React from 'react';
2
-import PropTypes from 'prop-types';
3
-import {Tag} from 'element-react';
4
-import {Link} from 'react-router-dom';
1
+import React from "react";
2
+import PropTypes from "prop-types";
3
+import { Tag } from "element-react";
4
+import { Link } from "react-router-dom";
5 5
 
6
-import {formatDateDistance} from '../../utils/package';
6
+import { formatDateDistance } from "../../utils/package";
7 7
 
8
-import classes from './package.scss';
8
+import classes from "./package.scss";
9 9
 
10
-const Package = ({name, version, author, description, license, time}) => {
10
+const Package = ({ name, version, author, description, license, time }) => {
11 11
   return (<section className={classes.package}>
12 12
     <Link to={`detail/${name}`}>
13 13
       <div className={classes.header}>
@@ -17,7 +17,7 @@ const Package = ({name, version, author, description, license, time}) => {
17 17
           </h1>
18 18
         </div>
19 19
         <div role="author" className={classes.author}>
20
-        { author ? `By: ${author}`: ''}
20
+          { author ? `By: ${author}` : ""}
21 21
         </div>
22 22
       </div>
23 23
       <div className={classes.footer}>
@@ -27,7 +27,7 @@ const Package = ({name, version, author, description, license, time}) => {
27 27
       </div>
28 28
       <div className={classes.details}>
29 29
         <div className={classes.homepage}>
30
-          {time ? `Published ${formatDateDistance(time)} ago` : ''}
30
+          {time ? `Published ${formatDateDistance(time)} ago` : ""}
31 31
         </div>
32 32
         <div className={classes.license}>
33 33
           {license}

+ 3
- 3
components/Package/package.scss View File

@@ -1,5 +1,5 @@
1
-@import '../../styles/variables';
2
-@import '../../styles/mixins';
1
+@import "../../styles/variables";
2
+@import "../../styles/mixins";
3 3
 
4 4
 .package {
5 5
   .header {
@@ -67,7 +67,7 @@
67 67
 
68 68
     &:hover {
69 69
       &::before {
70
-        content: '';
70
+        content: "";
71 71
         display: block;
72 72
         background: rgba(255, 255, 255, 0.7);
73 73
         @include fullSize;

+ 8
- 8
components/PackageDetail/index.js View File

@@ -1,16 +1,16 @@
1
-import React from 'react';
2
-import PropTypes from 'prop-types';
3
-import isNil from 'lodash/isNil';
1
+import React from "react";
2
+import PropTypes from "prop-types";
3
+import isNil from "lodash/isNil";
4 4
 
5
-import Readme from '../Readme';
5
+import Readme from "../Readme";
6 6
 
7
-import classes from './packageDetail.scss';
7
+import classes from "./packageDetail.scss";
8 8
 
9
-const displayState = (readMe) => {
10
-  return !isNil(readMe) ? <Readme readMe={readMe} /> : '';
9
+const displayState = readMe => {
10
+  return !isNil(readMe) ? <Readme readMe={readMe} /> : "";
11 11
 };
12 12
 
13
-const PackageDetail = ({packageName, readMe}) => {
13
+const PackageDetail = ({ packageName, readMe }) => {
14 14
   return (
15 15
     <div className={classes.pkgDetail}>
16 16
       <h1 className={classes.title}>{packageName}</h1>

+ 2
- 2
components/PackageDetail/packageDetail.scss View File

@@ -1,5 +1,5 @@
1
-@import '../../styles/variables';
2
-@import '../../styles/mixins';
1
+@import "../../styles/variables";
2
+@import "../../styles/mixins";
3 3
 
4 4
 .pkgDetail {
5 5
   .title {

+ 15
- 16
components/PackageList/index.js View File

@@ -1,13 +1,13 @@
1
-import React from 'react';
2
-import PropTypes from 'prop-types';
3
-import isEmpty from 'lodash/isEmpty';
1
+import React from "react";
2
+import PropTypes from "prop-types";
3
+import isEmpty from "lodash/isEmpty";
4 4
 
5
-import Package from '../Package';
6
-import Help from '../Help';
7
-import NoItems from '../NoItems';
8
-import {formatAuthor, formatLicense} from '../../utils/package';
5
+import Package from "../Package";
6
+import Help from "../Help";
7
+import NoItems from "../NoItems";
8
+import {formatAuthor, formatLicense} from "../../utils/package";
9 9
 
10
-import classes from './packageList.scss';
10
+import classes from "./packageList.scss";
11 11
 
12 12
 export default class PackageList extends React.Component {
13 13
   static propTypes = {
@@ -27,9 +27,8 @@ export default class PackageList extends React.Component {
27 27
   }
28 28
 
29 29
   renderTitle() {
30
-    if (this.isTherePackages() === false) {
30
+    if (this.isTherePackages() === false)
31 31
       return;
32
-    }
33 32
 
34 33
     return <h1 className={classes.listTitle}>Available Packages</h1>;
35 34
   }
@@ -39,6 +38,7 @@ export default class PackageList extends React.Component {
39 38
       const {name, version, description, time} = pkg;
40 39
       const author = formatAuthor(pkg.author);
41 40
       const license = formatLicense(pkg.license);
41
+
42 42
       return (
43 43
         <li key={i}>
44 44
           <Package {...{name, version, author, description, license, time}} />
@@ -48,26 +48,25 @@ export default class PackageList extends React.Component {
48 48
   }
49 49
 
50 50
   renderOptions() {
51
-    if (this.isTherePackages() === false && this.props.help) {
51
+    if (this.isTherePackages() === false && this.props.help)
52 52
       return this.renderHelp();
53
-    } else {
53
+    else
54 54
       return this.renderNoItems();
55
-    }
56 55
   }
57 56
 
58 57
   renderNoItems() {
59 58
     return (
60 59
       <NoItems
61 60
         className="package-no-items"
62
-        text={'No items were found with that query'}
61
+        text={"No items were found with that query"}
63 62
       />
64 63
     );
65 64
   }
66 65
 
67 66
   renderHelp() {
68
-    if (this.props.help === false) {
67
+    if (this.props.help === false)
69 68
       return;
70
-    }
69
+
71 70
     return <Help />;
72 71
   }
73 72
 

+ 2
- 2
components/PackageList/packageList.scss View File

@@ -1,5 +1,5 @@
1
-@import '../../styles/variables';
2
-@import '../../styles/mixins';
1
+@import "../../styles/variables";
2
+@import "../../styles/mixins";
3 3
 
4 4
 .pkgContainer {
5 5
   margin: 0;

+ 4
- 4
components/PackageSidebar/Module/index.jsx View File

@@ -1,9 +1,9 @@
1
-import React from 'react';
2
-import PropTypes from 'prop-types';
1
+import React from "react";
2
+import PropTypes from "prop-types";
3 3
 
4
-import classes from './style.scss';
4
+import classes from "./style.scss";
5 5
 
6
-export default function Module({title, description, children, className}) {
6
+export default function Module({ title, description, children, className }) {
7 7
   return (
8 8
     <div className={`${classes.module} ${className}`}>
9 9
       <h2 className={classes.moduleTitle}>

+ 3
- 4
components/PackageSidebar/Module/style.scss View File

@@ -1,18 +1,17 @@
1
-@import '../../../styles/variables';
2
-@import '../../../styles/mixins';
1
+@import "../../../styles/variables";
2
+@import "../../../styles/mixins";
3 3
 
4 4
 .module {
5
-
6 5
   margin-bottom: 10px;
7 6
 
8 7
   .moduleTitle {
8
+    @include border-bottom-default($greyGainsboro);
9 9
     display: flex;
10 10
     align-items: flex-end;
11 11
     font-size: $font-size-lg;
12 12
     margin: 0 0 10px;
13 13
     padding: 5px 0;
14 14
     font-weight: $font-weight-semibold;
15
-    @include border-bottom-default($greyGainsboro);
16 15
 
17 16
     span { // description
18 17
       font-size: $font-size-sm;

+ 5
- 4
components/PackageSidebar/ModuleContentPlaceholder/index.jsx View File

@@ -1,11 +1,12 @@
1
-import React from 'react';
2
-import PropTypes from 'prop-types';
1
+import React from "react";
2
+import PropTypes from "prop-types";
3 3
 
4
-import classes from './style.scss';
4
+import classes from "./style.scss";
5 5
 
6
-export default function ModuleContentPlaceholder({text}) {
6
+export default function ModuleContentPlaceholder({ text }) {
7 7
   return <p className={classes.emptyPlaceholder}>{text}</p>;
8 8
 }
9
+
9 10
 ModuleContentPlaceholder.propTypes = {
10 11
   text: PropTypes.string.isRequired
11 12
 };

+ 1
- 1
components/PackageSidebar/ModuleContentPlaceholder/style.scss View File

@@ -1,4 +1,4 @@
1
-@import '../../../styles/variables';
1
+@import "../../../styles/variables";
2 2
 
3 3
 .emptyPlaceholder {
4 4
   text-align: center;

+ 17
- 17
components/PackageSidebar/index.jsx View File

@@ -1,19 +1,19 @@
1
-import React from 'react';
2
-import PropTypes from 'prop-types';
3
-import get from 'lodash/get';
4
-import LastSync from './modules/LastSync';
5
-import Maintainers from './modules/Maintainers';
6
-import Dependencies from './modules/Dependencies';
7
-import PeerDependencies from './modules/PeerDependencies';
8
-import Infos from './modules/Infos';
1
+import React from "react";
2
+import PropTypes from "prop-types";
3
+import get from "lodash/get";
4
+import LastSync from "./modules/LastSync";
5
+import Maintainers from "./modules/Maintainers";
6
+import Dependencies from "./modules/Dependencies";
7
+import PeerDependencies from "./modules/PeerDependencies";
8
+import Infos from "./modules/Infos";
9 9
 
10 10
 import {
11 11
   formatLicense,
12 12
   formatRepository,
13 13
   getLastUpdatedPackageTime,
14 14
   getRecentReleases
15
-} from '../../utils/package';
16
-import API from '../../utils/api';
15
+} from "../../utils/package";
16
+import API from "../../utils/api";
17 17
 
18 18
 export default class PackageSidebar extends React.Component {
19 19
   state = {};
@@ -35,8 +35,8 @@ export default class PackageSidebar extends React.Component {
35 35
     let packageMeta;
36 36
 
37 37
     try {
38
-      packageMeta = await API.request(`sidebar/${packageName}`, 'GET');
39
-    } catch (err) {
38
+      packageMeta = await API.request(`sidebar/${packageName}`, "GET");
39
+    } catch(err) {
40 40
       this.setState({
41 41
         failed: true
42 42
       });
@@ -54,19 +54,19 @@ export default class PackageSidebar extends React.Component {
54 54
       const {time, _uplinks} = packageMeta;
55 55
 
56 56
       // Infos component
57
-      const license = formatLicense(get(packageMeta, 'latest.license', null));
57
+      const license = formatLicense(get(packageMeta, "latest.license", null));
58 58
       const repository = formatRepository(
59
-        get(packageMeta, 'latest.repository', null)
59
+        get(packageMeta, "latest.repository", null)
60 60
       );
61
-      const homepage = get(packageMeta, 'latest.homepage', null);
61
+      const homepage = get(packageMeta, "latest.homepage", null);
62 62
 
63 63
       // Lastsync component
64 64
       const recentReleases = getRecentReleases(time);
65 65
       const lastUpdated = getLastUpdatedPackageTime(_uplinks);
66 66
 
67 67
       // Dependencies component
68
-      const dependencies = get(packageMeta, 'latest.dependencies', {});
69
-      const peerDependencies = get(packageMeta, 'latest.peerDependencies', {});
68
+      const dependencies = get(packageMeta, "latest.dependencies", {});
69
+      const peerDependencies = get(packageMeta, "latest.peerDependencies", {});
70 70
 
71 71
       // Maintainers component
72 72
       return (

+ 10
- 9
components/PackageSidebar/modules/Dependencies/index.jsx View File

@@ -1,14 +1,14 @@
1
-import React from 'react';
2
-import PropTypes from 'prop-types';
3
-import Module from '../../Module';
1
+import React from "react";
2
+import PropTypes from "prop-types";
3
+import Module from "../../Module";
4 4
 
5
-import {getDetailPageURL} from '../../../../utils/url';
6
-import ModuleContentPlaceholder from '../../ModuleContentPlaceholder';
5
+import { getDetailPageURL } from "../../../../utils/url";
6
+import ModuleContentPlaceholder from "../../ModuleContentPlaceholder";
7 7
 
8
-import classes from './style.scss';
8
+import classes from "./style.scss";
9 9
 
10
-export const NO_DEPENDENCIES = 'Zero Dependencies!';
11
-export const DEP_ITEM_CLASS = 'dependency-item';
10
+export const NO_DEPENDENCIES = "Zero Dependencies!";
11
+export const DEP_ITEM_CLASS = "dependency-item";
12 12
 
13 13
 const renderDependenciesList = (dependencies, dependenciesList) => {
14 14
   return (
@@ -29,8 +29,9 @@ const renderDependenciesList = (dependencies, dependenciesList) => {
29 29
   );
30 30
 };
31 31
 
32
-const Dependencies = ({dependencies = {}, title = 'Dependencies'}) => {
32
+const Dependencies = ({ dependencies = {}, title = "Dependencies" }) => {
33 33
   const dependenciesList = Object.keys(dependencies);
34
+
34 35
   return (
35 36
     <Module title={title} className={classes.dependenciesModule}>
36 37
       {dependenciesList.length > 0 ? (

+ 1
- 1
components/PackageSidebar/modules/Dependencies/style.scss View File

@@ -1,4 +1,4 @@
1
-@import '../../../../styles/variables';
1
+@import "../../../../styles/variables";
2 2
 
3 3
 .dependenciesModule {
4 4
   li {

+ 16
- 15
components/PackageSidebar/modules/Infos/index.jsx View File

@@ -1,9 +1,9 @@
1
-import React from 'react';
2
-import PropTypes from 'prop-types';
3
-import Module from '../../Module';
4
-import ModuleContentPlaceholder from '../../ModuleContentPlaceholder';
1
+import React from "react";
2
+import PropTypes from "prop-types";
3
+import Module from "../../Module";
4
+import ModuleContentPlaceholder from "../../ModuleContentPlaceholder";
5 5
 
6
-import classes from './style.scss';
6
+import classes from "./style.scss";
7 7
 
8 8
 const renderSection = (title, url) => (
9 9
   <li>
@@ -14,18 +14,19 @@ const renderSection = (title, url) => (
14 14
   </li>
15 15
 );
16 16
 
17
-const Infos = ({homepage, repository, license}) => {
17
+const Infos = ({ homepage, repository, license }) => {
18 18
   const showInfo = homepage || repository || license;
19
+
19 20
   return <Module title="Infos" className={classes.infosModule}>
20
-      {showInfo ? <ul>
21
-          {homepage && renderSection('Homepage', homepage)}
22
-          {repository && renderSection('Repository', repository)}
23
-          {license && <li>
24
-              <span>License</span>
25
-              <span>{license}</span>
26
-            </li>}
27
-        </ul> : <ModuleContentPlaceholder text="Not Available!" />}
28
-    </Module>;
21
+    {showInfo ? <ul>
22
+      {homepage && renderSection("Homepage", homepage)}
23
+      {repository && renderSection("Repository", repository)}
24
+      {license && <li>
25
+        <span>License</span>
26
+        <span>{license}</span>
27
+      </li>}
28
+    </ul> : <ModuleContentPlaceholder text="Not Available!" />}
29
+  </Module>;
29 30
 };
30 31
 
31 32
 Infos.propTypes = {

+ 3
- 3
components/PackageSidebar/modules/Infos/style.scss View File

@@ -1,5 +1,5 @@
1
-@import '../../../../styles/variables';
2
-@import '../../../../styles/mixins';
1
+@import "../../../../styles/variables";
2
+@import "../../../../styles/mixins";
3 3
 
4 4
 .infosModule {
5 5
   li {
@@ -12,7 +12,7 @@
12 12
       max-width: 150px;
13 13
       @include ellipsis;
14 14
     }
15
-    
15
+
16 16
     a:last-child,
17 17
     span:last-child {
18 18
       margin-left: auto;

+ 8
- 7
components/PackageSidebar/modules/LastSync/index.jsx View File

@@ -1,15 +1,16 @@
1
-import React from 'react';
2
-import propTypes from 'prop-types';
3
-import Module from '../../Module';
4
-import ModuleContentPlaceholder from '../../ModuleContentPlaceholder';
1
+import React from "react";
2
+import propTypes from "prop-types";
3
+import Module from "../../Module";
4
+import ModuleContentPlaceholder from "../../ModuleContentPlaceholder";
5 5
 
6
-import classes from './style.scss';
6
+import classes from "./style.scss";
7 7
 
8 8
 const renderRecentReleases = (recentReleases) => {
9 9
   return (
10 10
     <ul>
11 11
       {recentReleases.map((versionInfo) => {
12
-        const {version, time} = versionInfo;
12
+        const { version, time } = versionInfo;
13
+
13 14
         return (
14 15
           <li className="last-sync-item" key={version}>
15 16
             <span>{version}</span>
@@ -21,7 +22,7 @@ const renderRecentReleases = (recentReleases) => {
21 22
   );
22 23
 };
23 24
 
24
-const LastSync = ({recentReleases = [], lastUpdated = ''}) => {
25
+const LastSync = ({ recentReleases = [], lastUpdated = "" }) => {
25 26
   return (
26 27
     <Module
27 28
       title="Last Sync"

+ 1
- 1
components/PackageSidebar/modules/LastSync/style.scss View File

@@ -1,4 +1,4 @@
1
-@import '../../../../styles/variables';
1
+@import "../../../../styles/variables";
2 2
 
3 3
 .releasesModule {
4 4
   li {

+ 9
- 7
components/PackageSidebar/modules/Maintainers/MaintainerInfo/index.jsx View File

@@ -1,10 +1,11 @@
1
-import React from 'react';
2
-import PropTypes from 'prop-types';
1
+import React from "react";
2
+import PropTypes from "prop-types";
3 3
 
4
-import classes from './style.scss';
4
+import classes from "./style.scss";
5
+
6
+export default function MaintainerInfo({ title, name, avatar }) {
7
+  let avatarDescription = `${title} ${name}"s avatar`;
5 8
 
6
-export default function MaintainerInfo({title, name, avatar}) {
7
-  let avatarDescription = `${title} ${name}'s avatar`;
8 9
   return (
9 10
     <div className={classes.maintainer} title={name}>
10 11
       <img src={avatar} alt={avatarDescription} title={avatarDescription}/>
@@ -12,8 +13,9 @@ export default function MaintainerInfo({title, name, avatar}) {
12 13
     </div>
13 14
   );
14 15
 }
16
+
15 17
 MaintainerInfo.propTypes = {
16
-  title: PropTypes.string.isRequired,
18
+  avatar: PropTypes.string.isRequired,
17 19
   name: PropTypes.string.isRequired,
18
-  avatar: PropTypes.string.isRequired
20
+  title: PropTypes.string.isRequired
19 21
 };

+ 8
- 8
components/PackageSidebar/modules/Maintainers/MaintainerInfo/style.scss View File

@@ -1,26 +1,26 @@
1
-@import '../../../../../styles/variables';
2
-@import '../../../../../styles/mixins';
1
+@import "../../../../../styles/variables";
2
+@import "../../../../../styles/mixins";
3 3
 
4 4
 .maintainer {
5
+  cursor: default;
5 6
   display: flex;
6 7
   line-height: $line-height-xl;
7
-  cursor: default;
8 8
 
9 9
   &:not(:last-child) {
10 10
     margin-bottom: 10px;
11 11
   }
12 12
 
13 13
   img {
14
-    width: 30px;
15
-    height: 30px;
16
-    margin-right: 10px;
14
+    width: 30px; height: 30px;
15
+
17 16
     border-radius: 100%;
18 17
     flex-shrink: 0;
18
+    margin-right: 10px;
19 19
   }
20 20
 
21 21
   span {
22
-    font-size: $font-size-sm;
23
-    flex-shrink: 1;
24 22
     @include ellipsis;
23
+    flex-shrink: 1;
24
+    font-size: $font-size-sm;
25 25
   }
26 26
 }

+ 22
- 21
components/PackageSidebar/modules/Maintainers/index.jsx View File

@@ -1,16 +1,16 @@
1
-import React from 'react';
2
-import PropTypes from 'prop-types';
3
-import get from 'lodash/get';
4
-import filter from 'lodash/filter';
5
-import size from 'lodash/size';
6
-import has from 'lodash/has';
7
-import uniqBy from 'lodash/uniqBy';
1
+import React from "react";
2
+import PropTypes from "prop-types";
3
+import get from "lodash/get";
4
+import filter from "lodash/filter";
5
+import size from "lodash/size";
6
+import has from "lodash/has";
7
+import uniqBy from "lodash/uniqBy";
8 8
 
9
-import Module from '../../Module';
10
-import MaintainerInfo from './MaintainerInfo';
11
-import ModuleContentPlaceholder from '../../ModuleContentPlaceholder';
9
+import Module from "../../Module";
10
+import MaintainerInfo from "./MaintainerInfo";
11
+import ModuleContentPlaceholder from "../../ModuleContentPlaceholder";
12 12
 
13
-import classes from './style.scss';
13
+import classes from "./style.scss";
14 14
 
15 15
 const CONTRIBUTORS_TO_SHOW = 5;
16 16
 
@@ -27,15 +27,16 @@ export default class Maintainers extends React.Component {
27 27
   }
28 28
 
29 29
   get author() {
30
-    return get(this, 'props.packageMeta.latest.author');
30
+    return get(this, "props.packageMeta.latest.author");
31 31
   }
32 32
 
33 33
   get contributors() {
34
-    let contributors = get(this, 'props.packageMeta.latest.contributors', {});
35
-    return filter(contributors, (contributor) => {
34
+    let contributors = get(this, "props.packageMeta.latest.contributors", {});
35
+
36
+    return filter(contributors, contributor => {
36 37
       return (
37
-        contributor.name !== get(this, 'author.name') &&
38
-        contributor.email !== get(this, 'author.email')
38
+        contributor.name !== get(this, "author.name") &&
39
+        contributor.email !== get(this, "author.email")
39 40
       );
40 41
     });
41 42
   }
@@ -45,11 +46,10 @@ export default class Maintainers extends React.Component {
45 46
   }
46 47
 
47 48
   get uniqueContributors() {
48
-    if (!this.contributors) {
49
+    if (!this.contributors)
49 50
       return [];
50
-    }
51 51
 
52
-    return uniqBy(this.contributors, (contributor) => contributor.name).slice(
52
+    return uniqBy(this.contributors, contributor => contributor.name).slice(
53 53
       0,
54 54
       CONTRIBUTORS_TO_SHOW
55 55
     );
@@ -62,7 +62,8 @@ export default class Maintainers extends React.Component {
62 62
   }
63 63
 
64 64
   renderContributors() {
65
-    if (!this.contributors) return null;
65
+    if (!this.contributors)
66
+      return null;
66 67
 
67 68
     return (this.showAllContributors
68 69
       ? this.contributors
@@ -111,7 +112,7 @@ export default class Maintainers extends React.Component {
111 112
     const contributors = this.renderContributors();
112 113
     return (
113 114
       <Module title="Maintainers" className={classes.maintainersModule}>
114
-        {contributors.length || has(author, 'name') ? (
115
+        {contributors.length || has(author, "name") ? (
115 116
           this.renderAuthorAndContributors(author)
116 117
         ) : (
117 118
           <ModuleContentPlaceholder text="Not Available!" />

+ 4
- 4
components/PackageSidebar/modules/Maintainers/style.scss View File

@@ -1,13 +1,13 @@
1
-@import '../../../../styles/variables';
1
+@import "../../../../styles/variables";
2 2
 
3 3
 .maintainersModule {
4 4
   .showAllContributors {
5
-    cursor: pointer;
6
-    width: 100%;
7 5
     background: none;
8 6
     border: none;
7
+    cursor: pointer;
9 8
     font-size: $font-size-sm;
10
-    text-align: center;
11 9
     padding: 10px 0;
10
+    text-align: center;
11
+    width: 100%;
12 12
   }
13 13
 }

+ 5
- 5
components/PackageSidebar/modules/PeerDependencies/index.jsx View File

@@ -1,10 +1,10 @@
1
-import React from 'react';
2
-import PropTypes from 'prop-types';
3
-import Dependencies from '../Dependencies';
1
+import React from "react";
2
+import PropTypes from "prop-types";
3
+import Dependencies from "../Dependencies";
4 4
 
5
-export const TITLE = 'Peer Dependencies'
5
+export const TITLE = "Peer Dependencies";
6 6
 
7
-const PeerDependencies = ({dependencies = {}, title = TITLE}) => {
7
+const PeerDependencies = ({ dependencies = {}, title = TITLE }) => {
8 8
   return (
9 9
     <Dependencies title={title} dependencies={dependencies} />
10 10
   );

+ 5
- 5
components/Readme/index.js View File

@@ -1,11 +1,11 @@
1 1
 
2
-import React from 'react';
3
-import PropTypes from 'prop-types';
2
+import React from "react";
3
+import PropTypes from "prop-types";
4 4
 
5
-import 'github-markdown-css';
5
+import "github-markdown-css";
6 6
 
7
-const Readme = (props) => {
8
-  return <div className="markdown-body" dangerouslySetInnerHTML={{__html: props.readMe}}/>;
7
+const Readme = props => {
8
+  return <div className="markdown-body" dangerouslySetInnerHTML={{ __html: props.readMe }}/>;
9 9
 };
10 10
 
11 11
 Readme.propTypes = {

+ 1
- 1
components/Readme/readme.scss View File

@@ -1,4 +1,4 @@
1
-@import '../../styles/mixins';
1
+@import "../../styles/mixins";
2 2
 
3 3
 .searchBox {
4 4
   @include searchBox;

+ 19
- 19
components/Search/index.js View File

@@ -1,35 +1,35 @@
1 1
 
2
-import React from 'react';
3
-import PropTypes from 'prop-types';
2
+import React from "react";
3
+import PropTypes from "prop-types";
4 4
 
5
-import classes from './search.scss';
5
+import classes from "./search.scss";
6 6
 
7
-const noSubmit = (e) => {
7
+const noSubmit = e => {
8 8
   e.preventDefault();
9 9
 };
10 10
 
11
-const Search = (props) => {
12
-    return (
13
-      <form autoComplete="off" onSubmit={noSubmit}>
14
-        <input
15
-          name="search-box"
16
-          type="text"
17
-          placeholder={props.placeHolder}
18
-          className={classes.searchBox}
19
-          onChange={props.handleSearchInput}
20
-          autoComplete="off"
21
-        />
22
-      </form>
23
-    );
11
+const Search = props => {
12
+  return (
13
+    <form autoComplete="off" onSubmit={noSubmit}>
14
+      <input
15
+        name="search-box"
16
+        type="text"
17
+        placeholder={props.placeHolder}
18
+        className={classes.searchBox}
19
+        onChange={props.handleSearchInput}
20
+        autoComplete="off"
21
+      />
22
+    </form>
23
+  );
24 24
 };
25 25
 
26 26
 Search.defaultProps = {
27
-  placeHolder: 'Type to search...'
27
+  placeHolder: "Type to search..."
28 28
 };
29 29
 
30 30
 Search.propTypes = {
31 31
   handleSearchInput: PropTypes.func.isRequired,
32
-  placeHolder: PropTypes.string,
32
+  placeHolder: PropTypes.string
33 33
 };
34 34
 
35 35
 export default Search;

+ 1
- 1
components/Search/search.scss View File

@@ -1,4 +1,4 @@
1
-@import '../../styles/mixins';
1
+@import "../../styles/mixins";
2 2
 
3 3
 .searchBox {
4 4
   @include searchBox;

+ 7
- 7
index.js View File

@@ -1,12 +1,12 @@
1
-import './utils/__setPublicPath__';
1
+import "./utils/__setPublicPath__";
2 2
 
3
-import React from 'react';
4
-import ReactDOM from 'react-dom';
5
-import {AppContainer} from 'react-hot-loader';
3
+import React from "react";
4
+import ReactDOM from "react-dom";
5
+import { AppContainer } from "react-hot-loader";
6 6
 
7
-import App from './app';
7
+import App from "./app";
8 8
 
9
-let rootNode = document.getElementById('root');
9
+let rootNode = document.getElementById("root");
10 10
 
11 11
 let renderApp = (Component) => {
12 12
   ReactDOM.render(
@@ -20,7 +20,7 @@ let renderApp = (Component) => {
20 20
 renderApp(App);
21 21
 
22 22
 if (module.hot) {
23
-  module.hot.accept('./app', () => {
23
+  module.hot.accept("./app", () => {
24 24
     renderApp(App);
25 25
   });
26 26
 }

+ 4
- 5
modules/detail/detail.scss View File

@@ -1,10 +1,10 @@
1
-@import '../../styles/variables';
2
-@import '../../styles/mixins';
1
+@import "../../styles/variables";
2
+@import "../../styles/mixins";
3 3
 
4 4
 .twoColumn {
5 5
   @include container-size;
6
-  margin: auto 10px;
7 6
   display: flex;
7
+  margin: auto 10px;
8 8
 
9 9
   > div {
10 10
     &:first-child {
@@ -16,10 +16,9 @@
16 16
 
17 17
   > aside {
18 18
     &:last-child {
19
+      flex-shrink: 0;
19 20
       margin-left: auto;
20
-
21 21
       padding-left: 15px;
22
-      flex-shrink: 0;
23 22
       width: 285px;
24 23
     }
25 24
   }

+ 27
- 23
modules/detail/index.jsx View File

@@ -1,34 +1,36 @@
1
-import React, {Component} from 'react';
2
-import PropTypes from 'prop-types';
3
-import {Loading} from 'element-react';
4
-import isEmpty from 'lodash/isEmpty';
1
+import React, {Component} from "react";
2
+import PropTypes from "prop-types";
3
+import {Loading} from "element-react";
4
+import isEmpty from "lodash/isEmpty";
5 5
 
6
-import PackageDetail from '../../components/PackageDetail';
7
-import NotFound from '../../components/NotFound';
8
-import API from '../../utils/api';
6
+import PackageDetail from "../../components/PackageDetail";
7
+import NotFound from "../../components/NotFound";
8
+import API from "../../utils/api";
9 9
 
10
-import classes from './detail.scss';
11
-import PackageSidebar from '../../components/PackageSidebar/index';
10
+import classes from "./detail.scss";
11
+import PackageSidebar from "../../components/PackageSidebar/index";
12 12
 
13
-const loadingMessage = 'Loading...';
13
+const loadingMessage = "Loading...";
14 14
 
15 15
 export default class Detail extends Component {
16 16
   static propTypes = {
17
-    match: PropTypes.object,
18
-    isUserLoggedIn: PropTypes.bool
17
+    isUserLoggedIn: PropTypes.bool,
18
+    match: PropTypes.object
19 19
   };
20 20
 
21 21
   state = {
22
-    readMe: '',
23
-    notFound: false
22
+    notFound: false,
23
+    readMe: ""
24 24
   };
25 25
 
26 26
   getPackageName(props = this.props) {
27 27
     const params = props.match.params;
28
-    return `${(params.scope && '@' + params.scope + '/') || ''}${
28
+
29
+    return `${(params.scope && "@" + params.scope + "/") || ""}${
29 30
       params.package
30 31
     }`;
31 32
   }
33
+
32 34
   get packageName() {
33 35
     return this.getPackageName();
34 36
   }
@@ -41,6 +43,7 @@ export default class Detail extends Component {
41 43
     const condition1 = prevProps.isUserLoggedIn !== this.props.isUserLoggedIn;
42 44
     const condition2 =
43 45
       prevProps.match.params.package !== this.props.match.params.package;
46
+
44 47
     if (condition1 || condition2) {
45 48
       const packageName = this.getPackageName(this.props);
46 49
       this.loadPackageInfo(packageName);
@@ -49,16 +52,17 @@ export default class Detail extends Component {
49 52
 
50 53
   async loadPackageInfo(packageName) {
51 54
     this.setState({
52
-      readMe: ''
55
+      readMe: ""
53 56
     });
54 57
 
55 58
     try {
56
-      const resp = await API.request(`package/readme/${packageName}`, 'GET');
59
+      const resp = await API.request(`package/readme/${packageName}`, "GET");
60
+
57 61
       this.setState({
58
-        readMe: resp,
59
-        notFound: false
62
+        notFound: false,
63
+        readMe: resp
60 64
       });
61
-    } catch (err) {
65
+    } catch(err) {
62 66
       this.setState({
63 67
         notFound: true
64 68
       });
@@ -68,11 +72,11 @@ export default class Detail extends Component {
68 72
   render() {
69 73
     const {notFound, readMe} = this.state;
70 74
 
71
-    if (notFound) {
75
+    if (notFound)
72 76
       return <NotFound pkg={this.packageName} />;
73
-    } else if (isEmpty(readMe)) {
77
+    else if (isEmpty(readMe))
74 78
       return <Loading text={loadingMessage} />;
75
-    }
79
+
76 80
     return (
77 81
       <div className={classes.twoColumn}>
78 82
         <PackageDetail readMe={readMe} packageName={this.packageName} />

+ 32
- 31
modules/home/index.js View File

@@ -1,13 +1,13 @@
1
-import React, {Component, Fragment} from 'react';
2
-import PropTypes from 'prop-types';
3
-import {Loading, MessageBox} from 'element-react';
4
-import isEmpty from 'lodash/isEmpty';
5
-import debounce from 'lodash/debounce';
1
+import React, {Component, Fragment} from "react";
2
+import PropTypes from "prop-types";
3
+import {Loading, MessageBox} from "element-react";
4
+import isEmpty from "lodash/isEmpty";
5
+import debounce from "lodash/debounce";
6 6
 
7
-import API from '../../utils/api';
7
+import API from "../../utils/api";
8 8
 
9
-import PackageList from '../../components/PackageList';
10
-import Search from '../../components/Search';
9
+import PackageList from "../../components/PackageList";
10
+import Search from "../../components/Search";
11 11
 
12 12
 export default class Home extends Component {
13 13
   static propTypes = {
@@ -18,7 +18,7 @@ export default class Home extends Component {
18 18
   state = {
19 19
     loading: true,
20 20
     fistTime: true,
21
-    query: ''
21
+    query: ""
22 22
   };
23 23
 
24 24
   constructor(props) {
@@ -33,59 +33,59 @@ export default class Home extends Component {
33 33
 
34 34
   componentDidUpdate(prevProps, prevState) {
35 35
     if (prevState.query !== this.state.query) {
36
-      if (this.req && this.req.abort) this.req.abort();
36
+      if (this.req && this.req.abort)
37
+        this.req.abort();
38
+
37 39
       this.setState({
38 40
         loading: true
39 41
       });
40 42
 
41
-      if (prevState.query !== '' && this.state.query === '') {
43
+      if (prevState.query !== "" && this.state.query === "")
42 44
         this.loadPackages();
43
-      } else {
45
+      else
44 46
         this.searchPackage(this.state.query);
45
-      }
46 47
     }
47 48
 
48
-    if (prevProps.isUserLoggedIn !== this.props.isUserLoggedIn) {
49
+    if (prevProps.isUserLoggedIn !== this.props.isUserLoggedIn)
49 50
       this.loadPackages();
50
-    }
51 51
   }
52 52
 
53 53
   async loadPackages() {
54 54
     try {
55
-      this.req = await API.request('packages', 'GET');
55
+      this.req = await API.request("packages", "GET");
56 56
 
57
-      if (this.state.query === '') {
57
+      if (this.state.query === "") {
58 58
         this.setState({
59
-          packages: this.req,
60 59
           loading: false
60
+          packages: this.req
61 61
         });
62 62
       }
63
-    } catch (error) {
63
+    } catch(error) {
64 64
       MessageBox.msgbox({
65
-        type: 'error',
66
-        title: 'Warning',
67
-        message: `Unable to load package list: ${error.message}`
65
+        message: `Unable to load package list: ${error.message}`,
66
+        title: "Warning",
67
+        type: "error"
68 68
       });
69 69
     }
70 70
   }
71 71
 
72 72
   async searchPackage(query) {
73 73
     try {
74
-      this.req = await API.request(`/search/${query}`, 'GET');
74
+      this.req = await API.request(`/search/${query}`, "GET");
75 75
 
76 76
       // Implement cancel feature later
77 77
       if (this.state.query === query) {
78 78
         this.setState({
79
-          packages: this.req,
80 79
           fistTime: false,
81
-          loading: false
80
+          loading: false,
81
+          packages: this.req
82 82
         });
83 83
       }
84
-    } catch (err) {
84
+    } catch(err) {
85 85
       MessageBox.msgbox({
86
-        type: 'error',
87
-        title: 'Warning',
88
-        message: 'Unable to get search result, please try again later.'
86
+        message: "Unable to get search result, please try again later.",
87
+        title: "Warning",
88
+        type: "error"
89 89
       });
90 90
     }
91 91
   }
@@ -102,6 +102,7 @@ export default class Home extends Component {
102 102
 
103 103
   render() {
104 104
     const {packages, loading} = this.state;
105
+
105 106
     return (
106 107
       <Fragment>
107 108
         {this.renderSearchBar()}
@@ -115,9 +116,9 @@ export default class Home extends Component {
115 116
   }
116 117
 
117 118
   renderSearchBar() {
118
-    if (this.isTherePackages() && this.state.fistTime) {
119
+    if (this.isTherePackages() && this.state.fistTime)
119 120
       return;
120
-    }
121
+
121 122
     return <Search handleSearchInput={this.handleSearchInput} />;
122 123
   }
123 124
 }

+ 1
- 0
node_modules/.bin/acorn View File

@@ -0,0 +1 @@
1
+../acorn/bin/acorn

+ 1
- 0
node_modules/.bin/eslint View File

@@ -0,0 +1 @@
1
+../eslint/bin/eslint.js

+ 1
- 0
node_modules/.bin/esparse View File

@@ -0,0 +1 @@
1
+../esprima/bin/esparse.js

+ 1
- 0
node_modules/.bin/esvalidate View File

@@ -0,0 +1 @@
1
+../esprima/bin/esvalidate.js

+ 1
- 0
node_modules/.bin/husky-upgrade View File

@@ -0,0 +1 @@
1
+../husky/lib/upgrader/bin.js

+ 1
- 0
node_modules/.bin/is-ci View File

@@ -0,0 +1 @@
1
+../is-ci/bin.js

+ 1
- 0
node_modules/.bin/js-yaml View File

@@ -0,0 +1 @@
1
+../js-yaml/bin/js-yaml.js

+ 1
- 0
node_modules/.bin/loose-envify View File

@@ -0,0 +1 @@
1
+../loose-envify/cli.js

+ 1
- 0
node_modules/.bin/mkdirp View File

@@ -0,0 +1 @@
1
+../mkdirp/bin/cmd.js

+ 1
- 0
node_modules/.bin/npm-run-all View File

@@ -0,0 +1 @@
1
+../npm-run-all/bin/npm-run-all/index.js

+ 1
- 0
node_modules/.bin/pidtree View File

@@ -0,0 +1 @@
1
+../pidtree/bin/pidtree.js

+ 1
- 0
node_modules/.bin/rimraf View File

@@ -0,0 +1 @@
1
+../rimraf/bin.js

+ 1
- 0
node_modules/.bin/run-node View File

@@ -0,0 +1 @@
1
+../run-node/run-node

+ 1
- 0
node_modules/.bin/run-p View File

@@ -0,0 +1 @@
1
+../npm-run-all/bin/run-p/index.js

+ 1
- 0
node_modules/.bin/run-s View File

@@ -0,0 +1 @@
1
+../npm-run-all/bin/run-s/index.js

+ 1
- 0
node_modules/.bin/semver View File

@@ -0,0 +1 @@
1
+../semver/bin/semver

+ 1
- 0
node_modules/.bin/snazzy View File

@@ -0,0 +1 @@
1
+../snazzy/bin/cmd.js

+ 1
- 0
node_modules/.bin/standard View File

@@ -0,0 +1 @@
1
+../standard/bin/cmd.js

+ 1
- 0
node_modules/.bin/standard-json View File

@@ -0,0 +1 @@
1
+../standard-json/bin.js

+ 1
- 0
node_modules/.bin/standardx View File

@@ -0,0 +1 @@
1
+../standardx/bin/cmd.js

+ 1
- 0
node_modules/.bin/updates View File

@@ -0,0 +1 @@
1
+../updates/updates.js

+ 1
- 0
node_modules/.bin/which View File

@@ -0,0 +1 @@
1
+../which/bin/which

+ 22
- 0
node_modules/@babel/code-frame/LICENSE View File

@@ -0,0 +1,22 @@
1
+MIT License
2
+
3
+Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
4
+
5
+Permission is hereby granted, free of charge, to any person obtaining
6
+a copy of this software and associated documentation files (the
7
+"Software"), to deal in the Software without restriction, including
8
+without limitation the rights to use, copy, modify, merge, publish,
9
+distribute, sublicense, and/or sell copies of the Software, and to
10
+permit persons to whom the Software is furnished to do so, subject to
11
+the following conditions:
12
+
13
+The above copyright notice and this permission notice shall be
14
+included in all copies or substantial portions of the Software.
15
+
16
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 19
- 0
node_modules/@babel/code-frame/README.md View File

@@ -0,0 +1,19 @@
1
+# @babel/code-frame
2
+
3
+> Generate errors that contain a code frame that point to source locations.
4
+
5
+See our website [@babel/code-frame](https://babeljs.io/docs/en/next/babel-code-frame.html) for more information.
6
+
7
+## Install
8
+
9
+Using npm:
10
+
11
+```sh
12
+npm install --save-dev @babel/code-frame
13
+```
14
+
15
+or using yarn:
16
+
17
+```sh
18
+yarn add @babel/code-frame --dev
19
+```

+ 173
- 0
node_modules/@babel/code-frame/lib/index.js View File

@@ -0,0 +1,173 @@
1
+"use strict";
2
+
3
+Object.defineProperty(exports, "__esModule", {
4
+  value: true
5
+});
6
+exports.codeFrameColumns = codeFrameColumns;
7
+exports.default = _default;
8
+
9
+function _highlight() {
10
+  const data = _interopRequireWildcard(require("@babel/highlight"));
11
+
12
+  _highlight = function () {
13
+    return data;
14
+  };
15
+
16
+  return data;
17
+}
18
+
19
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
20
+
21
+let deprecationWarningShown = false;
22
+
23
+function getDefs(chalk) {
24
+  return {
25
+    gutter: chalk.grey,
26
+    marker: chalk.red.bold,
27
+    message: chalk.red.bold
28
+  };
29
+}
30
+
31
+const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
32
+
33
+function getMarkerLines(loc, source, opts) {
34
+  const startLoc = Object.assign({
35
+    column: 0,
36
+    line: -1
37
+  }, loc.start);
38
+  const endLoc = Object.assign({}, startLoc, loc.end);
39
+  const {
40
+    linesAbove = 2,
41
+    linesBelow = 3
42
+  } = opts || {};
43
+  const startLine = startLoc.line;
44
+  const startColumn = startLoc.column;
45
+  const endLine = endLoc.line;
46
+  const endColumn = endLoc.column;
47
+  let start = Math.max(startLine - (linesAbove + 1), 0);
48
+  let end = Math.min(source.length, endLine + linesBelow);
49
+
50
+  if (startLine === -1) {
51
+    start = 0;
52
+  }
53
+
54
+  if (endLine === -1) {
55
+    end = source.length;
56
+  }
57
+
58
+  const lineDiff = endLine - startLine;
59
+  const markerLines = {};
60
+
61
+  if (lineDiff) {
62
+    for (let i = 0; i <= lineDiff; i++) {
63
+      const lineNumber = i + startLine;
64
+
65
+      if (!startColumn) {
66
+        markerLines[lineNumber] = true;
67
+      } else if (i === 0) {
68
+        const sourceLength = source[lineNumber - 1].length;
69
+        markerLines[lineNumber] = [startColumn, sourceLength - startColumn];
70
+      } else if (i === lineDiff) {
71
+        markerLines[lineNumber] = [0, endColumn];
72
+      } else {
73
+        const sourceLength = source[lineNumber - i].length;
74
+        markerLines[lineNumber] = [0, sourceLength];
75
+      }
76
+    }
77
+  } else {
78
+    if (startColumn === endColumn) {
79
+      if (startColumn) {
80
+        markerLines[startLine] = [startColumn, 0];
81
+      } else {
82
+        markerLines[startLine] = true;
83
+      }
84
+    } else {
85
+      markerLines[startLine] = [startColumn, endColumn - startColumn];
86
+    }
87
+  }
88
+
89
+  return {
90
+    start,
91
+    end,
92
+    markerLines
93
+  };
94
+}
95
+
96
+function codeFrameColumns(rawLines, loc, opts = {}) {
97
+  const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight().shouldHighlight)(opts);
98
+  const chalk = (0, _highlight().getChalk)(opts);
99
+  const defs = getDefs(chalk);
100
+
101
+  const maybeHighlight = (chalkFn, string) => {
102
+    return highlighted ? chalkFn(string) : string;
103
+  };
104
+
105
+  if (highlighted) rawLines = (0, _highlight().default)(rawLines, opts);
106
+  const lines = rawLines.split(NEWLINE);
107
+  const {
108
+    start,
109
+    end,
110
+    markerLines
111
+  } = getMarkerLines(loc, lines, opts);
112
+  const hasColumns = loc.start && typeof loc.start.column === "number";
113
+  const numberMaxWidth = String(end).length;
114
+  let frame = lines.slice(start, end).map((line, index) => {
115
+    const number = start + 1 + index;
116
+    const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
117
+    const gutter = ` ${paddedNumber} | `;
118
+    const hasMarker = markerLines[number];
119
+    const lastMarkerLine = !markerLines[number + 1];
120
+
121
+    if (hasMarker) {
122
+      let markerLine = "";
123
+
124
+      if (Array.isArray(hasMarker)) {
125
+        const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
126
+        const numberOfMarkers = hasMarker[1] || 1;
127
+        markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join("");
128
+
129
+        if (lastMarkerLine && opts.message) {
130
+          markerLine += " " + maybeHighlight(defs.message, opts.message);
131
+        }
132
+      }
133
+
134
+      return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join("");
135
+    } else {
136
+      return ` ${maybeHighlight(defs.gutter, gutter)}${line}`;
137
+    }
138
+  }).join("\n");
139
+
140
+  if (opts.message && !hasColumns) {
141
+    frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`;
142
+  }
143
+
144
+  if (highlighted) {
145
+    return chalk.reset(frame);
146
+  } else {
147
+    return frame;
148
+  }
149
+}
150
+
151
+function _default(rawLines, lineNumber, colNumber, opts = {}) {
152
+  if (!deprecationWarningShown) {
153
+    deprecationWarningShown = true;
154
+    const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
155
+
156
+    if (process.emitWarning) {
157
+      process.emitWarning(message, "DeprecationWarning");
158
+    } else {
159
+      const deprecationError = new Error(message);
160
+      deprecationError.name = "DeprecationWarning";
161
+      console.warn(new Error(message));
162
+    }
163
+  }
164
+
165
+  colNumber = Math.max(colNumber, 0);
166
+  const location = {
167
+    start: {
168
+      column: colNumber,
169
+      line: lineNumber
170
+    }
171
+  };
172
+  return codeFrameColumns(rawLines, location, opts);
173
+}

+ 49
- 0
node_modules/@babel/code-frame/package.json View File

@@ -0,0 +1,49 @@
1
+{
2
+  "_from": "@babel/code-frame@^7.0.0",
3
+  "_id": "@babel/code-frame@7.0.0",
4
+  "_inBundle": false,
5
+  "_integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==",
6
+  "_location": "/@babel/code-frame",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "@babel/code-frame@^7.0.0",
12
+    "name": "@babel/code-frame",
13
+    "escapedName": "@babel%2fcode-frame",
14
+    "scope": "@babel",
15
+    "rawSpec": "^7.0.0",
16
+    "saveSpec": null,
17
+    "fetchSpec": "^7.0.0"
18
+  },
19
+  "_requiredBy": [
20
+    "/eslint"
21
+  ],
22
+  "_resolved": "https://npm.inc.sh/@babel%2fcode-frame/-/code-frame-7.0.0.tgz",
23
+  "_shasum": "06e2ab19bdb535385559aabb5ba59729482800f8",
24
+  "_spec": "@babel/code-frame@^7.0.0",
25
+  "_where": "/Users/netopwibby/Desktop/Projects/NetOperatorWibby/verdaccio-webui/node_modules/eslint",
26
+  "author": {
27
+    "name": "Sebastian McKenzie",
28
+    "email": "sebmck@gmail.com"
29
+  },
30
+  "bundleDependencies": false,
31
+  "dependencies": {
32
+    "@babel/highlight": "^7.0.0"
33
+  },
34
+  "deprecated": false,
35
+  "description": "Generate errors that contain a code frame that point to source locations.",
36
+  "devDependencies": {
37
+    "chalk": "^2.0.0",
38
+    "strip-ansi": "^4.0.0"
39
+  },
40
+  "homepage": "https://babeljs.io/",
41
+  "license": "MIT",
42
+  "main": "lib/index.js",
43
+  "name": "@babel/code-frame",
44
+  "repository": {
45
+    "type": "git",
46
+    "url": "https://github.com/babel/babel/tree/master/packages/babel-code-frame"
47
+  },
48
+  "version": "7.0.0"
49
+}

+ 22
- 0
node_modules/@babel/highlight/LICENSE View File

@@ -0,0 +1,22 @@
1
+MIT License
2
+
3
+Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
4
+
5
+Permission is hereby granted, free of charge, to any person obtaining
6
+a copy of this software and associated documentation files (the
7
+"Software"), to deal in the Software without restriction, including
8
+without limitation the rights to use, copy, modify, merge, publish,
9
+distribute, sublicense, and/or sell copies of the Software, and to
10
+permit persons to whom the Software is furnished to do so, subject to
11
+the following conditions:
12
+
13
+The above copyright notice and this permission notice shall be
14
+included in all copies or substantial portions of the Software.
15
+
16
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 19
- 0
node_modules/@babel/highlight/README.md View File

@@ -0,0 +1,19 @@
1
+# @babel/highlight
2
+
3
+> Syntax highlight JavaScript strings for output in terminals.
4
+
5
+See our website [@babel/highlight](https://babeljs.io/docs/en/next/babel-highlight.html) for more information.
6
+
7
+## Install
8
+
9
+Using npm:
10
+
11
+```sh
12
+npm install --save-dev @babel/highlight
13
+```
14
+
15
+or using yarn:
16
+
17
+```sh
18
+yarn add @babel/highlight --dev
19
+```

+ 129
- 0
node_modules/@babel/highlight/lib/index.js View File

@@ -0,0 +1,129 @@
1
+"use strict";
2
+
3
+Object.defineProperty(exports, "__esModule", {
4
+  value: true
5
+});
6
+exports.shouldHighlight = shouldHighlight;
7
+exports.getChalk = getChalk;
8
+exports.default = highlight;
9
+
10
+function _jsTokens() {
11
+  const data = _interopRequireWildcard(require("js-tokens"));
12
+
13
+  _jsTokens = function () {
14
+    return data;
15
+  };
16
+
17
+  return data;
18
+}
19
+
20
+function _esutils() {
21
+  const data = _interopRequireDefault(require("esutils"));
22
+
23
+  _esutils = function () {
24
+    return data;
25
+  };
26
+
27
+  return data;
28
+}
29
+
30
+function _chalk() {
31
+  const data = _interopRequireDefault(require("chalk"));
32
+
33
+  _chalk = function () {
34
+    return data;
35
+  };
36
+
37
+  return data;
38
+}
39
+
40
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41
+
42
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
43
+
44
+function getDefs(chalk) {
45
+  return {
46
+    keyword: chalk.cyan,
47
+    capitalized: chalk.yellow,
48
+    jsx_tag: chalk.yellow,
49
+    punctuator: chalk.yellow,
50
+    number: chalk.magenta,
51
+    string: chalk.green,
52
+    regex: chalk.magenta,
53
+    comment: chalk.grey,
54
+    invalid: chalk.white.bgRed.bold
55
+  };
56
+}
57
+
58
+const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
59
+const JSX_TAG = /^[a-z][\w-]*$/i;
60
+const BRACKET = /^[()[\]{}]$/;
61
+
62
+function getTokenType(match) {
63
+  const [offset, text] = match.slice(-2);
64
+  const token = (0, _jsTokens().matchToToken)(match);
65
+
66
+  if (token.type === "name") {
67
+    if (_esutils().default.keyword.isReservedWordES6(token.value)) {
68
+      return "keyword";
69
+    }
70
+
71
+    if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == "</")) {
72
+      return "jsx_tag";
73
+    }
74
+
75
+    if (token.value[0] !== token.value[0].toLowerCase()) {
76
+      return "capitalized";
77
+    }
78
+  }
79
+
80
+  if (token.type === "punctuator" && BRACKET.test(token.value)) {
81
+    return "bracket";
82
+  }
83
+
84
+  if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
85
+    return "punctuator";
86
+  }
87
+
88
+  return token.type;
89
+}
90
+
91
+function highlightTokens(defs, text) {
92
+  return text.replace(_jsTokens().default, function (...args) {
93
+    const type = getTokenType(args);
94
+    const colorize = defs[type];
95
+
96
+    if (colorize) {
97
+      return args[0].split(NEWLINE).map(str => colorize(str)).join("\n");
98
+    } else {
99
+      return args[0];
100
+    }
101
+  });
102
+}
103
+
104
+function shouldHighlight(options) {
105
+  return _chalk().default.supportsColor || options.forceColor;
106
+}
107
+
108
+function getChalk(options) {
109
+  let chalk = _chalk().default;
110
+
111
+  if (options.forceColor) {
112
+    chalk = new (_chalk().default.constructor)({
113
+      enabled: true,
114
+      level: 1
115
+    });
116
+  }
117
+
118
+  return chalk;
119
+}
120
+
121
+function highlight(code, options = {}) {
122
+  if (shouldHighlight(options)) {
123
+    const chalk = getChalk(options);
124
+    const defs = getDefs(chalk);
125
+    return highlightTokens(defs, code);
126
+  } else {
127
+    return code;
128
+  }
129
+}

+ 151
- 0
node_modules/@babel/highlight/node_modules/js-tokens/CHANGELOG.md View File

@@ -0,0 +1,151 @@
1
+### Version 4.0.0 (2018-01-28) ###
2
+
3
+- Added: Support for ES2018. The only change needed was recognizing the `s`
4
+  regex flag.
5
+- Changed: _All_ tokens returned by the `matchToToken` function now have a
6
+  `closed` property. It is set to `undefined` for the tokens where “closed”
7
+  doesn’t make sense. This means that all tokens objects have the same shape,
8
+  which might improve performance.
9
+
10
+These are the breaking changes:
11
+
12
+- `'/a/s'.match(jsTokens)` no longer returns `['/', 'a', '/', 's']`, but
13
+  `['/a/s']`. (There are of course other variations of this.)
14
+- Code that rely on some token objects not having the `closed` property could
15
+  now behave differently.
16
+
17
+
18
+### Version 3.0.2 (2017-06-28) ###
19
+
20
+- No code changes. Just updates to the readme.
21
+
22
+
23
+### Version 3.0.1 (2017-01-30) ###
24
+
25
+- Fixed: ES2015 unicode escapes with more than 6 hex digits are now matched
26
+  correctly.
27
+
28
+
29
+### Version 3.0.0 (2017-01-11) ###
30
+
31
+This release contains one breaking change, that should [improve performance in
32
+V8][v8-perf]:
33
+
34
+> So how can you, as a JavaScript developer, ensure that your RegExps are fast?
35
+> If you are not interested in hooking into RegExp internals, make sure that
36
+> neither the RegExp instance, nor its prototype is modified in order to get the
37
+> best performance:
38
+>
39
+> ```js
40
+> var re = /./g;
41
+> re.exec('');  // Fast path.
42
+> re.new_property = 'slow';
43
+> ```
44
+
45
+This module used to export a single regex, with `.matchToToken` bolted
46
+on, just like in the above example. This release changes the exports of
47
+the module to avoid this issue.
48
+
49
+Before:
50
+
51
+```js
52
+import jsTokens from "js-tokens"
53
+// or:
54
+var jsTokens = require("js-tokens")
55
+var matchToToken = jsTokens.matchToToken
56
+```
57
+
58
+After:
59
+
60
+```js
61
+import jsTokens, {matchToToken} from "js-tokens"
62
+// or:
63
+var jsTokens = require("js-tokens").default
64
+var matchToToken = require("js-tokens").matchToToken
65
+```
66
+
67
+[v8-perf]: http://v8project.blogspot.se/2017/01/speeding-up-v8-regular-expressions.html
68
+
69
+
70
+### Version 2.0.0 (2016-06-19) ###
71
+
72
+- Added: Support for ES2016. In other words, support for the `**` exponentiation
73
+  operator.
74
+
75
+These are the breaking changes:
76
+
77
+- `'**'.match(jsTokens)` no longer returns `['*', '*']`, but `['**']`.
78
+- `'**='.match(jsTokens)` no longer returns `['*', '*=']`, but `['**=']`.
79
+
80
+
81
+### Version 1.0.3 (2016-03-27) ###
82
+
83
+- Improved: Made the regex ever so slightly smaller.
84
+- Updated: The readme.
85
+
86
+
87
+### Version 1.0.2 (2015-10-18) ###
88
+
89
+- Improved: Limited npm package contents for a smaller download. Thanks to
90
+  @zertosh!
91
+
92
+
93
+### Version 1.0.1 (2015-06-20) ###
94
+
95
+- Fixed: Declared an undeclared variable.
96
+
97
+
98
+### Version 1.0.0 (2015-02-26) ###
99
+
100
+- Changed: Merged the 'operator' and 'punctuation' types into 'punctuator'. That
101
+  type is now equivalent to the Punctuator token in the ECMAScript
102
+  specification. (Backwards-incompatible change.)
103
+- Fixed: A `-` followed by a number is now correctly matched as a punctuator
104
+  followed by a number. It used to be matched as just a number, but there is no
105
+  such thing as negative number literals. (Possibly backwards-incompatible
106
+  change.)
107
+
108
+
109
+### Version 0.4.1 (2015-02-21) ###
110
+
111
+- Added: Support for the regex `u` flag.
112
+
113
+
114
+### Version 0.4.0 (2015-02-21) ###
115
+
116
+- Improved: `jsTokens.matchToToken` performance.
117
+- Added: Support for octal and binary number literals.
118
+- Added: Support for template strings.
119
+
120
+
121
+### Version 0.3.1 (2015-01-06) ###
122
+
123
+- Fixed: Support for unicode spaces. They used to be allowed in names (which is
124
+  very confusing), and some unicode newlines were wrongly allowed in strings and
125
+  regexes.
126
+
127
+
128
+### Version 0.3.0 (2014-12-19) ###
129
+
130
+- Changed: The `jsTokens.names` array has been replaced with the
131
+  `jsTokens.matchToToken` function. The capturing groups of `jsTokens` are no
132
+  longer part of the public API; instead use said function. See this [gist] for
133
+  an example. (Backwards-incompatible change.)
134
+- Changed: The empty string is now considered an “invalid” token, instead an
135
+  “empty” token (its own group). (Backwards-incompatible change.)
136
+- Removed: component support. (Backwards-incompatible change.)
137
+
138
+[gist]: https://gist.github.com/lydell/be49dbf80c382c473004
139
+
140
+
141
+### Version 0.2.0 (2014-06-19) ###
142
+
143
+- Changed: Match ES6 function arrows (`=>`) as an operator, instead of its own
144
+  category (“functionArrow”), for simplicity. (Backwards-incompatible change.)
145
+- Added: ES6 splats (`...`) are now matched as an operator (instead of three
146
+  punctuations). (Backwards-incompatible change.)
147
+
148
+
149
+### Version 0.1.0 (2014-03-08) ###
150
+
151
+- Initial release.

+ 21
- 0
node_modules/@babel/highlight/node_modules/js-tokens/LICENSE View File

@@ -0,0 +1,21 @@
1
+The MIT License (MIT)
2
+
3
+Copyright (c) 2014, 2015, 2016, 2017, 2018 Simon Lydell
4
+
5
+Permission is hereby granted, free of charge, to any person obtaining a copy
6
+of this software and associated documentation files (the "Software"), to deal
7
+in the Software without restriction, including without limitation the rights
8
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+copies of the Software, and to permit persons to whom the Software is
10
+furnished to do so, subject to the following conditions:
11
+
12
+The above copyright notice and this permission notice shall be included in
13
+all copies or substantial portions of the Software.
14
+
15
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+THE SOFTWARE.

+ 240
- 0
node_modules/@babel/highlight/node_modules/js-tokens/README.md View File

@@ -0,0 +1,240 @@
1
+Overview [![Build Status](https://travis-ci.org/lydell/js-tokens.svg?branch=master)](https://travis-ci.org/lydell/js-tokens)
2
+========
3
+
4
+A regex that tokenizes JavaScript.
5
+
6
+```js
7
+var jsTokens = require("js-tokens").default
8
+
9
+var jsString = "var foo=opts.foo;\n..."
10
+
11
+jsString.match(jsTokens)
12
+// ["var", " ", "foo", "=", "opts", ".", "foo", ";", "\n", ...]
13
+```
14
+
15
+
16
+Installation
17
+============
18
+
19
+`npm install js-tokens`
20
+
21
+```js
22
+import jsTokens from "js-tokens"
23
+// or:
24
+var jsTokens = require("js-tokens").default
25
+```
26
+
27
+
28
+Usage
29
+=====
30
+
31
+### `jsTokens` ###
32
+
33
+A regex with the `g` flag that matches JavaScript tokens.
34
+
35
+The regex _always_ matches, even invalid JavaScript and the empty string.
36
+
37
+The next match is always directly after the previous.
38
+
39
+### `var token = matchToToken(match)` ###
40
+
41
+```js
42
+import {matchToToken} from "js-tokens"
43
+// or:
44
+var matchToToken = require("js-tokens").matchToToken
45
+```
46
+
47
+Takes a `match` returned by `jsTokens.exec(string)`, and returns a `{type:
48
+String, value: String}` object. The following types are available:
49
+
50
+- string
51
+- comment
52
+- regex
53
+- number
54
+- name
55
+- punctuator
56
+- whitespace
57
+- invalid
58
+
59
+Multi-line comments and strings also have a `closed` property indicating if the
60
+token was closed or not (see below).
61
+
62
+Comments and strings both come in several flavors. To distinguish them, check if
63
+the token starts with `//`, `/*`, `'`, `"` or `` ` ``.
64
+
65
+Names are ECMAScript IdentifierNames, that is, including both identifiers and
66
+keywords. You may use [is-keyword-js] to tell them apart.
67
+
68
+Whitespace includes both line terminators and other whitespace.
69
+
70
+[is-keyword-js]: https://github.com/crissdev/is-keyword-js
71
+
72
+
73
+ECMAScript support
74
+==================
75
+
76
+The intention is to always support the latest ECMAScript version whose feature
77
+set has been finalized.
78
+
79
+If adding support for a newer version requires changes, a new version with a
80
+major verion bump will be released.
81
+
82
+Currently, ECMAScript 2018 is supported.
83
+
84
+
85
+Invalid code handling
86
+=====================
87
+
88
+Unterminated strings are still matched as strings. JavaScript strings cannot
89
+contain (unescaped) newlines, so unterminated strings simply end at the end of
90
+the line. Unterminated template strings can contain unescaped newlines, though,
91
+so they go on to the end of input.
92
+
93
+Unterminated multi-line comments are also still matched as comments. They
94
+simply go on to the end of the input.
95
+
96
+Unterminated regex literals are likely matched as division and whatever is
97
+inside the regex.
98
+
99
+Invalid ASCII characters have their own capturing group.
100
+
101
+Invalid non-ASCII characters are treated as names, to simplify the matching of
102
+names (except unicode spaces which are treated as whitespace). Note: See also
103
+the [ES2018](#es2018) section.
104
+
105
+Regex literals may contain invalid regex syntax. They are still matched as
106
+regex literals. They may also contain repeated regex flags, to keep the regex
107
+simple.
108
+
109
+Strings may contain invalid escape sequences.
110
+
111
+
112
+Limitations
113
+===========
114
+
115
+Tokenizing JavaScript using regexes—in fact, _one single regex_—won’t be
116
+perfect. But that’s not the point either.
117
+
118
+You may compare jsTokens with [esprima] by using `esprima-compare.js`.
119
+See `npm run esprima-compare`!
120
+
121
+[esprima]: http://esprima.org/
122
+
123
+### Template string interpolation ###
124
+
125
+Template strings are matched as single tokens, from the starting `` ` `` to the
126
+ending `` ` ``, including interpolations (whose tokens are not matched
127
+individually).
128
+
129
+Matching template string interpolations requires recursive balancing of `{` and
130
+`}`—something that JavaScript regexes cannot do. Only one level of nesting is
131
+supported.
132
+
133
+### Division and regex literals collision ###
134
+
135
+Consider this example:
136
+
137
+```js
138
+var g = 9.82
139
+var number = bar / 2/g
140
+
141
+var regex = / 2/g
142
+```
143
+
144
+A human can easily understand that in the `number` line we’re dealing with
145
+division, and in the `regex` line we’re dealing with a regex literal. How come?
146
+Because humans can look at the whole code to put the `/` characters in context.
147
+A JavaScript regex cannot. It only sees forwards. (Well, ES2018 regexes can also
148
+look backwards. See the [ES2018](#es2018) section).
149
+
150
+When the `jsTokens` regex scans throught the above, it will see the following
151
+at the end of both the `number` and `regex` rows:
152
+
153
+```js
154
+/ 2/g
155
+```
156
+
157
+It is then impossible to know if that is a regex literal, or part of an
158
+expression dealing with division.
159
+
160
+Here is a similar case:
161
+
162
+```js
163
+foo /= 2/g
164
+foo(/= 2/g)
165
+```
166
+
167
+The first line divides the `foo` variable with `2/g`. The second line calls the
168
+`foo` function with the regex literal `/= 2/g`. Again, since `jsTokens` only
169
+sees forwards, it cannot tell the two cases apart.
170
+
171
+There are some cases where we _can_ tell division and regex literals apart,
172
+though.
173
+
174
+First off, we have the simple cases where there’s only one slash in the line:
175
+
176
+```js
177
+var foo = 2/g
178
+foo /= 2
179
+```
180
+
181
+Regex literals cannot contain newlines, so the above cases are correctly
182
+identified as division. Things are only problematic when there are more than
183
+one non-comment slash in a single line.
184