Преглед изворни кода

Merge pull request #2065 from cprussin/set-up-turborepo

feat: set up turborepo
Connor Prussin пре 1 година
родитељ
комит
cd2ad61a1c
58 измењених фајлова са 601 додато и 712 уклоњено
  1. 0 24
      .github/workflows/ci-hermes-client-api-types.yml
  2. 2 10
      .github/workflows/ci-turbo.yml
  3. 1 1
      .github/workflows/publish-js.yml
  4. 1 0
      .gitignore
  5. 1 0
      .prettierignore
  6. 1 1
      Dockerfile.node
  7. 35 15
      README.md
  8. 4 7
      apps/api-reference/package.json
  9. 24 0
      apps/api-reference/turbo.json
  10. 2 0
      apps/hermes/client/js/.gitignore
  11. 6 8
      apps/hermes/client/js/package.json
  12. 0 240
      apps/hermes/client/js/src/zodSchemas.ts
  13. 22 0
      apps/hermes/client/js/turbo.json
  14. 20 22
      apps/hermes/server/shell.nix
  15. 1 1
      apps/price_pusher/README.md
  16. 3 4
      apps/price_pusher/package.json
  17. 3 5
      apps/staking/package.json
  18. 28 0
      apps/staking/turbo.json
  19. 0 3
      apps/staking/vercel.json
  20. 1 2
      contract_manager/package.json
  21. 1 4
      contract_manager/src/chains.ts
  22. 1 1
      express_relay/examples/easy_lend/package.json
  23. 3 4
      express_relay/sdk/js/package.json
  24. 2 2
      express_relay/sdk/solidity/package.json
  25. 12 0
      express_relay/sdk/solidity/turbo.json
  26. 3 3
      flake.lock
  27. 19 20
      flake.nix
  28. 2 5
      governance/pyth_staking_sdk/package.json
  29. 1 1
      governance/xc_admin/packages/xc_admin_cli/README.md
  30. 1 1
      governance/xc_admin/packages/xc_admin_common/package.json
  31. 1 1
      governance/xc_admin/packages/xc_admin_frontend/Dockerfile
  32. 2 5
      governance/xc_admin/packages/xc_admin_frontend/README.md
  33. 6 4
      governance/xc_admin/packages/xc_admin_frontend/package.json
  34. 28 0
      governance/xc_admin/packages/xc_admin_frontend/turbo.json
  35. 0 1
      lerna.json
  36. 12 3
      package.json
  37. 0 2
      packages/component-library/package.json
  38. 0 2
      packages/fonts/package.json
  39. 228 262
      pnpm-lock.yaml
  40. 3 4
      price_service/client/js/package.json
  41. 4 4
      price_service/sdk/js/package.json
  42. 3 4
      target_chains/aptos/sdk/js/package.json
  43. 1 1
      target_chains/ethereum/contracts/README.md
  44. 1 1
      target_chains/ethereum/contracts/deploy.sh
  45. 2 2
      target_chains/ethereum/entropy_sdk/solidity/package.json
  46. 12 0
      target_chains/ethereum/entropy_sdk/solidity/turbo.json
  47. 3 4
      target_chains/ethereum/sdk/js/package.json
  48. 3 3
      target_chains/ethereum/sdk/solidity/package.json
  49. 18 0
      target_chains/ethereum/sdk/solidity/turbo.json
  50. 3 3
      target_chains/fuel/sdk/js/package.json
  51. 1 1
      target_chains/solana/sdk/js/pyth_solana_receiver/README.md
  52. 3 4
      target_chains/solana/sdk/js/pyth_solana_receiver/package.json
  53. 4 4
      target_chains/solana/sdk/js/solana_utils/package.json
  54. 3 4
      target_chains/starknet/sdk/js/package.json
  55. 3 4
      target_chains/sui/sdk/js/package.json
  56. 1 1
      target_chains/ton/contracts/package.json
  57. 3 4
      target_chains/ton/sdk/js/package.json
  58. 53 0
      turbo.json

+ 0 - 24
.github/workflows/ci-hermes-client-api-types.yml

