Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
02253cd
feat: implement data structure holding a number with an associated ra…
marhali Sep 16, 2025
6bde43f
feat: implement a ecmascript identifier checker
marhali Sep 16, 2025
bbc478c
feat: rework configuration options
marhali Sep 16, 2025
7b36121
feat: update gson internals
marhali Sep 16, 2025
f844e9d
feat: use new config options and minor docs change
marhali Sep 16, 2025
0516cf5
feat: add comment support and prepare primitive rework
marhali Sep 16, 2025
d758f71
feat(breaking): json5 null is no longer a singleton
marhali Sep 16, 2025
7656809
feat(breaking): let json5 primitive hold boolean, number (including h…
marhali Sep 16, 2025
39dc615
feat(breaking): rework lexer and parser and apply latest updates from…
marhali Sep 16, 2025
7bc0d95
feat(breaking): rework writer to support comments and other new options
marhali Sep 16, 2025
96aa52a
feat(breaking): update json5 object with latest updates from gson and…
marhali Sep 16, 2025
edc98ed
feat: make getter for RadixNumber public
marhali Sep 16, 2025
0d28086
feat(breaking): update json5 array to latest update from gson and add…
marhali Sep 16, 2025
3a3e837
feat: add support for instant primitives
marhali Sep 18, 2025
ffe3488
fix: getAsString on Json5Null
marhali Sep 18, 2025
2162978
feat: add more tests
marhali Sep 18, 2025
eaa843d
feat: allow and document empty parser
marhali Sep 20, 2025
1508f4f
fix: root element parsing
marhali Sep 20, 2025
4e0e113
feat: add an option to insert final newline to json5 writer
marhali Sep 20, 2025
75d0418
feat: use syntax error to throw duplicate key errors
marhali Sep 20, 2025
93a1f32
feat: enhance comment parsing
marhali Sep 20, 2025
43590eb
chore: format file
marhali Sep 20, 2025
1b74651
feat: test duplicate key strategy
marhali Sep 20, 2025
12ca6c9
feat: test trailing object rule
marhali Sep 20, 2025
87ce672
feat: test trailing array rule
marhali Sep 20, 2025
ad03942
feat: rework roundtrip tests
marhali Sep 20, 2025
351d54d
feat(tests): add test for NonNullElementWrapperList
marhali Sep 20, 2025
e3070c4
feat(tests): add test for LazilyParsedNumber
marhali Sep 20, 2025
cea55af
refactor(breaking): remove insertFinalNewline() from default options
marhali Sep 21, 2025
c487c99
feat: add some tests on Json5Element getters
marhali Sep 21, 2025
04b54b2
feat(tests): add tests on missing element closing tags
marhali Sep 21, 2025
4fe160a
feat(tests): add more parser tests
marhali Sep 21, 2025
545955e
feat(tests): test element opening tags
marhali Sep 21, 2025
dfcf31e
fix: properly write digit separators
marhali Sep 21, 2025
d1c9ef9
feat: also include hex floating point
marhali Sep 21, 2025
3de0e44
feat: enhance docs
marhali Sep 21, 2025
b12190a
feat: update README
marhali Sep 21, 2025
232fab1
feat: link options
marhali Sep 21, 2025
48feaae
refactor: reorder badges
marhali Sep 21, 2025
4e7493d
feat: enhance README.md
marhali Sep 22, 2025
4f17924
feat: add missing javadoc properties
marhali Sep 22, 2025
2e18d3b
feat: migrate to gradle
marhali Sep 22, 2025
6db942c
chore: update changelog
marhali Sep 22, 2025
5ae50ec
chore: update qodana linter
marhali Sep 22, 2025
1556de6
fix: qodana job
marhali Sep 23, 2025
f49834b
chore: apply formatting rules
marhali Sep 23, 2025
6506cc5
refactor: remove unnecessary toString()
marhali Sep 23, 2025
a5ac1a0
feat(ci): upload test-results to codecov
marhali Sep 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ updates:
schedule:
interval: monthly

# Maintain dependencies for Maven
- package-ecosystem: maven
# Maintain dependencies for Gradle
- package-ecosystem: gradle
directory: /
schedule:
interval: monthly
interval: monthly
171 changes: 171 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# GitHub Actions Workflow is created for testing and preparing the library release in the following steps:
# - Validate Gradle Wrapper.
# - Run 'test' task.
# - Run Qodana inspections.
# - Run the 'buildLibrary' task and prepare artifact for further tests.
# - Create a draft release.
#
# The workflow is triggered on push and pull_request events.
#
# GitHub Actions reference: https://help.github.com/en/actions

name: Build
on:
# Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g., for dependabot pull requests)
push:
branches: [ main ]
# Trigger the workflow on any pull request
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:

# Prepare the environment and build the library
build:
name: Build
runs-on: ubuntu-latest
steps:

# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4

# Set up the Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 11

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

# Build the library
- name: Build Library
run: ./gradlew build

# Store an already-built library as an artifact for downloading
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: ./build/libs/*

# Run tests and upload a code coverage report
test:
name: Test
needs: [ build ]
runs-on: ubuntu-latest
steps:

# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4

# Set up the Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 11

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true

# Run tests
- name: Run Tests
run: ./gradlew check

# Collect Tests Result of failed tests
- name: Collect Tests Result
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: tests-result
path: ${{ github.workspace }}/build/reports/tests

# Upload the jacoco report to CodeCov
- name: Upload Code Coverage Report
uses: codecov/codecov-action@v5
with:
files: ${{ github.workspace }}/build/reports/jacoco/jacocoTestReport.xml
token: ${{ secrets.CODECOV_TOKEN }}

# Upload the test results to CodeCov
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
files: ${{ github.workspace }}/build/test-results/test/*.xml
token: ${{ secrets.CODECOV_TOKEN }}

# Run Qodana inspections and provide a report
inspectCode:
name: Inspect code
needs: [ build ]
runs-on: ubuntu-latest
permissions:
contents: write
checks: write
pull-requests: write
steps:

# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
fetch-depth: 0 # a full history is required for pull request analysis

# Run Qodana inspections
- name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2025.2
with:
pr-mode: false
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_2073039781 }}
QODANA_ENDPOINT: 'https://qodana.cloud'

# Prepare a draft release for GitHub Releases page for the manual verification
# If accepted and published, the release workflow would be triggered
releaseDraft:
name: Release draft
if: github.event_name != 'pull_request'
needs: [ build, test, inspectCode ]
runs-on: ubuntu-latest
permissions:
contents: write
steps:

# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4

# Remove old release drafts by using the curl request for the available releases with a draft flag
- name: Remove Old Release Drafts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api repos/{owner}/{repo}/releases \
--jq '.[] | select(.draft == true) | .id' \
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}

# Create a new release draft which is not publicly visible and requires manual acceptance
- name: Create Release Draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION=$(./gradlew properties --property version --quiet --console=plain | tail -n 1 | cut -f2- -d ' ')
RELEASE_NOTE="./build/tmp/release_note.txt"
./gradlew getChangelog --unreleased --no-header --quiet --console=plain --output-file=$RELEASE_NOTE

gh release create $VERSION \
--draft \
--title $VERSION \
--notes-file $RELEASE_NOTE
32 changes: 0 additions & 32 deletions .github/workflows/cd.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/ci.yml

This file was deleted.

91 changes: 91 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# GitHub Actions Workflow created for handling the release process based on the draft release prepared with the Build workflow.

name: Release
on:
release:
types: [prereleased, released]

jobs:

# Prepare and publish the library to Maven Central and GitHub Packages
release:
name: Publish Library
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:

# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}

# Set up the Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 11

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true

# Update the Unreleased section with the current release note
- name: Patch Changelog
if: ${{ github.event.release.body != '' }}
env:
CHANGELOG: ${{ github.event.release.body }}
run: |
RELEASE_NOTE="./build/tmp/release_note.txt"
mkdir -p "$(dirname "$RELEASE_NOTE")"
echo "$CHANGELOG" > $RELEASE_NOTE

./gradlew patchChangelog --release-note-file=$RELEASE_NOTE

# Publish the library to Maven Central
- name: Publish Library
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralUsername }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKey }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ ORG_GRADLE_PROJECT_signingInMemoryKeyPassword }}
run: ./gradlew publishToMavenCentral

# Upload an artifact as a release asset
- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.event.release.tag_name }} ./build/libs/*

# Create a pull request
- name: Create Pull Request
if: ${{ steps.properties.outputs.changelog != '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ github.event.release.tag_name }}"
BRANCH="changelog-update-$VERSION"
LABEL="release changelog"

git config user.email "action@github.com"
git config user.name "GitHub Action"

git checkout -b $BRANCH
git commit -am "Changelog update - $VERSION"
git push --set-upstream origin $BRANCH

gh label create "$LABEL" \
--description "Pull requests with release changelog update" \
--force \
|| true

gh pr create \
--title "Changelog update - \`$VERSION\`" \
--body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \
--label "$LABEL" \
--head $BRANCH
14 changes: 3 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar
build
.gradle

# Eclipse m2e generated files
# Eclipse Core
Expand All @@ -17,4 +9,4 @@ buildNumber.properties
.classpath

# IntelliJ IDE
.idea
.idea
24 changes: 24 additions & 0 deletions .run/Run build.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run build" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="build" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
Loading