npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

create-clean-codebase

v1.0.0

Published

NPM package to easily create starter codebases, with a clean, maintainable and easy to understand starting point.

Downloads

3

Readme

CreateCleanCodebase

npm version License

Create a clean and efficient starting point for any type of project! 🚀

CreateCleanCodebase simplifies the process of setting up new development projects by allowing you to select from a variety of well-structured templates. Whether you're starting a Next.js app, a Python script, or a Rust project, kickstart your development with a solid foundation.

Table of Contents

Installation

You can use CreateCleanCodebase without installing it globally:

npx create-clean-codebase@latest

Alternatively, install it globally via npm:

npm install -g create-clean-codebase

Usage

Run the following command to start creating your project:

npx create-clean-codebase

Follow the interactive prompts to select your desired template and customize it according to your needs.

Example

$ npx create-clean-codebase

Welcome to CreateCleanCodebase!

Select a template:
- NextJS
  - Basic
  - Supabase
- Python
  - Flask
  - Django
- Rust
  - CLI Tool
  - WebAssembly

What is the name of your project? my-nextjs-app

Creating your project...

Success! Your project 'my-nextjs-app' has been created.

Supported Templates

The following templates are currently available:

NextJS

  • Basic: A basic Next.js project with TypeScript support.
  • Supabase: Next.js with Supabase integration. (Work in Progress)

(More templates coming soon!)

Template Customization

Some templates support additional customization through user input. For example, when selecting the Basic NextJS template, you might be prompted to provide the project name:

What is the name of your project? my-project

Templates can include an init.js script that runs after the template files are copied. This script can modify files based on your input, allowing for dynamic customization of the generated codebase.

Creating Custom Templates

You can define custom templates for your own use or to contribute to the project. Templates are defined in the templateMappings.js file and their corresponding files are stored in the codebase directory.

Here's an example of how templates are mapped:

// templateMappings.js

const templateMappings = {
  templates: {
    NextJS: {
      Basic: {
        template: true,
        args: [
          {
            type: "input",
            name: "project-name",
            default: "my-project",
            message: "What is the name of your project?"
          },
        ],
        path: "templates/nextjs/typescript/basic/",
      },
      Supabase: {
        template: true,
        path: "templates/nextjs/typescript/supabase/",
      },
    },
  },
};

export default templateMappings;

Adding a New Template

  1. Create the Template Files: Add your template files to the appropriate directory within templates/<your_template_path>/codebase.

  2. Update templateMappings.js: Add your new template to the mappings, specifying any arguments and the path to the template files.

  3. (Optional) Add init.js: If your template requires post-processing, include an init.js script in the template directory. This script receives the rootPath of the created codebase and any user arguments as an object.

Contributing

Contributions are welcome! If you have ideas for new templates or improvements, feel free to open an issue or submit a pull request.

  1. Fork the repository.
  2. Create your feature branch: git checkout -b feature/YourFeature
  3. Commit your changes: git commit -am 'feature: Add your feature'
  4. Push to the branch: git push origin feature/YourFeature
  5. Open a pull request.

License

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


Happy Coding!