@@ -1,24 +0,0 @@
-name: Check Hermes Client API Types
-
-on:
-  pull_request:
-    paths: [apps/hermes/client/**]
-  push:
-    branches: [main]
-    paths: [apps/hermes/client/**]
-jobs:
-  test:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v4
-      - uses: actions/setup-node@v4
-        with:
-          node-version-file: "package.json"
-      - uses: pnpm/action-setup@v4
-        name: Install pnpm
-        with:
-          run_install: true
-      - name: Generate API Types
-        run: pnpm exec lerna run generate-hermes-api-types
-      - name: Check API Types
-        run: pnpm exec lerna run check-hermes-api-types

+ 2 - 10
.github/workflows/ci-typescript.yml → .github/workflows/ci-turbo.yml

@@ -1,4 +1,4 @@
-name: JS/TS checks
+name: Turbo test
 on:
   pull_request:
     paths:
@@ -31,13 +31,5 @@ jobs:
         name: Install pnpm
         with:
           run_install: true
-      - name: Build
-        run: pnpm exec lerna run build
       - name: Test
-        run: pnpm exec lerna run test
-      - name: Lint
-        run: pnpm exec lerna run lint
-      - name: Generate ABIs
-        run: pnpm exec lerna run generate-abi
-      - name: Check ABIs
-        run: pnpm exec lerna run check-abi
+        run: pnpm turbo test --ui stream

+ 1 - 1
.github/workflows/publish-js.yml

@@ -21,5 +21,5 @@ jobs:
         run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
         env:
           NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
-      - run: pnpm exec lerna run build --no-private
+      - run: pnpm turbo build
       - run: pnpm exec lerna publish from-package --no-private --no-git-tag-version --yes

+ 1 - 0
.gitignore

@@ -22,3 +22,4 @@ __pycache__
 .vercel
 .direnv
 .next
+.turbo/

+ 1 - 0
.prettierignore

@@ -1,5 +1,6 @@
 pnpm-lock.yaml
 patches/
+.turbo/
 
 # These apps have their own prettier config that uses a later version of
 # prettier

+ 1 - 1
Dockerfile.node

@@ -16,7 +16,7 @@ USER pyth
 
 FROM builder-base AS builder
 ARG package
-RUN pnpm exec lerna run build --scope="$package" --include-dependencies
+RUN pnpm turbo build --filter $package
 RUN pnpm deploy --filter $package --prod /srv/$package
 
 

+ 35 - 15
README.md

@@ -75,21 +75,41 @@ Integration tests run in Tilt (via the `tilt ci` command). The Tilt CI workflow
 
 ### Typescript Monorepo
 
-All of the typescript / javascript packages in this repository are part of a lerna monorepo.
-This setup allows each package to reference the current version of the others.
-You can install dependencies using `pnpm i` from the repository root.
-You can build all of the packages using `pnpm exec lerna run build` and test with `pnpm exec lerna run test`.
-
-Lerna has some common failure modes that you may encounter:
-
-1. `pnpm i` fails with a typescript compilation error about a missing package.
-   This error likely means that the failing package has a `prepare` entry compiling the typescript in its `package.json`.
-   Fix this error by moving that logic to the `prepublishOnly` entry.
-2. The software builds locally but fails in CI, or vice-versa.
-   This error likely means that some local build caches need to be cleaned.
-   The build error may not indicate that this is a caching issue, e.g., it may appear that the packages are being built in the wrong order.
-   Delete `node_modules/`, `lib/` and `tsconfig.tsbuildinfo` from each package's subdirectory. then try again.
-3. `pnpm i` fails due to wrong node version. Make sure to be using `v18`. Node version `v21` is not supported and known to cause issues.
+All of the typescript / javascript packages in this repository are part of a
+[turborepo](https://turbo.build/repo/docs) monorepo.
+
+#### Setting up
+
+If you use nix and direnv, just cd to the project directory and `direnv allow`.
+
+If you use nix but not direnv, just cd to the project directory and enter a nix
+development shell with `nix develop`.
+
+If you don't use nix at all, then install the required system packages:
+
+- [Node.js](https://nodejs.org/en) -- match the version to `.nvmrc`; you can use
+  [nvm](https://github.com/nvm-sh/nvm) to manage your Node.js version.
+- [pnpm](https://pnpm.io/) -- match the version to the version specified in
+  `package.json`; you can experiment with
+  [corepack](https://nodejs.org/api/corepack.html) to manage your pnpm version
+  for you.
+
+#### Common tasks
+
+The following tasks are the most common ways to interact with the monorepo.
+Thanks to [turborepo](https://turbo.build/repo/docs), these tasks will
+coordinate building any needed dependencies, and task execution will be cached
+and will only re-run as necessary. For any of the following tasks, you can pass
+[any valid `turbo run` option](https://turbo.build/repo/docs/reference/run)
+after `--`, for instance you could run `pnpm test -- --concurrency 2`.
+
+- `pnpm test`: Run all unit tests, integration tests, linting, and format
+  checks, as well as whatever other code checks any packages support.
+- `pnpm fix`: Run auto fixes, including reformatting code and auto-fixing lint
+  rules where possible.
+- `pnpm start:dev`: Start all development servers in parallel.
+- `pnpm start:prod`: Run production builds and start production mode servers in
+  parallel.
 
 ## Audit / Feature Status
 

+ 4 - 7
apps/api-reference/package.json

@@ -8,17 +8,14 @@
   },
   "scripts": {
     "build": "next build",
-    "fix": "pnpm fix:lint && pnpm fix:format",
     "fix:format": "prettier --write .",
     "fix:lint": "eslint --fix .",
-    "pull:env": "VERCEL_ORG_ID=team_BKQrg3JJFLxZyTqpuYtIY0rj VERCEL_PROJECT_ID=prj_gbljYVzp0m5EpCuOF6nZpM4WMFM6 vercel env pull",
-    "start:dev": "next dev",
-    "start:prod": "next start",
-    "test": "tsc && jest",
+    "pull:env": "[ $VERCEL ] || VERCEL_ORG_ID=team_BKQrg3JJFLxZyTqpuYtIY0rj VERCEL_PROJECT_ID=prj_gbljYVzp0m5EpCuOF6nZpM4WMFM6 vercel env pull",
+    "start:dev": "next dev --port 3002",
+    "start:prod": "next start --port 3002",
     "test:format": "jest --selectProjects format",
     "test:lint": "jest --selectProjects lint",
-    "test:types": "tsc",
-    "test:unit": "jest --selectProjects unit --passWithNoTests"
+    "test:types": "tsc"
   },
   "dependencies": {
     "@amplitude/analytics-browser": "^2.9.0",

+ 24 - 0
apps/api-reference/turbo.json

@@ -0,0 +1,24 @@
+{
+  "$schema": "https://turbo.build/schema.json",
+  "extends": ["//"],
+  "tasks": {
+    "build": {
+      "dependsOn": ["pull:env", "^build"],
+      "outputs": [".next/**", "!.next/cache/**"]
+    },
+    "pull:env": {
+      "outputs": [".env.local"],
+      "cache": false
+    },
+    "start:dev": {
+      "dependsOn": ["pull:env"],
+      "persistent": true,
+      "cache": false
+    },
+    "start:prod": {
+      "dependsOn": ["build"],
+      "persistent": true,
+      "cache": false
+    }
+  }
+}

+ 2 - 0
apps/hermes/client/js/.gitignore

@@ -1 +1,3 @@
 lib/
+src/zodSchemas.ts
+schema.json

+ 6 - 8
apps/hermes/client/js/package.json

@@ -20,16 +20,14 @@
     "access": "public"
   },
   "scripts": {
-    "test": "jest --testPathIgnorePatterns=.*.e2e.test.ts --passWithNoTests",
-    "test:e2e": "jest --testPathPattern=.*.e2e.test.ts",
-    "build": "tsc",
-    "generate-hermes-api-types": "openapi-zod-client https://hermes.pyth.network/docs/openapi.json --output src/zodSchemas.ts && prettier --write src/zodSchemas.ts",
-    "check-hermes-api-types": "git diff --exit-code src/zodSchemas.ts",
+    "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",
     "format": "prettier --write \"src/**/*.ts\"",
-    "lint": "eslint src/",
-    "prepublishOnly": "pnpm run build && pnpm test && pnpm run lint",
-    "preversion": "pnpm run lint",
+    "test:lint": "eslint src/",
+    "prepublishOnly": "pnpm run build && pnpm run test:lint",
+    "preversion": "pnpm run test:lint",
     "version": "pnpm run format && git add -A src"
   },
   "keywords": [

+ 0 - 240
apps/hermes/client/js/src/zodSchemas.ts

@@ -1,240 +0,0 @@
-import { makeApi, Zodios, type ZodiosOptions } from "@zodios/core";
-import { z } from "zod";
-
-const AssetType = z.enum(["crypto", "fx", "equity", "metals", "rates"]);
-const asset_type = AssetType.nullish();
-const RpcPriceIdentifier = z.string();
-const PriceFeedMetadata = z
-  .object({ attributes: z.record(z.string()), id: RpcPriceIdentifier })
-  .passthrough();
-const PriceIdInput = z.string();
-const EncodingType = z.enum(["hex", "base64"]);
-const BinaryUpdate = z
-  .object({ data: z.array(z.string()), encoding: EncodingType })
-  .passthrough();
-const RpcPrice = z
-  .object({
-    conf: z.string(),
-    expo: z.number().int(),
-    price: z.string(),
-    publish_time: z.number().int(),
-  })
-  .passthrough();
-const RpcPriceFeedMetadataV2 = z
-  .object({
-    prev_publish_time: z.number().int().nullable(),
-    proof_available_time: z.number().int().nullable(),
-    slot: z.number().int().gte(0).nullable(),
-  })
-  .partial()
-  .passthrough();
-const ParsedPriceUpdate = z
-  .object({
-    ema_price: RpcPrice,
-    id: RpcPriceIdentifier,
-    metadata: RpcPriceFeedMetadataV2,
-    price: RpcPrice,
-  })
-  .passthrough();
-const PriceUpdate = z
-  .object({
-    binary: BinaryUpdate,
-    parsed: z.array(ParsedPriceUpdate).nullish(),
-  })
-  .passthrough();
-const ParsedPublisherStakeCap = z
-  .object({ cap: z.number().int().gte(0), publisher: z.string() })
-  .passthrough();
-const ParsedPublisherStakeCapsUpdate = z
-  .object({ publisher_stake_caps: z.array(ParsedPublisherStakeCap) })
-  .passthrough();
-const LatestPublisherStakeCapsUpdateDataResponse = z
-  .object({
-    binary: BinaryUpdate,
-    parsed: z.array(ParsedPublisherStakeCapsUpdate).nullish(),
-  })
-  .passthrough();
-
-export const schemas = {
-  AssetType,
-  asset_type,
-  RpcPriceIdentifier,
-  PriceFeedMetadata,
-  PriceIdInput,
-  EncodingType,
-  BinaryUpdate,
-  RpcPrice,
-  RpcPriceFeedMetadataV2,
-  ParsedPriceUpdate,
-  PriceUpdate,
-  ParsedPublisherStakeCap,
-  ParsedPublisherStakeCapsUpdate,
-  LatestPublisherStakeCapsUpdateDataResponse,
-};
-
-const endpoints = makeApi([
-  {
-    method: "get",
-    path: "/v2/price_feeds",
-    alias: "price_feeds_metadata",
-    description: `Get the set of price feeds.
-
-This endpoint fetches all price feeds from the Pyth network. It can be filtered by asset type
-and query string.`,
-    requestFormat: "json",
-    parameters: [
-      {
-        name: "query",
-        type: "Query",
-        schema: z.string().nullish(),
-      },
-      {
-        name: "asset_type",
-        type: "Query",
-        schema: asset_type,
-      },
-    ],
-    response: z.array(PriceFeedMetadata),
-  },
-  {
-    method: "get",
-    path: "/v2/updates/price/:publish_time",
-    alias: "timestamp_price_updates",
-    description: `Get the latest price updates by price feed id.
-
-Given a collection of price feed ids, retrieve the latest Pyth price for each price feed.`,
-    requestFormat: "json",
-    parameters: [
-      {
-        name: "publish_time",
-        type: "Path",
-        schema: z.number().int(),
-      },
-      {
-        name: "ids[]",
-        type: "Query",
-        schema: z.array(PriceIdInput),
-      },
-      {
-        name: "encoding",
-        type: "Query",
-        schema: z.enum(["hex", "base64"]).optional(),
-      },
-      {
-        name: "parsed",
-        type: "Query",
-        schema: z.boolean().optional(),
-      },
-    ],
-    response: PriceUpdate,
-    errors: [
-      {
-        status: 404,
-        description: `Price ids not found`,
-        schema: z.void(),
-      },
-    ],
-  },
-  {
-    method: "get",
-    path: "/v2/updates/price/latest",
-    alias: "latest_price_updates",
-    description: `Get the latest price updates by price feed id.
-
-Given a collection of price feed ids, retrieve the latest Pyth price for each price feed.`,
-    requestFormat: "json",
-    parameters: [
-      {
-        name: "ids[]",
-        type: "Query",
-        schema: z.array(PriceIdInput),
-      },
-      {
-        name: "encoding",
-        type: "Query",
-        schema: z.enum(["hex", "base64"]).optional(),
-      },
-      {
-        name: "parsed",
-        type: "Query",
-        schema: z.boolean().optional(),
-      },
-    ],
-    response: PriceUpdate,
-    errors: [
-      {
-        status: 404,
-        description: `Price ids not found`,
-        schema: z.void(),
-      },
-    ],
-  },
-  {
-    method: "get",
-    path: "/v2/updates/price/stream",
-    alias: "price_stream_sse_handler",
-    description: `SSE route handler for streaming price updates.`,
-    requestFormat: "json",
-    parameters: [
-      {
-        name: "ids[]",
-        type: "Query",
-        schema: z.array(PriceIdInput),
-      },
-      {
-        name: "encoding",
-        type: "Query",
-        schema: z.enum(["hex", "base64"]).optional(),
-      },
-      {
-        name: "parsed",
-        type: "Query",
-        schema: z.boolean().optional(),
-      },
-      {
-        name: "allow_unordered",
-        type: "Query",
-        schema: z.boolean().optional(),
-      },
-      {
-        name: "benchmarks_only",
-        type: "Query",
-        schema: z.boolean().optional(),
-      },
-    ],
-    response: PriceUpdate,
-    errors: [
-      {
-        status: 404,
-        description: `Price ids not found`,
-        schema: z.void(),
-      },
-    ],
-  },
-  {
-    method: "get",
-    path: "/v2/updates/publisher_stake_caps/latest",
-    alias: "latest_publisher_stake_caps",
-    description: `Get the most recent publisher stake caps update data.`,
-    requestFormat: "json",
-    parameters: [
-      {
-        name: "encoding",
-        type: "Query",
-        schema: z.enum(["hex", "base64"]).optional(),
-      },
-      {
-        name: "parsed",
-        type: "Query",
-        schema: z.boolean().optional(),
-      },
-    ],
-    response: LatestPublisherStakeCapsUpdateDataResponse,
-  },
-]);
-
-export const api = new Zodios(endpoints);
-
-export function createApiClient(baseUrl: string, options?: ZodiosOptions) {
-  return new Zodios(baseUrl, endpoints, options);
-}

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

@@ -0,0 +1,22 @@
+{
+  "$schema": "https://turbo.build/schema.json",
+  "extends": ["//"],
+  "tasks": {
+    "build:schemas": {
+      "dependsOn": ["pull:schema"],
+      "inputs": ["schema.json"],
+      "outputs": ["src/zodSchemas.ts"]
+    },
+    "build:typescript": {
+      "dependsOn": ["build:schemas", "^build"],
+      "outputs": ["lib/**"]
+    },
+    "build": {
+      "dependsOn": ["build:typescript", "build:schemas"]
+    },
+    "pull:schema": {
+      "outputs": ["schema.json"],
+      "cache": false
+    }
+  }
+}

+ 20 - 22
apps/hermes/server/shell.nix

@@ -1,23 +1,21 @@
-{ pkgs ? import <nixpkgs> {}
-, ...
-}:
+{pkgs ? import <nixpkgs> {}, ...}:
+with pkgs;
+  mkShell {
+    buildInputs = [
+      clang
+      llvmPackages.libclang
+      nettle
+      openssl_1_1
+      pkg-config
+      iconv
+      protobuf
+      go
+      rustup
+      curl
+    ];
 
-with pkgs; mkShell {
-  buildInputs = [
-    clang
-    llvmPackages.libclang
-    nettle
-    openssl_1_1
-    pkg-config
-    iconv
-    protobuf
-    go
-    rustup
-    curl
-  ];
-
-  shellHook = ''
-    export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib";
-    export CPATH="${darwin.Libsystem}/include";
-  '';
-}
+    shellHook = ''
+      export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib";
+      export CPATH="${darwin.Libsystem}/include";
+    '';
+  }

+ 1 - 1
apps/price_pusher/README.md

@@ -84,7 +84,7 @@ To run the price pusher, please run the following commands, replacing the comman
 ```sh
 # Please run the two following commands once from the root of the repo to build the code.
 pnpm install
-pnpm exec lerna run build --scope @pythnetwork/price-pusher --include-dependencies
+pnpm turbo build --filter @pythnetwork/price-pusher
 
 # Navigate to the price_pusher folder
 cd apps/price_pusher

+ 3 - 4
apps/price_pusher/package.json

@@ -20,14 +20,13 @@
     "access": "public"
   },
   "scripts": {
-    "test": "jest src/ --passWithNoTests",
     "build": "tsc",
     "format": "prettier --write \"src/**/*.ts\"",
-    "lint": "eslint src/",
+    "test:lint": "eslint src/",
     "start": "node lib/index.js",
     "dev": "ts-node src/index.ts",
-    "prepublishOnly": "pnpm run build && pnpm test && pnpm run lint",
-    "preversion": "pnpm run lint",
+    "prepublishOnly": "pnpm run build && pnpm run test:lint",
+    "preversion": "pnpm run test:lint",
     "version": "pnpm run format && git add -A src"
   },
   "keywords": [

+ 3 - 5
apps/staking/package.json

@@ -8,13 +8,11 @@
   },
   "scripts": {
     "build": "next build",
-    "fix": "pnpm fix:lint && pnpm fix:format",
     "fix:format": "prettier --write .",
     "fix:lint": "eslint --fix .",
-    "pull:env": "VERCEL_ORG_ID=team_BKQrg3JJFLxZyTqpuYtIY0rj VERCEL_PROJECT_ID=prj_4aG4ZJ4S8b59nQID6LZDDb7c9cVY vercel env pull",
-    "start:dev": "next dev",
-    "start:prod": "next start",
-    "test": "tsc && jest",
+    "pull:env": "[ $VERCEL ] || VERCEL_ORG_ID=team_BKQrg3JJFLxZyTqpuYtIY0rj VERCEL_PROJECT_ID=prj_3TIYzlYYncZx7wRtfmzG2YUsNzKp vercel env pull",
+    "start:dev": "next dev --port 3001",
+    "start:prod": "next start --port 3001",
     "test:format": "jest --selectProjects format",
     "test:lint": "jest --selectProjects lint",
     "test:types": "tsc",

+ 28 - 0
apps/staking/turbo.json

@@ -0,0 +1,28 @@
+{
+  "$schema": "https://turbo.build/schema.json",
+  "extends": ["//"],
+  "tasks": {
+    "build": {
+      "dependsOn": ["pull:env", "^build"],
+      "outputs": [".next/**", "!.next/cache/**"]
+    },
+    "pull:env": {
+      "outputs": [".env.local"],
+      "cache": false
+    },
+    "start:dev": {
+      "dependsOn": [
+        "pull:env",
+        "@pythnetwork/hermes-client#build",
+        "@pythnetwork/solana-utils#build"
+      ],
+      "persistent": true,
+      "cache": false
+    },
+    "start:prod": {
+      "dependsOn": ["build"],
+      "persistent": true,
+      "cache": false
+    }
+  }
+}

+ 0 - 3
apps/staking/vercel.json

@@ -1,3 +0,0 @@
-{
-  "buildCommand": "cd ../.. && pnpm lerna run build --scope @pythnetwork/staking --include-dependencies"
-}

+ 1 - 2
contract_manager/package.json

@@ -11,7 +11,7 @@
   "scripts": {
     "build": "tsc",
     "shell": "ts-node ./src/shell.ts",
-    "lint": "eslint src/ scripts/",
+    "test:lint": "eslint src/ scripts/",
     "format": "prettier --write \"src/**/*.ts\" \"scripts/**/*.ts\""
   },
   "author": "",
@@ -28,7 +28,6 @@
     "@injectivelabs/networks": "^1.14.6",
     "@mysten/sui": "^1.3.0",
     "@pythnetwork/client": "^2.22.0",
-    "@pythnetwork/contract-manager": "workspace:*",
     "@pythnetwork/cosmwasm-deploy-tools": "workspace:*",
     "@pythnetwork/entropy-sdk-solidity": "workspace:*",
     "@pythnetwork/hermes-client": "workspace:*",

+ 1 - 4
contract_manager/src/chains.ts

@@ -53,10 +53,7 @@ export abstract class Chain extends Storable {
     super();
     this.wormholeChainName = wormholeChainName as ChainName;
     if (toChainId(this.wormholeChainName) === undefined)
-      throw new Error(
-        `Invalid chain name ${wormholeChainName}.
-        Try rebuilding @pythnetwork/xc-admin-common: pnpm exec lerna run build --scope @pythnetwork/xc-admin-common`
-      );
+      throw new Error(`Invalid chain name ${wormholeChainName}.`);
   }
 
   public getWormholeChainId(): number {

+ 1 - 1
express_relay/examples/easy_lend/package.json

@@ -8,7 +8,7 @@
   ],
   "scripts": {
     "build": "tsc",
-    "lint": "eslint src/",
+    "test:lint": "eslint src/",
     "format": "prettier --write \"src/**/*.ts\"",
     "monitor": "pnpm run build && node tslib/monitor.js",
     "install-forge-deps": "forge install foundry-rs/forge-std@v1.7.6 --no-git --no-commit"

+ 3 - 4
express_relay/sdk/js/package.json

@@ -14,16 +14,15 @@
   },
   "scripts": {
     "build": "tsc",
-    "test": "jest src/ --passWithNoTests",
     "simple-searcher-evm": "pnpm run build && node lib/examples/simpleSearcherEvm.js",
     "simple-searcher-svm": "pnpm run build && node lib/examples/simpleSearcherSvm.js",
     "simple-searcher-limo": "pnpm run build && node lib/examples/simpleSearcherLimo.js",
     "generate-api-types": "openapi-typescript http://127.0.0.1:9000/docs/openapi.json --output src/serverTypes.d.ts",
     "generate-anchor-types": "anchor idl type src/idl/idlExpressRelay.json --out src/expressRelayTypes.d.ts && anchor idl type src/examples/idl/idlDummy.json --out src/examples/dummyTypes.d.ts",
     "format": "prettier --write \"src/**/*.ts\"",
-    "lint": "eslint src",
-    "prepublishOnly": "pnpm run build && pnpm test && pnpm run lint",
-    "preversion": "pnpm run lint",
+    "test:lint": "eslint src",
+    "prepublishOnly": "pnpm run build && pnpm test:lint",
+    "preversion": "pnpm run test:lint",
     "version": "pnpm run format && git add -A src"
   },
   "keywords": [

+ 2 - 2
express_relay/sdk/solidity/package.json

@@ -12,8 +12,8 @@
   },
   "scripts": {
     "format": "prettier --write .",
-    "generate-abi": "generate-abis IExpressRelay IExpressRelayFeeReceiver",
-    "check-abi": "git diff --exit-code abis"
+    "build": "generate-abis IExpressRelay IExpressRelayFeeReceiver",
+    "test": "git diff --exit-code abis"
   },
   "keywords": [
     "pyth",

+ 12 - 0
express_relay/sdk/solidity/turbo.json

@@ -0,0 +1,12 @@
+{
+  "$schema": "https://turbo.build/schema.json",
+  "extends": ["//"],
+  "tasks": {
+    "build": {
+      "outputs": ["abis/**"]
+    },
+    "test": {
+      "dependsOn": ["build"]
+    }
+  }
+}

+ 3 - 3
flake.lock

@@ -72,11 +72,11 @@
     },
     "nixpkgs_2": {
       "locked": {
-        "lastModified": 1728581530,
-        "narHash": "sha256-f4gri3fqUCTFb7NiBfU+HgxnorQGg05UpeJD+Pnrh8A=",
+        "lastModified": 1729707871,
+        "narHash": "sha256-AesCJV2teiYTIqNd8xtrYOtkECxxbHT8MkY51zLCvlg=",
         "owner": "NixOS",
         "repo": "nixpkgs",
-        "rev": "46ef0f39dda7f21c690472075096e70d1e799f79",
+        "rev": "95ee0b6830b0bed1517dd188b10e30044bae1ca9",
         "type": "github"
       },
       "original": {

+ 19 - 20
flake.nix

@@ -15,31 +15,29 @@
     (
       system: let
         cli-overlay = _: prev: {
-          cli = let
-            pnpm = "${prev.pnpm}/bin/pnpm i && ${prev.pnpm}/bin/pnpm";
-          in
-            prev.lib.mkCli "cli" {
-              _noAll = true;
+          cli = prev.lib.mkCli "cli" {
+            _noAll = true;
 
-              install = "${pnpm} i";
-              start = "${pnpm} lerna run start:dev";
+            start = "${prev.lib.getExe prev.pnpm} start:dev";
 
-              test = {
-                nix = {
-                  lint = "${prev.statix}/bin/statix check --ignore node_modules .";
-                  dead-code = "${prev.deadnix}/bin/deadnix --exclude ./node_modules .";
-                  format = "${prev.alejandra}/bin/alejandra --exclude ./node_modules --check .";
-                };
+            test = {
+              nix = {
+                lint = "${prev.statix}/bin/statix check --ignore node_modules .";
+                dead-code = "${prev.deadnix}/bin/deadnix --exclude ./node_modules .";
+                format = "${prev.alejandra}/bin/alejandra --exclude ./node_modules --check .";
               };
+              turbo = "${prev.lib.getExe prev.pnpm} test -- --ui stream";
+            };
 
-              fix = {
-                nix = {
-                  lint = "${prev.statix}/bin/statix fix --ignore node_modules .";
-                  dead-code = "${prev.deadnix}/bin/deadnix --exclude ./node_modules -e .";
-                  format = "${prev.alejandra}/bin/alejandra --exclude ./node_modules .";
-                };
+            fix = {
+              nix = {
+                lint = "${prev.statix}/bin/statix fix --ignore node_modules .";
+                dead-code = "${prev.deadnix}/bin/deadnix --exclude ./node_modules -e .";
+                format = "${prev.alejandra}/bin/alejandra --exclude ./node_modules .";
               };
+              turbo = "${prev.lib.getExe prev.pnpm} fix -- --ui stream";
             };
+          };
         };
 
         pkgs = import nixpkgs {
@@ -53,13 +51,14 @@
             pkgs.cargo
             pkgs.cli
             pkgs.git
-            pkgs.libusb
+            pkgs.libusb1
             pkgs.nodejs
             pkgs.pkg-config
             pkgs.pnpm
             pkgs.pre-commit
             pkgs.python3
             pkgs.python3Packages.distutils
+            pkgs.graphviz
           ];
         };
       }

+ 2 - 5
governance/pyth_staking_sdk/package.json

@@ -12,15 +12,12 @@
   },
   "scripts": {
     "build": "tsc",
-    "test": "pnpm run test:format && pnpm run test:lint && pnpm run test:integration && pnpm run test:types",
-    "fix": "pnpm fix:lint && pnpm fix:format",
     "fix:format": "prettier --write .",
     "fix:lint": "eslint --fix .",
+    "prepublishOnly": "node scripts/update-package-json.mjs",
     "test:format": "prettier --check .",
     "test:lint": "jest --selectProjects lint",
-    "test:types": "tsc",
-    "test:integration": "echo disabled # jest --selectProjects integration",
-    "prepublishOnly": "node scripts/update-package-json.mjs"
+    "test:types": "tsc"
   },
   "devDependencies": {
     "@cprussin/eslint-config": "^3.0.0",

+ 1 - 1
governance/xc_admin/packages/xc_admin_cli/README.md

@@ -27,7 +27,7 @@ To activate a transaction:
 
 ```
 pnpm i
-pnpm exec lerna run build --scope "@pythnetwork/xc-admin-common"  --include-dependencies
+pnpm turbo build --filter @pythnetwork/xc-admin-common
 pnpm exec ts-node src/index.ts activate -t <TRANSACTION_HASH> -c <CLUSTER: [mainnet|devnet|testnet] -v <VAULT_ADDRESS> -w <WALLET_SECRET_KEY_FILEPATH: [filepath|"ledger"]> -lda <LEDGER_DERIVATION_ACCOUNT> -ldc <LEDGER_DERIVATION_CHANGE>
 
 ```

+ 1 - 1
governance/xc_admin/packages/xc_admin_common/package.json

@@ -17,7 +17,7 @@
   "scripts": {
     "build": "tsc",
     "format": "prettier --write \"src/**/*.ts\"",
-    "test": "jest"
+    "test:unit": "jest"
   },
   "//": [
     "The injectivelabs/token-metadata package is pinned to a specific version to ensure that",

+ 1 - 1
governance/xc_admin/packages/xc_admin_frontend/Dockerfile

@@ -4,7 +4,7 @@ ARG NEXT_PUBLIC_RPC_POOL_TOKEN
 ENV NEXT_TELEMETRY_DISABLED 1
 ENV BUILD_STANDALONE true
 ENV NEXT_PUBLIC_RPC_POOL_TOKEN $NEXT_PUBLIC_RPC_POOL_TOKEN
-RUN pnpm exec lerna run build --scope="@pythnetwork/xc-admin-frontend" --include-dependencies
+RUN pnpm turbo build --filter @pythnetwork/xc-admin-frontend
 
 
 # See https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile

+ 2 - 5
governance/xc_admin/packages/xc_admin_frontend/README.md

@@ -5,13 +5,10 @@ This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next
 First, run the development server:
 
 ```bash
-pyth-crosschain % pnpm i
-pyth-crosschain % pnpm exec lerna run build --scope @pythnetwork/xc-admin-frontend --include-dependencies
-pyth-crosschain % cd governance/xc_admin/packages/xc_admin_frontend
-xc_admin_frontend % npm run dev
+pyth-crosschain % pnpm start:dev
 ```
 
-Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
+Open [http://localhost:3003](http://localhost:3003) with your browser to see the result.
 
 You can start editing the code. The page auto-updates as you edit the file.
 

+ 6 - 4
governance/xc_admin/packages/xc_admin_frontend/package.json

@@ -6,10 +6,11 @@
     "node": "20"
   },
   "scripts": {
-    "dev": "next dev",
     "build": "next build",
-    "start": "next start",
-    "lint": "next lint"
+    "pull:env": "[ $VERCEL ] || VERCEL_ORG_ID=team_BKQrg3JJFLxZyTqpuYtIY0rj VERCEL_PROJECT_ID=prj_TCjesnm3pxM7Ay8oxlTH4xLkkmP9 vercel env pull",
+    "start:dev": "next dev --port 3003",
+    "start:prod": "next start --port 3003",
+    "test:lint": "next lint"
   },
   "dependencies": {
     "@coral-xyz/anchor": "^0.29.0",
@@ -55,6 +56,7 @@
     "prettier": "^2.7.1",
     "prettier-plugin-tailwindcss": "^0.1.13",
     "tailwindcss": "^3.1.8",
-    "typescript": "^5.4.5"
+    "typescript": "^5.4.5",
+    "vercel": "^37.12.1"
   }
 }

+ 28 - 0
governance/xc_admin/packages/xc_admin_frontend/turbo.json

@@ -0,0 +1,28 @@
+{
+  "$schema": "https://turbo.build/schema.json",
+  "extends": ["//"],
+  "tasks": {
+    "build": {
+      "dependsOn": ["pull:env", "^build"],
+      "outputs": [".next/**", "!.next/cache/**"]
+    },
+    "pull:env": {
+      "outputs": [".env.local"],
+      "cache": false
+    },
+    "start:dev": {
+      "dependsOn": [
+        "pull:env",
+        "@pythnetwork/hermes-client#build",
+        "@pythnetwork/solana-utils#build"
+      ],
+      "persistent": true,
+      "cache": false
+    },
+    "start:prod": {
+      "dependsOn": ["build"],
+      "persistent": true,
+      "cache": false
+    }
+  }
+}

+ 0 - 1
lerna.json

@@ -1,6 +1,5 @@
 {
   "$schema": "node_modules/lerna/schemas/lerna-schema.json",
-  "useWorkspaces": true,
   "version": "independent",
   "npmClient": "pnpm"
 }

+ 12 - 3
package.json

@@ -1,20 +1,29 @@
 {
+  "name": "@pythnetwork/pyth-crosschain",
   "private": true,
   "packageManager": "pnpm@9.12.1",
   "engines": {
     "node": "^20.17.0",
     "pnpm": "^9.12.1"
   },
+  "scripts": {
+    "fix": "pnpm i && turbo fix",
+    "start:dev": "pnpm i && turbo start:dev",
+    "start:prod": "pnpm i && turbo start:prod",
+    "test": "pnpm i && turbo test"
+  },
   "devDependencies": {
-    "lerna": "^6.6.2",
+    "lerna": "^8.1.8",
     "pre-commit": "^1.2.2",
-    "prettier": "2.7.1"
+    "prettier": "2.7.1",
+    "turbo": "^2.2.3"
   },
   "pnpm": {
     "overrides": {
       "@injectivelabs/sdk-ts@1.10.72>@injectivelabs/token-metadata": "1.10.42",
       "eslint-config-next>@typescript-eslint/parser": "^7.0.0",
-      "@solana/web3.js@^1.93.0": "1.92.3"
+      "@solana/web3.js@^1.93.0": "1.92.3",
+      "eslint-config-turbo": "^2.2.3"
     },
     "patchedDependencies": {
       "eccrypto@1.1.6": "patches/eccrypto@1.1.6.patch"

+ 0 - 2
packages/component-library/package.json

@@ -5,11 +5,9 @@
   "type": "module",
   "scripts": {
     "build:storybook": "storybook build",
-    "fix": "pnpm fix:lint && pnpm fix:format",
     "fix:format": "prettier --write .",
     "fix:lint": "eslint --fix .",
     "start:storybook": "storybook dev --port 4000 --no-open",
-    "test": "pnpm test:types && pnpm test:lint && pnpm test:format",
     "test:format": "prettier --check .",
     "test:lint": "jest --selectProjects lint",
     "test:types": "tsc"

+ 0 - 2
packages/fonts/package.json

@@ -5,10 +5,8 @@
   "type": "module",
   "main": "./src/index.ts",
   "scripts": {
-    "fix": "pnpm fix:lint && pnpm fix:format",
     "fix:format": "prettier --write .",
     "fix:lint": "eslint --fix .",
-    "test": "pnpm test:types && jest",
     "test:format": "jest --selectProjects format",
     "test:lint": "jest --selectProjects lint",
     "test:types": "tsc"

Разлика између датотеке није приказан због своје велике величине
+ 228 - 262
pnpm-lock.yaml


+ 3 - 4
price_service/client/js/package.json

@@ -20,14 +20,13 @@
     "access": "public"
   },
   "scripts": {
-    "test": "jest --testPathIgnorePatterns=.*.e2e.test.ts --passWithNoTests",
     "test:e2e": "jest --testPathPattern=.*.e2e.test.ts",
     "build": "tsc",
     "example": "pnpm run build && node lib/examples/PriceServiceClient.js",
     "format": "prettier --write \"src/**/*.ts\"",
-    "lint": "eslint src/",
-    "prepublishOnly": "pnpm run build && pnpm test && pnpm run lint",
-    "preversion": "pnpm run lint",
+    "test:lint": "eslint src/",
+    "prepublishOnly": "pnpm run build && pnpm run test:lint",
+    "preversion": "pnpm run test:lint",
     "version": "pnpm run format && git add -A src"
   },
   "keywords": [

+ 4 - 4
price_service/sdk/js/package.json

@@ -17,13 +17,13 @@
     "access": "public"
   },
   "scripts": {
-    "test": "jest",
     "build": "tsc",
     "format": "prettier --write \"src/**/*.ts\"",
     "gen-ts-schema": "quicktype --src-lang schema src/schemas/price_feed.json -o src/schemas/PriceFeed.ts --raw-type any --converters all-objects && prettier --write \"src/schemas/*.ts\"",
-    "lint": "eslint src/",
-    "prepublishOnly": "pnpm run build && pnpm test && pnpm run lint",
-    "preversion": "pnpm run lint",
+    "test:unit": "jest",
+    "test:lint": "eslint src/",
+    "prepublishOnly": "pnpm run build && pnpm test:unit && pnpm run test:lint",
+    "preversion": "pnpm run test:lint",
     "version": "pnpm run format && git add -A src"
   },
   "keywords": [

+ 3 - 4
target_chains/aptos/sdk/js/package.json

@@ -20,13 +20,12 @@
     "access": "public"
   },
   "scripts": {
-    "test": "jest --passWithNoTests",
     "build": "tsc",
     "example-relay": "pnpm run build && node lib/examples/AptosRelay.js",
     "format": "prettier --write \"src/**/*.ts\"",
-    "lint": "eslint src/",
-    "prepublishOnly": "pnpm run build && pnpm test && pnpm run lint",
-    "preversion": "pnpm run lint",
+    "test:lint": "eslint src/",
+    "prepublishOnly": "pnpm run build && pnpm test:lint",
+    "preversion": "pnpm run test:lint",
     "version": "pnpm run format && git add -A src"
   },
   "keywords": [

+ 1 - 1
target_chains/ethereum/contracts/README.md

@@ -10,7 +10,7 @@ Next, run the following command from the repo root to install required dependenc
 
 ```
 pnpm i
-pnpm exec lerna run build --scope="@pythnetwork/pyth-evm-contract" --include-dependencies
+pnpm turbo build --filter @pythnetwork/pyth-evm-contract
 ```
 
 Next, from the `contracts` directory, run the following command to install forge dependencies:

+ 1 - 1
target_chains/ethereum/contracts/deploy.sh

@@ -13,7 +13,7 @@ set -euo pipefail
 
 echo "=========== Building dependencies ==========="
 pushd ../../../
-pnpm exec lerna run build --scope="@pythnetwork/pyth-evm-contract" --include-dependencies
+pnpm turbo build --filter @pythnetwork/pyth-evm-contract
 popd
 
 echo "=========== Compiling ==========="

+ 2 - 2
target_chains/ethereum/entropy_sdk/solidity/package.json

@@ -12,8 +12,8 @@
   },
   "scripts": {
     "format": "prettier --write .",
-    "generate-abi": "generate-abis IEntropy IEntropyConsumer EntropyErrors EntropyEvents EntropyStructs PRNG",
-    "check-abi": "git diff --exit-code abis"
+    "build": "generate-abis IEntropy IEntropyConsumer EntropyErrors EntropyEvents EntropyStructs PRNG",
+    "test": "git diff --exit-code abis"
   },
   "keywords": [
     "pyth",

+ 12 - 0
target_chains/ethereum/entropy_sdk/solidity/turbo.json

@@ -0,0 +1,12 @@
+{
+  "$schema": "https://turbo.build/schema.json",
+  "extends": ["//"],
+  "tasks": {
+    "build": {
+      "outputs": ["abis/**"]
+    },
+    "test": {
+      "dependsOn": ["build"]
+    }
+  }
+}

+ 3 - 4
target_chains/ethereum/sdk/js/package.json

@@ -20,15 +20,14 @@
     "access": "public"
   },
   "scripts": {
-    "test": "jest --passWithNoTests",
     "build": "tsc",
     "example-client": "pnpm run build && node lib/examples/EvmPriceServiceClient.js",
     "example-relay": "pnpm run build && node lib/examples/EvmRelay.js",
     "example-benchmark": "pnpm run build && node lib/examples/EvmBenchmark.js",
     "format": "prettier --write \"src/**/*.ts\"",
-    "lint": "eslint src/",
-    "prepublishOnly": "pnpm run build && pnpm test && pnpm run lint",
-    "preversion": "pnpm run lint",
+    "test:lint": "eslint src/",
+    "prepublishOnly": "pnpm run build && pnpm run test:lint",
+    "preversion": "pnpm run test:lint",
     "version": "pnpm run format && git add -A src"
   },
   "keywords": [

+ 3 - 3
target_chains/ethereum/sdk/solidity/package.json

@@ -8,10 +8,10 @@
     "directory": "target_chains/ethereum/sdk/solidity"
   },
   "scripts": {
+    "build:abis": "generate-abis IPyth IPythEvents AbstractPyth MockPyth PythErrors PythUtils",
+    "build:bin:": "solcjs --bin MockPyth.sol --base-path . -o build/",
     "format": "prettier --write .",
-    "generate-abi": "generate-abis IPyth IPythEvents AbstractPyth MockPyth PythErrors PythUtils",
-    "check-abi": "git diff --exit-code abis",
-    "build": "solcjs --bin MockPyth.sol --base-path . -o build/"
+    "test": "git diff --exit-code abis"
   },
   "keywords": [
     "pyth",

+ 18 - 0
target_chains/ethereum/sdk/solidity/turbo.json

@@ -0,0 +1,18 @@
+{
+  "$schema": "https://turbo.build/schema.json",
+  "extends": ["//"],
+  "tasks": {
+    "build:abis": {
+      "outputs": ["abis/**"]
+    },
+    "build:bin": {
+      "outputs": ["build/**"]
+    },
+    "build": {
+      "dependsOn": ["build:abis", "build:bin"]
+    },
+    "test": {
+      "dependsOn": ["build:abis"]
+    }
+  }
+}

+ 3 - 3
target_chains/fuel/sdk/js/package.json

@@ -23,9 +23,9 @@
     "usage-example": "ts-node src/examples/usage.ts",
     "build": "pnpm run generate-fuel-types && tsc && copyfiles -u 1 \"src/**/*.d.ts\" lib",
     "format": "prettier --write \"src/**/*.ts\"",
-    "lint": "eslint src/",
-    "prepublishOnly": "pnpm run build && pnpm run lint",
-    "preversion": "pnpm run lint",
+    "test:lint": "eslint src/",
+    "prepublishOnly": "pnpm run build && pnpm run test:lint",
+    "preversion": "pnpm run test:lint",
     "version": "pnpm run format && git add -A src",
     "generate-fuel-types": "pnpm fuels typegen -i ../../contracts/pyth-contract/out/release/*-abi.json -o ./src/types && prettier --write \"./src/types/**/*.ts\""
   },

+ 1 - 1
target_chains/solana/sdk/js/pyth_solana_receiver/README.md

@@ -178,7 +178,7 @@ First, install and build any necessary typescript dependencies:
 
 1. Clone the `pyth-crosschain` git repo
 2. Run `pnpm i` in the root of the repo
-3. Run `pnpm exec lerna run build` anywhere in the repo
+3. Run `pnpm turbo build` anywhere in the repo
 4. From the `pyth_solana_receiver` directory, run `pnpm exec ts-node examples/<example filename>.ts`
 
 The examples require a Solana keypair with SOL to send Solana transactions.

+ 3 - 4
target_chains/solana/sdk/js/pyth_solana_receiver/package.json

@@ -19,10 +19,9 @@
   "scripts": {
     "build": "tsc",
     "format": "prettier --write \"src/**/*.ts\"",
-    "lint": "eslint src/",
-    "test": "jest src/ --passWithNoTests",
-    "prepublishOnly": "pnpm run build && pnpm test && pnpm run lint",
-    "preversion": "pnpm run lint",
+    "test:lint": "eslint src/",
+    "prepublishOnly": "pnpm run build && pnpm test:lint",
+    "preversion": "pnpm run test:lint",
     "version": "pnpm run format && git add -A src"
   },
   "keywords": [

+ 4 - 4
target_chains/solana/sdk/js/solana_utils/package.json

@@ -17,12 +17,12 @@
     "access": "public"
   },
   "scripts": {
-    "test": "jest",
     "build": "tsc",
     "format": "prettier --write \"src/**/*.ts\"",
-    "lint": "eslint src/",
-    "prepublishOnly": "pnpm run build && pnpm test && pnpm run lint",
-    "preversion": "pnpm run lint",
+    "test:unit": "jest",
+    "test:lint": "eslint src/",
+    "prepublishOnly": "pnpm run build && pnpm test:unit && pnpm run test:lint",
+    "preversion": "pnpm run test:lint",
     "version": "pnpm run format && git add -A src"
   },
   "keywords": [

+ 3 - 4
target_chains/starknet/sdk/js/package.json

@@ -20,13 +20,12 @@
     "access": "public"
   },
   "scripts": {
-    "test": "jest --passWithNoTests",
     "build": "tsc",
     "usage-example": "ts-node src/examples/usage.ts",
     "format": "prettier --write \"src/**/*.ts\"",
-    "lint": "eslint src/",
-    "prepublishOnly": "pnpm run build && pnpm test && pnpm run lint",
-    "preversion": "pnpm run lint",
+    "test:lint": "eslint src/",
+    "prepublishOnly": "pnpm run build && pnpm run test:lint",
+    "preversion": "pnpm run test:lint",
     "version": "pnpm run format && git add -A src"
   },
   "keywords": [

+ 3 - 4
target_chains/sui/sdk/js/package.json

@@ -20,13 +20,12 @@
     "access": "public"
   },
   "scripts": {
-    "test": "jest --passWithNoTests",
     "build": "tsc",
     "example-relay": "pnpm run build && node lib/examples/SuiRelay.js",
     "format": "prettier --write \"src/**/*.ts\"",
-    "lint": "eslint src/",
-    "prepublishOnly": "pnpm run build && pnpm test && pnpm run lint",
-    "preversion": "pnpm run lint",
+    "test:lint": "eslint src/",
+    "prepublishOnly": "pnpm run build && pnpm test:lint",
+    "preversion": "pnpm run test:lint",
     "version": "pnpm run format && git add -A src"
   },
   "keywords": [

+ 1 - 1
target_chains/ton/contracts/package.json

@@ -5,7 +5,7 @@
   "scripts": {
     "start": "blueprint run",
     "build": "echo Pyth | blueprint build",
-    "test": "jest --verbose"
+    "test:unit": "jest --verbose"
   },
   "devDependencies": {
     "@pythnetwork/pyth-ton-js": "workspace:*",

+ 3 - 4
target_chains/ton/sdk/js/package.json

@@ -20,12 +20,11 @@
     "access": "public"
   },
   "scripts": {
-    "test": "jest --passWithNoTests",
     "build": "tsc",
     "format": "prettier --write \"src/**/*.ts\"",
-    "lint": "eslint src/",
-    "prepublishOnly": "pnpm run build && pnpm test && pnpm run lint",
-    "preversion": "pnpm run lint",
+    "test:lint": "eslint src/",
+    "prepublishOnly": "pnpm run build && pnpm run test:lint",
+    "preversion": "pnpm run test:lint",
     "version": "pnpm run format && git add -A src"
   },
   "keywords": [

+ 53 - 0
turbo.json

@@ -0,0 +1,53 @@
+{
+  "$schema": "https://turbo.build/schema.json",
+  "globalEnv": ["NODE_ENV"],
+  "ui": "tui",
+  "tasks": {
+    "build": {
+      "dependsOn": ["^build"],
+      "inputs": [
+        "$TURBO_DEFAULT$",
+        "!README.md",
+        "!**/*.test.*",
+        "!jest.config.js",
+        "!eslint.config.js",
+        "!prettier.config.js",
+        "!vercel.json"
+      ],
+      "outputs": ["dist/**", "lib/**"]
+    },
+    "fix": {
+      "dependsOn": ["fix:lint", "fix:format"],
+      "cache": false
+    },
+    "fix:format": {
+      "dependsOn": ["fix:lint"],
+      "cache": false
+    },
+    "fix:lint": {
+      "cache": false
+    },
+    "test": {
+      "dependsOn": [
+        "test:types",
+        "test:unit",
+        "test:integration",
+        "test:format",
+        "test:lint"
+      ]
+    },
+    "test:format": {},
+    "test:lint": {
+      "dependsOn": ["^build"]
+    },
+    "test:types": {
+      "dependsOn": ["^build"]
+    },
+    "test:unit": {
+      "dependsOn": ["^build"]
+    },
+    "test:integration": {
+      "dependsOn": ["^build"]
+    }
+  }
+}

Неке датотеке нису приказане због велике количине промена