Skip to content

Commit

Permalink
feat: docs update + project structure (#487)
Browse files Browse the repository at this point in the history
Co-authored-by: afmika <[email protected]>
Co-authored-by: Yohe-Am <[email protected]>
  • Loading branch information
3 people authored Nov 20, 2023
1 parent 34e5087 commit 7210129
Show file tree
Hide file tree
Showing 258 changed files with 9,844 additions and 10,984 deletions.
8 changes: 2 additions & 6 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
[env]
OUT_DIR = { value = "target", relative = true }
[alias]
x = "run --package xtask --"

[profile.typegraph_core.release]
opt-level = "z"
lto = true

[alias]
xtask = "run --package xtask --"
x = "run --package xtask --"
15 changes: 0 additions & 15 deletions .github/pr-title-checker-config.json

This file was deleted.

25 changes: 25 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!--
Pull requests are squash merged using:
- their title as the commit message
- their description as the commit body
Having a good title and description is important for the users to get readable changelog and understand when they need to update his code and how.
-->

### Describe your change

<!-- Explain WHAT the change is -->

### Motivation and context

<!-- Explain WHY the was made or link an issue number -->

### Migration notes

<!-- Explain HOW users should update their code when required -->

### Checklist

- [ ] The change come with new or modified tests
- [ ] Hard-to-understand functions have explanatory comments
- [ ] End-user documentation is updated to reflect the change
18 changes: 0 additions & 18 deletions .github/release.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/pr-title-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: thehanimo/[email protected]
with:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/publish-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
env:
PNPM_VERSION: "8.8.0"
NODE_VERSION: "20.8.0"
POETRY_VERSION: "1.6.1"
POETRY_VERSION: "1.7.0"
PYTHON_VERSION: "3.8"

jobs:
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
run: |
python3 -m venv .venv
source .venv/bin/activate
poetry install
poetry install --no-root
cd website
pnpm install --frozen-lockfile
pnpm build
Expand Down
33 changes: 19 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:

env:
PYTHON_VERSION: "3.8"
POETRY_VERSION: "1.6.1"
DENO_VERSION: "1.37.1"
POETRY_VERSION: "1.7.0"
DENO_VERSION: "1.38.1"
REGISTRY_IMAGE: ghcr.io/${{ github.repository_owner }}/typegate
WASM_TOOLS_VERSION: "1.0.45"
JCO_VERSION: "0.12.1"
Expand All @@ -24,19 +24,21 @@ jobs:
- uses: denoland/setup-deno@v1
with:
deno-version: v${{ env.DENO_VERSION }}
- name: Check version
- uses: kenji-miyake/setup-git-cliff@v1
- id: checks
run: |
VERSION=$(deno run -A dev/lock.ts --version)
if [[ "${{ github.ref_name }}" != "v$VERSION" ]]; then
echo "Tag does not match code version, stopping."
echo "Tag ${{ github.ref_name }} does not match code version v$VERSION, stopping."
exit -1
fi
echo "Releasing v$VERSION"
echo "release_note=$(git cliff --latest --strip header)" >> $GITHUB_OUTPUT
- uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref_name }}
makeLatest: true
generateReleaseNotes: true
body: ${{ steps.checks.outputs.release_note }}
discussionCategory: "Announcements"

