-
Notifications
You must be signed in to change notification settings - Fork 718
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix/spelling
- Loading branch information
Showing
1,679 changed files
with
76,752 additions
and
85,669 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,3 +73,5 @@ persisted_queries.json | |
|
||
# eslint | ||
.eslintcache | ||
|
||
.vercel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,16 @@ | ||
node_modules/ | ||
docs/dist/ | ||
docs/build/ | ||
./vocs.config.tsx.timestamp* | ||
|
||
# Yarn | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/releases | ||
!.yarn/plugins | ||
!.yarn/sdks | ||
!.yarn/versions | ||
|
||
# Environment variables | ||
.env*.local | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
18 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,60 @@ | ||
# Base Docs | ||
This is a [Vocs](https://vocs.dev) project bootstrapped with the Vocs CLI. | ||
|
||
This the Docusaurus app for the Base docs. You can run the dev server locally with `yarn workspace @app/base-docs dev`. | ||
# Creating New Docs | ||
|
||
You can create a new doc by adding a `.md` or `.mdx` file in | ||
`apps/base-docs/docs/pages`. | ||
|
||
The URL path for your doc will map to the file location. For instance, `bounty.mdx` | ||
is found within `chain/security`. So the URL for this link will be: | ||
`docs.base.org/chain/security/bounty`. | ||
|
||
|
||
# Running Docs Locally | ||
|
||
Follow these steps to run Base-Docs locally: | ||
|
||
1. Make sure you have installed all dependencies by running `yarn install` at | ||
the top-level of the monorepo | ||
|
||
2. Start the base-docs workspace with the following command: `yarn workspace @app/base-docs dev` | ||
|
||
|
||
# Building Docs Locally | ||
|
||
Follow these steps to build Base-Docs locally: | ||
|
||
1. Make sure you have installed all dependencies by running `yarn install` at | ||
the top-level of the monorepo | ||
|
||
2. Navigate into the base-docs service and then build the Vocs site: | ||
``` | ||
cd apps/base-docs | ||
yarn build | ||
``` | ||
|
||
3. Start the local build: `yarn preview` | ||
|
||
|
||
# Troubleshooting | ||
|
||
You may encounter an error of the form: | ||
``` | ||
TypeError: Cannot destructure property 'CookieBanner' of 'pkg' as it is undefined. | ||
``` | ||
|
||
To resolve this: | ||
1. navigate to `apps/base-docs/docs/contexts/CookieBannerWrapper.tsx` | ||
|
||
2. comment out the lines: | ||
``` | ||
import pkg from '@coinbase/cookie-banner'; | ||
const { CookieBanner } = pkg; | ||
``` | ||
|
||
3. add the following line: | ||
``` | ||
import { CookieBanner } from '@coinbase/cookie-banner'; | ||
``` | ||
|
||
NB: Do not commit this change, this is an issue in local dev only. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { google } from '@googleapis/sheets'; | ||
import type { VercelRequest, VercelResponse } from '@vercel/node'; | ||
|
||
// Initialize Google Sheets client | ||
const getGoogleSheetsClient = () => { | ||
try { | ||
const credentials = JSON.parse( | ||
Buffer.from(process.env.GOOGLE_SERVICE_ACCOUNT_KEY || '', 'base64').toString(), | ||
); | ||
|
||
const auth = new google.auth.GoogleAuth({ | ||
credentials, | ||
scopes: ['https://www.googleapis.com/auth/spreadsheets'], | ||
}); | ||
|
||
return google.sheets({ version: 'v4', auth }); | ||
} catch (error) { | ||
console.error('Failed to initialize Google Sheets client:', error); | ||
throw new Error('Failed to initialize Google Sheets client'); | ||
} | ||
}; | ||
|
||
type FeedbackPayload = { | ||
likeOrDislike: boolean; | ||
options: string[]; | ||
comment: string; | ||
url: string; | ||
ipAddress: string; | ||
timestamp: number; | ||
}; | ||
|
||
export default async function handler(req: VercelRequest, res: VercelResponse) { | ||
if (req.method !== 'POST') { | ||
return res.status(405).json({ error: 'Method not allowed' }); | ||
} | ||
|
||
try { | ||
const { likeOrDislike, options, comment, url, ipAddress, timestamp } = | ||
req.body as FeedbackPayload; | ||
|
||
const sheets = getGoogleSheetsClient(); | ||
const spreadsheetId = process.env.GOOGLE_SHEETS_ID; | ||
|
||
if (!spreadsheetId) { | ||
throw new Error('GOOGLE_SHEETS_ID environment variable is not set'); | ||
} | ||
|
||
// Format the row data | ||
const rowData = [ | ||
new Date(timestamp).toISOString(), | ||
url, | ||
ipAddress, | ||
likeOrDislike ? 'Like' : 'Dislike', | ||
options.join(', '), | ||
comment, | ||
]; | ||
|
||
// Append the row to the sheet | ||
await sheets.spreadsheets.values.append({ | ||
spreadsheetId, | ||
range: 'Sheet1!A:F', // Adjust range based on your sheet's structure | ||
valueInputOption: 'USER_ENTERED', | ||
requestBody: { | ||
values: [rowData], | ||
}, | ||
}); | ||
|
||
return res.status(200).json({ success: true }); | ||
} catch (error) { | ||
console.error('Error submitting feedback:', error); | ||
return res.status(500).json({ error: 'Failed to submit feedback' }); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.