From 8a7c4767fc817e495792e1ce99fbc12e6f4722b5 Mon Sep 17 00:00:00 2001 From: Mogeko Date: Mon, 3 Jul 2023 21:57:34 +0200 Subject: [PATCH] build: rename to `@mogeko/tmdb-request` --- .changeset/gentle-seals-invent.md | 5 +++++ apps/web/app/movie/[id]/page.tsx | 2 +- apps/web/app/search/[type]/page.tsx | 2 +- apps/web/package.json | 2 +- packages/tmdb-api/package.json | 2 +- packages/tmdb-api/src/mod.ts | 4 ++-- packages/tmdb-request/README.md | 10 +++++----- packages/tmdb-request/package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 9 files changed, 21 insertions(+), 16 deletions(-) create mode 100644 .changeset/gentle-seals-invent.md diff --git a/.changeset/gentle-seals-invent.md b/.changeset/gentle-seals-invent.md new file mode 100644 index 0000000..6843236 --- /dev/null +++ b/.changeset/gentle-seals-invent.md @@ -0,0 +1,5 @@ +--- +"@mogeko/tmdb-request": patch +--- + +Rename `tmdb-request` to `@mogeko/tmdb-request` diff --git a/apps/web/app/movie/[id]/page.tsx b/apps/web/app/movie/[id]/page.tsx index f87421a..23d2e53 100644 --- a/apps/web/app/movie/[id]/page.tsx +++ b/apps/web/app/movie/[id]/page.tsx @@ -1,4 +1,4 @@ -import { request } from "tmdb-request"; +import { request } from "@mogeko/tmdb-request"; import { tokens } from "@/config/tokens"; diff --git a/apps/web/app/search/[type]/page.tsx b/apps/web/app/search/[type]/page.tsx index 596ab84..a401495 100644 --- a/apps/web/app/search/[type]/page.tsx +++ b/apps/web/app/search/[type]/page.tsx @@ -1,5 +1,5 @@ import Link from "next/link"; -import { request } from "tmdb-request"; +import { request } from "@mogeko/tmdb-request"; import { tokens } from "@/config/tokens"; import type { XOR } from "@/lib/utils"; diff --git a/apps/web/package.json b/apps/web/package.json index 2aa3f0a..c6e74a7 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -12,6 +12,7 @@ }, "dependencies": { "@hookform/resolvers": "^3.1.1", + "@mogeko/tmdb-request": "workspace:^", "@radix-ui/react-accordion": "^1.1.2", "@radix-ui/react-avatar": "^1.0.3", "@radix-ui/react-dialog": "^1.0.4", @@ -31,7 +32,6 @@ "react-hook-form": "^7.45.1", "react-icons": "^4.10.1", "tailwind-merge": "^1.13.2", - "tmdb-request": "workspace:^", "zod": "^3.21.4" }, "devDependencies": { diff --git a/packages/tmdb-api/package.json b/packages/tmdb-api/package.json index f994818..8fffa39 100644 --- a/packages/tmdb-api/package.json +++ b/packages/tmdb-api/package.json @@ -42,7 +42,7 @@ "release": "pnpm publish --access public" }, "dependencies": { - "tmdb-request": "workspace:^" + "@mogeko/tmdb-request": "workspace:^" }, "devDependencies": { "@types/node": "20.2.5", diff --git a/packages/tmdb-api/src/mod.ts b/packages/tmdb-api/src/mod.ts index 029bf1f..f5d07e3 100644 --- a/packages/tmdb-api/src/mod.ts +++ b/packages/tmdb-api/src/mod.ts @@ -1,7 +1,7 @@ import { ENDPOINTS } from "@/endpoints"; import type { Recur, RestInterface } from "@/types"; -import { parser, request, type Options } from "tmdb-request"; -import { mergeDeep } from "tmdb-request/merge-deep"; +import { parser, request, type Options } from "@mogeko/tmdb-request"; +import { mergeDeep } from "@mogeko/tmdb-request/merge-deep"; export class TMDB { private _defaultOpts: Options; diff --git a/packages/tmdb-request/README.md b/packages/tmdb-request/README.md index d2d57be..ab94a91 100644 --- a/packages/tmdb-request/README.md +++ b/packages/tmdb-request/README.md @@ -9,7 +9,7 @@ It use [RFC 6570 URI Template specification](https://www.rfc-editor.org/rfc/rfc6 By install with [npm](https://www.npmjs.com/package/npm), [yarn](https://yarnpkg.com), [pnpm](https://pnpm.io) or any other package manager that you use. ```shell -pnpm add tmdb-request +pnpm add @mogeko/tmdb-request ``` > **Note** @@ -31,7 +31,7 @@ This library 1:1 mapping of REST API endpoints in the [The Movie Database API Re For example, to get the details of a movie, you would do: ```js -import { request } from "tmdb-request"; +import { request } from "@mogeko/tmdb-request"; // The default method is GET, so you can omit it. const result = request("/movie/{movie_id}?language={lang}", { @@ -52,7 +52,7 @@ You can also use `POST` request to interact with TMDB Server. For example, to rate a movie, you would do: ```js -import { request } from "tmdb-request"; +import { request } from "@mogeko/tmdb-request"; const result = request("POST /movie/{movie_id}/rating", { headers: { @@ -73,7 +73,7 @@ If you prefer to use other HTTP client, like [axios](https://axios-http.com). You can use `parser` function to only parse the URL. ```js -import { parser } from "tmdb-request"; +import { parser } from "@mogeko/tmdb-request"; parser("GET /movie/{movie_id}?language={lang}", { headers: { @@ -110,7 +110,7 @@ In this case, we will use the `endpoint.url` as the `route` parameter, so the `u This feature is implemented by TypeScript's [function overloading](https://www.typescriptlang.org/docs/handbook/2/functions.html#function-overloads). ```js -import { parser, request } from "tmdb-request"; +import { parser, request } from "@mogeko/tmdb-request"; // For request function request({ diff --git a/packages/tmdb-request/package.json b/packages/tmdb-request/package.json index 1cdbd14..4daf669 100644 --- a/packages/tmdb-request/package.json +++ b/packages/tmdb-request/package.json @@ -1,5 +1,5 @@ { - "name": "tmdb-request", + "name": "@mogeko/tmdb-request", "version": "1.2.3", "private": false, "type": "module", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6c1bc6f..2e48528 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -117,6 +117,9 @@ importers: '@hookform/resolvers': specifier: ^3.1.1 version: 3.1.1(react-hook-form@7.45.1) + '@mogeko/tmdb-request': + specifier: workspace:^ + version: link:../../packages/tmdb-request '@radix-ui/react-accordion': specifier: ^1.1.2 version: 1.1.2(@types/react-dom@18.2.4)(@types/react@18.2.8)(react-dom@18.2.0)(react@18.2.0) @@ -174,9 +177,6 @@ importers: tailwind-merge: specifier: ^1.13.2 version: 1.13.2 - tmdb-request: - specifier: workspace:^ - version: link:../../packages/tmdb-request zod: specifier: ^3.21.4 version: 3.21.4 @@ -235,7 +235,7 @@ importers: packages/tmdb-api: dependencies: - tmdb-request: + '@mogeko/tmdb-request': specifier: workspace:^ version: link:../tmdb-request devDependencies: