Skip to content

Releases: facebook/jscodeshift

v0.3.10

07 Dec 22:03
Compare
Choose a tag to compare

New

--run-in-band option makes jscodeshift execute all transformations in the main process instead of splitting up over multiple workers. Useful for debugging. (#71, @zertosh)

v0.3.9

18 Nov 00:55
Compare
Choose a tag to compare

Fixes

  • Fixed promise (chain) returned by .run (#69). The code used to perform an invalid operation which let the promise fail always.

v0.3.8

21 Oct 22:08
Compare
Choose a tag to compare

Improvements

  • jscodeshift.match and many methods that accept an object as second argument for filtering / pattern matching (e.g. .find) now also accept functions / objects containing functions. This allows you to write more complex filters more easily.

    Example:

    j(source)
    .find(j.VariableDeclarator, {id: node => node.name === 'foo' || node.name === 'bar'})

finds all VariableDeclarators whose identifier is either named "foo" or "bar".

Internal changes

jscodeshift switched to jest v0.5.10, which means that tests will only run in Node v4+. jscodeshift will likely continue to function in older Node versions though.

v0.3.7

03 Sep 21:52
Compare
Choose a tag to compare

New

  • .run returns a promise that is resolved once all workers are done
  • .at accepts negative indexes to get a collection of a node from the end of the current collection

Fixes

.remove now returns the collection itself

v0.3.6

21 Aug 00:38
Compare
Choose a tag to compare

Fixes

  • Fix .closest not correctly applying filter argument (#41)

v0.3.5

12 Aug 23:27
Compare
Choose a tag to compare

Fixes

  • File extension filter only applies to files in traversed directories, not to directly passed files
  • Enforce latest recast version that fixes some printing issues
  • Remove esprima-fb dependency

Changes

  • Depend on babel-core instead of babel

v0.3.4

06 Aug 16:50
Compare
Choose a tag to compare

Fixes

  • No worker spawned when using --cpu option.

v0.3.3

31 Jul 19:35
Compare
Choose a tag to compare

Fixes

  • Printing options not passed along to root
  • Trailing and leading whitespace being removed from file (#28)

v0.3.2

31 Jul 19:34
Compare
Choose a tag to compare

Fixes

  • Really fixed install process

v0.3.0

28 Jul 17:49
Compare
Choose a tag to compare

New

  • ES7 support for transform files: Transform files (and its dependencies) are now passed through Babel (using Babel's require hook). That means you can use ES7 syntax in your transform files. If you already transpiled the transformer or don't use any ES6 features that need to be transpiled, you can pass the --no-babel option.
  • Directory traversal: Until now jscodeshift only worked on files. Now, if a path to a directory is passed, it will recursively find over all files matching the file extension provided through --extension (defaults to js).
  • Remove nodes: Node collections now have a .remove method which removes all selected nodes from the AST.