Skip to content

Commit b51d3a9

Browse files
committed
chore: format
1 parent d890ecc commit b51d3a9

27 files changed

+10027
-8984
lines changed

.commitlintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"extends": ["@commitlint/config-conventional"]
2+
"extends": ["@commitlint/config-conventional"]
33
}

.eslintrc.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
{
2-
"root": true,
3-
"env": {
4-
"browser": true,
5-
"es2021": true
6-
},
7-
"extends": ["eslint:recommended", "plugin:@typescript-eslint/strict"],
8-
"parserOptions": {
9-
"ecmaFeatures": {
10-
"jsx": true
11-
},
12-
"ecmaVersion": "latest",
13-
"sourceType": "module",
14-
"project": "./tsconfig.json"
15-
},
16-
"ignorePatterns": [
17-
"node_modules/**/*",
18-
"build/**/*",
19-
"examples/**/*",
20-
"openapi*"
21-
],
22-
"plugins": ["@typescript-eslint"],
23-
"rules": {
24-
"@typescript-eslint/no-unused-vars": "warn",
25-
"react/prop-types": "off",
26-
"@typescript-eslint/no-explicit-any": "off"
27-
}
2+
"root": true,
3+
"env": {
4+
"browser": true,
5+
"es2021": true
6+
},
7+
"extends": ["eslint:recommended", "plugin:@typescript-eslint/strict"],
8+
"parserOptions": {
9+
"ecmaFeatures": {
10+
"jsx": true
11+
},
12+
"ecmaVersion": "latest",
13+
"sourceType": "module",
14+
"project": "./tsconfig.json"
15+
},
16+
"ignorePatterns": [
17+
"node_modules/**/*",
18+
"build/**/*",
19+
"examples/**/*",
20+
"openapi*"
21+
],
22+
"plugins": ["@typescript-eslint"],
23+
"rules": {
24+
"@typescript-eslint/no-unused-vars": "warn",
25+
"react/prop-types": "off",
26+
"@typescript-eslint/no-explicit-any": "off"
27+
}
2828
}

.github/workflows/ci.yml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
name: CI
22
on:
3-
push:
4-
branches:
5-
- 'main'
6-
pull_request: {}
3+
push:
4+
branches:
5+
- 'main'
6+
pull_request: {}
77

88
jobs:
9-
ci:
10-
strategy:
11-
matrix:
12-
os: [ubuntu-latest, macos-latest, windows-latest]
13-
node-version: [20.x]
14-
runs-on: ${{ matrix.os }}
15-
steps:
16-
- name: Checkout repository
17-
uses: actions/checkout@v4
9+
ci:
10+
strategy:
11+
matrix:
12+
os: [ubuntu-latest, macos-latest, windows-latest]
13+
node-version: [20.x]
14+
runs-on: ${{ matrix.os }}
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
1818

19-
- name: Setup Node.js
20-
uses: actions/setup-node@v4
21-
with:
22-
node-version: ${{ matrix.node-version }}
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ matrix.node-version }}
2323

24-
- name: Install pnpm
25-
uses: pnpm/action-setup@v2
26-
with:
27-
version: latest
24+
- name: Install pnpm
25+
uses: pnpm/action-setup@v2
26+
with:
27+
version: latest
2828

29-
- name: Install Bun
30-
uses: oven-sh/setup-bun@v1
31-
with:
32-
bun-version: latest
29+
- name: Install Bun
30+
uses: oven-sh/setup-bun@v1
31+
with:
32+
bun-version: latest
3333

34-
- name: Install dependencies
35-
run: pnpm install --frozen-lockfile
34+
- name: Install dependencies
35+
run: pnpm install --frozen-lockfile
3636

37-
- name: Run CI
38-
run: pnpm build && pnpm tsc && pnpm lint
37+
- name: Run CI
38+
run: pnpm build && pnpm tsc && pnpm lint

.github/workflows/release.yml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
name: Release
22

33
permissions:
4-
contents: write
5-
id-token: write
4+
contents: write
5+
id-token: write
66

77
on:
8-
push:
9-
tags:
10-
- 'v*'
8+
push:
9+
tags:
10+
- 'v*'
1111

