Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
3952687
bump deps
suhaotian Feb 23, 2025
593740b
refactor some code
suhaotian Feb 23, 2025
2611021
Update gh actions
suhaotian Feb 23, 2025
c03fb51
Refactor: remove fields
suhaotian Feb 24, 2025
16143e0
Instead `replace(/\\/g, '/')`, use `path.posix.join` for windows
suhaotian Feb 24, 2025
2926256
revert
suhaotian Feb 24, 2025
d5095e1
Add react-router web and delete nextjs web in examples
suhaotian Feb 24, 2025
b83429a
update lcok
suhaotian Feb 24, 2025
74a5d6a
examples/web2 -> examples/web
suhaotian Feb 24, 2025
5f4626b
Support esm
suhaotian Feb 24, 2025
7ee591c
Update document about esm/lib import from `fe-sdk`
suhaotian Feb 24, 2025
5251675
Support generate vue query hooks
suhaotian Feb 24, 2025
4a2b007
Use vitest and remove `configs/*`
suhaotian Feb 24, 2025
125df51
Delete unused `eslintConfig` in package.json
suhaotian Feb 24, 2025
c6d95af
remove .npmrc
suhaotian Feb 24, 2025
db3c603
Use same version of typescript
suhaotian Feb 24, 2025
480aae2
Fix tests with vitest
suhaotian Feb 24, 2025
155034a
GH Actions use node@v20
suhaotian Feb 25, 2025
3e72a80
Fix lint
suhaotian Feb 25, 2025
e8b1a7b
Refactor code
suhaotian Feb 25, 2025
aed82da
Fix lint
suhaotian Feb 25, 2025
4492dc9
Fix actions
suhaotian Feb 25, 2025
2fabac5
Fix tests
suhaotian Feb 25, 2025
fff9843
Try fix
suhaotian Feb 25, 2025
a29a8de
Fix GH actions failed
suhaotian Feb 25, 2025
21b577a
Support generate multiple hooks at same time
suhaotian Feb 26, 2025
6573f78
Delete uncessary code
suhaotian Feb 26, 2025
0140196
Fix typo
suhaotian Feb 26, 2025
cc12c7e
Refactor: add `replaceWindowsPath` and fix `removeFields` logic
suhaotian Feb 26, 2025
78b05e3
Add tests for `transformTypeormEntity`
suhaotian Feb 26, 2025
98aac67
Remove useless test
suhaotian Feb 26, 2025
2414c0e
Add prettier dep
suhaotian Feb 26, 2025
7258402
bump deps
suhaotian Feb 26, 2025
57b1697
remove `change-case`
suhaotian Feb 26, 2025
cb3e45d
Add time measure and remove `chalk`
suhaotian Feb 26, 2025
bc210bb
Add `concurrently` to improve execution time
suhaotian Feb 26, 2025
4ebb0b2
Remove `@tsconfig/recommended` in fe-sdk-template
suhaotian Feb 26, 2025
f49b8e2
fix fe-sdk readme wrong link generate
suhaotian Feb 27, 2025
2572ba1
Add bun to run tsdk scripts
suhaotian Feb 27, 2025
730bec5
Add purge package scripts
suhaotian Feb 27, 2025
7cd8147
Add unit tests for alias.ts and fix code
suhaotian Feb 27, 2025
63894ed
Refactor transform-import-path.ts
suhaotian Feb 27, 2025
a73e469
Refactor: try use fs instead of fs-extra
suhaotian Feb 27, 2025
3e64489
Use fs when can
suhaotian Feb 27, 2025
a05c073
Update fe-sdk-demo
suhaotian Feb 27, 2025
7c60aaa
Refactor `measureExecutionTime` function and add unit tests
suhaotian Feb 28, 2025
5b8347c
Update docs
suhaotian Feb 28, 2025
fcdc1d7
Update log format
suhaotian Feb 28, 2025
989c5ef
Add `--no-vscode` and add `tsdk --init`, `tsdk --sync` and `tsdk --sy…
suhaotian Feb 28, 2025
ac7ede2
Add `method /path` to API generate
suhaotian Feb 28, 2025
5ce078c
Change default `dataHookLib` to include all
suhaotian Feb 28, 2025
2f07537
Improve DX
suhaotian Feb 28, 2025
289f045
Add `--no-zod` cli option
suhaotian Feb 28, 2025
49da3c7
Add node@18.x test
suhaotian Feb 28, 2025
e4519f0
Add tsdk cli empty project e2e test
suhaotian Feb 28, 2025
b4c0790
Add esm output for `tsdk-server-adapters` module and update example a…
suhaotian Mar 1, 2025
da1e3c7
npm `files` should include `esm` folder
suhaotian Mar 1, 2025
7876eeb
Update pnpm version
suhaotian Mar 1, 2025
1267741
Fix actions
suhaotian Mar 1, 2025
40747d7
Add `onlyBuiltDependencies` in package.json for pnpm@v10
suhaotian Mar 1, 2025
077d9c2
add process.env to execSync options.env
suhaotian Mar 1, 2025
ef8cdc3
Minor improve
suhaotian Mar 1, 2025
41a441b
Improve snippets and docs
suhaotian Mar 1, 2025
56a7852
Increase timeout
suhaotian Mar 2, 2025
d7f5e4e
Add `--hookTimeout` to vitest
suhaotian Mar 2, 2025
0b44f4e
Add uniting tests for tsdk-server-adapters
suhaotian Mar 2, 2025
4074a12
Add `pnpm --filter tsdk-server-adapters test`
suhaotian Mar 2, 2025
4a9f0d7
Add zod tests for tsdk-server-adapters
suhaotian Mar 3, 2025
4acd324
Enhance tsdk-server-adapters types
suhaotian Mar 3, 2025
f1be892
hono adapter test add FormData tests
suhaotian Mar 3, 2025
af3e168
Fix
suhaotian Mar 3, 2025
15c7a89
Add simple apiconf `sapic` snippets
suhaotian Mar 3, 2025
d7ba5e6
remove unnessary log
suhaotian Mar 3, 2025
12aa96c
chore: bump deps
suhaotian Mar 3, 2025
0a12b85
Add `onRequest` and `onResponse` hook for APIConfig
suhaotian Mar 3, 2025
c4e8dcc
Fix hookTimeout
suhaotian Mar 3, 2025
35645e4
Fix bun.lockb -> bun.lock
suhaotian Mar 3, 2025
7b698fa
Add bun tests
suhaotian Mar 3, 2025
63a9c9c
Bump xior to v0.7.1
suhaotian Mar 5, 2025
67d3569
Refactor `get-pkg-manager.ts` and add unit tests
suhaotian Mar 5, 2025
71266ac
xior@0.7.2
suhaotian Mar 5, 2025
14f6bdb
Update fe-sdk-template
suhaotian Mar 5, 2025
4eaf024
Improve popover
suhaotian Mar 6, 2025
de408ec
Improve typedoc popover script
suhaotian Mar 8, 2025
1c4b049
Update
suhaotian Mar 9, 2025
c2de531
Compile with tsc first to extract `*.apiconf.ts` config to use AST pa…
suhaotian Mar 12, 2025
a75862a
Remove unnecessary fields in apiconf: `category` and `description`
suhaotian Mar 12, 2025
70c967e
Add how to start a typescript project
suhaotian Mar 12, 2025
4769616
Improve tsdk logs
suhaotian Mar 12, 2025
da20d3e
Update
suhaotian Mar 15, 2025
85d8df9
Add tsdk-helper tests
suhaotian Mar 15, 2025
12a1983
xior v0.7.7
suhaotian Mar 15, 2025
4ff8c0b
Add playwright for e2e tests
suhaotian Mar 16, 2025
34f667c
Update
suhaotian Mar 16, 2025
3bd813b
Update
suhaotian Mar 16, 2025
d3bcec8
Update
suhaotian Mar 17, 2025
5842d49
Update
suhaotian Mar 17, 2025
092d3b7
Update
suhaotian Mar 17, 2025
70d9b06
Fix
suhaotian Mar 20, 2025
4cac3d0
include `bun.lockb`
suhaotian Mar 21, 2025
f1c9e22
Add try catch
suhaotian Mar 21, 2025
789ab8b
Add `validationLib` and support `'valibot'`, `'zod'` and `'arktype'`
suhaotian Mar 21, 2025
420eb34
Fix
suhaotian Mar 21, 2025
6c2341a
Add arktype and valibot tests
suhaotian Mar 21, 2025
655bac2
Update docs
suhaotian Mar 21, 2025
15de7d8
Add gen-worker-api.ts
suhaotian Mar 24, 2025
7150300
generate worker files
suhaotian Mar 24, 2025
6bd3bf2
Fix: common api worker shouldn't generate
suhaotian Mar 24, 2025
429e707
Fix worker
suhaotian Mar 25, 2025
be07350
Improve web worker
suhaotian Mar 26, 2025
4104665
Update
suhaotian Mar 26, 2025
aa2f2d6
Add `worker` options to requestconfig
suhaotian Mar 26, 2025
6fd38ea
Fix typo
suhaotian Mar 27, 2025
d0e149d
Add web workers to README and socket.io example
suhaotian Mar 27, 2025
d2164fd
Fix typo
suhaotian Mar 28, 2025
499a07a
Update README
suhaotian Apr 1, 2025
c5f0a21
Add solidjs and svelte hooks for API SDK
suhaotian Apr 6, 2025
3f941f4
Bump xior
suhaotian Apr 9, 2025
9ef2b18
Bump deps
suhaotian Apr 14, 2025
8ab86d9
Bump deps
suhaotian Apr 18, 2025
bc16020
Support zod/v4
suhaotian Jun 2, 2025
24f76ba
Update deps
suhaotian Jun 24, 2025
9cec966
Update
suhaotian Jul 26, 2025
08fa3df
Update
suhaotian Jul 26, 2025
04de2a3
Ignore prettier error message
suhaotian Jul 26, 2025
cf16f50
ci: change windows-2019 -> windows-2022
suhaotian Jul 26, 2025
f522315
Update ci
suhaotian Jul 26, 2025
8c97402
Update
suhaotian Jul 26, 2025
89f9cf8
Bump deps
suhaotian Aug 4, 2025
c26f49c
Update react-query
suhaotian Aug 4, 2025
a3fe900
publish alpha.1
suhaotian Aug 5, 2025
423534d
Improve tests
suhaotian Aug 5, 2025
f2d0d4b
Fix: Add `isGet` match
suhaotian Aug 6, 2025
9937ed3
tsdk: remove useless util `removeInputFields`
suhaotian Oct 12, 2025
32a8c30
tsdk: enhance util `extractApiconfs`
suhaotian Oct 12, 2025
70695e1
tsdk: enhance util function `removeFields`
suhaotian Oct 12, 2025
b616ecd
tests: make tests stable
suhaotian Oct 12, 2025
d2072f9
Fix tests
suhaotian Oct 12, 2025
6e57f0c
tests:make tests stable
suhaotian Oct 13, 2025
1eb1870
Fix tsdk and bump deps
suhaotian Oct 13, 2025
b91a72f
tsdk: organize deps version in one file
suhaotian Oct 13, 2025
d57b725
vue-query use latest version
suhaotian Oct 13, 2025
2e360db
use latest solid/svelte query and fix hooks generate code
suhaotian Oct 13, 2025
97b777c
bump deps
suhaotian Oct 13, 2025
53a436e
bump deps
suhaotian Oct 13, 2025
9026f02
Add react-query / swr e2e tests
suhaotian Oct 14, 2025
822d52a
Fix playwright.yml
suhaotian Oct 14, 2025
60a41c6
ci: remove node18.x
suhaotian Oct 14, 2025
8ada863
ci: add node lts verison
suhaotian Oct 14, 2025
91991e1
Add vue-query e2e tests
suhaotian Oct 14, 2025
1f1e9fd
Add svelte-query hooks e2e tests
suhaotian Oct 14, 2025
94c29d3
Add solid query e2e tests
suhaotian Oct 14, 2025
5519114
Fix solid/svelte query hooks generate and add web build
suhaotian Oct 14, 2025
0fa0c1c
fix
suhaotian Oct 14, 2025
8ffe46c
delete
suhaotian Oct 14, 2025
a64f1e5
bump tanstack query version
suhaotian Oct 14, 2025
f515d7e
tsdk shared folder name changing: `shared `-> `tsdk-shared`, `shared/…
suhaotian Oct 16, 2025
1656758
Publish tsdk@1.0.0-alpha.7
suhaotian Oct 18, 2025
19917c2
Update lock file
suhaotian Oct 18, 2025
6c955d5
Fix ignore lines
suhaotian Oct 18, 2025
822779d
Keep fe-sdk-template's types.ts pure and keep only necessary types
suhaotian Oct 19, 2025
39dcabd
Fix typo for code snippets
suhaotian Oct 19, 2025
d006d7b
zod/v4 -> zod
suhaotian Oct 19, 2025
406c83f
sync lock
suhaotian Oct 19, 2025
d667cbf
Add load-commonjs util
suhaotian Oct 19, 2025
95f5048
tsdk: don't ignore `.gitignore` file in fe-sdk-template when publishi…
suhaotian Oct 19, 2025
7a0cd8b
Fix crash
suhaotian Oct 19, 2025
21a35bb
Improve tsdk config and template types
suhaotian Oct 20, 2025
502b4ac
Fix tsdk error
suhaotian Oct 22, 2025
39c6bdf
bump deps
suhaotian Nov 11, 2025
2a0b1b2
Release.yml support beta/alpha publish
suhaotian Nov 16, 2025
65d3b5d
No more XiorError as AxiosError since xior@0.8.0
suhaotian Nov 16, 2025
f4746fb
Bump deps
suhaotian Nov 26, 2025
194e2fd
Fix actions
suhaotian Dec 1, 2025
854588c
Fix `transform-import-path.ts` edge issue
suhaotian Dec 12, 2025
dd3a66f
Fix edge case
suhaotian Dec 12, 2025
5a554ec
Add 'use client' to generated hook file
suhaotian Dec 25, 2025
6640e53
Improve swr/react-query hook generate
suhaotian Dec 25, 2025
47878f7
improve tsdk --nest build output
suhaotian Dec 25, 2025
54b5479
Add `moduleType` to tsdk.config.js
suhaotian Dec 25, 2025
0041463
Support `tsdk --openapi openapi-v2orv3.yaml` to generate `*.apiconf.ts`
suhaotian Dec 26, 2025
4377785
sync package.json and lock file
suhaotian Dec 26, 2025
0754a4c
tsdk@1.0.0-alpha.12
suhaotian Dec 26, 2025
e65bad8
Fix hint
suhaotian Dec 26, 2025
9c3ba6d
Improve the test
suhaotian Dec 26, 2025
cd312b0
bump deps
suhaotian Dec 27, 2025
ee170a9
delete useless script.ts
suhaotian Dec 27, 2025
1314c44
bump alpha version for tsdk/tsdk-server-adapters
suhaotian Dec 27, 2025
ba441bc
remove 'utf-8-validate' module(node after v18 already built-in)
suhaotian Dec 27, 2025
bcde6c8
Bump examples dep
suhaotian Dec 27, 2025
fb1aaaa
bump deps
suhaotian Jan 16, 2026
afb19b0
tsdk: Add watch mode
suhaotian Jan 18, 2026
8a3597c
tsdk@1.0.0-alpha.14
suhaotian Jan 18, 2026
3e1e405
Add watch command
suhaotian Jan 18, 2026
4aea581
Sync lock file
suhaotian Jan 18, 2026
bdfb237
Sync new package.json
suhaotian Jan 18, 2026
2629d01
Fix version issue
suhaotian Jan 18, 2026
08d879f
tsdk: improve watch mode
suhaotian Jan 18, 2026
a13ddb8
Fix
suhaotian Jan 18, 2026
1fcdf90
Fix logic
suhaotian Jan 18, 2026
9847197
improve log, add --no-verbose
suhaotian Jan 18, 2026
a058007
fix test
suhaotian Jan 18, 2026
f80034e
Add apiconf to openapi.json support
suhaotian Jan 19, 2026
c7dc26a
Fix
suhaotian Jan 19, 2026
220dfb4
Improve tsdk cli
suhaotian Jan 23, 2026
288ef3f
Implement create functions
suhaotian Jan 24, 2026
29e1879
tsdk: Generate API functions with the first letter in lowercase.
suhaotian Mar 9, 2026
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
25 changes: 8 additions & 17 deletions .github/workflows/linux-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ on:
push:
branches: ['main']
pull_request:
branches: ['main']
types: [opened, synchronize, reopened]

