Skip to content
Open
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
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Formatted with oxfmt when the repository moved off Biome.
187f7029b211c241cb19cf304490da557848b82a
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ jobs:
- run: pnpm add --global @antelopejs/core
- run: pnpm prepack
- run: pnpm lint
- run: pnpm format:check
- run: pnpm knip
- run: pnpm test
8 changes: 4 additions & 4 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: 'Close stale issues'
name: "Close stale issues"

on:
schedule:
- cron: '30 * * * *'
- cron: "30 * * * *"
workflow_dispatch:

permissions:
Expand All @@ -17,8 +17,8 @@ jobs:
- uses: actions/stale@v9
with:
exempt-issue-labels: pending
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.'
close-issue-message: 'This issue was closed because it has been stalled for 30 days with no activity.'
stale-issue-message: "This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days."
close-issue-message: "This issue was closed because it has been stalled for 30 days with no activity."
days-before-stale: 60
days-before-close: 30
operations-per-run: 200
Expand Down
18 changes: 9 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| --------------------- | --------------------------------------------------------------------------------------- |
| English only | All code must be in English: variable names, function names, comments |
| PNPM only | Always use pnpm, never npm or yarn |
| NO COMMENTS | Code must be self-documenting through clear naming. TSDoc is allowed for public APIs |
| NO COMMENTS | Code must be self-documenting through clear naming. TSDoc is allowed for public APIs |
| NO switch/case | Use objects, maps, or arrays instead |
| NO inline types | Define proper interfaces/types, never use anonymous types like `{a: string, b: number}` |
| Functions ≤ 40 lines | Split into subfunctions if longer |
Expand All @@ -35,23 +35,23 @@ Never use `switch/case` or `if param === 'XXX'` chains. Instead:
// BAD
function getStatus(code: string) {
switch (code) {
case 'A':
return 'Active';
case 'I':
return 'Inactive';
case "A":
return "Active";
case "I":
return "Inactive";
default:
return 'Unknown';
return "Unknown";
}
}

// GOOD
const STATUS_MAP: Record<string, string> = {
A: 'Active',
I: 'Inactive',
A: "Active",
I: "Inactive",
};

function getStatus(code: string) {
return STATUS_MAP[code] ?? 'Unknown';
return STATUS_MAP[code] ?? "Unknown";
}
```

Expand Down
3 changes: 0 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Changelog


## v0.0.8

[compare changes](https://github.com/AntelopeJS/interface-redis/compare/v0.0.7...v0.0.8)
Expand Down Expand Up @@ -83,7 +82,6 @@

## v0.0.2


### 🚀 Enhancements

- Add Redis interface implementation ([b12b5b4](https://github.com/AntelopeJS/interface-redis/commit/b12b5b4))
Expand All @@ -106,4 +104,3 @@

- Antony Rizzitelli <upd4ting@gmail.com>
- Glastis ([@Glastis](http://github.com/Glastis))

56 changes: 0 additions & 56 deletions biome.json

This file was deleted.

10 changes: 8 additions & 2 deletions docs/1.introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ async function subscribeToUserEvents() {
await subscriber.psubscribe("user:*:events");

subscriber.on("pmessage", (pattern, channel, message) => {
console.log(`Pattern: ${pattern}, Channel: ${channel}, Message: ${message}`);
console.log(
`Pattern: ${pattern}, Channel: ${channel}, Message: ${message}`,
);
});
}
```
Expand Down Expand Up @@ -186,7 +188,11 @@ async function trackUniqueVisitors(pageId: string, visitorId: string) {
```typescript
import { GetClient } from "@antelopejs/interface-redis";

async function transferCredits(fromUser: string, toUser: string, amount: number) {
async function transferCredits(
fromUser: string,
toUser: string,
amount: number,
) {
const client = await GetClient();

// Execute multiple commands atomically
Expand Down
16 changes: 16 additions & 0 deletions knip.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { antelopeKnipConfig } from "@antelopejs/tooling-configs/knip";

export default antelopeKnipConfig({
entry: [
// `ajs module test` runs the compiled suites out of this tree, and reads
// src/antelope.test.ts (package.json antelopeJs.test) to build the test
// project; the preset only knows the `src/test/` spelling. The compiled
// tree ships in the package, and the modules implementing this interface
// run it as their conformance suite.
"src/tests/**/*.test.ts",
"src/antelope.test.ts",
],
// `ajs` comes from @antelopejs/core, which CI installs globally rather than
// pulling the whole CLI into every module's dependency tree.
ignoreBinaries: ["ajs"],
});
7 changes: 7 additions & 0 deletions oxfmt.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { antelopeFmtPreset } from "@antelopejs/tooling-configs/oxc/fmt";

export default antelopeFmtPreset({
// Drop once tooling-configs ships the shared ignore (AntelopeJS/tooling-configs#5):
// these are Markdown templates with a .yml extension, which oxfmt cannot parse.
ignorePatterns: [".github/ISSUE_TEMPLATE/**"],
});
7 changes: 7 additions & 0 deletions oxlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from "oxlint";
import { antelopePreset } from "@antelopejs/tooling-configs/oxc/lint";

export default defineConfig({
extends: [antelopePreset()],
options: { typeAware: true },
});
33 changes: 20 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,55 @@
"interface",
"redis"
],
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/AntelopeJS/interface-redis.git"
},
"license": "Apache-2.0",
"packageManager": "pnpm@10.6.5",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist",
"docs",
"skills"
],
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./package.json": "./package.json"
},
"publishConfig": {
"access": "public",
"provenance": true
},
"scripts": {
"build": "rimraf dist && tsc",
"format": "biome format --write .",
"lint:fix": "biome check --write .",
"lint": "biome check .",
"format": "oxfmt .",
"lint:fix": "oxlint --fix",
"lint": "oxlint",
"prepack": "pnpm run build",
"release": "pnpm run lint && pnpm run prepack && release-it",
"test": "pnpm run build && ajs module test ."
"test": "pnpm run build && ajs module test .",
"format:check": "oxfmt --check .",
"knip": "knip"
},
"dependencies": {
"ioredis": "^5.10.1"
},
"devDependencies": {
"@antelopejs/interface-core": ">=0.0.3 <1.0.0",
"@biomejs/biome": "2.3.2",
"@antelopejs/tooling-configs": "^0.0.4",
"@types/chai": "^4.3.20",
"@types/mocha": "^10.0.10",
"@types/node": "^22.19.15",
"chai": "^4.5.0",
"eslint-plugin-perfectionist": "^5.11.0",
"knip": "^6.34.0",
"oxfmt": "^0.66.0",
"oxlint": "1.81.0",
"oxlint-tsgolint": "^7.0.2001",
"release-it": "^19.2.4",
"release-it-changelogen": "^0.1.0",
"rimraf": "^6.1.3",
Expand All @@ -54,10 +64,7 @@
"peerDependencies": {
"@antelopejs/interface-core": ">=0.0.3 <1.0.0"
},
"publishConfig": {
"access": "public",
"provenance": true
},
"packageManager": "pnpm@10.6.5",
"antelopeJs": {
"test": "src/antelope.test.ts",
"skills": [
Expand Down
Loading