Repository navigation
v0.7.0
·
181 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
- breaking feat:
parse_<lang>,parse_<lang>_jsonandformat_<lang>return a result
instead of throwing, asstrip_typescriptdoes:{ok: true, ast | json | code}or
{ok: false, error}.erroris a plain object shaped like an AST node —
{kind, message, frame, start, end, loc},messagethe one-line summary andframethe
excerpt and caret — withkind: 'parse'for a syntax error and'refused'for
format_svelte's one refusal (a lone CR in an in-tag//comment). Argument errors and
positionless engine failures (the size cap, a trap) still throw.TsvSyntaxErroris replaced
byTsvParseError, and every error type extendsTsvError - feat: type stripping —
strip_typescript(source, options?)in@fuzdev/tsv-wasmand
@fuzdev/tsv, andtsv stripin both CLIs, turn TypeScript into JS by blanking every type
to whitespace, so every line and column stays where it was. TypeScript that blanking cannot
erase (enum, a valuenamespace, parameter properties,import =,export =,<T>x—
whaterasableSyntaxOnlyrejects — and anas/satisfieswhose blanking would regroup
its expression) is refused rather than transformed, returned as an error, not thrown. Like
format, an unnamed goal reads a module first and retries as a script, and a.mtspath is
always a module;tsv striptakes.ts/.mts/.ctspaths (exit 0 stripped, 1 refused,
2 an error). The format-only and parse-only packages do not carry it. Seedocs/strip.md - feat: a
TSMethodSignaturecarriesreadonly: truewhen written (tsc's parser accepts it;
acorn-typescript rejects it) - breaking fix: code that parsed at 0.6.0 and now rejects, as tsc or Svelte does — a bare
type assertion as an assignment target (a as T = 1,<T>a += 1; parenthesized it still
parses), and a hashbang at the start of a Svelte<script>or template expression - fix: a type argument list followed by
<, or by+/-on the next line, parses as tsc
reads it (f<T><U>(x)is a comparison) - fix: a prefix operator over a postfix update no longer continues into a call on the next
line (a = !b++then(z) => zis two statements)