jobs:
run-on-linux:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]
node-version: [20.x, lts/*]

steps:
- name: Checkout
Expand All @@ -26,30 +26,21 @@ jobs:
name: Install pnpm
id: pnpm-install
with:
# version: 9
run_install: false

# - name: Get pnpm store directory
# id: pnpm-cache
# shell: bash
# run: |
# echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

# - uses: actions/cache@v3
# name: Setup pnpm cache
# with:
# path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
# key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
# restore-keys: |
# ${{ runner.os }}-pnpm-store-
- uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: pnpm install

- run: pnpm -v
- run: dir
- run: pnpm lint
# - run: pnpm --filter app-example test
- run: pnpm start:tsdk

- run: pnpm --filter=web typecheck && pnpm --filter=web build

- run: pnpm start:bun

- run: pnpm --filter fe-sdk-demo-docs build
- run: dir
38 changes: 38 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Playwright Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
run_install: false

- name: Install dependencies
run: pnpm install
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps

- name: Build necessary packages
run: pnpm build:tsdk
- name: Run Playwright tests
run: pnpm exec playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Run vite/webpack/next builds
run: pnpm --filter web --filter vue-web --filter solid-web --filter svelte-web build
79 changes: 56 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,79 @@ name: Release

on:
push:
branches:
- main
tags:
- v*
pull_request:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

if: startsWith(github.ref, 'refs/tags/v')
permissions:
id-token: write
contents: write

steps:
- name: Check out
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
version: 9
run_install: false

- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
# version: 9.1.2
run_install: false
node-version: 20.x
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: pnpm install
run: pnpm install --frozen-lockfile

- name: Check types
run: pnpm checktype

- name: Run lint
run: pnpm lint

- run: pnpm lint
- name: Determine release tag
id: release-tag
run: |
TAG=${GITHUB_REF#refs/tags/}
echo "version=$TAG" >> $GITHUB_OUTPUT

- name: Release
run: pnpm start-publish
if [[ "$TAG" =~ -alpha(\.|$) ]] || [[ "$TAG" =~ -beta(\.|$) ]]; then
echo "npm_tag=next" >> $GITHUB_OUTPUT
echo "is_prerelease=true" >> $GITHUB_OUTPUT
echo "📦 Publishing as pre-release: $TAG (npm tag: next)"
else
echo "npm_tag=latest" >> $GITHUB_OUTPUT
echo "is_prerelease=false" >> $GITHUB_OUTPUT
echo "📦 Publishing as stable release: $TAG (npm tag: latest)"
fi

- name: Verify tsdk package contents
run: cd packages/tsdk && npm pack --dry-run

- name: Verify tsdk-server-adapters package contents
run: cd packages/tsdk-server-adapters && npm pack --dry-run

- name: Publish tsdk to npm
run: cd packages/tsdk && npm run build && node ../../scripts/purge-pkg-for-publish.mjs && npm publish --access public --no-git-checks --provenance --registry=https://registry.npmjs.org --tag=${{ steps.release-tag.outputs.npm_tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}

- name: Publish tsdk-server-adapters to npm
run: cd packages/tsdk-server-adapters && npm run build && node ../../scripts/purge-pkg-for-publish.mjs && npm publish --access public --no-git-checks --provenance --registry=https://registry.npmjs.org --tag=${{ steps.release-tag.outputs.npm_tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.release-tag.outputs.version }}
name: Release ${{ steps.release-tag.outputs.version }}
draft: false
prerelease: ${{ steps.release-tag.outputs.is_prerelease }}
generate_release_notes: true
30 changes: 10 additions & 20 deletions .github/workflows/windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ on:
push:
branches: ['main']
pull_request:
branches: ['main']
types: [opened, synchronize, reopened]

jobs:
run-on-windows-2019:
runs-on: windows-2019
run-on-windows-2025:
runs-on: windows-2025

strategy:
matrix:
node-version: [18.x]
node-version: [20.x, lts/*]

steps:
- name: Checkout
Expand All @@ -26,30 +26,20 @@ jobs:
name: Install pnpm
id: pnpm-install
with:
# version: 9.1.2
run_install: false

# - name: Get pnpm store directory
# id: pnpm-cache
# shell: bash
# run: |
# echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

# - uses: actions/cache@v3
# name: Setup pnpm cache
# with:
# path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
# key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
# restore-keys: |
# ${{ runner.os }}-pnpm-store-
- uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: pnpm install

- run: pnpm -v
- run: dir
# - run: pnpm lint
# - run: pnpm --filter app-example test
- run: pnpm start:tsdk

- run: pnpm --filter=web typecheck && pnpm --filter=web build

- run: pnpm start:bun

- run: pnpm --filter fe-sdk-demo-docs build
- run: dir
15 changes: 14 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,17 @@ build-*
*.db
*.db-shm
*.db-wal
*.zip
*.zip
test-project
test-project-bun
test-project-yarn
test-project-npm

# Playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
DOC.md
FAQ.md
FAQ2.md
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
pnpm lint-staged
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

73 changes: 45 additions & 28 deletions .vscode/tsdk.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,76 @@
"scope": "typescript",
"prefix": "apii",
"body": [
"import * as z from 'zod';",
"import { transformPath, APIConfig, ObjectLiteral } from '@/src/shared/tsdk-helper';"
"import { transformPath, type APIConfig } from '@/src/tsdk-shared/helpers';"
],
"description": "api config import snippet"
"description": "API config import snippet"
},
"apiconf": {
"scope": "typescript",
"prefix": "apic",
"body": [
"",
"/**",
" * ${1:description} ({@link APIConfig})",
" * @category ${3:Category}",
" * ${1:Description} ({@link APIConfig})",
" * @category ${2:Category}",
" */",
"export const ${2:ApiName}Config: APIConfig = {",
"export const ${3:ApiName}Config: APIConfig = {",
" type: '${4:user}',",
" method: '${5|get,post,delete,put,patch,head,options|}',",
" path: transformPath('${2:ApiName}'),",
" description: '${1:description}',",
" category: '${3:Category}'",
" method: '${5|GET,POST,DELETE,PUT,PATCH,HEAD,OPTIONS|}',",
" path: transformPath('${3:ApiName}'),",
"};",
"/**",
" *",
" * @category ${3:Category}",
" * @category ${2:Category}",
" */",
"export type ${2:ApiName}Req = ${8:{\\}};",
"",
"export type ${3:ApiName}Req = {${6:}};",
"/**",
" *",
" * @category ${3:Category}",
" * @category ${2:Category}",
" */",
"export type ${2:ApiName}Res = ${9:{\\}};",
"// --------- ${2:ApiName} END ---------",
""
"export type ${3:ApiName}Res = {${7:}};",
"// --------- ${3:ApiName} END ---------"
],
"description": "apic onfig snippet"
"description": "API config snippet"
},
"importApiConf": {
"simple apiconf": {
"scope": "typescript",
"prefix": "sapic",
"body": [
"/**",
" * ${1:Description} ({@link APIConfig})",
" * @category ${2:Category}",
" */",
"export const ${3:ApiName}Config: APIConfig = {",
" // type: 'user',",
" method: '${4|get,post,delete,put,patch,head,options|}',",
" path: transformPath('${3:ApiName}'),",
"};",
"/**",
" * @category ${2:Category}",
" */",
"export type ${3:ApiName}Req = {${5}};",
"/**",
" * @category ${2:Category}",
" */",
"export type ${3:ApiName}Res = {${6}};",
"// --------- ${3:ApiName} END ---------"
],
"description": "Simple API config snippet"
},
"importApiConf": {
"scope": "typescript,typescriptreact",
"prefix": "apin",
"body": [
"${1:name}Config,",
"${1:name}Req,",
"${1:name}Res,",
"${1:ApiName}Config,",
"${1:ApiName}Req,",
"${1:ApiName}Res,"
],
"description": "apic onfig name snippet"
"description": "API config import names"
},
"genRoute": {
"scope": "typescript",
"prefix": "genr",
"body": [
"genRoute<${1:name}Req, ${1:name}Res>(${1:name}Config, async (data, reqInfo) => {",
" return ${2://service}(data, reqInfo);",
"genRoute<${1:ApiName}Req, ${1:ApiName}Res>(${1:ApiName}Config, async (data, reqInfo) => {",
" return ${2://serviceName}(data, reqInfo);",
"});"
],
"description": "genRoute<Req, Res>() snippet"
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ pnpm install
- [`packages/tsdk`](./packages/tsdk) - `tsdk` package.
- [`packages/tsdk-server-adapters`](./packages/tsdk-server-adapters) - Server adapters package for tsdk.
- [`packages/bench`](./packages/bench) - benchmark for `tsdk-server-adapters`.
- [`configs/*`](./packages/bench) - config packages for ts/eslint/test etc.
- [`examples/*`](./examples) - Examples that only use packages and aren't aware of other apps.

## Community
Expand Down
Loading