Skip to content
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

V2: Merge main #1223

Merged
merged 22 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
dc7d75a
Update npm scripts (#1190)
timostamm Aug 28, 2024
1a3bb2f
Bump tsx from 4.16.5 to 4.19.0 in the build group (#1197)
dependabot[bot] Sep 2, 2024
edf8700
Bump @bufbuild/buf from 1.38.0 to 1.39.0 (#1201)
dependabot[bot] Sep 2, 2024
ab54a6c
Bump jscodeshift from 0.16.1 to 17.0.0 (#1203)
dependabot[bot] Sep 2, 2024
ef6911d
Bump @cloudflare/workers-types from 4.20240725.0 to 4.20240821.1 (#1199)
dependabot[bot] Sep 3, 2024
56f07b6
Replace Makefile with turborepo (#1194)
timostamm Sep 3, 2024
4422dda
Fix flaky decompression error code (#1204)
timostamm Sep 3, 2024
e442279
Bump wrangler from 3.68.0 to 3.73.0 (#1202)
dependabot[bot] Sep 3, 2024
d42cff5
Fix Node.js v16 error responses on HTTP1.1 (#1206)
timostamm Sep 3, 2024
e1e5613
Update Node.js versions (#1207)
timostamm Sep 4, 2024
8eee2fa
Fix gRPC trailers only response (#1209)
srikrsna-buf Sep 4, 2024
3a291fd
Rename argument for the sessionProvider option for the Node HTTP clie…
timostamm Sep 5, 2024
32d7ada
Upgrade conformance tests to v1.0.3 (#1208)
srikrsna-buf Sep 5, 2024
575bd85
Allow cloudflare environment variables in CI (#1214)
timostamm Sep 9, 2024
3a67300
Fix signal in handler always aborted in HTTP/1.1 (#1218)
srikrsna-buf Sep 9, 2024
6d375c1
Fix baseUrl without // mangling request URL on Node.js with HTTP/2 (#…
timostamm Sep 9, 2024
ed63cee
Respect headers from transport option `nodeOptions.headers` (#1219)
timostamm Sep 9, 2024
552d40b
Fix error detail debug property (#1221)
timostamm Sep 10, 2024
837b6ce
Throw an error on missing status in gRPC and gRPC-Web transports (#1205)
srikrsna-buf Sep 11, 2024
6575fc1
Release 1.5.0 (#1222)
timostamm Sep 11, 2024
ee8dcc7
Merge remote-tracking branch 'origin/main' into v2
srikrsna-buf Sep 11, 2024
15296ba
Revert changes to Migrate package.json
srikrsna-buf Sep 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 39 additions & 58 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,72 +12,62 @@
// See the License for the specific language governing permissions and
// limitations under the License.

const { readdirSync, existsSync } = require("fs");
const { join } = require("path");

module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
root: true,
ignorePatterns: [
"packages/connect-web-bench/src/gen/grpcweb/**/*",
"packages/connect/src/protocol-grpc/gen/**/*",
"packages/connect-node-test/connect-node-h1-server.mjs", // https:/eslint/eslint/issues/14156
"packages/example/www/webclient.js",
"packages/*/dist/**",
"node_modules/**",
// Our ESLint setup assumes all `.js` files are ESM, however these particular assets are CommonJS.
// Since for these files we cannot use `.cjs`, instead we override here to avoid having to override in each file
"packages/connect/*.js",
//
"packages/connect-web-bench/src/gen/grpcweb/**/*",
],
plugins: ["@typescript-eslint", "n", "import"],
// Rules and settings that do not require a non-default parser
extends: ["eslint:recommended"],
rules: {
"no-console": "error",
"import/no-cycle": "error",
"import/no-duplicates": "error",
},
settings: {},
overrides: [
...readdirSync("packages", { withFileTypes: true })
.filter((entry) => entry.isDirectory())
.map((entry) => join("packages", entry.name))
.filter((dir) => existsSync(join(dir, "tsconfig.json")))
.map((dir) => {
return {
files: [join(dir, "src/**/*.ts"), join(dir, "conformance/**/*.ts")],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: dir,
},
settings: {
"import/resolver": {
typescript: {
project: "packages/*/tsconfig.json",
},
},
},
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/recommended",
"plugin:import/typescript",
],
rules: {
"@typescript-eslint/strict-boolean-expressions": "error",
"@typescript-eslint/no-unnecessary-condition": "error",
// we use complex typings, where Array is actually more readable than T[]
"@typescript-eslint/array-type": "off",
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/no-unnecessary-boolean-literal-compare":
"error",
"@typescript-eslint/no-invalid-void-type": "error",
"@typescript-eslint/no-base-to-string": "error",
"import/no-cycle": "error",
"import/no-duplicates": "error",
{
files: ["**/*.{ts,tsx,cts,mts}"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: true,
},
settings: {
"import/resolver": {
typescript: {
project: "tsconfig.json",
},
};
}),
},
},
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/recommended",
"plugin:import/typescript",
],
rules: {
"@typescript-eslint/strict-boolean-expressions": "error",
"@typescript-eslint/no-unnecessary-condition": "error",
"@typescript-eslint/array-type": "off", // we use complex typings, where Array is actually more readable than T[]
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
"@typescript-eslint/no-invalid-void-type": "error",
"@typescript-eslint/no-base-to-string": "error",
"import/no-cycle": "error",
"import/no-duplicates": "error",
},
},
// For scripts and configurations, use Node.js rules
{
files: ["**/*.{js,mjs,cjs}"],
Expand All @@ -101,14 +91,5 @@ module.exports = {
"n/no-unsupported-features/es-syntax": "error",
},
},
{
// Our ESLint setup assumes all `.js` files are ESM, however these particular assets are CommonJS.
// Since for these files we cannot use `.cjs`, instead we override here to avoid having to override in each file
files: ["packages/connect/*.js"],
globals: {
module: "readonly",
require: "readonly",
},
},
],
};
23 changes: 16 additions & 7 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,22 @@ git remote add upstream https:/connectrpc/connect-es.git
git fetch upstream
```

Make sure that the tests and the linters pass (you'll need Node.js in the
version specified in .nvmrc, `make`, `bash` and Docker installed):
Install dependencies (you'll need Node.js in the version specified in `.nvmrc`,
and `npm` in the version specified in `package.json`):

```bash
npm ci
```
make

Make sure that the tests, linters, and other checks pass:

```bash
npm run all
```

We're using `turborepo` to run tasks. If you haven't used it yet, take a look at
[filtering and package scoping](https://turbo.build/repo/docs/crafting-your-repository/running-tasks).

## Making Changes

Start by creating a new branch for your changes:
Expand All @@ -53,16 +62,16 @@ git push origin cool_new_feature

Then use the GitHub UI to open a pull request.

At this point, you're waiting on us to review your changes. We *try* to respond
At this point, you're waiting on us to review your changes. We _try_ to respond
to issues and pull requests within a few business days, and we may suggest some
improvements or alternatives. Once your changes are approved, one of the
project maintainers will merge them.

We're much more likely to approve your changes if you:

* Add tests for new functionality.
* Write a [good commit message][commit-message].
* Maintain backward compatibility.
- Add tests for new functionality.
- Write a [good commit message][commit-message].
- Maintain backward compatibility.

[fork]: https:/connectrpc/connect-es/fork
[open-issue]: https:/connectrpc/connect-es/issues/new
Expand Down
14 changes: 6 additions & 8 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,38 @@
---
name: Bug report
about: Let us know about a bug
title: ''
title: ""
labels: bug
assignees: ''

assignees: ""
---

**Describe the bug**

As clearly as you can, please tell us what the bug is.


**To Reproduce**

If you encountered an error message, please copy and paste it verbatim.
If the bug is specific to an RPC or payload, please provide a reduced
example.


**Environment (please complete the following information):**

- @connectrpc/connect-web version: (for example, `0.1.0`)
- @connectrpc/connect-node version: (for example, `0.1.0`)
- Frontend framework and version: (for example, `[email protected]`)
- Node.js version: (for example, `18.0.0`)
- Browser and version: (for example, `Google Chrome 103.0.5060.134`)

If your problem is specific to bundling, please also provide the following information:
If your problem is specific to bundling, please also provide the following information:

- Bundler and version: (for example, `[email protected]`)
- Bundler plugins and version: (for example `[email protected]`)
- Bundler configuration file:
- Bundler configuration file:

```js

```


**Additional context**
Add any other context about the problem here.
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest a new feature or improvement
title: ''
title: ""
labels: enhancement
assignees: ''

assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand Down
26 changes: 13 additions & 13 deletions .github/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
## Prerequisites

- See the setup and tools required in CONTRIBUTING.md
- A granular access token for npmjs.com with read and write permissions, scoped
to the `connectrpc` organization.
- Make sure that the repository is in a good state, without PRs close to merge
- A granular access token for npmjs.com with read and write permissions, scoped
to the `connectrpc` organization.
- Make sure that the repository is in a good state, without PRs close to merge
that would ideally be part of the release.

## Steps

1. Choose a new version (e.g. 1.2.3), making sure to follow semver. Note that all
1. Choose a new version (e.g. 1.2.3), making sure to follow semver. Note that all
packages in this repository use the same version number.
2. Make sure you are on the latest main, and create a new git branch.
3. Set the new version across all packages within the monorepo with the following
command: `make setversion SET_VERSION=1.2.3`
3. Set the new version across all packages within the monorepo with the following
command: `npm run setversion 1.2.3`
4. Commit, push, and open a pull request with the title "Release 1.2.3". The PR title must start with "Release" to trigger the conformance tests in CI. See the conformance tests [README](/packages/connect-conformance/README.md) for more details.
5. Edit the PR description with release notes. See the section below for details.
6. Make sure CI passed on your PR and ask a maintainer for review.
7. After approval, run the following command to publish to npmjs.com: `make release`.
7. After approval, run the following command to publish to npmjs.com: `npm run release`.
8. Merge your PR.
9. Create a new release in the GitHub UI
- Choose "v1.2.3" as a tag and as the release title.
Expand All @@ -27,19 +27,19 @@

## Release notes

- We generate release notes with the GitHub feature, see
- We generate release notes with the GitHub feature, see
https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
- Only changes that impact users should be listed. No need to list things like
- Only changes that impact users should be listed. No need to list things like
doc changes (unless it’s something major), dependency version bumps, or similar.
Remove them from the generated release notes.
- If the release introduces a major new feature or change, add a section at the
- If the release introduces a major new feature or change, add a section at the
top that explains it for users. A good example is https:/connectrpc/connect-es/releases/tag/v0.10.0
It lists a major new feature and a major change with dedicated sections, and
It lists a major new feature and a major change with dedicated sections, and
moves the changelist with PR links to a separate "Enhancement" section below.
- If the release includes a very long list of changes, consider breaking the
- If the release includes a very long list of changes, consider breaking the
changelist up with the sections "Enhancements", "Bugfixes", "Breaking changes".
A good example is https:/connectrpc/connect-es/releases/tag/v0.9.0
- If the release includes changes specific to a npm package, group and explain
- If the release includes changes specific to a npm package, group and explain
the changelist in according separate sections. A good example is https:/connectrpc/connect-es/releases/tag/v0.8.0
Note that we are not using full package names with scope - a more user-friendly
name like "Connect for Node.js" or "Connect for Fastify" is preferable.
42 changes: 25 additions & 17 deletions .github/workflows/browserstack.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
name: browserstack
name: "Browserstack"

on:
push:
branches: [main, v2]
tags: ['v*']
branches: [main, "v*"]
tags: ["v*"]
pull_request:
branches: [main, v2]
branches: [main, "v*"]
workflow_dispatch:

permissions:
contents: read

env:
# https://consoledonottrack.com/
DO_NOT_TRACK: 1

jobs:
browserstack:
name: "Test @connectrpc/connect-web"
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- name: checkout
uses: actions/checkout@v4
- name: cache
uses: actions/cache@v4
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- uses: actions/cache@v4
with:
path: |
~/.tmp
.tmp
key: ${{ runner.os }}-connect-web-browserstack-${{ hashFiles('Makefile') }}
restore-keys: |
${{ runner.os }}-connect-web-browserstack-
- name: browserstack
path: .turbo
key: ${{ runner.os }}/browserstack/${{ github.sha }}
restore-keys: ${{ runner.os }}/browserstack
- name: NPM Install
run: npm ci
- name: Browserstack
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
run: make testwebbrowserstack

run: npx turbo run test-browserstack --output-logs new-only --log-order stream
Loading