diff --git a/README.md b/README.md index 9537a96..eb8a605 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@

- Clingon CLI logo + + Clingon CLI logo +

[![Build CI](https://github.com/ipetinate/clingon/actions/workflows/node.js.yml/badge.svg?branch=main)](https://github.com/ipetinate/clingon/actions/workflows/node.js.yml) @@ -27,7 +29,10 @@ Let's simplify all of this, execute a command, answer some questions, or select ## Links -- Official website: [clingon.dev](https://clingon.dev) +

+ 🔗 Official website 🔗 +

+ - Releases - [CHANGELOG](https://github.com/ipetinate/clingon/blob/main/CHANGELOG.md) - Documentation diff --git a/src/actions/guided.js b/src/actions/guided.js index 46699ef..b4e3436 100644 --- a/src/actions/guided.js +++ b/src/actions/guided.js @@ -26,7 +26,7 @@ export async function guidedAction(resourceName) { /** * Selected preset * - * @type {string } + * @type { string | boolean } */ let preset = false diff --git a/src/main.js b/src/main.js index 2992b5d..7495632 100755 --- a/src/main.js +++ b/src/main.js @@ -2,12 +2,12 @@ import { Command } from 'commander' +import { initAction } from './actions/init.js' import { guidedAction } from './actions/guided.js' import { createAction } from './actions/create.js' import { getLocalLibDirname } from './utils/directory.js' import { TestFrameworkEnum } from './enums/frameworks.js' -import { initAction } from './actions/init.js' /* * Global Variables @@ -26,81 +26,81 @@ const program = new Command() */ program - .name('clingon') - .description('CLI to generate files based on templates') - .version('0.9.0', '-v, --version', 'Current version') + .name('clingon') + .description('CLI to generate files based on templates') + .version('0.9.0', '-v, --version', 'Current version') /* * Guided flow - generate components based on prompt answers */ program - .command('gen') - .argument('[name]', 'Resource name') - .action(guidedAction) - .description('Start a guided flow to generate resources (components, functions, pages, etc)') + .command('gen') + .argument('[name]', 'Resource name') + .action(guidedAction) + .description('Start a guided flow to generate resources (components, functions, pages, etc)') /* * Preset flow - create instantly resources with presets */ program - .command('create') - .argument('', 'Resource name') - .option('--preset [preset]', 'Preset name') - .option('--type ', '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( - '--css-framework [cssFramework]', - 'Style approach: "css_modules" | "tailwind_inline" | "tailwind_file" | "css_vanilla" | "scss" (default: no_style)', - 'no_style' - ) - .option( - '--test-framework [testFrameworkName]', - 'Test framework: jest or vitest (default: vitest)', - TestFrameworkEnum.vitest - ) - .option( - '--path ', - 'Path to resource, use dot (".") to current dir where command is executed' - ) - .option( - '--test-path [testPath]', - 'Path to test, use dot (".") to current dir where command is executed, if ommited, and --spec is present, will use the same path to resource' - ) - .option( - '--story-path [storyPath]', - 'Path to story, use dot (".") to current dir where command is executed, if ommited, and --spec is present, will use the same path to resource' - ) - .option('--typescript', 'With TypeScript (default: false)', false) - .option('--testing-library', 'With Testing Library (default: false)', false) - .option('--test', 'Add test file (default: false)', false) - .option('--spec', 'Add spec file (default: false)', false) - .option('--story', 'Add story file (default: false)', false) - .option( - '--folder-wrapper', - 'Creates a folder with the name of the resource, with the files inside it', - false - ) - .action(createAction) - .usage('create --preset ') - .usage( - 'create --type (component | page | function) --framework (--test | --spec) --typescript --folder-wrapper --story --test-framework (vitest | jest)' - ) - .description( - 'Creates the resources with a local preset in non-verbose mode (preview and ask to confirm are not shown, resources will be created immediately), if the preset folder is empty, it will call the guided flow (the same as the `gen` command executes)' - ) + .command('create') + .argument('', 'Resource name') + .option('--preset [preset]', 'Preset name') + .option('--type ', '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( + '--css-framework [cssFramework]', + 'Style approach: "css_modules" | "tailwind_inline" | "tailwind_file" | "css_vanilla" | "scss" (default: no_style)', + 'no_style' + ) + .option( + '--test-framework [testFrameworkName]', + 'Test framework: jest or vitest (default: vitest)', + TestFrameworkEnum.vitest + ) + .option( + '--path ', + 'Path to resource, use dot (".") to current dir where command is executed' + ) + .option( + '--test-path [testPath]', + 'Path to test, use dot (".") to current dir where command is executed, if ommited, and --spec is present, will use the same path to resource' + ) + .option( + '--story-path [storyPath]', + 'Path to story, use dot (".") to current dir where command is executed, if ommited, and --spec is present, will use the same path to resource' + ) + .option('--typescript', 'With TypeScript (default: false)', false) + .option('--testing-library', 'With Testing Library (default: false)', false) + .option('--test', 'Add test file (default: false)', false) + .option('--spec', 'Add spec file (default: false)', false) + .option('--story', 'Add story file (default: false)', false) + .option( + '--folder-wrapper', + 'Creates a folder with the name of the resource, with the files inside it', + false + ) + .action(createAction) + .usage('create --preset ') + .usage( + 'create --type (component | page | function) --framework (--test | --spec) --typescript --folder-wrapper --story --test-framework (vitest | jest)' + ) + .description( + 'Creates the resources with a local preset in non-verbose mode (preview and ask to confirm are not shown, resources will be created immediately), if the preset folder is empty, it will call the guided flow (the same as the `gen` command executes)' + ) /* * Init tool assets, generate clingon.config.json */ program - .command('init') - .actions(initAction) - .usage('init') - .description('Init all needed setup, generate files and create folders to store assets.') + .command('init') + .action(initAction) + .usage('init') + .description('Init all needed setup, generate files and create folders to store assets.') /* * Parse program to execution