Releases: codemodsquad/astx
Releases · codemodsquad/astx
v2.0.0-beta.12
v2.0.0-beta.11
2.0.0-beta.11 (2022-09-01)
BREAKING CHANGES
This is a major refactor that finally enables parsing/generating with Babel, since recast
gives me buggy output in a lot of cases. This refactor also enables me to potentially support other parsers in the future.
The find/replace pattern format hasn't changed since v2.0.0-beta.9, but there are the following breaking changes:
General
- the parser/generator now defaults to babel. To keep using recast to preserve formatting, use
--parser recast/babel
(orexports.parser = 'recast/babel'
in your transform file) - support for
flow-parser
has been dropped since babel supports flow syntax well, and I doubt anyone was using it
Transform file API
exports.astx
is no longer called withj
/jscodeshift
properties (jscodeshift
was removed from dependencies). In place ofj
there is at
property, which is basicallyast-types
(customized for the parser's node types). For example, instead ofj.identifier('foo')
, uset.builders.identifier('foo')
.
Low-level API
- The
Astx
constructor is nownew Astx(backend, paths)
instead ofnew Astx(jscodeshift, paths)
.astx
now exports theBabelBackend
andRecastBackend
classes as well asgetBabelBackend
andgetRecastBackend
functions. - the following function signatures have also changed:
find
compileMatcher
replace
compileReplacement
runTransform
runTransformOnFile
v2.0.0-beta.9
v2.0.0-beta.8
2.0.0-beta.8 (2022-08-17)
Features
- improve syntax error output and top-level await/return parsing (4328f66)