From e613fff7f901a10e7d98b6052cb3be93a72ac97e Mon Sep 17 00:00:00 2001 From: Nathan Gendron Date: Tue, 1 Oct 2024 12:44:55 -0400 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=8F=97=EF=B8=8F=20Add=20entry=20point?= =?UTF-8?q?=20for=20cloud=20and=20server?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 8 ++++++++ src/cloud/index.ts | 2 +- src/index.ts | 4 ++-- typedoc.json | 6 +++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 083d92b..d537f66 100644 --- a/package.json +++ b/package.json @@ -73,6 +73,14 @@ ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" + }, + "./cloud": { + "types": "./dist/cloud/index.d.ts", + "default": "./dist/cloud/index.js" + }, + "./server": { + "types": "./dist/server/index.d.ts", + "default": "./dist/server/index.js" } }, "types": "dist/index.d.ts", diff --git a/src/cloud/index.ts b/src/cloud/index.ts index 1114719..f7e9a95 100644 --- a/src/cloud/index.ts +++ b/src/cloud/index.ts @@ -1,2 +1,2 @@ export * from "./client.js" -export type * as cloud from "./openapi/index.js" +export type * from "./openapi/index.js" diff --git a/src/index.ts b/src/index.ts index ce4bf6b..f9be965 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,3 @@ export * from "./base64.js" -export * from "./cloud/index.js" -export * from "./server/index.js" +export * as cloud from "./cloud/index.js" +export * as server from "./server/index.js" diff --git a/typedoc.json b/typedoc.json index df59887..84e4ec9 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,5 +1,9 @@ { "$schema": "https://typedoc.org/schema.json", - "entryPoints": ["./src/index.ts"], + "entryPoints": [ + "./src/index.ts", + "./src/cloud/index.ts", + "./src/server/index.ts" + ], "highlightLanguages": ["ini", "sh", "ts"] } From 9a2ba052af82a8254227a5cedffd4e6692e9fa69 Mon Sep 17 00:00:00 2001 From: Nathan Gendron Date: Tue, 1 Oct 2024 12:50:10 -0400 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9D=20Add=20entrypoint=20in=20READ?= =?UTF-8?q?ME.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 +++-- tests/cloud/client.ts | 5 +++-- tests/server/client.ts | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4ea80c5..223dac3 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,8 @@ pnpm i @coderabbitai/bitbucket ### Cloud ```ts -import { createBitbucketCloudClient, toBase64 } from "@coderabbitai/bitbucket" +import { createBitbucketCloudClient } from "@coderabbitai/bitbucket/cloud" +import { toBase64 } from "@coderabbitai/bitbucket" import { BITBUCKET_CLOUD_APP_PASSWORD, BITBUCKET_CLOUD_URL, @@ -38,7 +39,7 @@ const client = createBitbucketCloudClient({ ### Server ```ts -import { createBitbucketServerClient } from "@coderabbitai/bitbucket" +import { createBitbucketServerClient } from "@coderabbitai/bitbucket/server" import { BITBUCKET_SERVER_TOKEN, BITBUCKET_SERVER_URL } from "./env.js" const server = createBitbucketServerClient({ diff --git a/tests/cloud/client.ts b/tests/cloud/client.ts index 34f4261..f47280f 100644 --- a/tests/cloud/client.ts +++ b/tests/cloud/client.ts @@ -1,4 +1,5 @@ -import { createBitbucketCloudClient, toBase64 } from "../../src/index.js" +import { createBitbucketCloudClient } from "../../src/cloud/index.js" +import { toBase64 } from "../../src/index.js" import { BITBUCKET_CLOUD_APP_PASSWORD, BITBUCKET_CLOUD_URL, @@ -6,7 +7,7 @@ import { } from "../env.js" const basic = toBase64( - BITBUCKET_CLOUD_USERNAME + ":" + BITBUCKET_CLOUD_APP_PASSWORD, + `${BITBUCKET_CLOUD_USERNAME}:${BITBUCKET_CLOUD_APP_PASSWORD}`, ) export const client = createBitbucketCloudClient({ diff --git a/tests/server/client.ts b/tests/server/client.ts index 5961027..d97526a 100644 --- a/tests/server/client.ts +++ b/tests/server/client.ts @@ -1,4 +1,4 @@ -import { createBitbucketServerClient } from "../../src/index.js" +import { createBitbucketServerClient } from "../../src/server/index.js" import { BITBUCKET_SERVER_TOKEN, BITBUCKET_SERVER_URL } from "../env.js" export const client = createBitbucketServerClient({