meta-cli:
Expand All @@ -62,14 +64,13 @@ jobs:
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
suffix: ""
- os: windows-latest
target: x86_64-pc-windows-msvc
suffix: ".exe"
steps:
- uses: actions/checkout@v4
- uses: dsherret/rust-toolchain-file@v1
with:
targets: ${{ matrix.target }}
- uses: rui314/setup-mold@v1
if: contains(matrix.target, 'linux')
- uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-${{ matrix.target }}
Expand Down Expand Up @@ -98,6 +99,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dsherret/rust-toolchain-file@v1
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ runner.os }}-rust-${{ hashFiles('**/rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }}
Expand All @@ -124,15 +126,15 @@ jobs:
cargo install wasm-tools --version $WASM_TOOLS_VERSION --locked
cargo install wasm-opt --version $WASM_OPT_VERSION --locked
cargo build -p typegraph_core --target wasm32-unknown-unknown --release
wasm-opt -Oz target/wasm32-unknown-unknown/release/typegraph_core.wasm -o $WASM_FILE.opt
cargo build -p typegraph_core --target wasm32-unknown-unknown --target-dir target/wasm --release
wasm-opt -Oz target/wasm/wasm32-unknown-unknown/release/typegraph_core.wasm -o $WASM_FILE.opt
wasm-tools component new $WASM_FILE.opt -o $WASM_FILE
poetry install
poetry install --no-root
poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python/typegraph/gen
cd typegraph/python
poetry install --sync
poetry install
poetry build
poetry publish
cd ../..
Expand Down Expand Up @@ -223,18 +225,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dsherret/rust-toolchain-file@v1
- uses: denoland/setup-deno@v1
with:
deno-version: v${{ env.DENO_VERSION }}
- uses: kenji-miyake/setup-git-cliff@v1
- id: bump
run: |
deno run -A dev/lock.ts --bump prerelease
echo "version=$(deno run -A dev/lock.ts --version)" >> $GITHUB_OUTPUT
git cliff --output CHANGELOG.md
- uses: peter-evans/create-pull-request@v5
with:
branch: bump-${{ steps.bump.outputs.version }}
delete-branch: true
commit-message: "chore: prepare release ${{ steps.bump.outputs.version }}"
title: "chore: prepare release ${{ steps.bump.outputs.version }}"
commit-message: "chore(release): prepare for ${{ steps.bump.outputs.version }}"
title: "chore(release): prepare for ${{ steps.bump.outputs.version }}"
body: "Automatic suggested bump"
base: main
36 changes: 23 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ on:
env:
PYTHON_VERSION: "3.8"
PROTOC_VERSION: "v24.x"
POETRY_VERSION: "1.6.1"
DENO_VERSION: "1.37.1"
POETRY_VERSION: "1.7.0"
DENO_VERSION: "1.38.1"
PNPM_VERSION: "8.8.0"
NODE_VERSION: "20.8.0"
WASM_TOOLS_VERSION: "1.0.45"
Expand Down Expand Up @@ -75,6 +75,7 @@ jobs:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: dsherret/rust-toolchain-file@v1
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ runner.os }}-rust-${{ hashFiles('**/rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }}
Expand Down Expand Up @@ -115,7 +116,7 @@ jobs:
- run: |
python3 -m venv .venv
source .venv/bin/activate
poetry install
poetry install --no-root
cd website
pnpm install --frozen-lockfile
pnpm lint
Expand All @@ -129,6 +130,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dsherret/rust-toolchain-file@v1
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ runner.os }}-rust-${{ hashFiles('**/rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }}
Expand All @@ -148,6 +150,7 @@ jobs:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: dsherret/rust-toolchain-file@v1
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ runner.os }}-rust-${{ hashFiles('**/rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }}
Expand All @@ -167,14 +170,16 @@ jobs:
python3 -m venv .venv
source .venv/bin/activate
cd typegraph/python
poetry install --sync
poetry install --no-root
cd ../..
poetry install --no-root
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -v $WASMEDGE_VERSION
export LD_LIBRARY_PATH="$HOME/.wasmedge/lib:$LD_LIBRARY_PATH"
cargo install wasm-tools --version $WASM_TOOLS_VERSION --locked
cargo build -p typegraph_core --target wasm32-unknown-unknown
wasm-tools component new target/wasm32-unknown-unknown/debug/typegraph_core.wasm -o $WASM_FILE
cargo build -p typegraph_core --target wasm32-unknown-unknown --target-dir target/wasm
mkdir -p $(dirname $WASM_FILE)
wasm-tools component new target/wasm/wasm32-unknown-unknown/debug/typegraph_core.wasm -o $WASM_FILE
rm -rf typegraph/python/typegraph/gen
poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python/typegraph/gen
Expand Down Expand Up @@ -224,14 +229,16 @@ jobs:
python3 -m venv .venv
${{ matrix.activate }}
cd typegraph/python
poetry install --sync
poetry install --no-root
cd ../..
poetry install --no-root
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -v $WASMEDGE_VERSION
export LD_LIBRARY_PATH="$HOME/.wasmedge/lib:$LD_LIBRARY_PATH"
cargo install wasm-tools --version $WASM_TOOLS_VERSION --locked
cargo build -p typegraph_core --target wasm32-unknown-unknown
wasm-tools component new target/wasm32-unknown-unknown/debug/typegraph_core.wasm -o $WASM_FILE
cargo build -p typegraph_core --target wasm32-unknown-unknown --target-dir target/wasm
mkdir -p $(dirname $WASM_FILE)
wasm-tools component new target/wasm/wasm32-unknown-unknown/debug/typegraph_core.wasm -o $WASM_FILE
rm -rf typegraph/python/typegraph/gen
poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python/typegraph/gen
Expand Down Expand Up @@ -292,6 +299,7 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: lukka/get-cmake@latest
- uses: dsherret/rust-toolchain-file@v1
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ runner.os }}-rust-${{ hashFiles('**/rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }}
Expand Down Expand Up @@ -330,13 +338,14 @@ jobs:
tar -xvf meta.tar
python3 -m venv .venv
source .venv/bin/activate
poetry install --sync
poetry install --no-root
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -v $WASMEDGE_VERSION
export LD_LIBRARY_PATH="$HOME/.wasmedge/lib:$LD_LIBRARY_PATH"
cargo install wasm-tools --version $WASM_TOOLS_VERSION --locked
npm install --global @bytecodealliance/jco@$JCO_VERSION
cargo build -p typegraph_core --target wasm32-unknown-unknown
wasm-tools component new target/wasm32-unknown-unknown/debug/typegraph_core.wasm -o $WASM_FILE
cargo build -p typegraph_core --target wasm32-unknown-unknown --target-dir target/wasm
mkdir -p $(dirname $WASM_FILE)
wasm-tools component new target/wasm/wasm32-unknown-unknown/debug/typegraph_core.wasm -o $WASM_FILE
rm -rf typegraph/deno/src/gen
jco transpile $WASM_FILE -o typegraph/deno/src/gen
deno run -A typegraph/deno/dev/fix-declarations.ts
Expand Down Expand Up @@ -368,6 +377,7 @@ jobs:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: dsherret/rust-toolchain-file@v1
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ runner.os }}-rust-${{ hashFiles('**/rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }}
Expand All @@ -389,7 +399,7 @@ jobs:
python3 -m venv .venv
source .venv/bin/activate
cd typegraph/python
poetry install --sync
poetry install --no-root
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -v $WASMEDGE_VERSION
cd ../..
export LD_LIBRARY_PATH="$HOME/.wasmedge/lib:$LD_LIBRARY_PATH"
Expand Down
11 changes: 4 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,17 @@ repos:
# exclude all generated files
exclude: (typegate/deno.lock|.*\.snap$|typegate/src/typegraphs/.*\.json|website/docs/reference/)
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.27.0
rev: 0.27.1
hooks:
- id: check-dependabot
- id: check-github-workflows
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.292"
rev: "v0.1.5"
hooks:
- id: ruff
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
- id: ruff-format
- repo: https://github.com/commitizen-tools/commitizen
rev: 3.10.0
rev: 3.12.0
hooks:
- id: commitizen
stages:
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"website/.docusaurus": true,
"website/node_modules": true
},
"deno.importMap": "typegate/deno.json",
"deno.importMap": "typegate/import_map.json",
"deno.enablePaths": [
"typegate",
"dev",
Expand Down Expand Up @@ -61,4 +61,5 @@
"python.analysis.extraPaths": [
"typegraph/python"
],
"mdx.experimentalLanguageServer": true,
}
Loading

0 comments on commit 7210129

Please sign in to comment.