Skip to content

Commit

Permalink
feat: Add local explorer schema for codegen. Remove all references to…
Browse files Browse the repository at this point in the history
… the PREVIEW_API env var. Fix a few lines on dockerfile based on docker warnings.
  • Loading branch information
brunomenezes committed Dec 19, 2024
1 parent 0e1c5dc commit 69bd2d8
Show file tree
Hide file tree
Showing 10 changed files with 1,453 additions and 34 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ concurrency:
cancel-in-progress: true
env:
NEXT_PUBLIC_EXPLORER_API_URL: http://localhost:4350/graphql
NEXT_PUBLIC_PREVIEW_EXPLORER_API_URL: ${{ vars.NEXT_PUBLIC_PREVIEW_EXPLORER_API_URL }}
jobs:
ci:
runs-on: ubuntu-latest
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ permissions:
contents: read
packages: write
id-token: write
env:
PREVIEW_API_URL: ${{vars.NEXT_PUBLIC_PREVIEW_EXPLORER_API_URL}}
jobs:
build:
runs-on: ubuntu-latest
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: End-to-end testing
on:
deployment_status:
env:
NEXT_PUBLIC_PREVIEW_EXPLORER_API_URL: ${{vars.NEXT_PUBLIC_PREVIEW_EXPLORER_API_URL}}
jobs:
e2e:
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success' && contains(github.event.deployment_status.environment_url, 'rollups-explorer-sepolia')
Expand Down
2 changes: 0 additions & 2 deletions apps/web/.env.sunodo
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ NEXT_PUBLIC_CHAIN_ID=31337
NEXT_PUBLIC_EXPLORER_API_URL="http://localhost:8080/explorer-api/graphql"
INTERNAL_EXPLORER_API_URL="http://explorer_api:4350/graphql"
BASE_PATH="/explorer"
# TODO: Remove temp variable expansion
NEXT_PUBLIC_PREVIEW_EXPLORER_API_URL=${PREVIEW_API_URL}
4 changes: 0 additions & 4 deletions apps/web/additional.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ declare namespace NodeJS {
*/
NEXT_PUBLIC_EXPLORER_API_URL: string;

/**
* A short-lived public preview rollups-explorer-api graphql endpoint (for development purposes)
*/
NEXT_PUBLIC_PREVIEW_EXPLORER_API_URL: string;
/**
* Alchemy API key to have an extra rpc-node to work in conjunction with public nodes.
*/
Expand Down
8 changes: 3 additions & 5 deletions apps/web/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ import type { Types } from "@graphql-codegen/plugin-helpers";
import { join, sep } from "path";

const basePath = join("src", "graphql");
const rollupsBasePath = join("graphql", "rollups");
// FIXUP: to be replaced with new deployed API.
const explorerSchema =
process.env.NEXT_PUBLIC_PREVIEW_EXPLORER_API_URL ??
"https://api.cartesiscan.io/graphql";
//TODO: Evaluate if keep a schema locally is better than fetch externally.
const explorerSchema = join(".", "graphql", "schema.graphql");
const explorerAPIQueries = join(".", "graphql", "queries.graphql");
const rollupsBasePath = join("graphql", "rollups");
const rollupsSchema = join(".", rollupsBasePath, "schema.graphql");
const rollupsDocuments = join(".", rollupsBasePath, "queries.graphql");
const rollupsV2Schema = join(".", rollupsBasePath, "v2", "schema.graphql");
Expand Down
Loading

0 comments on commit 69bd2d8

Please sign in to comment.