Skip to content

Commit

Permalink
v0.2.1:
Browse files Browse the repository at this point in the history
- Feat: support custom handler in `fe-sdk`
- Chore: remove unnecessary code when `httpLib` is `xior` in `fe-sdk`
- Chore: bump deps to latest
  • Loading branch information
suhaotian committed Sep 21, 2024
1 parent e47c7af commit 71b33d6
Show file tree
Hide file tree
Showing 14 changed files with 336 additions and 263 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

This is the log of notable changes to the `tsdk` that are developer-facing.


### 0.2.1 2024/9/21

- Feat: support custom handler in `fe-sdk`
- Chore: remove unnecessary code when `httpLib` is `xior` in `fe-sdk`
- Chore: bump deps to latest

### 0.2.0 2024/7/18

- Chore: update `xior` to latest version `0.5.3`
Expand Down
12 changes: 6 additions & 6 deletions examples/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@
"bufferutil": "^4.0.7",
"change-case": "^4.1.2",
"cors": "^2.8.5",
"express": "^4.19.2",
"express": "^4.21.0",
"reflect-metadata": "^0.2.1",
"socket.io": "^4.7.5",
"socket.io": "^4.8.0",
"typeorm": "^0.3.20",
"kysely": "^0.27.2",
"typeorm-cursor-pagination": "^0.10.1",
"utf-8-validate": "^6.0.3",
"ws": "^8.13.0",
"zod": "^3.23.8",
"hono": "^4.5.0",
"fastify": "^4.27.0",
"hono": "^4.6.2",
"fastify": "^5.0.0",
"@fastify/express": "^3.0.0",
"@hono/node-server": "^1.11.1",
"i18next": "^23.10.1",
"i18next": "^23.15.1",
"intl-pluralrules": "^2.0.1"
},
"devDependencies": {
Expand All @@ -47,7 +47,7 @@
"@nestjs/cli": "^10.3.2",
"@types/express": "^4.17.21",
"@types/ws": "^8.5.5",
"socket.io-client": "^4.7.5",
"socket.io-client": "^4.8.0",
"tsdk": "workspace:*"
},
"eslintConfig": {
Expand Down
6 changes: 3 additions & 3 deletions examples/server/packages/fe-sdk-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"dependencies": {
"zod": "^3.23.8",
"axios": "^1.7.2",
"axios": "^1.7.7",
"xior": "^0.5.5",
"change-case": "^4.1.2",
"kysely": "^0.26.3",
Expand All @@ -19,11 +19,11 @@
},
"devDependencies": {
"typescript": "^5",
"typedoc": "^0.26.4",
"typedoc": "^0.26.7",
"@tsconfig/recommended": "^1.0.7"
},
"peerDependencies": {
"socket.io-client": "^4.7.5"
"socket.io-client": "^4.8.0"
},
"peerDependenciesMeta": {
"socket.io-client": {
Expand Down
6 changes: 3 additions & 3 deletions examples/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native-web": "^0.19.6",
"socket.io-client": "^4.7.5",
"axios": "^1.7.2",
"xior": "^0.5.5"
"socket.io-client": "^4.8.0",
"axios": "^1.7.7",
"xior": "^0.6.1"
},
"devDependencies": {
"@configs/vitest-config": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"overrides": {
"uuid": "^3.4.0",
"@babel/traverse": ">=7.23.2",
"xior": "^0.5.5"
"xior": "^0.6.1"
}
},
"eslintConfig": {
Expand Down
6 changes: 3 additions & 3 deletions packages/bench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
"dependencies": {
"tsdk-server-adapters": "^0.1.15",
"change-case": "^4.1.2",
"express": "^4.19.2",
"express": "^4.21.0",
"zod": "^3.23.8",
"hono": "^4.5.0",
"hono": "^4.6.2",
"@hono/node-server": "^1.11.1",
"@trpc/server": "^10.44.1",
"fastify": "^4.27.0"
"fastify": "^5.0.0"
},
"devDependencies": {
"@configs/test-config": "workspace:*",
Expand Down
10 changes: 5 additions & 5 deletions packages/tsdk-server-adapters/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tsdk-server-adapters",
"version": "0.2.0",
"version": "0.2.1",
"main": "lib/index.js",
"repository": "tsdk-monorepo/tsdk",
"bugs": "https://github.com/tsdk-monorepo/tsdk/issues",
Expand Down Expand Up @@ -37,11 +37,11 @@
"@tsconfig/recommended": "^1.0.7"
},
"peerDependencies": {
"express": "^4.19.2",
"express": "^4.21.0",
"zod": "^3.23.8",
"socket.io": "^4.7.5",
"hono": "^4.5.0",
"fastify": "^4.28.1"
"socket.io": "^4.8.0",
"hono": "^4.6.2",
"fastify": "^5.0.0"
},
"peerDependenciesMeta": {
"express": {
Expand Down
8 changes: 4 additions & 4 deletions packages/tsdk/fe-sdk-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
},
"dependencies": {
"zod": "^3.23.8",
"axios": "^1.7.2",
"xior": "^0.5.5",
"axios": "^1.7.7",
"xior": "^0.6.1",
"change-case": "^4.1.2"
},
"devDependencies": {
"typescript": "^5",
"typedoc": "^0.26.4",
"typedoc": "^0.26.7",
"@tsconfig/recommended": "^1.0.7"
},
"peerDependencies": {
"socket.io-client": "^4.7.5"
"socket.io-client": "^4.8.0"
},
"peerDependenciesMeta": {
"socket.io-client": {
Expand Down
5 changes: 3 additions & 2 deletions packages/tsdk/fe-sdk-template/src/gen-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ export default function genAPICall<ReqPayload, ResData>(
} {
function APICall(
data: ReqPayload,
requestConfig?: RequestConfig<ReqPayload> | ObjectLiteral
requestConfig?: RequestConfig<ReqPayload> | ObjectLiteral,
customHandler?: typeof handler
): Promise<ResData> {
return getHandler()(apiConfig, data, requestConfig);
return (customHandler ? customHandler : getHandler())(apiConfig, data, requestConfig);
}

// now you can access the config with api
Expand Down
2 changes: 1 addition & 1 deletion packages/tsdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tsdk",
"version": "0.2.0",
"version": "0.2.1",
"description": "Type-safe API development and code share tool for TypeScript projects.",
"repository": "tsdk-monorepo/tsdk",
"bugs": "https://github.com/tsdk-monorepo/tsdk/issues",
Expand Down
4 changes: 3 additions & 1 deletion packages/tsdk/src/sync-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,9 @@ export async function replaceGenAPI() {
const res = await fsExtra.readFile(genAPIfile, 'utf-8');
return fsExtra.writeFile(
genAPIfile,
res.replace('= AxiosRequestConfig<T>', '= XiorRequestConfig<T>')
res
.replace('= AxiosRequestConfig<T>', '= XiorRequestConfig<T>')
.replace(`import type { RequestConfig as AxiosRequestConfig } from './axios';`, '')
);
}
}
Loading

0 comments on commit 71b33d6

Please sign in to comment.