forked from specta-rs/rspc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Remove unused frontend packages - Improve typescript typing - Fix some small logic bugs - Small improvement to error handling - Change some repository links
- Loading branch information
1 parent
345c3d6
commit b5c14ba
Showing
30 changed files
with
469 additions
and
1,366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,108 +12,63 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
typescript: | ||
name: TypeScript CI | ||
runs-on: ubuntu-latest | ||
outputs: | ||
filter: ${{ steps.filter.outputs.workflows }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install NodeJS | ||
uses: actions/setup-node@v3 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '16' | ||
node-version: '20' | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2.2.4 | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: latest | ||
|
||
- name: Install system dependencies # Pull this step from `oscartbeaumont/specta` | ||
run: sudo apt-get update && sudo apt install libwebkit2gtk-4.1-dev build-essential curl wget file libssl-dev libayatana-appindicator3-dev librsvg2-dev | ||
|
||
- name: Install Rust toolchain | ||
run: rustup toolchain install stable --profile minimal | ||
|
||
- name: Rust cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Install npm dependencies | ||
- name: Install pnpm dependencies | ||
run: pnpm i --frozen-lockfile | ||
|
||
# TODO: Enabling this breaks the CI build with SolidJS Typescript errors and I don't get it. | ||
# - name: Build npm packages | ||
# run: pnpm build | ||
- name: Check format with Prettier | ||
run: pnpm prettier --check . | ||
|
||
- name: Build Rust crate | ||
run: cargo build --all-features | ||
- name: Typecheck with TypeScript | ||
run: pnpm typecheck | ||
|
||
# - name: Generate test bindings for typecheck | ||
# run: cargo test -p example tests::test_rspc_router -- --exact # TODO: Move this into a the first unit test | ||
|
||
# - name: Typecheck | ||
# run: pnpm typecheck | ||
|
||
# - name: Test Rust crate | ||
# run: cargo test --all --exclude create-rspc-app --all-features | ||
|
||
- uses: dorny/paths-filter@v2 | ||
id: filter | ||
with: | ||
filters: | | ||
workflows: | ||
- 'packages/**' | ||
build-publish: | ||
name: Publish to NPM | ||
rust: | ||
name: Rust CI | ||
runs-on: ubuntu-latest | ||
needs: test | ||
if: (github.event_name == 'workflow_dispatch' || (needs.test.outputs.filter == 'true' && github.event_name == 'push')) && github.repository == 'spacedriveapp/rspc' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: pnpm/[email protected] | ||
with: | ||
version: latest | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
cache: 'pnpm' | ||
|
||
- name: Setup npmrc | ||
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc | ||
|
||
- name: Install dependencies | ||
run: pnpm i --frozen-lockfile | ||
- name: Install system dependencies | ||
run: |- | ||
sudo apt-get -yqq update | ||
sudo apt-get install -yqq libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev | ||
- name: Build | ||
run: pnpm build | ||
|
||
- name: Configure main version | ||
if: github.ref == 'refs/heads/main' | ||
run: pnpm set-package-versions | ||
env: | ||
RELEASE_COMMIT_SHA: ${{ github.sha }} | ||
- name: Install Rust toolchain | ||
run: rustup toolchain install stable --profile minimal | ||
|
||
- name: Publish main to npm | ||
if: github.ref == 'refs/heads/main' | ||
run: pnpm publish -r ${TAG} --no-git-checks --filter "@oscartbeaumont-sd/rspc-*" --access public | ||
env: | ||
TAG: ${{ (github.ref == 'refs/heads/main' && '--tag=main') || '' }} | ||
- name: Build Rust crate | ||
run: cargo build --all-features | ||
|
||
# - name: Configure release version | ||
# if: github.ref_type == 'tag' | ||
# run: pnpm set-package-versions | ||
- name: Check Rust format | ||
run: cargo fmt -- --check | ||
|
||
# - name: Publish release to npm | ||
# if: github.ref_type == 'tag' | ||
# run: pnpm publish -r ${TAG} --no-git-checks --filter "@oscartbeaumont-sd/rspc-*" --access public | ||
# env: | ||
# TAG: ${{ (contains(github.ref_name, '-beta.') && '--tag=beta') || ''}} | ||
- name: Run Clippy | ||
uses: giraffate/clippy-action@v1 | ||
with: | ||
reporter: github-pr-review | ||
tool_name: 'Clippy' | ||
filter_mode: diff_context | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
clippy_flags: --workspace --all-features --locked | ||
fail_on_error: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pnpm-lock.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
{ | ||
"name": "@oscartbeaumont-sd/rspc-workspace", | ||
"version": "0.0.0", | ||
"name": "@spacedrive/rspc-workspace", | ||
"version": "1.0.0", | ||
"description": "A blazingly fast and easy to use TRPC-like server for Rust.", | ||
"keywords": [], | ||
"author": "Oscar Beaumont", | ||
"license": "MIT", | ||
"private": true, | ||
"scripts": { | ||
"format": "prettier --write .", | ||
"test": "pnpm -r --parallel --filter=!@oscartbeaumont-sd/rspc-docs --filter=!@oscartbeaumont-sd/rspc-config --filter=!@oscartbeaumont-sd/rspc-examples-* --filter=!rspc-vscode exec pnpm test", | ||
"typecheck": "pnpm -r --filter=!rspc-vscode exec tsc --noEmit", | ||
"client": "pnpm --filter @oscartbeaumont-sd/rspc-client -- ", | ||
"react": "pnpm --filter @oscartbeaumont-sd/rspc-react -- ", | ||
"tauri": "pnpm --filter @oscartbeaumont-sd/rspc-tauri -- " | ||
"test": "echo 'No tests yet.' >&2 && exit 1", | ||
"typecheck": "pnpm -r exec tsc --noEmit", | ||
"client": "pnpm --filter @spacedrive/rspc-client -- ", | ||
"react": "pnpm --filter @spacedrive/rspc-react -- ", | ||
"tauri": "pnpm --filter @spacedrive/rspc-tauri -- " | ||
}, | ||
"devDependencies": { | ||
"typescript": "^5.6.2", | ||
"@ianvs/prettier-plugin-sort-imports": "^4.3.1" | ||
}, | ||
"packageManager": "pnpm@9.11.0" | ||
"packageManager": "pnpm@9.12.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.