@sysce/estrogen 0.5.4 → 0.5.6

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 CHANGED
@@ -1,208 +1,240 @@
1
- # @sysce/estrogen
2
-
3
- Post-build web obfuscator. estrogen rewrites an already built output directory in
4
- place: string and template literals into an encrypted per-file pool, proxy and
5
- store names into per-build substitutes, and the embedded wasm names to match. It
6
- leaves a build with no sensitive plaintext from the canary list and does not
7
- change what the code does.
1
+ <div align="center">
2
+ <img src="https://raw.githubusercontent.com/Fracital/estrogen/v0.5.6/docs/assets/estrogen.png" alt="estrogen" width="88" />
3
+ </div>
8
4
 
9
- estrogen raises the cost of reading a build. It is not secrecy. A decoder key ships
10
- in each file, and anyone with devtools can run the code. Do not describe the
11
- output as secret.
5
+ # @sysce/estrogen
12
6
 
13
- This package is the Node launcher and integration layer. It resolves the native
14
- binary for the running platform from a per-target optional dependency and runs
15
- it. The obfuscation engine is a separate native binary; this package only
16
- resolves and spawns it.
7
+ <div align="center">
8
+ <a href="https://www.npmjs.com/package/@sysce/estrogen"><img src="https://img.shields.io/npm/v/@sysce/estrogen?maxAge=3600&label=npm" alt="npm" /></a>
9
+ <a href="https://github.com/Fracital/estrogen/actions/workflows/ci.yml"><img src="https://github.com/Fracital/estrogen/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI" /></a>
10
+ <a href="https://github.com/Fracital/estrogen/blob/v0.5.6/LICENSE"><img src="https://img.shields.io/badge/license-ISC-blue.svg" alt="license: ISC" /></a>
11
+ <a href="https://github.com/Fracital/estrogen/issues"><img src="https://img.shields.io/github/issues/Fracital/estrogen?style=flat&color=orange" alt="GitHub issues" /></a>
12
+ <a href="https://github.com/Fracital/estrogen/stargazers"><img src="https://img.shields.io/github/stars/Fracital/estrogen?style=flat&color=orange" alt="GitHub stars" /></a>
13
+ </div>
14
+
15
+ A post-build web obfuscator. It takes a directory a bundler already produced and
16
+ rewrites the JS, HTML and SVG in place. In app scripts it pools strings,
17
+ template literals and regex patterns, disguises number and boolean literals as
18
+ equivalent expressions, and shortens local names. In vendor scripts it replaces
19
+ proxy and store names, plus the matching names in embedded wasm. It leaves no
20
+ sensitive plaintext from the canary list, and it does not change what the code
21
+ does.
22
+
23
+ It also assembles the build it protects. `estrogen build` vendors packages and
24
+ folders, from `node_modules` or a glob, into the served tree under per-build
25
+ stamped names, obfuscating them on the way in or copying them verbatim, from a
26
+ `[[vendor]]` config. `estrogen --watch` re-runs on each change, and
27
+ `--sourcemap <dir>` writes a private V3 source map outside the served tree.
28
+ estrogen runs as a command line tool, as esbuild, rsbuild, Vite and Rollup
29
+ plugins, and as an Astro integration.
30
+
31
+ estrogen is written in Rust on [OXC](https://oxc.rs) and published to npm as
32
+ [`@sysce/estrogen`](https://www.npmjs.com/package/@sysce/estrogen). The binary is
33
+ `estrogen`.
34
+
35
+ estrogen transforms a shipped build into something more fun to read for crawlers.
36
+
37
+ Try it in your browser at [estro.help](https://estro.help): the real engine
38
+ compiled to WebAssembly, running locally on what you paste. Nothing is uploaded.
17
39
 
18
40
  ## Install
19
41
 
20
42
  ```sh
21
- npm install --save-dev @sysce/estrogen
43
+ npm i -D @sysce/estrogen
22
44
  ```
23
45
 
24
- npm installs the one `@sysce/estrogen-<os>-<cpu>` package that matches your
25
- platform through optional dependencies. The supported targets are
26
- `linux-x64`, `linux-arm64`, `darwin-x64`, `darwin-arm64`, and `win32-x64`.
46
+ The package pulls the matching per-target binary (`@sysce/estrogen-<os>-<cpu>`) as
47
+ an optional dependency. Supported targets: linux x64 and arm64, darwin x64 and
48
+ arm64, win32 x64.
27
49
 
28
50
  A nightly build of `main` is published under the `nightly` dist-tag, versioned
29
- like `0.5.5-nightly.202611230617.g1a2b3c4` (UTC time and commit), once a day
51
+ like `0.5.6-nightly.202611230617.g1a2b3c4` (UTC time and commit), once a day
30
52
  when `main` has a new commit that passed CI:
31
53
 
32
54
  ```sh
33
55
  npm i -D @sysce/estrogen@nightly
34
56
  ```
35
57
 
36
- ## CLI
58
+ ## Quick start
37
59
 
38
- ```sh
39
- estrogen [options] <dir>...
40
- estrogen build [options] <dir>...
41
- ```
60
+ Run it over a built directory from the command line:
42
61
 
43
- `estrogen` rewrites each directory in place. `estrogen build` first copies the
44
- config's `[[vendor]]` inputs into each directory, then obfuscates. The common
45
- options:
46
-
47
- | flag | meaning |
48
- | ----------------------- | --------------------------------------------------------------- |
49
- | `-c`, `--config <file>` | TOML config file |
50
- | `--canary <file>` | canary list the output must not leak |
51
- | `--names <file>` | proxy and store names to rename |
52
- | `--sourcemap <dir>` | write maps here, outside the served tree, for private debugging |
53
- | `--seed <hex>` | fixed seed for reproducible output (tests only) |
54
- | `-j`, `--jobs <n>` | worker count |
55
- | `--check` | report and run the canary check without writing |
56
- | `--watch` | re-run on each change until stopped |
57
- | `--quiet` | print nothing but errors |
58
- | `-v`, `--verbose` | per-file detail |
59
- | `-V`, `--version` | print the version |
60
- | `-h`, `--help` | print help |
61
-
62
- `estrogen --help` lists the rest: the VM switches (`--no-vm`, `--no-vm-glob`,
63
- `--module-glob`, `--top-level`, `--shared-runtime`, `--no-function-source`,
64
- `--no-function-source-warning`), the asset passes (`--no-minify`,
65
- `--no-optimize-svg`, `--no-minify-html`, `--no-minify-css`), vendoring
66
- (`--vendor-file`, `--manifest`, `--no-manifest`) and the live injector
67
- (`--cloak-target`, `--cloaks`, `--cloak-shortcut`, `--cloak-mount`). The
68
- repository's `docs/CLI.md` covers each one.
69
-
70
- Exit code 0 means success. Any nonzero code means the build was not fully
71
- rewritten; estrogen writes no partial output for a file it cannot handle and names
72
- the file and the reason.
73
-
74
- ## Node API
75
-
76
- ```ts
77
- import { obfuscate } from '@sysce/estrogen';
78
-
79
- const report = await obfuscate({
80
- dirs: 'dist',
81
- canary: 'canary-list.json',
82
- });
83
- console.log(report.ok, report.durationMs);
62
+ ```sh
63
+ npx estrogen dist
84
64
  ```
85
65
 
86
- `obfuscate(options)` spawns the binary once over one or more directories. It
87
- resolves with a `Report` when estrogen exits 0 and rejects with an `EstrogenError`
88
- (carrying the partial report) when it exits nonzero or fails to start.
66
+ Or run it after an esbuild build, over the output directory:
89
67
 
90
- ## esbuild
91
-
92
- ```ts
68
+ ```js
93
69
  import estrogen from '@sysce/estrogen/esbuild';
94
70
  import { build } from 'esbuild';
95
71
 
96
72
  await build({
97
- entryPoints: ['src/app.ts'],
73
+ entryPoints: ['src/index.ts'],
98
74
  bundle: true,
99
75
  outdir: 'dist',
100
- plugins: [estrogen({ canary: 'canary-list.json' })],
76
+ plugins: [estrogen()],
101
77
  });
102
78
  ```
103
79
 
104
- The plugin runs in `onEnd`, after esbuild writes the bundle. It takes the output
105
- directory from `outdir`, or from the directory of `outfile`, resolved against
106
- `absWorkingDir`. It skips a build that produced errors and turns an estrogen failure
107
- into an esbuild error.
108
-
109
- ## Rsbuild
80
+ Or add it to an Astro build, where it runs on `astro:build:done` over the output
81
+ directory:
110
82
 
111
- ```ts
112
- import { defineConfig } from '@rsbuild/core';
113
- import { pluginEstrogen } from '@sysce/estrogen/rsbuild';
83
+ ```js
84
+ import estrogen from '@sysce/estrogen/astro';
85
+ import { defineConfig } from 'astro/config';
114
86
 
115
87
  export default defineConfig({
116
- plugins: [pluginEstrogen({ canary: 'canary-list.json' })],
88
+ integrations: [estrogen()],
117
89
  });
118
90
  ```
119
91
 
120
- The plugin runs in `onAfterBuild`, after Rsbuild writes the output. It takes the
121
- dist directory from `api.context.distPath`, the path Rsbuild resolved for the
122
- build.
123
-
124
- ## Vite, Rollup and Astro
125
-
126
- ```ts
127
- import { pluginEstrogen } from '@sysce/estrogen/vite';
128
- import { defineConfig } from 'vite';
129
-
130
- export default defineConfig({
131
- plugins: [pluginEstrogen({ canary: 'canary-list.json' })],
132
- });
133
- ```
134
-
135
- The Vite plugin runs after `vite build` writes `build.outDir` and does nothing
136
- under `vite serve`. `@sysce/estrogen/rollup` exports the same `pluginEstrogen`
137
- and runs in `writeBundle` over `output.dir`. `@sysce/estrogen/astro` default
138
- exports an integration that runs on `astro:build:done`.
139
-
140
- `esbuild`, `@rsbuild/core`, `vite`, `rollup` and `astro` are optional peer
141
- dependencies: install whichever one you use. The plugin options are the same as
142
- `obfuscate` options without `dirs`, which each plugin fills in from the build.
143
-
144
- ## Text cloak and live injector
145
-
146
- The opt-in text cloak uses the same `#eckey` and AES-256-CBC wire format as
147
- the existing HolyText implementations. The server helpers create a fresh
148
- key and IV for each response; custom elements render decrypted text inside
149
- closed shadow roots. The `cloak`, `cloak/server`, `cloak/react`,
150
- `cloak/preact`, `cloak/vue`, `cloak/svelte`, `cloak/solid` and `cloak/astro`
151
- subpaths all belong to this package. Only the framework you use is needed.
152
-
153
- ```ts
154
- import {
155
- cloakKeyMarkup,
156
- cloakText,
157
- createEncryptionSession,
158
- } from '@sysce/estrogen/cloak/server';
159
-
160
- const session = createEncryptionSession();
161
- const html = cloakKeyMarkup(session) + cloakText('Private title', session);
162
- ```
163
-
164
- Include the returned markup in your HTML response and import
165
- `@sysce/estrogen/cloak` in your browser bundle to register its custom
166
- elements. The key is shipped to the browser; this is obfuscation, not secrecy.
167
-
168
- To inject a separate built frontend that appears when Ctrl+E is pressed:
169
-
170
- ```ts
171
- await obfuscate({
172
- dirs: 'dist',
173
- injector: {
174
- target: 'index.html',
175
- cloaks: new URL('../cloaks', import.meta.url),
176
- shortcut: 'Ctrl+E',
177
- },
178
- });
179
- ```
180
-
181
- The frontend is served from `_estrogen/cloaks/` in a closed-shadow iframe.
182
- For partial-page overlays, set `mount: '#decoy'`. Build frontend assets with
183
- a relative public base to keep CSS, modules and fonts at their copied paths.
184
- The same `injector` option works through the existing build plugins. The CLI
185
- accepts `--cloak-target`, repeatable `--cloaks`, `--cloak-mount` and
186
- `--cloak-shortcut`. See `docs/CLOAK.md` in the repository for details.
187
-
188
- ## Binary resolution
189
-
190
- The `estrogen` command and `obfuscate()` look up the `@sysce/estrogen-<os>-<cpu>`
191
- package for the running platform and run `bin/estrogen` from it
192
- (`bin/estrogen.exe` on Windows). An install with `--omit=optional` or
193
- `--no-optional` leaves that package out, and both then fail with a
194
- `MissingBinaryError` that names the package to install. To run a binary built
195
- elsewhere, set `ESTROGEN_BINARY=/path/to/estrogen` for the command, or pass
196
- `binaryPath` to `obfuscate()` or any plugin.
197
-
198
- ## Source maps
199
-
200
- A map that traces the output back to its source is the one thing the
201
- obfuscation withholds, so the default writes none and strips any
202
- `sourceMappingURL` comment from each file it processes. Pass `--sourcemap <dir>`
203
- (or the `sourcemap` option) to write maps outside the served tree for private
204
- debugging, and keep that directory private.
92
+ Run estrogen on fresh bundler output. A later pass recognizes its own comment
93
+ header or existing generated code structure and skips protected files. Use
94
+ `--no-header`, `[options] header = false`, or the Node option `header: false`
95
+ to omit the default `generated by https://estro.help` comment. Decoder-backed
96
+ output remains safe to repeat and check; decoder-less no-header output needs a
97
+ fresh build. Changed options or canary lists need a fresh build too.
98
+
99
+ To bring packages into the build as well, run `estrogen build dist` with a
100
+ `[[vendor]]` config. See the [CLI reference](https://github.com/Fracital/estrogen/blob/v0.5.6/docs/CLI.md).
101
+
102
+ ## Benchmarks
103
+
104
+ estrogen and [javascript-obfuscator](https://github.com/javascript-obfuscator/javascript-obfuscator)
105
+ 5.10.1 build the same inputs, and each build runs in its own Node 24.19.0
106
+ process on a Ryzen 9 7950X. The suite is ten small workloads in
107
+ `bench/workloads` (median of 5 processes, 10 timed calls each); the library row
108
+ is Prettier 3.10.1's browser build, 610 KB of minified ES modules, formatting one
109
+ file 20 times (median of 3 processes). javascript-obfuscator runs its three
110
+ shipped presets unchanged, `debugProtection` and `disableConsoleOutput`
111
+ included. Every build returns the same result as the original, and the VM
112
+ compiled every file it was given. The method and full tables are in
113
+ [docs/BENCHMARKS.md](https://github.com/Fracital/estrogen/blob/v0.5.6/docs/BENCHMARKS.md); `npm run bench` reruns it.
114
+
115
+ | | estrogen, VM | estrogen, `--no-vm` | javascript-obfuscator, default | medium | high |
116
+ | ---------------------------------------- | ------------ | ------------------- | ------------------------------ | -------- | --------- |
117
+ | Suite, slowdown (geomean) | 22.9x | 2.29x | 1.19x | 5.75x | 8.14x |
118
+ | Suite, gzip size (geomean) | 19.6x | 2.88x | 1.87x | 15.2x | 61.7x |
119
+ | Suite, build of 10 files | 12 ms | 9 ms | 330 ms | 746 ms | 1,436 ms |
120
+ | Prettier, format 20 times (native 12 ms) | 276 ms | 28 ms | 16 ms | 124 ms | 393 ms |
121
+ | Prettier, gzip (native 169 KB) | 316 KB | 326 KB | 296 KB | 1,320 KB | 3,263 KB |
122
+ | Prettier, import (native 14 ms) | 67 ms | 33 ms | 21 ms | 147 ms | 522 ms |
123
+ | Prettier, build | 75 ms | 36 ms | 2,753 ms | 6,170 ms | 10,378 ms |
124
+
125
+ estrogen builds 27 to 140 times faster: Prettier takes 75 ms through the VM
126
+ and 10.4 s through the high preset. The default preset costs the least at run
127
+ time, 1.19x on the suite, and leaves strings readable in a plain string array;
128
+ `--no-vm` encrypts every string for 2.29x.
129
+
130
+ The VM is the slowest on the small workloads, 22.9x, because each one is a tight
131
+ loop that runs every instruction through the interpreter. On Prettier it runs at
132
+ 22x, ahead of the high preset's 32x, and its output is smaller: 316 KB gzip
133
+ against 3,263 KB, and 1.9x native against the high preset's 19x. On the small
134
+ workloads the VM's size is mostly the runtime, about 9 KB gzip per file, which
135
+ `--shared-runtime` ships once for a build of ES modules. Hot code can leave the
136
+ VM with `--no-vm-glob`.
137
+
138
+ <img alt="Geometric mean slowdown, gzip size and build time for each tool and preset" src="https://raw.githubusercontent.com/Fracital/estrogen/v0.5.6/docs/assets/bench/summary.png">
139
+
140
+ <img alt="Prettier format time, gzip size and build time for each tool and preset" src="https://raw.githubusercontent.com/Fracital/estrogen/v0.5.6/docs/assets/bench/library.png">
141
+
142
+ <img alt="Steady-state slowdown against native for each workload, tool and preset" src="https://raw.githubusercontent.com/Fracital/estrogen/v0.5.6/docs/assets/bench/slowdown.png">
143
+
144
+ ## Compared with javascript-obfuscator
145
+
146
+ [javascript-obfuscator](https://github.com/javascript-obfuscator/javascript-obfuscator)
147
+ 5.10.1 is the open-source package. Its bytecode VM and HTML parsing are Pro
148
+ features of obfuscator.io: the source is uploaded to its cloud API, which needs a
149
+ paid token, so the benchmark above runs the local package.
150
+
151
+ | Technique | estrogen | javascript-obfuscator |
152
+ | --------------------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
153
+ | Bytecode VM | Local, on by default, opcode bytes shuffled per build | Pro only, compiled on obfuscator.io's servers |
154
+ | String literals | Every string in a ChaCha20 pool, keyed per file | String array; base64 or RC4 is opt-in (RC4 in the high preset), 75% of strings by default |
155
+ | Template literals | Static parts pooled; regex patterns pooled too | Rewritten to `concat` calls; parts pooled at the string array threshold |
156
+ | Property names | Static member names and object keys pooled | Member names through the string array; object keys with `transformObjectKeys` |
157
+ | Number and boolean literals | Rewritten as xor, sum and difference expressions, `!0`, `!![]` | `numbersToExpressions` (medium and high presets); `!![]`, `![]` |
158
+ | Local names | Shortened; module top-level bindings too | Hexadecimal or mangled; `renameGlobals` and `renameProperties` opt-in |
159
+ | Control flow flattening | No separate pass; VM code runs as bytecode | Yes (medium and high presets) |
160
+ | Dead code injection | No | Yes (medium and high presets) |
161
+ | Self-defending, anti-debug | No | `selfDefending`, `debugProtection`, `disableConsoleOutput`, `domainLock` |
162
+ | `Function.toString` | VM functions print `[native code]`, in every realm the page opens | Prints the obfuscated source |
163
+ | HTML and SVG | Inline scripts, markup pass, HTML, SVG and CSS minified | Pro only (`parseHtml`) |
164
+ | Proxy runtimes and wasm | Proxy and store names replaced, plus the matching names in embedded wasm | No |
165
+ | Input | A built output directory, rewritten in place; fails closed; canary check | A source string, file or directory of scripts |
166
+ | Vendoring | `estrogen build` copies packages into the build under stamped names | No |
167
+ | Source maps | Private V3 maps written outside the served tree | Inline or separate |
168
+ | Reproducible output | `--seed` | `seed` |
169
+ | Integrations | esbuild, rsbuild, Vite and Rollup plugins and an Astro integration in the package; `--watch` | webpack, Rollup, gulp and Grunt plugins as separate packages; esbuild and Vite plugins by third parties |
170
+ | Implementation | Rust on OXC, one native binary per platform, files in parallel | TypeScript on Node |
171
+ | In the browser | [estro.help](https://estro.help), the engine as WebAssembly, run locally | [obfuscator.io](https://obfuscator.io) |
172
+ | License | ISC | BSD-2-Clause |
173
+
174
+ ## Documentation
175
+
176
+ - [Text cloak and live injector](https://github.com/Fracital/estrogen/blob/v0.5.6/docs/CLOAK.md): per-request ciphertext,
177
+ framework components, Ctrl+E overlays and opt-in frontend build inputs.
178
+ - [CLI reference](https://github.com/Fracital/estrogen/blob/v0.5.6/docs/CLI.md): every flag, examples, exit codes, the
179
+ fail-closed rule.
180
+ - [Node API](https://github.com/Fracital/estrogen/blob/v0.5.6/docs/NODE-API.md): `obfuscate()`, the esbuild, rsbuild, Vite and
181
+ Rollup plugins, the Astro integration, the options object, the `Report` shape.
182
+ - [Rust API](https://github.com/Fracital/estrogen/blob/v0.5.6/docs/RUST-API.md): the `estrogen-core` public surface.
183
+ - [Integration](https://github.com/Fracital/estrogen/blob/v0.5.6/docs/INTEGRATION.md): esbuild, rsbuild, Vite, Rollup, Astro, and
184
+ a plain CLI step in `package.json`.
185
+ - [Benchmarks](https://github.com/Fracital/estrogen/blob/v0.5.6/docs/BENCHMARKS.md): what the VM and the literal pool cost at
186
+ run time and load, per workload, and the harness in `bench/`.
187
+ - [Project status](https://github.com/Fracital/estrogen/blob/v0.5.6/docs/PROJECT_STATUS.md): current validation and remaining
188
+ compatibility work.
189
+ - [Proxy name rename](https://github.com/Fracital/estrogen/blob/v0.5.6/docs/PROXY-NAMES.md): the `[proxy]` table, the vendor
190
+ and build scopes, `keep`, and the text a rename must not change.
191
+ - [Proxy integration coverage](https://github.com/Fracital/estrogen/blob/v0.5.6/docs/PROXY_COVERAGE.md): per-site builds,
192
+ browser evidence, VM percentages and remaining gaps.
193
+ - [Wiki](https://github.com/Fracital/estrogen/wiki): install, configuration,
194
+ source maps, security and limits, contributing.
195
+
196
+ ## Powering
197
+
198
+ <table>
199
+ <tr><th></th><th>Site</th><th>Link</th><th>Repo</th></tr>
200
+ <tr>
201
+ <td align="center" valign="middle"><img src="https://raw.githubusercontent.com/Fracital/estrogen/v0.5.6/docs/assets/brands/abstract.png" alt="abstract v2" width="28"></td>
202
+ <td valign="middle">abstract v2</td>
203
+ <td valign="middle"><a href="https://abstracteducation.loan">abstracteducation.loan</a></td>
204
+ <td valign="middle"></td>
205
+ </tr>
206
+ <tr>
207
+ <td align="center" valign="middle"><img src="https://raw.githubusercontent.com/Fracital/estrogen/v0.5.6/docs/assets/brands/fracital.svg" alt="Fracital" width="28"></td>
208
+ <td valign="middle">Fracital</td>
209
+ <td valign="middle"><a href="https://fracit.al">fracit.al</a></td>
210
+ <td valign="middle"><a href="https://github.com/Fracital/Fracital"><code>Fracital/Fracital</code></a></td>
211
+ </tr>
212
+ <tr>
213
+ <td align="center" valign="middle"><img src="https://raw.githubusercontent.com/Fracital/estrogen/v0.5.6/docs/assets/brands/systemya.png" alt="SystemYA" width="28"></td>
214
+ <td valign="middle">SystemYA</td>
215
+ <td valign="middle"><a href="https://systemya.fracit.al">systemya.fracit.al</a></td>
216
+ <td valign="middle"><a href="https://github.com/Fracital/SystemYA"><code>Fracital/SystemYA</code></a></td>
217
+ </tr>
218
+ <tr>
219
+ <td align="center" valign="middle"><img src="https://raw.githubusercontent.com/Fracital/estrogen/v0.5.6/docs/assets/brands/stomp.png" alt="STomp" width="28"></td>
220
+ <td valign="middle">STomp (powerMouse)</td>
221
+ <td valign="middle"><a href="https://stomp.fracit.al">stomp.fracit.al</a></td>
222
+ <td valign="middle"><a href="https://github.com/Fracital/powerMouse"><code>Fracital/powerMouse</code></a></td>
223
+ </tr>
224
+ <tr>
225
+ <td align="center" valign="middle"><img src="https://raw.githubusercontent.com/Fracital/estrogen/v0.5.6/docs/assets/brands/holy-unblocker.svg" alt="Holy Unblocker" width="28"></td>
226
+ <td valign="middle">Holy Unblocker</td>
227
+ <td valign="middle"><a href="https://holyunb.locker">holyunb.locker</a></td>
228
+ <td valign="middle"><a href="https://github.com/holy-unblocker/website2"><code>holy-unblocker/website2</code></a></td>
229
+ </tr>
230
+ </table>
231
+
232
+ ## Credits
233
+
234
+ | | GitHub | Name |
235
+ | ----------------------------------------------------------------------------- | ------------------------------ | ---------- |
236
+ | <img src="https://raw.githubusercontent.com/Fracital/estrogen/v0.5.6/docs/assets/am%20i%20cool%20yet.png" width="64" alt="e9x's avatar"> | [@e9x](https://github.com/e9x) | David Reed |
205
237
 
206
238
  ## License
207
239
 
208
- ISC. David Reed.
240
+ ISC. See [LICENSE](https://github.com/Fracital/estrogen/blob/v0.5.6/LICENSE).
@@ -119,8 +119,13 @@ function run(binaryPath, args, dirs, options) {
119
119
  };
120
120
  reject(new report_js_1.EstrogenError(`estrogen failed to start: ${error.message}`, report));
121
121
  });
122
- child.on('close', (code, signal) => {
122
+ child.on('close', async (code, signal) => {
123
123
  const exitCode = code ?? -1;
124
+ const run = options.report === undefined
125
+ ? undefined
126
+ : await (0, promises_1.readFile)((0, node_path_1.resolve)(options.cwd ?? process.cwd(), options.report), 'utf8')
127
+ .then((text) => JSON.parse(text))
128
+ .catch(() => undefined);
124
129
  // A plugin never prints stderr, so pass the warning through here.
125
130
  const warning = (0, report_js_1.functionSourceWarning)(stderr);
126
131
  if (warning !== undefined)
@@ -136,6 +141,7 @@ function run(binaryPath, args, dirs, options) {
136
141
  durationMs: Date.now() - started,
137
142
  details: (0, report_js_1.parseDetails)(stdout),
138
143
  warning,
144
+ run,
139
145
  };
140
146
  if (report.ok) {
141
147
  resolve(report);
@@ -10,6 +10,16 @@ export interface LiveInjectorOptions {
10
10
  shortcut?: string;
11
11
  /** CSS selector for the decoy region to cover; leave unset to cover the viewport. */
12
12
  mount?: string;
13
+ /**
14
+ * Served directory for the runtime and frontends, relative to each dist
15
+ * root. Defaults to a name derived from the injector config.
16
+ */
17
+ path?: string;
18
+ /**
19
+ * Global name for the `show`, `hide`, `toggle` and `select` API. Unset, the
20
+ * runtime exposes no global.
21
+ */
22
+ api?: string;
13
23
  }
14
24
  /** One reference rewrite on a vendored file (`[[vendor.rewrite]]`). */
15
25
  export interface VendorRewrite {
@@ -82,6 +92,11 @@ export interface Options {
82
92
  * survive verbatim in the output. estrogen fails nonzero if one does.
83
93
  */
84
94
  canary?: string;
95
+ /**
96
+ * Match canaries without regard to ASCII case (`--canary-ignore-case`), so
97
+ * `scramjet` also matches `Scramjet`. The default is exact case.
98
+ */
99
+ canaryIgnoreCase?: boolean;
85
100
  /**
86
101
  * Names file (`--names <file>`). The proxy and store names to rename for this
87
102
  * site.
@@ -106,8 +121,10 @@ export interface Options {
106
121
  */
107
122
  jobs?: number;
108
123
  /**
109
- * Check mode (`--check`). Report what estrogen would do and run the canary check
110
- * without writing changes. Useful in CI to gate a build.
124
+ * Check mode (`--check`). Run the passes and the canary check over a finished
125
+ * output directory without writing changes, and fail with exit code 2 on any
126
+ * unprotected file: one a run would still obfuscate, or an eligible file no
127
+ * pass would change. Useful in CI after the protect step.
111
128
  */
112
129
  check?: boolean;
113
130
  /**
@@ -134,6 +151,44 @@ export interface Options {
134
151
  * CSS as the bundler wrote it.
135
152
  */
136
153
  minifyCss?: boolean;
154
+ /**
155
+ * Compile inline `<script>` bodies to the bytecode VM (`--inline-vm`). Off by
156
+ * default: inline scripts take the literal pool, because each inline VM chunk
157
+ * carries its own runtime.
158
+ */
159
+ inlineVm?: boolean;
160
+ /**
161
+ * Write the generated comment header. Default `true`. `false` passes
162
+ * `--no-header`; decoder-backed repeat runs recognize the existing code
163
+ * structure instead. Decoder-less output needs a fresh build.
164
+ * Cannot be combined with `marker`.
165
+ */
166
+ header?: boolean;
167
+ /**
168
+ * The header comment for each protected file (`--marker <text>`), in place of
169
+ * `generated by https://estro.help`. An empty string is the legacy spelling of
170
+ * `header: false`. Cannot be combined with `header: false`.
171
+ */
172
+ marker?: string;
173
+ /**
174
+ * Write a JSON report of the run to this file (`--report <file>`), relative
175
+ * to {@link Options.cwd}: each file's status and protection (`vm`,
176
+ * `vm-classic`, `vm-shared`, `literals`, `proxy`, `markup`, `minified`), the
177
+ * reason the VM declined a chunk, every canary leak, and each failed gate.
178
+ * {@link obfuscate} reads it back into {@link Report.run}, on success and on
179
+ * failure.
180
+ */
181
+ report?: string;
182
+ /**
183
+ * Fail the run (exit 4) when any JS chunk is protected by something other
184
+ * than the VM (`--require-vm`).
185
+ */
186
+ requireVm?: boolean;
187
+ /**
188
+ * Fail the run (exit 5) when VM chunks turn more than this many functions
189
+ * into strings (`--max-function-source <n>`).
190
+ */
191
+ maxFunctionSource?: number;
137
192
  /** Inject a selected frontend in a closed shadow overlay after obfuscation. Off by default. */
138
193
  injector?: LiveInjectorOptions;
139
194
  /**
@@ -187,8 +242,9 @@ export interface Options {
187
242
  verbose?: boolean;
188
243
  /**
189
244
  * Path to the estrogen binary. Overrides the per-platform package resolution.
190
- * Set it to run a locally built binary or a stub in tests. Normally leave it
191
- * unset and let the matching `@sysce/estrogen-<os>-<cpu>` package provide it.
245
+ * Set it to run a locally built binary or a stub in tests. When unset, the
246
+ * `ESTROGEN_BINARY` environment variable is used if set, and otherwise the
247
+ * matching `@sysce/estrogen-<os>-<cpu>` package provides it.
192
248
  */
193
249
  binaryPath?: string;
194
250
  /** Working directory for the spawned process. Defaults to `process.cwd()`. */
@@ -31,6 +31,8 @@ function buildArgs(options) {
31
31
  args.push('--config', options.config);
32
32
  if (options.canary !== undefined)
33
33
  args.push('--canary', options.canary);
34
+ if (options.canaryIgnoreCase)
35
+ args.push('--canary-ignore-case');
34
36
  if (options.names !== undefined)
35
37
  args.push('--names', options.names);
36
38
  if (options.sourcemap !== undefined)
@@ -47,6 +49,20 @@ function buildArgs(options) {
47
49
  args.push('--no-minify-html');
48
50
  if (options.minifyCss === false)
49
51
  args.push('--no-minify-css');
52
+ if (options.inlineVm)
53
+ args.push('--inline-vm');
54
+ if (options.header === false && options.marker !== undefined)
55
+ throw new Error('estrogen: header: false cannot be combined with marker');
56
+ if (options.header === false)
57
+ args.push('--no-header');
58
+ if (options.marker !== undefined)
59
+ args.push('--marker', options.marker);
60
+ if (options.report !== undefined)
61
+ args.push('--report', options.report);
62
+ if (options.requireVm)
63
+ args.push('--require-vm');
64
+ if (options.maxFunctionSource !== undefined)
65
+ args.push('--max-function-source', String(options.maxFunctionSource));
50
66
  if (options.moduleGlobs)
51
67
  for (const pattern of options.moduleGlobs)
52
68
  args.push('--module-glob', pattern);
@@ -77,6 +93,10 @@ function buildArgs(options) {
77
93
  args.push('--cloak-shortcut', options.injector.shortcut);
78
94
  if (options.injector.mount)
79
95
  args.push('--cloak-mount', options.injector.mount);
96
+ if (options.injector.path)
97
+ args.push('--cloak-path', options.injector.path);
98
+ if (options.injector.api)
99
+ args.push('--cloak-api', options.injector.api);
80
100
  }
81
101
  if (options.quiet)
82
102
  args.push('--quiet');
@@ -6,7 +6,11 @@
6
6
  export interface Report {
7
7
  /** True when estrogen exited 0. */
8
8
  ok: boolean;
9
- /** The process exit code. 0 on success. */
9
+ /**
10
+ * The process exit code. 0 on success, 1 for an error, 2 for an unprotected
11
+ * file under `check`, 3 for a canary in the output, 4 for a non-VM chunk
12
+ * under `requireVm`, and 5 for `maxFunctionSource` exceeded.
13
+ */
10
14
  exitCode: number;
11
15
  /** The directories estrogen was asked to rewrite. */
12
16
  dirs: string[];
@@ -39,6 +43,12 @@ export interface Report {
39
43
  * shape is the binary's own and may grow; read it defensively.
40
44
  */
41
45
  details?: unknown;
46
+ /**
47
+ * The JSON run report, read back from {@link Options.report} when it is set
48
+ * and the binary wrote it. Its `version` field names the shape; read it
49
+ * defensively.
50
+ */
51
+ run?: unknown;
42
52
  }
43
53
  /**
44
54
  * Thrown when estrogen exits nonzero or fails to launch. Carries the partial
@@ -30,9 +30,11 @@ export declare class MissingBinaryError extends Error {
30
30
  * Locate the estrogen binary for the running platform.
31
31
  *
32
32
  * Resolution order:
33
- * 1. `override`, when given, is returned as is (the `binaryPath` option and the
34
- * bin launcher's own override use this).
35
- * 2. Otherwise the matching `@sysce/estrogen-<os>-<cpu>` package is resolved
33
+ * 1. `override`, when given, is returned as is (the `binaryPath` option uses
34
+ * this).
35
+ * 2. Otherwise the `ESTROGEN_BINARY` environment variable, when set, so the
36
+ * `estrogen` command, {@link obfuscate} and every plugin run the same binary.
37
+ * 3. Otherwise the matching `@sysce/estrogen-<os>-<cpu>` package is resolved
36
38
  * through `req.resolve` and the binary path inside it is returned.
37
39
  *
38
40
  * `req` is a `require` function anchored in the launcher package, so resolution
@@ -60,15 +60,17 @@ exports.MissingBinaryError = MissingBinaryError;
60
60
  * The tail of every {@link MissingBinaryError} message: the two ways to run a
61
61
  * binary that did not come from a per-platform package.
62
62
  */
63
- const OVERRIDE_HINT = 'To use a binary built elsewhere, set ESTROGEN_BINARY for the estrogen ' +
64
- 'command, or pass the binaryPath option to obfuscate() and the plugins.';
63
+ const OVERRIDE_HINT = 'To use a binary built elsewhere, set ESTROGEN_BINARY, or pass the ' +
64
+ 'binaryPath option to obfuscate() and the plugins.';
65
65
  /**
66
66
  * Locate the estrogen binary for the running platform.
67
67
  *
68
68
  * Resolution order:
69
- * 1. `override`, when given, is returned as is (the `binaryPath` option and the
70
- * bin launcher's own override use this).
71
- * 2. Otherwise the matching `@sysce/estrogen-<os>-<cpu>` package is resolved
69
+ * 1. `override`, when given, is returned as is (the `binaryPath` option uses
70
+ * this).
71
+ * 2. Otherwise the `ESTROGEN_BINARY` environment variable, when set, so the
72
+ * `estrogen` command, {@link obfuscate} and every plugin run the same binary.
73
+ * 3. Otherwise the matching `@sysce/estrogen-<os>-<cpu>` package is resolved
72
74
  * through `req.resolve` and the binary path inside it is returned.
73
75
  *
74
76
  * `req` is a `require` function anchored in the launcher package, so resolution
@@ -80,6 +82,9 @@ const OVERRIDE_HINT = 'To use a binary built elsewhere, set ESTROGEN_BINARY for
80
82
  function resolveBinaryPath(req, override) {
81
83
  if (override !== undefined && override !== '')
82
84
  return override;
85
+ const fromEnv = process.env.ESTROGEN_BINARY;
86
+ if (fromEnv !== undefined && fromEnv !== '')
87
+ return fromEnv;
83
88
  const key = targetKey();
84
89
  const pkg = platformPackageName();
85
90
  if (key === null || pkg === null) {
@@ -116,8 +116,13 @@ function run(binaryPath, args, dirs, options) {
116
116
  };
117
117
  reject(new EstrogenError(`estrogen failed to start: ${error.message}`, report));
118
118
  });
119
- child.on('close', (code, signal) => {
119
+ child.on('close', async (code, signal) => {
120
120
  const exitCode = code ?? -1;
121
+ const run = options.report === undefined
122
+ ? undefined
123
+ : await readFile(resolvePath(options.cwd ?? process.cwd(), options.report), 'utf8')
124
+ .then((text) => JSON.parse(text))
125
+ .catch(() => undefined);
121
126
  // A plugin never prints stderr, so pass the warning through here.
122
127
  const warning = functionSourceWarning(stderr);
123
128
  if (warning !== undefined)
@@ -133,6 +138,7 @@ function run(binaryPath, args, dirs, options) {
133
138
  durationMs: Date.now() - started,
134
139
  details: parseDetails(stdout),
135
140
  warning,
141
+ run,
136
142
  };
137
143
  if (report.ok) {
138
144
  resolve(report);
@@ -10,6 +10,16 @@ export interface LiveInjectorOptions {
10
10
  shortcut?: string;
11
11
  /** CSS selector for the decoy region to cover; leave unset to cover the viewport. */
12
12
  mount?: string;
13
+ /**
14
+ * Served directory for the runtime and frontends, relative to each dist
15
+ * root. Defaults to a name derived from the injector config.
16
+ */
17
+ path?: string;
18
+ /**
19
+ * Global name for the `show`, `hide`, `toggle` and `select` API. Unset, the
20
+ * runtime exposes no global.
21
+ */
22
+ api?: string;
13
23
  }
14
24
  /** One reference rewrite on a vendored file (`[[vendor.rewrite]]`). */
15
25
  export interface VendorRewrite {
@@ -82,6 +92,11 @@ export interface Options {
82
92
  * survive verbatim in the output. estrogen fails nonzero if one does.
83
93
  */
84
94
  canary?: string;
95
+ /**
96
+ * Match canaries without regard to ASCII case (`--canary-ignore-case`), so
97
+ * `scramjet` also matches `Scramjet`. The default is exact case.
98
+ */
99
+ canaryIgnoreCase?: boolean;
85
100
  /**
86
101
  * Names file (`--names <file>`). The proxy and store names to rename for this
87
102
  * site.
@@ -106,8 +121,10 @@ export interface Options {
106
121
  */
107
122
  jobs?: number;
108
123
  /**
109
- * Check mode (`--check`). Report what estrogen would do and run the canary check
110
- * without writing changes. Useful in CI to gate a build.
124
+ * Check mode (`--check`). Run the passes and the canary check over a finished
125
+ * output directory without writing changes, and fail with exit code 2 on any
126
+ * unprotected file: one a run would still obfuscate, or an eligible file no
127
+ * pass would change. Useful in CI after the protect step.
111
128
  */
112
129
  check?: boolean;
113
130
  /**
@@ -134,6 +151,44 @@ export interface Options {
134
151
  * CSS as the bundler wrote it.
135
152
  */
136
153
  minifyCss?: boolean;
154
+ /**
155
+ * Compile inline `<script>` bodies to the bytecode VM (`--inline-vm`). Off by
156
+ * default: inline scripts take the literal pool, because each inline VM chunk
157
+ * carries its own runtime.
158
+ */
159
+ inlineVm?: boolean;
160
+ /**
161
+ * Write the generated comment header. Default `true`. `false` passes
162
+ * `--no-header`; decoder-backed repeat runs recognize the existing code
163
+ * structure instead. Decoder-less output needs a fresh build.
164
+ * Cannot be combined with `marker`.
165
+ */
166
+ header?: boolean;
167
+ /**
168
+ * The header comment for each protected file (`--marker <text>`), in place of
169
+ * `generated by https://estro.help`. An empty string is the legacy spelling of
170
+ * `header: false`. Cannot be combined with `header: false`.
171
+ */
172
+ marker?: string;
173
+ /**
174
+ * Write a JSON report of the run to this file (`--report <file>`), relative
175
+ * to {@link Options.cwd}: each file's status and protection (`vm`,
176
+ * `vm-classic`, `vm-shared`, `literals`, `proxy`, `markup`, `minified`), the
177
+ * reason the VM declined a chunk, every canary leak, and each failed gate.
178
+ * {@link obfuscate} reads it back into {@link Report.run}, on success and on
179
+ * failure.
180
+ */
181
+ report?: string;
182
+ /**
183
+ * Fail the run (exit 4) when any JS chunk is protected by something other
184
+ * than the VM (`--require-vm`).
185
+ */
186
+ requireVm?: boolean;
187
+ /**
188
+ * Fail the run (exit 5) when VM chunks turn more than this many functions
189
+ * into strings (`--max-function-source <n>`).
190
+ */
191
+ maxFunctionSource?: number;
137
192
  /** Inject a selected frontend in a closed shadow overlay after obfuscation. Off by default. */
138
193
  injector?: LiveInjectorOptions;
139
194
  /**
@@ -187,8 +242,9 @@ export interface Options {
187
242
  verbose?: boolean;
188
243
  /**
189
244
  * Path to the estrogen binary. Overrides the per-platform package resolution.
190
- * Set it to run a locally built binary or a stub in tests. Normally leave it
191
- * unset and let the matching `@sysce/estrogen-<os>-<cpu>` package provide it.
245
+ * Set it to run a locally built binary or a stub in tests. When unset, the
246
+ * `ESTROGEN_BINARY` environment variable is used if set, and otherwise the
247
+ * matching `@sysce/estrogen-<os>-<cpu>` package provides it.
192
248
  */
193
249
  binaryPath?: string;
194
250
  /** Working directory for the spawned process. Defaults to `process.cwd()`. */
@@ -27,6 +27,8 @@ export function buildArgs(options) {
27
27
  args.push('--config', options.config);
28
28
  if (options.canary !== undefined)
29
29
  args.push('--canary', options.canary);
30
+ if (options.canaryIgnoreCase)
31
+ args.push('--canary-ignore-case');
30
32
  if (options.names !== undefined)
31
33
  args.push('--names', options.names);
32
34
  if (options.sourcemap !== undefined)
@@ -43,6 +45,20 @@ export function buildArgs(options) {
43
45
  args.push('--no-minify-html');
44
46
  if (options.minifyCss === false)
45
47
  args.push('--no-minify-css');
48
+ if (options.inlineVm)
49
+ args.push('--inline-vm');
50
+ if (options.header === false && options.marker !== undefined)
51
+ throw new Error('estrogen: header: false cannot be combined with marker');
52
+ if (options.header === false)
53
+ args.push('--no-header');
54
+ if (options.marker !== undefined)
55
+ args.push('--marker', options.marker);
56
+ if (options.report !== undefined)
57
+ args.push('--report', options.report);
58
+ if (options.requireVm)
59
+ args.push('--require-vm');
60
+ if (options.maxFunctionSource !== undefined)
61
+ args.push('--max-function-source', String(options.maxFunctionSource));
46
62
  if (options.moduleGlobs)
47
63
  for (const pattern of options.moduleGlobs)
48
64
  args.push('--module-glob', pattern);
@@ -73,6 +89,10 @@ export function buildArgs(options) {
73
89
  args.push('--cloak-shortcut', options.injector.shortcut);
74
90
  if (options.injector.mount)
75
91
  args.push('--cloak-mount', options.injector.mount);
92
+ if (options.injector.path)
93
+ args.push('--cloak-path', options.injector.path);
94
+ if (options.injector.api)
95
+ args.push('--cloak-api', options.injector.api);
76
96
  }
77
97
  if (options.quiet)
78
98
  args.push('--quiet');
@@ -6,7 +6,11 @@
6
6
  export interface Report {
7
7
  /** True when estrogen exited 0. */
8
8
  ok: boolean;
9
- /** The process exit code. 0 on success. */
9
+ /**
10
+ * The process exit code. 0 on success, 1 for an error, 2 for an unprotected
11
+ * file under `check`, 3 for a canary in the output, 4 for a non-VM chunk
12
+ * under `requireVm`, and 5 for `maxFunctionSource` exceeded.
13
+ */
10
14
  exitCode: number;
11
15
  /** The directories estrogen was asked to rewrite. */
12
16
  dirs: string[];
@@ -39,6 +43,12 @@ export interface Report {
39
43
  * shape is the binary's own and may grow; read it defensively.
40
44
  */
41
45
  details?: unknown;
46
+ /**
47
+ * The JSON run report, read back from {@link Options.report} when it is set
48
+ * and the binary wrote it. Its `version` field names the shape; read it
49
+ * defensively.
50
+ */
51
+ run?: unknown;
42
52
  }
43
53
  /**
44
54
  * Thrown when estrogen exits nonzero or fails to launch. Carries the partial
@@ -30,9 +30,11 @@ export declare class MissingBinaryError extends Error {
30
30
  * Locate the estrogen binary for the running platform.
31
31
  *
32
32
  * Resolution order:
33
- * 1. `override`, when given, is returned as is (the `binaryPath` option and the
34
- * bin launcher's own override use this).
35
- * 2. Otherwise the matching `@sysce/estrogen-<os>-<cpu>` package is resolved
33
+ * 1. `override`, when given, is returned as is (the `binaryPath` option uses
34
+ * this).
35
+ * 2. Otherwise the `ESTROGEN_BINARY` environment variable, when set, so the
36
+ * `estrogen` command, {@link obfuscate} and every plugin run the same binary.
37
+ * 3. Otherwise the matching `@sysce/estrogen-<os>-<cpu>` package is resolved
36
38
  * through `req.resolve` and the binary path inside it is returned.
37
39
  *
38
40
  * `req` is a `require` function anchored in the launcher package, so resolution
@@ -52,15 +52,17 @@ export class MissingBinaryError extends Error {
52
52
  * The tail of every {@link MissingBinaryError} message: the two ways to run a
53
53
  * binary that did not come from a per-platform package.
54
54
  */
55
- const OVERRIDE_HINT = 'To use a binary built elsewhere, set ESTROGEN_BINARY for the estrogen ' +
56
- 'command, or pass the binaryPath option to obfuscate() and the plugins.';
55
+ const OVERRIDE_HINT = 'To use a binary built elsewhere, set ESTROGEN_BINARY, or pass the ' +
56
+ 'binaryPath option to obfuscate() and the plugins.';
57
57
  /**
58
58
  * Locate the estrogen binary for the running platform.
59
59
  *
60
60
  * Resolution order:
61
- * 1. `override`, when given, is returned as is (the `binaryPath` option and the
62
- * bin launcher's own override use this).
63
- * 2. Otherwise the matching `@sysce/estrogen-<os>-<cpu>` package is resolved
61
+ * 1. `override`, when given, is returned as is (the `binaryPath` option uses
62
+ * this).
63
+ * 2. Otherwise the `ESTROGEN_BINARY` environment variable, when set, so the
64
+ * `estrogen` command, {@link obfuscate} and every plugin run the same binary.
65
+ * 3. Otherwise the matching `@sysce/estrogen-<os>-<cpu>` package is resolved
64
66
  * through `req.resolve` and the binary path inside it is returned.
65
67
  *
66
68
  * `req` is a `require` function anchored in the launcher package, so resolution
@@ -72,6 +74,9 @@ const OVERRIDE_HINT = 'To use a binary built elsewhere, set ESTROGEN_BINARY for
72
74
  export function resolveBinaryPath(req, override) {
73
75
  if (override !== undefined && override !== '')
74
76
  return override;
77
+ const fromEnv = process.env.ESTROGEN_BINARY;
78
+ if (fromEnv !== undefined && fromEnv !== '')
79
+ return fromEnv;
75
80
  const key = targetKey();
76
81
  const pkg = platformPackageName();
77
82
  if (key === null || pkg === null) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sysce/estrogen",
3
- "version": "0.5.4",
4
- "description": "Post-build web obfuscator. Rewrites a built dist in place; raises the cost of reading it, not secrecy, since a key ships in each file.",
3
+ "version": "0.5.6",
4
+ "description": "Post-build web obfuscator in Rust. Rewrites a built directory in place: JavaScript into a per-build bytecode VM, strings into an encrypted pool, and HTML, SVG and wasm names to match.",
5
5
  "license": "ISC",
6
6
  "author": "David Reed",
7
7
  "repository": {
@@ -203,16 +203,17 @@
203
203
  "test:cloak": "npm run build && node --test test/cloak.test.mjs test/cloak-span.test.mjs",
204
204
  "test:function-source": "npm run build && node --test test/function-source-warning.test.mjs",
205
205
  "test:vendor": "npm run build && node --test test/vendor.test.mjs",
206
+ "test:resolve": "npm run build && node --test test/resolve-binary.test.mjs",
206
207
  "test:astro": "npm run build && astro build --root ./test/fixtures/astro && node test/cloak-astro-ssr.mjs",
207
208
  "test:browser": "node test/cloak-browser.mjs && node test/cloak-framework-browser.mjs && node test/cloak-astro-browser.mjs && node test/injector-browser.mjs && node test/vm-browser-compat.mjs",
208
- "prepublishOnly": "npm run build"
209
+ "prepack": "npm run build && node scripts/readme.mjs"
209
210
  },
210
211
  "optionalDependencies": {
211
- "@sysce/estrogen-darwin-arm64": "0.5.4",
212
- "@sysce/estrogen-darwin-x64": "0.5.4",
213
- "@sysce/estrogen-linux-arm64": "0.5.4",
214
- "@sysce/estrogen-linux-x64": "0.5.4",
215
- "@sysce/estrogen-win32-x64": "0.5.4"
212
+ "@sysce/estrogen-darwin-arm64": "0.5.6",
213
+ "@sysce/estrogen-darwin-x64": "0.5.6",
214
+ "@sysce/estrogen-linux-arm64": "0.5.6",
215
+ "@sysce/estrogen-linux-x64": "0.5.6",
216
+ "@sysce/estrogen-win32-x64": "0.5.6"
216
217
  },
217
218
  "peerDependencies": {
218
219
  "@rsbuild/core": "*",