Skip to content

Commit 79bd500

Browse files
authored
Merge pull request #564 from nervosnetwork/rc/v0.1.0-alpha.0
[ᚬmaster] RC v0.1.0 alpha.0
2 parents 3382282 + ed14e4c commit 79bd500

File tree

224 files changed

+32758
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

224 files changed

+32758
-0
lines changed

.editorconfig

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
# Use 4 spaces for the Python files
13+
[*.py]
14+
indent_size = 4
15+
max_line_length = 120
16+
17+
# The JSON files contain newlines inconsistently
18+
[*.json]
19+
insert_final_newline = ignore
20+
21+
# The JavaScript file
22+
[*.js]
23+
indent_size = 2
24+
max_line_length = 120
25+
26+
# The TypeScript file
27+
[*.{ts,tsx}]
28+
indent_size = 2
29+
trim_trailing_whitespace = true
30+
max_line_length = 120
31+
32+
# Minified JavaScript files shouldn't be changed
33+
[**.min.js]
34+
indent_style = ignore
35+
insert_final_newline = ignore
36+
37+
# Makefiles always use tabs for indentation
38+
[Makefile]
39+
indent_style = tab
40+
41+
# Batch files use tabs for indentation
42+
[*.bat]
43+
indent_style = tab
44+
45+
[*.md]
46+
trim_trailing_whitespace = false

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
jest.config.js

.eslintrc.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
module.exports = {
2+
"extends": ["airbnb", "plugin:prettier/recommended"],
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": ["@typescript-eslint"],
5+
"rules": {
6+
"prettier/prettier": [2, {
7+
"printWidth": 120
8+
}],
9+
"semi": [2, "never"],
10+
"comma-dangle": [2, {
11+
"arrays": "always-multiline",
12+
"objects": "always-multiline",
13+
"imports": "always-multiline",
14+
"exports": "always-multiline",
15+
"functions": "ignore"
16+
}],
17+
"import/no-extraneous-dependencies": [2, {
18+
"devDependencies": true
19+
}],
20+
"no-unused-vars": "off",
21+
"implicit-arrow-linebreak": "off",
22+
"@typescript-eslint/no-unused-vars": ["error", {
23+
"vars": "local",
24+
"args": "after-used",
25+
"ignoreRestSiblings": false
26+
}],
27+
"arrow-parens": [2, "as-needed"],
28+
"max-len": [2, {
29+
"code": 120,
30+
"ignoreComments": true,
31+
"ignoreTrailingComments": true,
32+
"ignoreUrls": true,
33+
"ignoreStrings": true,
34+
"ignoreTemplateLiterals": true,
35+
"ignoreRegExpLiterals": true,
36+
}],
37+
"object-curly-newline": ["error", {
38+
"ObjectExpression": {
39+
"consistent": true
40+
},
41+
"ObjectPattern": {
42+
"consistent": true
43+
},
44+
"ImportDeclaration": {
45+
"consistent": true,
46+
},
47+
"ExportDeclaration": {
48+
"multiline": true,
49+
"minProperties": 3
50+
}
51+
}],
52+
"no-plusplus": [0],
53+
"no-console": [2, {
54+
"allow": ["warn", "error", "info"]
55+
}],
56+
"lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }]
57+
},
58+
"globals": {
59+
"BigInt": "readonly"
60+
},
61+
"env": {
62+
"jest": true,
63+
"browser": true,
64+
"node": true
65+
},
66+
"settings": {
67+
"import/resolver": {
68+
"node": {
69+
"paths": ["src"],
70+
"extensions": [".js", ".jsx", ".ts", ".tsx"]
71+
}
72+
}
73+
}
74+
};

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
build
13+
dist
14+
pages
15+
release
16+
17+
# misc
18+
.DS_Store
19+
.env
20+
.env.local
21+
.env.development.local
22+
.env.test.local
23+
.env.production.local
24+
25+
npm-debug.log*
26+
yarn-debug.log*
27+
yarn-error.log*
28+
*.log
29+
30+
# deps lock
31+
# yarn-lock.json
32+
package-lock.json
33+
lerna-debug.log
34+
35+
#docs
36+
docs
37+
38+
# vscode config
39+
./packages/neuron-wallet/.vscode
40+
41+
# Webstorm config
42+
.idea
43+
44+
# sqlite db
45+
cell-dev.sqlite
46+
address-dev.sqlite

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"trailingComma": "es5",
3+
"semi": false,
4+
"singleQuote": true
5+
}

