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

gluegun

Package Overview
Dependencies
Maintainers
2
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gluegun - npm Package Compare versions

Comparing version 0.8.0 to 0.9.0

2

package.json
{
"name": "gluegun",
"version": "0.8.0",
"version": "0.9.0",
"description": "Build yourself a pluggable CLI.",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -57,6 +57,9 @@ const print = require('../utils/print')

reject(isHidden),
map(command => [
command.name,
replace('$BRAND', context.runtime.brand, command.description || '-')
])
map(command => {
const alias = command.alias ? `(${command.alias})` : ''
return [
`${command.name} ${alias}`,
replace('$BRAND', context.runtime.brand, command.description || '-')
]
})
)(plugin)

@@ -63,0 +66,0 @@ }

@@ -51,2 +51,4 @@ const autobind = require('autobind-decorator')

runtime.commandDescriptionToken = this.commandDescriptionToken
runtime.commandHiddenToken = this.commandHiddenToken
runtime.commandAliasToken = this.commandAliasToken
runtime.extensionNameToken = this.extensionNameToken

@@ -152,2 +154,8 @@

break
case 'commandHidden':
this.commandHiddenToken = value
break
case 'commandAlias':
this.commandAliasToken = value
break
case 'extensionName':

@@ -154,0 +162,0 @@ this.extensionNameToken = value

@@ -207,3 +207,3 @@ const parseCommandLine = require('../cli/parse-command-line')

load (directory, options = {}) {
const { brand, extensionNameToken, commandNameToken, commandDescriptionToken } = this
const { brand, extensionNameToken, commandNameToken, commandDescriptionToken, commandHiddenToken, commandAliasToken } = this

@@ -213,2 +213,4 @@ const plugin = loadPluginFromDirectory(directory, {

commandNameToken,
commandHiddenToken,
commandAliasToken,
commandDescriptionToken,

@@ -295,3 +297,3 @@ brand,

return find(
(command) => startsWith(command.name, rawCommand)
(command) => startsWith(command.name, rawCommand) || rawCommand === command.alias
, plugin.commands

@@ -298,0 +300,0 @@ )

@@ -40,2 +40,4 @@ const { isNotFile } = require('../utils/filesystem-utils')

const commandDescriptionToken = options.commandDescriptionToken || 'gluegunCommandDescription'
const commandHiddenToken = options.commandHiddenToken || 'gluegunCommandHidden'
const commandAliasToken = options.commandAliasToken || 'gluegunCommandAlias'

@@ -65,3 +67,3 @@ // sanity check the input

// try reading in tokens embedded in the file
const tokens = findTokens(jetpack.read(file) || '', [commandNameToken, commandDescriptionToken])
const tokens = findTokens(jetpack.read(file) || '', [commandNameToken, commandDescriptionToken, commandHiddenToken, commandAliasToken])

@@ -71,2 +73,4 @@ // let's override if we've found these tokens

command.description = tokens[commandDescriptionToken] || command.description
command.alias = tokens[commandAliasToken] || command.alias
command.hidden = (tokens[commandHiddenToken] || command.hidden) === 'true'

@@ -73,0 +77,0 @@ // require in the module -- best chance to bomb is here

@@ -33,2 +33,4 @@ const jetpack = require('fs-jetpack')

commandNameToken,
commandHiddenToken,
commandAliasToken,
commandDescriptionToken,

@@ -73,3 +75,3 @@ extensionNameToken,

`${directory}/commands/${file}`,
{ commandNameToken, commandDescriptionToken }
{ commandNameToken, commandDescriptionToken, commandHiddenToken, commandAliasToken }
),

@@ -124,3 +126,5 @@ jetpackPlugin.cwd('commands').find({ matching: commandFilePattern, recursive: false })

// set the hidden bit
plugin.commands = map(assoc('hidden', hidden), plugin.commands)
if (hidden) {
plugin.commands = map(assoc('hidden', true), plugin.commands)
}

@@ -127,0 +131,0 @@ return plugin

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