Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newworld #234

Merged
merged 65 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
c740e7f
first success
Oct 17, 2023
4d7bb3c
config ability added
Oct 17, 2023
8cb9910
core json write working
Oct 18, 2023
0304f9e
ugly but inTermsOf works
Oct 19, 2023
eed5e6d
Added caching for trait writers
Oct 19, 2023
d11003e
writing json is working
Oct 20, 2023
766f55a
Rudimentary read working
Oct 23, 2023
b6bd07e
fixed seq parsing
Oct 24, 2023
f95e73c
enum parse works
Oct 25, 2023
b8d75be
Classes with default values work
Oct 25, 2023
242eafb
SelfRefs working
Oct 26, 2023
3dfcea0
Maps and more work
Oct 27, 2023
3fde56a
modularize reader
Oct 27, 2023
826a30d
tests started
Oct 29, 2023
ee2cd18
New faster writer
Nov 5, 2023
03e76d5
fix benchmark table
Nov 5, 2023
194117c
more fixes
Nov 5, 2023
6a47401
more fixes
Nov 5, 2023
7e3bd6b
more write types
Nov 6, 2023
bc311c7
More write progress
Nov 6, 2023
62ddc82
sealed traits and more
Nov 7, 2023
e48b358
most of write finished
Nov 8, 2023
ee5da35
ZIO based parser experiments
Nov 14, 2023
caaa5e3
checkpoint
Nov 15, 2023
4a7b716
checkpoint
Nov 16, 2023
f016750
performance jump on writes
Nov 19, 2023
fa32cf3
big perf bump
Nov 20, 2023
fc0b259
another big perf bump
Nov 21, 2023
23e2788
final write optimization
Nov 21, 2023
c9d18e3
Update README.md
gzoller Nov 21, 2023
79e3546
Update README.md
gzoller Nov 21, 2023
b13979c
readme fidgeting
Nov 21, 2023
bb41444
JsonConfig initial working
Nov 28, 2023
25e7d4b
about a third thru write tests
Dec 6, 2023
7f1ce40
more tests and fixes
Dec 7, 2023
38eb1bf
basic write tests complete
Dec 7, 2023
bc11e67
NeoType writes work
Dec 10, 2023
3a3001a
writes done
Dec 11, 2023
facd89e
First tentative steps into reading
Jan 26, 2024
c8b0d68
Got rudimentary class parsing working
Feb 14, 2024
241661d
reworked read codegen
Feb 22, 2024
0ca9f0d
test of Jsoniter parse string
Feb 29, 2024
f0da3f9
Massive performance boost
Mar 2, 2024
54f0b43
Another massive performance improvement
Mar 3, 2024
b08f70f
checkpoint
Mar 3, 2024
b19ecd8
more perf tweaks
Mar 4, 2024
19ca469
lastest tweaks
Mar 7, 2024
5dbb0ce
More write performance improvements
Mar 14, 2024
ce27f87
implement read primitives
Mar 19, 2024
b140b52
Continue read implementations
Mar 26, 2024
db8a60d
more read cases implement
Mar 28, 2024
3b9a37f
fine tuning either and option
Mar 31, 2024
101807a
checkpoint-lots of fixes and problems solved
Apr 6, 2024
1de8717
Java collections and maps
Apr 8, 2024
d802efc
Many fixes for classes
Apr 14, 2024
0545e3f
enum tests done
Apr 22, 2024
4f90b68
almost code complete
Apr 24, 2024
6b882c6
docs and fixes
May 4, 2024
2b2d4fd
lots of docs and a refactor of SJConfig
May 4, 2024
efad12a
doc tweak
May 4, 2024
3d41c1a
initial msgpack support
May 17, 2024
0823f7d
remove msgpack
May 21, 2024
8490083
wrapping up
May 30, 2024
cbbaafd
coveralls tweak
May 30, 2024
3dc398a
tweak readme
May 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
132 changes: 105 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,119 @@
name: Package Build
# This workflow is triggered on pushes to the repository.
on: [pull_request]
# This file was automatically generated by sbt-github-actions using the
# githubWorkflowGenerate task. You should add and commit this file to
# your git repository. It goes without saying that you shouldn't edit
# this file by hand! Instead, if you wish to make changes, you should
# change your sbt build configuration to revise the workflow description
# to meet your needs, then regenerate this file.

