buncord-transcript 1.0.3 → 1.0.5

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/README.md CHANGED
@@ -1,9 +1,6 @@
1
- # Buncord-Transcript
1
+ # **Buncord-Transcript**
2
2
 
3
- [![Sponsor](https://img.shields.io/github/sponsors/LuigiColantuono?style=social)](https://github.com/sponsors/LuigiColantuono)
4
- [![PayPal](https://img.shields.io/badge/💖-Support-ff69b4)](https://paypal.me/l0g4n7)
5
- [![npm](https://img.shields.io/npm/v/buncord-transcript?style=flat-square)](https://www.npmjs.com/package/buncord-transcript)
6
- ![Github Stars](https://img.shields.io/github/stars/LuigiColantuono/Buncord-Transcript?style=flat-square)
3
+ <p align="center"><a href="https://github.com/sponsors/LuigiColantuono"><img src="https://img.shields.io/github/sponsors/LuigiColantuono?style=social"></a> <a href="https://paypal.me/l0g4n7"><img src="https://img.shields.io/badge/💖-Support-ff69b4"></a> <img src="https://img.shields.io/npm/v/buncord-transcript"> <img src="https://img.shields.io/npm/dm/buncord-transcript?label=downloads"> <img src="https://img.shields.io/npm/l/buncord-transcript"> <img src="https://img.shields.io/github/repo-size/LuigiColantuono/Buncord-Transcript"> <a href="https://github.com/LuigiColantuono/Buncord-Transcript"><img src="https://img.shields.io/badge/Bun-Networking-black?logo=bun"></a></p>
7
4
 
8
5
  <div align="center">
9
6
  <img src="https://github.com/user-attachments/assets/70e8758e-f363-478a-a013-fd46ca3cf3ec" alt="Buncord Logo" width="180"/>
@@ -15,26 +12,35 @@
15
12
 
16
13
  Stop simulating browsers to generate simple text logs. **Buncord-Transcript** purges the bloat of JSDOM and React, replacing them with a high-performance, string-based rendering engine powered by Bun and a specialized fork of Mustache.
17
14
 
18
- ## Blazingly Fast
15
+ ## **Blazingly Fast**
19
16
 
20
17
  * **Zero Node Dependencies**: No `ws`, no `http` legacy, no `JSDOM`. Pure Bun-native execution.
21
18
  * **Mustache Powered**: Generates complex transcripts in milliseconds using optimized string templates instead of heavy, recursive DOM manipulation.
22
19
  * **Zero Memory Overhead**: While other libraries require hundreds of MBs to "render" a virtual DOM, Buncord processes messages through a stream-like logic that keeps your RAM footprint invisible.
23
20
 
24
- ## 🎨 Absolute Cinema UI
21
+ ## **Absolute Cinema UI**
25
22
 
26
23
  * **Discord v2 Native**: First-class support for modern components: **Buttons**, **Select Menus**, and the new **Containers**.
27
24
  * **1:1 Visual Fidelity**: Unlike libraries with hardcoded styles, Buncord uses a dynamic CSS variable system mirrored directly from the official Discord client.
28
25
  * **Media-First**: Native support for **Multi-image Media Galleries**, high-res avatars, and custom emoji rendering.
29
26
  * **Smart Mentions**: Intelligently resolves user mentions and relative timestamps within the transcript context.
30
27
 
31
- ## 📦 Installation
28
+ ### **📦 Bundle Size Comparison: Transcripts**
29
+
30
+ | Package | Size (Unpacked) | Total Files | Dependencies | Install Weight (est.) |
31
+ | :--- | :--- | :--- | :--- | :--- |
32
+ | **discord-html-transcripts** | 170 kB | 87 | React, JSDOM, etc. | **~25.000 kB (25MB)** |
33
+ | **buncord-transcript** | 33.8 kB | 8 | **NONE** (Native) | **~34 kB** |
34
+
35
+ > **Result: 99.8% savings on total installation weight!**
36
+
37
+ ## **Installation**
32
38
 
33
39
  ```bash
34
40
  bun add buncord-transcript
35
41
  ```
36
42
 
37
- ## 🚀 Quick Start
43
+ ## **Quick Start**
38
44
 
39
45
  ```typescript
40
46
  import { createTranscript } from 'buncord-transcript';
@@ -50,7 +56,7 @@ const html = await createTranscript(messages, channel);
50
56
  <img width="400" height="500" alt="Buncord-Transcript" src="https://github.com/user-attachments/assets/a63256bd-c22e-465a-a667-74d747526dfb" />
51
57
  </div>
52
58
 
53
- ## 🛠️ The Philosophy
59
+ ## **The Philosophy**
54
60
 
55
61
  Built out of frustration with outdated, bloated libraries that fail to render modern Discord components. Buncord-Transcript is a **"Performance Tier 1"** tool for developers who prioritize speed, code purity, and production stability.
56
62
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "buncord-transcript",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "High-performance, Bun-native Discord HTML transcripts with 1:1 visual fidelity.",
5
5
  "module": "src/index.ts",
6
6
  "main": "src/index.ts",
@@ -29,11 +29,16 @@
29
29
  "zero-dependency",
30
30
  "discord-v2"
31
31
  ],
32
- "devDependencies": {
33
- "@types/bun": "latest"
32
+ "scripts": {
33
+ "lint": "eslint .",
34
+ "typecheck": "tsc --noEmit"
34
35
  },
35
- "peerDependencies": {
36
- "typescript": "5.9.3"
36
+ "devDependencies": {
37
+ "@types/bun": "latest",
38
+ "eslint": "^9.39.2",
39
+ "globals": "^15.14.0",
40
+ "typescript": "^5.9.3",
41
+ "typescript-eslint": "^8.54.0"
37
42
  },
38
43
  "dependencies": {
39
44
  "mustache": "github:LuigiColantuono/mustache"
package/src/generator.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import mustache from 'mustache/mustache.js';
2
- import { htmlTemplate, css } from './template';
3
- import type { Message, TranscriptOptions, ChannelInfo, Embed, Button, SelectMenu, AnyComponent, ContainerComponent, TextDisplayComponent, SeparatorComponent, ActionRow } from './types';
2
+ import { htmlTemplate, css } from './template.ts';
3
+ import type { Message, TranscriptOptions, ChannelInfo, Button, SelectMenu, AnyComponent, ContainerComponent, TextDisplayComponent, SeparatorComponent, ActionRow } from './types.ts';
4
4
  // Helper to format Date
5
5
  function formatDate(dateString: string): string {
6
6
  const date = new Date(dateString);
@@ -62,7 +62,7 @@ function formatContent(content: string, userMap?: Map<string, string>): string {
62
62
  // Mentions (Role) <@&123456>
63
63
  html = html.replace(/&lt;@&(\d+)&gt;/g, '<span class="mention">@role</span>');
64
64
  // Timestamps <t:123456:R>
65
- html = html.replace(/&lt;t:(\d+):?([A-Z])?&gt;/g, (match, timestamp, style) => {
65
+ html = html.replace(/&lt;t:(\d+):?([A-Z])?&gt;/g, (match, timestamp, _style) => {
66
66
  const date = new Date(parseInt(timestamp) * 1000);
67
67
  return `<span class="timestamp">${date.toLocaleString()}</span>`;
68
68
  });
package/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
- import { generateTranscript } from './generator';
3
- export * from './types';
2
+ import { generateTranscript } from './generator.ts';
3
+ export * from './types.ts';
4
4
 
5
5
  // Facade for the user
6
6
  export const createTranscript = generateTranscript;
package/src/template.ts CHANGED
@@ -1,5 +1,5 @@
1
+
1
2
  export const css = `
2
- @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
3
3
  @import url('https://fonts.googleapis.com/css2?family=Fira+Code&display=swap');
4
4
 
5
5
  :root {
@@ -54,9 +54,10 @@ export const css = `
54
54
  body {
55
55
  background-color: var(--background-primary);
56
56
  color: var(--text-normal);
57
- font-family: 'Inter', 'gg sans', 'Whitney', 'Helvetica Neue', Helvetica, Arial, sans-serif;
57
+ font-family: 'gg sans', 'Whitney', 'Helvetica Neue', Helvetica, Arial, sans-serif;
58
58
  font-size: 1rem;
59
59
  line-height: 1.375rem;
60
+ letter-spacing: -0.02em;
60
61
  margin: 0;
61
62
  padding: 0;
62
63
  -webkit-font-smoothing: antialiased;
@@ -143,13 +144,13 @@ a:hover { text-decoration: underline; }
143
144
  .bot-tag {
144
145
  background-color: var(--brand-experiment);
145
146
  color: #ffffff;
146
- font-size: 0.625rem;
147
+ font-size: 0.725rem;
147
148
  text-transform: uppercase;
148
149
  height: 0.9375rem;
149
- padding: 0 0.275rem;
150
- border-radius: 0.1875rem;
151
- line-height: normal;
152
- font-weight: 500;
150
+ padding: 0 4.8px;
151
+ border-radius: 3px;
152
+ line-height: 0.9375rem;
153
+ font-weight: 600;
153
154
  margin-left: 0.25rem;
154
155
  display: inline-flex;
155
156
  align-items: center;
@@ -161,8 +162,10 @@ a:hover { text-decoration: underline; }
161
162
 
162
163
  .bot-tag svg {
163
164
  margin-right: 2px;
164
- width: 14px;
165
- height: 14px;
165
+ width: 1rem;
166
+ height: 1rem;
167
+ margin-inline-start: -0.2rem;
168
+ margin-top: -0.02rem;
166
169
  }
167
170
 
168
171
  .bot-tag-text {
@@ -248,7 +251,7 @@ a:hover { text-decoration: underline; }
248
251
  display: flex;
249
252
  max-width: 520px;
250
253
  background-color: var(--background-secondary);
251
- border-radius: 4px;
254
+ border-radius: 8px;
252
255
  border-left: 4px solid var(--background-tertiary);
253
256
  margin-top: 8px;
254
257
  padding: 8px 16px 16px 12px;
@@ -343,7 +346,7 @@ a:hover { text-decoration: underline; }
343
346
  height: 32px;
344
347
  min-width: 60px;
345
348
  padding: 2px 16px;
346
- border-radius: 3px;
349
+ border-radius: 4px;
347
350
  font-size: 14px;
348
351
  font-weight: 500;
349
352
  color: #ffffff;