opfs-worker 2.0.0 → 2.1.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.
Files changed (134) hide show
  1. package/README.md +64 -428
  2. package/dist/BaseOPFS-BusBkyJX.js +2114 -0
  3. package/dist/BaseOPFS-BusBkyJX.js.map +1 -0
  4. package/dist/BaseOPFS-CYwrD7-q.cjs +4 -0
  5. package/dist/BaseOPFS-CYwrD7-q.cjs.map +1 -0
  6. package/dist/OPFSAsync-B2dR-2VR.cjs +2 -0
  7. package/dist/OPFSAsync-B2dR-2VR.cjs.map +1 -0
  8. package/dist/OPFSAsync-CO44W23e.js +124 -0
  9. package/dist/OPFSAsync-CO44W23e.js.map +1 -0
  10. package/dist/OPFSFacade-CEaSqTut.js +308 -0
  11. package/dist/OPFSFacade-CEaSqTut.js.map +1 -0
  12. package/dist/OPFSFacade-hrNXCn6w.cjs +2 -0
  13. package/dist/OPFSFacade-hrNXCn6w.cjs.map +1 -0
  14. package/dist/OPFSSync-BPrNtvFS.cjs +2 -0
  15. package/dist/OPFSSync-BPrNtvFS.cjs.map +1 -0
  16. package/dist/OPFSSync-D7obTsl3.js +208 -0
  17. package/dist/OPFSSync-D7obTsl3.js.map +1 -0
  18. package/dist/assets/dedicated.worker-DW6UqFo0.js.map +1 -0
  19. package/dist/{OPFSWorker.d.ts → core/BaseOPFS.d.ts} +53 -292
  20. package/dist/core/BaseOPFS.d.ts.map +1 -0
  21. package/dist/core/OPFSAsync.d.ts +55 -0
  22. package/dist/core/OPFSAsync.d.ts.map +1 -0
  23. package/dist/core/OPFSSync.d.ts +54 -0
  24. package/dist/core/OPFSSync.d.ts.map +1 -0
  25. package/dist/createOPFSAsync-DdhJYoC0.js +10 -0
  26. package/dist/createOPFSAsync-DdhJYoC0.js.map +1 -0
  27. package/dist/createOPFSAsync-DyWpvmL-.cjs +2 -0
  28. package/dist/createOPFSAsync-DyWpvmL-.cjs.map +1 -0
  29. package/dist/createOPFSDedicated-BwTc0NV5.js +2407 -0
  30. package/dist/createOPFSDedicated-BwTc0NV5.js.map +1 -0
  31. package/dist/createOPFSDedicated-CEeRexom.cjs +2357 -0
  32. package/dist/createOPFSDedicated-CEeRexom.cjs.map +1 -0
  33. package/dist/createOPFSShared-BSFWsoLe.js +23 -0
  34. package/dist/createOPFSShared-BSFWsoLe.js.map +1 -0
  35. package/dist/createOPFSShared-BoCft_BS.cjs +2 -0
  36. package/dist/createOPFSShared-BoCft_BS.cjs.map +1 -0
  37. package/dist/dedicated.worker.js +2355 -0
  38. package/dist/dedicated.worker.js.map +1 -0
  39. package/dist/{OPFSFacade.d.ts → facade/OPFSFacade.d.ts} +51 -25
  40. package/dist/facade/OPFSFacade.d.ts.map +1 -0
  41. package/dist/facade/createOPFSAsync.d.ts +16 -0
  42. package/dist/facade/createOPFSAsync.d.ts.map +1 -0
  43. package/dist/facade/createOPFSDedicated.d.ts +17 -0
  44. package/dist/facade/createOPFSDedicated.d.ts.map +1 -0
  45. package/dist/facade/createOPFSShared.d.ts +24 -0
  46. package/dist/facade/createOPFSShared.d.ts.map +1 -0
  47. package/dist/index.async.cjs +2 -0
  48. package/dist/index.async.cjs.map +1 -0
  49. package/dist/index.async.d.ts +10 -0
  50. package/dist/index.async.d.ts.map +1 -0
  51. package/dist/index.async.js +55 -0
  52. package/dist/index.async.js.map +1 -0
  53. package/dist/index.cjs +1 -2477
  54. package/dist/index.cjs.map +1 -1
  55. package/dist/index.d.ts +17 -3
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +61 -2828
  58. package/dist/index.js.map +1 -1
  59. package/dist/index.pure.cjs +1 -1
  60. package/dist/index.pure.cjs.map +1 -1
  61. package/dist/index.pure.d.ts +3 -1
  62. package/dist/index.pure.d.ts.map +1 -1
  63. package/dist/index.pure.js +50 -1053
  64. package/dist/index.pure.js.map +1 -1
  65. package/dist/index.sharedworker.cjs +2 -0
  66. package/dist/index.sharedworker.cjs.map +1 -0
  67. package/dist/index.sharedworker.d.ts +11 -0
  68. package/dist/index.sharedworker.d.ts.map +1 -0
  69. package/dist/index.sharedworker.js +55 -0
  70. package/dist/index.sharedworker.js.map +1 -0
  71. package/dist/index.sync.cjs +2 -0
  72. package/dist/index.sync.cjs.map +1 -0
  73. package/dist/index.sync.d.ts +11 -0
  74. package/dist/index.sync.d.ts.map +1 -0
  75. package/dist/index.sync.js +55 -0
  76. package/dist/index.sync.js.map +1 -0
  77. package/dist/shared.worker.js +2240 -0
  78. package/dist/shared.worker.js.map +1 -0
  79. package/dist/types.d.ts +42 -4
  80. package/dist/types.d.ts.map +1 -1
  81. package/dist/worker/createDedicatedWorker.d.ts +30 -0
  82. package/dist/worker/createDedicatedWorker.d.ts.map +1 -0
  83. package/dist/worker/createSharedWorker.d.ts +37 -0
  84. package/dist/worker/createSharedWorker.d.ts.map +1 -0
  85. package/dist/worker/dedicated.worker.d.ts +2 -0
  86. package/dist/worker/dedicated.worker.d.ts.map +1 -0
  87. package/dist/worker/shared.worker.d.ts +2 -0
  88. package/dist/worker/shared.worker.d.ts.map +1 -0
  89. package/docs/api/backend.md +36 -0
  90. package/docs/api/create.md +82 -0
  91. package/docs/api/facade.md +53 -0
  92. package/docs/choosing-a-mode.md +41 -0
  93. package/docs/file-descriptors.md +46 -605
  94. package/docs/guides/async.md +36 -0
  95. package/docs/guides/dedicated.md +76 -0
  96. package/docs/guides/hashing.md +34 -0
  97. package/docs/guides/pure.md +46 -0
  98. package/docs/guides/sharedworker.md +57 -0
  99. package/docs/guides/streaming.md +185 -0
  100. package/docs/guides/watching.md +35 -0
  101. package/docs/migration.md +41 -0
  102. package/docs/types.md +105 -153
  103. package/package.json +53 -4
  104. package/src/{OPFSWorker.ts → core/BaseOPFS.ts} +159 -629
  105. package/src/core/OPFSAsync.ts +248 -0
  106. package/src/core/OPFSSync.ts +460 -0
  107. package/src/{OPFSFacade.ts → facade/OPFSFacade.ts} +134 -58
  108. package/src/facade/createOPFSAsync.ts +22 -0
  109. package/src/facade/createOPFSDedicated.ts +23 -0
  110. package/src/facade/createOPFSShared.ts +30 -0
  111. package/src/index.async.ts +11 -0
  112. package/src/index.pure.ts +3 -2
  113. package/src/index.sharedworker.ts +12 -0
  114. package/src/index.sync.ts +12 -0
  115. package/src/index.ts +37 -8
  116. package/src/types.ts +45 -4
  117. package/src/worker/createDedicatedWorker.ts +74 -0
  118. package/src/worker/createSharedWorker.ts +67 -0
  119. package/src/worker/dedicated.worker.ts +13 -0
  120. package/src/worker/shared.worker.ts +17 -0
  121. package/dist/OPFSFacade.d.ts.map +0 -1
  122. package/dist/OPFSWorker.d.ts.map +0 -1
  123. package/dist/assets/worker.entry-DUlEoroc.js.map +0 -1
  124. package/dist/createOPFSWorker.d.ts +0 -17
  125. package/dist/createOPFSWorker.d.ts.map +0 -1
  126. package/dist/helpers-DNj8ZoMu.cjs +0 -4
  127. package/dist/helpers-DNj8ZoMu.cjs.map +0 -1
  128. package/dist/helpers-WY2jfbOT.js +0 -1427
  129. package/dist/helpers-WY2jfbOT.js.map +0 -1
  130. package/dist/worker.entry.d.ts +0 -2
  131. package/dist/worker.entry.d.ts.map +0 -1
  132. package/docs/api-reference.md +0 -815
  133. package/src/createOPFSWorker.ts +0 -57
  134. package/src/worker.entry.ts +0 -6
