From 468d07f5f3976f39b57ec219298093312b4adb89 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Sat, 4 Mar 2017 23:44:16 +0100 Subject: [PATCH] add smartanalytics --- README.md | 24 +++++------ dist/npmts.cli.js | 2 + dist/npmts.plugins.d.ts | 3 +- dist/npmts.plugins.js | 2 + package.json | 1 + ts/npmts.cli.ts | 95 +++++++++++++++++++++-------------------- ts/npmts.plugins.ts | 2 + yarn.lock | 12 +++++- 8 files changed, 79 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index 0c3327b..767038c 100644 --- a/README.md +++ b/README.md @@ -3,23 +3,22 @@ Write npm modules with TypeScript without hassle. TypeScript ready. Fully ES6. ## Availabililty [![npm](https://gitzone.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/npmts) -[![git](https://gitzone.gitlab.io/assets/repo-button-git.svg)](https://gitlab.com/gitzone/npmts) -[![git](https://gitzone.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/gitzonetools/npmts) +[![git](https://gitzone.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/gitzone/npmts) +[![git](https://gitzone.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/gitzone/npmts) [![docs](https://gitzone.gitlab.io/assets/repo-button-docs.svg)](https://gitzone.gitlab.io/npmts/) ## Status for master -[![build status](https://gitlab.com/gitzone/npmts/badges/master/build.svg)](https://gitlab.com/gitzone/npmts/commits/master) -[![coverage report](https://gitlab.com/gitzone/npmts/badges/master/coverage.svg)](https://gitlab.com/gitzone/npmts/commits/master) +[![build status](https://GitLab.com/gitzone/npmts/badges/master/build.svg)](https://GitLab.com/gitzone/npmts/commits/master) +[![coverage report](https://GitLab.com/gitzone/npmts/badges/master/coverage.svg)](https://GitLab.com/gitzone/npmts/commits/master) [![npm downloads per month](https://img.shields.io/npm/dm/npmts.svg)](https://www.npmjs.com/package/npmts) -[![docker pulls](https://img.shields.io/docker/pulls/hosttoday/ht-docker-node.svg)](https://hub.docker.com/r/hosttoday/ht-docker-node/) -[![Dependency Status](https://david-dm.org/gitzonetools/npmts.svg)](https://david-dm.org/gitzonetools/npmts) -[![bitHound Dependencies](https://www.bithound.io/github/gitzonetools/npmts/badges/dependencies.svg)](https://www.bithound.io/github/gitzonetools/npmts/master/dependencies/npm) -[![bitHound Code](https://www.bithound.io/github/gitzonetools/npmts/badges/code.svg)](https://www.bithound.io/github/gitzonetools/npmts) +[![Dependency Status](https://david-dm.org/gitzone/npmts.svg)](https://david-dm.org/gitzone/npmts) +[![bitHound Dependencies](https://www.bithound.io/github/gitzone/npmts/badges/dependencies.svg)](https://www.bithound.io/github/gitzone/npmts/master/dependencies/npm) +[![bitHound Code](https://www.bithound.io/github/gitzone/npmts/badges/code.svg)](https://www.bithound.io/github/gitzone/npmts) [![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/) [![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/) [![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/) -## Introduction +## Usage NPMTS is your friend when writing, testing, publishing and documenting npm modules written in TypeScript. npmts will @@ -32,8 +31,7 @@ npmts will This works on your machine and in CI. There is a prebuild docker image available that includes npmts to make CI a breeze: [hosttoday/ht-docker-node:npmts on Dockerhub](https://hub.docker.com/r/hosttoday/ht-docker-node/) -For further information read the linked docs at the top of this README. +> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) +| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html) -> MIT licensed | **©** 2016 - 2017 [Lossless GmbH](https://lossless.gmbh) - -[![npm](https://gitzone.gitlab.io/assets/repo-footer.svg)](https://git.zone) +[![repo-footer](https://gitzone.gitlab.io/assets/repo-footer.svg)](https://push.rocks) diff --git a/dist/npmts.cli.js b/dist/npmts.cli.js index e03b4bc..1184f2c 100644 --- a/dist/npmts.cli.js +++ b/dist/npmts.cli.js @@ -7,6 +7,8 @@ const NpmtsConfig = require("./npmts.config"); const NpmtsMods = require("./npmts.mods"); const NpmtsWatch = require("./npmts.watch"); const NpmtsShip = require("./npmts.ship"); +let npmtsAnalytics = new plugins.smartanalytics.AnalyticsAccount('npmts', 'UA-64087619-2'); +npmtsAnalytics.sendEvent('npm', 'exec', 'push.rocks'); exports.run = () => { let done = q.defer(); let npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot); diff --git a/dist/npmts.plugins.d.ts b/dist/npmts.plugins.d.ts index 181dddc..19e9a5d 100644 --- a/dist/npmts.plugins.d.ts +++ b/dist/npmts.plugins.d.ts @@ -5,6 +5,7 @@ import * as lodash from 'lodash'; import * as npmextra from 'npmextra'; import * as projectinfo from 'projectinfo'; import * as path from 'path'; +import * as smartanalytics from 'smartanalytics'; import * as smartcli from 'smartcli'; import * as smartenv from 'smartenv'; import * as smartfile from 'smartfile'; @@ -14,4 +15,4 @@ import * as smartstring from 'smartstring'; import * as smartsystem from 'smartsystem'; import * as through2 from 'through2'; export declare let sourceMapSupport: any; -export { beautylog, depcheck, lodash, npmextra, projectinfo, path, smartcli, smartenv, smartfile, smartpath, smartstream, smartstring, smartsystem, through2 }; +export { beautylog, depcheck, lodash, npmextra, projectinfo, path, smartanalytics, smartcli, smartenv, smartfile, smartpath, smartstream, smartstring, smartsystem, through2 }; diff --git a/dist/npmts.plugins.js b/dist/npmts.plugins.js index 82c7cf4..75550c7 100644 --- a/dist/npmts.plugins.js +++ b/dist/npmts.plugins.js @@ -13,6 +13,8 @@ const projectinfo = require("projectinfo"); exports.projectinfo = projectinfo; const path = require("path"); exports.path = path; +const smartanalytics = require("smartanalytics"); +exports.smartanalytics = smartanalytics; const smartcli = require("smartcli"); exports.smartcli = smartcli; const smartenv = require("smartenv"); diff --git a/package.json b/package.json index 2bd3c00..1987f45 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "lodash": "^4.17.4", "npmextra": "^2.0.3", "projectinfo": "^3.0.2", + "smartanalytics": "^1.0.3", "smartchok": "^1.0.5", "smartcli": "2.0.1", "smartcov": "1.0.0", diff --git a/ts/npmts.cli.ts b/ts/npmts.cli.ts index a107504..5efff32 100644 --- a/ts/npmts.cli.ts +++ b/ts/npmts.cli.ts @@ -7,52 +7,55 @@ import * as NpmtsMods from './npmts.mods' import * as NpmtsWatch from './npmts.watch' import * as NpmtsShip from './npmts.ship' -export let run = () => { - let done = q.defer() - let npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot) - let npmtsCli = new plugins.smartcli.Smartcli() - npmtsCli.standardTask() - .then((argvArg) => { - plugins.beautylog.figletSync('NPMTS') - plugins.beautylog.info('npmts version: ' + npmtsProjectInfo.version) - return NpmtsConfig.run(argvArg) - }) - .then((configArg: NpmtsConfig.INpmtsConfig) => { - let done = q.defer() - plugins.beautylog.ora.start('loading additional modules...') - NpmtsMods.mod00.load() - .then((mod00) => { - return mod00.run(configArg) - }) - .then(configArg => { - let done = q.defer() - NpmtsMods.mod01.load() - .then(mod01 => { - return mod01.run(configArg) - }) - .then(configArg => { - done.resolve(configArg) - }) - return done.promise - }) - .then(configArg => { - let done = q.defer() - NpmtsMods.mod02.load() - .then(mod02 => { - return mod02.run(configArg) - }) - .then(configArg => { - done.resolve(configArg) - }) - return done.promise - }) - .then(NpmtsWatch.run) - .then(NpmtsShip.run) +let npmtsAnalytics = new plugins.smartanalytics.AnalyticsAccount('npmts','UA-64087619-2') +npmtsAnalytics.sendEvent('npm','exec','push.rocks') - return done.promise +export let run = () => { + let done = q.defer() + let npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot) + let npmtsCli = new plugins.smartcli.Smartcli() + npmtsCli.standardTask() + .then((argvArg) => { + plugins.beautylog.figletSync('NPMTS') + plugins.beautylog.info('npmts version: ' + npmtsProjectInfo.version) + return NpmtsConfig.run(argvArg) + }) + .then((configArg: NpmtsConfig.INpmtsConfig) => { + let done = q.defer() + plugins.beautylog.ora.start('loading additional modules...') + NpmtsMods.mod00.load() + .then((mod00) => { + return mod00.run(configArg) }) - .catch((err) => { if (err instanceof Error) { console.log(err) } } ) - npmtsCli.addVersion(npmtsProjectInfo.version) - npmtsCli.startParse() - return done.promise + .then(configArg => { + let done = q.defer() + NpmtsMods.mod01.load() + .then(mod01 => { + return mod01.run(configArg) + }) + .then(configArg => { + done.resolve(configArg) + }) + return done.promise + }) + .then(configArg => { + let done = q.defer() + NpmtsMods.mod02.load() + .then(mod02 => { + return mod02.run(configArg) + }) + .then(configArg => { + done.resolve(configArg) + }) + return done.promise + }) + .then(NpmtsWatch.run) + .then(NpmtsShip.run) + + return done.promise + }) + .catch((err) => { if (err instanceof Error) { console.log(err) } }) + npmtsCli.addVersion(npmtsProjectInfo.version) + npmtsCli.startParse() + return done.promise } diff --git a/ts/npmts.plugins.ts b/ts/npmts.plugins.ts index 96b5787..4a3f2dd 100644 --- a/ts/npmts.plugins.ts +++ b/ts/npmts.plugins.ts @@ -6,6 +6,7 @@ import * as lodash from 'lodash' import * as npmextra from 'npmextra' import * as projectinfo from 'projectinfo' import * as path from 'path' +import * as smartanalytics from 'smartanalytics' import * as smartcli from 'smartcli' import * as smartenv from 'smartenv' import * as smartfile from 'smartfile' @@ -23,6 +24,7 @@ export { npmextra, projectinfo, path, + smartanalytics, smartcli, smartenv, smartfile, diff --git a/yarn.lock b/yarn.lock index 8ae3529..50eb015 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2668,6 +2668,14 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" +smartanalytics@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/smartanalytics/-/smartanalytics-1.0.3.tgz#02b49051fe1e6ed415516de39bd38ff61b35e033" + dependencies: + smartq "^1.1.1" + smartrequest "^1.0.4" + typings-global "^1.0.14" + smartchai@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/smartchai/-/smartchai-1.0.3.tgz#de6d010bb8b5aef24cb70b31a5f5334e8c41b72f" @@ -2734,7 +2742,7 @@ smartenv@^1.2.2, smartenv@^1.2.5: lodash "^4.11.1" q "^1.4.1" -smartfile@4.1.6, smartfile@^4.0.21, smartfile@^4.1.4: +smartfile@4.1.6: version "4.1.6" resolved "https://registry.yarnpkg.com/smartfile/-/smartfile-4.1.6.tgz#d71026aefef99233c56766c3c6c11afc41a19b3a" dependencies: @@ -2751,7 +2759,7 @@ smartfile@4.1.6, smartfile@^4.0.21, smartfile@^4.1.4: vinyl "^2.0.1" vinyl-file "^3.0.0" -smartfile@^4.1.7: +smartfile@^4.0.21, smartfile@^4.1.4, smartfile@^4.1.7: version "4.1.7" resolved "https://registry.yarnpkg.com/smartfile/-/smartfile-4.1.7.tgz#5657bea62ad673d891b2c9a00f5866154e768c3f" dependencies: