Skip to content

Commit

Permalink
Workaround for reactjs/react-docgen#463
Browse files Browse the repository at this point in the history
  • Loading branch information
nafg committed Aug 16, 2020
1 parent ee1d120 commit 9230142
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 1 addition & 6 deletions project/FacadeGenerator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
3 changes: 3 additions & 0 deletions project/FacadeGeneratorPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]", "@babel/[email protected]")
.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)
},
Expand Down

0 comments on commit 9230142

Please sign in to comment.