Skip to content

Commit

Permalink
Merge pull request #2 from MLH-Fellowship/feature-list
Browse files Browse the repository at this point in the history
Migrate to Yargs and update eslint config
  • Loading branch information
thehanimo committed Feb 18, 2021
2 parents 40caf69 + d92f851 commit 45914c1
Show file tree
Hide file tree
Showing 9 changed files with 224 additions and 2,306 deletions.
4 changes: 2 additions & 2 deletions .eslintrc
@@ -1,3 +1,3 @@
{
"extends": "oclif"
}
"extends": ["@ljharb", "@ljharb/eslint-config/node/latest"]
}
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -102,3 +102,6 @@ dist

# TernJS port file
.tern-port

# Lockfiles
yarn.lock
8 changes: 8 additions & 0 deletions README.md
@@ -1,6 +1,14 @@
# repo-report
CLI to list all repos a user has access to, and report on their configuration in aggregate.

# Installation

- `npm install` to install all dependencies
- create .env file and initialize GITHUB_PAT with your Github token

# Usage

- `node ./src/index.js list` to have a list of repos with different fields: access, default branch, etc.


# In a NutShell
Expand Down
27 changes: 24 additions & 3 deletions bin/run
@@ -1,5 +1,26 @@
#!/usr/bin/env node
/* eslint-disable no-magic-numbers */

require('@oclif/command').run()
.then(require('@oclif/command/flush'))
.catch(require('@oclif/errors/handle'))
'use strict';

require('dotenv').config();
const Yargs = require('yargs');
const list = require('../src/commands/list');

Yargs.usage('Usage: $0 <command> [options]')
.command('list', 'lists all repositories', function (yargs) {
const argv = yargs
.usage('Usage: $0 list [options]')
.alias('g', 'group-by')
.nargs('g', 1)
.describe('g', 'Field to be grouped by')
.alias('f', 'fields')
.boolean('f')
.describe('f', 'Show available fields')
.help('h')
.alias('h', 'help').argv;
list(argv);
})
.help('h')
.alias('h', 'help')
.parse();
3 changes: 0 additions & 3 deletions bin/run.cmd

This file was deleted.

77 changes: 23 additions & 54 deletions package.json
@@ -1,55 +1,24 @@
{
"name": "repo-report",
"description": "CLI to list all repos a user has access to, and report on their configuration in aggregate.",
"version": "0.0.0",
"author": "@MLH-Fellowship",
"bin": {
"repo-report": "./bin/run"
},
"bugs": "https://github.com/MLH-Fellowship/repo-report/issues",
"dependencies": {
"@oclif/command": "^1",
"@oclif/config": "^1",
"@oclif/plugin-help": "^3",
"@octokit/graphql": "^4.6.0",
"cli-table": "^0.3.4",
"dotenv": "^8.2.0",
"log-symbols": "^4.0.0"
},
"devDependencies": {
"@oclif/dev-cli": "^1",
"eslint": "^5.13",
"eslint-config-oclif": "^3.1",
"globby": "^10"
},
"engines": {
"node": ">=8.0.0"
},
"files": [
"/bin",
"/npm-shrinkwrap.json",
"/oclif.manifest.json",
"/src"
],
"homepage": "https://github.com/MLH-Fellowship/repo-report",
"keywords": [
"oclif"
],
"license": "MIT",
"main": "src/index.js",
"oclif": {
"commands": "./src/commands",
"bin": "repo-report",
"plugins": [
"@oclif/plugin-help"
]
},
"repository": "MLH-Fellowship/repo-report",
"scripts": {
"postpack": "rm -f oclif.manifest.json",
"posttest": "eslint .",
"prepack": "oclif-dev manifest && oclif-dev readme",
"test": "echo NO TESTS",
"version": "oclif-dev readme && git add README.md"
}
}
"name": "repo-report",
"version": "0.0.0",
"description": "CLI to list all repos a user has access to, and report on their configuration in aggregate.",
"main": "bin/run",
"bin": {
"repo-report": "./bin/run"
},
"repository": "https://github.com/ljharb/repo-report",
"author": "ljharb",
"license": "MIT",
"private": false,
"dependencies": {
"@octokit/graphql": "^4.6.0",
"cli-table": "^0.3.4",
"dotenv": "^8.2.0",
"log-symbols": "^4.0.0",
"yargs": "^16.2.0"
},
"devDependencies": {
"@ljharb/eslint-config": "^17.5.1",
"eslint": "^7.20.0"
}
}

0 comments on commit 45914c1

Please sign in to comment.