From f7bc4612f6c3f45ce1fad5d3ddceef8562aadd3e Mon Sep 17 00:00:00 2001 From: Josu Martinez <6097850+Josuto@users.noreply.github.com> Date: Tue, 10 Oct 2023 15:14:02 +0200 Subject: [PATCH] fix: rename 'node-abstract-repository' refs to monguito --- examples/nestjs-mongoose-book-manager/README.md | 11 +++++------ examples/nestjs-mongoose-book-manager/package.json | 4 ++-- .../src/book.repository.ts | 2 +- .../nestjs-mongoose-book-manager/src/book.schemas.ts | 2 +- examples/nestjs-mongoose-book-manager/src/book.ts | 2 +- examples/nestjs-mongoose-book-manager/yarn.lock | 10 ++++------ monguito.code-workspace | 8 ++++++++ package.json | 4 ++-- 8 files changed, 24 insertions(+), 19 deletions(-) create mode 100644 monguito.code-workspace diff --git a/examples/nestjs-mongoose-book-manager/README.md b/examples/nestjs-mongoose-book-manager/README.md index 8437aaf..0149f73 100644 --- a/examples/nestjs-mongoose-book-manager/README.md +++ b/examples/nestjs-mongoose-book-manager/README.md @@ -1,13 +1,12 @@ -This is an example of how to use the `node-abstract-repository` library in a NestJS application that uses MongoDB. It -is a dummy book manager that exposes three simple endpoints i.e., create, update, and delete a book, as well as list all +This is an example of how to use `monguito` in a NestJS application that uses MongoDB. It is a dummy book +manager that exposes three simple endpoints i.e., create, update, and delete a book, as well as list all books. A book may be of type `Book` or any of its subtypes i.e., `PaperBook` and `AudioBook`. > **Warning** > > Some basic knowledge on [NestJS](https://docs.nestjs.com/) is assumed, as well as that you have read the main -> documentation of [node-abstract-repository](../../README.md). The goal of this documentation is not to provide a -> comprehensive guide on the `node-abstract-repository` library usage. Thus, you may want to check -> the [sample application code](./src) as you go reading. +> documentation of [monguito](../../README.md). The goal of this documentation is not to provide a comprehensive +guide on `monguito` usage. Thus, you may want to check the [sample application code](./src) as you go reading. # Main Contents @@ -222,7 +221,7 @@ e.g., [Domain-Driven Design (tactical design)](https://enterprisecraftsmanship.c I have decided not to do so for simplicity purposes; the book manager presented here is such an extremely simple CRUD application that introducing services would be over-engineering. I rather implement the minimum amount of code necessary for the sake of maximising the actual purpose of this documentation: illustrate how to integrate -the `node-abstract-repository` library on a NodeJS-based enterprise application. +`monguito` on a NodeJS-based enterprise application. Moreover, you would probably not write a `deserialise` function to enable the transformation of JSON request bodies into domain objects when dealing with `POST` requests. Instead, you would rather use diff --git a/examples/nestjs-mongoose-book-manager/package.json b/examples/nestjs-mongoose-book-manager/package.json index 6e24722..fa2ca4b 100644 --- a/examples/nestjs-mongoose-book-manager/package.json +++ b/examples/nestjs-mongoose-book-manager/package.json @@ -1,7 +1,7 @@ { "name": "nestjs-mongoose-book-manager", "version": "0.2.0", - "description": "Sample NestJS application that uses the node-abstract-repository library.", + "description": "Sample NestJS application that uses monguito.", "author": "Josu Martinez", "private": true, "license": "MIT", @@ -29,7 +29,7 @@ "@nestjs/platform-express": "^9.0.0", "class-transformer": "^0.5.1", "mongoose": "^7.5.0", - "node-abstract-repository": "link:../../", + "monguito": "link:../../", "reflect-metadata": "^0.1.13", "rxjs": "^7.2.0", "typescript-optional": "^3.0.0-alpha.3" diff --git a/examples/nestjs-mongoose-book-manager/src/book.repository.ts b/examples/nestjs-mongoose-book-manager/src/book.repository.ts index e896b6f..e596a40 100644 --- a/examples/nestjs-mongoose-book-manager/src/book.repository.ts +++ b/examples/nestjs-mongoose-book-manager/src/book.repository.ts @@ -2,7 +2,7 @@ import { IllegalArgumentException, MongooseRepository, Repository, -} from 'node-abstract-repository'; +} from 'monguito'; import { AudioBook, Book, PaperBook } from './book'; import { AudioBookSchema, BookSchema, PaperBookSchema } from './book.schemas'; import { Injectable } from '@nestjs/common'; diff --git a/examples/nestjs-mongoose-book-manager/src/book.schemas.ts b/examples/nestjs-mongoose-book-manager/src/book.schemas.ts index 7ad4619..ec8602e 100644 --- a/examples/nestjs-mongoose-book-manager/src/book.schemas.ts +++ b/examples/nestjs-mongoose-book-manager/src/book.schemas.ts @@ -1,4 +1,4 @@ -import { BaseSchema, extendSchema } from 'node-abstract-repository'; +import { BaseSchema, extendSchema } from 'monguito'; export const BookSchema = extendSchema( BaseSchema, diff --git a/examples/nestjs-mongoose-book-manager/src/book.ts b/examples/nestjs-mongoose-book-manager/src/book.ts index 8f16e31..f227ca5 100644 --- a/examples/nestjs-mongoose-book-manager/src/book.ts +++ b/examples/nestjs-mongoose-book-manager/src/book.ts @@ -1,4 +1,4 @@ -import { Entity } from 'node-abstract-repository'; +import { Entity } from 'monguito'; export class Book implements Entity { readonly id?: string; diff --git a/examples/nestjs-mongoose-book-manager/yarn.lock b/examples/nestjs-mongoose-book-manager/yarn.lock index 2be0b4e..de4d0f3 100644 --- a/examples/nestjs-mongoose-book-manager/yarn.lock +++ b/examples/nestjs-mongoose-book-manager/yarn.lock @@ -4659,6 +4659,10 @@ mongoose@^7.1.1, mongoose@^7.5.0: ms "2.1.3" sift "16.0.1" +"monguito@link:../..": + version "0.0.0" + uid "" + mpath@0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/mpath/-/mpath-0.9.0.tgz#0c122fe107846e31fc58c75b09c35514b3871904" @@ -4736,12 +4740,6 @@ node-abort-controller@^3.0.1: resolved "https://registry.yarnpkg.com/node-abort-controller/-/node-abort-controller-3.1.1.tgz#a94377e964a9a37ac3976d848cb5c765833b8548" integrity sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ== -"node-abstract-repository@link:../..": - version "2.7.0" - dependencies: - mongoose "^7.1.1" - typescript-optional "^3.0.0-alpha.3" - node-emoji@1.11.0: version "1.11.0" resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.11.0.tgz#69a0150e6946e2f115e9d7ea4df7971e2628301c" diff --git a/monguito.code-workspace b/monguito.code-workspace new file mode 100644 index 0000000..876a149 --- /dev/null +++ b/monguito.code-workspace @@ -0,0 +1,8 @@ +{ + "folders": [ + { + "path": "." + } + ], + "settings": {} +} \ No newline at end of file diff --git a/package.json b/package.json index 23917ff..048ca08 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "node-abstract-repository", + "name": "monguito", "version": "2.8.0", "description": "Node.js lightweight abstract and polymorphic MongoDB repository implementation.", "author": { @@ -9,7 +9,7 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/josuto/node-abstract-repository.git" + "url": "https://github.com/josuto/monguito.git" }, "keywords": [ "node",