sh-ast@0.3.0
Minor Changes
-
#24
b93cba8Thanks @mike-north! - Generated node types (node-types.d.ts) now give every scalar leaf field a concrete TypeScript type instead of leaving it asunknown— e.g.ShLitNode.value: string | undefined,ShStmtNode.negated: boolean | undefined,ShRedirectNode.op: number | undefined(see issue #22).tools/gen-visitor-keyswas only classifying node-reference/interface-union child fields; plain scalars fell through to the[field: string]: unknowncatch-all every node still carries.Types are derived from the pinned
mvdan.cc/sh/v3 v3.13.1struct definitions plus the shim's actual runtime serialization:bool/stringfields map straight through, and mvdan/sh'suint32-backed operator-enum fields (RedirOperator,BinAritOperator,CaseOperator, ...) are typednumber— those types implement onlyfmt.Stringer, notjson.Marshaler, so the shim's encoder serializes them as plain JSON numbers, not string tokens.Every generated interface still carries
[field: string]: unknownas an escape hatch for fields this generator doesn't yet classify — this is unchanged and intentional, not a hedge against the newly-typed fields.