From e1971bab77b63576be4a2c6b943b9744f2583b45 Mon Sep 17 00:00:00 2001 From: Khaled Mohamed Date: Mon, 2 Jan 2017 14:21:18 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20Adding=20semantic-release=20?= =?UTF-8?q?=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 15 +++++++++++--- README.md | 8 ++++++-- package.json | 58 ++++++++++++++++++++++++++++++++-------------------- 3 files changed, 54 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8ab7e0b..e16dacd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,19 @@ -sudo: false language: node_js +cache: + directories: + - node_modules +notifications: + email: false node_js: - '6' - '4' -install: - - npm install +before_script: + - npm prune script: - npm run lint - npm test +after_success: + - npm run semantic-release +branches: + only: + - master diff --git a/README.md b/README.md index 3cc2eab..f934bf6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # Translate a JSON Object ↳ Links: [NPM](https://www.npmjs.com/package/translate-json-object) | [GitHub](https://github.com/KhaledMohamedP/translate-json-object) -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/fd5819795ed745d2b793787849b5400d)](https://www.codacy.com/app/khaledmohamedp/translate-json-object?utm_source=github.com&utm_medium=referral&utm_content=KhaledMohamedP/translate-json-object&utm_campaign=Badge_Grade) [![Version](https://img.shields.io/npm/v/translate-json-object.svg?style=flat-square)](https://www.npmjs.com/package/translate-json-object) [![License](https://img.shields.io/npm/l/translate-json-object.svg?style=flat-square)](https://www.npmjs.com/package/translate-json-object) [![Downloads](http://img.shields.io/npm/dm/translate-json-object.svg?style=flat-square)](https://www.npmjs.com/package/translate-json-object) +[![Build Status](https://travis-ci.org/KhaledMohamedP/translate-json-object.svg?branch=master)](https://travis-ci.org/KhaledMohamedP/translate-json-object) +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/fd5819795ed745d2b793787849b5400d)](https://www.codacy.com/app/khaledmohamedp/translate-json-object?utm_source=github.com&utm_medium=referral&utm_content=KhaledMohamedP/translate-json-object&utm_campaign=Badge_Grade) [![Version](https://img.shields.io/npm/v/translate-json-object.svg?style=flat)](https://www.npmjs.com/package/translate-json-object) [![License](https://img.shields.io/npm/l/translate-json-object.svg?style=flat)](https://www.npmjs.com/package/translate-json-object) [![Downloads](http://img.shields.io/npm/dm/translate-json-object.svg?style=flat)](https://www.npmjs.com/package/translate-json-object) +[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) A Node.js module to translate a JSON object from a detectable language to any other language currently via [google translate API](https://cloud.google.com/translate/docs) | [yandex translate](https://tech.yandex.com/translate/) @@ -76,9 +78,11 @@ Translate an object to any given language, it returns a promise with the transla ## What's next? #### TODO * [✅] Adding yandex service v2.1.0 -* [❌] Adding bing service * [✅] Unit test v2.1.4 * [✅] JS Linting v2.1.3 +* [✅] semantic-release-cli +* [❌] Adding bing translate service +* [❌] Adding cli utility #### Reach out diff --git a/package.json b/package.json index 675da70..b8bfd40 100644 --- a/package.json +++ b/package.json @@ -1,31 +1,15 @@ { "name": "translate-json-object", - "version": "2.1.4", + "version": "0.0.0-development", "description": "Translate a JSON object to any language via google or yandex translate API", "main": "lib/translate-json-object.js", "scripts": { + "commit": "git-cz", "lint": "xo", - "test": "jest", - "coverage": "jest --coverage", - "test:watch": "jest --coverage --watch" + "test": "jest --coverage", + "test:watch": "jest --coverage --watchAll", + "semantic-release": "semantic-release pre && npm publish && semantic-release post" }, - "repository": { - "type": "git", - "url": "git+https://github.com/KhaledMohamedP/translate-json-object.git" - }, - "keywords": [ - "translate", - "object", - "JSON", - "google", - "translate" - ], - "author": "Khaled Mohamed", - "license": "MIT", - "bugs": { - "url": "https://github.com/KhaledMohamedP/translate-json-object/issues" - }, - "homepage": "https://github.com/KhaledMohamedP/translate-json-object#readme", "dependencies": { "google-translate": "1.0.7", "lodash": "4.17.3", @@ -33,7 +17,10 @@ "yandex-translate": "2.1.1" }, "devDependencies": { + "commitizen": "2.9.3", + "cz-conventional-changelog": "1.2.0", "jest": "18.0.0", + "semantic-release": "6.3.2", "xo": "0.17.1" }, "xo": { @@ -44,5 +31,32 @@ "describe", "it" ] - } + }, + "jest": { + "coverageThreshold": { + "global": { + "branches": 85, + "functions": 85, + "lines": 85, + "statements": 85 + } + } + }, + "repository": { + "type": "git", + "url": "https://github.com/KhaledMohamedP/translate-json-object.git" + }, + "keywords": [ + "translate", + "object", + "JSON", + "google", + "translate" + ], + "author": "Khaled Mohamed", + "license": "MIT", + "bugs": { + "url": "https://github.com/KhaledMohamedP/translate-json-object/issues" + }, + "homepage": "https://github.com/KhaledMohamedP/translate-json-object#readme" }