diff --git a/.github/workflows/website-build.yml b/.github/workflows/tutorial-build.yml similarity index 89% rename from .github/workflows/website-build.yml rename to .github/workflows/tutorial-build.yml index ef459d04..45d1c14d 100644 --- a/.github/workflows/website-build.yml +++ b/.github/workflows/tutorial-build.yml @@ -1,4 +1,4 @@ -name: Build website +name: Build tutorial on: pull_request: @@ -13,12 +13,12 @@ on: - release/* jobs: - build-website: + build-tutorial: runs-on: ubuntu-latest defaults: run: - working-directory: website + working-directory: tutorial steps: - name: Check out the repo @@ -57,5 +57,5 @@ jobs: - name: Add build summary run: | - echo "## Website build result" >> $GITHUB_STEP_SUMMARY + echo "## Tutorial build result" >> $GITHUB_STEP_SUMMARY echo "✅ Passed" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/tutorial-deploy.yml b/.github/workflows/tutorial-deploy.yml new file mode 100644 index 00000000..d2b80cbb --- /dev/null +++ b/.github/workflows/tutorial-deploy.yml @@ -0,0 +1,83 @@ +name: Deploy tutorial + +on: + push: + branches: ["dev"] + paths: + - tutorial/** + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + deploy-tutorial: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + + defaults: + run: + working-directory: tutorial + + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Install Pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + run_install: false + + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: pnpm + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build + run: pnpm run build + env: + VITE_WALLETCONNECT_PROJECT_ID: ${{ secrets.VITE_WALLETCONNECT_PROJECT_ID }} + VITE_INFURA_API_KEY: ${{ secrets.VITE_INFURA_API_KEY }} + + - name: Setup Pages + uses: actions/configure-pages@v3 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: "./tutorial/dist" + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 + + - name: Add tutorial deployment summary + run: | + echo "## Tutorial deployment result" >> $GITHUB_STEP_SUMMARY + echo "✅ Passed" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/website-deploy.yml b/.github/workflows/website-deploy.yml index af9bfb04..3d921fdb 100644 --- a/.github/workflows/website-deploy.yml +++ b/.github/workflows/website-deploy.yml @@ -31,47 +31,13 @@ jobs: - name: Check out the repo uses: actions/checkout@v4 - - name: Install Pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 - run_install: false - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: pnpm - - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - uses: actions/cache@v3 - name: Setup pnpm cache - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Build - run: pnpm run build - env: - VITE_WALLETCONNECT_PROJECT_ID: ${{ secrets.VITE_WALLETCONNECT_PROJECT_ID }} - VITE_INFURA_API_KEY: ${{ secrets.VITE_INFURA_API_KEY }} - - name: Setup Pages uses: actions/configure-pages@v3 - name: Upload artifact uses: actions/upload-pages-artifact@v2 with: - path: "./website/dist" + path: "./website/index.html" - name: Deploy to GitHub Pages id: deployment diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7a57b450..4e6fb677 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -558,7 +558,7 @@ importers: specifier: 0.6.0 version: 0.6.0 - website: + tutorial: dependencies: '@fortawesome/fontawesome-svg-core': specifier: ^6.4.2 @@ -614,22 +614,22 @@ importers: version: 18.2.15 '@typescript-eslint/eslint-plugin': specifier: ^6.10.0 - version: 6.10.0(@typescript-eslint/parser@6.10.0)(eslint@8.53.0)(typescript@5.2.2) + version: 6.13.1(@typescript-eslint/parser@6.13.1)(eslint@8.55.0)(typescript@5.2.2) '@typescript-eslint/parser': specifier: ^6.10.0 - version: 6.10.0(eslint@8.53.0)(typescript@5.2.2) + version: 6.13.1(eslint@8.55.0)(typescript@5.2.2) '@vitejs/plugin-react': specifier: ^4.1.1 version: 4.2.0(vite@4.5.2) eslint: specifier: ^8.53.0 - version: 8.53.0 + version: 8.55.0 eslint-plugin-react-hooks: specifier: ^4.6.0 - version: 4.6.0(eslint@8.53.0) + version: 4.6.0(eslint@8.55.0) eslint-plugin-react-refresh: specifier: ^0.4.4 - version: 0.4.4(eslint@8.53.0) + version: 0.4.4(eslint@8.55.0) typescript: specifier: ^5.2.2 version: 5.2.2 @@ -640,6 +640,12 @@ importers: specifier: ^0.9.1 version: 0.9.1(vite@4.5.2) + website: + devDependencies: + eslint-plugin-html: + specifier: ^8.0.0 + version: 8.0.0 + packages: /@aashutoshrathi/word-wrap@1.2.6: @@ -1070,14 +1076,6 @@ packages: dependencies: '@babel/types': 7.23.4 - /@babel/parser@7.23.4: - resolution: {integrity: sha512-vf3Xna6UEprW+7t6EtOmFpHNAuxw3xqPZghy+brsnusscJRW5BMUzzHZc5ICjULee81WeUV2jjakG09MDglJXQ==} - engines: {node: '>=6.0.0'} - hasBin: true - dependencies: - '@babel/types': 7.23.4 - dev: true - /@babel/parser@7.23.6: resolution: {integrity: sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==} engines: {node: '>=6.0.0'} @@ -9547,7 +9545,7 @@ packages: /@types/babel__core@7.20.5: resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} dependencies: - '@babel/parser': 7.23.4 + '@babel/parser': 7.23.6 '@babel/types': 7.23.4 '@types/babel__generator': 7.6.6 '@types/babel__template': 7.4.3 @@ -14887,6 +14885,14 @@ packages: entities: 2.2.0 dev: true + /dom-serializer@2.0.0: + resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==} + dependencies: + domelementtype: 2.3.0 + domhandler: 5.0.3 + entities: 4.5.0 + dev: true + /domain-browser@1.2.0: resolution: {integrity: sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==} engines: {node: '>=0.4', npm: '>=1.2'} @@ -14908,6 +14914,13 @@ packages: domelementtype: 2.3.0 dev: true + /domhandler@5.0.3: + resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==} + engines: {node: '>= 4'} + dependencies: + domelementtype: 2.3.0 + dev: true + /domutils@2.8.0: resolution: {integrity: sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==} dependencies: @@ -14916,6 +14929,14 @@ packages: domhandler: 4.3.1 dev: true + /domutils@3.1.0: + resolution: {integrity: sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==} + dependencies: + dom-serializer: 2.0.0 + domelementtype: 2.3.0 + domhandler: 5.0.3 + dev: true + /dot-case@3.0.4: resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==} dependencies: @@ -15568,6 +15589,13 @@ packages: string-natural-compare: 3.0.1 dev: true + /eslint-plugin-html@8.0.0: + resolution: {integrity: sha512-NINLBAXM3mLa3k5Ezr/kNLHAJJwbot6lS7Ro+SUftDw4cA51KMmcDuCf98GP6Q6kTVPY1hIggzskxAdxfUPXSA==} + engines: {node: '>=16.0.0'} + dependencies: + htmlparser2: 9.1.0 + dev: true + /eslint-plugin-import@2.26.0(@typescript-eslint/parser@5.62.0)(eslint@8.55.0): resolution: {integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==} engines: {node: '>=4'} @@ -15799,15 +15827,6 @@ packages: eslint: 8.55.0 dev: true - /eslint-plugin-react-hooks@4.6.0(eslint@8.53.0): - resolution: {integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==} - engines: {node: '>=10'} - peerDependencies: - eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 - dependencies: - eslint: 8.53.0 - dev: true - /eslint-plugin-react-hooks@4.6.0(eslint@8.55.0): resolution: {integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==} engines: {node: '>=10'} @@ -15817,14 +15836,6 @@ packages: eslint: 8.55.0 dev: true - /eslint-plugin-react-refresh@0.4.4(eslint@8.53.0): - resolution: {integrity: sha512-eD83+65e8YPVg6603Om2iCIwcQJf/y7++MWm4tACtEswFLYMwxwVWAfwN+e19f5Ad/FOyyNg9Dfi5lXhH3Y3rA==} - peerDependencies: - eslint: '>=7' - dependencies: - eslint: 8.53.0 - dev: true - /eslint-plugin-react-refresh@0.4.4(eslint@8.55.0): resolution: {integrity: sha512-eD83+65e8YPVg6603Om2iCIwcQJf/y7++MWm4tACtEswFLYMwxwVWAfwN+e19f5Ad/FOyyNg9Dfi5lXhH3Y3rA==} peerDependencies: @@ -18508,6 +18519,15 @@ packages: entities: 2.2.0 dev: true + /htmlparser2@9.1.0: + resolution: {integrity: sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==} + dependencies: + domelementtype: 2.3.0 + domhandler: 5.0.3 + domutils: 3.1.0 + entities: 4.5.0 + dev: true + /http-basic@8.1.3: resolution: {integrity: sha512-/EcDMwJZh3mABI2NhGfHOGOeOZITqfkEO4p/xK+l3NpyncIHUQBoMvCSF/b5GqvKtySC2srL/GGG3+EtlqlmCw==} engines: {node: '>=6.0.0'} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 87a901e9..fad68208 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -5,4 +5,5 @@ packages: - 'sdk' - 'snap/packages/**' - 'subgraph' + - 'tutorial' - 'website' diff --git a/website/.env.example b/tutorial/.env.example similarity index 58% rename from website/.env.example rename to tutorial/.env.example index 555b3a53..f890face 100644 --- a/website/.env.example +++ b/tutorial/.env.example @@ -1,2 +1 @@ VITE_WALLETCONNECT_PROJECT_ID=XXX -VITE_INFURA_API_KEY=XXX diff --git a/tutorial/.eslintrc.cjs b/tutorial/.eslintrc.cjs new file mode 100644 index 00000000..d6c95379 --- /dev/null +++ b/tutorial/.eslintrc.cjs @@ -0,0 +1,18 @@ +module.exports = { + root: true, + env: { browser: true, es2020: true }, + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:react-hooks/recommended', + ], + ignorePatterns: ['dist', '.eslintrc.cjs'], + parser: '@typescript-eslint/parser', + plugins: ['react-refresh'], + rules: { + 'react-refresh/only-export-components': [ + 'warn', + { allowConstantExport: true }, + ], + }, +} diff --git a/tutorial/README.md b/tutorial/README.md new file mode 100644 index 00000000..2e5968b6 --- /dev/null +++ b/tutorial/README.md @@ -0,0 +1,12 @@ +# Verax Attestation Registry - Tutorial + +This package manages the tutorial of Verax Attestation Registry, hosted at +[tutorial.examples.ver.ax](https://tutorial.examples.ver.ax). + +## Getting Started + +### Launch in development mode + +```bash +pnpm run dev +``` diff --git a/tutorial/index.html b/tutorial/index.html new file mode 100644 index 00000000..a6ed5240 --- /dev/null +++ b/tutorial/index.html @@ -0,0 +1,13 @@ + + + + + + + Verax | Tutorial + + +
+ + + diff --git a/tutorial/package.json b/tutorial/package.json new file mode 100644 index 00000000..ff90a1dc --- /dev/null +++ b/tutorial/package.json @@ -0,0 +1,56 @@ +{ + "name": "verax-tutorial", + "version": "0.0.1", + "description": "Verax Attestation Registry tutorial", + "keywords": [ + "linea-attestation-registry", + "blockchain", + "attestation", + "ethereum", + "foundry", + "smart-contracts", + "solidity" + ], + "repository": "github.com/Consensys/linea-attestation-registry", + "license": "MIT", + "author": "Consensys", + "type": "module", + "scripts": { + "build": "tsc && vite build", + "build:netlify": "pnpm run build && pnpm run redirect", + "dev": "vite", + "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", + "preview": "vite preview", + "redirect": "touch dist/_redirects && echo '/* /index.html 200' >> dist/_redirects" + }, + "dependencies": { + "@fortawesome/fontawesome-svg-core": "^6.4.2", + "@fortawesome/free-brands-svg-icons": "^6.4.2", + "@fortawesome/free-solid-svg-icons": "^6.4.2", + "@fortawesome/react-fontawesome": "^0.2.0", + "@lens-protocol/widgets-react": "^2.1.0", + "@verax-attestation-registry/verax-sdk": "1.1.1", + "@wagmi/core": "^1.4.7", + "@web3modal/wagmi": "^3.5.0", + "axios": "^1.6.1", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-json-view": "^1.21.3", + "react-router-dom": "^6.19.0", + "viem": "^1.18.9", + "wagmi": "^1.4.6" + }, + "devDependencies": { + "@types/react": "^18.2.37", + "@types/react-dom": "^18.2.15", + "@typescript-eslint/eslint-plugin": "^6.10.0", + "@typescript-eslint/parser": "^6.10.0", + "@vitejs/plugin-react": "^4.1.1", + "eslint": "^8.53.0", + "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-react-refresh": "^0.4.4", + "typescript": "^5.2.2", + "vite": "^4.5.2", + "vite-plugin-radar": "^0.9.1" + } +} diff --git a/website/src/App.css b/tutorial/src/App.css similarity index 100% rename from website/src/App.css rename to tutorial/src/App.css diff --git a/website/src/App.tsx b/tutorial/src/App.tsx similarity index 71% rename from website/src/App.tsx rename to tutorial/src/App.tsx index f256a6c4..a9a175c2 100644 --- a/website/src/App.tsx +++ b/tutorial/src/App.tsx @@ -1,9 +1,8 @@ import "./App.css"; import { HashRouter, Route, Routes } from "react-router-dom"; -import Home from "./pages/Home.tsx"; import Navbar from "./components/Navbar.tsx"; import Footer from "./components/Footer.tsx"; -import Tutorials from "./pages/Tutorials.tsx"; +import Home from "./pages/Home.tsx"; function App() { return ( @@ -14,8 +13,7 @@ function App() {
- } /> - } /> + } />