Skip to content

Commit

Permalink
feat: generatePresence take 2 (#25)
Browse files Browse the repository at this point in the history
Now the keys that we store the presence entities allow distinguishing if there is an id with the value `''` vs no id provided. The keys used are:

```
-/p/${clientID}/${entityName}/
-/p/${clientID}/${entityName}/id/${id}
```

Then we also modify the types to not allow an `id` in the params passed to `get`, `list` `startAtID` etc if the type does not have an `id`.

We never add an `id` to an entity.
  • Loading branch information
arv authored Jan 30, 2024
1 parent 8a5d995 commit 9203ed7
Show file tree
Hide file tree
Showing 11 changed files with 2,481 additions and 898 deletions.
1 change: 1 addition & 0 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ jobs:
- name: Install Playwright Deps
run: npx playwright install --with-deps
- run: npm run test
- run: npm run test-types
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
out
node_modules
tsconfig.tsbuildinfo
tsconfig.vitest-temp.json
82 changes: 41 additions & 41 deletions package-lock.json

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

12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
"lint": "eslint --ext .ts,.tsx,.js,.jsx src/",
"build": "tsc",
"prepack": "npm run check-format && npm run lint && npm run test && npm run build",
"test": "vitest run --browser.provider=playwright --browser.name=chromium --browser.headless",
"test:watch": "vitest watch --browser.provider=playwright --browser.name=chromium --browser.headless"
"test": "vitest run",
"test:watch": "vitest watch",
"test-types": "vitest run --typecheck.only --no-browser.enabled",
"test-types:watch": "vitest watch --typecheck.only --no-browser.enabled"
},
"author": "",
"license": "Apache-2.0",
Expand All @@ -30,12 +32,12 @@
"@web/test-runner": "^0.18.0",
"@web/test-runner-playwright": "^0.11.0",
"nanoid": "^5.0.4",
"replicache": "14.0.3",
"replicache": "14.1.0",
"typescript": "^5.3.3",
"zod": "^3.22.4",
"@vitest/browser": "^1.2.1",
"@vitest/browser": "1.2.2",
"playwright": "^1.41.1",
"vitest": "^1.2.1"
"vitest": "1.2.2"
},
"files": [
"out/",
Expand Down
Loading

0 comments on commit 9203ed7

Please sign in to comment.