Skip to content

Commit

Permalink
Fix playwright exports and update to current Connect deps (#101)
Browse files Browse the repository at this point in the history
This performs a few maintenance tasks:

* Updates to latest Protobuf-ES and Connect-ES versions
* Removes the ESM proxy setup as this was causing issues with running
Playwright tests in Node v20. Falling back to a simpler export map for
CJS and ESM.
* Add a Node matrix to run the tests in CI for Node versions 18 and 20.
  • Loading branch information
smaye81 authored Jan 24, 2024
1 parent 963f530 commit 470d1c1
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 144 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ on:
jobs:
ci:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [18, 20]
steps:
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: checkout
uses: actions/checkout@v4

Expand Down
57 changes: 31 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"devDependencies": {
"@bufbuild/license-header": "^0.0.4",
"@bufbuild/protobuf": "^1.6.0",
"@bufbuild/protobuf": "^1.7.0",
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/parser": "^6.17.0",
"eslint": "^8.56.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/connect-playwright-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"license": "ISC",
"devDependencies": {
"@bufbuild/buf": "^1.28.1",
"@bufbuild/protobuf": "^1.6.0",
"@bufbuild/protoc-gen-es": "^1.6.0",
"@connectrpc/connect": "^1.2.0",
"@connectrpc/connect-web": "^1.2.0",
"@connectrpc/protoc-gen-connect-es": "^1.2.0",
"@bufbuild/protobuf": "^1.7.0",
"@bufbuild/protoc-gen-es": "^1.7.0",
"@connectrpc/connect": "^1.3.0",
"@connectrpc/connect-web": "^1.3.0",
"@connectrpc/protoc-gen-connect-es": "^1.3.0",
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
"esbuild": "^0.19.11",
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.

// @generated by protoc-gen-connect-es v1.2.0 with parameter "target=ts"
// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=ts"
// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3)
/* eslint-disable */
// @ts-nocheck
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.

// @generated by protoc-gen-es v1.6.0 with parameter "target=ts"
// @generated by protoc-gen-es v1.7.0 with parameter "target=ts"
// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3)
/* eslint-disable */
// @ts-nocheck
Expand Down
9 changes: 2 additions & 7 deletions packages/connect-playwright/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@
"scripts": {
"clean": "rm -rf ./dist/*",
"test": "playwright install chromium && jasmine --config=jasmine.json",
"build": "npm run build:cjs && npm run build:esm && npm run build:proxy",
"build": "npm run build:cjs && npm run build:esm",
"build:cjs": "tsc --project tsconfig.json --module commonjs --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.json --module ES2015 --verbatimModuleSyntax --outDir ./dist/esm --declaration --declarationDir ./dist/esm && echo >./dist/esm/package.json '{\"type\":\"module\", \"sideEffects\":false}'",
"build:proxy": "node ../../scripts/gen-esm-proxy.mjs .",
"format": "prettier --write --ignore-unknown '.' '!dist'",
"lint": "eslint --max-warnings 0 .",
"attw": "attw --pack",
Expand All @@ -25,17 +24,13 @@
"main": "./dist/cjs/index.js",
"exports": {
".": {
"node": {
"import": "./dist/proxy/index.js",
"require": "./dist/cjs/index.js"
},
"module": "./dist/esm/index.js",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
}
},
"peerDependencies": {
"@connectrpc/connect": "^1.1.2",
"@connectrpc/connect": "^1.3.0",
"@playwright/test": "^1.0.0"
},
"devDependencies": {
Expand Down
103 changes: 0 additions & 103 deletions scripts/gen-esm-proxy.mjs

This file was deleted.

0 comments on commit 470d1c1

Please sign in to comment.