name: Continuous Integration

on:
pull_request:
branches: ['**']
push:
branches: ['**']
tags: [v*]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


concurrency:
group: ${{ github.workflow }} @ ${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-test:
runs-on: ubuntu-latest
build:
name: Build and Test

strategy:
matrix:
os: [ubuntu-latest]
scala: [3.4.2]
java: [zulu@21]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- name: Ignore line ending differences in git
if: contains(runner.os, 'windows')
shell: bash
run: git config --global core.autocrlf false
- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Java (zulu@21)
id: setup-java-zulu-21
if: matrix.java == 'zulu@21'
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
cache: sbt

- name: sbt update
if: matrix.java == 'zulu@21' && steps.setup-java-zulu-21.outputs.cache-hit == 'false'
run: sbt +update

- name: Check that workflows are up to date
run: sbt githubWorkflowCheck

- name: Build project
run: sbt '++ ${{ matrix.scala }}' test

- name: Make target directories
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
run: mkdir -p target project/target

- name: Compress target directories
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
run: tar cf targets.tar target project/target

- name: Upload target directories
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
uses: actions/upload-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}
path: targets.tar

publish:
name: Publish Artifacts
needs: [build]
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
strategy:
matrix:
os: [ubuntu-latest]
java: [zulu@21]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Java (zulu@13)
uses: actions/setup-java@v3
- name: Setup Java (zulu@21)
id: setup-java-zulu-21
if: matrix.java == 'zulu@21'
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 13
java-version: 21
cache: sbt

- name: Cache sbt
uses: actions/cache@v3
- name: sbt update
if: matrix.java == 'zulu@21' && steps.setup-java-zulu-21.outputs.cache-hit == 'false'
run: sbt +update

- name: Download target directories (3.4.2)
uses: actions/download-artifact@v4
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
name: target-${{ matrix.os }}-${{ matrix.java }}-3.4.2

- name: Build project
shell: bash
run: sbt test
- name: Inflate target directories (3.4.2)
run: |
tar xf targets.tar
rm targets.tar

- env:
CI_SNAPSHOT_RELEASE: +publishSigned
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
run: sbt ci-release
59 changes: 59 additions & 0 deletions .github/workflows/clean.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This file was automatically generated by sbt-github-actions using the
# githubWorkflowGenerate task. You should add and commit this file to
# your git repository. It goes without saying that you shouldn't edit
# this file by hand! Instead, if you wish to make changes, you should
# change your sbt build configuration to revise the workflow description
# to meet your needs, then regenerate this file.

name: Clean

on: push

jobs:
delete-artifacts:
name: Delete Artifacts
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Delete artifacts
run: |
# Customize those three lines with your repository and credentials:
REPO=${GITHUB_API_URL}/repos/${{ github.repository }}

# A shortcut to call GitHub API.
ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; }

# A temporary file which receives HTTP response headers.
TMPFILE=/tmp/tmp.$$

# An associative array, key: artifact name, value: number of artifacts of that name.
declare -A ARTCOUNT

# Process all artifacts on this repository, loop on returned "pages".
URL=$REPO/actions/artifacts
while [[ -n "$URL" ]]; do

# Get current page, get response headers in a temporary file.
JSON=$(ghapi --dump-header $TMPFILE "$URL")

# Get URL of next page. Will be empty if we are at the last page.
URL=$(grep '^Link:' "$TMPFILE" | tr ',' '\n' | grep 'rel="next"' | head -1 | sed -e 's/.*<//' -e 's/>.*//')
rm -f $TMPFILE

