Skip to content

Commit

Permalink
refactor: move linked roles to core package (#138)
Browse files Browse the repository at this point in the history
* refactor: move linked roles to core package

* chore: remove entry from tsconfig

* chore: fix undefined existing in docs path name on windows

* chore: refactor copy api script to support "subpackages"
  • Loading branch information
apteryxxyz authored Sep 23, 2024
1 parent c25cfac commit 6ab721f
Show file tree
Hide file tree
Showing 22 changed files with 123 additions and 208 deletions.
5 changes: 5 additions & 0 deletions .changeset/itchy-spiders-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@buape/carbon": minor
---

refactor: move linked roles to core package
1 change: 0 additions & 1 deletion apps/rocko/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
},
"dependencies": {
"@buape/carbon": "workspace:*",
"@buape/carbon-linked-roles": "workspace:*",
"@buape/carbon-nodejs": "workspace:*",
"@types/node": "22.5.5"
},
Expand Down
4 changes: 2 additions & 2 deletions apps/rocko/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { dirname } from "node:path"
import { fileURLToPath } from "node:url"
import { Client, ClientMode } from "@buape/carbon"
import { loadCommands, serve } from "@buape/carbon-nodejs"
import {
ApplicationRoleConnectionMetadataType,
LinkedRoles
} from "@buape/carbon-linked-roles"
import { loadCommands, serve } from "@buape/carbon-nodejs"
} from "@buape/carbon/linked-roles"
const __dirname = dirname(fileURLToPath(import.meta.url))

if (
Expand Down
4 changes: 2 additions & 2 deletions formatter.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { dirname, relative } from "node:path"
import { dirname, relative, sep } from "node:path"
// @ts-check
import { fileURLToPath } from "node:url"
import { MarkdownPageEvent } from "typedoc-plugin-markdown"
Expand Down Expand Up @@ -27,7 +27,7 @@ export function load(app) {
(page) => {
if (!page.contents) return
const rel = relative(root, dirname(page.filename))
const parts = rel.split("/")
const parts = rel.split(sep)
const pkg = parts[1]
const dirParts = parts.slice(3)
const dir = dirParts.length ? `${dirParts.join("/")}/` : ""
Expand Down
10 changes: 10 additions & 0 deletions packages/carbon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
"type": "module",
"main": "./dist/src/index.js",
"repository": "github:buape/carbon",
"exports": {
".": {
"types": "./dist/src/index.d.ts",
"import": "./dist/src/index.js"
},
"./*": {
"types": "./dist/src/plugins/*/index.d.ts",
"import": "./dist/src/plugins/*/index.js"
}
},
"scripts": {
"build": "tsc",
"dev": "tsc -w",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Client } from "@buape/carbon"
import type { Client } from "../../classes/Client.js"
import {
ApplicationRoleConnectionMetadataType,
type LinkedRolesOptions
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/carbon/typedoc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://typedoc.org/schema.json",
"extends": ["../../typedoc.json"],
"entryPoints": ["src/index.ts"],
"entryPoints": ["src/index.ts", "src/plugins/*/index.ts"],
"name": "@buape/carbon",
"out": "docs",
"excludeExternals": true,
Expand Down
104 changes: 0 additions & 104 deletions packages/linked-roles/CHANGELOG.md

This file was deleted.

13 changes: 0 additions & 13 deletions packages/linked-roles/README.md

This file was deleted.

23 changes: 0 additions & 23 deletions packages/linked-roles/package.json

This file was deleted.

11 changes: 0 additions & 11 deletions packages/linked-roles/tsconfig.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/linked-roles/typedoc.json

This file was deleted.

9 changes: 0 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions website/content/carbon/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"...",
"--- Usage ---",
"classes",
"plugins",
"helpful-guides",
"even-more",
"--- API Reference ---",
Expand Down
6 changes: 6 additions & 0 deletions website/content/carbon/plugins/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Plugins
index: true
icon: Cable
---

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Linked Roles
description: Linked Roles are a handy feature of Discord that allows you to create roles that users have to meet certain criteria in order to claim those roles.
---

Linked Roles are a handy feature of Discord that allows you to create roles that users have to meet certain criteria in order to claim those roles.
Expand All @@ -17,13 +18,13 @@ Then, create a new instance of the `LinkedRoles` class, and pass it your metadat
### Installation

<CommandTabs command="install" args={["@buape/carbon @buape/carbon-linked-roles"]} />
<CommandTabs command="install" args={["@buape/carbon"]} />

### Example

```ts title="src/index.ts"
import { Client } from "@buape/carbon"
import { LinkedRoles } from "@buape/carbon-linked-roles"
import { LinkedRoles } from "@buape/carbon/linked-roles"

const client = new Client({
clientId: "12345678901234567890",
Expand Down
1 change: 1 addition & 0 deletions website/content/carbon/plugins/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "title": "Plugins" }
4 changes: 0 additions & 4 deletions website/content/linked-roles/meta.json

This file was deleted.

Loading

0 comments on commit 6ab721f

Please sign in to comment.