From 5db381f2f1efb76aaa7ccfc5464c3dc53ba49004 Mon Sep 17 00:00:00 2001 From: Dipendra Upreti Date: Wed, 21 Aug 2024 14:46:43 +0545 Subject: [PATCH 1/6] docs: add readme --- README.md | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ makefile | 10 +++------ 2 files changed, 65 insertions(+), 7 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..317e2de --- /dev/null +++ b/README.md @@ -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 +``` + +This command will create a directory with the name you provide as `Package name`. Navigate to this directory: + +```bash +cd +``` + +### 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. diff --git a/makefile b/makefile index 451fd4b..0065f5c 100644 --- a/makefile +++ b/makefile @@ -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" @@ -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 From 5df5ecf746db3becd57f8ff62a770914ece94a33 Mon Sep 17 00:00:00 2001 From: Dipendra Upreti Date: Wed, 21 Aug 2024 15:31:09 +0545 Subject: [PATCH 2/6] chore: update readme --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 317e2de..be72bdd 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,12 @@ This command will create a directory with the name you provide as `Package name` cd ``` +This command install the required dependencies and create a `pnpm-lock.yaml` file: + +```bash +make install +``` + ### Initialize git repository Initialize a Git repository in your new project directory: From 911c7103a9087b7aec3af295c194573e645a731c Mon Sep 17 00:00:00 2001 From: Dipendra Upreti Date: Wed, 21 Aug 2024 15:45:04 +0545 Subject: [PATCH 3/6] chore: rename package name from generator-package-monorepo to generator-library --- README.md | 4 ++-- package.json | 4 ++-- ship.config.cjs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index be72bdd..a5887a4 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ npm link Run the following command and follow the prompts to generate your monorepo setup: ```bash -yo package-monorepo +yo library ``` This command will create a directory with the name you provide as `Package name`. Navigate to this directory: @@ -62,7 +62,7 @@ git init To generate only the fastify plugin, use: ```bash -yo package-monorepo:fastify-plugin +yo library:fastify-plugin ``` This will create the fastify plugin setup without the rest of the monorepo structure. diff --git a/package.json b/package.json index 3f5493e..f9953ff 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "generator-package-monorepo", + "name": "generator-library", "version": "0.1.0", "description": "", "keywords": [ @@ -7,7 +7,7 @@ "yeoman-generator" ], "homepage": "", - "repository": "generator-package-monorepo", + "repository": "generator-library", "license": "MIT", "author": { "name": "12 Degres SAS", diff --git a/ship.config.cjs b/ship.config.cjs index 7d1c473..20396e4 100644 --- a/ship.config.cjs +++ b/ship.config.cjs @@ -1,5 +1,5 @@ module.exports = { - appname: "@dzangolab/generator-package-monorepo", + appname: "@dzangolab/generator-library", buildCommand: () => null, publishCommand: () => { return "npm publish --access public"; From cb15eb8db50f134871b67c6589796b234ea1a371 Mon Sep 17 00:00:00 2001 From: Dipendra Upreti Date: Wed, 21 Aug 2024 15:51:01 +0545 Subject: [PATCH 4/6] docs: update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a5887a4..58c88a4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Yeoman generator for package monorepo +# Yeoman generator for library -This Yeoman generator helps you set up a package monorepo with two available generators: `app` and `fastify-plugin`. +This Yeoman generator helps you set up a library (monorepo) with two available generators: `app` and `fastify-plugin`. ## Generators - **app**: sets up a new monorepo From 022459a7eccbdcaf8cc05942634bbe93647a82d7 Mon Sep 17 00:00:00 2001 From: Dipendra Upreti Date: Wed, 21 Aug 2024 15:53:07 +0545 Subject: [PATCH 5/6] docs: update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 58c88a4..47038f7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Yeoman generator for library -This Yeoman generator helps you set up a library (monorepo) with two available generators: `app` and `fastify-plugin`. +This yeoman generator helps set up a library (monorepo). ## Generators - **app**: sets up a new monorepo From 62f3ea5891608f99448caff10b961c09a21a747d Mon Sep 17 00:00:00 2001 From: Dipendra Upreti Date: Wed, 21 Aug 2024 15:54:17 +0545 Subject: [PATCH 6/6] chore: fix typo --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f9953ff..6dab516 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "repository": "generator-library", "license": "MIT", "author": { - "name": "12 Degres SAS", + "name": "12 Degree SAS", "email": "info@12deg.com", "url": "https://12deg.com" },