Releases: facebook/jscodeshift
Releases · facebook/jscodeshift
v0.6.0
A bunch of changes to get jscodeshift in a better shape. This is minor version update because important dependencies and parser configurations have changed.
New
- New CLI option
--parser-config
: This option accepts a path to a JSON file and overrides the default options for flow or babylon. This allows you to tweak parser settings (e.g. legacy decorators). (46d250f) - New CLI option
--stdin
: If provided, the list of files/directories is read from stdin. This makes it easier to pass large lists of files. (b6eaa0a) - New API in transforms:
api.report
lets you print arbitrary text to stdout. Useful if another tools consumes jscodeshift's stdout. (c902a00) Example:
// In the transform
api.report('some data');
// in stdout
REP path/to/file.js some data
Improvements
- Updated babylon to v7 adding support for newer flow features (#282 , @wanderley )
- Updated recast to v0.16, which includes a bunch of printing improvments (#289 , @majapw )
- Enable more features in babylon and flow (#278 , @mjesun ; #281 , @jbrown215 )
- Improve handling of large lists of files (62b12ad, 9c83c39)
Fixes
- JSXElements's
hasAttributes
method understands value-less Boolean attributes (#277 , @artemruts ) - More reliable printing to stdout (62b12ad)
Internal
v0.5.0
v0.3.32
v0.3.31
Fixes
- Printing issues by bumping recast and babylon versions ( #200 , #201 @xixixao)
- Bug with
template.expression
when a literal with no interpolation was used ( #196, @jsnajdr)
Internally
- Drop usage of
es6-promise
( #189, @wtgtybhertgeghgtwtg)
Thank you @xixixao, @jsnajdr and @wtgtybhertgeghgtwtg for contributing!
v0.3.30
v0.3.29
New
-
Collections now have a
.length
property which is equivalent to.size()
(#151, @DrewML) -
You can now reference jscodeshift as
j
directly from the transform's API options. I.e. you can writeexport default function transformer(file, { j }) { return j(file.source).toSource(); }
instead of
export default function transformer(file, api) { const j = api.jscodeshift; return j(file.source).toSource(); }
or
export default function transformer(file, {jscodeshift: j}) { return j(file.source).toSource(); }
Improved
- Experimental settings have been enabled for the flow parser, so it is now be able to process files that use e.g. public class fields (a2e4a3a)
v0.3.28
v0.3.27
v0.3.26
New
- Return value of
Runner.run
includes elapsed time and stats collected viastats
method ( #128, @iamdustan). jscodeshift --version
also prints the used recast version ( #131, @keyanzhang)