generated from moderneinc/rewrite-recipe-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit with simple
ApplyCodemod
recipe (#1)
* Initial commit * Add generic `ApplyCodemod` recipe * Add a few Next.JS codemods * Polish test * Disable test in CI * Run codemod from `node_modules` * Polish build * Copy `node_modules` to temp folder * Use Node plugin to populate `node_modules` * Fix build * Fix bug when extracting node_modules from jar * Avoid `Files.createTempDirectory()` * Fix build * Fix build
- Loading branch information
1 parent
98d3cda
commit f5ede63
Showing
18 changed files
with
6,058 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ build/ | |
.gradle/ | ||
.idea/ | ||
out/ | ||
|
||
node_modules/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,97 @@ | ||
import com.github.gradle.node.npm.task.NpmInstallTask | ||
|
||
plugins { | ||
id("org.openrewrite.build.recipe-library") version "latest.release" | ||
id("com.github.node-gradle.node") version "latest.release" | ||
} | ||
|
||
// Set as appropriate for your organization | ||
group = "com.yourorg" | ||
description = "Rewrite recipes." | ||
group = "org.openrewrite.recipe" | ||
description = "Migrate JavaScript projects using codemods" | ||
|
||
// The bom version can also be set to a specific version or latest.release. | ||
val latest = "latest.integration" | ||
val rewriteVersion = rewriteRecipe.rewriteVersion.get() | ||
dependencies { | ||
implementation(platform("org.openrewrite:rewrite-bom:${latest}")) | ||
implementation(platform("org.openrewrite:rewrite-bom:$rewriteVersion")) | ||
|
||
implementation("org.openrewrite:rewrite-java") | ||
runtimeOnly("org.openrewrite:rewrite-java-17") | ||
// Need to have a slf4j binding to see any output enabled from the parser. | ||
runtimeOnly("ch.qos.logback:logback-classic:1.2.+") | ||
implementation("org.openrewrite:rewrite-core") | ||
|
||
testRuntimeOnly("com.google.guava:guava:latest.release") | ||
testImplementation("org.openrewrite:rewrite-test") | ||
} | ||
|
||
configure<PublishingExtension> { | ||
publications { | ||
named("nebula", MavenPublication::class.java) { | ||
suppressPomMetadataWarningsFor("runtimeElements") | ||
} | ||
} | ||
license { | ||
exclude("**/package.json") | ||
exclude("**/package-lock.json") | ||
} | ||
|
||
node { | ||
nodeProjectDir.set(file("build/resources/main/codemods")) | ||
} | ||
|
||
tasks.named("npmInstall") { | ||
dependsOn(tasks.named("processResources")) | ||
} | ||
|
||
tasks.named("classes") { | ||
dependsOn(tasks.named("npmInstall")) | ||
} | ||
|
||
// We don't care about publishing javadocs anywhere, so don't waste time building them | ||
tasks.withType<Javadoc>().configureEach { | ||
enabled = false | ||
} | ||
|
||
tasks.named<Jar>("sourcesJar") { | ||
enabled = false | ||
} | ||
|
||
tasks.named<Jar>("javadocJar") { | ||
enabled = false | ||
} | ||
|
||
val emptySourceJar = tasks.create<Jar>("emptySourceJar") { | ||
file("README.md") | ||
archiveClassifier.set("sources") | ||
} | ||
|
||
val emptyJavadocJar = tasks.create<Jar>("emptyJavadocJar") { | ||
file("README.md") | ||
archiveClassifier.set("javadoc") | ||
} | ||
|
||
publishing { | ||
repositories { | ||
maven { | ||
name = "moderne" | ||
url = uri("https://us-west1-maven.pkg.dev/moderne-dev/moderne-recipe") | ||
} | ||
} | ||
publications.named<MavenPublication>("nebula") { | ||
artifactId = project.name | ||
description = project.description | ||
|
||
artifacts.clear() // remove the regular JAR | ||
// Empty JARs are OK: https://central.sonatype.org/publish/requirements/#supply-javadoc-and-sources | ||
artifact(tasks.named("jar")) | ||
artifact(emptySourceJar) | ||
artifact(emptyJavadocJar) | ||
|
||
pom { | ||
name.set(project.name) | ||
description.set(project.description) | ||
url.set("https://moderne.io") | ||
licenses { | ||
license { | ||
name.set("Creative Commons Attribution-NonCommercial 4.0") | ||
url.set("https://creativecommons.org/licenses/by-nc-nd/4.0/deed.en") | ||
} | ||
} | ||
developers { | ||
developer { | ||
name.set("Team Moderne") | ||
email.set("[email protected]") | ||
organization.set("Moderne, Inc.") | ||
organizationUrl.set("https://moderne.io") | ||
} | ||
} | ||
scm { | ||
connection.set("scm:git:git://github.com/moderneinc/rewrite-codemods.git") | ||
developerConnection.set("scm:git:ssh://github.com:moderneinc/rewrite-codemods.git") | ||
url.set("https://github.com/moderneinc/rewrite-codemods/tree/main") | ||
} | ||
} | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
rootProject.name = "rewrite-recipe-starter" | ||
rootProject.name = "rewrite-codemods" |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.