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

feat: adding redis APL #374

Merged
merged 17 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .changeset/ninety-otters-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@saleor/app-sdk": minor
---

Adding REDIS as APL provider
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,32 @@ the command:
```bash
pnpm lint
```

### Running Integration Tests

To run the integration tests (e.g., Redis APL tests), follow these steps:

1. Start a Redis container:

```bash
docker run --name saleor-app-sdk-redis -p 6379:6379 -d redis:7-alpine
```

2. Run the integration tests:

```bash
pnpm test:integration
```

3. (Optional) Clean up the Redis container:

```bash
docker stop saleor-app-sdk-redis
docker rm saleor-app-sdk-redis
```

Note: If your Redis instance is running on a different host or port, you can set the `REDIS_URL` environment variable:

```bash
REDIS_URL=redis://custom-host:6379 pnpm test:integration
```
15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"copy-readme": "cp README.md dist/README.md",
"publish:ci-prod": "pnpm publish && pnpm exec changeset tag && git push --follow-tags",
"publish:ci-dev": "pnpm exec changeset version --snapshot pr && pnpm publish --tag dev --no-git-checks",
"lint-staged": "lint-staged"
"lint-staged": "lint-staged",
"test:integration": "INTEGRATION=1 vitest run test/integration"
},
"keywords": [],
"author": "",
Expand All @@ -25,7 +26,8 @@
"graphql": ">=16.6.0",
"next": ">=12",
"react": ">=17",
"react-dom": ">=17"
"react-dom": ">=17",
"redis": ">=4"
},
"dependencies": {
"@opentelemetry/api": "^1.7.0",
Expand Down Expand Up @@ -70,6 +72,7 @@
"prettier": "2.7.1",
"react": "^18.2.0",
"react-dom": "18.2.0",
"redis": "^4.7.0",
"tsm": "^2.2.2",
"tsup": "^6.2.3",
"typescript": "4.9.5",
Expand All @@ -80,6 +83,9 @@
"peerDependenciesMeta": {
"@vercel/kv": {
"optional": true
},
"redis": {
"optional": true
}
},
"lint-staged": {
Expand All @@ -98,6 +104,11 @@
"import": "./APL/index.mjs",
"require": "./APL/index.js"
},
"./APL/redis": {
"types": "./APL/redis/index.d.ts",
"import": "./APL/redis/index.mjs",
"require": "./APL/redis/index.js"
},
"./APL/vercel-kv": {
"types": "./APL/vercel-kv/index.d.ts",
"import": "./APL/vercel-kv/index.mjs",
Expand Down
82 changes: 82 additions & 0 deletions pnpm-lock.yaml

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

3 changes: 3 additions & 0 deletions src/APL/redis/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { RedisAPL } from "./redis-apl";

export { RedisAPL };
Loading
Loading