Skip to content
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

Transpiling support for vuex #315

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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