Skip to content

Commit

Permalink
Sync public branch with internal repository (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffsmale90 authored Aug 23, 2024
2 parents 74b3275 + 9b72d55 commit 582a248
Show file tree
Hide file tree
Showing 15 changed files with 6,377 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NEXT_PUBLIC_PAYMASTER_API_KEY=
NEXT_PUBLIC_BUNDLER_URL=
54 changes: 54 additions & 0 deletions .github/workflows/push-to-public.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Push to Public Repo and Create PR

on:
push:
branches:
- public

jobs:
push_to_public:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
ref: public

- name: Set up SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: Configure Git Identity
run: |
git config --global user.name "Delegators"
git config --global user.email "hellogators@consensys.net"
- name: Checkout main branch from public repo
run: |
git remote add public-repo git@github.com:MetaMask/hello-gator.git
git fetch public-repo
git checkout -b public-main public-repo/main
- name: Restore from public branch
run: |
git restore --source=origin/public --worktree --staged .
- name: Commit changes to updates branch
run: |
git checkout -b updates
git commit -m "Sync public branch with internal repository"
- name: Push updates branch to public repo
run: |
git push public-repo updates
# the PR is on the public hello-gator repo, so we need to figure out how to get permissions

# - name: Create Pull Request
# run: |
# gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
# gh pr create --base public --head updates --repo MetaMask/hello-gator --title "Sync updates from internal public branch" --body "This PR syncs the public branch with the latest changes from the internal repository."
56 changes: 56 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Dependencies
node_modules
.pnp
.pnp.js

# Local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Testing
coverage

# Turbo
.turbo

# Vercel
.vercel

# Changesets
.changeset


# Build Outputs
.next/
out/
build
dist
cache

# Debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Misc
.DS_Store
*.pem
packages/*/.eslintcache

# yarn v3 (w/o zero-install)
# See: https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Yarn Integrity file
.yarn-integrity
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//nexus.eu-west-3.codefi.network/repository/npm-hosted/:_authToken=${NPM_AUTH_TOKEN}
@codefi:registry=https://nexus.eu-west-3.codefi.network/repository/npm-hosted/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.18.2
9 changes: 9 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
nodeLinker: node-modules

npmRegistries:
"https://nexus.eu-west-3.codefi.network/repository/npm-hosted/":
npmAuthToken: "${NPM_AUTH_TOKEN}"

npmScopes:
codefi:
npmRegistryServer: "https://nexus.eu-west-3.codefi.network/repository/npm-hosted/"
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,33 @@
# hello-gator
# Hello Gator 🐊

Easily get up-to-speed with (and integrate) the MetaMask Delegation Toolkit with this demonstration. It includes examples for all the core elements including Delegator Account (ERC-4337) creation, sending User Operations, and the Delegation lifecycle. Example code is provided utilising the DeleGator Core [Viem](https://viem.sh/) client.

Note: this template is also designed to complement the [documentation](https://docs.gator.metamask.io).

## Dependency Setup

> Note that the package `@codefi/delegator-core-viem` is currently hosted on a private registry. Please get in touch with the team for access at hellogators@consensys.io.
Once configured, you'll be able to install the dependencies (both private and public) via the following:

```sh
yarn install
```

## Configuration

Configuration is provided via environment variables, you may create a `.env` file in the root of Hello Gator, including the configuration parameters defined in `.env.example`.

Refer to the [documentation](https://docs.gator.metamask.io) for further information on configuration.

## Running

Start development environment:

```sh
yarn dev
```

## Support

Feel free to open an issue or contact the team directly at [hellogators@consensys.io](mailto:hellogators@consensys.io).
5 changes: 5 additions & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
4 changes: 4 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}

module.exports = nextConfig
33 changes: 33 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "hello-gator",
"private": true,
"version": "0.1.0",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@codefi/delegator-core-viem": "0.1.1",
"next": "13.5.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"viem": "latest",
"wagmi": "latest"
},
"devDependencies": {
"@types/node": "^20.7.2",
"@types/react": "^18.2.22",
"@types/react-dom": "^18.2.7",
"@wagmi/cli": "latest",
"bufferutil": "^4.0.7",
"encoding": "^0.1.13",
"lokijs": "^1.5.12",
"pino-pretty": "^10.2.0",
"supports-color": "^9.4.0",
"typescript": "^5.2.2",
"utf-8-validate": "^6.0.3"
},
"packageManager": "yarn@3.2.1"
}
21 changes: 21 additions & 0 deletions src/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
:root {
background-color: #181818;
color: rgba(255, 255, 255, 0.87);
color-scheme: light dark;
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
font-synthesis: none;
font-weight: 400;
line-height: 1.5;
text-rendering: optimizeLegibility;

-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
}

@media (prefers-color-scheme: light) {
:root {
background-color: #f8f8f8;
color: #181818;
}
}
21 changes: 21 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import './globals.css'
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import { type ReactNode } from 'react'

const inter = Inter({ subsets: ['latin'] })

export const metadata: Metadata = {
title: 'Hello Gator 🐊',
description: 'Minimum Viable Gator',
}

export default function RootLayout(props: { children: ReactNode }) {
return (
<html lang="en">
<body className={inter.className}>
{props.children}
</body>
</html>
)
}
Loading

0 comments on commit 582a248

Please sign in to comment.