Skip to content

Commit

Permalink
fix(deps): Updates cli-table, cosmiconfig, ejs, execa, and fs-jetpack (
Browse files Browse the repository at this point in the history
…#741 by @jamonholmgren)

BREAKING CHANGE: Updates cli-table, cosmiconfig, ejs, execa, and fs-jetpack major (breaking) versions

* Also updates other dependencies to minor or patch versions
  • Loading branch information
jamonholmgren committed Jan 21, 2022
1 parent c33f24f commit ee9d84a
Show file tree
Hide file tree
Showing 58 changed files with 4,487 additions and 5,327 deletions.
12 changes: 5 additions & 7 deletions .circleci/cleanDir.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ if (targetDir == null || !existsSync(targetDir)) {
throw Error('You must provider a valid path to clean.')
}

const getChildren = dir => readdirSync(dir).map(name => path.join(dir, name))
const stat = path => ({
const getChildren = (dir) => readdirSync(dir).map((name) => path.join(dir, name))
const stat = (path) => ({
path,
isDir: statSync(path).isDirectory(),
})
Expand All @@ -22,12 +22,10 @@ const isEmpty = ({ path, isDir }) => {
}
}

for (const { path, isDir } of getChildren(targetDir)
.map(stat)
.filter(isEmpty)) {
for (const { path, isDir } of getChildren(targetDir).map(stat).filter(isEmpty)) {
if (isDir) {
rmdir(path, err => (!!err ? console.log(err) : null))
rmdir(path, (err) => (!!err ? console.log(err) : null))
} else {
unlink(path, err => (!!err ? console.log(err) : null))
unlink(path, (err) => (!!err ? console.log(err) : null))
}
}
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
defaults: &defaults
docker:
# Choose the version of Node you want here
- image: circleci/node:10.18
- image: circleci/node:14.17
working_directory: ~/repo

version: 2
Expand Down
2 changes: 1 addition & 1 deletion .circleci/createDirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const directFiles = [
const fs = require('fs')

// add all the direct access files
directFiles.forEach(f => {
directFiles.forEach((f) => {
const filename = __dirname + '/../' + f + '.js'
fs.writeFileSync(filename, `module.exports = require('./build/${f}')\n`)
})
Expand Down
3 changes: 2 additions & 1 deletion .circleci/removeDirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ const directFiles = [
'patching',
'prompt',
'package-manager',
'toolbox',
]
const fs = require('fs')
directFiles.forEach(f => {
directFiles.forEach((f) => {
const filename = __dirname + '/../' + f + '.js'
if (fs.existsSync(filename)) fs.unlinkSync(filename)
})
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ semver.js
http.js
patching.js
prompt.js
package-manager.js
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pool:
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
versionSpec: '14.x'
displayName: 'Install Node.js'

- script: |
Expand Down
52 changes: 26 additions & 26 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@

Gluegun is a delightful toolkit for building Node-based command-line interfaces (CLIs) in TypeScript or modern JavaScript, with support for:

🌯 *parameters* - command-line arguments and options<br />
🎛 *template* - generating files from templates<br />
🗄 *patching* - manipulating file contents<br />
💾 *filesystem* - moving files and directories around<br />
*system* - executing other command-line scripts<br />
🎅 *http* - interacting with API servers<br />
🛎 *prompt* - auto-complete prompts<br />
💃 *print* - printing pretty colors and tables<br />
👩‍✈️ *semver* - working with semantic versioning<br />
🎻 *strings* - manipulating strings & template data<br />
📦 *packageManager* - installing NPM packages with Yarn or NPM<br />
🌯 _parameters_ - command-line arguments and options<br />
🎛 _template_ - generating files from templates<br />
🗄 _patching_ - manipulating file contents<br />
💾 _filesystem_ - moving files and directories around<br />
_system_ - executing other command-line scripts<br />
🎅 _http_ - interacting with API servers<br />
🛎 _prompt_ - auto-complete prompts<br />
💃 _print_ - printing pretty colors and tables<br />
👩‍✈️ _semver_ - working with semantic versioning<br />
🎻 _strings_ - manipulating strings & template data<br />
📦 _packageManager_ - installing NPM packages with Yarn or NPM<br />

In addition, `gluegun` supports expanding your CLI's ecosystem with a robust set of easy-to-write plugins and extensions.

# Why use Gluegun?

You might want to use Gluegun if:

* You need to build a CLI app
* You want to have powerful tools at your fingertips
* And you don't want to give up flexibility at the same time
- You need to build a CLI app
- You want to have powerful tools at your fingertips
- And you don't want to give up flexibility at the same time

If so ... welcome!

Expand Down Expand Up @@ -65,7 +65,7 @@ const { build } = require('gluegun')

// aim
const movieCLI = build('movie')
.src(`${__dirname}/core-plugins`)
.src(`${__dirname}/src`)
.plugins('node_modules', { matching: 'movie-*' })
.help()
.version()
Expand All @@ -85,7 +85,7 @@ Commands are simple objects that provide a name, optional aliases, and a functio
module.exports = {
name: 'foo',
alias: 'f',
run: async function(toolbox) {
run: async function (toolbox) {
// gluegun provides all these features and more!
const { system, print, filesystem, strings } = toolbox

Expand All @@ -99,7 +99,7 @@ module.exports = {
print.info(`${print.checkmark} Citius`)
print.warning(`${print.checkmark} Altius`)
print.success(`${print.checkmark} Fortius`)
}
},
}
```

Expand All @@ -109,12 +109,12 @@ See the [runtime docs](./docs/runtime.md) for more details on building your own

# Who Is Using This?

* [Ignite CLI](https://github.com/infinitered/ignite) - React Native CLI and starter kit
* [Solidarity](https://github.com/infinitered/solidarity) - audits your system dependencies so you can develop in peace
* [AWS Amplify CLI](https://github.com/aws-amplify/amplify-cli) - A CLI toolchain for simplifying serverless web and mobile development
* [Sara Vieira's Fiddly](https://github.com/SaraVieira/fiddly) - Create beautiful and simple HTML pages from your Readme.md files - [https://fiddly.netlify.com](https://fiddly.netlify.com)
* [Graph CLI](https://github.com/graphprotocol/graph-cli) - CLI for building and managing subgraphs that index data from Ethereum and IPFS - [https://thegraph.com/explorer](https://thegraph.com/explorer)
* [Vts](https://github.com/snowfrogdev/Vts) - Vanilla TypeScript library starter CLI tool
- [Ignite CLI](https://github.com/infinitered/ignite) - React Native CLI and starter kit
- [Solidarity](https://github.com/infinitered/solidarity) - audits your system dependencies so you can develop in peace
- [AWS Amplify CLI](https://github.com/aws-amplify/amplify-cli) - A CLI toolchain for simplifying serverless web and mobile development
- [Sara Vieira's Fiddly](https://github.com/SaraVieira/fiddly) - Create beautiful and simple HTML pages from your Readme.md files - [https://fiddly.netlify.com](https://fiddly.netlify.com)
- [Graph CLI](https://github.com/graphprotocol/graph-cli) - CLI for building and managing subgraphs that index data from Ethereum and IPFS - [https://thegraph.com/explorer](https://thegraph.com/explorer)
- [Vts](https://github.com/snowfrogdev/Vts) - Vanilla TypeScript library starter CLI tool

# What's under the hood?

Expand All @@ -131,14 +131,14 @@ We've assembled an _all-star cast_ of libraries to help you build your CLI.
⭐️ [node-which](https://github.com/npm/node-which) for finding executables</br>
⭐️ [pluralize](https://github.com/blakeembrey/pluralize) for manipulating strings</br>

[Node.js 8.0+](https://nodejs.org) is required. If you need to support Node 7.6, use Gluegun 3.x.
[Node.js 12.0+](https://nodejs.org) is required.

## Community CLIs and Plugins

Here are a few community CLIs based on Gluegun plus some plugins you can use. Is yours missing? Send a PR to add it!

* [Gluegun-Menu](https://github.com/lenneTech/gluegun-menu) - A command menu for Gluegun-based CLIs
* [Gluegun CLI-Starter](https://github.com/lenneTech/cli-starter) - A CLI Starter for your next Gluegun CLI project
- [Gluegun-Menu](https://github.com/lenneTech/gluegun-menu) - A command menu for Gluegun-based CLIs
- [Gluegun CLI-Starter](https://github.com/lenneTech/cli-starter) - A CLI Starter for your next Gluegun CLI project

## Sponsors

Expand Down
4 changes: 2 additions & 2 deletions docs/toolbox-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Let's explore the inside of the famous Gluegun "Toolbox" (or "Context" as it's s
module.exports = {
name: 'dostuff',
alias: 'd',
run: async function(toolbox) {
run: async function (toolbox) {
// great! now what?
},
}
Expand Down Expand Up @@ -36,7 +36,7 @@ The `toolbox` has "drawers" full of useful tools for building CLIs. For example,
module.exports = {
name: 'dostuff',
alias: 'd',
run: async function(toolbox) {
run: async function (toolbox) {
// use them like this...
toolbox.print.info(toolbox.meta.version())

Expand Down
1 change: 0 additions & 1 deletion package-manager.js

This file was deleted.

115 changes: 59 additions & 56 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"windows:test": "yarn && yarn format && yarn test && yarn clean-build && yarn compile && yarn copy-templates && jest --config=./.circleci/jest-integration.config.json",
"ci:test": "yarn lint && yarn test --maxWorkers=2 && yarn integration",
"ci:publish": "yarn build && yarn semantic-release",
"semantic-release": "semantic-release"
"semantic-release": "semantic-release",
"prepare": "husky install"
},
"author": {
"name": "Infinite Red, Inc.",
Expand Down Expand Up @@ -53,14 +54,14 @@
"dependencies": {
"apisauce": "^2.1.5",
"app-module-path": "^2.2.0",
"cli-table3": "~0.5.0",
"colors": "1.3.3",
"cosmiconfig": "6.0.0",
"cross-spawn": "^7.0.0",
"ejs": "^2.6.1",
"enquirer": "2.3.4",
"execa": "^3.0.0",
"fs-jetpack": "^2.2.2",
"cli-table3": "0.6.0",
"colors": "1.4.0",
"cosmiconfig": "7.0.1",
"cross-spawn": "7.0.3",
"ejs": "3.1.6",
"enquirer": "2.3.6",
"execa": "5.1.1",
"fs-jetpack": "4.3.0",
"lodash.camelcase": "^4.3.0",
"lodash.kebabcase": "^4.1.1",
"lodash.lowercase": "^4.3.0",
Expand All @@ -76,45 +77,45 @@
"lodash.trimstart": "^4.5.1",
"lodash.uppercase": "^4.3.0",
"lodash.upperfirst": "^4.3.1",
"ora": "^4.0.0",
"ora": "4.0.2",
"pluralize": "^8.0.0",
"semver": "^7.0.0",
"which": "^2.0.0",
"yargs-parser": "^16.1.0"
"semver": "7.3.5",
"which": "2.0.2",
"yargs-parser": "^21.0.0"
},
"devDependencies": {
"@semantic-release/git": "9.0.0",
"@types/cli-table2": "0.2.2",
"@types/jest": "25.1.1",
"@types/node": "12.12.26",
"@semantic-release/git": "10.0.1",
"@types/cli-table2": "0.2.3",
"@types/jest": "27.4.0",
"@types/node": "16.11.12",
"@types/pluralize": "0.0.29",
"@types/sinon": "7.5.1",
"@typescript-eslint/eslint-plugin": "2.18.0",
"@typescript-eslint/parser": "2.18.0",
"cpy-cli": "3.0.0",
"eslint": "6.8.0",
"eslint-config-prettier": "6.10.0",
"eslint-config-standard": "14.1.0",
"eslint-plugin-import": "2.20.0",
"eslint-plugin-jest": "23.6.0",
"eslint-plugin-node": "11.0.0",
"eslint-plugin-promise": "4.2.1",
"eslint-plugin-standard": "4.0.1",
"expect": "24.9.0",
"husky": "4.2.1",
"jest": "24.9.0",
"jest-mock": "24.9.0",
"lint-staged": "9.5.0",
"@types/sinon": "10.0.6",
"@typescript-eslint/eslint-plugin": "5.6.0",
"@typescript-eslint/parser": "5.6.0",
"cpy-cli": "3.1.1",
"eslint": "8.4.1",
"eslint-config-prettier": "8.3.0",
"eslint-config-standard": "16.0.3",
"eslint-plugin-import": "2.25.3",
"eslint-plugin-jest": "25.3.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "5.2.0",
"eslint-plugin-standard": "5.0.0",
"expect": "27.4.2",
"husky": "^7.0.0",
"jest": "27.4.7",
"jest-mock": "27.4.6",
"lint-staged": "12.1.2",
"mock-stdin": "1.0.0",
"prettier": "1.19.1",
"rimraf": "3.0.0",
"semantic-release": "17.0.1",
"sinon": "7.5.0",
"strip-ansi": "6.0.0",
"prettier": "2.5.1",
"rimraf": "3.0.2",
"semantic-release": "18.0.1",
"sinon": "12.0.1",
"strip-ansi": "6.0.1",
"temp-write": "4.0.0",
"ts-jest": "24.3.0",
"ts-node": "8.6.2",
"typescript": "3.8.3",
"ts-jest": "^27.1.3",
"ts-node": "10.4.0",
"typescript": "4.5.2",
"unique-temp-dir": "1.0.0"
},
"jest": {
Expand Down Expand Up @@ -155,13 +156,23 @@
"eslint:recommended",
"eslint-config-standard",
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/@typescript-eslint"
"prettier"
],
"rules": {
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-var-requires": 0
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-namespace": 0,
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
],
"node/no-path-concat": 0,
"no-use-before-define": 0
},
"overrides": [
{
Expand All @@ -184,16 +195,13 @@
"lint-staged": {
"*.ts": [
"prettier --write",
"eslint --fix",
"git add"
"eslint --fix"
],
"*.md": [
"prettier --write",
"git add"
"prettier --write"
],
"*.json": [
"prettier --write",
"git add"
"prettier --write"
]
},
"release": {
Expand All @@ -210,10 +218,5 @@
}
]
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
}
Loading

0 comments on commit ee9d84a

Please sign in to comment.