Skip to content
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 @@ -49,7 +49,7 @@ class PackageActor(
src: String,
coursier: String,
store: PackageStore,
packagehubUrl: String,
lsifJavaVersion: String,
val dir: Path,
val addr: Int = 3434
)(implicit ctx: Context, log: cask.Logger)
Expand Down Expand Up @@ -247,7 +247,10 @@ class PackageActor(
return dump
pkg match {
case _: NpmPackage =>
exec(sourceroot, List("yarn", "install"))
val toolVersions = sourceroot.resolve(".tool-versions")
if (!Files.isRegularFile(toolVersions)) {
Files.write(toolVersions, List("yarn 1.22.4").asJava)
}
val tsconfig = sourceroot.resolve("tsconfig.json")
if (!Files.isRegularFile(tsconfig)) {
val config = Obj(
Expand All @@ -256,6 +259,7 @@ class PackageActor(
)
Files.write(tsconfig, List(ujson.write(config, indent = 2)).asJava)
}
exec(sourceroot, List("yarn", "install"))
exec(
sourceroot,
List("npx", "@olafurpg/lsif-tsc", "-p", sourceroot.toString)
Expand Down Expand Up @@ -285,8 +289,9 @@ class PackageActor(
"launch",
"--jvm",
jvm,
"--contrib",
"lsif-java",
s"com.sourcegraph:lsif-java_2.13:${lsifJavaVersion}",
"-r",
"sonatype:snapshots",
"--",
"index",
"--output",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ case class PackageHub(
postgres: PostgresOptions = PostgresOptions(),
@Description("URL of the PackageHub server") packagehubUrl: String =
"https://packagehub-ohcltxh6aq-uc.a.run.app",
@Description(
"The version of lsif-java to use for indexing packages"
) lsifJavaVersion: String = BuildInfo.version,
@Description("Path to the src-cli binary") src: String = "src",
@Description("Path to the coursier binary") coursier: String = "coursier",
@Description("If enabled, schedule an LSIF index after the given delay")
Expand All @@ -62,7 +65,7 @@ case class PackageHub(
src,
coursier,
store,
packagehubUrl,
lsifJavaVersion,
dir.getOrElse(app.env.cacheDirectory)
)(ctx, log)
val routes = new PackageRoutes(this, actor, store, log)(ctx)
Expand Down