1.1.1 • Published 1 year ago
next-component-cli v1.1.1
next-component-cli
This is package for create new component
Quick Start
Install via NPM:
# Using NPM
$ npm i next-component-cli
# or, using PNPM:
$ pnpm i next-component-cliReference
This package has several options for generating files.
-i = {ComponentName}.tsx
-t = {ComponentName}.types.ts
-h = {ComponentName}.hooks.ts
-c = {ComponentName}.constants.ts
-s = {ComponentName}.schemas.ts
-all = generate all filesYou can create a folder structure according to what you want to create.
cd into your project's directory, and try creating a new component:
$ new-component NewComponentYour project will now have a new directory has five files index , view, types, hooks, constants:
// `NewComponent/index.tsx`
import NewComponent from './NewComponent';
export default NewComponent;$ new-component <ComponentName> <Option>
$ new-component NewComponent -all
# or
$ new-component NewComponent -i -t -c -h -s$ new-component <ComponentName> -d <Path>
$ new-component NewComponent -d features/parent-folder/views $ new-component <ComponentName> <Path> <Option>
$ new-component NewComponent -d features/parent-folder/views -all
# or
$ new-component NewComponent -d features/parent-folder/views -i -t -c -h -sThese files will be formatted according to your Prettier configuration.