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

Various improvements #291

Merged
merged 31 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
80b0c81
WIP
kearfy Jun 29, 2024
a2b8bd6
Prefix SurrealDB versions with v
kearfy Jun 29, 2024
50bd2d7
Code Quality
kearfy Jun 29, 2024
3a6805a
fix cbor tests
kearfy Jun 29, 2024
f538a2d
Exclude certain tests for 1.4.2
kearfy Jun 29, 2024
6c12ff6
Fix test exclusion
kearfy Jun 29, 2024
8ae3a9e
isolatedDeclarations
kearfy Jun 29, 2024
444db7b
Fixup build process
kearfy Jun 29, 2024
5b3ef53
Update publish workflow
kearfy Jun 29, 2024
8c0b834
Code Quality
kearfy Jun 29, 2024
fa9eb36
vscode config
kearfy Jun 29, 2024
8eddf72
vscode config
kearfy Jun 29, 2024
6d52d5d
Update workflows
kearfy Jun 29, 2024
f4525e4
Improve package.json
kearfy Jun 29, 2024
91debb2
Add comment explaining difference
kearfy Jun 29, 2024
3b47a4a
Apply suggestions from review
kearfy Jun 29, 2024
de8595e
Apply suggestions from review
kearfy Jul 1, 2024
abf13a8
Run tests across WS and HTTP engines
kearfy Jul 1, 2024
32b13c7
Fix live listeners not receiving CLOSE message
kearfy Jul 1, 2024
d8aba57
Update LQ test
kearfy Jul 1, 2024
70c445a
Allow passing `Table`
kearfy Jul 1, 2024
7c9ee47
export `escape_ident` method
kearfy Jul 1, 2024
117912f
Code Quality
kearfy Jul 1, 2024
82a6341
Prepared Queries should be partially encoded
kearfy Jul 2, 2024
0090326
Fix tests 2.0.0
kearfy Jul 2, 2024
746da79
Bump CI to Surrealdb 2.0.0-alpha.4
kearfy Jul 2, 2024
156cfd2
Fix readFloat16
kearfy Jul 2, 2024
9b9a9fa
bundle cbor exports
kearfy Jul 3, 2024
23141f8
ts script should not emit dts files
kearfy Jul 3, 2024
a2a09dc
update imports/exports
kearfy Jul 3, 2024
cdff21b
Make version validation functions abstract
kearfy Jul 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .editorconfig

This file was deleted.

114 changes: 60 additions & 54 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,65 @@
name: CI

on:
push:
branches:
- main
pull_request:
push:
branches:
- main
pull_request:

jobs:
lint:
name: Linting
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Check formatting
run: deno fmt --check
- name: Run linting
run: deno lint

test:
name: Testing
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Setup SurrealDB
run: curl -sSf https://install.surrealdb.com | sh

- name: Run Test
run: deno task test

build:
name: Build library
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Run Build
run: deno task build
quality:
name: Code Quality
runs-on: ubuntu-latest
steps:
- name: Install Bun
uses: oven-sh/setup-bun@v2

- name: Code Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: bun install

- name: Checking Code Quality
run: bun run quality:check

test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
surrealdb: ["v1.4.2", "v1.5.3", "v2.0.0-alpha.3"]
engine: ["ws", "http"]
steps:
- name: Install SurrealDB ${{ matrix.surrealdb }} over ${{ matrix.engine }} engine
run: curl --proto '=https' --tlsv1.2 -sSf https://install.surrealdb.com | sh -s -- --version ${{ matrix.surrealdb }}

- name: Install Bun
uses: oven-sh/setup-bun@v2

- name: Code Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: bun install

- name: Run tests
run: bun test
env:
SURREAL_PROTOCOL: ${{ matrix.engine }}

build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Install Bun
uses: oven-sh/setup-bun@v2

- name: Code Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: bun install

- name: Build library
run: bun run build
62 changes: 46 additions & 16 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,51 @@
name: Publish Package to npmjs
name: Publish

on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- uses: actions/checkout@v3
- run: deno task build
- run: cd ./npm && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
npm:
name: NPM
runs-on: ubuntu-latest
steps:
- name: Install Bun
uses: oven-sh/setup-bun@v2

- uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'

- name: Code Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: bun install

- name: Build library
run: bun run build

- name: Publish to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
jsr:
name: JSR
runs-on: ubuntu-latest
steps:
- name: Install Bun
uses: oven-sh/setup-bun@v2

- name: Code Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: bun install

- name: Generate JSR config
run: bun run jsr

- name: Publish to JSR
run: bunx jsr publish
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ Temporary Items
/.test_data
npm
node_modules
dist


# -----------------------------------
# Files
# -----------------------------------

*.db
jsr.json
5 changes: 2 additions & 3 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"recommendations": [
"denoland.vscode-deno"
]
"recommendations": ["biomejs.biome", "oven.bun-vscode"],
"unwantedRecommendations": []
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"deno.enable": true
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true
}
13 changes: 13 additions & 0 deletions .zed/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"formatter": {
"external": {
"command": "bunx",
"arguments": [
"biome",
"format",
"--write",
"--stdin-file-path={buffer_path}"
]
}
}
}
15 changes: 15 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"files": {
"ignore": ["dist/**"]
}
}
Binary file added bun.lockb
Binary file not shown.
65 changes: 0 additions & 65 deletions compile.ts

This file was deleted.

30 changes: 0 additions & 30 deletions deno.json

This file was deleted.

Loading
Loading