{"id":20713835,"url":"https://github.com/diffplug/webtools","last_synced_at":"2025-12-25T04:48:34.968Z","repository":{"id":246907565,"uuid":"824437020","full_name":"diffplug/webtools","owner":"diffplug","description":"Gradle plugins for website tooling","archived":false,"fork":false,"pushed_at":"2024-08-04T23:26:01.000Z","size":97,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-17T21:31:20.993Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diffplug.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-05T06:17:42.000Z","updated_at":"2024-08-04T23:26:04.000Z","dependencies_parsed_at":"2025-01-17T21:37:21.081Z","dependency_job_id":null,"html_url":"https://github.com/diffplug/webtools","commit_stats":null,"previous_names":["diffplug/webtools"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diffplug%2Fwebtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diffplug%2Fwebtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diffplug%2Fwebtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diffplug%2Fwebtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diffplug","download_url":"https://codeload.github.com/diffplug/webtools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242988077,"owners_count":20217534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T02:27:32.767Z","updated_at":"2025-12-25T04:48:34.961Z","avatar_url":"https://github.com/diffplug.png","language":"Java","readme":"# DiffPlug Webtools\n\n- [node](#node) - hassle-free `npm install` and `npm run blah`\n- [static server](#static-server) - a simple static file server\n- [jte](#jte) - creates idiomatic Kotlin model classes for `jte` templates (strict nullability \u0026 idiomatic collections and generics)\n- [flywayjooq](#flywayjooq) - coordinates docker, flyway, and jOOQ for fast testing\n\n## Node\n\n```gradle\napply plugin: 'com.diffplug.webtools.node'\nnode {\n  // looks for an `.nvmrc` in this folder or its parent\n  // downloads the corresponding version of node `npm ci`\n\n  // and then it will run `npm run blah` like so\n  npm_run 'blah', {\n    inputs.file('tsconfig.json').withPathSensitivity(PathSensitivity.RELATIVE)\n    inputs.dir('somedir').withPathSensitivity(PathSensitivity.RELATIVE)\n    outputs.dir('build/some-output')\n  }\n  // if an npm script contains `:` it willbe transformed into `-`\n  npm_run 'lint:fix', {} // becomes `npm_run_lint-fix`\n}\n```\n\n## Static Server\n\n```gradle\ntasks.register('serve', com.diffplug.webtools.serve.StaticServerTask) {\n  dir = file('build/static')\n  port = 8080 // by default\n}\n```\n\n### JTE\n\nYou have to apply `gg.jte.gradle` plugin yourself. We add a task called `jteModels` which creates a Kotlin model classes with strict nullability. Like so:\n\n```jte\n// header.jte\n@param String title\n@param String createdAtAndBy\n@param Long idToImpersonateNullable\n@param String loginLinkNullable\n```\n\nwill turn into\n\n```kotlin\nclass header(\n  val title: String,\n  val createdAtAndBy: String,\n  val idToImpersonateNullable: Long?,\n  val loginLinkNullable: String?,\n  ) : common.JteModel {\n\n  override fun render(engine: TemplateEngine, output: TemplateOutput) {\n    engine.render(\"pages/Admin/userShow/header.jte\", mapOf(\n      \"title\" to title,\n      \"createdAtAndBy\" to createdAtAndBy,\n      \"idToImpersonateNullable\" to idToImpersonateNullable,\n      \"loginLinkNullable\" to loginLinkNullable,\n    ), output)\n  }\n}\n```\n\nWe also translate Java collections and generics to their Kotlin equivalents. See `JteRenderer.convertJavaToKotlin` for details.\n\n### flywayjooq\n\nCompile tasks just need to depend on the `jooq` task. It will keep a live database running to test against.\n\n```gradle\nflywayJooq {\n  // starts this docker container which needs to have postgres\n  setup.dockerComposeFile = file('src/test/resources/docker-compose.yml')\n  // writes out connection data to this file\n  setup.dockerConnectionParams = file('build/pgConnection.properties')\n  // migrates a template database to this\n  setup.flywayMigrations = file('src/main/resources/db/migration')\n  // dumps the final schema out to this\n  setup.flywaySchemaDump = file('src/test/resources/schema.sql')\n  // sets up jOOQ\n  configuration {\n    // jOOQ setup same as the official jOOQ plugin\n  }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiffplug%2Fwebtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiffplug%2Fwebtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiffplug%2Fwebtools/lists"}