@@ -29,32 +29,32 @@ namespace React.AspNet
2929#endif
3030{
3131 /// <summary>
32- /// File system that serves transformed JSX files.
32+ /// File system that serves transformed JavaScript files.
3333 /// </summary>
34- public class JsxFileSystem : IOwinFileSystem
34+ public class BabelFileSystem : IOwinFileSystem
3535 {
36- private readonly IJsxTransformer _transformer ;
36+ private readonly IBabel _transformer ;
3737 private readonly IOwinFileSystem _physicalFileSystem ;
3838 private readonly string [ ] _extensions ;
3939
4040 /// <summary>
41- /// Creates a new instance of the JsxFileSystem .
41+ /// Creates a new instance of the BabelFileSystem .
4242 /// </summary>
43- /// <param name="transformer">JSX transformer used to compile JSX files</param>
43+ /// <param name="transformer">Babel transformer used to compile files</param>
4444 /// <param name="root">The root directory</param>
45- /// <param name="extensions">Extensions of files that will be treated as JSX files</param>
46- public JsxFileSystem ( IJsxTransformer transformer , string root , IEnumerable < string > extensions )
45+ /// <param name="extensions">Extensions of files that will be treated as JavaScript files</param>
46+ public BabelFileSystem ( IBabel transformer , string root , IEnumerable < string > extensions )
4747 : this ( transformer , new PhysicalFileSystem ( root ) , extensions )
4848 {
4949 }
5050
5151 /// <summary>
52- /// Creates a new instance of the JsxFileSystem .
52+ /// Creates a new instance of the BabelFileSystem .
5353 /// </summary>
54- /// <param name="transformer">JSX transformer used to compile JSX files</param>
54+ /// <param name="transformer">Babel transformer used to compile files</param>
5555 /// <param name="fileSystem">File system used to look up files</param>
56- /// <param name="extensions">Extensions of files that will be treated as JSX files</param>
57- public JsxFileSystem ( IJsxTransformer transformer , IOwinFileSystem fileSystem , IEnumerable < string > extensions )
56+ /// <param name="extensions">Extensions of files that will be treated as JavaScript files</param>
57+ public BabelFileSystem ( IBabel transformer , IOwinFileSystem fileSystem , IEnumerable < string > extensions )
5858 {
5959 _transformer = transformer ;
6060 _physicalFileSystem = fileSystem ;
@@ -68,12 +68,12 @@ public JsxFileSystem(IJsxTransformer transformer, IOwinFileSystem fileSystem, IE
6868
6969#if OWIN
7070 /// <summary>
71- /// Locate a JSX file at the given path.
71+ /// Locate a JavaScript file at the given path.
7272 /// </summary>
7373 /// <param name="subpath">The path that identifies the file</param>
7474 /// <param name="fileInfo">The discovered file if any</param>
7575 /// <returns>
76- /// True if a JSX file was located at the given path
76+ /// True if a JavaScript file was located at the given path
7777 /// </returns>
7878 public bool TryGetFileInfo ( string subpath , out IFileInfo fileInfo )
7979 {
@@ -89,7 +89,7 @@ public bool TryGetFileInfo(string subpath, out IFileInfo fileInfo)
8989 if ( internalFileInfo . IsDirectory )
9090 return false ;
9191
92- fileInfo = new JsxFileInfo ( _transformer , internalFileInfo ) ;
92+ fileInfo = new BabelFileInfo ( _transformer , internalFileInfo ) ;
9393 return true ;
9494 }
9595
@@ -108,14 +108,14 @@ public bool TryGetDirectoryContents(string subpath, out IEnumerable<IFileInfo> c
108108#else
109109
110110 /// <summary>
111- /// Locate a JSX file at the given path.
111+ /// Locate a file at the given path.
112112 /// </summary>
113113 /// <param name="subpath">The path that identifies the file</param>
114114 /// <returns>The discovered file if any</returns>
115115 public IFileInfo GetFileInfo ( string subpath )
116116 {
117117 var internalFileInfo = _physicalFileSystem . GetFileInfo ( subpath ) ;
118- return new JsxFileInfo ( _transformer , internalFileInfo ) ;
118+ return new BabelFileInfo ( _transformer , internalFileInfo ) ;
119119 }
120120
121121 /// <summary>
@@ -143,19 +143,19 @@ IExpirationTrigger IOwinFileSystem.Watch(string filter)
143143 }
144144#endif
145145
146- private class JsxFileInfo : IFileInfo
146+ private class BabelFileInfo : IFileInfo
147147 {
148- private readonly IJsxTransformer _jsxTransformer ;
148+ private readonly IBabel _babel ;
149149 private readonly IFileInfo _fileInfo ;
150150 private readonly Lazy < byte [ ] > _content ;
151151
152- public JsxFileInfo ( IJsxTransformer jsxTransformer , IFileInfo fileInfo )
152+ public BabelFileInfo ( IBabel babel , IFileInfo fileInfo )
153153 {
154- _jsxTransformer = jsxTransformer ;
154+ _babel = babel ;
155155 _fileInfo = fileInfo ;
156156
157157 _content = new Lazy < byte [ ] > (
158- ( ) => Encoding . UTF8 . GetBytes ( _jsxTransformer . TransformJsxFile ( fileInfo . PhysicalPath ) )
158+ ( ) => Encoding . UTF8 . GetBytes ( _babel . TransformFile ( fileInfo . PhysicalPath ) )
159159 ) ;
160160 }
161161
0 commit comments