Skip to content
This repository has been archived by the owner on Jun 7, 2019. It is now read-only.

Commit

Permalink
Updated npm scripts and setting, moved docs to folder
Browse files Browse the repository at this point in the history
  • Loading branch information
shuse2 committed Feb 9, 2018
1 parent efe0a6a commit eb1f62a
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 146 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"extends": ["lisk-base"],
"plugins": ["mocha"],
"globals": {
"naclInstance": true
},
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jspm_packages

# IDE directories
.idea
tmp

# Distribution folders
dist-browser/*.js
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.11.1
6.12.3
104 changes: 0 additions & 104 deletions Gruntfile.js

This file was deleted.

36 changes: 26 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,35 @@ pipeline {
stages {
stage('Install dependencies') {
steps {
sh '''
cp -r ~/cache/${CHANGE_TARGET:-${BRANCH_NAME:-development}}/node_modules ./ || true
npm install --verbose
cp ~/.coveralls.yml .
'''
sh 'npm install --verbose'
}
}
stage('Run lint') {
steps{
sh 'grunt eslint-ci'
steps {
ansiColor('xterm') {
sh 'npm run lint'
}
}
}
stage('Build') {
steps {
sh 'npm run build'
}
}
stage('Run node tests') {
stage('Run tests') {
steps {
sh 'npm run jenkins'
ansiColor('xterm') {
sh 'npm run test'
sh '''
cp ~/.coveralls.yml-lisk-js .coveralls.yml
npm run cover
'''
}
}
}
stage('Run browser tests') {
steps {
sh '''
npm run build
npm run build:check
npm run build:browsertest
HTTP_PORT=808${EXECUTOR_NUMBER:-0}
Expand All @@ -50,9 +58,17 @@ pipeline {
post {
success {
deleteDir()
githubNotify context: 'continuous-integration/jenkins/lisk-js', description: 'The build passed.', status: 'SUCCESS'
}
failure {
archiveArtifacts allowEmptyArchive: true, artifacts: 'cypress/screenshots/'
githubNotify context: 'continuous-integration/jenkins/lisk-js', description: 'The build failed.', status: 'FAILURE'
}
aborted {
githubNotify context: 'continuous-integration/jenkins/lisk-template', description: 'The build was aborted.', status: 'ERROR'
}
always {
archiveArtifacts allowEmptyArchive: true, artifacts: 'logs/*'
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions docs/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
### What was the problem?

### How did I fix it?

### How to test it?

### Review checklist

* The PR solves #INSERT_ISSUE_NUMBER
* All new code is covered with unit tests
* All new code was formatted with Prettier
* Linting passes
* Tests pass
* Commit messages follow the
[commit guidelines](CONTRIBUTING.md#git-commit-messages)
* Documentation has been added/updated
85 changes: 55 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,64 @@
"name": "lisk-js",
"version": "0.4.5",
"description": "JavaScript library for sending Lisk transactions from the client or server",
"main": "./dist-node/index.js",
"author": "Lisk Foundation <admin@lisk.io>, lightcurve GmbH <admin@lightcurve.io>",
"license": "GPL-3.0",
"keywords": [
"lisk",
"blockchain"
],
"homepage": "https://github.com/LiskHQ/lisk-js#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/LiskHQ/lisk-js.git"
},
"bugs": {
"url": "https://github.com/LiskHQ/lisk-js/issues"
},
"engines": {
"node": "=6.12.3",
"npm": "=3.10.10"
},
"main": "dist-node/index.js",
"scripts": {
"prestart": "./bin/prestart.sh",
"start": "./bin/start.sh",
"clean": "rm -rf ./node_modules ./dist-browser/lisk-js.js ./dist-browser/lisk-js.min.js ./dist-node",
"clean:browsertest": "rm -r browsertest/src browsertest/test",
"format": "prettier --write \"browsertest/{setup,runTests}.js\" \"{cypress/integration,src,test}/**/*.js\"",
"lint": "eslint .",
"lint:fix": "npm run lint -- --fix",
"test": "nyc mocha test --recursive",
"test:watch": "chokidar \"./(src|test)/**/*.js\" -c \"mocha test --recursive\" --initial",
"test:watch": "npm test -- --watch",
"test:watch:min": "npm run test:watch -- --reporter=min",
"test:browser": "cypress run --env ROOT_DIR=\"${PWD##*/}\"",
"cover": "nyc report --reporter=lcov",
"eslint": "grunt eslint",
"prettier": "prettier --write \"browsertest/{setup,runTests}.js\" \"{cypress/integration,src,test}/**/*.js\"",
"cover": "if [ -z $JENKINS_HOME ]; then npm run cover:local; else npm run cover:ci; fi",
"cover:base": "NODE_ENV=test nyc report",
"cover:local": "npm run cover:base -- --reporter=html --reporter=text",
"cover:ci": "npm run cover:base -- --reporter=text-lcov | coveralls -v",
"serve:browsertest": "http-server browsertest",
"jenkins": "grunt jenkins --verbose",
"build": "grunt build",
"prebuild:node": "rm -r dist-node/* || mkdir dist-node | echo",
"prebuild:browsertest": "cp package.json browsertest/",
"build": "npm run build:node && npm run build:browser",
"build:browsertest":
"npm run prebuild:browsertest && npm run babel:browsertest && npm run browserify:browsertest && npm run uglify:browsertest && npm run clean:browsertest",
"build:node": "npm run prebuild:node && npm run babel",
"build:browser": "npm run browserify && npm run uglify",
"build:check": "node -e \"require('./dist-node')\"",
"build:browsertest": "grunt build-browsertest",
"precommit": "lint-staged && npm run eslint",
"prepush": "npm run eslint && npm test",
"prepublishOnly": "npm run prepush && npm run build",
"babel": "babel src -d dist-node",
"babel:browsertest":
"babel src -d ./browsertest/src && BABEL_ENV=browsertest babel test --ignore test/transactions/dapp.js -d ./browsertest/test",
"browserify": "browserify ./dist-node/index.js -o ./dist-browser/lisk-js.js -s lisk -t rewireify",
"browserify:browsertest": "browserify ./browsertest/test/*.js ./browsertest/test/**/*.js -o ./browsertest/browsertest.js -s lisk -t rewireify",
"uglify": "uglifyjs -o ./dist-browser/lisk-js.min.js ./dist-browser/lisk-js.js",
"uglify:browsertest": "uglifyjs -o ./browsertest/browsertest.min.js ./browsertest/browsertest.js",
"precommit": "lint-staged && npm run lint",
"prepush": "npm run lint && npm test",
"prepublishOnly": "rm -r ./node_modules && npm install && npm run prepush && npm run build",
"prepublish:browser": "npm run prepublishOnly",
"publish:browser": "./bin/publish_browser.sh",
"postpublish": "npm run publish:browser"
},
"repository": {
"type": "git",
"url": "git@github.com:LiskHQ/lisk-js.git"
},
"author": "Lisk Foundation <admin@lisk.io>, lightcurve GmbH <admin@lightcurve.io>",
"license": "GPL-3.0",
"dependencies": {
"babel-runtime": "=6.26.0",
"bip39": "=2.4.0",
Expand All @@ -44,29 +74,24 @@
"babel-plugin-rewire": "=1.1.0",
"babel-plugin-transform-runtime": "=6.23.0",
"babel-preset-env": "=1.6.0",
"chokidar-cli": "=1.2.0",
"coveralls": "=2.13.1",
"browserify": "=16.0.0",
"coveralls": "=3.0.0",
"cypress": "=0.20.3",
"eslint": "=4.16.0",
"eslint-config-airbnb-base": "=11.3.1",
"eslint-config-lisk-base": "=0.1.0",
"eslint-plugin-import": "=2.7.0",
"grunt": "=1.0.1",
"grunt-browserify": "=5.0.0",
"grunt-contrib-uglify": "=3.0.1",
"grunt-coveralls": "=1.0.1",
"grunt-eslint": "=20.0.0",
"grunt-exec": "=2.0.0",
"eslint-plugin-mocha": "=4.11.0",
"http-server": "=0.10.0",
"husky": "=0.14.3",
"lint-staged": "=4.2.3",
"load-grunt-tasks": "=3.5.2",
"mocha": "=3.4.2",
"mocha-lcov-reporter": "=1.3.0",
"mocha": "=4.0.1",
"nyc": "=11.3.0",
"prettier": "=1.7.4",
"prettier": "=1.8.2",
"rewireify": "=0.2.5",
"should": "=11.2.1",
"should-sinon": "=0.0.6",
"sinon": "=2.2.0"
"sinon": "=4.1.2",
"uglify-js": "=3.3.10"
}
}
5 changes: 4 additions & 1 deletion test/transactions/utils/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ describe('time module', () => {
let clock;

before(() => {
clock = sinon.useFakeTimers(nowRealTime, 'Date');
clock = sinon.useFakeTimers({
now: nowRealTime,
toFake: ['Date'],
});
});

after(() => {
Expand Down

0 comments on commit eb1f62a

Please sign in to comment.