@jhits/plugin-images 0.0.1 → 0.0.4

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/package.json CHANGED
@@ -1,26 +1,39 @@
1
1
  {
2
2
  "name": "@jhits/plugin-images",
3
- "version": "0.0.1",
3
+ "version": "0.0.4",
4
4
  "description": "Image management and storage plugin for the JHITS ecosystem",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
8
  "main": "./src/index.tsx",
9
9
  "types": "./src/index.tsx",
10
+ "browser": {
11
+ "mongodb": false,
12
+ "server-only": false,
13
+ "./src/api/api-server.ts": false,
14
+ "./src/index.server.ts": false
15
+ },
10
16
  "exports": {
11
17
  ".": {
12
18
  "types": "./src/index.tsx",
19
+ "import": "./src/index.tsx",
13
20
  "default": "./src/index.tsx"
14
21
  },
15
22
  "./server": {
16
23
  "types": "./src/index.server.ts",
24
+ "import": "./src/index.server.ts",
17
25
  "default": "./src/index.server.ts"
26
+ },
27
+ "./components/*": {
28
+ "types": "./src/components/*.tsx",
29
+ "default": "./src/components/*.tsx"
18
30
  }
19
31
  },
20
32
  "dependencies": {
21
33
  "@jhits/plugin-core": "^0.0.1",
22
34
  "mongodb": "^7.0.0",
23
- "lucide-react": "^0.562.0"
35
+ "lucide-react": "^0.562.0",
36
+ "server-only": "^0.0.1"
24
37
  },
25
38
  "peerDependencies": {
26
39
  "next": ">=15.0.0",
@@ -44,4 +57,4 @@
44
57
  "src",
45
58
  "package.json"
46
59
  ]
47
- }
60
+ }
@@ -1,8 +1,12 @@
1
1
  /**
2
2
  * Image Upload API Handler
3
3
  * POST /api/plugin-images/upload - Handles image file uploads
4
+ *
5
+ * SERVER-ONLY: This module must never be imported by client code
4
6
  */
5
7
 
8
+ import 'server-only';
9
+
6
10
  import { NextRequest, NextResponse } from 'next/server';
7
11
  import { writeFile, mkdir } from 'fs/promises';
8
12
  import path from 'path';
@@ -1,3 +1,4 @@
1
+ import 'server-only';
1
2
  /**
2
3
  * Plugin Images - Server-Only Entry Point
3
4
  * This file exports only server-side API handlers