Releases: codemodsquad/astx
Releases · codemodsquad/astx
v2.0.0-beta.2
2.0.0-beta.2 (2021-08-14)
Bug Fixes
- --babel-generator: use
@babel/generator
from deps if it isn't installed in your project (673a2a6)
v2.0.0-beta.1
2.0.0-beta.1 (2021-08-14)
Bug Fixes
- babel-generator: use concise mode (3c60692)
- babel-generator issues (0065da9)
- bug with replacing an ExpressionStatement with multiple Statements (536e8db)
- capture escape bugs (bebd341)
- implement convertReplacement system (72b155c)
- issue in GenericNodeMatcher/GenericNodeReplacement (ab46d74)
- remove Collection from Astx API (bc00c2e)
- replace lodash.cloneDeep (8fcdf7d)
- string capture escaping (420a5e0)
- Astx: support passing ASTNode to replace (33289ee)
- Capture: allow (JSX)Identifier captues/backreferences to match (6beb33a)
- Capture: allow identifier backreference to match shorthand property (b918816)
- compileMatcher: improve JSX children matching (645e55d)
- compileMatcher: use ASTPaths instead of ASTNodes (8c390f8)
- parseFindOrReplace: default to function and class declarations instead of expressions (65320b1)
- replace: fix regression (f89611d)
- replace: support replacing with non-expression nodes (e66a40c)
- more WIP on compileReplacement (ddd43ba)
- support $id: $typeAnnotation capture and replace (59ffe86)
- use $$ instead of $_ for array capture (5363913)
- various issues, add renderPropsStylesRefactor test case (0b67737)
- transform: work around ridiculous recast behavior (e804b44)
Features
- add --babel-generator option (4df4cbe)
- implement /**/ extraction in patterns (8c1a7e6)
- Astx: add .closest, make API more like jscodeshift (54d6110)
- Astx: add .withCaptures() method (e1f270a)
- Astx: add captures() and arrayCaptures() methods (e5c0dc3)
- Astx: add size(), length, matches(), match(), paths(), nodes(), filter() (35f98ce)
- find: add <...> type annotation matching (ec88368)
- find: add withCaptures option (94e58cb)
- find: implement (...) and fix variable declarator matching (21fb1cf)
- find: implement (...), (...), <...>, and <...> (7b67082)
- transform: format reported Astx collections (109b217)
- allow transform fn to return false (a12bd7c)
- more refactoring and fixes (ccc602f)
- WIP on compile-replacement (6808561)
BREAKING CHANGES
- you must now begin array capture variables with
$$
instead of$_
, and use leading$_
as an escape for$
instead of$$
. This is to mimic how jQuery$
/$$
select single/multiple elements respectively. Hopefully it should be easier for everyone to understand for array capture - removed
replaceMatches
andReplaceOptions
exports Astx
: import paths have been moved toastx/jscodeshift
(there will also beastx/babel
in the future)Astx
: use.find`...`().replace`...`()
instead of.find`...`.replace`...`
Astx
: use.replace`...`()
instead of.replace`...`
Astx
: no longer has aroot
property, and the constructor no longer accepts a jscodeshift Collection instance.Astx
:.findStatements
and.findAuto
have been removed, now you can use `.find for statements or a single node pattern.compileMatcher
:Match
andStatementsMatch
have been merged into a single type.
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.1.0
v1.0.0
1.0.0 (2021-04-09)
Bug Fixes
- drop support for jscodeshift-style transforms, smart-restart mode (c0b299a)
- enable replacing statements with an expression (978e0ff)
- implement template literal string capture replacement (e3559de)
- minor runner fix, and document CLI (9d4f71f)
- object pattern, test more things (0492957)
- potential single-node capture and replace issues (531ca6d)
- remove console.log statements (693d0e5)
- remove obsolete type exports (0129034)
- use babel-parse-wild-code instead of jscodeshift-choose-parser (4112063)
- cli: make exports.find/exports.replace apply prettier if available (fb3eaf9)
- find: ignore extra field (6e6fa52)
- runner: use new Astx API (a9887d0)
- runTransform: improve globbing and file resolution (f712466)
- template: handle errors properly with flow parser (38fcadb)
- code parsing and object matching tests (6a365c0)
- drop requirement for tailing $ in object spread captures, document object matching (a6989d2)
- issues with literals, flow parser (0a9379b)
- lodash dependency, and precompile matcher, it will be needed for fast object matching (5becffd)
- multiple replacement bug (3240481)
- replace print-diff with better output (117da7e)
- safe find statements order (8ca6ebe)
- workaround ast-types bugs (c2b7f2f)
- cli: check that prettier API is as expected (321fa1e)
- compileMatcher: performance improvements (a32346e)
- replace: statement replacement logic (ba811af)
- sortFlags: memoize to improve performance (f39f971)
Features
- implement string matching (ca6184c)
- cli: --find, --replace, --watch, --parser options (10794e9)
- add CLI (f4e0783)
- add where option to find and replace, fix quoting in replace (64eb000)
- create more convenient API, start working on README (df756a1)
- implement backreferences (37b6abc)
- implement list matching for some node types (ea7c016)
- implement multi-statement replacement (234a6bb)
- implement object rest spread capture [WIP] (e97c8d5)
- initial commit (5a6fa31)
- initial commit (c62c8c4)
- make replacement work for new list matching use cases (6782a1b)
- support array matching on function types, object types, variable declarations (78ee78d)
- support finding array of statements [WIP] (e2d6a72)
- support list matching in object expressions and classes (0a417dd)
- support list matching on import specifiers, JSX attributes/children (c8bb893)
- Astx: allow replace function to return a string (99cd30f)
- cli: support exports.astx = and glob dirs (811edf4)