Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: add readme #6

Merged
merged 8 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# 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
rameshlohala marked this conversation as resolved.
Show resolved Hide resolved
dipendraupreti marked this conversation as resolved.
Show resolved Hide resolved
```

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
rameshlohala marked this conversation as resolved.
Show resolved Hide resolved
```

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