Skip to content

Commit

Permalink
Merge pull request #172 from authzed/171-use-vitest
Browse files Browse the repository at this point in the history
Generate ESM code and use vitest for tests
  • Loading branch information
tstirrat15 authored Jan 21, 2025
2 parents e29e7a3 + ff91f0b commit 591c30e
Show file tree
Hide file tree
Showing 41 changed files with 592 additions and 726 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: "Lint and Test"
on:
push:
Expand Down
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
node_modules
dist
src/authzedapi/authzed/api/v0
src/authzedapi/authzed/api/v1alpha1
js-dist/src/authzedapi/authzed/api/v0
js-dist/src/authzedapi/authzed/api/v1alpha1

# Because of how node's dependency management works,
# and the fact that a lockfile in a published package
Expand All @@ -13,3 +9,4 @@ yarn.lock
package-lock.json
js-dist/yarn.lock
js-dist/package-lock.json
js-dist/src
10 changes: 8 additions & 2 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
---
version: "v2"
plugins:
- remote: buf.build/community/timostamm-protobuf-ts:v2.9.4
- remote: "buf.build/community/timostamm-protobuf-ts:v2.9.1"
out: "src/authzedapi"
opt: generate_dependencies,long_type_string,client_grpc1
opt:
- generate_dependencies
- long_type_string
- client_grpc1
inputs:
- module: "buf.build/authzed/api:v1.38.0"
paths:
# NOTE: This grabs only the v1 proto and ignores v0 and v1dev.
- "authzed/api/v1"
3 changes: 2 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
services:
spicedb-servetesting:
image: quay.io/authzed/spicedb:latest
Expand All @@ -7,4 +8,4 @@ services:
test: ["CMD", "/usr/local/bin/grpc_health_probe", "-addr=:50051"]
interval: 30s
timeout: 30s
retries: 3
retries: 3
5 changes: 0 additions & 5 deletions jasmine.json

This file was deleted.

5 changes: 0 additions & 5 deletions js-dist/jasmine.json

This file was deleted.

5 changes: 3 additions & 2 deletions js-dist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@authzed/authzed-js-node",
"author": "authzed",
"version": "0.19.0",
"type": "module",
"description": "authzed js client for nodejs",
"keywords": [
"authorization",
Expand All @@ -18,14 +19,14 @@
"private": false,
"scripts": {
"test": "../scripts/run-and-test.sh",
"only-run-tests": "jasmine --config=jasmine.json"
"only-run-tests": "vitest"
},
"dependencies": {
"@grpc/grpc-js": "^1.11.3",
"google-protobuf": "^3.15.3"
},
"devDependencies": {
"grpc-tools": "^1.11.2",
"jasmine": "^5.3.0"
"vitest": "^2.1.3"
}
}
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@authzed/authzed-node",
"author": "authzed",
"version": "0.19.0",
"type": "module",
"description": "authzed client for nodejs",
"keywords": [
"authorization",
Expand All @@ -19,12 +20,12 @@
"private": false,
"scripts": {
"test": "./scripts/run-and-test.sh",
"only-run-tests": "ts-node node_modules/jasmine/bin/jasmine --config=jasmine.json",
"buf": "./buf.gen.yaml",
"only-run-tests": "vitest",
"buf": "buf generate && tsc-esm-fix --src src/authzedapi --ext='.js'",
"lint": "./node_modules/.bin/eslint src",
"build": "tsc",
"prepublish": "yarn build",
"build-js-client": "tsc --target es2018 --declaration false --outDir js-dist"
"build-js-client": "tsc --declaration false --outDir js-dist"
},
"dependencies": {
"@grpc/grpc-js": "^1.12.5",
Expand All @@ -36,14 +37,13 @@
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.17.0",
"@protobuf-ts/plugin": "^2.9.4",
"@types/jasmine": "^5.1.5",
"@types/jest": "^29.5.14",
"@tsconfig/node18": "^18.2.4",
"@typescript-eslint/eslint-plugin": "^8.19.0",
"@typescript-eslint/parser": "^8.19.0",
"eslint": "^9.17.0",
"grpc-tools": "^1.12.4",
"jasmine": "^5.5.0",
"ts-node": "^10.9.2",
"typescript": "^5.7"
"tsc-esm-fix": "^3.1.2",
"typescript": "^5.7",
"vitest": "^2.1.3"
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/authzedapi/authzed/api/materialize/v0/watchpermissions.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 25 additions & 27 deletions src/authzedapi/authzed/api/v1/core.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 591c30e

Please sign in to comment.