package/docs/types.md CHANGED
@@ -1,38 +1,22 @@
1
1
  # Types
2
2
 
3
- This document contains all TypeScript types and interfaces provided by OPFS Worker.
4
-
5
- ## Core Types
6
-
7
- ### `FileStat`
8
-
9
- File or directory statistics.
3
+ ## `FileStat`
10
4
 
11
5
  ```typescript
12
6
  interface FileStat {
13
7
  kind: 'file' | 'directory';
14
8
  size: number;
15
- mtime: string; // ISO string
16
- ctime: string; // ISO string
9
+ mtime: string; // ISO
10
+ ctime: string; // ISO
17
11
  isFile: boolean;
18
12
  isDirectory: boolean;
19
- hash?: string; // Hash of file content (only for files)
13
+ hash?: string; // files only, when hashing is enabled
20
14
  }
21
15
  ```
22
16
 
23
- **Properties:**
24
-
25
- - `kind`: Type of the file system entry
26
- - `size`: Size in bytes (0 for directories)
27
- - `mtime`: Last modification time as ISO string
28
- - `ctime`: Creation time as ISO string
29
- - `isFile`: True if this is a file
30
- - `isDirectory`: True if this is a directory
31
- - `hash`: Optional hash of file content (only present for files when hashing is enabled)
32
-
33
- ### `DirentData`
17
+ `size` is `0` for directories.
34
18
 
35
- Directory entry information.
19
+ ## `DirentData`
36
20
 
37
21
  ```typescript
38
22
  interface DirentData {
@@ -43,75 +27,90 @@ interface DirentData {
43
27
  }
44
28
  ```
45
29
 
46
- **Properties:**
30
+ ## `WatchOptions`
47
31
 
48
- - `name`: Name of the file or directory
49
- - `kind`: Type of the entry
50
- - `isFile`: True if this is a file
51
- - `isDirectory`: True if this is a directory
32
+ ```typescript
33
+ interface WatchOptions {
34
+ recursive?: boolean; // default: true
35
+ include?: string | string[]; // minimatch, default: ['**']
36
+ exclude?: string | string[]; // minimatch, default: []
37
+ }
38
+ ```
52
39
 
53
- ### `WatchOptions`
40
+ ## `ImportFilesProgress`
54
41
 
55
- Options for file watching operations.
42
+ Fired by `importFiles` / `onProgress` for each chunk written:
56
43
 
57
44
  ```typescript
58
- interface WatchOptions {
59
- recursive?: boolean; // Whether to watch recursively (default: true)
60
- include?: string | string[]; // Glob patterns to include in watching (minimatch syntax, default: ['**'])
61
- exclude?: string | string[]; // Glob patterns to exclude from watching (minimatch syntax, default: [])
45
+ interface ImportFilesProgress {
46
+ path: string; // file currently being written
47
+ index: number; // 0-based
48
+ count: number; // total entries
49
+ bytesWritten: number; // within current file
50
+ bytesTotal: number; // size of current file
51
+ totalBytesWritten: number;
52
+ totalBytes: number; // sum of all entry sizes
62
53
  }
63
54
  ```
64
55
 
65
- **Properties:**
56
+ ## `ImportFilesResult`
66
57
 
67
- - `recursive`: Whether to watch the entire directory tree (default: true)
68
- - `include`: Glob patterns to include in watching (default: all files)
69
- - `exclude`: Glob patterns to exclude from watching (default: none)
58
+ Returned when `importFiles` finishes:
70
59
 
71
- ### `RemoteOPFSWorker`
60
+ ```typescript
61
+ interface ImportFilesResult {
62
+ paths: string[]; // written paths, in order
63
+ count: number; // paths.length
64
+ bytesWritten: number; // total bytes across all files
65
+ }
66
+ ```
67
+
68
+ Entries accept `Iterable<[path, string | Uint8Array | Blob]>` or `Map<string, …>` — see [streaming](./guides/streaming.md).
69
+
70
+ ## `OPFSApi`
71
+
72
+ Promise-based surface shared by all backends — a Comlink proxy to `OPFSSync`, or an in-process `OPFSAsync`. What `OPFSFacade` talks to (see `OPFSBackend` in [Create helpers](./api/create.md)).
73
+
74
+ ```typescript
75
+ type OPFSApi = { [K in keyof OPFSSync]: OPFSSync[K] };
76
+ ```
72
77
 
73
- Remote file system interface type for Comlink communication.
78
+ ## `PathLike`
74
79
 
75
80
  ```typescript
76
- type RemoteOPFSWorker = Remote<OPFSWorker>;
81
+ type PathLike = string | URL;
77
82
  ```
78
83
 
79
- This type represents the remote interface when using the worker with Comlink.
84
+ ## `FileOpenOptions`
80
85
 
81
- ## Configuration Types
86
+ ```typescript
87
+ interface FileOpenOptions {
88
+ create?: boolean;
89
+ exclusive?: boolean;
90
+ truncate?: boolean;
91
+ }
92
+ ```
82
93
 
83
- ### `OPFSOptions`
94
+ ## `OPFSOptions`
84
95
 
85
- Configuration options for creating an OPFS Worker instance.
96
+ Table: [Create helpers Options](./api/create.md#options).
86
97
 
87
98
  ```typescript
88
99
  interface OPFSOptions {
89
- /** Root path for the file system (default: '/') */
100
+ /** Root path (default: '/') */
90
101
  root?: string;
91
- /** Namespace for the events (default: 'opfs-worker:${root}') */
102
+ /** Event namespace (default: 'opfs-worker:${root}') */
92
103
  namespace?: string;
93
- /** Hash algorithm for file hashing, or false/null to disable (default: 'etag') */
104
+ /** Hash algorithm, or false/null to disable (default: 'etag') */
94
105
  hashAlgorithm?: null | false | 'etag' | 'SHA-1' | 'SHA-256' | 'SHA-384' | 'SHA-512';
95
- /** Maximum file size in bytes for SHA-* hashing (default: 50MB); ignored by 'etag' */
106
+ /** Max bytes for SHA-* hashing (default: 50MB); ignored by 'etag' */
96
107
  maxFileSize?: number;
97
- /** Custom name for the broadcast channel (default: 'opfs-worker') */
108
+ /** Broadcast channel name or instance (default: 'opfs-worker') */
98
109
  broadcastChannel?: string | BroadcastChannel | null;
99
110
  }
100
111
  ```
101
112
 
102
- **Properties:**
103
-
104
- - `root`: Root path for the file system
105
- - `namespace`: Namespace for events and isolation
106
- - `hashAlgorithm`: `'etag'` (default, mtime+size), `'SHA-*'`, or `null`/`false` to disable
107
- - `maxFileSize`: Max bytes for SHA-* content hashing (etag ignores this)
108
- - `broadcastChannel`: Custom broadcast channel name or instance
109
-
110
- ## Event Types
111
-
112
- ### `WatchEventType`
113
-
114
- Enumeration of file system change event types.
113
+ ## `WatchEventType`
115
114
 
116
115
  ```typescript
117
116
  enum WatchEventType {
@@ -121,15 +120,7 @@ enum WatchEventType {
121
120
  }
122
121
  ```
123
122
 
124
- **Values:**
125
-
126
- - `Added`: File or directory was created
127
- - `Changed`: File or directory was modified
128
- - `Removed`: File or directory was deleted
129
-
130
- ### `WatchEvent`
131
-
132
- File system change event sent via BroadcastChannel.
123
+ ## `WatchEvent`
133
124
 
134
125
  ```typescript
135
126
  interface WatchEvent {
@@ -142,91 +133,52 @@ interface WatchEvent {
142
133
  }
143
134
  ```
144
135
 
145
- **Properties:**
146
-
147
- - `namespace`: Event namespace for isolation
148
- - `path`: Path of the changed file/directory
149
- - `type`: Type of change (added, changed, removed)
150
- - `isDirectory`: Whether the changed item is a directory
151
- - `timestamp`: ISO timestamp of the change
152
- - `hash`: Optional hash of the file content (if hashing is enabled)
153
-
154
- ## Utility Types
155
-
156
- ### `Kind`
157
-
158
- File system entry type.
136
+ ## Utility types
159
137
 
160
138
  ```typescript
161
139
  type Kind = 'file' | 'directory';
162
- ```
163
-
164
- ### `Encoding`
165
-
166
- Supported text encodings.
167
-
168
- ```typescript
169
140
  type Encoding = 'utf-8' | 'utf-16le' | 'ascii' | 'latin1' | 'base64' | 'hex' | 'binary';
170
141
  ```
171
142
 
172
- ## Error Types
173
-
174
- The library provides comprehensive error handling with specific error types that are Node.js SystemError compatible:
175
-
176
- ### Base Error Class
177
-
178
- - `OPFSError` - Base error class for all OPFS-related errors (Node.js SystemError compatible)
179
-
180
- **Properties:**
181
-
182
- - `errno: number` - Numeric error code (e.g., -2 for ENOENT)
183
- - `syscall?: string` - System call name (e.g., 'open', 'read', 'write')
184
- - `path?: string` - File path when applicable
185
- - `name: string` - Error class name ('OPFSError')
186
- - `message: string` - Human-readable error message
187
- - `cause?: any` - Underlying error (Node.js 16+ feature)
188
-
189
- ### Specialized Error Classes
190
-
191
- - `OPFSNotSupportedError` - Thrown when OPFS is not supported in the browser
192
- - `PathError` - Thrown for invalid paths or path traversal attempts
193
- - `ExistenceError` - Thrown when files or directories don't exist
194
- - Usage: `new ExistenceError('File not found: /path/to/file', 'ENOENT', '/path/to/file')`
195
- - `PermissionError` - Thrown when permission is denied for an operation
196
- - `StorageError` - Thrown when an operation fails due to insufficient storage
197
- - `TimeoutError` - Thrown when an operation times out
198
- - `FileBusyError` - Thrown when a file is busy (locked by another operation)
199
- - `FileTypeError` - Thrown when file/directory type expectations don't match
200
- - Usage: `new FileTypeError('directory', '/path/to/dir')`
201
- - `ValidationError` - Thrown for validation failures (invalid arguments, formats, etc.)
202
- - Usage: `new ValidationError('Invalid size', 'EINVAL', '/path/to/file')`
203
- - `OperationAbortedError` - Thrown when an operation is aborted
204
- - `IOError` - Thrown for I/O operation failures
205
- - `OperationNotSupportedError` - Thrown when an operation is not supported
206
- - `DirectoryOperationError` - Thrown when directory operations fail
207
- - Usage: `new DirectoryOperationError('RM_FAILED', '/path/to/dir')`
208
- - `InitializationFailedError` - Thrown when OPFS initialization fails
209
- - `FileSystemOperationError` - Thrown when file system operations fail
210
- - `PathResolutionFailedError` - Thrown when path resolution fails
211
- - `AlreadyExistsError` - Thrown when a file or directory already exists
212
-
213
- ### Error Code Mapping
214
-
215
- The library uses standard POSIX error codes with numeric errno mapping:
216
-
217
- - `ENOENT` (-2) - No such file or directory
218
- - `EISDIR` (-21) - Is a directory
219
- - `ENOTDIR` (-20) - Not a directory
220
- - `EACCES` (-13) - Permission denied
221
- - `EEXIST` (-17) - File exists
222
- - `ENOTEMPTY` (-39) - Directory not empty
223
- - `EINVAL` (-22) - Invalid argument
224
- - `EIO` (-5) - I/O error
225
- - `ENOSPC` (-28) - No space left on device
226
- - `EBUSY` (-16) - Device or resource busy
227
- - `EINTR` (-4) - Interrupted system call
228
- - `ENOTSUP` (-95) - Operation not supported
229
- - `ERANGE` (-34) - Result too large
230
- - `EBADF` (-9) - Bad file descriptor
231
-
232
- Each error type extends the base `OPFSError` class and provides specific error codes and context information for better debugging.
143
+ ## Errors
144
+
145
+ Node.js SystemError-compatible. Base class: `OPFSError` (`errno`, `syscall?`, `path?`, `cause?`).
146
+
147
+ | Class | |
148
+ | ---------------------------- | ------------------------------------------------------------------- |
149
+ | `OPFSNotSupportedError` | OPFS missing in the browser |
150
+ | `PathError` | Bad path / traversal |
151
+ | `ExistenceError` | Missing entry — `new ExistenceError(msg, 'ENOENT', path)` |
152
+ | `PermissionError` | Access denied |
153
+ | `StorageError` | Quota / storage full |
154
+ | `TimeoutError` | Timed out |
155
+ | `FileBusyError` | Locked / busy |
156
+ | `FileTypeError` | File vs directory mismatch — `new FileTypeError('directory', path)` |
157
+ | `ValidationError` | Bad args — `new ValidationError(msg, 'EINVAL', path)` |
158
+ | `OperationAbortedError` | Aborted |
159
+ | `IOError` | I/O failure |
160
+ | `OperationNotSupportedError` | Not supported (e.g. FDs on async) |
161
+ | `DirectoryOperationError` | Dir op failed — `new DirectoryOperationError('RM_FAILED', path)` |
162
+ | `InitializationFailedError` | Init failed |
163
+ | `FileSystemOperationError` | Generic FS failure |
164
+ | `PathResolutionFailedError` | Path resolve failed |
165
+ | `AlreadyExistsError` | Already exists |
166
+
167
+ ### errno
168
+
169
+ | Code | errno | |
170
+ | ----------- | ----- | ------------------------- |
171
+ | `ENOENT` | -2 | No such file or directory |
172
+ | `EISDIR` | -21 | Is a directory |
173
+ | `ENOTDIR` | -20 | Not a directory |
174
+ | `EACCES` | -13 | Permission denied |
175
+ | `EEXIST` | -17 | File exists |
176
+ | `ENOTEMPTY` | -39 | Directory not empty |
177
+ | `EINVAL` | -22 | Invalid argument |
178
+ | `EIO` | -5 | I/O error |
179
+ | `ENOSPC` | -28 | No space left |
180
+ | `EBUSY` | -16 | Busy |
181
+ | `EINTR` | -4 | Interrupted |
182
+ | `ENOTSUP` | -95 | Not supported |
183
+ | `ERANGE` | -34 | Result too large |
184
+ | `EBADF` | -9 | Bad file descriptor |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opfs-worker",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "description": "A robust TypeScript library for working with Origin Private File System (OPFS) through Web Workers",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -18,7 +18,27 @@
18
18
  "source": "./src/index.pure.ts",
19
19
  "import": "./dist/index.pure.js",
20
20
  "require": "./dist/index.pure.cjs"
21
- }
21
+ },
22
+ "./sync": {
23
+ "types": "./dist/index.sync.d.ts",
24
+ "source": "./src/index.sync.ts",
25
+ "import": "./dist/index.sync.js",
26
+ "require": "./dist/index.sync.cjs"
27
+ },
28
+ "./async": {
29
+ "types": "./dist/index.async.d.ts",
30
+ "source": "./src/index.async.ts",
31
+ "import": "./dist/index.async.js",
32
+ "require": "./dist/index.async.cjs"
33
+ },
34
+ "./sharedworker": {
35
+ "types": "./dist/index.sharedworker.d.ts",
36
+ "source": "./src/index.sharedworker.ts",
37
+ "import": "./dist/index.sharedworker.js",
38
+ "require": "./dist/index.sharedworker.cjs"
39
+ },
40
+ "./dedicated.worker.js": "./dist/dedicated.worker.js",
41
+ "./shared.worker.js": "./dist/shared.worker.js"
22
42
  },
23
43
  "sideEffects": false,
24
44
  "files": [
@@ -29,9 +49,15 @@
29
49
  "LICENSE"
30
50
  ],
31
51
  "scripts": {
32
- "build": "vite build && tsc -p tsconfig.build.json",
52
+ "build": "bun run build:lib && bun run build:workers && bun run build:types",
53
+ "build:lib": "vite build",
54
+ "build:workers": "bun run build:worker:dedicated && bun run build:worker:shared",
55
+ "build:worker:dedicated": "OPFS_WORKER=dedicated.worker vite build -c vite.worker.config.ts",
56
+ "build:worker:shared": "OPFS_WORKER=shared.worker vite build -c vite.worker.config.ts",
57
+ "build:types": "tsc -p tsconfig.build.json",
33
58
  "build:demo": "vite build demo --base=./",
34
59
  "dev": "concurrently \"vite build --watch --mode development\" \"tsc -p tsconfig.build.json --watch\"",
60
+ "dev:demo": "vite demo",
35
61
  "preview": "vite preview demo",
36
62
  "type-check": "tsc --noEmit",
37
63
  "lint": "eslint src --ext .ts,.tsx --fix --max-warnings=9999 --quiet",
@@ -40,7 +66,7 @@
40
66
  "prepublishOnly": "bun run lint && bun run type-check && bun run build",
41
67
  "changelog": "changeset",
42
68
  "version-packages": "changeset version",
43
- "release": "changeset publish"
69
+ "release": "bun run scripts/release.mjs"
44
70
  },
45
71
  "keywords": [
46
72
  "opfs",
@@ -63,18 +89,40 @@
63
89
  "homepage": "https://github.com/kachurun/opfs-worker#readme",
64
90
  "devDependencies": {
65
91
  "@changesets/cli": "^2.29.5",
92
+ "@codemirror/lang-cpp": "6.0.3",
93
+ "@codemirror/lang-css": "6.3.1",
94
+ "@codemirror/lang-go": "6.0.1",
95
+ "@codemirror/lang-html": "6.4.11",
96
+ "@codemirror/lang-java": "6.0.2",
97
+ "@codemirror/lang-javascript": "6.2.5",
98
+ "@codemirror/lang-json": "6.0.2",
99
+ "@codemirror/lang-markdown": "6.5.1",
100
+ "@codemirror/lang-php": "6.0.2",
101
+ "@codemirror/lang-python": "6.2.1",
102
+ "@codemirror/lang-rust": "6.0.2",
103
+ "@codemirror/lang-sql": "6.10.0",
104
+ "@codemirror/lang-xml": "6.1.0",
105
+ "@codemirror/lang-yaml": "6.1.3",
106
+ "@codemirror/legacy-modes": "6.5.3",
107
+ "@codemirror/theme-one-dark": "6.1.3",
66
108
  "@flexbe/eslint-config": "^1.0.11",
109
+ "@tailwindcss/vite": "4.3.3",
67
110
  "@types/minimatch": "^6.0.0",
68
111
  "@types/node": "^24.2.0",
69
112
  "@types/react": "^19.1.9",
70
113
  "@types/react-dom": "^19.1.7",
71
114
  "@typescript-eslint/eslint-plugin": "^8.39.0",
72
115
  "@typescript-eslint/parser": "^8.39.0",
116
+ "@uiw/react-codemirror": "4.25.11",
73
117
  "@vitest/coverage-v8": "^3.2.4",
118
+ "daisyui": "5.7.4",
74
119
  "eslint": "^9.32.0",
75
120
  "happy-dom": "^18.0.1",
121
+ "lucide-react": "1.26.0",
76
122
  "react": "^19.1.1",
77
123
  "react-dom": "^19.1.1",
124
+ "react-icons": "5.7.0",
125
+ "tailwindcss": "4.3.3",
78
126
  "typescript": "^5.9.2",
79
127
  "vite": "^7.0.6",
80
128
  "vitest": "^3.2.4"
@@ -88,6 +136,7 @@
88
136
  "packageManager": "bun@1.2.19",
89
137
  "dependencies": {
90
138
  "comlink": "^4.4.2",
139
+ "fflate": "0.8.3",
91
140
  "minimatch": "^10.0.3"
92
141
  },
93
142
  "publishConfig": {