spearkit 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/llms.txt ADDED
@@ -0,0 +1,39 @@
1
+ # spearkit
2
+
3
+ > discord.js++ — a developer-experience-first Discord library. Drop-in compatible with discord.js, with ergonomic events, slash commands, and interactive components.
4
+
5
+ spearkit re-exports the entire discord.js surface (so it is a drop-in replacement) and adds a fully type-safe layer for slash commands, options, interactive components, events, cooldowns, scheduled tasks, prefix commands, logging, usage tracking and dotenv. Import everything from `spearkit`; never mix a separate `discord.js` import.
6
+
7
+ Core rules an agent should follow: use `SpearClient` (not `Client`); define commands with `command()`/`commandGroup()` and options with `option.*`; define components with `button`/`stringSelect`/`modal`/… and let spearkit route them by custom-id — never write an `interactionCreate` switch; register with `client.register(...)`; `await client.start(token)` then `await client.deployCommands({ guildId })` (deploy only after start); the ready event is `clientReady`, not `ready`.
8
+
9
+ ## Documentation
10
+
11
+ - [Getting started](https://raw.githubusercontent.com/byigitt/spearkit/main/docs/getting-started.md): spearkit is discord.js++: it re-exports the entire discord.js surface and adds a fully type-safe layer for events, slash commands and interactive components. This page takes you from an empty folder…
12
+ - [Client](https://raw.githubusercontent.com/byigitt/spearkit/main/docs/client.md): SpearClient is a discord.js Client with command, event and component registries — plus interaction routing — wired up for you. You construct it the same way you construct a discord.js client…
13
+ - [Migrating from discord.js](https://raw.githubusercontent.com/byigitt/spearkit/main/docs/migration.md): spearkit re-exports the entire discord.js surface, so adopting it is not a rewrite — it is a one-line import change followed by optional, incremental cleanup. You can move to spearkit today and start…
14
+
15
+ ## Guides
16
+
17
+ - [Commands](https://raw.githubusercontent.com/byigitt/spearkit/main/docs/commands.md): Slash commands in spearkit are defined as a single object: the metadata, the typed options, and the handler all live together. spearkit serialises them for discord and routes incoming interactions to…
18
+ - [Options](https://raw.githubusercontent.com/byigitt/spearkit/main/docs/options.md): Slash command options are declared as a map of name → builder. spearkit infers the exact value type each option resolves to, so your handler's ctx.options is fully typed — no casts, no any, no manual…
19
+ - [Components](https://raw.githubusercontent.com/byigitt/spearkit/main/docs/components.md): Buttons, select menus and modals in spearkit follow one pattern: define the appearance, the custom-id pattern, and the handler in one place; register it; then build() the discord.js component to put…
20
+ - [Events](https://raw.githubusercontent.com/byigitt/spearkit/main/docs/events.md): event() defines a reusable, loadable discord.js event listener with a fully-typed handler. The handler's arguments are inferred from discord.js' ClientEvents, so you never annotate them by hand…
21
+ - [Contexts](https://raw.githubusercontent.com/byigitt/spearkit/main/docs/context.md): Every spearkit handler — command, button, select, modal — receives a context object. They all share BaseContext, which smooths over discord.js' reply/defer/edit/follow-up state machine and exposes…
22
+ - [Cooldowns](https://raw.githubusercontent.com/byigitt/spearkit/main/docs/cooldown.md): Rate-limit commands per user, per role, per guild, per channel or globally. Cooldowns are enforced automatically by command dispatch: when an actor is still on cooldown, spearkit replies…
23
+ - [Scheduled tasks](https://raw.githubusercontent.com/byigitt/spearkit/main/docs/scheduler.md): Run work on a cron schedule or a fixed interval. The client starts the scheduler when it becomes ready and stops it on destroy(), so timers never outlive your bot.
24
+ - [Prefix commands](https://raw.githubusercontent.com/byigitt/spearkit/main/docs/prefix.md): Alongside slash commands, spearkit can dispatch classic text/prefix commands like !ping. You define them with prefixCommand, enable them with the client's prefix option, and spearkit parses each…
25
+ - [Logging](https://raw.githubusercontent.com/byigitt/spearkit/main/docs/logging.md): spearkit ships a small, dependency-free structured logger. Every client owns one at client.logger, and spearkit routes its own command, component, event, and gateway errors through it. You can use…
26
+ - [Usage tracking](https://raw.githubusercontent.com/byigitt/spearkit/main/docs/usage.md): Usage tracking records who used what: every successful command, component, and prefix-command invocation becomes a UsageEvent that spearkit can persist to a store and/or mirror into a Discord…
27
+ - [Environment & dotenv](https://raw.githubusercontent.com/byigitt/spearkit/main/docs/env.md): spearkit includes a tiny, dependency-free .env loader and a typed reader over process.env, so a bot needs no extra dotenv dependency. The client auto-loads .env on start(), and the same helpers are…
28
+ - [Plugins](https://raw.githubusercontent.com/byigitt/spearkit/main/docs/plugins.md): A plugin is a named, reusable bundle of commands, events and components. It lets you package a feature once and install it into any SpearClient with a single call — useful for sharing functionality…
29
+ - [File-based loading](https://raw.githubusercontent.com/byigitt/spearkit/main/docs/loading.md): Instead of importing and registering every handler by hand, you can keep one command, event or component per file and let spearkit discover them. The loader imports a directory, inspects each…
30
+
31
+ ## Reference
32
+
33
+ - [API reference](https://raw.githubusercontent.com/byigitt/spearkit/main/docs/api-reference.md): Every symbol spearkit exports, in addition to the entire re-exported discord.js surface. Import any of these from "spearkit".
34
+
35
+ ## Optional
36
+
37
+ - [Full documentation](https://raw.githubusercontent.com/byigitt/spearkit/main/llms-full.txt): every guide and the full API reference concatenated into one file.
38
+ - [Examples](https://github.com/byigitt/spearkit/tree/main/examples): one runnable folder per topic (commands, options, components, events, loading, cooldown, scheduler, prefix, logging, usage, env, guards, context-menus, pagination, confirm, …).
39
+ - [Repository](https://github.com/byigitt/spearkit): source, issues and the docs site source under `website/`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spearkit",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "discord.js++ — a developer-experience-first Discord library. Drop-in compatible with discord.js, with ergonomic events, slash commands, and interactive components.",
5
5
  "type": "module",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",
@@ -35,7 +35,12 @@
35
35
  "module": "./dist/index.js",
36
36
  "types": "./dist/index.d.ts",
37
37
  "files": [
38
- "dist"
38
+ "dist",
39
+ "llms.txt",
40
+ "llms-full.txt",
41
+ "AGENTS.md",
42
+ "docs",
43
+ ".claude/skills"
39
44
  ],
40
45
  "scripts": {
41
46
  "build": "tsup",
@@ -44,7 +49,8 @@
44
49
  "test": "vitest run",
45
50
  "test:watch": "vitest",
46
51
  "e2e": "node e2e/live.mjs",
47
- "prepublishOnly": "npm run build"
52
+ "docs:llms": "node scripts/generate-llms.mjs",
53
+ "prepublishOnly": "npm run docs:llms && npm run build"
48
54
  },
49
55
  "dependencies": {
50
56
  "discord.js": "^14.16.3"