Skip to content

Releases: thelabcorner/espack

ESPACK v0.4.1 — ESB64Native v2 shared accelerator

Choose a tag to compare

@thelabcorner thelabcorner released this 11 Aug 03:35

ESPACK v0.4.1

  • Shared accelerator cache version bumped to v2 (loader template SHARED_ACCEL_VERSION) — cache-busting the patched ESB64Native DLL so long-lived hosts stop reusing the stale v1 pool.
  • Vendored ESB64Native.dll refreshed to the patched build (segmented growable arena; fixes allocator exhaustion / error 10004).
  • Test fixtures updated for the v2 shared-accel name (espack-test.mjs); e2e version-bump mechanics already covered and passing.

ESPACK v0.4.0 — arbitrary-file payloads (EXEs, assets, anything)

Choose a tag to compare

@thelabcorner thelabcorner released this 10 Aug 19:56

ESPACK v0.4.0

New in this release

  • Arbitrary-file payloads (kind=file): --embed now accepts any file — EXEs, PNGs, fonts, JSON, anything — not just DLLs.
    • Original extension preserved in the versioned cache name: Tool_v1.exe
    • Byte-exact extraction through the same native (b64decodeToFile) and JSX lanes
    • ESPAK.extract(i) / ESPAK.payloadPath(i) materialize file payloads; ESPAK.load(i) rejects them with a clear kind=file error — a non-DLL is never handed to ExternalObject
    • GC is extension-agnostic; ESPAK.config.payloads exposes kind; extract() reports lane: "skip" on the already-extracted path
  • DLL payloads unchanged and byte-compatible with v0.3.0 — no kind emitted for them in bundles or manifests.

Example

var x = ESPAK.extract('Tool');          // { ok: true, lane: "native", path }
if (x.ok) new File(x.path).execute();   // spawn the bundled helper EXE

Validation

  • Node: 39/39 espack + 6/6 merge + vendor-sync drift guard
  • Live on Illustrator 30.6.0 via COM: ALL e2e checks passed — new kind=file scenario: byte-exact EXE extraction via the native lane, load() rejection, config kind surfaced

Assets

  • ESPAK-demo.accel.jsx — runnable standalone demo bundle (shared accelerator, #target illustrator)
  • ESB64Native.dll — the shared WHATWG-exact accelerator (9,728 B) embedded in every accel bundle

ESPACK v0.3.0 — manifest-assisted merge + shared-accel discovery

Choose a tag to compare

@thelabcorner thelabcorner released this 10 Aug 19:13

ESPACK v0.3.0

Four-layer merge architecture: one self-extracting loader per composed file, N payloads, one shared accelerator.

New in this release

  • --manifest-out (espack-build.mjs): explicit manifest sidecar (schema v1, fixed key order, payload-only — no machine paths). No-flag output is byte-identical to v0.2.0.
  • espack-merge.mjs (new CLI): merges N manifests into ONE bundle — collision policy: same name+version+same bytes dedupe; same name+version+different bytes hard error; same name+different version keeps the higher integer version; accelerator must match across manifests. Merged bundle name defaults to the first manifest (skip re-extraction).
  • Shared-accel discovery (loader): accel-less bundles now discover %LOCALAPPDATA%\espack\ESB64Native_v1.dll and decode payloads natively (3–10 µs vs ~35 ms JSX lane); embedded-accel extraction failure falls back to the on-disk shared accel. Fail-open, capability-checked.
  • Load-by-name contract: consumers load payloads by name (ESPAK.load('LibA')) — index-0 is not a stable API under merge.

Validation

  • Node: 33/33 espack + 6/6 merge + vendor-sync drift guard
  • Live on Illustrator 30.6.0 via COM: 71/71 e2e checks — multi-payload load-by-name (native, byte-exact), merged-bundle accel dedupe (one accel literal), cache migration (skip-extract + stale-old harmless), facade last-wins ordering

Assets

  • ESPAK-demo.accel.jsx — runnable standalone demo bundle (shared accelerator, #target illustrator)
  • ESB64Native.dll — the shared WHATWG-exact accelerator (9,728 B) embedded in every accel bundle

ESPACK v0.2.0

Choose a tag to compare

@thelabcorner thelabcorner released this 08 Aug 19:17

ESPACK v0.2.0 — self-extracting single-file ExternalObject bundles

Build-time packer + ES3 self-extracting loader so ExternalObject DLLs ship inside a single .jsx and materialize on disk at runtime, in the "1 + n" model:

  • 1 shared esb64 accelerator DLL (ESB64Native.dll, ~9.5 KB, WHATWG-exact) unpacked once per system into %LOCALAPPDATA%\espack\ using the bundle's inlined ES3 base64 lane, then reused by every espack bundle on that machine.
  • n payload DLLs (--embed, repeatable), each decoded by the accelerator (b64decodeToFile: native decode straight to disk — NUL-safe, no string channel) into %LOCALAPPDATA%\<bundle-name>\.

Runtime order: ES3 mode → inlined lane unpacks the accelerator (only if missing) → accelerator natively unpacks every payload → all DLLs load via ExternalObject. If the accelerator is unavailable (read-only cache, locked host), payloads fall back to the JSX lane transparently with the reason on ESPAK.lastError().

Features

  • Deterministic, dependency-free Node packer (espack-build.mjs): self-contained output — no $.evalFile, no #include
  • ESPAK.attach() capability switch: start in ES3 fallback → extract → load → swap the library's hot functions to native; stay in ES3 with a surfaced error on any failure
  • Versioned extracted filenames + best-effort GC (a loaded DLL is locked until host exit)
  • Integrity: size + versioned name; wrong-size files trigger re-extraction
  • esb64 memo makes same-session re-extraction ~0 ms

Measured on Illustrator 30.6.0 (ExtendScript 4.5.6)

  • JSX-lane decode: linear ~1 µs/base64 char, no engine wedge through 64 K (chunk 24,576)
  • Accelerator extraction (one-time per system): ~13 ms for the 9.5 KB DLL
  • Payload extraction: 3–10 µs (native b64decodeToFile)
  • Load (skip-extract path): ~1.2–1.9 ms
  • File BINARY I/O: byte-exact incl. NULs; %LOCALAPPDATA% writes verified from JSX

Quick start

npm test                                   # 28 Node tests + vendor-sync drift guard
node espack-build.mjs --embed MyDll.dll --out dist/MyBundle.jsx --name mybundle
npm run e2e                                # live end-to-end on Illustrator (requires the COM tool)

Drop the emitted .jsx into Illustrator's Scripts folder (or run via COM/DoJavaScript); it installs ESPAK on $.global and extracts/loads on demand.

Consumers

  • esb64dist/ESB64.accel.jsx: self-referential bundle; its ES3 atob extracts the DLL that accelerates atob (btoa 16 K: 18.6 ms → 317 µs, 58.5×; atob 48 K: 66.8 ms → 957 µs, 69.8×)
  • esondist/ESON.accel.jsx: auto-enables the native RFC-exact parse gate

Assets: ESPAK-demo.accel.jsx — a ready-to-run demo bundle (shared accelerator only) for live inspection.