Skip to content

Commit 7266ef8

Browse files
feat: js bindings (#240)
* chore: add our own text-size * fix: test * chore: cleanup feature gates * chore: cleanup remaining feature gates * refactor: migrate to json config * fix: lint * feat: add schema field * migrate to jsonc config * feat: wasm attempt 2 * make pglt_wasm crate build * setup bun monorepo * feat: bindings * adapt generate packages * fix: add pg to job * fix: run docs codegen * fixes * fixes * fixes * Update configuration.rs Co-authored-by: Julian Domke <[email protected]> * add unit tests * fix: replace_secion * fix: remove wasm tools * remove musl * remove biome ref * remove biome ref * refactor: migrate to jsonc config (#239) * chore: add our own text-size * fix: test * chore: cleanup feature gates * chore: cleanup remaining feature gates * refactor: migrate to json config * fix: lint * feat: add schema field * migrate to jsonc config * fix: run docs codegen * Update configuration.rs Co-authored-by: Julian Domke <[email protected]> * add unit tests * fix: replace_secion --------- Co-authored-by: Julian Domke <[email protected]> --------- Co-authored-by: Julian Domke <[email protected]>
1 parent 6a3d573 commit 7266ef8

38 files changed

+2850
-590
lines changed

.github/workflows/pull_request.yml

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ on:
1212
- "Cargo.lock"
1313
- "rust-toolchain.toml"
1414
- "rustfmt.toml"
15+
# or in js packages
16+
- "packages/**"
1517

1618
concurrency:
1719
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
@@ -40,10 +42,15 @@ jobs:
4042
cache-base: main
4143
env:
4244
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
- name: Setup Biome
46+
uses: biomejs/setup-biome@v2
47+
with:
48+
version: latest
4349
- name: Run format
4450
run: |
4551
cargo fmt --all --check
4652
taplo format --check
53+
biome format
4754
4855
actionlint:
4956
name: Lint GitHub Actions
@@ -84,36 +91,15 @@ jobs:
8491
cache-base: main
8592
env:
8693
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94+
- name: Setup Biome
95+
uses: biomejs/setup-biome@v2
96+
with:
97+
version: latest
8798
- name: Run Lints
8899
run: |
89100
cargo clippy
90101
cargo run -p rules_check
91-
92-
# check-dependencies:
93-
# name: Check Dependencies
94-
# runs-on: ubuntu-latest
95-
# services:
96-
# postgres:
97-
# image: postgres:latest
98-
# env:
99-
# POSTGRES_USER: postgres
100-
# POSTGRES_PASSWORD: postgres
101-
# POSTGRES_DB: postgres
102-
# ports:
103-
# - 5432:5432
104-
# steps:
105-
# - name: Checkout PR Branch
106-
# uses: actions/checkout@v4
107-
# with:
108-
# submodules: true
109-
# - name: Free Disk Space
110-
# uses: ./.github/actions/free-disk-space
111-
# - name: Install toolchain
112-
# run: rustup toolchain install nightly
113-
# - name: Install udeps
114-
# run: cargo install cargo-udeps --locked
115-
# - name: Detect unused dependencies using udeps
116-
# run: cargo +nightly udeps --all-targets
102+
biome lint
117103
118104
test:
119105
name: Test
@@ -145,6 +131,40 @@ jobs:
145131
- name: Run tests
146132
run: cargo test --workspace
147133

134+
test-js-bindings:
135+
name: Test JS Bindings
136+
runs-on: ubuntu-latest
137+
services:
138+
postgres:
139+
image: postgres:latest
140+
env:
141+
POSTGRES_USER: postgres
142+
POSTGRES_PASSWORD: postgres
143+
POSTGRES_DB: postgres
144+
ports:
145+
- 5432:5432
146+
steps:
147+
- name: Checkout PR branch
148+
uses: actions/checkout@v4
149+
with:
150+
submodules: true
151+
- name: Free Disk Space
152+
uses: ./.github/actions/free-disk-space
153+
- name: Install toolchain
154+
uses: moonrepo/setup-rust@v1
155+
- name: Build main binary
156+
run: cargo build -p pglt_cli --release
157+
- name: Setup Bun
158+
uses: oven-sh/setup-bun@v2
159+
- name: Install JS dependencies
160+
run: bun install
161+
- name: Build TypeScript code
162+
working-directory: packages/@pglt/backend-jsonrpc
163+
run: bun run build
164+
- name: Run JS tests
165+
working-directory: packages/@pglt/backend-jsonrpc
166+
run: bun run test
167+
148168
codegen:
149169
name: Check Codegen
150170
runs-on: ubuntu-latest

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@ target/
1818
.DS_Store
1919
desktop.ini
2020

21-
*.log
21+
*.log
22+
23+
node_modules/
24+
25+
**/dist/

0 commit comments

Comments
 (0)