1.2.2 • Published 6 months ago

next-utils-cli v1.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Next Utils CLI

Test GitHub license

Next Utils CLI is a command-line tool exclusively designed for the new Next.js App router, streamlining the creation of routes, pages, and components in your Next.js application. You can also use Next Utils CLI to clean up the boilerplate code from the home page.

Features

  • Quickly generate Next.js routes, pages, and components.
  • Create routes with various HTTP methods (GET, POST, PUT, PATCH, DELETE, OPTIONS).
  • Choose between different function types for components.
  • Choice to opt in to client rendering for components and pages.
  • Easily customize the path and name for your files.
  • Recursive directory creation for an organized codebase.
  • When using the page and component commands, function components are camel-cased by default within those created pages and components.
  • Clean up the boilerplate code from the home page with the clean-home-page command.

Installation

You can install Next Utils CLI globally using npm:

npm install -g next-utils-cli

Usage

To use Next Utils CLI, simply run the desired command:

next-utils route
next-utils page
next-utils component
next-utils clean-home-page

Next Utils CLI will guide you through the process of creating routes, pages, and components with interactive prompts.

Additional Information

  • When creating a page, and a route you can only select the app directory as the base.
  • For components and pages, you'll be prompted to choose a function type (arrow function or function declaration).
  • When creating a route, you have the flexibility to select multiple HTTP methods to associate with it.
  • When attempting to overwrite an existing directory you will be prompted to confirm the overwrite.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributions

Contributions are welcome! If you have ideas for improvements or encounter issues, please open an issue or submit a pull request.

How to Contribute

  1. Fork the Repository: Click the "Fork" button on the GitHub page to create your copy of the project.

  2. Clone Your Fork: In your terminal, run the following command, replacing [your-username] with your GitHub username:

    git clone https://github.com/[your-username]/next-utils-cli.git
  3. Install Dependencies:

    npm install
  4. Make Changes: Create a new branch for your changes, make improvements or fixes, and commit your work:

    git checkout -b my-fix
    # or
    git switch -c my-fix
  5. Run the Project:

Run the following command to make sure project is running properly:

npm run next-utils -- -h

If you want to test in another directory:

npm run build test

npm link

# In your test directory
npm link next-utils-cli

# Then run the command
next-utils [command]
  1. Add Tests (if necessary) and Run Them:

    npm run test
  2. Push Your Changes to GitHub: Commit your changes and push them to GitHub. Then, open a pull request against the main branch.

    git add .
    git commit -m "Fix: Describe your fix or feature"

Links

TODO

  • Add examples to README.md
1.2.2

6 months ago

1.2.1

6 months ago

1.2.0

6 months ago

1.1.1

6 months ago

1.1.0

6 months ago

1.0.3

6 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago

0.0.61

7 months ago

0.0.60

7 months ago

0.0.59

7 months ago

0.0.58

7 months ago

0.0.57

7 months ago

0.0.56

7 months ago

0.0.55

7 months ago

0.0.54

7 months ago

0.0.53

7 months ago

0.0.52

7 months ago

0.0.51

7 months ago