make a new package for helpers
This commit is contained in:
10
packages/helpers/package.json
Normal file
10
packages/helpers/package.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "@reacord/helpers",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@types/lodash-es": "^4.17.6",
|
||||
"lodash-es": "^4.17.21",
|
||||
"type-fest": "^2.17.0"
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
import { AsyncQueue } from "@reacord/helpers/async-queue"
|
||||
import type { Client, Message, TextBasedChannel } from "discord.js"
|
||||
import { AsyncQueue } from "../../helpers/async-queue"
|
||||
import { makeMessageUpdatePayload } from "../core/make-message-payload"
|
||||
import type { Node } from "../core/node"
|
||||
import type { ReacordMessageRenderer } from "../core/reacord-instance-pool"
|
||||
import { makeMessageUpdatePayload } from "../core/make-message-payload.js"
|
||||
import type { Node } from "../core/node.js"
|
||||
import type { ReacordMessageRenderer } from "../core/reacord-instance-pool.js"
|
||||
|
||||
export class ChannelMessageRenderer implements ReacordMessageRenderer {
|
||||
private message: Message | undefined
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { snakeCaseDeep } from "@reacord/helpers/convert-object-property-case.js"
|
||||
import { omit } from "@reacord/helpers/omit.js"
|
||||
import React from "react"
|
||||
import { snakeCaseDeep } from "../../../helpers/convert-object-property-case"
|
||||
import { omit } from "../../../helpers/omit"
|
||||
import { ReacordElement } from "../../internal/element.js"
|
||||
import type { MessageOptions } from "../../internal/message"
|
||||
import { Node } from "../../internal/node.js"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { isInstanceOf } from "@reacord/helpers/is-instance-of.js"
|
||||
import { randomUUID } from "node:crypto"
|
||||
import type { ReactNode } from "react"
|
||||
import React from "react"
|
||||
import { isInstanceOf } from "../../../helpers/is-instance-of"
|
||||
import { ReacordElement } from "../../internal/element.js"
|
||||
import type { ComponentInteraction } from "../../internal/interaction"
|
||||
import type {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { raise } from "@reacord/helpers/raise"
|
||||
import * as React from "react"
|
||||
import { raise } from "../../helpers/raise"
|
||||
import type { ReacordInstance } from "./instance"
|
||||
|
||||
const Context = React.createContext<ReacordInstance | undefined>(undefined)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/* eslint-disable class-methods-use-this */
|
||||
import { pick } from "@reacord/helpers/pick"
|
||||
import { pruneNullishValues } from "@reacord/helpers/prune-nullish-values"
|
||||
import { raise } from "@reacord/helpers/raise"
|
||||
import * as Discord from "discord.js"
|
||||
import type { ReactNode } from "react"
|
||||
import type { Except } from "type-fest"
|
||||
import { pick } from "../../helpers/pick"
|
||||
import { pruneNullishValues } from "../../helpers/prune-nullish-values"
|
||||
import { raise } from "../../helpers/raise"
|
||||
import type { ComponentInteraction } from "../internal/interaction"
|
||||
import type {
|
||||
Message,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { last } from "@reacord/helpers/last"
|
||||
import type { Except } from "type-fest"
|
||||
import { last } from "../../helpers/last"
|
||||
import type { EmbedOptions } from "../core/components/embed-options"
|
||||
import type { SelectProps } from "../core/components/select"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { raise } from "@reacord/helpers/raise.js"
|
||||
import type { HostConfig } from "react-reconciler"
|
||||
import ReactReconciler from "react-reconciler"
|
||||
import { DefaultEventPriority } from "react-reconciler/constants"
|
||||
import { raise } from "../../helpers/raise.js"
|
||||
import { Node } from "./node.js"
|
||||
import type { Renderer } from "./renderers/renderer"
|
||||
import { TextNode } from "./text-node.js"
|
||||
|
||||
@@ -36,10 +36,8 @@
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "cp ../../README.md . && cp ../../LICENSE . && tsup library/main.ts --target node16 --format cjs,esm --dts --sourcemap",
|
||||
"build-watch": "pnpm build -- --watch",
|
||||
"test": "vitest --coverage --no-watch",
|
||||
"test-dev": "vitest",
|
||||
"build": "cp ../../README.md . && cp ../../LICENSE . && tsup library.new/main.ts --target node16 --format cjs,esm --dts --sourcemap",
|
||||
"build-watch": "pnpm build --watch",
|
||||
"test-manual": "nodemon --exec tsx --ext ts,tsx ./scripts/discordjs-manual-test.tsx",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"release": "bash scripts/release.sh"
|
||||
@@ -47,7 +45,7 @@
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"@types/react": "*",
|
||||
"@types/react-reconciler": "^0.28.0",
|
||||
"@types/react-reconciler": "*",
|
||||
"discord-api-types": "^0.36.3",
|
||||
"react-reconciler": "^0.29.0",
|
||||
"rxjs": "^7.5.6"
|
||||
@@ -62,8 +60,8 @@
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@reacord/helpers": "workspace:*",
|
||||
"@types/lodash-es": "^4.17.6",
|
||||
"c8": "^7.12.0",
|
||||
"discord.js": "^14.0.3",
|
||||
"dotenv": "^16.0.1",
|
||||
"lodash-es": "^4.17.21",
|
||||
@@ -75,8 +73,7 @@
|
||||
"tsup": "^6.1.3",
|
||||
"tsx": "^3.8.0",
|
||||
"type-fest": "^2.17.0",
|
||||
"typescript": "^4.7.4",
|
||||
"vitest": "^0.18.1"
|
||||
"typescript": "^4.7.4"
|
||||
},
|
||||
"resolutions": {
|
||||
"esbuild": "latest"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { raise } from "@reacord/helpers/raise.js"
|
||||
import { waitFor } from "@reacord/helpers/wait-for.js"
|
||||
import { ChannelType, Client, IntentsBitField, TextChannel } from "discord.js"
|
||||
import "dotenv/config"
|
||||
import { kebabCase } from "lodash-es"
|
||||
import prettyMilliseconds from "pretty-ms"
|
||||
import React, { useEffect, useState } from "react"
|
||||
import { raise } from "../helpers/raise"
|
||||
import { waitFor } from "../helpers/wait-for"
|
||||
import { Button, ReacordDiscordJs } from "../library.new/main"
|
||||
|
||||
const client = new Client({ intents: IntentsBitField.Flags.Guilds })
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/* eslint-disable class-methods-use-this */
|
||||
/* eslint-disable require-await */
|
||||
import { logPretty } from "@reacord/helpers/log-pretty"
|
||||
import { omit } from "@reacord/helpers/omit"
|
||||
import { pruneNullishValues } from "@reacord/helpers/prune-nullish-values"
|
||||
import { raise } from "@reacord/helpers/raise"
|
||||
import { waitFor } from "@reacord/helpers/wait-for"
|
||||
import { randomUUID } from "node:crypto"
|
||||
import { setTimeout } from "node:timers/promises"
|
||||
import type { ReactNode } from "react"
|
||||
import { expect } from "vitest"
|
||||
import { logPretty } from "../helpers/log-pretty"
|
||||
import { omit } from "../helpers/omit"
|
||||
import { pruneNullishValues } from "../helpers/prune-nullish-values"
|
||||
import { raise } from "../helpers/raise"
|
||||
import { waitFor } from "../helpers/wait-for"
|
||||
import type {
|
||||
ChannelInfo,
|
||||
GuildInfo,
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
/// <reference types="vitest" />
|
||||
import { defineConfig } from "vitest/config"
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
sourcemap: true,
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user