diff --git a/project/FacadeGenerator.scala b/project/FacadeGenerator.scala index a03127e..664f97b 100644 --- a/project/FacadeGenerator.scala +++ b/project/FacadeGenerator.scala @@ -6,11 +6,6 @@ import os.ProcessOutput object FacadeGenerator { - os.proc("yarn", "global", "add", "react-docgen") - .call(stderr = os.Inherit, stdout = os.Inherit) - - val yarnDir = os.proc("yarn", "global", "bin").call().out.text().trim - private def comment(str: String, indent: String) = if (str.trim.isEmpty) "" else @@ -39,7 +34,7 @@ object FacadeGenerator { else base / "react-docgen.log" - os.proc(yarnDir + "/react-docgen", "-o", docGenOutputFile.toString(), subDir) + os.proc("yarn", "react-docgen", "--out", docGenOutputFile.toString(), "--exclude", ".*\\.test\\.js$", subDir) .call(cwd = repoDir, stderr = log, stdout = log) println() diff --git a/project/FacadeGeneratorPlugin.scala b/project/FacadeGeneratorPlugin.scala index 5ce749f..b71d5ec 100644 --- a/project/FacadeGeneratorPlugin.scala +++ b/project/FacadeGeneratorPlugin.scala @@ -54,6 +54,9 @@ object FacadeGeneratorPlugin extends AutoPlugin { override def projectSettings = Seq( autoImport.reactDocGenDir := cloneOrCheckoutGitRepo.value, autoImport.runYarnInstall := { + // workaround for https://github.com/reactjs/react-docgen/issues/463 + os.proc("yarn", "add", "--mutex", "network", "-W", "-D", "react-docgen", "@babel/core@7.10.5", "@babel/parser@7.10.5") + .call(cwd = autoImport.reactDocGenDir.value, stderr = os.Inherit, stdout = os.Inherit) os.proc("yarn", "install", "--mutex", "network") .call(cwd = autoImport.reactDocGenDir.value, stderr = os.Inherit, stdout = os.Inherit) },