Skip to content

Commit

Permalink
First import
Browse files Browse the repository at this point in the history
  • Loading branch information
mozillazg committed Nov 18, 2019
0 parents commit a48d0fc
Show file tree
Hide file tree
Showing 306 changed files with 42,993 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"compact": false,
"plugins": [
"@babel/plugin-transform-runtime",
"@babel/plugin-transform-block-scoping",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-export-default-from"
]
}
25 changes: 25 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# http://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true

[*.{yml,yaml,json,js,jsx,css,scss,sass,html}]
indent_style = space
indent_size = 2

[.{eslint,babel,postcss}rc]
indent_style = space
indent_size = 2
language = json

[Makefile]
indent_style = tab

[Jenkinsfile]
indent_style = space
indent_size = 2
language = groovy
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NODE_ENV=development
HUSKAR_API_URL=http://127.0.0.1:5000
28 changes: 28 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"parser": "babel-eslint",
"extends": "airbnb",
"rules": {
"no-bitwise": "off",
"object-curly-newline": ["error", {
"consistent": true
}],
"react/destructuring-assignment": "off",
"react/jsx-one-expression-per-line": "off",
"jsx-a11y/label-has-for": "off"
},
"env": {
"browser": true,
"jest": true
},
"plugins": [
"babel"
],
"settings": {
"import/extensions": [".js", ".jsx"],
"import/resolver": {
"webpack": {
"config": "webpack.config.babel.js"
}
}
}
}
13 changes: 13 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Contributing Guide

1. Keep your branch up-to-date
- `git fetch upstream`
- `git rebase upstream/master`
2. Squash or reword commits for clear history
- `git rebase -i --autosquash upstream/master`
3. Create a pull request
- Edit the description
- Invite one or multiple reviewers
- Assign someone who can merge pull requests
- Choose labels and milestone
- If there is a topic-related Trello card, attach this pull request on it
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### Description

<!-- If this is a bug, provide as much information as you can to help reproduce the issue. -->

### Enviroment Info


### Reference Link

<!-- It's better if you give a link that can reproduce the bug. -->

### Screenshot

<!-- Screenshot, if any (drag an image here). -->
20 changes: 20 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
### Description

<!-- Your description here. -->

### Reference


### Todo

<!--
Remove this section at will, if your pull request is not WIP.
- [ ] Step 1
- [ ] Step 2
-->


### Preview

<!-- UI interface changes, prefer a image of screenshot to show it. -->
53 changes: 53 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Created by https://www.gitignore.io/api/node

### Node ###
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# PyCharm
.idea/
.python-version

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# Vim cache
*.swp

# Custom
/dist
/.env
/test-report.xml
5 changes: 5 additions & 0 deletions .postcssrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"plugins": {
"autoprefixer": {}
}
}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Changlog
=========

0.174.2 (2019-11-18)
----------------------

* First import.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) <2019> <Eleme Inc.>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
82 changes: 82 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Huskar Front-End

The web console of [Huskar](https://github.com/huskar-org/huskar).

## Getting Start

You should create a `.env` file (from `.env.example`) for development in local.

Example:

```
$ cat .env
NODE_ENV=development
HUSKAR_API_URL=http://huskar-api.example.com
```

Then you could use the presented npm scripts:

```
$ npm install # install dependencies
$ npm run clean # clean dist directory
$ npm run build # build only
$ npm start # start the development server
$ npm test # run tests
```

## Delopyment


There is a series of configuration items as environment variables:

| Name | Context | Required | Default |
| ---------------------------------- | ------------ | -------- | ------------------------------------- |
| `NODE_ENV` | Compile time | Required | development |
| `HUSKAR_SENTRY_DSN` | Runtime | Optional | |
| `HUSKAR_MONITOR_URL` | Runtime | Optional | https://monitor.example.com |
| `HUSKAR_AMQP_DASHBOARD_URL` | Runtime | Optional | |
| `HUSKAR_ES_DASHBOARD_URL` | Runtime | Optional | |
| `HUSKAR_FEATURE_LIST` | Runtime | Optional | stateswitch |
| `HUSKAR_EZONE_LIST` | Runtime | Optional | global,alta1,altb1 |
| `HUSKAR_CLUSTER_SPEC_URL` | Runtime | Optional | |
| `HUSKAR_DEFAULT_CLUSTER` | Runtime | Optional | |
| `HUSKAR_ROUTE_ADMIN_ONLY_EZONE` | Runtime | Optional | |

Available feature flags:

* `signup`
* `createapp`
* `stateswitch`
* `delaybutton`
* `infrarawurl`

## Development Knowledge

### Languages

- [ES6 Features](http://es6-features.org)
- [SASS](http://sass-lang.com)

### Toolchains

- [webpack v3](https://webpack.js.org)
- [babel](https://babeljs.io)

### Frameworks and Libraries

- [Redux](http://redux.js.org)
- [React](https://facebook.github.io/react/)
- [React-Router](https://github.com/ReactTraining/react-router)
- [Immutable.js](https://facebook.github.io/immutable-js/)
- [apisdk.js](https://github.com/YanagiEiichi/apisdk)
- [axios](https://github.com/mzabriskie/axios)

### Apps

The [devdocs](http://devdocs.io) is useful for looking up API of those stuff.

### Best Practices

- Pass all eslint rules
- Write pure and micro components instead of stateful and huge components
- Use GA to track new features
Loading

0 comments on commit a48d0fc

Please sign in to comment.