Skip to content

Commit

Permalink
Ok this is a big commit:
Browse files Browse the repository at this point in the history
- message service uses bootstrap toasts now. This allows to show stacked messages
- use gradle to install node and npm via plugin so that we can use the versions needed for this project locally and in GitHub
-add some run configurations for intellij
-add more file support features: upload, download, delete, copy bodyFileName. Also include a modal to adjust the filename, which can also include folders.
-add new view for files
-add paperclip icon for mappings, which contain files
-fix some layout issues.
-add websocket for file changes, so that new page can be updated accordingly.
-adjust GitHub workflows due to node changes.
- add indicators
- move broadcasts from endpoint to actual location where changes are happening.
- update version
  • Loading branch information
holomekc committed Dec 11, 2023
1 parent 511f475 commit 11b2aa8
Show file tree
Hide file tree
Showing 63 changed files with 1,248 additions and 468 deletions.
2 changes: 0 additions & 2 deletions .github/release-drafter.yml

This file was deleted.

72 changes: 34 additions & 38 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,51 +14,47 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
jdk: [11, 17]
os: [ ubuntu-latest, macos-latest, windows-latest ]
jdk: [ 11, 17 ]
runs-on: ${{ matrix.os }}
env:
JDK_VERSION: ${{ matrix.jdk }}
JDK_VERSION: ${{ matrix.jdk }}

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Set up node using nvm
uses: dcodeIO/setup-node-nvm@v5
with:
node-version: 20.10.0
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x gradlew

# - name: Cache SonarCloud packages
# uses: actions/cache@v1
# with:
# path: ~/.sonar/cache
# key: ${{ runner.os }}-sonar
# restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
# - name: Cache SonarCloud packages
# uses: actions/cache@v1
# with:
# path: ~/.sonar/cache
# key: ${{ runner.os }}-sonar
# restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

# - name: Test WireMock with Sonarqube
# if: ${{ matrix.os == 'ubuntu-latest' && matrix.jdk == 11 && github.event_name == 'push' }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# run: ./gradlew check sonarqube --stacktrace --no-daemon
# - name: Test WireMock with Sonarqube
# if: ${{ matrix.os == 'ubuntu-latest' && matrix.jdk == 11 && github.event_name == 'push' }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# run: ./gradlew check sonarqube --stacktrace --no-daemon

- name: Test WireMock
if: ${{ !(matrix.os == 'ubuntu-latest' && matrix.jdk == 11 && github.event_name == 'push') }}
run: ./gradlew check --stacktrace --no-daemon
- name: Test WireMock
if: ${{ !(matrix.os == 'ubuntu-latest' && matrix.jdk == 11 && github.event_name == 'push') }}
run: ./gradlew check --stacktrace --no-daemon

# - name: Archive WireMock test report - ${{ matrix.os }} JDK ${{ matrix.jdk }}
# if: always()
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ jobs:
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Set up node using nvm
uses: dcodeIO/setup-node-nvm@v5
with:
node-version: 20.10.0
- name: Cache Gradle packages
uses: actions/cache@v3
with:
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ bin

# WIREMOCK #
#################
/mappings/
mappings/
__files
src/main/resources/assets/webapp/

scripts/client-cert.*
Expand All @@ -70,4 +71,4 @@ notes.txt

