move stuff around until it feels right
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { CommandInteraction, ComponentInteraction } from "./interaction"
|
||||
import type { CommandInteraction, ComponentInteraction } from "../interaction"
|
||||
|
||||
export type Adapter<InteractionInit> = {
|
||||
addComponentInteractionListener(
|
||||
@@ -1,9 +1,9 @@
|
||||
import type * as Discord from "discord.js"
|
||||
import { raise } from "../../helpers/raise"
|
||||
import { toUpper } from "../../helpers/to-upper"
|
||||
import type { CommandInteraction, ComponentInteraction } from "../interaction"
|
||||
import type { Message, MessageOptions } from "../message"
|
||||
import type { Adapter } from "./adapter"
|
||||
import { raise } from "./helpers/raise"
|
||||
import { toUpper } from "./helpers/to-upper"
|
||||
import type { CommandInteraction, ComponentInteraction } from "./interaction"
|
||||
import type { Message, MessageOptions } from "./message"
|
||||
|
||||
export class DiscordJsAdapter implements Adapter<Discord.CommandInteraction> {
|
||||
constructor(private client: Discord.Client) {}
|
||||
@@ -18,6 +18,7 @@ export class DiscordJsAdapter implements Adapter<Discord.CommandInteraction> {
|
||||
})
|
||||
}
|
||||
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
createCommandInteraction(
|
||||
interaction: Discord.CommandInteraction,
|
||||
): CommandInteraction {
|
||||
@@ -1,12 +1,12 @@
|
||||
import { nanoid } from "nanoid"
|
||||
import type { Adapter } from "./adapter"
|
||||
import { raise } from "./helpers/raise"
|
||||
import { raise } from "../../helpers/raise"
|
||||
import type {
|
||||
ButtonInteraction,
|
||||
CommandInteraction,
|
||||
ComponentInteraction,
|
||||
} from "./interaction"
|
||||
import type { Message, MessageButtonOptions, MessageOptions } from "./message"
|
||||
} from "../interaction"
|
||||
import type { Message, MessageButtonOptions, MessageOptions } from "../message"
|
||||
import type { Adapter } from "./adapter"
|
||||
|
||||
export class TestAdapter implements Adapter<{}> {
|
||||
readonly messages: TestMessage[] = []
|
||||
@@ -1,7 +1,7 @@
|
||||
import { nanoid } from "nanoid"
|
||||
import React from "react"
|
||||
import { last } from "../helpers/last.js"
|
||||
import { ReacordElement } from "./element.js"
|
||||
import { last } from "./helpers/last.js"
|
||||
import type { ButtonInteraction, ComponentInteraction } from "./interaction"
|
||||
import type { MessageOptions } from "./message"
|
||||
import { Node } from "./node.js"
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from "react"
|
||||
import { omit } from "../../helpers/omit"
|
||||
import { ReacordElement } from "../element.js"
|
||||
import { omit } from "../helpers/omit"
|
||||
import type { MessageOptions } from "../message"
|
||||
import { Node } from "../node.js"
|
||||
import { EmbedChildNode } from "./embed-child.js"
|
||||
@@ -1,6 +1,7 @@
|
||||
export * from "./adapter"
|
||||
export * from "./adapter/adapter"
|
||||
export * from "./adapter/discord-js-adapter"
|
||||
export * from "./adapter/test-adapter"
|
||||
export * from "./button"
|
||||
export * from "./discord-js-adapter"
|
||||
export * from "./embed/embed"
|
||||
export * from "./embed/embed-field"
|
||||
export * from "./embed/embed-title"
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { ReactNode } from "react"
|
||||
import type { Adapter } from "./adapter"
|
||||
import type { Adapter } from "./adapter/adapter"
|
||||
import { reconciler } from "./reconciler.js"
|
||||
import { Renderer } from "./renderer.js"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { HostConfig } from "react-reconciler"
|
||||
import ReactReconciler from "react-reconciler"
|
||||
import { raise } from "./helpers/raise.js"
|
||||
import { raise } from "../helpers/raise.js"
|
||||
import { Node } from "./node.js"
|
||||
import type { Renderer } from "./renderer.js"
|
||||
import { TextNode } from "./text.js"
|
||||
@@ -12,7 +12,7 @@
|
||||
"require": "./dist/main.cjs"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsup-node src/main.ts --target node16 --format cjs,esm --dts --sourcemap",
|
||||
"build": "tsup-node library/main.ts --target node16 --format cjs,esm --dts --sourcemap",
|
||||
"build-watch": "pnpm build -- --watch",
|
||||
"lint": "eslint --ext js,ts,tsx .",
|
||||
"lint-fix": "pnpm lint -- --fix",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from "react"
|
||||
import { Button, Embed, EmbedField, EmbedTitle } from "../src/main"
|
||||
import { Button, Embed, EmbedField, EmbedTitle } from "../library/main"
|
||||
|
||||
export function Counter(props: { onDeactivate: () => void }) {
|
||||
const [count, setCount] = React.useState(0)
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Client } from "discord.js"
|
||||
import "dotenv/config"
|
||||
import React from "react"
|
||||
import { DiscordJsAdapter } from "../src/discord-js-adapter"
|
||||
import { Reacord } from "../src/main.js"
|
||||
import { DiscordJsAdapter, Reacord } from "../library/main.js"
|
||||
import { createCommandHandler } from "./command-handler.js"
|
||||
import { Counter } from "./counter.js"
|
||||
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
import { nextTick } from "node:process"
|
||||
import { promisify } from "node:util"
|
||||
import * as React from "react"
|
||||
import { omit } from "../src/helpers/omit"
|
||||
import { Button, Embed, EmbedField, EmbedTitle, Reacord } from "../src/main"
|
||||
import { TestAdapter, TestCommandInteraction } from "../src/test-adapter"
|
||||
import { omit } from "../helpers/omit"
|
||||
import {
|
||||
Button,
|
||||
Embed,
|
||||
EmbedField,
|
||||
EmbedTitle,
|
||||
Reacord,
|
||||
TestAdapter,
|
||||
TestCommandInteraction,
|
||||
} from "../library/main"
|
||||
|
||||
const nextTickPromise = promisify(nextTick)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user