Skip to content

Releases: facebook/jscodeshift

v0.5.0

07 Mar 05:12
Compare
Choose a tag to compare

New

  • Bump recast and babylon to support JSX fragments (#239)
  • Add dynamicImport plugin to babylon parser. (#208)
  • Allow specifying a testName for inline tests (#218)
  • Add some() and every() methods for Collection (#216)

Fixed/Improved

  • Fix error handling for http (#242)
  • Perf: replace async with neo-async (#241)
  • Fix renameTo renaming React component prop name unexpectedly (#220)
  • Fix renameTo not taking property shorthands into account (#211)

v0.3.32

20 Jun 15:08
Compare
Choose a tag to compare

New

@TheSavior added the possibility to define tests inline, without having to create separate files for input and output:

const transform = require('../myTransform');
defineInlineTest(transform, {}, 'input', 'expected output');

#204

v0.3.31

13 Jun 05:16
Compare
Choose a tag to compare

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


Thank you @xixixao, @jsnajdr and @wtgtybhertgeghgtwtg for contributing!

v0.3.30

25 Oct 20:13
Compare
Choose a tag to compare

Fixes

v0.3.29

25 Oct 17:46
Compare
Choose a tag to compare

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 write

    export 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();
    }

    (#153, @vjeux)

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

15 Aug 16:28
Compare
Choose a tag to compare

New

Changed

  • Better error message when using .get on an empty collection ( #140 , @DrewML )
  • jscodeshift now depends on recast v0.11.11 which adds better support for new flow type constructs.

v0.3.27

29 Jul 23:10
Compare
Choose a tag to compare

Fixes

v0.3.26

18 Jul 10:21
Compare
Choose a tag to compare

New

  • Return value of Runner.run includes elapsed time and stats collected via stats method ( #128, @iamdustan).
  • jscodeshift --version also prints the used recast version ( #131, @keyanzhang)

Fixes

  • renameTo ignores Identifiers that are not variable references ( #125, Robby Nevels)
  • Transformers / codemods can use experimental features ( >= stage 1) and flow type annotations again (28eb515). This was a regressions.

v0.3.25

23 Jun 00:57
Compare
Choose a tag to compare

Fixed

  • testUtils supports custom parsers (e5fb37d)
  • testUtils also passes a stub for the stats method to the transformer (e5fb37d)

v0.3.24

22 Jun 20:27
Compare
Choose a tag to compare

Fixed

  • Fixed stats output in dry run. Thanks @gaearon for noticing.