Skip to content

Commit 7e41bc4

Browse files
authored
refactor: merge with standard-server repo (#176)
* improve tsconfig * refactor: merge with repo * improve test:coverage * update naming * fix typescript references
1 parent fd117b2 commit 7e41bc4

File tree

91 files changed

+3427
-110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+3427
-110
lines changed

eslint.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ export default antfu({
1212
'ts/method-signature-style': ['off'],
1313
},
1414
}, {
15-
files: ['**/*.test.ts', '**/*.test.tsx', '**/*.test-d.ts', '**/*.test-d.tsx', 'apps/content/shared/**', 'playgrounds/**'],
15+
files: ['**/*.test.ts', '**/*.test.tsx', '**/*.test-d.ts', '**/*.test-d.tsx', 'apps/content/shared/**', 'playgrounds/**', 'packages/*/playground/**'],
1616
rules: {
1717
'unused-imports/no-unused-vars': 'off',
1818
'antfu/no-top-level-await': 'off',
1919
'react-hooks/rules-of-hooks': 'off',
2020
'no-alert': 'off',
2121
},
2222
}, {
23-
files: ['apps/content/shared/**', 'apps/content/docs/**', 'apps/content/examples/**', 'playgrounds/**'],
23+
files: ['apps/content/shared/**', 'apps/content/docs/**', 'apps/content/examples/**', 'playgrounds/**', 'packages/*/playground/**'],
2424
rules: {
2525
'no-console': 'off',
2626
'perfectionist/sort-imports': 'off',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"posttype:check": "tsc --noEmit",
1414
"test": "vitest run",
1515
"test:watch": "vitest watch",
16-
"test:coverage": "vitest run --coverage --coverage.include=packages",
16+
"test:coverage": "vitest run --coverage --coverage.include='packages/*/src/**'",
1717
"lint": "eslint --max-warnings=0 .",
1818
"lint:fix": "pnpm run lint --fix",
1919
"sherif": "pnpm dlx sherif",

packages/client/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@
6060
"type:check": "tsc -b"
6161
},
6262
"dependencies": {
63-
"@orpc/server-standard": "^0.4.0",
64-
"@orpc/server-standard-fetch": "^0.4.0",
65-
"@orpc/shared": "workspace:*"
63+
"@orpc/shared": "workspace:*",
64+
"@orpc/standard-server": "workspace:*",
65+
"@orpc/standard-server-fetch": "workspace:*"
6666
},
6767
"devDependencies": {
6868
"zod": "^3.24.1"

packages/client/src/adapters/fetch/rpc-link.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ORPCError } from '@orpc/contract'
22
import { os } from '@orpc/server'
3-
import { getEventMeta, isAsyncIteratorObject, withEventMeta } from '@orpc/server-standard'
43
import { RPCHandler } from '@orpc/server/fetch'
4+
import { getEventMeta, isAsyncIteratorObject, withEventMeta } from '@orpc/standard-server'
55
import { beforeEach, describe, expect, it, vi } from 'vitest'
66
import { supportedDataTypes } from '../../../tests/shared'
77
import { RPCLink } from './rpc-link'

packages/client/src/adapters/fetch/rpc-link.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { Value } from '@orpc/shared'
22
import type { ClientContext, ClientLink, ClientOptionsOut } from '../../types'
33
import type { FetchWithContext } from './types'
4-
import { isAsyncIteratorObject, type StandardBody } from '@orpc/server-standard'
5-
import { toFetchBody, toStandardBody } from '@orpc/server-standard-fetch'
64
import { trim, value } from '@orpc/shared'
5+
import { isAsyncIteratorObject, type StandardBody } from '@orpc/standard-server'
6+
import { toFetchBody, toStandardBody } from '@orpc/standard-server-fetch'
77
import { ORPCError } from '../../error'
88
import { createAutoRetryEventIterator, type EventIteratorReconnectOptions } from '../../event-iterator'
99
import { RPCSerializer } from '../../rpc'

packages/client/src/event-iterator.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getEventMeta, withEventMeta } from '@orpc/server-standard'
1+
import { getEventMeta, withEventMeta } from '@orpc/standard-server'
22
import { createAutoRetryEventIterator, mapEventIterator } from './event-iterator'
33
import { onEventIteratorStatusChange } from './event-iterator-state'
44

packages/client/src/event-iterator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { EventIteratorState } from './event-iterator-state'
2-
import { getEventMeta, isEventMetaContainer, withEventMeta } from '@orpc/server-standard'
32
import { retry } from '@orpc/shared'
3+
import { getEventMeta, isEventMetaContainer, withEventMeta } from '@orpc/standard-server'
44
import { registerEventIteratorState, updateEventIteratorStatus } from './event-iterator-state'
55

66
export function mapEventIterator<TYield, TReturn, TNext, TMap = TYield | TReturn>(

packages/client/src/openapi/bracket-notation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ describe('bracketNotation', () => {
181181
})
182182

183183
it.each([
184-
[{ a: 1, b: 2, c: [1, 2, { a: 1, b: 2 }, new Date(), new Blob(), new Set([1, 2]), new Map([[1, 2]])] }],
184+
[{ a: 1, b: 2, c: [1, 2, { a: 1, b: 2 }, new Date(), new Blob([]), new Set([1, 2]), new Map([[1, 2]])] }],
185185
])('.serialize + .deserialize', (value) => {
186186
expect(serializer.deserialize(serializer.serialize(value))).toEqual(value)
187187
})

packages/client/src/openapi/serializer.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ORPCError } from '@orpc/contract'
2-
import { ErrorEvent, getEventMeta, withEventMeta } from '@orpc/server-standard'
2+
import { ErrorEvent, getEventMeta, withEventMeta } from '@orpc/standard-server'
33
import { OpenAPIJsonSerializer } from './json-serializer'
44
import { OpenAPISerializer } from './serializer'
55

@@ -21,7 +21,7 @@ describe('openAPISerializer', () => {
2121
})
2222

2323
it('with blob', () => {
24-
const blob = new Blob()
24+
const blob = new Blob([])
2525
expect(openapiSerializer.serialize(blob)).toBe(blob)
2626
})
2727

@@ -217,7 +217,7 @@ describe('openAPISerializer', () => {
217217
})
218218

219219
it('with blob', () => {
220-
const blob = new Blob()
220+
const blob = new Blob([])
221221
expect(openapiSerializer.deserialize(blob)).toBe(blob)
222222
})
223223

packages/client/src/openapi/serializer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { JsonValue } from '@orpc/server-standard'
2-
import { ErrorEvent, isAsyncIteratorObject } from '@orpc/server-standard'
1+
import type { JsonValue } from '@orpc/standard-server'
2+
import { ErrorEvent, isAsyncIteratorObject } from '@orpc/standard-server'
33
import { ORPCError, toORPCError } from '../error'
44
import { mapEventIterator } from '../event-iterator'
55
import { BracketNotationSerializer } from './bracket-notation'

0 commit comments

Comments
 (0)