Skip to content

Commit

Permalink
Transpiling support for vuex (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
max-leuthaeuser authored Nov 6, 2023
1 parent 7b124f4 commit 33f9d5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ class TypescriptTranspiler(override val config: Config, override val projectPath
options.asInstanceOf[ObjectNode].putArray("types")
options.asInstanceOf[ObjectNode].putArray("typeRoots")
}
// also remove the extends settings; if transpiling subprojects they may not be present
json.asInstanceOf[ObjectNode].remove("extends")
// --include is not available as tsc CLI argument; we set it manually:
json.asInstanceOf[ObjectNode].putArray("include").add("**/*")
val customTsConfigFile = File.newTemporaryFile("js2cpgTsConfig", ".json", parent = Some(projectPath))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ object VueTranspiler {

def isVueProject(config: Config, projectPath: Path): Boolean = {
val hasVueDep =
PackageJsonParser.dependencies((File(config.srcDir) / FileDefaults.PACKAGE_JSON_FILENAME).path).contains("vue")
PackageJsonParser
.dependencies((File(config.srcDir) / FileDefaults.PACKAGE_JSON_FILENAME).path)
.exists(_._1.startsWith("vue"))
hasVueDep && hasVueFiles(config, projectPath)
}

Expand Down

0 comments on commit 33f9d5e

Please sign in to comment.