Skip to content

Commit 33f9d5e

Browse files
Transpiling support for vuex (#315)
1 parent 7b124f4 commit 33f9d5e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/main/scala/io/shiftleft/js2cpg/preprocessing/TypescriptTranspiler.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ class TypescriptTranspiler(override val config: Config, override val projectPath
9090
options.asInstanceOf[ObjectNode].putArray("types")
9191
options.asInstanceOf[ObjectNode].putArray("typeRoots")
9292
}
93+
// also remove the extends settings; if transpiling subprojects they may not be present
94+
json.asInstanceOf[ObjectNode].remove("extends")
9395
// --include is not available as tsc CLI argument; we set it manually:
9496
json.asInstanceOf[ObjectNode].putArray("include").add("**/*")
9597
val customTsConfigFile = File.newTemporaryFile("js2cpgTsConfig", ".json", parent = Some(projectPath))

src/main/scala/io/shiftleft/js2cpg/preprocessing/VueTranspiler.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ object VueTranspiler {
4040

4141
def isVueProject(config: Config, projectPath: Path): Boolean = {
4242
val hasVueDep =
43-
PackageJsonParser.dependencies((File(config.srcDir) / FileDefaults.PACKAGE_JSON_FILENAME).path).contains("vue")
43+
PackageJsonParser
44+
.dependencies((File(config.srcDir) / FileDefaults.PACKAGE_JSON_FILENAME).path)
45+
.exists(_._1.startsWith("vue"))
4446
hasVueDep && hasVueFiles(config, projectPath)
4547
}
4648

0 commit comments

Comments
 (0)