Skip to content

Commit

Permalink
Merge pull request #48 from ipetinate/fix/options-mode-conflicts
Browse files Browse the repository at this point in the history
fix: Options mode conflicts with preset mode
  • Loading branch information
ipetinate authored May 10, 2024
2 parents b5e6051 + 2e62bae commit 9d5c1c3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"test:watch": "node --test --watch",
"test:coverage": "node --test --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=lcov.info",
"dev": "yarn build && clear && node src/main.js",
"dev:npx": "yarn build && npm link && clear && npx clingon gen"
"dev:npx": "yarn build && npm link && clear && npx clingon "
},
"dependencies": {
"@inquirer/prompts": "^4.3.2",
Expand Down
8 changes: 4 additions & 4 deletions src/actions/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ export async function createAction(resourceName, options) {
*/
let preset = options.preset

if (!options.type || !options.framework || !options.path) {
throw new Error('You did not pass any of the mandatory parameters for Options Mode')
}

if (!preset && options.framework) {
if (!options.type || !options.framework || !options.path) {
throw new Error('You did not pass any of the mandatory parameters for Options Mode')
}

let storyPath = options.path
let withStory = options.story

Expand Down
6 changes: 3 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ program
.command('create')
.argument('<name>', 'Resource name')
.option('--preset [preset]', 'Preset name')
.option('--type <resourceType>', 'Resource type: "function" | "page" | "component"')
.option('--type [resourceType]', 'Resource type: "function" | "page" | "component"')
.option('--vue-version [vueVersion]', 'Vue version: "2" | "3" (default: 3))', '3')
.option('--framework <frameworkName>', 'Framework name for default preset: vue or react')
.option('--framework [frameworkName]', 'Framework name for default preset: vue or react')
.option(
'--css-framework [cssFramework]',
'Style approach: "css_modules" | "tailwind_inline" | "tailwind_file" | "css_vanilla" | "scss" (default: no_style)',
Expand All @@ -61,7 +61,7 @@ program
TestFrameworkEnum.vitest
)
.option(
'--path <resourcePath>',
'--path [resourcePath]',
'Path to resource, use dot (".") to current dir where command is executed'
)
.option(
Expand Down

0 comments on commit 9d5c1c3

Please sign in to comment.