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
49 changes: 49 additions & 0 deletions .github/workflows/typescript-sdk-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: TypeScript SDK Lint

on:
push:
branches: [main, v1]
paths:
- 'sdks/typescript/**'
- '.github/workflows/typescript-sdk-lint.yml'
pull_request:
paths:
- 'sdks/typescript/**'
- '.github/workflows/typescript-sdk-lint.yml'

jobs:
lint-typescript:
name: Lint TypeScript SDK
runs-on: ubuntu-latest

defaults:
run:
working-directory: sdks/typescript

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Cache dependencies
uses: actions/cache@v3
with:
path: sdks/typescript/node_modules
key: ${{ runner.os }}-typescript-sdk-${{ hashFiles('sdks/typescript/package-lock.json') }}
restore-keys: |
${{ runner.os }}-typescript-sdk-

- name: Install dependencies
run: npm ci

- name: Run ESLint
run: npm run lint

- name: Run TypeScript type check
run: npm run typecheck

- name: Run Prettier format check
run: npm run format:check
59 changes: 59 additions & 0 deletions .github/workflows/typescript-sdk-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: TypeScript SDK Tests

on:
push:
branches: [main, v1]
paths:
- 'sdks/typescript/**'
- '.github/workflows/typescript-sdk-test.yml'
pull_request:
paths:
- 'sdks/typescript/**'
- '.github/workflows/typescript-sdk-test.yml'

jobs:
test-typescript:
name: Test TypeScript SDK (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest

strategy:
matrix:
node-version: ['20', '22', '24']

defaults:
run:
working-directory: sdks/typescript

steps:
- uses: actions/checkout@v4

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Cache dependencies
uses: actions/cache@v3
with:
path: sdks/typescript/node_modules
key: ${{ runner.os }}-typescript-sdk-node${{ matrix.node-version }}-${{ hashFiles('sdks/typescript/package-lock.json') }}
restore-keys: |
${{ runner.os }}-typescript-sdk-node${{ matrix.node-version }}-
${{ runner.os }}-typescript-sdk-

- name: Install dependencies
run: npm ci

- name: Build TypeScript
run: npm run build
# - name: Run tests with coverage
# run: npm run test:coverage
#
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# directory: ./sdks/typescript/coverage
# flags: typescript-sdk
# name: typescript-sdk-node${{ matrix.node-version }}
# fail_ci_if_error: false
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ build
*.min.css
coverage
.next
src/routeTree.gen.ts
src/routeTree.gen.ts
sdks/
1 change: 1 addition & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default [
'*.js',
'**/coverage/',
'**/.wrangler/',
'sdks/**',
],
},
prettier,
Expand Down
52 changes: 52 additions & 0 deletions sdks/typescript/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"project": "./tsconfig.eslint.json"
},
"plugins": ["@typescript-eslint", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"rules": {
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/consistent-type-imports": [
"error",
{
"prefer": "type-imports"
}
],
"prettier/prettier": "error"
},
"overrides": [
{
"files": ["tests/**/*.ts", "**/*.test.ts", "**/*.spec.ts"],
"env": {
"node": true
},
"rules": {
"@typescript-eslint/no-explicit-any": "off"
}
}
],
"ignorePatterns": [
"dist/",
"node_modules/",
"coverage/",
"*.js",
"*.d.ts",
"vitest.config.ts",
".eslintrc.json"
]
}
10 changes: 10 additions & 0 deletions sdks/typescript/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
dist/
node_modules/
coverage/
*.d.ts
*.js
*.js.map
package-lock.json
tsconfig.json
.eslintrc.json
vitest.config.ts
9 changes: 9 additions & 0 deletions sdks/typescript/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"endOfLine": "lf"
}
Loading
Loading