12 Commits

Author SHA1 Message Date
Logan Smyth
53e4d74ebe
Treat all filenames as absolute paths. (#8044) 2018-05-24 20:56:19 -07:00
Logan Smyth
69cca412eb
Make the filename option, as exposed to the plugins, consistently relative to the working directory (#7956)
| Q                        | A <!--(Can use an emoji 👍) -->
| ------------------------ | ---
| Fixed Issues?            | 
| Patch: Bug Fix?          | Y
| Major: Breaking Change?  | N
| Minor: New Feature?      |
| Tests Added + Pass?      | Yes
| Documentation PR         | <!-- If so, add `[skip ci]` to your commit message to skip CI -->
| Any Dependency Changes?  |
| License                  | MIT

Currently the `opts.filename` value exposed to plugins is just whatever the user passed. While it _could_ be relative to the working directory, if Babel was passed an absolute URL, it'll be absolute.

This PR explicitly ensures the filename is a relative path based on the working directory. This also exposes an officially endorsed API for reading the working directory path.
2018-05-21 17:10:57 -07:00
Deven Bansod
c8d82d6483 Migrate all remaining fixtures to jest expect 2018-03-24 16:22:20 +05:30
Nicolò Ribaudo
8659e1a88c Remove old expected.{js,json} files (#7187) 2018-01-09 13:10:30 -06:00
Raja Sekar
0f42accb87 Renamed files 2018-01-09 15:36:42 +01:00
Henry Zhu
691f90a774 Scoped: change test imports to @babel/ [skip ci] 2017-10-16 22:49:56 -04:00
Sergey Rubanov
292c3ca206 Refactor test packages to use ES modules instead of CJS (#5138) 2017-01-16 11:25:04 -05:00
Alexander Kotliarskyi
8fa1174b32 Skip adding __source if it already exists (#3504) 2016-05-16 16:45:33 -04:00
Alex Kotliarskyi
1f543e1bca Add jsx source annotations only to the files that contain JSX 2016-01-20 14:23:27 -08:00
Alex Kotliarskyi
34116faaf8 Fix tests for react-jsx-source 2016-01-20 13:25:53 -08:00
Alex Kotliarskyi
9f76cf7c42 Hoist current file name for transform-react-jsx-source
For better tooling support it's important to include absolute file name for JSX
elements. However, having them inline will inflate resulting file size, so we
move the file name to a constant declared at the beginning of the file and
reference it from `__source` attribute.
2016-01-19 20:10:53 -08:00
jim
f4049db99d Added jsx-source plugin 2015-11-10 13:49:46 -08:00