Skip to content

Commit

Permalink
Tidy up various dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
robknight committed Oct 23, 2024
1 parent aa45ec0 commit 076cc95
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 159 deletions.
6 changes: 1 addition & 5 deletions examples/test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
"@parcnet-js/client-rpc": "workspace:*",
"@parcnet-js/podspec": "workspace:*",
"@parcnet-js/ticket-spec": "workspace:*",
"@pcd/pod": "0.1.7",
"json-bigint": "^1.0.0",
"@semaphore-protocol/identity": "^3.15.2",
"lodash": "^4.17.21",
"@pcd/pod": "^0.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.0.1",
Expand All @@ -27,7 +24,6 @@
"@parcnet-js/eslint-config": "workspace:*",
"@tailwindcss/forms": "^0.5.7",
"@tailwindcss/typography": "^0.5.14",
"@types/json-bigint": "^1.0.1",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
Expand Down
11 changes: 8 additions & 3 deletions examples/test-app/src/apis/GPC.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { ProveResult } from "@parcnet-js/client-rpc";
import type { PODData, PodspecProofRequest } from "@parcnet-js/podspec";
import { TicketSpec, ticketProofRequest } from "@parcnet-js/ticket-spec";
import JSONBig from "json-bigint";
import type { ReactNode } from "react";
import { useEffect, useState } from "react";
import { TryIt } from "../components/TryIt";
Expand Down Expand Up @@ -141,7 +140,10 @@ const gpcProof = await z.gpc.prove({ request });
/>
{proveResult && (
<pre className="whitespace-pre-wrap">
{JSONBig.stringify(proveResult, null, 2)}
{JSON.stringify(proveResult, (key, value) =>
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
typeof value === "bigint" ? value.toString() : value
)}
</pre>
)}
</div>
Expand Down Expand Up @@ -308,7 +310,10 @@ const gpcProof = await z.gpc.prove({ request: request.schema });
/>
{proveResult && (
<pre className="whitespace-pre-wrap">
{JSONBig.stringify(proveResult, null, 2)}
{JSON.stringify(proveResult, (key, value) =>
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
typeof value === "bigint" ? value.toString() : value
)}
</pre>
)}
</div>
Expand Down
17 changes: 9 additions & 8 deletions examples/test-app/src/apis/PODSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import type { ParcnetAPI, Subscription } from "@parcnet-js/app-connector";
import * as p from "@parcnet-js/podspec";
import type { PODData } from "@parcnet-js/podspec";
import type { PODEntries, PODValue } from "@pcd/pod";
import { POD_INT_MAX, POD_INT_MIN } from "@pcd/pod";
import JSONBig from "json-bigint";
import { POD_INT_MAX, POD_INT_MIN } from "@pcd/pod/podTypes";
import type { Dispatch, ReactNode, SetStateAction } from "react";
import { useReducer, useState } from "react";
import { Button } from "../components/Button";
Expand Down Expand Up @@ -102,14 +101,15 @@ const pods = await z.pod.collection("${selectedCollection}").query(q);
/>
{pods !== undefined && (
<pre className="whitespace-pre-wrap">
{JSONBig.stringify(
{JSON.stringify(
pods.map((p) => ({
entries: p.entries,
signature: p.signature,
signerPublicKey: p.signerPublicKey
})),
null,
2
(key, value) =>
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
typeof value === "bigint" ? value.toString() : value
)}
</pre>
)}
Expand Down Expand Up @@ -695,14 +695,15 @@ const sub = await z.pod.collection("${selectedCollection}").subscribe(q);
{pods.length > 0 && subscription !== null && (
<div>
<pre className="whitespace-pre-wrap">
{JSONBig.stringify(
{JSON.stringify(
pods.map((p) => ({
entries: p.entries,
signature: p.signature,
signerPublicKey: p.signerPublicKey
})),
null,
2
(key, value) =>
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
typeof value === "bigint" ? value.toString() : value
)}
</pre>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/podspec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@pcd/proto-pod-gpc-artifacts": "^0.11.0",
"@semaphore-protocol/identity": "^3.15.2",
"@types/uuid": "^9.0.0",
"@zk-kit/eddsa-poseidon": "1.0.3",
"@zk-kit/eddsa-poseidon": "^1.0.3",
"tsup": "^8.2.4",
"typescript": "^5.5",
"uuid": "^9.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/podspec/src/parse/entries.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { PODEntries, PODValue } from "@pcd/pod";
import { checkPODName } from "@pcd/pod";
import { checkPODName } from "@pcd/pod/podChecks";
import type {
PodspecBaseIssue,
PodspecInvalidEntryNameIssue,
Expand Down
2 changes: 1 addition & 1 deletion packages/podspec/src/parse/entry.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { PODCryptographicValue, PODIntValue } from "@pcd/pod";
import { checkBigintBounds } from "@pcd/pod";
import { checkBigintBounds } from "@pcd/pod/podChecks";
import type { PodspecBaseIssue, PodspecNotInRangeIssue } from "../error.js";
import { IssueCode } from "../error.js";
import type { DefinedEntrySchema } from "../schemas/entry.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/podspec/src/parse/parse_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
checkBigintBounds,
checkPODValue,
checkPublicKeyFormat
} from "@pcd/pod";
} from "@pcd/pod/podChecks";
import type {
PodspecBaseIssue,
PodspecExcludedByListIssue,
Expand Down
5 changes: 4 additions & 1 deletion packages/podspec/src/schemas/cryptographic.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type { PODCryptographicValue, PODName } from "@pcd/pod";
import { POD_CRYPTOGRAPHIC_MAX, POD_CRYPTOGRAPHIC_MIN } from "@pcd/pod";
import {
POD_CRYPTOGRAPHIC_MAX,
POD_CRYPTOGRAPHIC_MIN
} from "@pcd/pod/podTypes";
import type { PodspecInvalidTypeIssue } from "../error.js";
import { IssueCode } from "../error.js";
import type { ParseResult } from "../parse/parse_utils.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/podspec/src/schemas/int.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { PODIntValue, PODName } from "@pcd/pod";
import { POD_INT_MAX, POD_INT_MIN } from "@pcd/pod";
import { POD_INT_MAX, POD_INT_MIN } from "@pcd/pod/podTypes";
import type { PodspecInvalidTypeIssue } from "../error.js";
import { IssueCode } from "../error.js";
import type { ParseResult } from "../parse/parse_utils.js";
Expand Down
3 changes: 2 additions & 1 deletion packages/podspec/test/podspec.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import path from "path";
import type { GPCBoundConfig } from "@pcd/gpc";
import { gpcProve, gpcVerify } from "@pcd/gpc";
import { POD, POD_INT_MAX, POD_INT_MIN } from "@pcd/pod";
import { POD } from "@pcd/pod";
import { POD_INT_MAX, POD_INT_MIN } from "@pcd/pod/podTypes";
import { v4 as uuidv4 } from "uuid";
import { assert, describe, expect, it } from "vitest";
import type {
Expand Down
4 changes: 2 additions & 2 deletions packages/ticket-spec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"devDependencies": {
"@parcnet-js/eslint-config": "workspace:*",
"@parcnet-js/typescript-config": "workspace:*",
"@pcd/gpc": "0.2.0",
"@pcd/pod": "0.3.0",
"@pcd/gpc": "^0.2.0",
"@pcd/pod": "^0.3.0",
"@pcd/proto-pod-gpc-artifacts": "^0.9.0",
"@semaphore-protocol/core": "^4.0.3",
"@semaphore-protocol/identity": "^3.15.2",
Expand Down
Loading

0 comments on commit 076cc95

Please sign in to comment.