Skip to content

Commit

Permalink
add yargs type to createYargsForComponentGeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkPollmann committed May 19, 2020
1 parent 94d1aee commit ff73a53
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@types/listr": "^0.14.2",
"@types/node-fetch": "^2.5.5",
"@types/pluralize": "^0.0.29",
"@types/yargs": "^15.0.5",
"rimraf": "^3.0.2"
},
"scripts": {
Expand Down
7 changes: 4 additions & 3 deletions packages/cli/src/commands/generate/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import pluralize from 'pluralize'
import Listr from 'listr'
import pascalcase from 'pascalcase'
import { paramCase } from 'param-case'
import { CommandModule } from 'yargs'

import { generateTemplate, getPaths, writeFilesTask } from 'src/lib'
import c from 'src/lib/colors'
Expand Down Expand Up @@ -76,12 +77,12 @@ export const createYargsForComponentGeneration = ({
}: {
componentName: 'cell' | 'component' | 'function' | 'layout' | 'service'
filesFn: Function
}) => {
}): CommandModule => {
return {
command: `${componentName} <name>`,
desc: `Generate a ${componentName} component.`,
describe: `Generate a ${componentName} component.`,
builder: { force: { type: 'boolean', default: false } },
handler: async ({ force, ...rest }: { force: boolean }) => {
handler: async ({ force, ...rest }) => {
const tasks = new Listr(
[
{
Expand Down
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2937,6 +2937,13 @@
dependencies:
"@types/yargs-parser" "*"

"@types/yargs@^15.0.5":
version "15.0.5"
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.5.tgz#947e9a6561483bdee9adffc983e91a6902af8b79"
integrity sha512-Dk/IDOPtOgubt/IaevIUbTgV7doaKkoorvOyYM2CMwuDyP89bekI7H4xLIwunNYiK9jhCkmc6pUrJk3cj2AB9w==
dependencies:
"@types/yargs-parser" "*"

"@types/zen-observable@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.0.tgz#8b63ab7f1aa5321248aad5ac890a485656dcea4d"
Expand Down

0 comments on commit ff73a53

Please sign in to comment.