refactor: rewrite CLI and internal architecture #41
Reference in New Issue
Block a user
Delete Branch "feat/updated-arch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
The old architecture used a monolithic
main()with a custom arg parser, an event-emitter-based runtime, and a plugin system for optional features.This PR rewrites the CLI and internal architecture to be modular, extensible, and built around a registry of interchangeable components.
convert,reduce,engine list).internal/registry) for marshalers, codecs, and engines, with BFS-based conversion path resolution.internal/cli) withRepr,Engine,Process,Marshaler, andConversioninterfaces wrapping genericpkg/types.Runtimewith a simplerEngine/Processmodel (pkg/engine).Codec[T, U]andMarshaler[T]interfaces (pkg/codec).saccharine/tokensub-package intosaccharineand rename scanner functions fromparse*toscan*.lambda.Marshalerandsaccharine.Marshalerimplementingcodec.Marshaler.pkg/runtime,pkg/expr,internal/plugins,internal/statistics.make linttarget and update golangci-lint config.Decisions
cli.Repr(wrappingany) enables the registry to work with heterogeneous types while keepingpkg/generics type-safe.Processmodel can support hooks differently in the future.Benefits
Engine/Processmodel reduces complexity compared to the event-emitter runtime.tokensub-package reduces import depth and package sprawl.Checklist
<type>/<description>). Always use underscores.