Skip to content

Commit

Permalink
Feat: Add latest turboETH updates (#18)
Browse files Browse the repository at this point in the history
* feat: add template updates

* fix: remove .github from gitignore
  • Loading branch information
marthendalnunes authored Sep 12, 2023
1 parent fa38134 commit 73fce28
Show file tree
Hide file tree
Showing 690 changed files with 29,402 additions and 14,217 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
/tmp
node_modules
oclif.manifest.json
.github
.vscode
2 changes: 1 addition & 1 deletion src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default class Core extends Command {
ux.action.start('Installing packages. This might take a few minutes')

if (!skipInstall) {
const installArgs = ['install', packageManager === 'npm' ? '--quiet' : '--silent', '--legacy-peer-deps']
const installArgs = ['install', packageManager === 'npm' ? '--quiet --legacy-peer-deps' : '--silent']
try {
await execa(packageManager, installArgs, { cwd: projectDir, env: { ...process.env, NODE_ENV: 'development' } })
} catch (error) {
Expand Down
124 changes: 82 additions & 42 deletions src/config/integrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Integrations } from '../types'
import path from 'node:path'
import { z } from 'zod'

const indexPagePath = path.join('app', '(general)', 'page.tsx')
const exampleDemosPath = path.join('components', 'shared', 'example-demos.tsx')
const dataConfigPath = path.join('data', 'turbo-integrations.ts')

export const integrationOptions: Integrations = {
Expand All @@ -12,14 +12,14 @@ export const integrationOptions: Integrations = {
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*erc20: {\s*name: 'ERC20',[\S\s]*?imgDark: '\/integrations\/erc20-icon\.png',\s*},/g],
regexList: [/\n\s*erc20: {\s*name: "ERC20",[\S\s]*?imgDark: "\/integrations\/erc20\.png",\s*},/g],
},
{
dependencyPath: indexPagePath,
dependencyPath: exampleDemosPath,
type: 'snippet',
regexList: [
/\nimport \{ ERC20Decimals, ERC20Name, ERC20Symbol \} from '@\/integrations\/erc20\/components\/erc20-read'/g,
/\n\s*{\s*title: 'ERC20 WAGMI',[\s\S]*?<\/LinkComponent>\s*<\/div>\s*\),\s*},/g,
/\nimport \{\n {2}ERC20Decimals,\n {2}ERC20Name,\n {2}ERC20Symbol,\n\} from "@\/integrations\/erc20\/components\/erc20-read"/g,
/\n\s*{\s*title: "ERC20 WAGMI",[\s\S]*?<\/Link>\s*<\/div>\s*\),\s*},/g,
],
},
],
Expand All @@ -30,28 +30,38 @@ export const integrationOptions: Integrations = {
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*erc721: \{\s*name: 'ERC721',[\s\S]*?imgDark: '\/integrations\/erc721-icon.png',\s*\},/g],
regexList: [/\n\s*erc721: \{\s*name: "ERC721",[\s\S]*?imgDark: "\/integrations\/erc721-icon.png",\s*\},/g],
},
{
dependencyPath: indexPagePath,
dependencyPath: exampleDemosPath,
type: 'snippet',
regexList: [
/\nimport { ERC721TokenUriImage, ERC721TokenUriName } from '@\/integrations\/erc721'/g,
/\n\s*{\s*title: 'ERC721 WAGMI',[\s\S]*?<\/LinkComponent>\s*<\/div>\s*\),\s*},/g,
/\nimport { ERC721TokenUriImage, ERC721TokenUriName } from "@\/integrations\/erc721"/g,
/\n\s*{\s*title: "ERC721 WAGMI",[\s\S]*?<\/Link>\s*<\/div>\s*\),\s*},/g,
],
},
],
},
erc1155: {
name: 'ERC1155',
pageDependencies: [
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*erc1155: {\s*name: "ERC1155",[\S\s]*?imgDark: "\/integrations\/erc1155-icon\.png",\s*},/g],
},
],
},
disco: {
name: 'Disco',
pageDependencies: [
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*disco: \{\s*name: 'Disco',[\s\S]*?imgDark: '\/integrations\/disco.jpeg',\s*\},/g],
regexList: [/\n\s*disco: \{\s*name: "Disco",[\s\S]*?imgDark: "\/integrations\/discoDark\.png",\s*\},/g],
},
{
dependencyPath: indexPagePath,
dependencyPath: exampleDemosPath,
type: 'snippet',
regexList: [/\n\s*{\s*title: turboIntegrations\.disco\.name,[\S\s]*?href: turboIntegrations\.disco\.href,[\S\s]*?<\/div>\s*\),\s*},/g],
},
Expand All @@ -76,10 +86,10 @@ export const integrationOptions: Integrations = {
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*etherscan: \{\s*name: 'Etherscan',[\s\S]*?imgDark: '\/integrations\/etherscan-dark.svg',\s*\},/g],
regexList: [/\n\s*etherscan: \{\s*name: "Etherscan",[\s\S]*?imgDark: "\/integrations\/etherscan-dark.svg",\s*\},/g],
},
{
dependencyPath: indexPagePath,
dependencyPath: exampleDemosPath,
type: 'snippet',
regexList: [/\n\s*{\s*title: turboIntegrations\.etherscan\.name,[\s\S]*?<\/IsDarkTheme>\s*<\/div>\s*\),\s*},/g],
},
Expand All @@ -90,7 +100,7 @@ export const integrationOptions: Integrations = {
{
dependencyPath: path.join('config', 'menu-dashboard.ts'),
type: 'snippet',
regexList: [/\n\s*{\s*label: 'Transactions',[\s\S]*?},/g],
regexList: [/\n\s*{\s*label: "Transactions",[\s\S]*?},/g],
},
],
// Don't require Etherscan API keys since they are not required to make API requests
Expand Down Expand Up @@ -119,10 +129,10 @@ export const integrationOptions: Integrations = {
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*litProtocol: \{\s*name: 'Lit Protocol',[\s\S]*?imgDark: '\/integrations\/lit-protocol.png',\s*\},/g],
regexList: [/\n\s*litProtocol: \{\s*name: "Lit Protocol",[\s\S]*?imgDark: "\/integrations\/lit-protocol.png",\s*\},/g],
},
{
dependencyPath: indexPagePath,
dependencyPath: exampleDemosPath,
type: 'snippet',
regexList: [/\n\s*{\s*title: turboIntegrations\.litProtocol\.name,[\s\S]*?<\/IsDarkTheme>\s*<\/div>\s*\),\s*},/g],
},
Expand All @@ -134,10 +144,10 @@ export const integrationOptions: Integrations = {
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*openai: \{\s*name: 'OpenAI',[\s\S]*?imgDark: '\/integrations\/openai-dark.svg',\s*\},/g],
regexList: [/\n\s*openai: \{\s*name: "OpenAI",[\s\S]*?imgDark: "\/integrations\/openai-dark.svg",\s*\},/g],
},
{
dependencyPath: indexPagePath,
dependencyPath: exampleDemosPath,
type: 'snippet',
regexList: [/\n\s*{\s*title: turboIntegrations\.openai\.name,[\s\S]*?<\/IsDarkTheme>\s*<\/div>\s*\),\s*},/g],
},
Expand All @@ -162,10 +172,10 @@ export const integrationOptions: Integrations = {
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*pooltogether_v4: \{\s*name: 'PoolTogether',[\s\S]*?imgDark: '\/integrations\/pooltogether.svg',\s*\},/g],
regexList: [/\n\s*pooltogether_v4: \{\s*name: "PoolTogether",[\s\S]*?imgDark: "\/integrations\/pooltogether.svg",\s*\},/g],
},
{
dependencyPath: indexPagePath,
dependencyPath: exampleDemosPath,
type: 'snippet',
regexList: [/\n\s*{\s*title: turboIntegrations\.pooltogether_v4\.name,[\s\S]*?<\/IsDarkTheme>\s*<\/div>\s*\),\s*},/g],
},
Expand All @@ -177,10 +187,10 @@ export const integrationOptions: Integrations = {
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*sessionKeys: \{\s*name: 'Session Keys',[\s\S]*?imgDark: '\/integrations\/session-keys.png',\s*\},/g],
regexList: [/\n\s*sessionKeys: \{\s*name: "Session Keys",[\s\S]*?imgDark: "\/integrations\/session-keys.png",\s*\},/g],
},
{
dependencyPath: indexPagePath,
dependencyPath: exampleDemosPath,
type: 'snippet',
regexList: [/\n\s*{\s*title: turboIntegrations\.sessionKeys\.name,[\s\S]*?<\/IsDarkTheme>\s*<\/div>\s*\),\s*},/g],
},
Expand All @@ -192,10 +202,10 @@ export const integrationOptions: Integrations = {
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*connext: \{\s*name: 'Connext',[\s\S]*?imgDark: '\/integrations\/connext.png',\s*\},/g],
regexList: [/\n\s*connext: \{\s*name: "Connext",[\s\S]*?imgDark: "\/integrations\/connext.png",\s*\},/g],
},
{
dependencyPath: indexPagePath,
dependencyPath: exampleDemosPath,
type: 'snippet',
regexList: [/\n\s*{\s*title: turboIntegrations\.connext\.name,[\s\S]*?<\/IsDarkTheme>\s*<\/div>\s*\),\s*},/g],
},
Expand All @@ -207,10 +217,10 @@ export const integrationOptions: Integrations = {
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*livepeer: \{\s*name: 'Livepeer',[\s\S]*?imgDark: '\/integrations\/livepeer.svg',\s*\},/g],
regexList: [/\n\s*livepeer: \{\s*name: "Livepeer",[\s\S]*?imgDark: "\/integrations\/livepeer.svg",\s*\},/g],
},
{
dependencyPath: indexPagePath,
dependencyPath: exampleDemosPath,
type: 'snippet',
regexList: [/\n\s*{\s*title: turboIntegrations\.livepeer\.name,[\s\S]*?<\/IsDarkTheme>\s*<\/div>\s*\),\s*},/g],
},
Expand All @@ -235,10 +245,10 @@ export const integrationOptions: Integrations = {
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*gelato: \{\s*name: 'Gelato',[\s\S]*?imgDark: '\/integrations\/gelato-light.svg',\s*\},/g],
regexList: [/\n\s*gelato: \{\s*name: "Gelato",[\s\S]*?imgDark: "\/integrations\/gelato-light.svg",\s*\},/g],
},
{
dependencyPath: indexPagePath,
dependencyPath: exampleDemosPath,
type: 'snippet',
regexList: [/\n\s*{\s*title: turboIntegrations\.gelato\.name,[\s\S]*?<\/IsDarkTheme>\s*<\/div>\s*\),\s*},/g],
},
Expand All @@ -250,10 +260,10 @@ export const integrationOptions: Integrations = {
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*push_protocol: \{\s*name: 'Push Protocol',[\s\S]*?imgDark: '\/integrations\/push.svg',\s*\},/g],
regexList: [/\n\s*push_protocol: \{\s*name: "Push Protocol",[\s\S]*?imgDark: "\/integrations\/push.svg",\s*\},/g],
},
{
dependencyPath: indexPagePath,
dependencyPath: exampleDemosPath,
type: 'snippet',
regexList: [/\n\s*{\s*title: turboIntegrations\.push_protocol\.name,[\s\S]*?<\/IsDarkTheme>\s*<\/div>\s*\),\s*},/g],
},
Expand All @@ -265,12 +275,12 @@ export const integrationOptions: Integrations = {
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*moralis: \{\s*name: 'Moralis',[\s\S]*?imgDark: '\/integrations\/moralis.png',\s*\},/g],
regexList: [/\n\s*moralis: \{\s*name: "Moralis",[\s\S]*?imgDark: "\/integrations\/moralis.png",\s*\},/g],
},
{
dependencyPath: indexPagePath,
dependencyPath: exampleDemosPath,
type: 'snippet',
regexList: [/\n\s*{\s*title: turboIntegrations\.moralis\.name,[\s\S]*?<\/IsDarkTheme>\s*<\/div>\s*\),\s*},/g],
regexList: [/\n\s*{\s*title: turboIntegrations\.moralis\.name,[\s\S]*?\/>\s*<\/div>\s*\),\s*},/g],
},
],
env: {
Expand All @@ -293,12 +303,12 @@ export const integrationOptions: Integrations = {
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*aave: \{\s*name: 'Aave',[\s\S]*?imgDark: '\/integrations\/aave.png',\s*\},/g],
regexList: [/\n\s*aave: \{\s*name: "Aave",[\s\S]*?imgDark: "\/integrations\/aave.png",\s*\},/g],
},
{
dependencyPath: indexPagePath,
dependencyPath: exampleDemosPath,
type: 'snippet',
regexList: [/\n\s*{\s*title: turboIntegrations\.aave\.name,[\s\S]*?<\/IsDarkTheme>\s*<\/div>\s*\),\s*},/g],
regexList: [/\n\s*{\s*title: turboIntegrations\.aave\.name,[\s\S]*?\/>\s*<\/div>\s*\),\s*},/g],
},
],
},
Expand All @@ -308,12 +318,42 @@ export const integrationOptions: Integrations = {
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*arweave: \{\s*name: 'Arweave',[\s\S]*?imgDark: '\/integrations\/arweave-dark.png',\s*\},/g],
regexList: [/\n\s*arweave: \{\s*name: "Arweave",[\s\S]*?imgDark: "\/integrations\/arweave-dark.png",\s*\},/g],
},
{
dependencyPath: exampleDemosPath,
type: 'snippet',
regexList: [/\n\s*{\s*title: turboIntegrations\.arweave\.name,[\s\S]*?\/>\s*<\/div>\s*\),\s*},/g],
},
],
},
'gitcoin-passport': {
name: 'Gitcoin Passport',
pageDependencies: [
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*gitcoinPassport: \{\s*name: "Gitcoin Passport",[\s\S]*?imgDark: "\/integrations\/gitcoin-passport.svg",\s*\},/g],
},
{
dependencyPath: exampleDemosPath,
type: 'snippet',
regexList: [/\n\s*{\s*title: turboIntegrations\.gitcoinPassport\.name,[\s\S]*?\/>\s*<\/div>\s*\),\s*},/g],
},
],
},
'lens-protocol': {
name: 'Lens Protocol',
pageDependencies: [
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*lensProtocol: \{\s*name: "Lens Protocol",[\s\S]*?imgDark: "\/integrations\/lensprotocol-dark.svg",\s*\},/g],
},
{
dependencyPath: indexPagePath,
dependencyPath: exampleDemosPath,
type: 'snippet',
regexList: [/\n\s*{\s*title: turboIntegrations\.arweave\.name,[\s\S]*?<\/IsDarkTheme>\s*<\/div>\s*\),\s*},/g],
regexList: [/\n\s*{\s*title: turboIntegrations\.lensProtocol\.name,[\s\S]*?\/>\s*<\/div>\s*\),\s*},/g],
},
],
},
Expand All @@ -323,12 +363,12 @@ export const integrationOptions: Integrations = {
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*starter: \{\s*name: 'Starter Template',[\s\S]*?imgDark: '\/logo-dark.png',\s*\},/g],
regexList: [/\n\s*starter: \{\s*name: "Starter Template",[\s\S]*?imgDark: "\/logo-gradient\.png",\s*\},/g],
},
{
dependencyPath: indexPagePath,
dependencyPath: exampleDemosPath,
type: 'snippet',
regexList: [/\n\s*{\s*title: turboIntegrations\.starter\.name,[\s\S]*?<\/IsDarkTheme>\s*<\/div>\s*\),\s*},/g],
regexList: [/\n\s*{\s*title: turboIntegrations\.starter\.name,[\s\S]*?\/>\s*<\/div>\s*\),\s*},/g],
},
],
},
Expand Down
3 changes: 3 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export type EnvVariable = {

export type AvailableIntegrations =
| 'erc20'
| 'erc1155'
| 'erc721'
| 'disco'
| 'etherscan'
Expand All @@ -75,6 +76,8 @@ export type AvailableIntegrations =
| 'moralis'
| 'aave'
| 'arweave'
| 'gitcoin-passport'
| 'lens-protocol'
| 'starter'

export type Integrations = Record<AvailableIntegrations, Integration>
Expand Down
4 changes: 4 additions & 0 deletions template/base/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@ OPENAI_API_KEY=

# Moralis API Key: https://admin.moralis.io/settings#secret-keys
MORALIS_API_KEY=

# Gitcoin Passport Scorer ID and API key: https://scorer.gitcoin.co/#/dashboard/scorer
GITCOIN_PASSPORT_SCORER_ID=
GITCOIN_PASSPORT_API_KEY=
1 change: 1 addition & 0 deletions template/base/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
**/components/shared/table/**
**/generated
.next/**
tailwind.config.js
38 changes: 38 additions & 0 deletions template/base/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/* eslint-env node */
module.exports = {
root: true,
extends: [
"next/core-web-vitals",
"eslint:recommended",
"prettier",
"plugin:tailwindcss/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
],
plugins: ["@typescript-eslint", "tailwindcss"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
},
rules: {
"@next/next/no-html-link-for-pages": "off",
"@next/next/no-img-element": "off", // We currently not using next/image because it isn't supported with SSG mode
"react-hooks/exhaustive-deps": "off", // Incorrectly report needed dependency with Next.js router
"tailwindcss/no-custom-classname": "error",
"tailwindcss/classnames-order": "error",
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"no-unused-vars": "off",
},
settings: {
tailwindcss: {
callees: ["cn"],
config: "tailwind.config.js",
},
next: {
rootDir: true,
},
},
}
Loading

0 comments on commit 73fce28

Please sign in to comment.