Forked from hermes-frontend, stripped openclaw/bun specifics: - Auth tokens: openclaw_session -> nyx_session - Vite proxy: localhost:3003 -> localhost:8000 (assay) - Prod WS: wss://assay.loop42.de/ws - Workspace paths: removed openclaw-specific paths - Added missing deps: @heroicons/vue, overlayscrollbars-vue - Branding: title -> nyx Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
magic-string-ast
magic-string with AST shortcut.
Install
# npm
npm i magic-string-ast
# jsr
npx jsr add -D @sxzz/magic-string-ast
Usage
import { MagicStringAST } from 'magic-string-ast'
const offset = 0
const node = {
// AST node with `start` and `end` properties
start: 6,
end: 7,
// ...
}
const s = new MagicStringAST('const a = 1')
s.sliceNode(node, { offset }) // 'a'
s.removeNode(node)
s.moveNode(node, 0)
s.overwriteNode(node, 'foo')
// support source-map, inspired by muggle-string.
s.replaceRange(5, 5, '(', expression, ')') // appendLeft
s.replaceRange(5, 8, '(', expression, ')') // overwrite
s.replaceRange(5, 8) // remove
For more APIs, see docs and magic-string.
Sponsors
License
MIT License © 2023-PRESENT Kevin Deng