Skip to content

Commit

Permalink
reorganize code (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangcheng authored Dec 3, 2024
1 parent 11695f9 commit 9d37022
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ import {
validateResponse,
} from '@connectrpc/connect/protocol-connect';

import { warnUnsupportedOptions } from './compatbility';
import { normalize, normalizeIterable } from './protocol/normalize';
import type { CreateTransportOptions } from './types';
import { normalize, normalizeIterable } from '../connect/protocol/normalize';
import type { CreateTransportOptions } from '../types';
import { warnUnsupportedOptions } from './utils/compatibility';
import {
createWxRequestAsAsyncGenerator,
createWxRequestAsPromise,
} from './wx-request';
} from './utils/wx-request';

export function createConnectTransport(
options: CreateTransportOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ import {
validateTrailer,
} from '@connectrpc/connect/protocol-grpc-web';

import { warnUnsupportedOptions } from './compatbility';
import { normalize, normalizeIterable } from './protocol/normalize';
import type { CreateTransportOptions } from './types';
import { createWxRequestAsAsyncGenerator } from './wx-request';
import { normalize, normalizeIterable } from '../connect/protocol/normalize';
import type { CreateTransportOptions } from '../types';
import { warnUnsupportedOptions } from './utils/compatibility';
import { createWxRequestAsAsyncGenerator } from './utils/wx-request';

export function createGrpcWebTransport(
options: CreateTransportOptions,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { headersToObject } from 'headers-polyfill';

import { createEnvelopeAsyncGenerator } from '../../connect/protocol/envelope';
import type {
AdditionalRequestOptions,
CreateTransportOptions,
} from '../../types';
import { createAsyncGeneratorFromEventPattern } from './async-generator';
import { createEnvelopeAsyncGenerator } from './envelope';
import type { AdditionalRequestOptions, CreateTransportOptions } from './types';

export type PartialOptions = Pick<
WechatMiniprogram.RequestOption,
Expand Down
9 changes: 3 additions & 6 deletions packages/connect-miniprogram/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
export { createConnectTransport } from './connect/connect-transport-wx';
export { createGrpcWebTransport } from './connect/grpc-web-transport-wx';
export type {
AdditionalRequestOptions,
CreateTransportOptions,
} from './connect/types';
export { createConnectTransport } from './connect-wx/connect-transport-wx';
export { createGrpcWebTransport } from './connect-wx/grpc-web-transport-wx';
export type { AdditionalRequestOptions, CreateTransportOptions } from './types';
File renamed without changes.

0 comments on commit 9d37022

Please sign in to comment.