Skip to content

Commit ae61202

Browse files
staktracesvc-squareup-copybara
authored andcommitted
Use public npm registry everywhere in the OSS builds
GitOrigin-RevId: 3aeeb353ab641f87c037057b2ae8dc3070510079
1 parent 738ccb1 commit ae61202

File tree

2 files changed

+2
-62
lines changed

2 files changed

+2
-62
lines changed

misk-admin-web-actions/build.gradle.kts

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ tasks.register<WebActionsTabBuildTask>("buildWebActionsTab") {
2020
)
2121

2222
outputFiles.setFrom(projectDir.resolve("lib"))
23-
24-
dependsOn("checkInternalRepos")
2523
}
2624

2725
@CacheableTask
@@ -84,61 +82,3 @@ abstract class WebActionsTabBuildTask : DefaultTask() {
8482
exec(npm, "run-script", "test")
8583
}
8684
}
87-
88-
abstract class CheckInternalReposTask : DefaultTask() {
89-
@get:InputFiles
90-
@get:PathSensitive(PathSensitivity.RELATIVE)
91-
abstract val packageLockFiles: ConfigurableFileCollection
92-
93-
init {
94-
packageLockFiles.setFrom(
95-
project.projectDir.walk()
96-
.filter { it.name == "package-lock.json" }
97-
.toList()
98-
)
99-
}
100-
101-
@TaskAction
102-
fun check() {
103-
val internalRepos = listOf(
104-
"global.block-artifacts.com",
105-
"artifactory.global.square"
106-
)
107-
108-
val violations = mutableListOf<Pair<File, List<String>>>()
109-
110-
packageLockFiles.forEach { file ->
111-
try {
112-
val content = file.readText()
113-
val foundRepos = internalRepos.filter { repo -> repo in content }
114-
115-
if (foundRepos.isNotEmpty()) {
116-
violations.add(file to foundRepos)
117-
}
118-
} catch (e: Exception) {
119-
logger.error("Error processing ${file.relativeTo(project.projectDir)}: ${e.message}")
120-
}
121-
}
122-
123-
if (violations.isNotEmpty()) {
124-
val message = buildString {
125-
appendLine("Found internal repository references:")
126-
violations.forEach { (file, repos) ->
127-
appendLine("- ${file.relativeTo(project.projectDir)} contains references to:")
128-
repos.forEach { repo ->
129-
appendLine(" * '$repo'")
130-
}
131-
}
132-
appendLine("\nPlease remove references to internal npm repositories.")
133-
}
134-
throw GradleException(message)
135-
} else {
136-
logger.lifecycle("No internal repository references found.")
137-
}
138-
}
139-
}
140-
141-
tasks.register<CheckInternalReposTask>("checkInternalRepos") {
142-
group = "verification"
143-
description = "Check for internal repository references in package-lock.json files"
144-
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)