diff --git a/package.json b/package.json index a2b1ba7..3808b80 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/actions/create.js b/src/actions/create.js index 59883c2..f352650 100644 --- a/src/actions/create.js +++ b/src/actions/create.js @@ -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 diff --git a/src/main.js b/src/main.js index 07945f0..77424c2 100755 --- a/src/main.js +++ b/src/main.js @@ -47,9 +47,9 @@ program .command('create') .argument('', 'Resource name') .option('--preset [preset]', 'Preset name') - .option('--type ', '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 ', '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)', @@ -61,7 +61,7 @@ program TestFrameworkEnum.vitest ) .option( - '--path ', + '--path [resourcePath]', 'Path to resource, use dot (".") to current dir where command is executed' ) .option(