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

🏗️ Add entry point for cloud and server #10

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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({
Expand Down
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/cloud/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "./client.js"
export type * as cloud from "./openapi/index.js"
export type * from "./openapi/index.js"
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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"
5 changes: 3 additions & 2 deletions tests/cloud/client.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
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,
BITBUCKET_CLOUD_USERNAME,
} from "../env.js"

const basic = toBase64(
BITBUCKET_CLOUD_USERNAME + ":" + BITBUCKET_CLOUD_APP_PASSWORD,
`${BITBUCKET_CLOUD_USERNAME}:${BITBUCKET_CLOUD_APP_PASSWORD}`,
)

export const client = createBitbucketCloudClient({
Expand Down
2 changes: 1 addition & 1 deletion tests/server/client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createBitbucketServerClient } from "../../src/index.js"
import { createBitbucketServerClient } from "../../src/server/index.js"
NatoBoram marked this conversation as resolved.
Show resolved Hide resolved
import { BITBUCKET_SERVER_TOKEN, BITBUCKET_SERVER_URL } from "../env.js"

export const client = createBitbucketServerClient({
Expand Down
6 changes: 5 additions & 1 deletion typedoc.json
Original file line number Diff line number Diff line change
@@ -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"]
}