Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
napi-ci:
if: ${{ always() && !cancelled() && needs.check-changes.result == 'success' && (needs.trust-check.result == 'success' || needs.trust-check.result == 'skipped') }}
needs: [check-changes, trust-check]
uses: stella/.github/.github/workflows/rust-napi-ci.yml@a5346f3ac3ce5601ed4c38c82e8043b8a1e96a35
uses: stella/.github/.github/workflows/rust-napi-ci.yml@90c81b47c5fee6dc88e67d432cc6951e88a6724e
with:
node-version: "22"
trusted: ${{ (github.event_name != 'pull_request' || needs.trust-check.outputs.trusted == 'true') && 'true' || 'false' }}
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ on:
issue_comment:
types: [created]
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review, closed]
types:
[
opened,
synchronize,
reopened,
ready_for_review,
closed,
]

permissions:
actions: write
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/provenance-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ name: Provenance Sync

on:
pull_request:
types:
[
opened,
synchronize,
reopened,
ready_for_review,
]
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "bun.lock"
- "Cargo.lock"
Expand Down Expand Up @@ -96,7 +90,7 @@ jobs:
echo "$install_bin" >> "$GITHUB_PATH"

- name: Install dependencies
run: bun install --frozen-lockfile
run: bun install --frozen-lockfile --no-verify

- name: Generate provenance artifacts
run: |
Expand Down
4 changes: 3 additions & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
"index.cjs",
"index.d.ts",
"*.wasi.cjs",
"*.wasi-browser.js"
"*.wasi-browser.js",
"wasi-worker.mjs",
"wasi-worker-browser.mjs"
],
"overrides": [
{
Expand Down
4 changes: 2 additions & 2 deletions .provenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ notice:
- "@stll"
sbom:
exclude_regexes:
- '(^|/)dist(?:/.*)?(?:#.*)?$'
- '(^|/)wasm/dist(?:/.*)?(?:#.*)?$'
- "(^|/)dist(?:/.*)?(?:#.*)?$"
- "(^|/)wasm/dist(?:/.*)?(?:#.*)?$"
- '(^|/)[^/]+\.wasi(?:-browser)?\.(?:c?js)(?:#.*)?$'
- '(^|/)browser\.js(?:#.*)?$'
- '(^|/)[^/]+\.node(?:#.*)?$'
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,16 @@ toy regex cases.

Representative baseline from the checked-in public
harness on this machine:

- runtime: Bun `1.3.12`
- platform: macOS `26.4.1` (`Darwin arm64`)

| Scenario | `@stll/aho-corasick` | Best compared JS/TS result | Relative |
| ----------------------------------- | -------------------- | -------------------------- | -------- |
| `bible.txt`, `4.0 MB`, `20` terms | `2.27 ms` | `69.25 ms` | `30.5x` |
| `world192.txt`, `2.5 MB`, `20` terms| `1.55 ms` | `41.88 ms` | `26.9x` |
| `E.coli`, `4.6 MB`, `16` codons | `0.83 ms` | `11.00 ms` | `13.3x` |
| `bible.txt`, single-pattern baseline| `0.67 ms` | `20.10 ms` | `29.9x` |
| Scenario | `@stll/aho-corasick` | Best compared JS/TS result | Relative |
| ------------------------------------ | -------------------- | -------------------------- | -------- |
| `bible.txt`, `4.0 MB`, `20` terms | `2.27 ms` | `69.25 ms` | `30.5x` |
| `world192.txt`, `2.5 MB`, `20` terms | `1.55 ms` | `41.88 ms` | `26.9x` |
| `E.coli`, `4.6 MB`, `16` codons | `0.83 ms` | `11.00 ms` | `13.3x` |
| `bible.txt`, single-pattern baseline | `0.67 ms` | `20.10 ms` | `29.9x` |

<details>
<summary>Alternatives tested</summary>
Expand Down
15 changes: 11 additions & 4 deletions __test__/vite.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ describe("stllAhoCorasickWasmVite", () => {
const plugin = stllAhoCorasickWasmVite();

expect(plugin.name).toBe("stll-aho-corasick-wasm");
expect(plugin.config?.({ optimizeDeps: { exclude: ["existing-package"] } }))
.toEqual({
expect(
plugin.config?.({
optimizeDeps: { exclude: ["existing-package"] },
}),
).toEqual({
optimizeDeps: {
exclude: [...WASM_VITE_PACKAGES],
},
Expand All @@ -59,9 +62,13 @@ const bytes = await fetch(__wasmUrl).then((res) => res.arrayBuffer())
"@stll/aho-corasick-wasm",
);

expect(transformed).toContain("const view = new Uint8Array(bytes)");
expect(transformed).toContain(
"const view = new Uint8Array(bytes)",
);
expect(transformed).toContain("view[0] !== 0x00");
expect(transformed).toContain("@stll/aho-corasick-wasm/vite");
expect(transformed).toContain(
"@stll/aho-corasick-wasm/vite",
);
});

test("warns when napi-rs loader format changes", () => {
Expand Down
Loading
Loading