Skip to content

Commit

Permalink
Merge pull request #19 from Adamant-im/dev
Browse files Browse the repository at this point in the history
v1.5.0
  • Loading branch information
adamant-al authored Apr 1, 2022
2 parents 04a749a + 9d397ce commit 364f31f
Show file tree
Hide file tree
Showing 53 changed files with 2,532 additions and 1,585 deletions.
15 changes: 0 additions & 15 deletions .editorconfig

This file was deleted.

70 changes: 28 additions & 42 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,29 @@
module.exports = {
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module"
},
"rules": {
"semi": "warn", // обязательно ;
"semi-spacing": ["error", {"before": false, "after": true}],
"indent": ["error", "tab"],
"space-infix-ops": "error",// отступы вокруг + - * / = и тд
"eqeqeq": "error", // обязательно === и !== (нельзя == и !=)
// "no-eq-null": "error", // обязательно === и !== (нельзя == и !=) но тоько в отношении null
"curly": "error", // проверка шаблонов `${name}`
// "space-before-function-paren": [ // отступ до и после function
// "error", {
// "anonymous": "always",
// "named": "always",
// "asyncArrow": "ignore"
// }
// ],
"key-spacing": ["error", { "mode": "strict" }], // оформление обЪекта
"space-in-parens": ["error", "never"], // запрет отступов ( a,b)
"computed-property-spacing": ["error", "never"], // запрет лишних отступов в выражениях a[ i]
"array-bracket-spacing": ["error", "never"],
"no-multi-spaces": "error", // запрет лишних пробелов var a = 2
"no-sparse-arrays": "warn", // предупреждение при дырке в массиве
"no-mixed-spaces-and-tabs": "error", // нельзя миксовать табы и пробелы
"keyword-spacing": ["error", { "after": true }],
"comma-spacing": ["error", { "before": false, "after": true }], // отступ после запятой, а перед нельзя
"no-undef":"error",
"array-callback-return": "error" // коллбек методов массива типа arr.map arr.filter должны иметь return в коллбеке
},
"env": {
"browser": true,
"node": true
},
"globals": {
"Vue":true,
"Symbol":true,
"Promise":true,
},
"plugins": []
}
env: {
commonjs: true,
es2021: true,
browser: true,
node: true,
'jest/globals': true,
},
extends: ['eslint:recommended', 'google'],
plugins: ['jest'],
parserOptions: {
ecmaVersion: 12,
},
rules: {
'max-len': [
'error',
{
code: 200,
ignoreTrailingComments: true,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],
'require-jsdoc': 'off',
'quote-props': 'off',
},
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ logs/
.vscode/
test.js
package-lock.json
.editorconfig
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint
91 changes: 91 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Contributing Guide

Before submitting your contribution, please make sure to take a moment and read through the following guidelines:

- [Pull Request Guidelines](#pull-request-guidelines)
- [Development Setup](#development-setup)
- [Scripts](#scripts)
- [Project Structure](#project-structure)
- [Contributing Tests](#contributing-tests)

## Pull Request Guidelines

- The master branch is just a snapshot of the latest stable release. All development should be done in dedicated branches. Do not submit PRs against the master branch.

- Checkout a topic branch from a base branch, e.g. `master`, and merge back against that branch.

- If adding a new feature add accompanying test case.

- It's OK to have multiple small commits as you work on the PR - GitHub can automatically squash them before merging.

- Make sure tests pass!

- Commit messages must follow the [commit message convention](./commit-convention.md). Commit messages are automatically validated before commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [husky](https://github.com/typicode/husky)).

- No need to worry about code style as long as you have installed the dev dependencies - modified files are automatically formatted with Prettier on commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [husky](https://github.com/typicode/husky)).

## Development Setup

You will need [Node.js](https://nodejs.org) **version 16+**.

After cloning the repo, run:

```bash
$ npm i # install the dependencies of the project
```

A high level overview of tools used:

- [Jest](https://jestjs.io/) for unit testing
- [Prettier](https://prettier.io/) for code formatting

## Scripts

### `npm run lint`

The `lint` script runs linter.

```bash
# lint files
$ npm run lint
# fix linter errors
$ npm run lint:fix
```

### `npm run test`

The `test` script simply calls the `jest` binary, so all [Jest CLI Options](https://jestjs.io/docs/en/cli) can be used. Some examples:

```bash
# run all tests
$ npm run test

# run all tests under the runtime-core package
$ npm run test -- runtime-core

# run tests in a specific file
$ npm run test -- fileName

# run a specific test in a specific file
$ npm run test -- fileName -t 'test name'
```

## Project Structure

- **`src`**: contains the source code

- **`api`**: contains group of methods and methods for the API.

- **`helpers`**: contains utilities shared across the entire codebase.

- **`tests`**: contains tests for the helpers directory.

- **`tests`**: contains tests for the src directory.

## Contributing Tests

Unit tests are collocated with the code being tested inside directories named `tests`. Consult the [Jest docs](https://jestjs.io/docs/en/using-matchers) and existing test cases for how to write new test specs. Here are some additional guidelines:

- Use the minimal API needed for a test case. For example, if a test can be written without involving the reactivity system or a component, it should be written so. This limits the test's exposure to changes in unrelated parts and makes it more stable.

- Only use platform-specific runtimes if the test is asserting platform-specific behavior.
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
};
83 changes: 0 additions & 83 deletions groups/decodeMsg.js

This file was deleted.

24 changes: 0 additions & 24 deletions groups/eth.js

This file was deleted.

46 changes: 0 additions & 46 deletions groups/get.js

This file was deleted.

Loading

0 comments on commit 364f31f

Please sign in to comment.