Skip to content

Commit

Permalink
Updates from near-api-js (#105)
Browse files Browse the repository at this point in the history
* moved changes from near-api-js
* eslint added
* js artifacts moved to lib folder
* fuzz tests added to borsh-ts
* jest version increased
* js travis setup deleted (temp)
  • Loading branch information
volovyks authored Nov 30, 2020
1 parent da52355 commit 4c2f1a0
Show file tree
Hide file tree
Showing 43 changed files with 1,365 additions and 275 deletions.
21 changes: 21 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
env:
es6: true
node: true
extends:
- 'eslint:recommended'
parserOptions:
ecmaVersion: 2018
rules:
indent:
- error
- 4
linebreak-style:
- error
- unix
quotes:
- error
- single
semi:
- error
- always
no-console: off
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Cargo.lock
**/node_modules/
package-lock.json
yarn.lock
.nyc_output

# Borsh schema file
**/schema_schema.dat
Expand Down
9 changes: 0 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,12 @@ branches:
only:
- master

before_install:
- sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg
- echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
- sudo apt-get update -qq
- sudo apt-get install -y -qq yarn

install:
- cargo build --verbose --manifest-path=borsh-rs/Cargo.toml
- yarn install

script:
- cargo build --verbose --manifest-path=borsh-rs/Cargo.toml
- cargo test --verbose --manifest-path=borsh-rs/Cargo.toml
- yarn test


addons:
apt:
Expand Down
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,35 @@ Make sure you are on the master branch, then tag the code and push the tag:
git tag -a v9.9.9 -m "My superawesome change."
git push origin v9.9.9
```

# TypeScript/JavaScript

## Contributing

Install dependencies:
```bash
yarn install
```

Continuesly build with:
```bash
yarn dev
```

Run tests:
```bash
yarn test
```

Run linter
```bash
yarn lint
```
## Publish

Prepare `dist` version by running:
```bash
yarn build
```

When publishing to npm use [np](https://github.com/sindresorhus/np).
201 changes: 0 additions & 201 deletions borsh-js/index.js

This file was deleted.

18 changes: 18 additions & 0 deletions borsh-ts/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
env:
es6: true
node: true
extends:
- 'eslint:recommended'
- 'plugin:@typescript-eslint/eslint-recommended'
- 'plugin:@typescript-eslint/recommended'
parser: '@typescript-eslint/parser'
rules:
no-inner-declarations: 1
'@typescript-eslint/no-explicit-any': 1
'@typescript-eslint/camelcase': 1
'@typescript-eslint/explicit-function-return-type': 1
'@typescript-eslint/no-use-before-define': 1

parserOptions:
ecmaVersion: 2018
sourceType: module
Loading

0 comments on commit 4c2f1a0

Please sign in to comment.