Skip to content

Commit

Permalink
docs: add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dipendraupreti committed Aug 21, 2024
1 parent a7491a8 commit cc1b0fb
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 7 deletions.
61 changes: 61 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Yeoman generator for package monorepo

This Yeoman generator helps you set up a package monorepo with two available generators: `app` and `fastify-plugin`.

# Generators
- **app**: sets up a new monorepo
- **fastify-plugin**: sets up a fastify plugin within the monorepo

# Requirements
- [yo](https://github.com/yeoman/yo)
- [shipjs](https://github.com/algolia/shipjs) (optional, for deployment purposes)

To install `shipjs` and `yo` globally, run:

```bash
npm install -g shipjs yo
```

# Installation
1. Clone this repo locally and navigate to the project directory and install dependencies:

```bash
make install
```

2. Link this generator locally so that the `yo` command can recognize it:

```bash
npm link
```

# Usage

## Generate the monorepo
Run the following command and follow the prompts to generate your monorepo setup:

```bash
yo package-monorepo
```

This command will create a directory with the name you provide as `Package name`. Navigate to this directory:

```bash
cd <Package name>
```

## Initialize git repository

Initialize a Git repository in your new project directory:

```bash
git init
```

## Generate a fastify plugin only (experimental)
To generate only the Fastify plugin, use:

```bash
yo package-monorepo:fastify-plugin
```
This will create the fastify plugin setup without the rest of the monorepo structure.
10 changes: 3 additions & 7 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ install:

lint:
@printf "\033[0;32m>>> Lint code\033[0m\n"
npm lint
npm run lint

lint.fix:
@printf "\033[0;32m>>> Lint code\033[0m\n"
npm lint:fix
npm run lint:fix

outdated:
@printf "\033[0;32m>>> Check for outdated dependencies\033[0m\n"
Expand All @@ -27,8 +27,4 @@ release:

sort-package:
@printf "\033[0;32m>>> Format package.json\033[0m\n"
npm sort-package

typecheck:
@printf "\033[0;32m>>> Running Type check\033[0m\n"
npm typecheck
npm run sort-package

0 comments on commit cc1b0fb

Please sign in to comment.