monorepon't
This commit is contained in:
40
package.json
40
package.json
@@ -1,16 +1,36 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "reacord",
|
||||
"type": "module",
|
||||
"description": "send reactive discord messages using react components ⚛",
|
||||
"version": "0.0.0",
|
||||
"types": "./dist/main.d.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"exports": {
|
||||
"import": "./dist/main.js",
|
||||
"require": "./dist/main.cjs"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "pnpm -C packages/reacord build",
|
||||
"build": "tsup-node src/main.ts --target node16 --format cjs,esm --dts --sourcemap",
|
||||
"build-watch": "pnpm -C packages/reacord build -- --watch",
|
||||
"lint": "eslint --ext js,ts,tsx .",
|
||||
"lint-fix": "pnpm lint -- --fix",
|
||||
"format": "prettier --write .",
|
||||
"test": "pnpm build && pnpm test-only",
|
||||
"test-only": "vitest",
|
||||
"coverage": "pnpm build && vitest --coverage",
|
||||
"typecheck": "pnpm build && tsc --noEmit"
|
||||
"test": "vitest",
|
||||
"coverage": "vitest --coverage",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"@types/react": "*",
|
||||
"@types/react-reconciler": "^0.26.4",
|
||||
"immer": "^9.0.7",
|
||||
"react-reconciler": "^0.26.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"discord.js": "^13.3",
|
||||
"react": ">=17"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@itsmapleleaf/configs": "^1.1.2",
|
||||
@@ -30,7 +50,13 @@
|
||||
"should": "^13.2.3",
|
||||
"typescript": "^4.5.4",
|
||||
"vite": "^2.7.4",
|
||||
"vitest": "^0.0.102"
|
||||
"vitest": "^0.0.102",
|
||||
"discord.js": "^13.3.1",
|
||||
"dotenv": "^10.0.0",
|
||||
"esbuild": "^0.14.6",
|
||||
"nanoid": "^3.1.30",
|
||||
"react": "^17.0.2",
|
||||
"tsup": "^5.11.6"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"name": "reacord-helpers",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.11.14"
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"name": "reacord-integration-tests",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@types/react": "*",
|
||||
"@types/node": "^17.0.1",
|
||||
"discord.js": "^13.3.1",
|
||||
"dotenv": "^10.0.0",
|
||||
"reacord": "workspace:*",
|
||||
"reacord-helpers": "workspace:*",
|
||||
"react": "^17.0.2"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig",
|
||||
"include": ["**/*", "node_modules/reacord/dist"]
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
{
|
||||
"name": "reacord",
|
||||
"type": "module",
|
||||
"description": "send reactive discord messages using react components ⚛",
|
||||
"version": "0.0.0",
|
||||
"types": "./dist/main.d.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"exports": {
|
||||
"import": "./dist/main.js",
|
||||
"require": "./dist/main.cjs"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsup src/main.ts --clean --target node16 --format cjs,esm --dts --sourcemap"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "itsMapleLeaf",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"@types/react": "*",
|
||||
"@types/react-reconciler": "^0.26.4",
|
||||
"immer": "^9.0.7",
|
||||
"react-reconciler": "^0.26.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"discord.js": "^13.3",
|
||||
"react": "^17.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"discord.js": "^13.3.1",
|
||||
"dotenv": "^10.0.0",
|
||||
"esbuild": "^0.14.6",
|
||||
"nanoid": "^3.1.30",
|
||||
"reacord-helpers": "workspace:*",
|
||||
"react": "^17.0.2",
|
||||
"tsup": "^5.11.6"
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
export * from "./embed.js"
|
||||
export * from "./root.js"
|
||||
export * from "./text.js"
|
||||
23
pnpm-lock.yaml
generated
23
pnpm-lock.yaml
generated
@@ -5,10 +5,16 @@ importers:
|
||||
.:
|
||||
specifiers:
|
||||
'@itsmapleleaf/configs': ^1.1.2
|
||||
'@types/node': '*'
|
||||
'@types/react': '*'
|
||||
'@types/react-reconciler': ^0.26.4
|
||||
'@typescript-eslint/eslint-plugin': ^5.8.0
|
||||
'@typescript-eslint/parser': ^5.8.0
|
||||
c8: ^7.10.0
|
||||
chai: ^4.3.4
|
||||
discord.js: ^13.3.1
|
||||
dotenv: ^10.0.0
|
||||
esbuild: ^0.14.6
|
||||
eslint: ^8.5.0
|
||||
eslint-config-prettier: ^8.3.0
|
||||
eslint-import-resolver-typescript: ^2.5.0
|
||||
@@ -17,17 +23,31 @@ importers:
|
||||
eslint-plugin-react: ^7.27.1
|
||||
eslint-plugin-react-hooks: ^4.3.0
|
||||
eslint-plugin-unicorn: ^39.0.0
|
||||
immer: ^9.0.7
|
||||
nanoid: ^3.1.30
|
||||
prettier: ^2.5.1
|
||||
react: ^17.0.2
|
||||
react-reconciler: ^0.26.2
|
||||
should: ^13.2.3
|
||||
tsup: ^5.11.6
|
||||
typescript: ^4.5.4
|
||||
vite: ^2.7.4
|
||||
vitest: ^0.0.102
|
||||
dependencies:
|
||||
'@types/node': 17.0.1
|
||||
'@types/react': 17.0.37
|
||||
'@types/react-reconciler': 0.26.4
|
||||
immer: 9.0.7
|
||||
react-reconciler: 0.26.2_react@17.0.2
|
||||
devDependencies:
|
||||
'@itsmapleleaf/configs': 1.1.2
|
||||
'@typescript-eslint/eslint-plugin': 5.8.0_836011a006f4f5d67178564baf2b6d34
|
||||
'@typescript-eslint/parser': 5.8.0_eslint@8.5.0+typescript@4.5.4
|
||||
c8: 7.10.0
|
||||
chai: 4.3.4
|
||||
discord.js: 13.3.1
|
||||
dotenv: 10.0.0
|
||||
esbuild: 0.14.6
|
||||
eslint: 8.5.0
|
||||
eslint-config-prettier: 8.3.0_eslint@8.5.0
|
||||
eslint-import-resolver-typescript: 2.5.0_f385d671d5f1c72a868db745a891bc1f
|
||||
@@ -36,8 +56,11 @@ importers:
|
||||
eslint-plugin-react: 7.27.1_eslint@8.5.0
|
||||
eslint-plugin-react-hooks: 4.3.0_eslint@8.5.0
|
||||
eslint-plugin-unicorn: 39.0.0_eslint@8.5.0
|
||||
nanoid: 3.1.30
|
||||
prettier: 2.5.1
|
||||
react: 17.0.2
|
||||
should: 13.2.3
|
||||
tsup: 5.11.6_typescript@4.5.4
|
||||
typescript: 4.5.4
|
||||
vite: 2.7.4
|
||||
vitest: 0.0.102_c8@7.10.0+vite@2.7.4
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
workspaces: [packages/*]
|
||||
@@ -8,7 +8,7 @@ export function withLoggedMethodCalls<T extends object>(value: T) {
|
||||
return value
|
||||
}
|
||||
return (...values: any[]) => {
|
||||
console.log(
|
||||
console.info(
|
||||
`${String(property)}(${values
|
||||
.map((value) => inspect(value, { depth: 1 }))
|
||||
.join(", ")})`,
|
||||
3
src/main.ts
Normal file
3
src/main.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from "./embed"
|
||||
export * from "./root"
|
||||
export * from "./text"
|
||||
@@ -1,10 +1,10 @@
|
||||
/* eslint-disable unicorn/no-null */
|
||||
import { inspect } from "node:util"
|
||||
import { raise } from "reacord-helpers/raise.js"
|
||||
import ReactReconciler from "react-reconciler"
|
||||
import { BaseInstance } from "./base-instance.js"
|
||||
import { ContainerInstance } from "./container-instance.js"
|
||||
import type { ReacordContainer } from "./container.js"
|
||||
import { raise } from "./helpers/raise.js"
|
||||
import { TextInstance } from "./text-instance.js"
|
||||
|
||||
type ElementTag = string
|
||||
@@ -2,12 +2,12 @@
|
||||
import type { Message } from "discord.js"
|
||||
import { Client, TextChannel } from "discord.js"
|
||||
import { deepEqual } from "node:assert"
|
||||
import type { ReacordRoot } from "reacord"
|
||||
import { createRoot, Embed, Text } from "reacord"
|
||||
import { pick } from "reacord-helpers/pick.js"
|
||||
import { raise } from "reacord-helpers/raise.js"
|
||||
import React from "react"
|
||||
import { afterAll, beforeAll, test } from "vitest"
|
||||
import { pick } from "./helpers/pick.js"
|
||||
import { raise } from "./helpers/raise.js"
|
||||
import type { ReacordRoot } from "./main"
|
||||
import { createRoot, Embed, Text } from "./main"
|
||||
import { testBotToken, testChannelId } from "./test-environment.js"
|
||||
|
||||
const client = new Client({
|
||||
@@ -1,5 +1,5 @@
|
||||
import "dotenv/config.js"
|
||||
import { raise } from "reacord-helpers/raise.js"
|
||||
import { raise } from "./helpers/raise.js"
|
||||
|
||||
function getEnvironmentValue(name: string) {
|
||||
return process.env[name] ?? raise(`Missing environment variable: ${name}`)
|
||||
@@ -1,8 +0,0 @@
|
||||
// eslint-disable-next-line import/no-unused-modules
|
||||
export default {
|
||||
test: {
|
||||
deps: {
|
||||
inline: ["should"],
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user