.travis.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
language: node_js
2+
3+
os:
4+
- linux
5+
- osx
6+
7+
dist: xenial
8+
osx_image: xcode10.2
9+
10+
services:
11+
- xvfb
12+
13+
node_js:
14+
- '11'
15+
- '12'
16+
17+
cache:
18+
- npm
19+
- yarn
20+
21+
before_install:
22+
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0
23+
- export PATH=$HOME/.yarn/bin:$PATH
24+
- yarn global add lerna
25+
26+
install:
27+
- travis_retry yarn bootstrap
28+
29+
script:
30+
- git diff --exit-code yarn.lock
31+
- CI=false yarn build
32+
- yarn test

.vscode/launch.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [{
7+
"name": "Chrome",
8+
"type": "chrome",
9+
"request": "launch",
10+
"url": "http://localhost:3000",
11+
"webRoot": "${workspaceRoot}/packages/neuron-ui/src"
12+
}, {
13+
"name": "neuron-wallet",
14+
"type": "node",
15+
"request": "launch",
16+
"cwd": "${workspaceRoot}/packages/neuron-wallet",
17+
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
18+
"windows": {
19+
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
20+
},
21+
"args": ["."],
22+
"outputCapture": "std",
23+
"env": {
24+
"NODE_ENV": "development"
25+
}
26+
}]
27+
}

.vscode/settings.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"eslint.workingDirectories": [
3+
{
4+
"directory": "packages/neuron-wallet",
5+
"changeProcessCWD": true
6+
},
7+
{
8+
"directory": "packages/neuron-ui",
9+
"changeProcessCWD": true
10+
}
11+
],
12+
"eslint.validate": [
13+
"javascript",
14+
"javascriptreact",
15+
"typescript",
16+
"typescriptreact"
17+
],
18+
"typescript.tsdk": "node_modules/typescript/lib"
19+
}

.yarnrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry "https://registry.yarnpkg.com"

README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,71 @@
11
# Neuron
2+
23
Nervos CKB Wallet
4+
5+
[![Azure Pipelines Build Status](https://dev.azure.com/nervosnetwork/neuron/_apis/build/status/nervosnetwork.neuron?branchName=develop)](https://dev.azure.com/nervosnetwork/neuron/_build/latest?definitionId=8&branchName=develop)
6+
[![TravisCI](https://travis-ci.com/nervosnetwork/neuron.svg?branch=develop)](https://travis-ci.com/nervosnetwork/neuron)
7+
[![Telegram Group](https://cdn.rawgit.com/Patrolavia/telegram-badge/8fe3382b/chat.svg)](https://t.me/nervos_ckb_dev)
8+
9+
---
10+
11+
## Quick Start
12+
13+
### Prerequisites
14+
15+
You will need `node >= 11` and `yarn >= 1.12` to build and run this Neuron.
16+
17+
Please be noted that Neuron depends on [node-gyp](https://github.com/nodejs/node-gyp) to build native NPM modules. Follow [this](https://github.com/nodejs/node-gyp#installation) to install node-gyp dependencies.
18+
19+
#### Lerna
20+
21+
Neuron project uses [lerna](https://github.com/lerna/lerna/) for packages management. It can be installed globally, or locally in the project.
22+
23+
```sh
24+
$ yarn global add lerna # install lerna globally
25+
# or
26+
$ yarn add lerna --exact --ignore-workspace-root-check # install lerna locally in the project
27+
```
28+
29+
#### Install Dependencies
30+
31+
After lerna installed, the dependencies can be installed by
32+
33+
```sh
34+
$ yarn bootstrap
35+
```
36+
37+
### Start Neuron
38+
39+
### Start Neuron in development mode
40+
41+
```sh
42+
$ yarn start
43+
```
44+
45+
This command will start two tasks
46+
47+
1. start `neuron-ui`, which works for the user interface.
48+
2. start `neuron-wallet`, works for the wallet functionality.
49+
50+
They are also able to start independently:
51+
52+
```sh
53+
# start neuron-ui at `http://localhost:3000`
54+
$ cd packages/neuron-ui && yarn start
55+
```
56+
57+
```sh
58+
# start neuron-wallet
59+
$ cd packages/neuron-wallet && yarn start:dev
60+
```
61+
62+
### Test
63+
64+
```sh
65+
# launch the test runner in the watch mode.
66+
$ yarn test
67+
```
68+
69+
## License
70+
71+
Neuron is released under the terms of the MIT license. See [COPYING](COPYING) for more information or see [https://opensource.org/licenses/MIT](https://opensource.org/licenses/MIT).

0 commit comments

Comments
 (0)