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

Fix examples #979

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
],
"scripts": {
"clean": "git clean -Xdf",
"all": "turbo run build generate test lint attw bundle-size format license-header bootstrap:inject bootstrap:wkt",
"all": "turbo run --ui tui build generate test lint attw bundle-size format license-header bootstrap:inject bootstrap:wkt",
"setversion": "node scripts/set-workspace-version.js",
"postsetversion": "npm run all",
"release": "npm run all && node scripts/release.js",
Expand Down
22 changes: 8 additions & 14 deletions packages/protobuf-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,17 @@ Note that this example can be easily implemented in other languages, because
the serialization format is standardized. That means you could add a user to the
list with Dart, and list people with TypeScript interchangeably.

### Build and run the example
### Run the example

To run the example, you only need npm or Yarn.
[Download the source](https://github.com/bufbuild/protobuf-es/archive/refs/heads/main.zip),
then run the following commands:
You need [Node](https://nodejs.org/en/download/) version 20.17.0 or later installed.
Download the example project and install its dependencies:

From the project root, first install and build all required packages:
```shell
curl -L https://github.com/bufbuild/protobuf-es/archive/refs/heads/main.zip > protobuf-es-main.zip
unzip protobuf-es-main.zip 'protobuf-es-main/packages/protobuf-example/*'

```shellsession
npm ci
npm run generate --filter ./packages/protobuf-example
```

Next, `cd` into the example directory:

```shellsession
cd packages/protobuf-example
cd protobuf-es-main/packages/protobuf-example
npm install
```

To add a user:
Expand Down
5 changes: 3 additions & 2 deletions packages/protobuf-example/package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
{
"name": "@bufbuild/protobuf-example",
"version": "2.1.0",
"private": true,
"license": "(Apache-2.0 AND BSD-3-Clause)",
"scripts": {
"build": "../../node_modules/typescript/bin/tsc --noEmit",
"add": "tsx src/add.ts",
"list": "tsx src/list.ts",
"generate": "buf generate",
"postgenerate": "license-header src/gen",
"format": "prettier --write --ignore-unknown '.' '!.turbo' '!src/gen/**'",
"license-header": "license-header",
"lint": "eslint --max-warnings 0 ."
},
"license": "Apache-2.0",
"type": "module",
"dependencies": {
"@bufbuild/buf": "^1.36.0",
"@bufbuild/protobuf": "2.1.0",
"@bufbuild/protoc-gen-es": "2.1.0",
"tsx": "^4.16.1",
"typescript": "^5.5.4"
}
}
2 changes: 1 addition & 1 deletion packages/protoplugin-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ clients from service definitions in Protobuf files.

## Run the example

You need [Node](https://nodejs.org/en/download/) version 18.17.0 or later installed.
You need [Node](https://nodejs.org/en/download/) version 20.17.0 or later installed.
Download the example project and install its dependencies:

```shell
Expand Down
1 change: 0 additions & 1 deletion packages/protoplugin-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"start": "npx esbuild src/index.ts --serve=localhost:3000 --servedir=www --outdir=www --bundle --global-name=eliza",
"test": "tsx --test test/*.ts",
"generate": "buf generate",
"postgenerate": "license-header src/gen",
"format": "prettier --write --ignore-unknown '.' '!.turbo' '!src/gen/**'",
"license-header": "license-header",
"lint": "eslint --max-warnings 0 ."
Expand Down