This repository was archived by the owner on Jun 9, 2026. It is now read-only.
0.7.9
What's New
Trait System (@arkstack/common)
A composable mixin pattern for TypeScript classes. Define behaviour units with trait(), compose them onto any class with use(), and verify membership at runtime with uses().
const Auditable = trait(Base => class Auditable extends Base {
audit () { return `Audited at ${Date.now()}` }
})
class MyModel extends use(Auditable) { }
uses(new MyModel(), Auditable) // true- Traits compose in any order — rightmost wins on conflicts
- Static methods on traits are promoted to the host class
- Trait methods are available in the host constructor after
super() instanceofworks correctly across the full composition chain- Proxy-returning constructors are supported
Full Changelog: https://github.com/arkstack-tmp/arkstack/commits/0.7.9