# MINE #
Guide.txt
docker
docker
2 changes: 1 addition & 1 deletion .run/Build WireMock.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
<ForceTestExec>false</ForceTestExec>
<method v="2" />
</configuration>
</component>
</component>
8 changes: 8 additions & 0 deletions .run/Run WireMock.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run WireMock" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="wiremock.Run" />
<module name="wiremock.main" />
<option name="PROGRAM_PARAMETERS" value="--port 8088" />
<method v="2" />
</configuration>
</component>
13 changes: 13 additions & 0 deletions .run/WebApp lint --fix.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="WebApp lint --fix" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/webapp/wiremock/package.json" />
<command value="run" />
<scripts>
<script value="lint:fix" />
</scripts>
<node-interpreter value="$PROJECT_DIR$/.gradle/nodejs/node-v20.10.0-darwin-arm64/bin/node" />
<package-manager value="$PROJECT_DIR$/.gradle/npm/npm-v10.2.5/lib/node_modules/npm/bin/npm-cli.js" />
<envs />
<method v="2" />
</configuration>
</component>
13 changes: 13 additions & 0 deletions .run/WebApp lint.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="WebApp lint" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/webapp/wiremock/package.json" />
<command value="run" />
<scripts>
<script value="lint" />
</scripts>
<node-interpreter value="$PROJECT_DIR$/.gradle/nodejs/node-v20.10.0-darwin-arm64/bin/node" />
<package-manager value="$PROJECT_DIR$/.gradle/npm/npm-v10.2.5/lib/node_modules/npm/bin/npm-cli.js" />
<envs />
<method v="2" />
</configuration>
</component>
13 changes: 13 additions & 0 deletions .run/WebApp prettier.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="WebApp prettier" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/webapp/wiremock/package.json" />
<command value="run" />
<scripts>
<script value="prettier" />
</scripts>
<node-interpreter value="$PROJECT_DIR$/.gradle/nodejs/node-v20.10.0-darwin-arm64/bin/node" />
<package-manager value="$PROJECT_DIR$/.gradle/npm/npm-v10.2.5/lib/node_modules/npm/bin/npm-cli.js" />
<envs />
<method v="2" />
</configuration>
</component>
13 changes: 13 additions & 0 deletions .run/WebApp start.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="WebApp start" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/webapp/wiremock/package.json" />
<command value="run" />
<scripts>
<script value="start" />
</scripts>
<node-interpreter value="$PROJECT_DIR$/.gradle/nodejs/node-v20.10.0-darwin-arm64/bin/node" />
<package-manager value="$PROJECT_DIR$/.gradle/npm/npm-v10.2.5/lib/node_modules/npm/bin/npm-cli.js" />
<envs />
<method v="2" />
</configuration>
</component>
10 changes: 9 additions & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## Feature

- New Files page allows to upload, download, delete files.
- Allow to upload a file when editing a mapping. The bodyFileName is automatically set. Don't forget to press save.
- Allow to delete a file when editing a mapping. The bodyFileName is automatically removed. Don't forget to press save.
- Allow to download a file in raw and separated view in case a file is used.
- Add indicator in tree and list view to show mappings with files and if they are persistent.

## Fix

- Fix gradle build, so that ui is copied properly. Furthermore, improve tests to make sure ui is accessible.
- Some layout issues fixed due to dark mode and more
36 changes: 15 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ plugins {
id 'com.github.johnrengelman.shadow' version '8.1.0'
id "org.sonarqube" version "4.4.1.3373"
id 'jacoco'
id 'com.github.node-gradle.node' version '7.0.1'
}

group = 'org.wiremock'
Expand Down Expand Up @@ -65,9 +66,9 @@ dependencies {
}
api platform("com.fasterxml.jackson:jackson-bom:$versions.jackson")
api "com.fasterxml.jackson.core:jackson-core",
"com.fasterxml.jackson.core:jackson-annotations",
"com.fasterxml.jackson.core:jackson-databind",
"com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
"com.fasterxml.jackson.core:jackson-annotations",
"com.fasterxml.jackson.core:jackson-databind",
"com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
api "org.apache.httpcomponents.client5:httpclient5:5.2.1"
api "org.xmlunit:xmlunit-core:$versions.xmlUnit"
api "org.xmlunit:xmlunit-legacy:$versions.xmlUnit", {
Expand Down Expand Up @@ -215,7 +216,7 @@ allprojects {
mavenCentral()
}

version = '3.3.1.1'
version = '3.3.1.2'


sourceCompatibility = 11
Expand Down Expand Up @@ -278,8 +279,6 @@ task testJar(type: Jar, dependsOn: testClasses) {
from sourceSets.test.output
}

final DOCS_DIR = project(':').rootDir.getAbsolutePath() + '/docs-v2'

jar {
archiveBaseName.set('wiremock')
manifest {
Expand Down Expand Up @@ -426,25 +425,20 @@ task addGitTag {
}
}

final WEBAPP_DIR = project(':').rootDir.getAbsolutePath() + '/webapp/wiremock'
node {
version = "20.10.0"
npmVersion = "10.2.5"
nodeProjectDir = file(project(':').rootDir.getAbsolutePath() + '/webapp/wiremock')
download = true
}

task npmInstallWebapp(type: Exec) {
workingDir WEBAPP_DIR
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
commandLine 'cmd', '/c', 'npm', 'i'
} else {
commandLine 'npm', 'i'
}
task npmInstallWebapp(type: NpmTask) {
args = ['install']
}

task generateWebapp(type: Exec) {
task generateWebapp(type: NpmTask) {
dependsOn npmInstallWebapp
workingDir WEBAPP_DIR
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
commandLine 'cmd', '/c', 'npm', 'run', 'prod'
} else {
commandLine 'npm', 'run', 'prod'
}
args = ['run', 'prod']
}

task finalizeWebapp(type: Copy) {
Expand Down
Loading

0 comments on commit 11b2aa8

Please sign in to comment.