Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@beuluis/hook-cli

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beuluis/hook-cli - npm Package Compare versions

Comparing version 1.1.4 to 1.2.0

dist/modules/checkCommitMessageIssueKey.js

2

dist/modules/checkForVulnerabilities.js

@@ -78,3 +78,3 @@ "use strict";

{
title: `Check for vulnerabilities with '${console_log_colors_1.color.cyan(`${packageManager} audit`)}'`,
title: `Check for vulnerabilities with ${console_log_colors_1.color.cyan(`${packageManager} audit`)}`,
task: async (_context, task) => await (0, exec_helper_1.execute)(`${auditCommandBuilder(packageManager, prod)} --json`)

@@ -81,0 +81,0 @@ .then(() => (task.title = `No package vulnerabilities with level ${auditLevel} or higher found`))

@@ -72,6 +72,6 @@ "use strict";

},
fail: {
alias: 'f',
'no-fail': {
alias: 'n',
type: 'boolean',
description: 'If true it will exit with a non zero in case of updates',
description: 'If true only prints warning messages and do not exit with not zero code',
default: false,

@@ -81,6 +81,6 @@ },

handler: async (argv) => {
const { 'package-manager': packageManager, fail } = argv;
const { 'package-manager': packageManager, 'no-fail': noFail } = argv;
const tasks = new listr_1.default([
{
title: `Check for updates with '${console_log_colors_1.color.cyan(`${packageManager} outdated`)}'`,
title: `Check for updates with ${console_log_colors_1.color.cyan(`${packageManager} outdated`)}`,
task: async (context, task) => await (0, exec_helper_1.execute)(`${packageManager} outdated --json`)

@@ -125,6 +125,3 @@ .then(() => (task.title = `No package updates found`))

}
if (error instanceof commandModule_helper_1.HookFailedError) {
if (fail) {
process.exit(1);
}
if (error instanceof commandModule_helper_1.HookFailedError && noFail) {
process.exit(0);

@@ -131,0 +128,0 @@ }

{
"name": "@beuluis/hook-cli",
"version": "1.1.4",
"version": "1.2.0",
"description": "A small hook cli that can be used with for example husky",

@@ -42,15 +42,15 @@ "bin": {

"devDependencies": {
"@beuluis/eslint-config": "^1.0.2",
"@beuluis/hook-cli": "^1.1.2",
"@beuluis/prettier-config": "^2.0.1",
"@types/listr": "^0.14.4",
"@types/node": "^18.7.18",
"@types/yargs": "^17.0.10",
"eslint": "^8.23.1",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"np": "^7.6.2",
"ts-node": "^10.8.0",
"tslib": "^2.4.0",
"typescript": "^4.7.2"
"@beuluis/eslint-config": "1.0.2",
"@beuluis/hook-cli": "1.1.3",
"@beuluis/prettier-config": "2.0.1",
"@types/listr": "0.14.4",
"@types/node": "18.7.18",
"@types/yargs": "17.0.12",
"eslint": "8.23.1",
"husky": "8.0.1",
"lint-staged": "13.0.3",
"np": "7.6.2",
"ts-node": "10.9.1",
"tslib": "2.4.0",
"typescript": "4.8.3"
},

@@ -57,0 +57,0 @@ "keywords": [

@@ -51,2 +51,85 @@ [![Contributors][contributors-shield]][contributors-url]

#### checkCommitMessageIssueKey
Check the pattern of a commit message
| Option | Description | Type | default |
| ----------------- | ------------------------------------------------------------------------ | --------- | ------- |
| `-p`, `--prefix` | Prefix of the issue key. | `string` | `` |
| `-m`, `--message` | Get message from command line instead of file. | `string` | `` |
| `-n`, `--no-fail` | If true only prints warning messages and do not exit with not zero code. | `boolean` | `false` |
##### Example usage
```bash
npx hook-cli checkCommitMessageIssueKey "$1" -p "HelloWorld"
```
```bash
npx hook-cli checkCommitMessageIssueKey .git/COMMIT_EDITMSG -p "KEY"
```
```bash
npx hook-cli checkCommitMessageIssueKey -m "KEY-12 message" -p "KEY"
```
```bash
npx hook-cli checkCommitMessageIssueKey -m "KEY-12 message" -p "KEY" -n
```
#### checkCommitMessagePattern
Check the pattern of a commit message
| Option | Description | Type | default |
| ----------------- | ------------------------------------------------------------------------ | --------- | ------- |
| `-p`, `--pattern` | Regex pattern to check the message against. | `string` | `` |
| `-m`, `--message` | Get message from command line instead of file. | `string` | `` |
| `-n`, `--no-fail` | If true only prints warning messages and do not exit with not zero code. | `boolean` | `false` |
##### Example usage
```bash
npx hook-cli checkCommitMessagePattern "$1" -p "HelloWorld"
```
```bash
npx hook-cli checkCommitMessagePattern .git/COMMIT_EDITMSG -p "HelloWorld"
```
```bash
npx hook-cli checkCommitMessagePattern -m "I say HelloWorld" -p "HelloWorld"
```
```bash
npx hook-cli checkCommitMessagePattern -m "I say HelloWorld" -p "HelloWorld" -n
```
#### checkForFileChanged
Check if a staged file like a changelog was changed locale or remote compared to another branch
| Option | Description | Type | default |
| ----------------- | ------------------------------------------------------------------------ | --------- | ------- |
| `-b`, `--branch` | Branch to compare to. | `string` | `main` |
| `-n`, `--no-fail` | If true only prints warning messages and do not exit with not zero code. | `boolean` | `true` |
##### Example usage
```bash
npx hook-cli checkForFileChanged CHANGELOG.md
```
```bash
npx hook-cli checkForFileChanged CHANGELOG.md -b trunk
```
```bash
npx hook-cli checkForFileChanged CHANGELOG.md -n
```
```bash
npx hook-cli checkForFileChanged CHANGELOG.md -b trunk -n
```
#### checkForVulnerabilities

@@ -60,4 +143,4 @@

| `-l`, `--audit-level` | The severity of the vulnerabilities what the script will report. | `info`, `low`, `moderate`, `high`, `critical` | `critical` |
| `-p`, `--prod` | If true only run audit for prod dependencies and skip dev ones. | `boolean` | `false` |
| `-n`, `--no-fail` | If true only prints warning messages and do not exit with not zero code. | `boolean` | `false` |
| `-p`, `--prod` | If true only run audit for prod dependencies and skip dev ones. | `boolean` | `false` |

@@ -90,2 +173,35 @@ ##### Example usage

#### checkPackageVersion
Check if the version field is the same for package.json and package-lock.json
| Option | Description | Type | default |
| ----------------- | ------------------------------------------------------------------------ | --------- | ------- |
| `-n`, `--no-fail` | If true only prints warning messages and do not exit with not zero code. | `boolean` | `false` |
##### Example usage
```bash
npx hook-cli checkPackageVersion
```
#### checkPackageVersionInFile
Check if the version field is the same for package.json and file
| Option | Description | Type | default |
| ------------------- | ------------------------------------------------------------------------ | --------- | ------- |
| `-p`, `--json-path` | Path in json file to check | `string` | `` |
| `-n`, `--no-fail` | If true only prints warning messages and do not exit with not zero code. | `boolean` | `false` |
##### Example usage
```bash
npx hook-cli checkPackageVersionInFile hello.json -p 'path.version'
```
```bash
npx hook-cli checkPackageVersionInFile hello.json -p 'path.version' -n
```
#### updateReminder

@@ -98,3 +214,3 @@

| `-m`, `--package-manager` | The package manager you want to use. Keep in mind that both package managers report differently. | `yarn`, `npm` | `npm` |
| `-f`, `--fail` | If true it will exit with a non zero in case of updates. | `boolean` | `false` |
| `-n`, `--no-fail` | If true only prints warning messages and do not exit with not zero code. | `boolean` | `false` |

@@ -108,11 +224,11 @@ ##### Example usage

```bash
npx hook-cli updateReminder - yarn
npx hook-cli updateReminder -m yarn
```
```bash
npx hook-cli updateReminder -f
npx hook-cli updateReminder -n
```
```bash
npx hook-cli updateReminder - yarn -f
npx hook-cli updateReminder -m yarn -n
```

@@ -119,0 +235,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc