@zip.js/zip.js 2.8.43 → 2.8.45

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 (56) hide show
  1. package/README.md +0 -37
  2. package/deno.json +21 -1
  3. package/dist/zip-core-external.js +194 -159
  4. package/dist/zip-core-external.min.js +1 -1
  5. package/dist/zip-core.js +194 -131
  6. package/dist/zip-core.min.js +1 -1
  7. package/dist/zip-fs-core-external.js +246 -167
  8. package/dist/zip-fs-core-external.min.js +1 -1
  9. package/dist/zip-fs-core.js +244 -139
  10. package/dist/zip-fs-core.min.js +1 -1
  11. package/dist/zip-fs-external.js +267 -1761
  12. package/dist/zip-fs-external.min.js +1 -1
  13. package/dist/zip-fs-native.js +269 -1735
  14. package/dist/zip-fs-native.min.js +1 -1
  15. package/dist/zip-fs.js +268 -1734
  16. package/dist/zip-fs.min.js +1 -1
  17. package/dist/zip-legacy.js +196 -133
  18. package/dist/zip-legacy.min.js +1 -1
  19. package/dist/zip-native.js +196 -133
  20. package/dist/zip-native.min.js +1 -1
  21. package/dist/zip-web-worker-native.js +1 -1
  22. package/dist/zip-web-worker.js +1 -1
  23. package/dist/zip.js +195 -132
  24. package/dist/zip.min.js +1 -1
  25. package/eslint.config.mjs +31 -2
  26. package/index-native.cjs +269 -1735
  27. package/index-native.min.js +1 -1
  28. package/index.cjs +268 -1734
  29. package/index.d.cts +129 -8
  30. package/index.d.ts +129 -8
  31. package/index.min.js +1 -1
  32. package/lib/core/codec-pool.js +6 -2
  33. package/lib/core/codec-worker.js +2 -2
  34. package/lib/core/constants.js +4 -0
  35. package/lib/core/options.js +6 -0
  36. package/lib/core/streams/aes-crypto-stream.js +18 -21
  37. package/lib/core/streams/codec-stream.js +6 -2
  38. package/lib/core/streams/common-crypto.js +2 -0
  39. package/lib/core/streams/zip-entry-stream.js +16 -17
  40. package/lib/core/util/mime-type-data.js +3 -0
  41. package/lib/core/util/mime-type.js +23 -1596
  42. package/lib/core/web-worker-base.js +2 -2
  43. package/lib/core/web-worker-inline-native.js +1 -1
  44. package/lib/core/web-worker-inline-wasm.js +1 -1
  45. package/lib/core/web-worker-wasm.js +4 -8
  46. package/lib/core/zip-entry.js +11 -1
  47. package/lib/core/zip-fs.js +62 -5
  48. package/lib/core/zip-reader.js +80 -43
  49. package/lib/core/zip-writer.js +68 -45
  50. package/lib/zip-core-external.js +2 -0
  51. package/lib/zip-core-reader.js +2 -0
  52. package/lib/zip-fs-core-external.js +2 -0
  53. package/lib/zip-fs-external.js +2 -0
  54. package/lib/zip-mime-types.js +2 -0
  55. package/package.json +9 -3
  56. package/worker-message-property-names.js +1 -1
package/README.md CHANGED
@@ -171,43 +171,6 @@ function downloadFile(blob) {
171
171
 
172
172
  Run the code on Plunker: https://plnkr.co/edit/4sVljNIpqSUE9HCA?preview
173
173
 
174
- ## Using external assets
175
-
176
- By default, zip.js embeds the code of the web worker and the WebAssembly module
177
- in the library. The `@zip.js/zip.js/external` entry point references them as
178
- external files instead.
179
-
180
- ```js
181
- import * as zip from "@zip.js/zip.js/external";
182
- ```
183
-
184
- Bundlers like webpack and Vite detect these references. They emit
185
- `zip-web-worker.js` and `zip-module.wasm` as separate assets and remove
186
- approximately 45KB of embedded payloads from the main bundle. The worker also
187
- runs from a real file URL. This avoids `blob:` restrictions on pages and
188
- browser extensions with a strict Content Security Policy.
189
-
190
- With Vite, add `@zip.js/zip.js` to `optimizeDeps.exclude` to resolve the assets
191
- during development. With bundlers which do not rewrite
192
- `new URL(..., import.meta.url)` expressions, copy the two files next to the
193
- output bundle.
194
-
195
- The build `dist/zip-fs-external.min.js` offers the same behavior without a
196
- bundler. It resolves `zip-web-worker.js` and `zip-module.wasm` relative to its
197
- own location. The three files must be deployed in the same directory.
198
-
199
- Smaller compositions of this entry point are also available.
200
- `@zip.js/zip.js/lib/zip-fs-core-external.js` excludes the MIME type table
201
- (approximately 23KB), `getMimeType()` then returns
202
- `"application/octet-stream"`. `@zip.js/zip.js/lib/zip-core-external.js` also
203
- excludes the filesystem API. Both compositions come with prebuilt bundles in
204
- the `/dist` directory. The full table remains available from any entry point
205
- via `@zip.js/zip.js/mime-types`:
206
-
207
- ```js
208
- import { getMimeType } from "@zip.js/zip.js/mime-types";
209
- ```
210
-
211
174
  ## Tests
212
175
 
213
176
  See https://github.com/gildas-lormeau/zip.js/tree/master/tests/all
package/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zip-js/zip-js",
3
- "version": "2.8.43",
3
+ "version": "2.8.45",
4
4
  "exports": {
5
5
  ".": "./index.js",
6
6
  "./external": "./lib/zip-fs-external.js",
@@ -8,6 +8,24 @@
8
8
  "./lib/zip-core-external.js": "./lib/zip-core-external.js",
9
9
  "./lib/zip-fs-core-external.js": "./lib/zip-fs-core-external.js"
10
10
  },
11
+ "publish": {
12
+ "exclude": [
13
+ "tests/",
14
+ "dist/",
15
+ "!dist/zip-web-worker.js",
16
+ "!dist/zip-module.wasm",
17
+ "*.cjs",
18
+ "index.d.cts",
19
+ "index.min.js",
20
+ "index-native.js",
21
+ "index-native.min.js",
22
+ "package.json",
23
+ "package-lock.json",
24
+ ".npmignore",
25
+ "eslint.config.mjs",
26
+ "worker-message-property-names.js"
27
+ ]
28
+ },
11
29
  "lint": {
12
30
  "exclude": [
13
31
  "dist/*.js",
@@ -22,6 +40,8 @@
22
40
  "rollup*",
23
41
  "reserved-property-names.js",
24
42
  "mangled-property-names.js",
43
+ "mime-types.json",
44
+ "generate-mime-type-data.js",
25
45
  "tsconfig.json",
26
46
  ".vscode",
27
47
  ".eslintrc.json",