diff --git a/.gitignore b/.gitignore index 75f4e792c..9da7a6b14 100644 --- a/.gitignore +++ b/.gitignore @@ -24,10 +24,10 @@ test/.coverage-unit .nyc_output # cypress media -**/cypress/screenshots/ -**/cypress/videos/ -**/cypress/plugins/ -**/cypress/support/ +templates/cypress.tmpl/screenshots/ +templates/cypress.tmpl/videos/ +templates/cypress.tmpl/plugins/ +templates/cypress.tmpl/support/ # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt @@ -53,8 +53,9 @@ jspm_packages tmp # Distribution folders -dist-browser/ dist-node/ +dist-browser/ +browsertest.build/ # Unsupported lock files yarn.lock diff --git a/.npmrc b/.npmrc deleted file mode 100644 index cac71fa6f..000000000 --- a/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -message = ":arrow_up: Version %s" -save-exact = true diff --git a/.npmrc b/.npmrc new file mode 120000 index 000000000..e48092b89 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +templates/.npmrc.tmpl \ No newline at end of file diff --git a/.nycrc b/.nycrc deleted file mode 100644 index 85974ea3a..000000000 --- a/.nycrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "require": ["babel-register"], - "sourceMap": false, - "instrument": false -} diff --git a/.nycrc b/.nycrc new file mode 120000 index 000000000..ca9add230 --- /dev/null +++ b/.nycrc @@ -0,0 +1 @@ +templates/.nycrc.tmpl \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index df996112c..000000000 --- a/.prettierrc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "singleQuote": true, - "trailingComma": "all", - "useTabs": true -} diff --git a/.prettierrc.json b/.prettierrc.json new file mode 120000 index 000000000..2710f71b3 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1 @@ +templates/.prettierrc.json.tmpl \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 17db2a2a2..31b40f2d3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,6 +40,21 @@ pipeline { } } } + stage('Run node tests') { + steps { + ansiColor('xterm') { + sh 'npm run test:node' + } + } + } + stage('Run browser tests') { + steps { + sh ''' + npm run build:browsertest + npm run test:browser + ''' + } + } } post { success { diff --git a/lerna.json b/lerna.json index 1c3a02709..62b7c75fc 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,6 @@ { "lerna": "2.11.0", "packages": ["packages/*"], - "version": "independent" + "version": "independent", + "stream": true } diff --git a/package.json b/package.json index 8ed462f2c..15e146171 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,10 @@ "lint": "lerna run lint", "lint:fix": "lerna run lint:fix", "test": "lerna run test", + "test:node": "lerna run test:node", + "test:browser": "lerna run test:browser", "build": "lerna run build", + "build:browsertest": "lerna run build:browsertest", "cover": "lerna run cover", "postinstall": "npm run bootstrap", "precommit": "lint-staged && npm run lint", diff --git a/packages/lisk-api-client/.babelrc b/packages/lisk-api-client/.babelrc index e4ccb8a75..cbfd2392a 120000 --- a/packages/lisk-api-client/.babelrc +++ b/packages/lisk-api-client/.babelrc @@ -1 +1 @@ -../../.babelrc.tmpl \ No newline at end of file +../../templates/.babelrc.tmpl \ No newline at end of file diff --git a/packages/lisk-api-client/.eslintignore b/packages/lisk-api-client/.eslintignore index ff4ebdaff..94760d288 120000 --- a/packages/lisk-api-client/.eslintignore +++ b/packages/lisk-api-client/.eslintignore @@ -1 +1 @@ -../../.eslintignore.tmpl \ No newline at end of file +../../templates/.eslintignore.tmpl \ No newline at end of file diff --git a/packages/lisk-api-client/.npmignore b/packages/lisk-api-client/.npmignore index 11c219c7f..8a0be70f3 120000 --- a/packages/lisk-api-client/.npmignore +++ b/packages/lisk-api-client/.npmignore @@ -1 +1 @@ -../../.npmignore.tmpl \ No newline at end of file +../../templates/.npmignore.tmpl \ No newline at end of file diff --git a/packages/lisk-api-client/.npmrc b/packages/lisk-api-client/.npmrc index cba44bb38..5cc817c43 120000 --- a/packages/lisk-api-client/.npmrc +++ b/packages/lisk-api-client/.npmrc @@ -1 +1 @@ -../../.npmrc \ No newline at end of file +../../templates/.npmrc.tmpl \ No newline at end of file diff --git a/packages/lisk-api-client/.nycrc b/packages/lisk-api-client/.nycrc index 5076d8ad5..6ca7ee8dd 120000 --- a/packages/lisk-api-client/.nycrc +++ b/packages/lisk-api-client/.nycrc @@ -1 +1 @@ -../../.nycrc \ No newline at end of file +../../templates/.nycrc.tmpl \ No newline at end of file diff --git a/packages/lisk-api-client/.prettierrc.json b/packages/lisk-api-client/.prettierrc.json index e69c69c2f..00ecd510a 120000 --- a/packages/lisk-api-client/.prettierrc.json +++ b/packages/lisk-api-client/.prettierrc.json @@ -1 +1 @@ -../../.prettierrc.json \ No newline at end of file +../../templates/.prettierrc.json.tmpl \ No newline at end of file diff --git a/packages/lisk-api-client/browsertest b/packages/lisk-api-client/browsertest new file mode 120000 index 000000000..c5e729e5c --- /dev/null +++ b/packages/lisk-api-client/browsertest @@ -0,0 +1 @@ +../../templates/browsertest.tmpl \ No newline at end of file diff --git a/packages/lisk-api-client/browsertest/config.json b/packages/lisk-api-client/browsertest/config.json deleted file mode 100644 index 28c6b1b2d..000000000 --- a/packages/lisk-api-client/browsertest/config.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "nodes": { - "mainnet": [ - "node01.lisk.io", - "node02.lisk.io", - "node03.lisk.io", - "node04.lisk.io", - "node05.lisk.io", - "node06.lisk.io", - "node07.lisk.io", - "node08.lisk.io" - ], - "testnet": ["testnet.lisk.io"] - }, - "options": { - "testnet": false, - "ssl": true, - "randomNode": true, - "node": null, - "port": null, - "nethash": null, - "bannedNodes": [] - } -} diff --git a/packages/lisk-api-client/cypress b/packages/lisk-api-client/cypress new file mode 120000 index 000000000..958c42d19 --- /dev/null +++ b/packages/lisk-api-client/cypress @@ -0,0 +1 @@ +../../templates/cypress.tmpl \ No newline at end of file diff --git a/packages/lisk-api-client/cypress.json b/packages/lisk-api-client/cypress.json deleted file mode 100644 index 2ef006ebd..000000000 --- a/packages/lisk-api-client/cypress.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "baseUrl": "http://localhost:8080", - "video": false -} diff --git a/packages/lisk-api-client/cypress.json b/packages/lisk-api-client/cypress.json new file mode 120000 index 000000000..f9d7d1e5a --- /dev/null +++ b/packages/lisk-api-client/cypress.json @@ -0,0 +1 @@ +../../templates/cypress.json.tmpl \ No newline at end of file diff --git a/packages/lisk-api-client/package.json b/packages/lisk-api-client/package.json index ffbcf5be6..e4ecb0511 100644 --- a/packages/lisk-api-client/package.json +++ b/packages/lisk-api-client/package.json @@ -24,15 +24,15 @@ "scripts": { "transpile": "babel src -d dist-node", "transpile:browsertest": - "babel src -d ./browsertest/src && BABEL_ENV=browsertest babel test -d ./browsertest/test", + "babel src -d ./browsertest.build/src && BABEL_ENV=browsertest babel test -d ./browsertest.build/test", "browserify": "browserify ./dist-node/index.js -o ./dist-browser/index.js -s lisk --node", "browserify:browsertest": - "browserify ./browsertest/test/*.js ./browsertest/test/**/*.js -o ./browsertest/browsertest.js -s lisk", + "browserify ./browsertest.build/test/*.js ./browsertest.build/test/**/*.js -o ./browsertest.build/browsertest.js -s lisk", "uglify": "uglifyjs -nm -o ./dist-browser/index.min.js ./dist-browser/index.js", "uglify:browsertest": - "uglifyjs -o ./browsertest/browsertest.min.js ./browsertest/browsertest.js", + "uglifyjs -o ./browsertest.build/browsertest.min.js ./browsertest.build/browsertest.js", "format": "prettier --write \"*.{js,json}\" \"{src,test}/**/*.{js,json}\"", "lint": "eslint .", "lint:fix": "npm run lint -- --fix", @@ -41,8 +41,13 @@ "test:watch:min": "npm run test:watch -- --reporter=min", "test:node": "npm run build:check && BABEL_ENV=buildcheck mocha test --compilers js:babel-register --recursive", - "test:browser": "cypress run --env ROOT_DIR=\"${PWD##*/}\"", - "serve:browsertest": "http-server browsertest", + "serve:start": "http-server -p 11541 ./browsertest &", + "serve:stop": "kill $(lsof -t -i:11541) || true", + "pretest:browser": + "npm run serve:stop && npm run build:browsertest && npm run serve:start", + "test:browser": + "wait-on http://localhost:11541 && cypress run --config baseUrl=http://localhost:11541 --env ROOT_DIR=\"${PWD##*/}\"", + "posttest:browser": "npm run serve:stop", "cover": "if [ -z $JENKINS_HOME ]; then npm run cover:local; else npm run cover:ci; fi", "cover:base": "NODE_ENV=test nyc report", @@ -50,14 +55,16 @@ "cover:ci": "npm run cover:base -- --reporter=text", "build:browsertest": "npm run transpile:browsertest && npm run browserify:browsertest && npm run uglify:browsertest", - "postbuild:browsertest": "rm -r browsertest/src browsertest/test", - "prebuild:node": "rm -r dist-node/* || mkdir dist-node | echo", + "postbuild:browsertest": + "rm -r browsertest.build/src browsertest.build/test", + "prebuild:node": "rm -r dist-node/* || mkdir dist-node || true", "build:node": "npm run transpile", "prebuild:browser": - "rm ./dist-browser/index.js ./dist-browser/index.min.js | echo", - "build:browser": "npm run browserify && npm run uglify", - "prebuild": "npm run prebuild:node && npm run prebuild:browser", - "build": "npm run build:node && npm run build:browser", + "rm ./dist-browser/index.js ./dist-browser/index.min.js || true", + "build:browser": + "npm run build:node && npm run browserify && npm run uglify", + "prebuild": "npm run prebuild:browser", + "build": "npm run build:browser", "build:check": "node -e \"require('./dist-node')\"", "prepublishOnly": "npm run lint && npm test && npm run build && npm run build:check" @@ -88,6 +95,7 @@ "prettier": "1.12.1", "sinon": "4.1.2", "sinon-chai": "2.14.0", - "uglify-es": "3.3.9" + "uglify-es": "3.3.9", + "wait-on": "2.1.0" } } diff --git a/packages/lisk-constants/.babelrc b/packages/lisk-constants/.babelrc index e4ccb8a75..cbfd2392a 120000 --- a/packages/lisk-constants/.babelrc +++ b/packages/lisk-constants/.babelrc @@ -1 +1 @@ -../../.babelrc.tmpl \ No newline at end of file +../../templates/.babelrc.tmpl \ No newline at end of file diff --git a/packages/lisk-constants/.eslintignore b/packages/lisk-constants/.eslintignore index ff4ebdaff..94760d288 120000 --- a/packages/lisk-constants/.eslintignore +++ b/packages/lisk-constants/.eslintignore @@ -1 +1 @@ -../../.eslintignore.tmpl \ No newline at end of file +../../templates/.eslintignore.tmpl \ No newline at end of file diff --git a/packages/lisk-constants/.npmignore b/packages/lisk-constants/.npmignore index 11c219c7f..8a0be70f3 120000 --- a/packages/lisk-constants/.npmignore +++ b/packages/lisk-constants/.npmignore @@ -1 +1 @@ -../../.npmignore.tmpl \ No newline at end of file +../../templates/.npmignore.tmpl \ No newline at end of file diff --git a/packages/lisk-constants/.npmrc b/packages/lisk-constants/.npmrc index cba44bb38..5cc817c43 120000 --- a/packages/lisk-constants/.npmrc +++ b/packages/lisk-constants/.npmrc @@ -1 +1 @@ -../../.npmrc \ No newline at end of file +../../templates/.npmrc.tmpl \ No newline at end of file diff --git a/packages/lisk-constants/.nycrc b/packages/lisk-constants/.nycrc index 5076d8ad5..6ca7ee8dd 120000 --- a/packages/lisk-constants/.nycrc +++ b/packages/lisk-constants/.nycrc @@ -1 +1 @@ -../../.nycrc \ No newline at end of file +../../templates/.nycrc.tmpl \ No newline at end of file diff --git a/packages/lisk-constants/.prettierrc.json b/packages/lisk-constants/.prettierrc.json index e69c69c2f..00ecd510a 120000 --- a/packages/lisk-constants/.prettierrc.json +++ b/packages/lisk-constants/.prettierrc.json @@ -1 +1 @@ -../../.prettierrc.json \ No newline at end of file +../../templates/.prettierrc.json.tmpl \ No newline at end of file diff --git a/packages/lisk-constants/browsertest b/packages/lisk-constants/browsertest new file mode 120000 index 000000000..c5e729e5c --- /dev/null +++ b/packages/lisk-constants/browsertest @@ -0,0 +1 @@ +../../templates/browsertest.tmpl \ No newline at end of file diff --git a/packages/lisk-constants/cypress b/packages/lisk-constants/cypress new file mode 120000 index 000000000..958c42d19 --- /dev/null +++ b/packages/lisk-constants/cypress @@ -0,0 +1 @@ +../../templates/cypress.tmpl \ No newline at end of file diff --git a/packages/lisk-constants/cypress.json b/packages/lisk-constants/cypress.json new file mode 120000 index 000000000..f9d7d1e5a --- /dev/null +++ b/packages/lisk-constants/cypress.json @@ -0,0 +1 @@ +../../templates/cypress.json.tmpl \ No newline at end of file diff --git a/packages/lisk-constants/package.json b/packages/lisk-constants/package.json index d140623cb..c805e56e7 100644 --- a/packages/lisk-constants/package.json +++ b/packages/lisk-constants/package.json @@ -19,24 +19,55 @@ "node": ">=6.3 <=9.5", "npm": ">=3 <=5" }, + "browser": "dist-browser/index.min.js", "main": "dist-node/index.js", "scripts": { + "transpile": "babel src -d dist-node", + "transpile:browsertest": + "babel src -d ./browsertest.build/src && BABEL_ENV=browsertest babel test -d ./browsertest.build/test", + "browserify": + "browserify ./dist-node/index.js -o ./dist-browser/index.js -s lisk --node", + "browserify:browsertest": + "browserify ./browsertest.build/test/*.js -o ./browsertest.build/browsertest.js -s lisk", + "uglify": + "uglifyjs -nm -o ./dist-browser/index.min.js ./dist-browser/index.js", + "uglify:browsertest": + "uglifyjs -o ./browsertest.build/browsertest.min.js ./browsertest.build/browsertest.js", "format": "prettier --write \"*.{js,json}\" \"{src,test}/**/*.{js,json}\"", "lint": "eslint .", "lint:fix": "npm run lint -- --fix", "test": "NODE_ENV=test nyc mocha test", "test:watch": "npm test -- --watch", "test:watch:min": "npm run test:watch -- --reporter=min", + "test:node": + "npm run build:check && BABEL_ENV=buildcheck mocha test --compilers js:babel-register --recursive", + "serve:start": "http-server -p 11542 ./browsertest &", + "serve:stop": "kill $(lsof -t -i:11542) || true", + "pretest:browser": + "npm run serve:stop && npm run build:browsertest && npm run serve:start", + "test:browser": + "wait-on http://localhost:11542 && cypress run --config baseUrl=http://localhost:11542 --env ROOT_DIR=\"${PWD##*/}\"", + "posttest:browser": "npm run serve:stop", "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", - "prebuild": "rm -r dist-node || mkdir dist-node | echo", - "build": "babel src -d dist-node", + "build:browsertest": + "npm run transpile:browsertest && npm run browserify:browsertest && npm run uglify:browsertest", + "postbuild:browsertest": + "rm -r browsertest.build/src browsertest.build/test", + "prebuild:node": "rm -r dist-node/* || mkdir dist-node || true", + "build:node": "npm run transpile", + "prebuild:browser": + "rm ./dist-browser/index.js ./dist-browser/index.min.js || true", + "build:browser": + "npm run build:node && npm run browserify && npm run uglify", + "prebuild": "npm run prebuild:browser", + "build": "npm run build:browser", "build:check": "node -e \"require('./dist-node')\"", "prepublishOnly": - "rm -r ./node_modules && npm install && npm run lint && npm test && npm run build && npm run build:check" + "npm run lint && npm test && npm run build && npm run build:check" }, "devDependencies": { "babel-cli": "6.26.0", @@ -45,14 +76,19 @@ "babel-plugin-transform-runtime": "6.23.0", "babel-preset-env": "1.6.1", "babel-register": "6.26.0", + "browserify": "16.2.2", "chai": "4.1.2", + "cypress": "3.0.2", "eslint": "4.19.1", "eslint-config-airbnb-base": "12.1.0", "eslint-config-lisk-base": "1.0.0", "eslint-plugin-import": "2.11.0", "eslint-plugin-mocha": "5.0.0", + "http-server": "0.11.1", "mocha": "5.1.1", "nyc": "11.7.1", - "prettier": "1.12.1" + "prettier": "1.12.1", + "uglify-es": "3.3.9", + "wait-on": "2.1.0" } } diff --git a/packages/lisk-cryptography/.babelrc b/packages/lisk-cryptography/.babelrc index e4ccb8a75..cbfd2392a 120000 --- a/packages/lisk-cryptography/.babelrc +++ b/packages/lisk-cryptography/.babelrc @@ -1 +1 @@ -../../.babelrc.tmpl \ No newline at end of file +../../templates/.babelrc.tmpl \ No newline at end of file diff --git a/packages/lisk-cryptography/.eslintignore b/packages/lisk-cryptography/.eslintignore index ff4ebdaff..94760d288 120000 --- a/packages/lisk-cryptography/.eslintignore +++ b/packages/lisk-cryptography/.eslintignore @@ -1 +1 @@ -../../.eslintignore.tmpl \ No newline at end of file +../../templates/.eslintignore.tmpl \ No newline at end of file diff --git a/packages/lisk-cryptography/.npmignore b/packages/lisk-cryptography/.npmignore index 11c219c7f..8a0be70f3 120000 --- a/packages/lisk-cryptography/.npmignore +++ b/packages/lisk-cryptography/.npmignore @@ -1 +1 @@ -../../.npmignore.tmpl \ No newline at end of file +../../templates/.npmignore.tmpl \ No newline at end of file diff --git a/packages/lisk-cryptography/.npmrc b/packages/lisk-cryptography/.npmrc index cba44bb38..5cc817c43 120000 --- a/packages/lisk-cryptography/.npmrc +++ b/packages/lisk-cryptography/.npmrc @@ -1 +1 @@ -../../.npmrc \ No newline at end of file +../../templates/.npmrc.tmpl \ No newline at end of file diff --git a/packages/lisk-cryptography/.nycrc b/packages/lisk-cryptography/.nycrc index 5076d8ad5..6ca7ee8dd 120000 --- a/packages/lisk-cryptography/.nycrc +++ b/packages/lisk-cryptography/.nycrc @@ -1 +1 @@ -../../.nycrc \ No newline at end of file +../../templates/.nycrc.tmpl \ No newline at end of file diff --git a/packages/lisk-cryptography/.prettierrc.json b/packages/lisk-cryptography/.prettierrc.json index e69c69c2f..00ecd510a 120000 --- a/packages/lisk-cryptography/.prettierrc.json +++ b/packages/lisk-cryptography/.prettierrc.json @@ -1 +1 @@ -../../.prettierrc.json \ No newline at end of file +../../templates/.prettierrc.json.tmpl \ No newline at end of file diff --git a/packages/lisk-cryptography/browsertest b/packages/lisk-cryptography/browsertest new file mode 120000 index 000000000..c5e729e5c --- /dev/null +++ b/packages/lisk-cryptography/browsertest @@ -0,0 +1 @@ +../../templates/browsertest.tmpl \ No newline at end of file diff --git a/packages/lisk-cryptography/cypress b/packages/lisk-cryptography/cypress new file mode 120000 index 000000000..958c42d19 --- /dev/null +++ b/packages/lisk-cryptography/cypress @@ -0,0 +1 @@ +../../templates/cypress.tmpl \ No newline at end of file diff --git a/packages/lisk-cryptography/cypress.json b/packages/lisk-cryptography/cypress.json new file mode 120000 index 000000000..f9d7d1e5a --- /dev/null +++ b/packages/lisk-cryptography/cypress.json @@ -0,0 +1 @@ +../../templates/cypress.json.tmpl \ No newline at end of file diff --git a/packages/lisk-cryptography/package.json b/packages/lisk-cryptography/package.json index 8edf904fe..996c678c1 100644 --- a/packages/lisk-cryptography/package.json +++ b/packages/lisk-cryptography/package.json @@ -20,24 +20,55 @@ "node": ">=6.3 <=9.5", "npm": ">=3 <=5" }, - "main": "dist/index.js", + "browser": "dist-browser/index.min.js", + "main": "dist-node/index.js", "scripts": { + "transpile": "babel src -d dist-node", + "transpile:browsertest": + "babel src -d ./browsertest.build/src && BABEL_ENV=browsertest babel test -d ./browsertest.build/test", + "browserify": + "browserify ./dist-node/index.js -o ./dist-browser/index.js -s lisk --node", + "browserify:browsertest": + "browserify ./browsertest.build/test/*.js -o ./browsertest.build/browsertest.js -s lisk", + "uglify": + "uglifyjs -nm -o ./dist-browser/index.min.js ./dist-browser/index.js", + "uglify:browsertest": + "uglifyjs -o ./browsertest.build/browsertest.min.js ./browsertest.build/browsertest.js", "format": "prettier --write \"*.{js,json}\" \"{src,test}/**/*.{js,json}\"", "lint": "eslint .", "lint:fix": "npm run lint -- --fix", "test": "NODE_ENV=test nyc mocha test", "test:watch": "npm test -- --watch", "test:watch:min": "npm run test:watch -- --reporter=min", + "test:node": + "npm run build:check && BABEL_ENV=buildcheck mocha test --compilers js:babel-register --recursive", + "serve:start": "http-server -p 11543 ./browsertest &", + "serve:stop": "kill $(lsof -t -i:11543) || true", + "pretest:browser": + "npm run serve:stop && npm run build:browsertest && npm run serve:start", + "test:browser": + "wait-on http://localhost:11543 && cypress run --config baseUrl=http://localhost:11543 --env ROOT_DIR=\"${PWD##*/}\"", + "posttest:browser": "npm run serve:stop", "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", - "prebuild": "rm -r dist || mkdir dist | echo", - "build": "babel src -d dist", - "build:check": "node -e \"require('./dist')\"", + "build:browsertest": + "npm run transpile:browsertest && npm run browserify:browsertest && npm run uglify:browsertest", + "postbuild:browsertest": + "rm -r browsertest.build/src browsertest.build/test", + "prebuild:node": "rm -r dist-node/* || mkdir dist-node || true", + "build:node": "npm run transpile", + "prebuild:browser": + "rm ./dist-browser/index.js ./dist-browser/index.min.js || true", + "build:browser": + "npm run build:node && npm run browserify && npm run uglify", + "prebuild": "npm run prebuild:browser", + "build": "npm run build:browser", + "build:check": "node -e \"require('./dist-node')\"", "prepublishOnly": - "rm -r ./node_modules && npm install && npm run lint && npm test && npm run build && npm run build:check" + "npm run lint && npm test && npm run build && npm run build:check" }, "dependencies": { "browserify-bignum": "1.3.0-2", @@ -50,18 +81,24 @@ "devDependencies": { "babel-cli": "6.26.0", "babel-plugin-istanbul": "4.1.6", + "babel-plugin-module-resolver": "3.1.1", "babel-plugin-transform-runtime": "6.23.0", "babel-preset-env": "1.6.1", "babel-register": "6.26.0", + "browserify": "16.2.2", "chai": "4.1.2", + "cypress": "3.0.2", "eslint": "4.19.1", "eslint-config-airbnb-base": "12.1.0", "eslint-config-lisk-base": "1.0.0", "eslint-plugin-import": "2.11.0", "eslint-plugin-mocha": "5.0.0", + "http-server": "0.11.1", "mocha": "5.1.1", "nyc": "11.7.1", "prettier": "1.12.1", - "sinon": "4.1.2" + "sinon": "4.1.2", + "uglify-es": "3.3.9", + "wait-on": "2.1.0" } } diff --git a/packages/lisk-elements/.babelrc b/packages/lisk-elements/.babelrc index e4ccb8a75..cbfd2392a 120000 --- a/packages/lisk-elements/.babelrc +++ b/packages/lisk-elements/.babelrc @@ -1 +1 @@ -../../.babelrc.tmpl \ No newline at end of file +../../templates/.babelrc.tmpl \ No newline at end of file diff --git a/packages/lisk-elements/.eslintignore b/packages/lisk-elements/.eslintignore deleted file mode 100644 index 4891d1153..000000000 --- a/packages/lisk-elements/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -.nyc_output/ -browsertest/browsertest.js -browsertest/browsertest.min.js -coverage/ -cypress/plugins/ -docs/ -dist-*/ diff --git a/packages/lisk-elements/.eslintignore b/packages/lisk-elements/.eslintignore new file mode 120000 index 000000000..94760d288 --- /dev/null +++ b/packages/lisk-elements/.eslintignore @@ -0,0 +1 @@ +../../templates/.eslintignore.tmpl \ No newline at end of file diff --git a/packages/lisk-elements/.npmignore b/packages/lisk-elements/.npmignore new file mode 120000 index 000000000..8a0be70f3 --- /dev/null +++ b/packages/lisk-elements/.npmignore @@ -0,0 +1 @@ +../../templates/.npmignore.tmpl \ No newline at end of file diff --git a/packages/lisk-elements/.npmrc b/packages/lisk-elements/.npmrc index cba44bb38..5cc817c43 120000 --- a/packages/lisk-elements/.npmrc +++ b/packages/lisk-elements/.npmrc @@ -1 +1 @@ -../../.npmrc \ No newline at end of file +../../templates/.npmrc.tmpl \ No newline at end of file diff --git a/packages/lisk-elements/.nycrc b/packages/lisk-elements/.nycrc index 5076d8ad5..6ca7ee8dd 120000 --- a/packages/lisk-elements/.nycrc +++ b/packages/lisk-elements/.nycrc @@ -1 +1 @@ -../../.nycrc \ No newline at end of file +../../templates/.nycrc.tmpl \ No newline at end of file diff --git a/packages/lisk-elements/.prettierrc.json b/packages/lisk-elements/.prettierrc.json index e69c69c2f..00ecd510a 120000 --- a/packages/lisk-elements/.prettierrc.json +++ b/packages/lisk-elements/.prettierrc.json @@ -1 +1 @@ -../../.prettierrc.json \ No newline at end of file +../../templates/.prettierrc.json.tmpl \ No newline at end of file diff --git a/packages/lisk-elements/browsertest b/packages/lisk-elements/browsertest new file mode 120000 index 000000000..c5e729e5c --- /dev/null +++ b/packages/lisk-elements/browsertest @@ -0,0 +1 @@ +../../templates/browsertest.tmpl \ No newline at end of file diff --git a/packages/lisk-elements/cypress b/packages/lisk-elements/cypress new file mode 120000 index 000000000..958c42d19 --- /dev/null +++ b/packages/lisk-elements/cypress @@ -0,0 +1 @@ +../../templates/cypress.tmpl \ No newline at end of file diff --git a/packages/lisk-elements/cypress.json b/packages/lisk-elements/cypress.json new file mode 120000 index 000000000..f9d7d1e5a --- /dev/null +++ b/packages/lisk-elements/cypress.json @@ -0,0 +1 @@ +../../templates/cypress.json.tmpl \ No newline at end of file diff --git a/packages/lisk-elements/package.json b/packages/lisk-elements/package.json index 9c7f0d0e4..34845690b 100644 --- a/packages/lisk-elements/package.json +++ b/packages/lisk-elements/package.json @@ -20,35 +20,57 @@ "node": ">=6.3 <=9.5", "npm": ">=3 <=5" }, + "browser": "dist-browser/index.min.js", "main": "dist-node/index.js", "scripts": { "prestart": "./scripts/prestart.sh", "start": "./scripts/start.sh", + "transpile": "babel src -d dist-node", + "transpile:browsertest": + "babel src -d ./browsertest.build/src && BABEL_ENV=browsertest babel test -d ./browsertest.build/test", + "browserify": + "browserify ./dist-node/index.js -o ./dist-browser/index.js -s lisk --node", + "browserify:browsertest": + "browserify ./browsertest.build/test/*.js -o ./browsertest.build/browsertest.js -s lisk --node", + "uglify": + "uglifyjs -nm -o ./dist-browser/index.min.js ./dist-browser/index.js", + "uglify:browsertest": + "uglifyjs -o ./browsertest.build/browsertest.min.js ./browsertest.build/browsertest.js", "format": "prettier --write \"*.{js,json}\" \"{src,test}/**/*.{js,json}\"", "lint": "eslint .", "lint:fix": "npm run lint -- --fix", "test": "NODE_ENV=test nyc mocha test", "test:watch": "npm test -- --watch", "test:watch:min": "npm run test:watch -- --reporter=min", + "test:node": + "npm run build:check && BABEL_ENV=buildcheck mocha test --compilers js:babel-register --recursive", + "serve:start": "http-server -p 11540 ./browsertest &", + "serve:stop": "kill $(lsof -t -i:11540) || true", + "pretest:browser": + "npm run serve:stop && npm run build:browsertest && npm run serve:start", + "test:browser": + "wait-on http://localhost:11540 && cypress run --config baseUrl=http://localhost:11540 --env ROOT_DIR=\"${PWD##*/}\"", + "posttest:browser": "npm run serve:stop", "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", - "prebuild:node": "rm -r dist-node/* || mkdir dist-node | echo", - "build:node": "babel src -d dist-node", + "build:browsertest": + "npm run transpile:browsertest && npm run browserify:browsertest && npm run uglify:browsertest", + "postbuild:browsertest": + "rm -r browsertest.build/src browsertest.build/test", + "prebuild:node": "rm -r dist-node/* || mkdir dist-node || true", + "build:node": "npm run transpile", "prebuild:browser": - "rm ./dist-browser/lisk-elements.js ./dist-browser/lisk-elements.min.js | echo", + "rm ./dist-browser/index.js ./dist-browser/index.min.js || true", "build:browser": - "browserify ./dist-node/index.js -o ./dist-browser/lisk-elements.js -s lisk", - "postbuild:browser": "npm run build:browser:min", - "build:browser:min": - "uglifyjs -nm -o ./dist-browser/lisk-elements.min.js ./dist-browser/lisk-elements.js", - "prebuild": "npm run prebuild:node && npm run prebuild:browser", - "build": "npm run build:node && npm run build:browser", + "npm run build:node && npm run browserify && npm run uglify", + "prebuild": "npm run prebuild:browser", + "build": "npm run build:browser", "build:check": "node -e \"require('./dist-node')\"", "prepublishOnly": - "rm -r ./node_modules && npm install && npm run lint && npm test && npm run build && npm run build:check", + "npm run lint && npm test && npm run build && npm run build:check", "prepublish:browser": "npm run prepublishOnly", "publish:browser": "./scripts/publish_browser.sh", "postpublish": "npm run publish:browser" @@ -63,19 +85,23 @@ "devDependencies": { "babel-cli": "6.26.0", "babel-plugin-istanbul": "4.1.6", + "babel-plugin-module-resolver": "3.1.1", "babel-plugin-transform-runtime": "6.23.0", "babel-preset-env": "1.6.1", "babel-register": "6.26.0", "browserify": "16.0.0", "chai": "4.1.2", + "cypress": "3.0.2", "eslint": "4.19.1", "eslint-config-airbnb-base": "12.1.0", "eslint-config-lisk-base": "1.0.0", "eslint-plugin-import": "2.11.0", "eslint-plugin-mocha": "5.0.0", + "http-server": "0.11.1", "mocha": "5.1.1", "nyc": "11.7.1", "prettier": "1.12.1", - "uglify-es": "3.3.9" + "uglify-es": "3.3.9", + "wait-on": "2.1.0" } } diff --git a/packages/lisk-passphrase/.babelrc b/packages/lisk-passphrase/.babelrc index e4ccb8a75..cbfd2392a 120000 --- a/packages/lisk-passphrase/.babelrc +++ b/packages/lisk-passphrase/.babelrc @@ -1 +1 @@ -../../.babelrc.tmpl \ No newline at end of file +../../templates/.babelrc.tmpl \ No newline at end of file diff --git a/packages/lisk-passphrase/.eslintignore b/packages/lisk-passphrase/.eslintignore index ff4ebdaff..94760d288 120000 --- a/packages/lisk-passphrase/.eslintignore +++ b/packages/lisk-passphrase/.eslintignore @@ -1 +1 @@ -../../.eslintignore.tmpl \ No newline at end of file +../../templates/.eslintignore.tmpl \ No newline at end of file diff --git a/packages/lisk-passphrase/.npmignore b/packages/lisk-passphrase/.npmignore index 11c219c7f..8a0be70f3 120000 --- a/packages/lisk-passphrase/.npmignore +++ b/packages/lisk-passphrase/.npmignore @@ -1 +1 @@ -../../.npmignore.tmpl \ No newline at end of file +../../templates/.npmignore.tmpl \ No newline at end of file diff --git a/packages/lisk-passphrase/.npmrc b/packages/lisk-passphrase/.npmrc index cba44bb38..5cc817c43 120000 --- a/packages/lisk-passphrase/.npmrc +++ b/packages/lisk-passphrase/.npmrc @@ -1 +1 @@ -../../.npmrc \ No newline at end of file +../../templates/.npmrc.tmpl \ No newline at end of file diff --git a/packages/lisk-passphrase/.nycrc b/packages/lisk-passphrase/.nycrc index 5076d8ad5..6ca7ee8dd 120000 --- a/packages/lisk-passphrase/.nycrc +++ b/packages/lisk-passphrase/.nycrc @@ -1 +1 @@ -../../.nycrc \ No newline at end of file +../../templates/.nycrc.tmpl \ No newline at end of file diff --git a/packages/lisk-passphrase/.prettierrc.json b/packages/lisk-passphrase/.prettierrc.json index e69c69c2f..00ecd510a 120000 --- a/packages/lisk-passphrase/.prettierrc.json +++ b/packages/lisk-passphrase/.prettierrc.json @@ -1 +1 @@ -../../.prettierrc.json \ No newline at end of file +../../templates/.prettierrc.json.tmpl \ No newline at end of file diff --git a/packages/lisk-passphrase/browsertest b/packages/lisk-passphrase/browsertest new file mode 120000 index 000000000..c5e729e5c --- /dev/null +++ b/packages/lisk-passphrase/browsertest @@ -0,0 +1 @@ +../../templates/browsertest.tmpl \ No newline at end of file diff --git a/packages/lisk-passphrase/cypress b/packages/lisk-passphrase/cypress new file mode 120000 index 000000000..958c42d19 --- /dev/null +++ b/packages/lisk-passphrase/cypress @@ -0,0 +1 @@ +../../templates/cypress.tmpl \ No newline at end of file diff --git a/packages/lisk-passphrase/cypress.json b/packages/lisk-passphrase/cypress.json new file mode 120000 index 000000000..f9d7d1e5a --- /dev/null +++ b/packages/lisk-passphrase/cypress.json @@ -0,0 +1 @@ +../../templates/cypress.json.tmpl \ No newline at end of file diff --git a/packages/lisk-passphrase/package.json b/packages/lisk-passphrase/package.json index 3af0b6d9c..5970fa91d 100644 --- a/packages/lisk-passphrase/package.json +++ b/packages/lisk-passphrase/package.json @@ -20,24 +20,55 @@ "node": ">=6.3 <=9.5", "npm": ">=3 <=5" }, - "main": "dist/index.js", + "browser": "dist-browser/index.min.js", + "main": "dist-node/index.js", "scripts": { + "transpile": "babel src -d dist-node", + "transpile:browsertest": + "babel src -d ./browsertest.build/src && BABEL_ENV=browsertest babel test -d ./browsertest.build/test", + "browserify": + "browserify ./dist-node/index.js -o ./dist-browser/index.js -s lisk --node", + "browserify:browsertest": + "browserify ./browsertest.build/test/*.js -o ./browsertest.build/browsertest.js -s lisk", + "uglify": + "uglifyjs -nm -o ./dist-browser/index.min.js ./dist-browser/index.js", + "uglify:browsertest": + "uglifyjs -o ./browsertest.build/browsertest.min.js ./browsertest.build/browsertest.js", "format": "prettier --write \"*.{js,json}\" \"{src,test}/**/*.{js,json}\"", "lint": "eslint .", "lint:fix": "npm run lint -- --fix", "test": "NODE_ENV=test nyc mocha test", "test:watch": "npm test -- --watch", "test:watch:min": "npm run test:watch -- --reporter=min", + "test:node": + "npm run build:check && BABEL_ENV=buildcheck mocha test --compilers js:babel-register --recursive", + "serve:start": "http-server -p 11544 ./browsertest &", + "serve:stop": "kill $(lsof -t -i:11544) || true", + "pretest:browser": + "npm run serve:stop && npm run build:browsertest && npm run serve:start", + "test:browser": + "wait-on http://localhost:11544 && cypress run --config baseUrl=http://localhost:11544 --env ROOT_DIR=\"${PWD##*/}\"", + "posttest:browser": "npm run serve:stop", "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", - "prebuild": "rm -r dist || mkdir dist | echo", - "build": "babel src -d dist", - "build:check": "node -e \"require('./dist')\"", + "build:browsertest": + "npm run transpile:browsertest && npm run browserify:browsertest && npm run uglify:browsertest", + "postbuild:browsertest": + "rm -r browsertest.build/src browsertest.build/test", + "prebuild:node": "rm -r dist-node/* || mkdir dist-node || true", + "build:node": "npm run transpile", + "prebuild:browser": + "rm ./dist-browser/index.js ./dist-browser/index.min.js || true", + "build:browser": + "npm run build:node && npm run browserify && npm run uglify", + "prebuild": "npm run prebuild:browser", + "build": "npm run build:browser", + "build:check": "node -e \"require('./dist-node')\"", "prepublishOnly": - "rm -r ./node_modules && npm install && npm run lint && npm test && npm run build && npm run build:check" + "npm run lint && npm test && npm run build && npm run build:check" }, "dependencies": { "bip39": "2.4.0" @@ -45,17 +76,23 @@ "devDependencies": { "babel-cli": "6.26.0", "babel-plugin-istanbul": "4.1.4", + "babel-plugin-module-resolver": "3.1.1", "babel-plugin-transform-runtime": "6.23.0", "babel-preset-env": "1.6.0", "babel-register": "6.26.0", + "browserify": "16.2.2", "chai": "4.1.2", + "cypress": "3.0.2", "eslint": "4.19.1", "eslint-config-airbnb-base": "12.1.0", "eslint-config-lisk-base": "1.0.0", "eslint-plugin-import": "2.11.0", "eslint-plugin-mocha": "5.0.0", + "http-server": "0.11.1", "mocha": "5.1.1", "nyc": "11.7.1", - "prettier": "1.12.1" + "prettier": "1.12.1", + "uglify-es": "3.3.9", + "wait-on": "2.1.0" } } diff --git a/packages/lisk-transactions/.babelrc b/packages/lisk-transactions/.babelrc index e4ccb8a75..cbfd2392a 120000 --- a/packages/lisk-transactions/.babelrc +++ b/packages/lisk-transactions/.babelrc @@ -1 +1 @@ -../../.babelrc.tmpl \ No newline at end of file +../../templates/.babelrc.tmpl \ No newline at end of file diff --git a/packages/lisk-transactions/.eslintignore b/packages/lisk-transactions/.eslintignore index ff4ebdaff..94760d288 120000 --- a/packages/lisk-transactions/.eslintignore +++ b/packages/lisk-transactions/.eslintignore @@ -1 +1 @@ -../../.eslintignore.tmpl \ No newline at end of file +../../templates/.eslintignore.tmpl \ No newline at end of file diff --git a/packages/lisk-transactions/.npmignore b/packages/lisk-transactions/.npmignore index 11c219c7f..8a0be70f3 120000 --- a/packages/lisk-transactions/.npmignore +++ b/packages/lisk-transactions/.npmignore @@ -1 +1 @@ -../../.npmignore.tmpl \ No newline at end of file +../../templates/.npmignore.tmpl \ No newline at end of file diff --git a/packages/lisk-transactions/.npmrc b/packages/lisk-transactions/.npmrc index cba44bb38..5cc817c43 120000 --- a/packages/lisk-transactions/.npmrc +++ b/packages/lisk-transactions/.npmrc @@ -1 +1 @@ -../../.npmrc \ No newline at end of file +../../templates/.npmrc.tmpl \ No newline at end of file diff --git a/packages/lisk-transactions/.nycrc b/packages/lisk-transactions/.nycrc index 5076d8ad5..6ca7ee8dd 120000 --- a/packages/lisk-transactions/.nycrc +++ b/packages/lisk-transactions/.nycrc @@ -1 +1 @@ -../../.nycrc \ No newline at end of file +../../templates/.nycrc.tmpl \ No newline at end of file diff --git a/packages/lisk-transactions/.prettierrc.json b/packages/lisk-transactions/.prettierrc.json index e69c69c2f..00ecd510a 120000 --- a/packages/lisk-transactions/.prettierrc.json +++ b/packages/lisk-transactions/.prettierrc.json @@ -1 +1 @@ -../../.prettierrc.json \ No newline at end of file +../../templates/.prettierrc.json.tmpl \ No newline at end of file diff --git a/packages/lisk-transactions/browsertest b/packages/lisk-transactions/browsertest new file mode 120000 index 000000000..c5e729e5c --- /dev/null +++ b/packages/lisk-transactions/browsertest @@ -0,0 +1 @@ +../../templates/browsertest.tmpl \ No newline at end of file diff --git a/packages/lisk-transactions/cypress b/packages/lisk-transactions/cypress new file mode 120000 index 000000000..958c42d19 --- /dev/null +++ b/packages/lisk-transactions/cypress @@ -0,0 +1 @@ +../../templates/cypress.tmpl \ No newline at end of file diff --git a/packages/lisk-transactions/cypress.json b/packages/lisk-transactions/cypress.json new file mode 120000 index 000000000..f9d7d1e5a --- /dev/null +++ b/packages/lisk-transactions/cypress.json @@ -0,0 +1 @@ +../../templates/cypress.json.tmpl \ No newline at end of file diff --git a/packages/lisk-transactions/package.json b/packages/lisk-transactions/package.json index 9cff20fbc..b8c23f611 100644 --- a/packages/lisk-transactions/package.json +++ b/packages/lisk-transactions/package.json @@ -20,24 +20,55 @@ "node": ">=6.3 <=9.5", "npm": ">=3 <=5" }, - "main": "dist/index.js", + "browser": "dist-browser/index.min.js", + "main": "dist-node/index.js", "scripts": { + "transpile": "babel src -d dist-node", + "transpile:browsertest": + "babel src -d ./browsertest.build/src && BABEL_ENV=browsertest babel test -d ./browsertest.build/test", + "browserify": + "browserify ./dist-node/index.js -o ./dist-browser/index.js -s lisk --node", + "browserify:browsertest": + "browserify ./browsertest.build/test/*.js -o ./browsertest.build/browsertest.js -s lisk", + "uglify": + "uglifyjs -nm -o ./dist-browser/index.min.js ./dist-browser/index.js", + "uglify:browsertest": + "uglifyjs -o ./browsertest.build/browsertest.min.js ./browsertest.build/browsertest.js", "format": "prettier --write \"*.{js,json}\" \"{src,test}/**/*.{js,json}\"", "lint": "eslint .", "lint:fix": "npm run lint -- --fix", "test": "NODE_ENV=test nyc mocha test", "test:watch": "npm test -- --watch", "test:watch:min": "npm run test:watch -- --reporter=min", + "test:node": + "npm run build:check && BABEL_ENV=buildcheck mocha test --compilers js:babel-register --recursive", + "serve:start": "http-server -p 11545 ./browsertest &", + "serve:stop": "kill $(lsof -t -i:11545) || true", + "pretest:browser": + "npm run serve:stop && npm run build:browsertest && npm run serve:start", + "test:browser": + "wait-on http://localhost:11545 && cypress run --config baseUrl=http://localhost:11545 --env ROOT_DIR=\"${PWD##*/}\"", + "posttest:browser": "npm run serve:stop", "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", - "prebuild": "rm -r dist || mkdir dist | echo", - "build": "babel src -d dist", - "build:check": "node -e \"require('./dist')\"", + "build:browsertest": + "npm run transpile:browsertest && npm run browserify:browsertest && npm run uglify:browsertest", + "postbuild:browsertest": + "rm -r browsertest.build/src browsertest.build/test", + "prebuild:node": "rm -r dist-node/* || mkdir dist-node || true", + "build:node": "npm run transpile", + "prebuild:browser": + "rm ./dist-browser/index.js ./dist-browser/index.min.js || true", + "build:browser": + "npm run build:node && npm run browserify && npm run uglify", + "prebuild": "npm run prebuild:browser", + "build": "npm run build:browser", + "build:check": "node -e \"require('./dist-node')\"", "prepublishOnly": - "rm -r ./node_modules && npm install && npm run lint && npm test && npm run build && npm run build:check" + "npm run lint && npm test && npm run build && npm run build:check" }, "dependencies": { "browserify-bignum": "1.3.0-2", @@ -48,19 +79,25 @@ "devDependencies": { "babel-cli": "6.26.0", "babel-plugin-istanbul": "4.1.6", + "babel-plugin-module-resolver": "3.1.1", "babel-plugin-transform-runtime": "6.23.0", "babel-preset-env": "1.6.1", "babel-register": "6.26.0", + "browserify": "16.2.2", "chai": "4.1.2", + "cypress": "3.0.2", "eslint": "4.19.1", "eslint-config-airbnb-base": "12.1.0", "eslint-config-lisk-base": "1.0.0", "eslint-plugin-import": "2.11.0", "eslint-plugin-mocha": "5.0.0", + "http-server": "0.11.1", "mocha": "5.1.1", "nyc": "11.7.1", "prettier": "1.12.1", "sinon": "4.1.2", - "sinon-chai": "2.14.0" + "sinon-chai": "2.14.0", + "uglify-es": "3.3.9", + "wait-on": "2.1.0" } } diff --git a/.babelrc.tmpl b/templates/.babelrc.tmpl similarity index 100% rename from .babelrc.tmpl rename to templates/.babelrc.tmpl diff --git a/.eslintignore.tmpl b/templates/.eslintignore.tmpl similarity index 63% rename from .eslintignore.tmpl rename to templates/.eslintignore.tmpl index 731c7c6bd..b098bcc84 100644 --- a/.eslintignore.tmpl +++ b/templates/.eslintignore.tmpl @@ -6,10 +6,7 @@ dist-node/ dist-browser/ # browser tests -browsertest/src/ -browsertest/test/ -browsertest/browsertest.js -browsertest/browsertest.min.js +browsertest.build/ # cypress media cypress/screenshots/ diff --git a/.npmignore.tmpl b/templates/.npmignore.tmpl similarity index 100% rename from .npmignore.tmpl rename to templates/.npmignore.tmpl diff --git a/templates/.npmrc.tmpl b/templates/.npmrc.tmpl new file mode 100644 index 000000000..cac71fa6f --- /dev/null +++ b/templates/.npmrc.tmpl @@ -0,0 +1,2 @@ +message = ":arrow_up: Version %s" +save-exact = true diff --git a/templates/.nycrc.tmpl b/templates/.nycrc.tmpl new file mode 100644 index 000000000..85974ea3a --- /dev/null +++ b/templates/.nycrc.tmpl @@ -0,0 +1,5 @@ +{ + "require": ["babel-register"], + "sourceMap": false, + "instrument": false +} diff --git a/templates/.prettierrc.json.tmpl b/templates/.prettierrc.json.tmpl new file mode 100644 index 000000000..df996112c --- /dev/null +++ b/templates/.prettierrc.json.tmpl @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "trailingComma": "all", + "useTabs": true +} diff --git a/packages/lisk-api-client/browsertest/.eslintrc.json b/templates/browsertest.tmpl/.eslintrc.json similarity index 100% rename from packages/lisk-api-client/browsertest/.eslintrc.json rename to templates/browsertest.tmpl/.eslintrc.json diff --git a/packages/lisk-api-client/browsertest/browsertest.html b/templates/browsertest.tmpl/browsertest.html similarity index 90% rename from packages/lisk-api-client/browsertest/browsertest.html rename to templates/browsertest.tmpl/browsertest.html index e697f8a58..6bb184a18 100644 --- a/packages/lisk-api-client/browsertest/browsertest.html +++ b/templates/browsertest.tmpl/browsertest.html @@ -17,7 +17,7 @@ - + diff --git a/packages/lisk-api-client/browsertest/browsertest.min.html b/templates/browsertest.tmpl/browsertest.min.html similarity index 89% rename from packages/lisk-api-client/browsertest/browsertest.min.html rename to templates/browsertest.tmpl/browsertest.min.html index b09ff3b1a..399e82813 100644 --- a/packages/lisk-api-client/browsertest/browsertest.min.html +++ b/templates/browsertest.tmpl/browsertest.min.html @@ -17,7 +17,7 @@ - + diff --git a/packages/lisk-api-client/browsertest/run_tests.js b/templates/browsertest.tmpl/run_tests.js similarity index 100% rename from packages/lisk-api-client/browsertest/run_tests.js rename to templates/browsertest.tmpl/run_tests.js diff --git a/packages/lisk-api-client/browsertest/setup.js b/templates/browsertest.tmpl/setup.js similarity index 100% rename from packages/lisk-api-client/browsertest/setup.js rename to templates/browsertest.tmpl/setup.js diff --git a/templates/cypress.json.tmpl b/templates/cypress.json.tmpl new file mode 100644 index 000000000..26e2979d8 --- /dev/null +++ b/templates/cypress.json.tmpl @@ -0,0 +1,5 @@ +{ + "video": false, + "pluginsFile": false, + "supportFile": false +} diff --git a/packages/lisk-api-client/cypress/.eslintrc.json b/templates/cypress.tmpl/.eslintrc.json similarity index 100% rename from packages/lisk-api-client/cypress/.eslintrc.json rename to templates/cypress.tmpl/.eslintrc.json diff --git a/packages/lisk-api-client/cypress/integration/index.js b/templates/cypress.tmpl/integration/index.js similarity index 100% rename from packages/lisk-api-client/cypress/integration/index.js rename to templates/cypress.tmpl/integration/index.js diff --git a/mocha.opts.tmpl b/templates/mocha.opts.tmpl similarity index 100% rename from mocha.opts.tmpl rename to templates/mocha.opts.tmpl