# Number of artifacts on this page:
COUNT=$(( $(jq <<<$JSON -r '.artifacts | length') ))

# Loop on all artifacts on this page.
for ((i=0; $i < $COUNT; i++)); do

# Get name of artifact and count instances of this name.
name=$(jq <<<$JSON -r ".artifacts[$i].name?")
ARTCOUNT[$name]=$(( $(( ${ARTCOUNT[$name]} )) + 1))

id=$(jq <<<$JSON -r ".artifacts[$i].id?")
size=$(( $(jq <<<$JSON -r ".artifacts[$i].size_in_bytes?") ))
printf "Deleting '%s' #%d, %'d bytes\n" $name ${ARTCOUNT[$name]} $size
ghapi -X DELETE $REPO/actions/artifacts/$id
done
done
59 changes: 59 additions & 0 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Coveralls Publish

on:
push:
branches: [master]
tags: ["v*"]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


concurrency:
group: ${{ github.workflow }} @ ${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build and Test
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
scala: [3.4.2]
java: [zulu@21]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- name: Ignore line ending differences in git
if: contains(runner.os, 'windows')
shell: bash
run: git config --global core.autocrlf false

- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Java (zulu@21)
id: setup-java-zulu-21
if: matrix.java == 'zulu@21'
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
cache: sbt

- name: sbt update
if: matrix.java == 'zulu@21' && steps.setup-java-zulu-21.outputs.cache-hit == 'false'
shell: bash
run: sbt +update

- name: Build project
run: sbt '++ ${{ matrix.scala }}' coverage test

- run: sbt '++ ${{ matrix.scala }}' coverageReport

- name: Coveralls
uses: coverallsapp/github-action@v2
with:
git-branch: main
27 changes: 0 additions & 27 deletions .github/workflows/publish.yml

This file was deleted.

10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
.DS_Store
out/
.bsp/
.vscode/
.metals/
.bloop/
.idea/
.idea_modules/
target/
reports/
lib_managed/
src_managed/
project/boot/
project/project/
project/project/target/
project/plugins/project
java_pid*.hprof
*.swp
Expand All @@ -16,3 +21,6 @@ tags
.history
*~
wip/
.dotty-ide*
_site/
.bsp/
23 changes: 20 additions & 3 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
align = more // For pretty alignment.
maxColumn = 175 // For my wide 30" display.
assumeStandardLibraryStripMargin = true
version = 3.7.14
project.git = true
maxColumn = 256
runner.dialect = Scala3

align.preset = some

rewrite.rules = [Imports, RedundantBraces, SortModifiers]
rewrite.imports.sort = scalastyle
rewrite.redundantBraces.stringInterpolation = true

rewrite.scala3.convertToNewSyntax = true
rewrite.scala3.removeOptionalBraces = false

docstrings.blankFirstLine = no
docstrings.style = SpaceAsterisk
docstrings.wrap = no

newlines.sometimesBeforeColonInMethodReturnType = true
lineEndings=unix
24 changes: 23 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MIT License
## MIT License

Copyright (c) 2020 Greg Zoller

Expand All @@ -19,3 +19,25 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## ZIO-Json Attribution

Parts of JSON reading software were used either directly or derived from the
[ZIO-Json project](https://github.com/zio/zio-json)
licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
In most cases, "derived" means removal of features not needed by ScalaJack or
other changes needed to adapt the code to the ScalaJack ecosystem. Regardless,
they are credited here as materially the same as those in the ZIO-Json project.

The files used directly or derived are:
* FastStringBuilder.scala
* FieldKeyDecoder.scala
* JsonDecoder.scala
* JsonParser.scala
* JsonReader.scala
* Numbers.scala
* StringMatrix.scala

The terms, privileges, and restrictions provided by the Apache License 2.0
fully apply to these files, where these differ from the MIT license, which
applies to the rest of ScalaJack's code.
Loading