-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
251 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,56 @@ | ||
# HeroDevs CLI -- `@herodevs/cli` | ||
# HeroDevs CLI - `@herodevs/cli` | ||
|
||
## Installation | ||
## Node Setup & Installation | ||
|
||
``` | ||
npm install -g @herodevs/cli | ||
``` | ||
|
||
## Usage | ||
Node versions 14+ | ||
|
||
after global installation | ||
No installation: | ||
|
||
``` | ||
@herodevs/cli ____ | ||
npx @herodevs/cli ... | ||
``` | ||
|
||
or | ||
Global installation: | ||
|
||
``` | ||
hd ____ | ||
npm install -g @herodevs/cli | ||
hd ... | ||
# or | ||
hdcli ... | ||
``` | ||
|
||
without installation: | ||
## Non-Node or Node < 14 Setup & Installation | ||
|
||
``` | ||
npx @herodevs/cli ____ | ||
Navigate [here](https://github.com/herodevs/cli/releases) to download the version for your operating system from the most recent release. | ||
|
||
## Available Commands | ||
|
||
```bash | ||
# Initializes your project to use NES libraries | ||
hdcli nes init | ||
``` | ||
|
||
## Commands | ||
```bash | ||
# Shows a list of committers in git repository | ||
hdcli report committers | ||
``` | ||
|
||
Get a list of committers within a git repository | ||
```bash | ||
# Shows diagnostic information about your project | ||
hdcli report diagnostics | ||
``` | ||
|
||
```bash | ||
# Initializes the project for the lines-of-code tracker | ||
hdcli tracker init | ||
``` | ||
hd report committers | ||
|
||
```bash | ||
# Runs a lines-of-code tracker to gather project | ||
hdcli tracker run | ||
``` | ||
|
||
## Tutorials | ||
|
||
- [Configure your project to consume a Never-Ending Support package](docs/nes-init.md) | ||
- [Get an audit of the users who have committed to a project](docs/git-audit.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Git Audit | ||
|
||
Get a list of committers in a project. | ||
|
||
![screenshot of running a git audit](git-audit-screenshot.png) | ||
|
||
## Installation | ||
|
||
Follow the instructions [here](installation-and-running.md) to install the HeroDevs CLI. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Installation and running the HeroDevs CLI | ||
|
||
## Installation | ||
|
||
Do you have NodeJS installed with version 14 or higher? | ||
|
||
- Yes | ||
- No need to install. | ||
- No | ||
- Get the HeroDevs CLI installer [here](https://github.com/herodevs/cli/releases). | ||
- Download the version for your operating system. | ||
- Unzip the download into your project's root directory. | ||
- The command that you run is based upon your operating system. | ||
- linux: `hdcli` | ||
- mac: `hdcli` | ||
- windows: `hdcli.exe` | ||
|
||
## Run | ||
|
||
Run the appropriate command based upon your environment. Noting that `...` represents the command and arguments you wish to run | ||
|
||
### NodeJS v14+ | ||
|
||
```bash | ||
npx @herodevs/cli@latest ... | ||
``` | ||
|
||
### Without NodeJS v14+: | ||
|
||
linux/mac: | ||
|
||
```bash | ||
hdcli ... | ||
``` | ||
|
||
windows: | ||
|
||
```bash | ||
hdcli.exe ... | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# NES Init | ||
|
||
Configure a project to use a [Never-Ending Support](https://www.herodevs.com/support#NES-Products) product. | ||
|
||
## Installation | ||
|
||
Follow the instructions [here](installation-and-running.md) to install the HeroDevs CLI. | ||
|
||
## Running the command | ||
|
||
``` | ||
hdcli nes init | ||
``` | ||
|
||
## Steps/procedure | ||
|
||
Confirm all changes have been committed to source control/git. | ||
|
||
![screenshot of confirmation](nes-init-1.png) | ||
|
||
Enter your access token. | ||
|
||
![screenshot of entering access token](nes-init-2.png) | ||
|
||
Select your product. | ||
|
||
![screenshot of entering access token](nes-init-3.png) | ||
|
||
Select your version. | ||
|
||
![screenshot of entering access token](nes-init-4.png) | ||
|
||
CONGRATULATIONS! Your product is now configured to use a NES product. | ||
|
||
![screenshot of entering access token](nes-init-5.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ import { getPackageChoices } from './get-package-choices'; | |
import { checkbox, confirm, password, select } from '@inquirer/prompts'; | ||
import { configureProject } from './configure-project'; | ||
import { Choice, ReleaseTrain } from './models'; | ||
import { sortByName } from '@herodevs/utility'; | ||
|
||
jest.mock('./verify-project-type'); | ||
jest.mock('@inquirer/prompts'); | ||
|
@@ -32,7 +33,7 @@ describe('nesInitCommand', () => { | |
let getProductChoicesMock: jest.Mock; | ||
let getPackageChoicesMock: jest.Mock; | ||
let mockReleaseTrains: ReleaseTrain[] = []; | ||
let mockReleaseTrainChoices: Choice<ReleaseTrain>[] = []; | ||
let mockReleaseTrainChoices: Choice<ReleaseTrain[]>[] = []; | ||
let configureProjectMock: jest.Mock; | ||
|
||
beforeEach(() => { | ||
|
@@ -74,8 +75,52 @@ describe('nesInitCommand', () => { | |
}, | ||
], | ||
}, | ||
{ | ||
id: 3, | ||
key: 'release-train-3', | ||
name: 'release train 3', | ||
products: [ | ||
{ | ||
id: 333, | ||
key: 'vue_essentials', | ||
name: 'Vue 3 Essentials', | ||
}, | ||
], | ||
entries: [ | ||
{ | ||
packageVersion: { | ||
id: 444, | ||
name: '4.5.6', | ||
fqns: '@neverendingsupport/[email protected]', | ||
origination: { | ||
name: 'vue', | ||
type: 'npm', | ||
version: '4.5.6', | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
]; | ||
mockReleaseTrainChoices = mockReleaseTrains.map((rt) => ({ name: rt.name, value: rt })); | ||
const products = mockReleaseTrains.reduce((acc, rt) => { | ||
rt.products.forEach((product) => { | ||
if (acc[product.name]) { | ||
acc[product.name].push(rt); | ||
} else { | ||
acc[product.name] = [rt]; | ||
} | ||
}); | ||
|
||
return acc; | ||
}, {} as { [key: string]: ReleaseTrain[] }); | ||
|
||
mockReleaseTrainChoices = Object.entries(products) | ||
.map(([key, value]) => ({ | ||
name: key, | ||
value, | ||
})) | ||
.sort(sortByName); | ||
|
||
const packageChoices = mockReleaseTrains[0].entries.map((e) => ({ | ||
name: e.packageVersion, | ||
value: e, | ||
|
@@ -87,7 +132,7 @@ describe('nesInitCommand', () => { | |
}); | ||
confirmMock.mockReturnValue(Promise.resolve(true)); | ||
passwordMock.mockReturnValue(Promise.resolve('abc123')); | ||
selectMock.mockReturnValue(Promise.resolve(mockReleaseTrains[0])); | ||
selectMock.mockReturnValue(Promise.resolve(mockReleaseTrainChoices[0].value)); | ||
checkboxMock.mockReturnValue(Promise.resolve(packageChoices.map((c) => c.value))); | ||
getProductChoicesMock.mockReturnValue(Promise.resolve(mockReleaseTrainChoices)); | ||
getPackageChoicesMock.mockReturnValue(packageChoices); | ||
|
@@ -150,6 +195,7 @@ describe('nesInitCommand', () => { | |
message: 'select a product', | ||
choices: mockReleaseTrainChoices, | ||
pageSize: mockReleaseTrainChoices.length, | ||
loop: false, | ||
}); | ||
}); | ||
|
||
|
Oops, something went wrong.