1212
jobs:
13-
release:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v4
17-
with:
18-
fetch-depth: 0
19-
- uses: actions/setup-node@v4
20-
with:
21-
node-version: lts/*
22-
registry-url: https://registry.npmjs.org/
23-
- uses: oven-sh/setup-bun@v1
24-
with:
25-
bun-version: latest
26-
- uses: pnpm/action-setup@v4
27-
- run: pnpm install
28-
- run: pnpm build
29-
- run: npx changelogithub
30-
continue-on-error: true
31-
env:
32-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
33-
- run: pnpm run publish:ci
34-
env:
35-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
36-
NPM_CONFIG_PROVENANCE: true
13+
release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: lts/*
22+
registry-url: https://registry.npmjs.org/
23+
- uses: oven-sh/setup-bun@v1
24+
with:
25+
bun-version: latest
26+
- uses: pnpm/action-setup@v4
27+
- run: pnpm install
28+
- run: pnpm build
29+
- run: npx changelogithub
30+
continue-on-error: true
31+
env:
32+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
33+
- run: pnpm run publish:ci
34+
env:
35+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
36+
NPM_CONFIG_PROVENANCE: true

.prettierrc

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
2-
"tabWidth": 6,
3-
"useTabs": false,
4-
"bracketSpacing": false,
5-
"bracketSameLine": true,
6-
"singleQuote": true,
7-
"trailingComma": "all",
8-
"arrowParens": "avoid",
2+
"tabWidth": 2,
3+
"useTabs": false,
4+
"bracketSpacing": false,
5+
"bracketSameLine": true,
6+
"singleQuote": true,
7+
"trailingComma": "all",
8+
"arrowParens": "avoid",
99

10-
"importOrder": [
11-
"<THIRD_PARTY_MODULES>",
12-
"",
13-
"^@types/(.*)$",
14-
"^types/(.*)$",
15-
"",
16-
"^constants/(.*)$",
17-
"",
18-
"^utils/(.*)$",
19-
"",
20-
"^src/(.*)$",
21-
"",
22-
"^[./]"
23-
],
10+
"importOrder": [
11+
"<THIRD_PARTY_MODULES>",
12+
"",
13+
"^@types/(.*)$",
14+
"^types/(.*)$",
15+
"",
16+
"^constants/(.*)$",
17+
"",
18+
"^utils/(.*)$",
19+
"",
20+
"^src/(.*)$",
21+
"",
22+
"^[./]"
23+
],
2424

25-
"plugins": ["@ianvs/prettier-plugin-sort-imports"]
25+
"plugins": ["@ianvs/prettier-plugin-sort-imports"]
2626
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ npm install @cortex-ai/sdk
1212
import {Cortex} from '@cortex-ai/sdk';
1313

1414
const cortex = new Cortex({
15-
apiKey: 'YOUR_API_KEY',
15+
apiKey: 'YOUR_API_KEY',
1616
});
1717
```

bump.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {defineConfig} from 'bumpp';
22

33
export default defineConfig({
4-
files: ['package.json', 'examples/**/package.json'],
4+
files: ['package.json', 'examples/**/package.json'],
55
});

bunup.config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import {defineConfig} from 'bunup';
22

33
export default defineConfig({
4-
outDir: 'build',
5-
entry: ['src/index.ts'],
6-
minify: true,
7-
format: ['esm', 'cjs'],
8-
dts: true,
4+
outDir: 'build',
5+
entry: ['src/index.ts'],
6+
minify: true,
7+
format: ['esm', 'cjs'],
8+
dts: true,
99
});

examples/hono/package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
2-
"name": "cortex-sdk-hono-example",
3-
"type": "module",
4-
"version": "0.6.2",
5-
"scripts": {
6-
"dev": "bun run src/index.ts"
7-
},
8-
"dependencies": {
9-
"@cortex-ai/sdk": "workspace:*",
10-
"@hono/node-server": "^1.14.0",
11-
"dotenv": "^16.4.7",
12-
"hono": "^4.7.5"
13-
},
14-
"devDependencies": {
15-
"@types/node": "^20.17.30",
16-
"tsx": "^4.19.3"
17-
}
2+
"name": "cortex-sdk-hono-example",
3+
"type": "module",
4+
"version": "0.6.2",
5+
"scripts": {
6+
"dev": "bun run src/index.ts"
7+
},
8+
"dependencies": {
9+
"@cortex-ai/sdk": "workspace:*",
10+
"@hono/node-server": "^1.14.0",
11+
"dotenv": "^16.4.7",
12+
"hono": "^4.7.5"
13+
},
14+
"devDependencies": {
15+
"@types/node": "^20.17.30",
16+
"tsx": "^4.19.3"
17+
}
1818
}

examples/hono/src/index.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,50 +13,50 @@ const PORT = 8085;
1313
const app = new Hono();
1414

1515
const createCortex = (ctx: Context) => {
16-
const {CORTEX_API_KEY} = env<{
17-
CORTEX_API_KEY: string;
18-
}>(ctx);
16+
const {CORTEX_API_KEY} = env<{
17+
CORTEX_API_KEY: string;
18+
}>(ctx);
1919

20-
const cortex = new Cortex({
21-
apiKey: CORTEX_API_KEY,
22-
});
20+
const cortex = new Cortex({
21+
apiKey: CORTEX_API_KEY,
22+
});
2323

24-
return cortex;
24+
return cortex;
2525
};
2626

2727
app.get('/', c => {
28-
return c.text('Cortex SDK');
28+
return c.text('Cortex SDK');
2929
});
3030

3131
app.get('/stream/step', async ctx => {
32-
const cortex = createCortex(ctx);
32+
const cortex = createCortex(ctx);
3333

34-
const response = await stepStreamResponse(cortex);
34+
const response = await stepStreamResponse(cortex);
3535

36-
if (response instanceof Response) {
37-
return response;
38-
}
36+
if (response instanceof Response) {
37+
return response;
38+
}
3939

40-
return ctx.text(response);
40+
return ctx.text(response);
4141
});
4242

4343
app.get('/stream/workflow', async ctx => {
44-
const {WORKFLOW_ID} = env<{WORKFLOW_ID: string}>(ctx);
44+
const {WORKFLOW_ID} = env<{WORKFLOW_ID: string}>(ctx);
4545

46-
const cortex = createCortex(ctx);
46+
const cortex = createCortex(ctx);
4747

48-
const response = await worklflowStreamResponse(cortex, WORKFLOW_ID);
48+
const response = await worklflowStreamResponse(cortex, WORKFLOW_ID);
4949

50-
if (response instanceof Response) {
51-
return response;
52-
}
50+
if (response instanceof Response) {
51+
return response;
52+
}
5353

54-
return ctx.text(response);
54+
return ctx.text(response);
5555
});
5656

5757
console.log(`Server is running on http://localhost:${PORT}`);
5858

5959
serve({
60-
fetch: app.fetch,
61-
port: PORT,
60+
fetch: app.fetch,
61+
port: PORT,
6262
});

0 commit comments

Comments
 (0)