discord2html 1.0.1 → 1.0.2
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 +1 -1
- package/dist/{chunk-I5MJAEQ5.mjs → chunk-7ZTHJQTL.mjs} +2 -1
- package/dist/index.mjs +4 -3
- package/dist/index.mjs.map +1 -1
- package/dist/{lib-4JGP6V5E.mjs → lib-XLT2PDZN.mjs} +3 -2
- package/dist/{lib-4JGP6V5E.mjs.map → lib-XLT2PDZN.mjs.map} +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-I5MJAEQ5.mjs.map → chunk-7ZTHJQTL.mjs.map} +0 -0
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Generate styled HTML transcripts from Discord channel message history. Processes
|
|
|
15
15
|
- **Components V2**: Select menu option emojis now render as images (not raw URL strings). Premium button style handled. All unknown component types degrade gracefully to `null` instead of throwing.
|
|
16
16
|
- **Dual CJS/ESM output**: Package now ships both `dist/index.js` (CJS) and `dist/index.mjs` (ESM) with matching `.d.ts` / `.d.mts` type declarations. The `exports` field is set correctly.
|
|
17
17
|
- **Dependency fix**: `debug` was in `devDependencies` but is used in production code — moved to `dependencies`.
|
|
18
|
-
- **Bundled React (self-contained)**: React, ReactDOM and `@derockdev/discord-components-*` are bundled into the dist at build time. The package renders with React 19 (`react-dom/static`), but `@derockdev/discord-components-react` peer-requires React ≤18 — so a naïve install left two React copies in the tree, and elements created under React 18 failed to render under React 19 with *"Objects are not valid as a React child"*. Bundling resolves every `import React` to a single React 19 instance baked into the package, so **consumers never need to install React or add `overrides`** — only `discord.js`.
|
|
18
|
+
- **Bundled React (self-contained)**: React, ReactDOM and `@derockdev/discord-components-*` are bundled into the dist at build time. The package renders with React 19 (`react-dom/static`), but `@derockdev/discord-components-react` peer-requires React ≤18 — so a naïve install left two React copies in the tree, and elements created under React 18 failed to render under React 19 with *"Objects are not valid as a React child"*. Bundling resolves every `import React` to a single React 19 instance baked into the package, so **consumers never need to install React or add `overrides`** — only `discord.js`. The ESM build injects a `createRequire` shim so the bundled CJS `react-dom` server can load Node built-ins (`util`, `stream`, …) without the *"Dynamic require of X is not supported"* error.
|
|
19
19
|
- **Modernized**: TypeScript target updated to ES2020. React updated to 19.2.4. Build pipeline switched from raw `tsc` to `tsup`.
|
|
20
20
|
|
|
21
21
|
---
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createRequire as __td_createRequire } from 'module'; const require = __td_createRequire(import.meta.url);
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -52,4 +53,4 @@ export {
|
|
|
52
53
|
__toESM,
|
|
53
54
|
__toCommonJS
|
|
54
55
|
};
|
|
55
|
-
//# sourceMappingURL=chunk-
|
|
56
|
+
//# sourceMappingURL=chunk-7ZTHJQTL.mjs.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createRequire as __td_createRequire } from 'module'; const require = __td_createRequire(import.meta.url);
|
|
1
2
|
import {
|
|
2
3
|
__commonJS,
|
|
3
4
|
__esm,
|
|
@@ -6,7 +7,7 @@ import {
|
|
|
6
7
|
__require,
|
|
7
8
|
__toCommonJS,
|
|
8
9
|
__toESM
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-7ZTHJQTL.mjs";
|
|
10
11
|
|
|
11
12
|
// node_modules/react/cjs/react.production.js
|
|
12
13
|
var require_react_production = __commonJS({
|
|
@@ -129912,7 +129913,7 @@ var _TranscriptImageDownloader = class _TranscriptImageDownloader {
|
|
|
129912
129913
|
*/
|
|
129913
129914
|
withCompression(quality = 80, convertToWebP = false, options = {}) {
|
|
129914
129915
|
if (quality < 1 || quality > 100) throw new Error("Quality must be between 1 and 100");
|
|
129915
|
-
import("./lib-
|
|
129916
|
+
import("./lib-XLT2PDZN.mjs").catch((err) => {
|
|
129916
129917
|
console.error(err);
|
|
129917
129918
|
console.error(
|
|
129918
129919
|
`[discord2html] Failed to import 'sharp'. Image compression requires the 'sharp' package to be installed. Either install sharp or remove the compression options.`
|
|
@@ -129938,7 +129939,7 @@ var _TranscriptImageDownloader = class _TranscriptImageDownloader {
|
|
|
129938
129939
|
const buffer = await response.body.arrayBuffer().then((res) => Buffer.from(res));
|
|
129939
129940
|
this.log(`Finished fetching ${attachment.id} (${buffer.length} bytes)`);
|
|
129940
129941
|
if (this.compression) {
|
|
129941
|
-
const sharp = await import("./lib-
|
|
129942
|
+
const sharp = await import("./lib-XLT2PDZN.mjs");
|
|
129942
129943
|
this.log(`Compressing ${attachment.id} with 'sharp'`);
|
|
129943
129944
|
const sharpbuf = await sharp.default(buffer).webp({
|
|
129944
129945
|
quality: this.compression.quality,
|