-
Notifications
You must be signed in to change notification settings - Fork 20
V2: Introduce connect-query-core package #357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
8fe27b3
Introduce connect-query-core package
paul-sachs cfdf9db
Update core version to sync with other pkgs
paul-sachs 1344085
Add test for using tanstack core skip token
paul-sachs c434d5d
Remove unused dev dependency
paul-sachs 7dbc7d3
Merge branch 'v2' into psachs/connect-query-core
paul-sachs 5a987d2
Fix formatting
paul-sachs 496913c
Update packages/connect-query-core/README.md
paul-sachs ff843cb
Update packages/connect-query-core/package.json
paul-sachs 975a9b6
Exclude generated code from tsc compile and bundle dist only
paul-sachs 3897dc3
Moved test protos to separate package
paul-sachs f198dcb
Merge branch 'v2' into psachs/connect-query-core
paul-sachs 69baadc
Add buf as proper dev dep
paul-sachs 2ea0dac
Fixed publish bug with test-utils
paul-sachs ca07a58
Converted test-utils to publish ts files
paul-sachs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist | ||
coverage | ||
src/gen |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# @connectrpc/connect-query-core | ||
|
||
This package provides the core functionality for the Connect Query API. It exposes all the necessary functions to use with the different variants of the tanstack/query packages. Documentation for these APIs can be found in the main repo readme at https://github.com/connectrpc/connect-query-es and covers any non-hook functions (anything that doesn't start with `use`). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# buf.gen.yaml defines a local generation template. | ||
# For details, see https://buf.build/docs/configuration/v2/buf-gen-yaml | ||
version: v2 | ||
inputs: | ||
- directory: proto | ||
# Deletes the directories specified in the `out` field for all plugins before running code generation. | ||
clean: true | ||
plugins: | ||
- local: protoc-gen-es | ||
out: src/gen | ||
opt: | ||
- target=ts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"name": "@connectrpc/connect-query-core", | ||
paul-sachs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"version": "2.0.0-rc.2", | ||
"description": "Core of connect-query, framework agnostic helpers for typescript safe queries.", | ||
paul-sachs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"license": "Apache-2.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/connectrpc/connect-query-es.git", | ||
"directory": "packages/connect-query-core" | ||
}, | ||
"scripts": { | ||
"clean": "rm -rf ./dist/*", | ||
"build": "npm run build:cjs && npm run build:esm", | ||
"build:cjs": "tsc --project tsconfig.build.json --module commonjs --moduleResolution node10 --verbatimModuleSyntax false --outDir ./dist/cjs --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'", | ||
"build:esm": "tsc --project tsconfig.build.json", | ||
"generate": "buf generate", | ||
"test": "vitest --run", | ||
"test:watch": "vitest --watch", | ||
"format": "prettier . --write --ignore-path ./.eslintignore && eslint . --fix && license-header", | ||
"attw": "attw --pack" | ||
}, | ||
"type": "module", | ||
"sideEffects": false, | ||
"main": "./dist/cjs/index.js", | ||
"exports": { | ||
".": { | ||
"import": "./dist/esm/index.js", | ||
"require": "./dist/cjs/index.js" | ||
} | ||
}, | ||
"devDependencies": { | ||
"@arethetypeswrong/cli": "^0.15.2", | ||
"@bufbuild/buf": "1.43.0", | ||
"@bufbuild/jest-environment-jsdom": "^0.1.1", | ||
"@bufbuild/protobuf": "^2.2.0", | ||
"@bufbuild/protoc-gen-es": "^2.2.0", | ||
"@connectrpc/connect": "^2.0.0-rc.1", | ||
"@connectrpc/connect-web": "^2.0.0-rc.1", | ||
"typescript": "^5.5.4" | ||
}, | ||
"peerDependencies": { | ||
"@bufbuild/protobuf": "2.x", | ||
"@connectrpc/connect": "^2.0.0-rc.1", | ||
"@tanstack/query-core": "5.x" | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2021-2023 The Connect Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
|
||
import "google/protobuf/empty.proto"; | ||
|
||
service BigIntService { | ||
paul-sachs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
rpc Count(CountRequest) returns (CountResponse); | ||
rpc GetCount(google.protobuf.Empty) returns (CountResponse); | ||
} | ||
|
||
message CountRequest { | ||
int64 add = 1; | ||
} | ||
|
||
message CountResponse { | ||
int64 count = 1; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2021-2023 The Connect Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
|
||
package connectrpc.eliza.v1; | ||
|
||
// ElizaService provides a way to talk to Eliza, a port of the DOCTOR script | ||
// for Joseph Weizenbaum's original ELIZA program. Created in the mid-1960s at | ||
// the MIT Artificial Intelligence Laboratory, ELIZA demonstrates the | ||
// superficiality of human-computer communication. DOCTOR simulates a | ||
// psychotherapist, and is commonly found as an Easter egg in emacs | ||
// distributions. | ||
service ElizaService { | ||
// Say is a unary RPC. Eliza responds to the prompt with a single sentence. | ||
rpc Say(SayRequest) returns (SayResponse) {} | ||
} | ||
|
||
// SayRequest is a single-sentence request. | ||
message SayRequest { | ||
string sentence = 1; | ||
} | ||
|
||
// SayResponse is a single-sentence response. | ||
message SayResponse { | ||
string sentence = 1; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2021-2023 The Connect Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
|
||
service ListService { | ||
rpc List(ListRequest) returns (ListResponse); | ||
} | ||
|
||
message ListRequest { | ||
int64 page = 1; | ||
bool preview = 2; | ||
} | ||
|
||
message ListResponse { | ||
int64 page = 1; | ||
repeated string items = 2; | ||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2021-2023 The Connect Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto2"; | ||
package test; | ||
|
||
message Proto2Message { | ||
optional string string_field = 1; | ||
optional int32 int32_field = 3; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright 2021-2023 The Connect Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
package test; | ||
|
||
// Note: We do not exhaust all field types | ||
message Proto3Message { | ||
string string_field = 1; | ||
bytes bytes_field = 2; | ||
int32 int32_field = 3; | ||
int64 int64_field = 4; | ||
double double_field = 5; | ||
bool bool_field = 6; | ||
Proto3Enum enum_field = 7; | ||
Proto3Message message_field = 8; | ||
|
||
optional string optional_string_field = 9; | ||
|
||
repeated string repeated_string_field = 17; | ||
repeated Proto3Message repeated_message_field = 18; | ||
repeated Proto3Enum repeated_enum_field = 19; | ||
|
||
oneof either { | ||
string oneof_string_field = 31; | ||
int32 oneof_int32_field = 33; | ||
} | ||
|
||
map<string, int64> map_string_int64_field = 39; | ||
map<string, Proto3Message> map_string_message_field = 40; | ||
map<string, Proto3Enum> map_string_enum_field = 41; | ||
} | ||
|
||
enum Proto3Enum { | ||
PROTO3_ENUM_UNSPECIFIED = 0; | ||
PROTO3_ENUM_YES = 1; | ||
PROTO3_ENUM_NO = 2; | ||
} |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.