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.
c63de7a84effc6ec10143132343b8753fee8558b
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
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@

### Features

* add JSONBody parameter provider and assert utility function ([#3](https://github.com/AntelopeJS/api/issues/3)) ([2349558](https://github.com/AntelopeJS/api/commit/23495586ff3618795ce7585a601d0dac5bed5d92))
* default config ([#6](https://github.com/AntelopeJS/api/issues/6)) ([cc00ddc](https://github.com/AntelopeJS/api/commit/cc00ddc8aaee3ba0ad196682a2a3bdd219182b7c))
- add JSONBody parameter provider and assert utility function ([#3](https://github.com/AntelopeJS/api/issues/3)) ([2349558](https://github.com/AntelopeJS/api/commit/23495586ff3618795ce7585a601d0dac5bed5d92))
- default config ([#6](https://github.com/AntelopeJS/api/issues/6)) ([cc00ddc](https://github.com/AntelopeJS/api/commit/cc00ddc8aaee3ba0ad196682a2a3bdd219182b7c))

### Bug Fixes

* default config ([900ea22](https://github.com/AntelopeJS/api/commit/900ea2202589c54ea63a0c3f52e9df40ec217388))
* use correct path mappings for playground interfaces ([#2](https://github.com/AntelopeJS/api/issues/2)) ([3ed7582](https://github.com/AntelopeJS/api/commit/3ed7582d65112adc20ef24cdcdb01a10a9192177))
- default config ([900ea22](https://github.com/AntelopeJS/api/commit/900ea2202589c54ea63a0c3f52e9df40ec217388))
- use correct path mappings for playground interfaces ([#2](https://github.com/AntelopeJS/api/issues/2)) ([3ed7582](https://github.com/AntelopeJS/api/commit/3ed7582d65112adc20ef24cdcdb01a10a9192177))

## 0.0.1 (2025-05-08)
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ ajs project modules add @antelopejs/api

This module implements the API interfaces who provide a HTTP framework with decorator controllers and middleware support. The interfaces are installed separately to maintain modularity and minimize dependencies.

| Name | Install command | |
| ------------- | --------------------------------------- | ------------------------------------------------------------ |
| API | `ajs module imports add api` | [Documentation](https://github.com/AntelopeJS/interface-api) |
| Name | Install command | |
| ---- | ---------------------------- | ------------------------------------------------------------ |
| API | `ajs module imports add api` | [Documentation](https://github.com/AntelopeJS/interface-api) |

## Overview

Expand Down
53 changes: 0 additions & 53 deletions biome.json

This file was deleted.

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

export default antelopeKnipConfig({
// `ajs` comes from @antelopejs/core, which CI installs globally rather than
// pulling the whole CLI into every module's dependency tree.
ignoreBinaries: ["ajs"],
ignoreDependencies: [
// emitDecoratorMetadata makes tsc emit Reflect.metadata calls, so the
// polyfill has to be loaded at runtime even though nothing imports it.
"reflect-metadata",
// Mocha's globals, supplied to the suites `ajs module test` runs.
"@types/mocha",
],
});
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 },
});
59 changes: 33 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,33 @@
"antelopejs",
"api",
"http",
"websocket",
"server"
"server",
"websocket"
],
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/AntelopeJS/api.git"
},
"main": "dist/index.js",
"files": [
"dist"
],
"main": "dist/index.js",
"publishConfig": {
"access": "public",
"provenance": true
},
"license": "Apache-2.0",
"packageManager": "pnpm@10.6.5",
"scripts": {
"build": "rimraf dist && tsc",
"dev": "ajs project run -w -p playground",
"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 test && pnpm run prepack && release-it",
"test": "pnpm run build && ajs module test ."
},
"antelopeJs": {
"implements": [
"@antelopejs/interface-api",
"@antelopejs/interface-api-util"
],
"test": "src/test/antelope.test.ts",
"defaultConfig": {
"servers": [
{
"protocol": "http",
"host": "localhost",
"port": 8080
}
]
}
"test": "pnpm run build && ajs module test .",
"format:check": "oxfmt --check .",
"knip": "knip"
},
"dependencies": {
"@antelopejs/interface-api": ">=0.0.12 <1.0.0",
Expand All @@ -57,15 +42,37 @@
"ws": "^8.20.0"
},
"devDependencies": {
"@biomejs/biome": "2.3.2",
"@antelopejs/tooling-configs": "^0.0.4",
"@types/mocha": "^10.0.10",
"@types/node": "^22.19.15",
"@types/sinon": "^21.0.0",
"@types/ws": "^8.18.1",
"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",
"sinon": "^21.0.3",
"typescript": "^5.9.3"
},
"packageManager": "pnpm@10.6.5",
"antelopeJs": {
"implements": [
"@antelopejs/interface-api",
"@antelopejs/interface-api-util"
],
"test": "src/test/antelope.test.ts",
"defaultConfig": {
"servers": [
{
"protocol": "http",
"host": "localhost",
"port": 8080
}
]
}
}
}
2 changes: 1 addition & 1 deletion playground/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from "@antelopejs/interface-api-util";
import {
Controller,
Delete,
Expand All @@ -7,7 +8,6 @@ import {
Post,
Put,
} from "@antelopejs/interface-api";
import { assert } from "@antelopejs/interface-api-util";

export class PlaygroundController extends Controller("/playground") {
@Get("/hello")
Expand Down
5 changes: 2 additions & 3 deletions playground/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"compilerOptions": {
"moduleResolution": "node",
"target": "esnext",
"module": "commonjs",
"lib": ["ES2020"],
"allowJs": true,
"outDir": "dist",
"rootDir": "src",
"strict": true,
"noImplicitAny": true,
"esModuleInterop": true,
Expand All @@ -16,8 +16,7 @@
"emitDecoratorMetadata": true,
"declaration": true,
"sourceMap": true,
"useDefineForClassFields": true,
"baseUrl": "src"
"useDefineForClassFields": true
},
"include": ["src/**/*.ts"]
}
Loading