Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup npm package #138

Merged
merged 6 commits into from
May 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ build
debian
deb_dist
dist
node_modules
*.egg-info
*.pyc
*.tgz
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Below are some example outputs for a number of famous open source projects. All
### The Team
* Adam Waldenberg, Lead maintainer and Swedish translation
* Agustín Cañas, Spanish translation
* Bart van Andel, npm package maintainer
* Bill Wang, Chinese translation
* Christian Kastner, Debian package maintainer
* Jiwon Kim, Korean translation
Expand All @@ -49,5 +50,7 @@ Below are some example outputs for a number of famous open source projects. All
### Packages
The Debian packages offered with releases of gitinspector are unofficial and very simple packages generated with [stdeb](https://github.com/astraw/stdeb). Christian Kastner is maintaining the official Debian packages. You can check the current status on the [Debian Package Tracker](https://tracker.debian.org/pkg/gitinspector). Consequently, there are official packages for many Debian based distributions installable via *apt-get*.

An [npm](https://npmjs.com) package is provided for convenience as well. To install it globally, execute `npm i -g gitinspector`.

### License
gitinspector is licensed under the *GNU GPL v3*. The gitinspector logo is partly based on the git logo; based on the work of Jason Long. The logo is licensed under the *Creative Commons Attribution 3.0 Unported License*.
29 changes: 29 additions & 0 deletions gitinspector.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
var PythonShell = require('python-shell');

var options = {
// The main python script is in the same directory as this file
scriptPath: __dirname,

// Get command line arguments, skipping the default node args:
// arg0 == node executable, arg1 == this file
args: process.argv.slice(2)
};


// Set encoding used by stdin etc manually. Without this, gitinspector may fail to run.
process.env.PYTHONIOENCODING = 'utf8';

// Start inspector
var inspector = new PythonShell('gitinspector.py', options);

// Handle stdout
inspector.on('message', function(message) {
console.log(message);
});

// Let the inspector run, catching any error at the end
inspector.end(function (err) {
if (err) {
throw err;
}
});
64 changes: 64 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"name": "gitinspector",
"version": "0.5.0-dev-1",
"description": "Gitinspector is a statistical analysis tool for git repositories. The default analysis shows general statistics per author, which can be complemented with a timeline analysis that shows the workload and activity of each author.",
"preferGlobal": true,
"main": "gitinspector.py",
"directories": {
"doc": "docs",
"test": "tests"
},
"scripts": {
"clean": "rimraf **/*.pyc",
"crlf": "crlf --set=LF **/*.py",
"prepublish": "npm run clean && npm run crlf",
"release": "with-package git commit -am pkg.version && with-package git tag pkg.version && git push && npm publish && git push --tags",
"release:beta": "npm run release && npm run tag:beta",
"tag:beta": "with-package npm dist-tag add [email protected] beta",
"test": "echo \"Error: no test specified\" && exit 1"
},
"bin": {
"gitinspector": "gitinspector.py"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ejwa/gitinspector.git"
},
"keywords": [
"git",
"statistics",
"stats",
"analytics",
"grading"
],
"author": {
"name": "Adam Waldenberg",
"email": "[email protected]",
"url": "https://github.com/adam-waldenberg"
},
"contributors": [
"Agustín Cañas",
"Bart van Andel <[email protected]>",
"Bill Wang",
"Christian Kastner",
"Jiwon Kim",
"Kamila Chyla",
"Luca Motta",
"Philipp Nowak",
"Sergei Lomakov",
"Yannick Moy"
],
"license": "GPL-3.0",
"bugs": {
"url": "https://github.com/ejwa/gitinspector/issues"
},
"homepage": "https://github.com/ejwa/gitinspector#readme",
"devDependencies": {
"crlf": "^1.1.0",
"rimraf": "^2.5.4",
"with-package": "^0.2.0"
},
"dependencies": {
"python-shell": "^0.4.0"
}
}