refactor(as): consolidate the AS SDK into assemblyscript/ (one package, like go/ and rust/) - #18
Merged
Merged
Conversation
…e, like go/)
Mano's runtime foundation landed in a separate assemblyscript-sdk/
(@pyde-net/sdk) folder; go/ and rust/ each keep raw + ergonomic in ONE
folder. This merges the ergonomic layer into the existing assemblyscript/
(@pyde-net/host) so there's one AS package per the cross-language layout.
- move assembly/{abort,borsh,calldata,codec,ctx,exit,hash,raw,types,u128}.ts
into assemblyscript/assembly/ (alongside the raw host_fns.ts + child.ts)
- rewire imports: @pyde-net/host/assembly -> ./host_fns (same package now);
the example + tests -> @pyde-net/host
- index.ts now exports the ergonomic surface (codec/types/u128/borsh +
ctx/calldata/exit/hash) + child; the raw declarations stay in ./host_fns,
re-exported via ./raw, so `caller` (raw) and `ctx.caller` don't collide
(mirrors how go/ hides the raw bindings)
- package.json: @pyde-net/host absorbs the SDK (as-bignum dep, asbuild +
parity test), bumped to alpha.10; asconfig gains runtime:stub
- move the scalar-store-as example + codec-parity test in
BREAKING: @pyde-net/host no longer re-exports the raw host fns at the top
level — import them from "@pyde-net/host/assembly/raw" (or /host_fns).
Verified: package builds; codec parity 47×2 byte-identical to Rust borsh;
child test 13/13; the acceptance example builds against the consolidated
package.
zarah-s
pushed a commit
that referenced
this pull request
Jul 30, 2026
…le (#21) Adds the generated-entry-dispatch section otigen's AS codegen needs as its canonical reference: the `__<fn>_impl` author seam, the full otigen.toml → AssemblyScript type-mapping table, the index.ts + abort wiring, the signature-drift rules, and how the seam is opted into and out of. Also corrects two things the Phase 1 consolidation (#18) left stale: - The Install example imported `sload` / `sstore` / `emit_event` / `hash_poseidon2` from `@pyde-net/host/assembly`. Since #18, index.ts re-exports the ergonomic wrappers and the raw externs live behind `/assembly/raw`, so that snippet fails with `Element not found` — the first thing a new author would copy. Replaced with both subpaths and why they're split; the replacement was compiled with asc to confirm every name resolves. - The opening claimed "One file, no runtime code, no external dependencies". All three stopped being true with the borsh / codec / u128 / ctx / calldata / exit / hash modules and the as-bignum dependency, and it contradicted the codecs the new section documents. Docs only — no code, no ABI, no package surface change.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mano's AS runtime foundation (#14) landed in a separate
assemblyscript-sdk/(@pyde-net/sdk) folder, butgo/andrust/each keep raw + ergonomic in ONE folder. This consolidates the ergonomic layer into the existingassemblyscript/(@pyde-net/host) so the cross-language layout is consistent.assemblyscript/assembly/alongside the rawhost_fns.ts+child.ts@pyde-net/host/assembly→./host_fns; example + tests →@pyde-net/hostindex.tsnow exports the ergonomic surface +child; the raw declarations stay in./host_fns, re-exported via./raw, socaller(raw) andctx.callerdon't collide (mirrors howgo/hides its raw bindings)@pyde-net/hostabsorbs the SDK (as-bignumdep,asbuild+ parity test), bumped toalpha.10; asconfig gainsruntime: stubscalar-store-asacceptance example + codec-parity test inBREAKING:
@pyde-net/hostno longer re-exports the raw host fns at the top level — import them from@pyde-net/host/assembly/raw(or/host_fns).Verified locally: package builds; codec parity 47×2 byte-identical to Rust borsh; child test 13/13; the acceptance example builds against the consolidated package.
Heads-up for @manoahLinks: base future AS-SDK work on the consolidated
assemblyscript/(@pyde-net/host) — the ergonomic layer now lives there, not inassemblyscript-sdk/.