archive-codec 1.0.0 → 1.0.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.
- package/README.md +12 -5
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# archive-codec
|
|
2
2
|
|
|
3
|
-
[](https://github.com/ExaDev/archive-codec) [](https://www.npmjs.com/package/archive-codec) [](https://github.com/ExaDev/documents.js/tree/main/packages/archive-codec) [](https://www.npmjs.com/package/archive-codec) [](https://www.npmjs.com/package/archive-codec) [](https://github.com/ExaDev/documents.js/actions)
|
|
4
4
|
|
|
5
|
-
> Recursive archive (ZIP-in-ZIP) detection and walking with depth and cumulative decompressed-size guards — zero document-format knowledge, the archive utility package for the [documents.js family](
|
|
5
|
+
> Recursive archive (ZIP-in-ZIP) detection and walking with depth and cumulative decompressed-size guards — zero document-format knowledge, the archive utility package for the [documents.js family](../../README.md). Worker-isomorphic: the same code runs under Node and inside a Cloudflare Workers isolate.
|
|
6
6
|
|
|
7
|
-
Created for [documents.js#564](https://github.com/ExaDev/documents.js/issues/564): nothing in the ecosystem recursed into a nested archive. Most concretely, OOXML's embedded-object model — a docx/pptx carrying a genuinely separate ZIP blob at `word/embeddings/oleObject1.xlsx` — had no safe handling anywhere, and no package guarded against recursive-archive inputs at all (`byte-codec`'s 512 MiB per-stream inflate cap does not compose across recursion). A new sibling was chosen over extending `byte-codec` (whose charter is byte/image primitives, zero container-format knowledge) or doing it inline in `documents.js` (which would repeat the duplication `byte-codec`'s own extraction was meant to avoid). No family package depends on it yet
|
|
7
|
+
Created for [documents.js#564](https://github.com/ExaDev/documents.js/issues/564): nothing in the ecosystem recursed into a nested archive. Most concretely, OOXML's embedded-object model — a docx/pptx carrying a genuinely separate ZIP blob at `word/embeddings/oleObject1.xlsx` — had no safe handling anywhere, and no package guarded against recursive-archive inputs at all (`byte-codec`'s 512 MiB per-stream inflate cap does not compose across recursion). A new sibling was chosen over extending `byte-codec` (whose charter is byte/image primitives, zero container-format knowledge) or doing it inline in `documents.js` (which would repeat the duplication `byte-codec`'s own extraction was meant to avoid). No family package depends on it yet — `document-schema.js`'s `ContentEmbeddedObject`/`ContentEmbeddedObjectBlock` already has the `objectKind` vocabulary to carry a recovered embedded OOXML sub-document (mirroring how odf.js embeds formula sub-documents), but nothing in `ooxml.js` populates it from this package yet. Tracked as two separate follow-ups given their different risk profiles: [documents.js#733](https://github.com/ExaDev/documents.js/issues/733) (pptx, extending existing partial OLE-handling) and [documents.js#734](https://github.com/ExaDev/documents.js/issues/734) (docx, built from scratch with no existing fixtures).
|
|
8
8
|
|
|
9
9
|
Scope for v1: **ZIP containers only** — read and write over [`fflate`](https://github.com/101arrowz/fflate), recursive walking of ZIP-in-ZIP entries, and archive-format detection (ZIP vs not-ZIP). **tar and gzip are explicitly out of scope.**
|
|
10
10
|
|
|
@@ -55,10 +55,9 @@ Both guards throw rather than truncate: an input outside the contract must fail
|
|
|
55
55
|
|
|
56
56
|
## Conventions
|
|
57
57
|
|
|
58
|
-
- Worker-isomorphic (see the [family-wide convention](
|
|
58
|
+
- Worker-isomorphic (see the [family-wide convention](../../README.md#conventions)): runtime `src/` must not import `node:*`, a bare Node builtin, or use the `Buffer` global — enforced by a `no-restricted-imports`/`no-restricted-globals` ESLint rule and exercised in CI by running the test suite inside an actual `workerd` isolate (`pnpm test:workers`). Test files under `src/**/*.test.ts` and `src/test-support/` are exempt and may use Node APIs for fixtures.
|
|
59
59
|
- Only `src/index.ts` may be named `index.*` — a custom ESLint rule (`local/no-non-barrel-index`) rejects any other module using an `index` basename, since that would be a hidden entry point the `exports` map in `package.json` doesn't advertise.
|
|
60
60
|
- Zero document-format knowledge: this package knows bytes and ZIP structure, never that any entry is a document. It depends only on `fflate` — not on `byte-codec`, `ooxml.js`, or `odf.js` (whose ZIP wrappers it deliberately mirrors rather than imports, keeping their branding and release cadences decoupled).
|
|
61
|
-
- Releases are fully automated: a push to `main` runs `semantic-release` in CI, which determines the version from Conventional Commit messages and publishes to npm via OIDC trusted publishing (no local `NPM_TOKEN` needed). There is no manual publish step.
|
|
62
61
|
|
|
63
62
|
## Install
|
|
64
63
|
|
|
@@ -68,6 +67,14 @@ pnpm add archive-codec
|
|
|
68
67
|
npm install archive-codec
|
|
69
68
|
```
|
|
70
69
|
|
|
70
|
+
## Release and publishing
|
|
71
|
+
|
|
72
|
+
Release, CI, and commit-message conventions are all workspace-wide, not package-local — see the [monorepo root README](../../README.md#releases) for the mechanism (topological per-package `semantic-release` via `@exadev/semantic-release-workspace`, OIDC trusted npm publishing, automatic sibling dependency-range rewriting) and its [known gap](../../README.md#releases) note on GitHub Packages republishing and SBOM/provenance signing, both dropped in the migration to this monorepo and not yet restored.
|
|
73
|
+
|
|
74
|
+
## Contributing
|
|
75
|
+
|
|
76
|
+
Conventional Commits, enforced workspace-wide by commitlint through a root `commit-msg` hook. Work inside `packages/archive-codec/`; see [CONTRIBUTING.md](../../CONTRIBUTING.md) for the shared git hooks and history conventions.
|
|
77
|
+
|
|
71
78
|
## License
|
|
72
79
|
|
|
73
80
|
MIT
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "archive-codec",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Recursive archive (ZIP-in-ZIP) detection and walking with depth and cumulative decompressed-size guards - zero document-format knowledge, the archive utility package for the documents.js family.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/ExaDev/
|
|
8
|
+
"url": "git+https://github.com/ExaDev/documents.js.git",
|
|
9
|
+
"directory": "packages/archive-codec"
|
|
9
10
|
},
|
|
10
|
-
"homepage": "https://github.com/ExaDev/archive-codec
|
|
11
|
+
"homepage": "https://github.com/ExaDev/documents.js/tree/main/packages/archive-codec",
|
|
11
12
|
"bugs": {
|
|
12
|
-
"url": "https://github.com/ExaDev/
|
|
13
|
+
"url": "https://github.com/ExaDev/documents.js/issues"
|
|
13
14
|
},
|
|
14
15
|
"license": "MIT",
|
|
15
16
|
"exports": {
|
|
@@ -52,8 +53,9 @@
|
|
|
52
53
|
"lint": "turbo run _lint",
|
|
53
54
|
"_lint": "eslint . --fix --cache --max-warnings 0",
|
|
54
55
|
"lint:check": "eslint . --max-warnings 0",
|
|
55
|
-
"typecheck": "turbo run _typecheck",
|
|
56
|
+
"typecheck": "turbo run _typecheck _typecheck:attw",
|
|
56
57
|
"_typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.node.json",
|
|
58
|
+
"_typecheck:attw": "attw --pack",
|
|
57
59
|
"test": "turbo run _test",
|
|
58
60
|
"_test": "vitest run",
|
|
59
61
|
"test:watch": "vitest",
|