Skip to content

Commit

Permalink
tidy up react app example
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddenton committed Dec 2, 2023
1 parent 272c993 commit 80fcf56
Show file tree
Hide file tree
Showing 9 changed files with 4,774 additions and 6,971 deletions.
4 changes: 2 additions & 2 deletions react-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ Run:

... then either:

1. launch `RunnableEnvironment` from your IDE - the UI lives at http://localhost:8000
1. launch `Http4kReactMain` from your IDE - the UI lives at http://localhost:8000
1. enter development mode - the UI lives at http://localhost:3000
```shell
cd frontend
yarn start
npm start
```

## Create production build
Expand Down
7 changes: 3 additions & 4 deletions react-app/backend/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
apply plugin: 'application'
apply plugin: "application"

dependencies {
api platform("org.http4k:http4k-bom:$http4kVersion")
api "org.http4k:http4k-core"
implementation project(':frontend')

testImplementation platform("org.junit:junit-bom:$junitVersion")
testImplementation "org.junit.jupiter:junit-jupiter-api"
testImplementation "org.junit.jupiter:junit-jupiter-engine"
}

mainClassName = 'org.http4k.examples.Http4kReactMainKt'
mainClassName = "org.http4k.examples.Http4kReactMainKt"

task stage(dependsOn: ['installDist'])
tasks.register("stage") { dependsOn["installDist"] }
23 changes: 8 additions & 15 deletions react-app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import static org.gradle.api.JavaVersion.VERSION_1_8

buildscript {
repositories {
mavenCentral()
maven {
maven {
url "https://plugins.gradle.org/m2/"
}
}
Expand All @@ -14,19 +16,15 @@ buildscript {
allprojects {
repositories {
mavenCentral()
}
}

apply plugin: 'kotlin'
apply plugin: "kotlin"

compileKotlin.kotlinOptions.jvmTarget = "1.8"
compileTestKotlin.kotlinOptions.jvmTarget = "1.8"

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

test {
useJUnitPlatform()
}
sourceCompatibility = VERSION_1_8
targetCompatibility = VERSION_1_8

compileKotlin {
kotlinOptions.allWarningsAsErrors = false
Expand All @@ -39,7 +37,7 @@ allprojects {
jar {
manifest {
attributes(
'release_version': archiveVersion,
"release_version": archiveVersion,
)
}
}
Expand All @@ -48,8 +46,3 @@ allprojects {
compileTestKotlin.kotlinOptions {
jvmTarget = "11"
}

dependencies {
implementation(project("backend"))
implementation(project("frontend"))
}
2 changes: 1 addition & 1 deletion react-app/frontend/.node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.4.0
18.2.0
76 changes: 0 additions & 76 deletions react-app/frontend/build.gradle

This file was deleted.

79 changes: 41 additions & 38 deletions react-app/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,43 @@
{
"name": "chinelo",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1"
},
"proxy": "http://localhost:8000",
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test-watch": "react-scripts test",
"test": "react-scripts test --no-watch",
"eject": "react-scripts eject",
"reset": "rm -rf node_modules && yarn",
"testci": "react-scripts test --no-watch --reporters=default"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
"name": "http4k",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"react-router": "^5.2.0",
"@testing-library/user-event": "^13.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
"proxy": "http://localhost:8000",
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test-watch": "react-scripts test",
"test": "react-scripts test --no-watch",
"eject": "react-scripts eject",
"testci": "react-scripts test --no-watch --reporters=default"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Loading

0 comments on commit 80fcf56

Please sign in to comment.