From b17c900e58007fd9cfaca66831f43ab4ecfc06fb Mon Sep 17 00:00:00 2001 From: treeform Date: Thu, 30 Apr 2026 08:20:47 -0700 Subject: [PATCH 1/3] Modernize project structure --- .github/workflows/build.yml | 25 +++++++++++-------------- .github/workflows/docs.yml | 20 ++++++++++---------- .gitignore | 17 +++++++++++++---- README.md | 14 +++++++++++--- pixie.nimble | 10 +++++----- tests/{all.nim => tests.nim} | 0 6 files changed, 50 insertions(+), 36 deletions(-) rename tests/{all.nim => tests.nim} (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d6ea1768..a73ccbfa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,22 +1,19 @@ name: Github Actions -on: [push, pull_request] +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + workflow_dispatch: jobs: build: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest] - nim-version: ['1.4.x', 'stable'] - + os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - - uses: jiro4989/setup-nim-action@v2 - with: - nim-version: ${{ matrix.nim-version }} - repo-token: ${{ secrets.GITHUB_TOKEN }} - - run: nimble test --gc:arc -d:release -y - - run: nimble test --gc:arc -d:release -d:pixieNoSimd -y - - run: nimble test --gc:orc -d:release -y - - run: nim cpp --gc:orc -d:release -r tests/all.nim + - uses: actions/checkout@v5 + - uses: treeform/setup-nim-action@v6 + - run: nimby install -g + - run: nim r tests/tests.nim diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 683a6b54..ae233df2 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,22 +3,22 @@ on: push: branches: - master + workflow_dispatch: +permissions: + contents: write env: - nim-version: 'stable' - nim-src: src/${{ github.event.repository.name }}.nim + nim-src: src/pixie.nim deploy-dir: .gh-pages jobs: docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: jiro4989/setup-nim-action@v1 - with: - nim-version: ${{ env.nim-version }} - - run: nimble install -Y - - run: nimble doc --index:on --project --git.url:https://github.com/${{ github.repository }} --git.commit:master --out:${{ env.deploy-dir }} ${{ env.nim-src }} - - name: "Copy to index.html" - run: cp ${{ env.deploy-dir }}/${{ github.event.repository.name }}.html ${{ env.deploy-dir }}/index.html + - uses: actions/checkout@v5 + - uses: treeform/setup-nim-action@v6 + - run: nimby install -g + - run: nim doc --index:on --project --git.url:https://github.com/${{ github.repository }} --git.commit:master --out:${{ env.deploy-dir }} ${{ env.nim-src }} + - name: Copy to index.html + run: cp ${{ env.deploy-dir }}/pixie.html ${{ env.deploy-dir }}/index.html - name: Deploy documents uses: peaceiris/actions-gh-pages@v3 with: diff --git a/.gitignore b/.gitignore index caff1f8b..639c87c4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,23 @@ -# ignore files with no extention: +# Ignore files with no extention. * !*/ !*.* +!LICENSE -# normal ignores: +# Ignore hidden files, but not the license or github files. +.* +!.github/ +!.github/** +!.gitignore + +# Normal ignores. *.exe nimcache *.pdb *.ilk -.* +*.out + +# Project specific ignores. *.dll __pycache__ bindings/generated @@ -17,4 +26,4 @@ dump.txt tests/fileformats/jpeg/generated tests/fileformats/jpeg/diffs *.dylib -tmp +tmp/ diff --git a/README.md b/README.md index 051fdba7..1e734d17 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,28 @@ 👏 👏 👏 Check out video about the library: [A full-featured 2D graphics library for Nim (NimConf 2021)](https://www.youtube.com/watch?v=8acDfUIwLnk) 👏 👏 👏 -# Pixie - A full-featured 2D graphics library for Nim +# Pixie - A full-featured 2D graphics library for Nim. Pixie is a 2D graphics library similar to [Cairo](https://www.cairographics.org/) and [Skia](https://skia.org) written entirely in Nim. This library is being actively developed and we'd be happy for you to use it. -`nimble install pixie` +`nimby install pixie` ![Github Actions](https://github.com/treeform/pixie/workflows/Github%20Actions/badge.svg) +![GitHub release (latest by date)](https://img.shields.io/github/v/release/treeform/pixie) +![GitHub Repo stars](https://img.shields.io/github/stars/treeform/pixie) +![GitHub](https://img.shields.io/github/license/treeform/pixie) +![GitHub issues](https://img.shields.io/github/issues/treeform/pixie) [API reference](https://treeform.github.io/pixie) [Pixie Book](https://github.com/treeform/pixiebook) +## About + +Pixie includes CPU rasterization, image codecs, text layout, paths, paints, masking, blending, and SIMD-accelerated operations. + ### Videos * [Pixie 5.0 performance improvements](https://www.youtube.com/watch?v=Did21OYIrGI) @@ -111,7 +119,7 @@ To learn how to use Pixie for realtime graphics with GPU, check out [Boxy](https ## Testing -`nimble test` +`nim r tests/tests.nim` ## Examples diff --git a/pixie.nimble b/pixie.nimble index 6903560c..0b1bdf90 100644 --- a/pixie.nimble +++ b/pixie.nimble @@ -5,14 +5,14 @@ license = "MIT" srcDir = "src" -requires "nim >= 1.4.8" +requires "nim >= 2.0.0" requires "vmath >= 3.0.0" -requires "chroma >= 0.2.6" -requires "zippy >= 0.10.3" +requires "chroma >= 1.0.0" +requires "zippy >= 0.10.16" requires "flatty >= 0.3.4" -requires "nimsimd >= 1.2.4" +requires "nimsimd >= 1.3.2" requires "bumpy >= 1.1.3" -requires "crunchy >= 0.1.0" +requires "crunchy >= 0.1.11" task bindings, "Generate bindings": diff --git a/tests/all.nim b/tests/tests.nim similarity index 100% rename from tests/all.nim rename to tests/tests.nim From c6a4280b751499ffcf65e49d0d4226683fd124a7 Mon Sep 17 00:00:00 2001 From: treeform Date: Thu, 30 Apr 2026 08:25:20 -0700 Subject: [PATCH 2/3] Install Pixie dependencies in CI --- .github/workflows/build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a73ccbfa..eb710295 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,5 +15,13 @@ jobs: steps: - uses: actions/checkout@v5 - uses: treeform/setup-nim-action@v6 - - run: nimby install -g + - name: Install dependencies + run: | + nimby install -g bumpy + nimby install -g chroma + nimby install -g crunchy + nimby install -g flatty + nimby install -g nimsimd + nimby install -g vmath + nimby install -g zippy - run: nim r tests/tests.nim From d860486e5870a3033a0422926baf8fbf6df225f9 Mon Sep 17 00:00:00 2001 From: treeform Date: Thu, 30 Apr 2026 08:28:26 -0700 Subject: [PATCH 3/3] Install dependencies from Pixie nimble --- .github/workflows/build.yml | 10 +++------- .github/workflows/docs.yml | 5 ++++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb710295..b9fb988f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,12 +16,8 @@ jobs: - uses: actions/checkout@v5 - uses: treeform/setup-nim-action@v6 - name: Install dependencies + shell: bash run: | - nimby install -g bumpy - nimby install -g chroma - nimby install -g crunchy - nimby install -g flatty - nimby install -g nimsimd - nimby install -g vmath - nimby install -g zippy + cd .. + nimby install -g pixie/pixie.nimble - run: nim r tests/tests.nim diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ae233df2..18d90d74 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -15,7 +15,10 @@ jobs: steps: - uses: actions/checkout@v5 - uses: treeform/setup-nim-action@v6 - - run: nimby install -g + - name: Install dependencies + run: | + cd .. + nimby install -g pixie/pixie.nimble - run: nim doc --index:on --project --git.url:https://github.com/${{ github.repository }} --git.commit:master --out:${{ env.deploy-dir }} ${{ env.nim-src }} - name: Copy to index.html run: cp ${{ env.deploy-dir }}/pixie.html ${{ env.deploy-dir }}/index.html