Sfoglia il codice sorgente

fix(xc-admin-proposer-server): fixed build

benduran 3 settimane fa
parent
commit
05959a074b

+ 11 - 2
governance/xc_admin/packages/proposer_server/package.json

@@ -6,7 +6,8 @@
   "author": "",
   "homepage": "https://github.com/pyth-network/pyth-crosschain",
   "license": "ISC",
-  "main": "dist/index.ts",
+  "main": "./dist/index.js",
+  "type": "module",
   "repository": {
     "type": "git",
     "url": "git+https://github.com/pyth-network/pyth-crosschain.git"
@@ -40,5 +41,13 @@
     "node": ">=22.16.0",
     "pnpm": ">=10.19.0"
   },
-  "packageManager": "pnpm@10.19.0"
+  "packageManager": "pnpm@10.19.0",
+  "exports": {
+    ".": {
+      "default": "./dist/index.js",
+      "types": "./dist/index.d.ts"
+    },
+    "./package.json": "./package.json"
+  },
+  "types": "./dist/index.d.ts"
 }

+ 4 - 4
governance/xc_admin/packages/proposer_server/src/index.ts

@@ -1,7 +1,7 @@
-import express, { Request, Response } from "express";
+import express, { type Request, type Response } from "express";
 import cors from "cors";
 import {
-  Cluster,
+  type Cluster,
   Connection,
   Keypair,
   PublicKey,
@@ -14,7 +14,7 @@ import {
   PRICE_FEED_MULTISIG,
 } from "@pythnetwork/xc-admin-common";
 import * as fs from "fs";
-import { getPythClusterApiUrl, PythCluster } from "@pythnetwork/client";
+import { getPythClusterApiUrl, type PythCluster } from "@pythnetwork/client";
 import SquadsMesh from "@sqds/mesh";
 import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet";
 
@@ -84,7 +84,7 @@ app.post("/api/propose", async (req: Request, res: Response) => {
     // preserve the existing API by returning only the first pubkey
     const proposalPubkey = (
       await vault.proposeInstructions(instructions, cluster, {
-        computeUnitPriceMicroLamports: COMPUTE_UNIT_PRICE_MICROLAMPORTS,
+        computeUnitPriceMicroLamports: COMPUTE_UNIT_PRICE_MICROLAMPORTS!,
       })
     )[0];
     res.status(200).json({ proposalPubkey: proposalPubkey });

+ 4 - 0
governance/xc_admin/packages/proposer_server/tsconfig.json

@@ -1,5 +1,9 @@
 {
   "extends": "@cprussin/tsconfig/base.json",
   "include": ["src"],
+  "compilerOptions": {
+    "module": "preserve",
+    "moduleResolution": "node"
+  },
   "exclude": ["dist", "node_modules", "**/__tests__/*"]
 }