-
Notifications
You must be signed in to change notification settings - Fork 477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Console output from transforms is silently swallowed #81
Comments
Mmh, not sure. According to the docs, However, even if it worked, I'm not sure it would be useful, since the workers run concurrently and any output produced by the child processes might be intermingled with the output of the parent process. Have you considered using the |
Not sure if something changed in the codebase that enabled this, but this works with the current version of export default function transformer(file, api) {
console.log('heyyyyyyy');
return null;
}; |
Yep, works fine for me too. |
In facebook#79, I made it so the transformation is skipped in some cases, in particular when the capitalization is invalid. This broke an assumption elsewhere in the code that `convertNodeToJSX` always returns a `JSXElement`, so there was a crash if a skipped element was used as a child. To fix, we can just wrap in a `JSXExpressionContainer` for that case.
This does not shows everything though: module.exports = function (file, api) {
const j = api.jscodeshift;
const { statement } = j.template;
console.log("Starting"); // this is shown
return j(file.source)
.find(j.FunctionExpression)
.replaceWith((p) => {
console.log("What the", p); // not logged
const root = j(p.value);
const variablesToReplace = {};
return p;
});
}; |
sorry, my bad, I was using FunctionExpression to look for ArrowFunctionExpressions. It works. |
I'm trying to run transformations but having a really hard time because all my files get skipped and I have no indication of why.
Each of the transformation files use console.log() to tell the user why files were skipped, but for whatever reason, the console.log() statements never make it into stdout.
The text was updated successfully, but these errors were encountered: