mirror of https://github.com/status-im/metro.git
Move "transformFile" to "transform" to match worker interface
Reviewed By: cpojer Differential Revision: D6968803 fbshipit-source-id: 7dee92d5a58e18bb1ee0d5cd5748acd44cde5b18
This commit is contained in:
parent
b129827fa2
commit
e651b81881
|
@ -158,7 +158,7 @@ class Bundler {
|
|||
resetCache: opts.resetCache,
|
||||
sourceExts: opts.sourceExts,
|
||||
transformCode: (module, code, transformCodeOptions) =>
|
||||
this._transformer.transformFile(
|
||||
this._transformer.transform(
|
||||
module.path,
|
||||
module.localPath,
|
||||
code,
|
||||
|
|
|
@ -64,7 +64,7 @@ describe('Transformer', function() {
|
|||
const transformOptions = {arbitrary: 'options'};
|
||||
const code = 'arbitrary(code)';
|
||||
|
||||
new Transformer(opts).transformFile(
|
||||
new Transformer(opts).transform(
|
||||
fileName,
|
||||
localPath,
|
||||
code,
|
||||
|
@ -108,7 +108,7 @@ describe('Transformer', function() {
|
|||
expect.assertions(6);
|
||||
|
||||
return transformer
|
||||
.transformFile(fileName, localPath, '', true, {})
|
||||
.transform(fileName, localPath, '', true, {})
|
||||
.catch(function(error) {
|
||||
expect(error.type).toEqual('TransformError');
|
||||
expect(error.message).toBe(
|
||||
|
|
|
@ -91,7 +91,7 @@ module.exports = class Transformer {
|
|||
return await this._worker.minify(filename, code, sourceMap);
|
||||
}
|
||||
|
||||
async transformFile(
|
||||
async transform(
|
||||
filename: string,
|
||||
localPath: LocalPath,
|
||||
code: string,
|
||||
|
@ -123,7 +123,7 @@ module.exports = class Transformer {
|
|||
|
||||
return data.result;
|
||||
} catch (err) {
|
||||
debug('Failed transformFile file', filename);
|
||||
debug('Failed transform file', filename);
|
||||
|
||||
if (err.loc) {
|
||||
throw this._formatBabelError(err, filename);
|
||||
|
|
Loading…
Reference in New Issue