@mostajs/qrpanel 0.3.2 → 0.3.3

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.
Files changed (2) hide show
  1. package/README.md +21 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -8,6 +8,27 @@ QR code panel — générateur server-side *(PNG / SVG / data URL via la lib `qr
8
8
 
9
9
  Aucune dépendance Chromium / Puppeteer / node-gyp. Pure-JS pour `qrcode`, prebuilt-binaries Rust pour le rasterizer (`@resvg/resvg-js`). Fonctionne identiquement sur **Linux, macOS, Windows** *(Node ≥18)*.
10
10
 
11
+ ## ⚠️ Next.js (App Router)
12
+
13
+ `@resvg/resvg-js` charge un **binaire natif** (`.node`). Webpack ne sait pas le bundler — il faut le déclarer en *server external* dans `next.config.js` :
14
+
15
+ ```js
16
+ /** @type {import('next').NextConfig} */
17
+ const nextConfig = {
18
+ serverExternalPackages: [
19
+ '@mostajs/qrpanel',
20
+ '@resvg/resvg-js',
21
+ ],
22
+ }
23
+ export default nextConfig
24
+ ```
25
+
26
+ *(Sur Next.js < 15, la clé s'appelle `experimental.serverComponentsExternalPackages`.)* Sans ça, `npm run build` échoue avec :
27
+ ```
28
+ Module parse failed: Unexpected character '' (1:0)
29
+ ./node_modules/@resvg/resvg-js-linux-x64-gnu/resvgjs.linux-x64-gnu.node
30
+ ```
31
+
11
32
  ## Installation
12
33
 
13
34
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mostajs/qrpanel",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "QR code panel — server-side PNG/SVG generator with 12 built-in themes (image-as-frame composite, ECC=H), config-driven (.qrconfig.json), cross-OS no chromium, + React <QrPanel> client with copy/share/mailto.",
5
5
  "author": "Dr Hamid MADANI <drmdh@msn.com>",
6
6
  "license": "AGPL-3.0-or-later",