Skip to content

Commit

Permalink
refactor: modify dependencies in project
Browse files Browse the repository at this point in the history
  • Loading branch information
jianyi-gronk committed Jul 2, 2023
1 parent 78dc17d commit 0706ee8
Show file tree
Hide file tree
Showing 83 changed files with 357 additions and 357 deletions.
10 changes: 5 additions & 5 deletions packages/connect-express/src/express-connect-middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
// limitations under the License.

import type { JsonValue } from "@bufbuild/protobuf";
import { createConnectRouter, Code, ConnectError } from "@bufbuild/connect";
import type { ConnectRouter, ConnectRouterOptions } from "@bufbuild/connect";
import type { UniversalHandler } from "@bufbuild/connect/protocol";
import { createConnectRouter, Code, ConnectError } from "@apache/dubbo";
import type { ConnectRouter, ConnectRouterOptions } from "@apache/dubbo";
import type { UniversalHandler } from "@apache/dubbo/protocol";
import {
compressionBrotli,
compressionGzip,
universalRequestFromNodeRequest,
universalResponseToNodeResponse,
} from "@bufbuild/connect-node";
} from "@apache/dubbo-node";
import type * as express from "express";

interface ExpressConnectMiddlewareOptions extends ConnectRouterOptions {
Expand All @@ -31,7 +31,7 @@ interface ExpressConnectMiddlewareOptions extends ConnectRouterOptions {
* Create a file `connect.ts` with a default export such as this:
*
* ```ts
* import {ConnectRouter} from "@bufbuild/connect";
* import {ConnectRouter} from "@apache/dubbo";
*
* export default (router: ConnectRouter) => {
* router.service(ElizaService, {});
Expand Down
14 changes: 7 additions & 7 deletions packages/connect-fastify/src/fastify-connect-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
// limitations under the License.

import type { JsonValue } from "@bufbuild/protobuf";
import { Code, ConnectError, createConnectRouter } from "@bufbuild/connect";
import type { ConnectRouter, ConnectRouterOptions } from "@bufbuild/connect";
import * as protoConnect from "@bufbuild/connect/protocol-connect";
import * as protoGrpcWeb from "@bufbuild/connect/protocol-grpc-web";
import * as protoGrpc from "@bufbuild/connect/protocol-grpc";
import { Code, ConnectError, createConnectRouter } from "@apache/dubbo";
import type { ConnectRouter, ConnectRouterOptions } from "@apache/dubbo";
import * as protoConnect from "@apache/dubbo/protocol-connect";
import * as protoGrpcWeb from "@apache/dubbo/protocol-grpc-web";
import * as protoGrpc from "@apache/dubbo/protocol-grpc";
import {
compressionBrotli,
compressionGzip,
universalRequestFromNodeRequest,
universalResponseToNodeResponse,
} from "@bufbuild/connect-node";
} from "@apache/dubbo-node";
import type { FastifyInstance } from "fastify/types/instance";

interface FastifyConnectPluginOptions extends ConnectRouterOptions {
Expand All @@ -33,7 +33,7 @@ interface FastifyConnectPluginOptions extends ConnectRouterOptions {
* Create a file `connect.ts` with a default export such as this:
*
* ```ts
* import {ConnectRouter} from "@bufbuild/connect";
* import {ConnectRouter} from "@apache/dubbo";
*
* export default (router: ConnectRouter) => {
* router.service(ElizaService, {});
Expand Down
10 changes: 5 additions & 5 deletions packages/connect-next/src/connect-nextjs-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { createConnectRouter } from "@bufbuild/connect";
import type { ConnectRouter, ConnectRouterOptions } from "@bufbuild/connect";
import type { UniversalHandler } from "@bufbuild/connect/protocol";
import { createConnectRouter } from "@apache/dubbo";
import type { ConnectRouter, ConnectRouterOptions } from "@apache/dubbo";
import type { UniversalHandler } from "@apache/dubbo/protocol";
import {
compressionBrotli,
compressionGzip,
universalRequestFromNodeRequest,
universalResponseToNodeResponse,
} from "@bufbuild/connect-node";
} from "@apache/dubbo-node";
import type { NextApiRequest, NextApiResponse, PageConfig } from "next";
import type { JsonValue } from "@bufbuild/protobuf";

Expand All @@ -37,7 +37,7 @@ interface NextJsApiRouterOptions extends ConnectRouterOptions {
* Create a file `connect.ts` with a default export such as this:
*
* ```ts
* import {ConnectRouter} from "@bufbuild/connect";
* import {ConnectRouter} from "@apache/dubbo";
*
* export default (router: ConnectRouter) => {
* router.service(ElizaService, {});
Expand Down
2 changes: 1 addition & 1 deletion packages/connect-node-test/connect-node-h1-server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ switch (command) {
break;

case "startinternal":
const server = createTestServers().servers["@bufbuild/connect-node (h1)"];
const server = createTestServers().servers["@apache/dubbo-node (h1)"];
await server.start(PORT);
writeFileSync(lockFile, "server listening at " + server.getUrl(), {
encoding: "utf-8",
Expand Down
12 changes: 6 additions & 6 deletions packages/connect-node-test/src/badweather/broken-input.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@

import { TestService } from "../gen/grpc/testing/test_connect.js";
import { createTestServers } from "../helpers/testserver.js";
import { Code, ConnectError } from "@bufbuild/connect";
import { createMethodUrl } from "@bufbuild/connect/protocol";
import { Code, ConnectError } from "@apache/dubbo";
import { createMethodUrl } from "@apache/dubbo/protocol";
import {
endStreamFromJson,
codeFromHttpStatus,
errorFromJsonBytes,
} from "@bufbuild/connect/protocol-connect";
} from "@apache/dubbo/protocol-connect";
import { http2Request } from "../helpers/http2-request.js";

describe("broken input", () => {
const servers = createTestServers();
beforeAll(async () => await servers.start());

servers.describeServers(
["connect-go (h2)", "@bufbuild/connect-node (h2c)"],
["connect-go (h2)", "@apache/dubbo-node (h2c)"],
(server, serverName) => {
const rejectUnauthorized = serverName !== "connect-go (h2)"; // TODO set up cert for go server correctly

Expand Down Expand Up @@ -64,7 +64,7 @@ describe("broken input", () => {
);
expect(status).toBe(400);
expect(error.code).toBe(Code.InvalidArgument);
if (serverName == "@bufbuild/connect-node (h2c)") {
if (serverName == "@apache/dubbo-node (h2c)") {
expect(error.rawMessage).toMatch(
/^cannot decode grpc.testing.SimpleRequest from JSON: Unexpected token '?h'?.*JSON/
);
Expand Down Expand Up @@ -104,7 +104,7 @@ describe("broken input", () => {
const { status, endStream } = await streamingRequest(body);
expect(status).toBe(200);
expect(endStream.error?.code).toBe(Code.InvalidArgument);
if (serverName == "@bufbuild/connect-node (h2c)") {
if (serverName == "@apache/dubbo-node (h2c)") {
// Error messages tend to change across Node versions. Should this happen again, this link is useful to
// build the correct RegExp: https://regex101.com/r/By9VEN/1
expect(endStream.error?.rawMessage).toMatch(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@

import { TestService } from "../gen/grpc/testing/test_connect.js";
import { createTestServers } from "../helpers/testserver.js";
import { Code, ConnectError } from "@bufbuild/connect";
import { createMethodUrl } from "@bufbuild/connect/protocol";
import { Code, ConnectError } from "@apache/dubbo";
import { createMethodUrl } from "@apache/dubbo/protocol";
import {
codeFromHttpStatus,
endStreamFromJson,
errorFromJsonBytes,
} from "@bufbuild/connect/protocol-connect";
} from "@apache/dubbo/protocol-connect";
import { http2Request } from "../helpers/http2-request.js";

describe("unsupported content encoding", () => {
const servers = createTestServers();
beforeAll(async () => await servers.start());

servers.describeServers(
["@bufbuild/connect-node (h2c)", "connect-go (h2)"],
["@apache/dubbo-node (h2c)", "connect-go (h2)"],
(server, serverName) => {
const rejectUnauthorized = serverName !== "connect-go (h2)"; // TODO set up cert for go server correctly

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

import { TestService } from "../gen/grpc/testing/test_connect.js";
import { createTestServers } from "../helpers/testserver.js";
import { createMethodUrl } from "@bufbuild/connect/protocol";
import { createMethodUrl } from "@apache/dubbo/protocol";
import { http2Request } from "../helpers/http2-request.js";

describe("unsupported media type", () => {
const servers = createTestServers();
beforeAll(async () => await servers.start());

servers.describeServers(
["@bufbuild/connect-node (h2c)", "connect-go (h2)"],
["@apache/dubbo-node (h2c)", "connect-go (h2)"],
(server, serverName) => {
const rejectUnauthorized = serverName !== "connect-go (h2)"; // TODO set up cert for go server correctly

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

import { TestService } from "../gen/grpc/testing/test_connect.js";
import { createTestServers } from "../helpers/testserver.js";
import { createMethodUrl } from "@bufbuild/connect/protocol";
import { createMethodUrl } from "@apache/dubbo/protocol";
import { http2Request } from "../helpers/http2-request.js";

describe("unsupported method", () => {
const servers = createTestServers();
beforeAll(async () => await servers.start());

servers.describeServers(
["@bufbuild/connect-node (h2c)", "connect-go (h2)"],
["@apache/dubbo-node (h2c)", "connect-go (h2)"],
(server, serverName) => {
const rejectUnauthorized = serverName !== "connect-go (h2)"; // TODO set up cert for go server correctly

Expand Down
4 changes: 2 additions & 2 deletions packages/connect-node-test/src/compression.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { ConnectError } from "@bufbuild/connect";
import { compressionBrotli, compressionGzip } from "@bufbuild/connect-node";
import { ConnectError } from "@apache/dubbo";
import { compressionBrotli, compressionGzip } from "@apache/dubbo-node";
import * as zlib from "zlib";

describe("compression", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { createCallbackClient, createPromiseClient } from "@bufbuild/connect";
import { createCallbackClient, createPromiseClient } from "@apache/dubbo";
import { TestService } from "../gen/grpc/testing/test_connect.js";
import { SimpleRequest } from "../gen/grpc/testing/messages_pb.js";
import { createTestServers } from "../helpers/testserver.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { Code, ConnectError, createPromiseClient } from "@bufbuild/connect";
import { Code, ConnectError, createPromiseClient } from "@apache/dubbo";
import { TestService } from "../gen/grpc/testing/test_connect.js";
import { PayloadType } from "../gen/grpc/testing/messages_pb.js";
import { createTestServers } from "../helpers/testserver.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { Code, ConnectError, createPromiseClient } from "@bufbuild/connect";
import { Code, ConnectError, createPromiseClient } from "@apache/dubbo";
import { TestService } from "../gen/grpc/testing/test_connect.js";
import {
PayloadType,
Expand All @@ -36,41 +36,41 @@ describe("cancel_after_first_response", function () {
servers.describeTransportsExcluding(
[
// All following Transports run over HTTP/1, which cannot support full-duplex.
"@bufbuild/connect-node (Connect, JSON, http) against @bufbuild/connect-node (h1)",
"@bufbuild/connect-node (Connect, binary, http) against @bufbuild/connect-node (h1)",
"@bufbuild/connect-node (Connect, binary, https) against @bufbuild/connect-node (h1 + tls)",
"@bufbuild/connect-node (Connect, JSON, https) against @bufbuild/connect-node (h1 + tls)",
"@bufbuild/connect-node (Connect, binary, http) against connect-go (h1)",
"@bufbuild/connect-node (Connect, binary, http, gzip) against connect-go (h1)",
"@bufbuild/connect-node (Connect, JSON, http) against connect-go (h1)",
"@bufbuild/connect-node (Connect, JSON, http, gzip) against connect-go (h1)",
"@bufbuild/connect-node (Connect, JSON, http, gzip) against @bufbuild/connect-node (h1)",
"@bufbuild/connect-node (Connect, binary, http, gzip) against @bufbuild/connect-node (h1)",
"@bufbuild/connect-node (Connect, JSON, http, gzip) against @bufbuild/connect-express (h1)",
"@bufbuild/connect-node (Connect, binary, http, gzip) against @bufbuild/connect-express (h1)",
"@bufbuild/connect-node (gRPC, binary, http) against @bufbuild/connect-node (h1)",
"@bufbuild/connect-node (gRPC, JSON, http) against @bufbuild/connect-node (h1)",
"@bufbuild/connect-node (gRPC, JSON, https) against @bufbuild/connect-node (h1 + tls)",
"@bufbuild/connect-node (gRPC, binary, https) against @bufbuild/connect-node (h1 + tls)",
"@bufbuild/connect-node (gRPC, binary, https) against connect-go (h1)",
"@bufbuild/connect-node (gRPC, JSON, https) against connect-go (h1)",
"@bufbuild/connect-node (gRPC, JSON, http, gzip) against @bufbuild/connect-node (h1)",
"@bufbuild/connect-node (gRPC, binary, http, gzip) against @bufbuild/connect-node (h1)",
"@bufbuild/connect-node (gRPC, binary, http, gzip) against connect-go (h1)",
"@bufbuild/connect-node (gRPC, JSON, http, gzip) against connect-go (h1)",
"@bufbuild/connect-node (gRPC, JSON, http, gzip) against @bufbuild/connect-express (h1)",
"@bufbuild/connect-node (gRPC, binary, http, gzip) against @bufbuild/connect-express (h1)",
"@bufbuild/connect-node (gRPC-web, binary, http) against @bufbuild/connect-node (h1)",
"@bufbuild/connect-node (gRPC-web, JSON, http) against @bufbuild/connect-node (h1)",
"@bufbuild/connect-node (gRPC-web, JSON, https) against @bufbuild/connect-node (h1 + tls)",
"@bufbuild/connect-node (gRPC-web, binary, https) against @bufbuild/connect-node (h1 + tls)",
"@bufbuild/connect-node (gRPC-web, binary, https) against connect-go (h1)",
"@bufbuild/connect-node (gRPC-web, JSON, https) against connect-go (h1)",
"@bufbuild/connect-node (gRPC-web, JSON, http, gzip) against connect-go (h1)",
"@bufbuild/connect-node (gRPC-web, JSON, http, gzip) against @bufbuild/connect-node (h1)",
"@bufbuild/connect-node (gRPC-web, binary, http, gzip) against @bufbuild/connect-node (h1)",
"@bufbuild/connect-node (gRPC-web, JSON, http, gzip) against @bufbuild/connect-express (h1)",
"@bufbuild/connect-node (gRPC-web, binary, http, gzip) against @bufbuild/connect-express (h1)",
"@apache/dubbo-node (Connect, JSON, http) against @apache/dubbo-node (h1)",
"@apache/dubbo-node (Connect, binary, http) against @apache/dubbo-node (h1)",
"@apache/dubbo-node (Connect, binary, https) against @apache/dubbo-node (h1 + tls)",
"@apache/dubbo-node (Connect, JSON, https) against @apache/dubbo-node (h1 + tls)",
"@apache/dubbo-node (Connect, binary, http) against connect-go (h1)",
"@apache/dubbo-node (Connect, binary, http, gzip) against connect-go (h1)",
"@apache/dubbo-node (Connect, JSON, http) against connect-go (h1)",
"@apache/dubbo-node (Connect, JSON, http, gzip) against connect-go (h1)",
"@apache/dubbo-node (Connect, JSON, http, gzip) against @apache/dubbo-node (h1)",
"@apache/dubbo-node (Connect, binary, http, gzip) against @apache/dubbo-node (h1)",
"@apache/dubbo-node (Connect, JSON, http, gzip) against @apache/dubbo-express (h1)",
"@apache/dubbo-node (Connect, binary, http, gzip) against @apache/dubbo-express (h1)",
"@apache/dubbo-node (gRPC, binary, http) against @apache/dubbo-node (h1)",
"@apache/dubbo-node (gRPC, JSON, http) against @apache/dubbo-node (h1)",
"@apache/dubbo-node (gRPC, JSON, https) against @apache/dubbo-node (h1 + tls)",
"@apache/dubbo-node (gRPC, binary, https) against @apache/dubbo-node (h1 + tls)",
"@apache/dubbo-node (gRPC, binary, https) against connect-go (h1)",
"@apache/dubbo-node (gRPC, JSON, https) against connect-go (h1)",
"@apache/dubbo-node (gRPC, JSON, http, gzip) against @apache/dubbo-node (h1)",
"@apache/dubbo-node (gRPC, binary, http, gzip) against @apache/dubbo-node (h1)",
"@apache/dubbo-node (gRPC, binary, http, gzip) against connect-go (h1)",
"@apache/dubbo-node (gRPC, JSON, http, gzip) against connect-go (h1)",
"@apache/dubbo-node (gRPC, JSON, http, gzip) against @apache/dubbo-express (h1)",
"@apache/dubbo-node (gRPC, binary, http, gzip) against @apache/dubbo-express (h1)",
"@apache/dubbo-node (gRPC-web, binary, http) against @apache/dubbo-node (h1)",
"@apache/dubbo-node (gRPC-web, JSON, http) against @apache/dubbo-node (h1)",
"@apache/dubbo-node (gRPC-web, JSON, https) against @apache/dubbo-node (h1 + tls)",
"@apache/dubbo-node (gRPC-web, binary, https) against @apache/dubbo-node (h1 + tls)",
"@apache/dubbo-node (gRPC-web, binary, https) against connect-go (h1)",
"@apache/dubbo-node (gRPC-web, JSON, https) against connect-go (h1)",
"@apache/dubbo-node (gRPC-web, JSON, http, gzip) against connect-go (h1)",
"@apache/dubbo-node (gRPC-web, JSON, http, gzip) against @apache/dubbo-node (h1)",
"@apache/dubbo-node (gRPC-web, binary, http, gzip) against @apache/dubbo-node (h1)",
"@apache/dubbo-node (gRPC-web, JSON, http, gzip) against @apache/dubbo-express (h1)",
"@apache/dubbo-node (gRPC-web, binary, http, gzip) against @apache/dubbo-express (h1)",
],
(transport) => {
const servers = createTestServers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { createPromiseClient } from "@bufbuild/connect";
import { createPromiseClient } from "@apache/dubbo";
import { TestService } from "../gen/grpc/testing/test_connect.js";
import { PayloadType } from "../gen/grpc/testing/messages_pb.js";
import { createTestServers } from "../helpers/testserver.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
createPromiseClient,
decodeBinaryHeader,
encodeBinaryHeader,
} from "@bufbuild/connect";
} from "@apache/dubbo";
import { TestService } from "../gen/grpc/testing/test_connect.js";
import {
SimpleRequest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
createPromiseClient,
decodeBinaryHeader,
encodeBinaryHeader,
} from "@bufbuild/connect";
} from "@apache/dubbo";
import { TestService } from "../gen/grpc/testing/test_connect.js";
import {
StreamingOutputCallRequest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { createCallbackClient, createPromiseClient } from "@bufbuild/connect";
import { createCallbackClient, createPromiseClient } from "@apache/dubbo";
import { TestService } from "../gen/grpc/testing/test_connect.js";
import { StreamingOutputCallRequest } from "../gen/grpc/testing/messages_pb.js";
import { createTestServers } from "../helpers/testserver.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { createCallbackClient, createPromiseClient } from "@bufbuild/connect";
import { createCallbackClient, createPromiseClient } from "@apache/dubbo";
import { TestService } from "../gen/grpc/testing/test_connect.js";
import { Empty } from "../gen/grpc/testing/empty_pb.js";
import { createTestServers } from "../helpers/testserver.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { createCallbackClient, createPromiseClient } from "@bufbuild/connect";
import { createCallbackClient, createPromiseClient } from "@apache/dubbo";
import { TestService } from "../gen/grpc/testing/test_connect.js";
import { Empty } from "../gen/grpc/testing/empty_pb.js";
import { createTestServers } from "../helpers/testserver.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
ConnectError,
createCallbackClient,
createPromiseClient,
} from "@bufbuild/connect";
} from "@apache/dubbo";
import { TestService } from "../gen/grpc/testing/test_connect.js";
import {
ErrorDetail,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
ConnectError,
createCallbackClient,
createPromiseClient,
} from "@bufbuild/connect";
} from "@apache/dubbo";
import { TestService } from "../gen/grpc/testing/test_connect.js";
import {
ErrorDetail,
Expand Down
Loading

0 comments on commit 0706ee8

Please sign in to comment.