ソースを参照

fix(hermes-client): fix instructions to run example

Connor Prussin 1 年間 前
コミット
f78f3b80cd

+ 7 - 4
apps/hermes/client/js/README.md

@@ -69,12 +69,15 @@ By default, these updates are returned as binary data and is serialized as eithe
 
 ### Examples
 
-The [HermesClient](./src/examples/HermesClient.ts) example demonstrates both the examples above.
-You can run it with `npm run example`.
-A full command that prints BTC and ETH price feeds, in the testnet network, looks like so:
+The [HermesClient](./src/examples/HermesClient.ts) example demonstrates both the
+examples above. To run the example:
+
+1. Clone [the Pyth monorepo](https://github.com/pyth-network/pyth-crosschain)
+2. In the root of the monorepo, run `pnpm example:hermes-client -- <args>`. For
+   example, to print BTC and ETH price feeds in the testnet network, run:
 
 ```bash
-npm run example -- \
+pnpm example:hermes-client -- \
   --endpoint https://hermes.pyth.network \
   --price-ids \
     0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43 \

+ 1 - 1
apps/hermes/client/js/package.json

@@ -23,7 +23,7 @@
     "build:typescript": "tsc",
     "build:schemas": "openapi-zod-client ./schema.json --output src/zodSchemas.ts",
     "pull:schema": "curl -o schema.json -z schema.json https://hermes.pyth.network/docs/openapi.json",
-    "example": "pnpm run build && node lib/examples/HermesClient.js",
+    "example": "node lib/examples/HermesClient.js",
     "format": "prettier --write \"src/**/*.ts\"",
     "test:lint": "eslint src/",
     "prepublishOnly": "pnpm run build && pnpm run test:lint",

+ 4 - 0
apps/hermes/client/js/turbo.json

@@ -14,6 +14,10 @@
     "build": {
       "dependsOn": ["build:typescript", "build:schemas"]
     },
+    "example": {
+      "dependsOn": ["build"],
+      "cache": false
+    },
     "pull:schema": {
       "outputs": ["schema.json"],
       "cache": false

+ 1 - 0
package.json

@@ -7,6 +7,7 @@
     "pnpm": "^9.12.1"
   },
   "scripts": {
+    "example:hermes-client": "pnpm i && turbo example --filter @pythnetwork/hermes-client --ui stream",
     "fix": "pnpm i && turbo fix",
     "start:dev": "pnpm i && turbo start:dev",
     "start:prod": "pnpm i && turbo start:prod",