Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Base Docs V2 #1784

Merged
merged 31 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
24d5aea
fresh slate
brendan-defi Feb 19, 2025
3062ba0
fresh import
brendan-defi Feb 19, 2025
a9474b4
linter settings
brendan-defi Feb 19, 2025
1c61d00
working local build
brendan-defi Feb 19, 2025
845d854
add file-loader
brendan-defi Feb 19, 2025
1da0856
linter fixes
brendan-defi Feb 19, 2025
a4c4c89
scratch updates
brendan-defi Feb 19, 2025
3bc2795
theme working, banner not working
brendan-defi Feb 19, 2025
5a56f0c
save
dschlabach Feb 19, 2025
f85d881
remove log
dschlabach Feb 19, 2025
b774f4c
fresh slate
brendan-defi Feb 19, 2025
95cc8e6
fresh import
brendan-defi Feb 19, 2025
9a2b73f
linter settings
brendan-defi Feb 19, 2025
e2101c5
working local build
brendan-defi Feb 19, 2025
9b484e9
add file-loader
brendan-defi Feb 19, 2025
c035c30
linter fixes
brendan-defi Feb 19, 2025
581e7fa
scratch updates
brendan-defi Feb 19, 2025
c4bedb5
theme working, banner not working
brendan-defi Feb 19, 2025
001f90f
save
dschlabach Feb 19, 2025
6e31de8
remove log
dschlabach Feb 19, 2025
38de9ea
fix cookie banner with polyfil
dschlabach Feb 19, 2025
1b4e7d4
cca draft
brendan-defi Feb 20, 2025
51743d9
logevent
brendan-defi Feb 20, 2025
035b8e2
Remove dead code
ericbrown99 Feb 19, 2025
ee8f1a5
Fix typo in quickstart
ericbrown99 Feb 19, 2025
28a009f
optimize large gif
brendan-defi Feb 20, 2025
55416b3
add csp
brendan-defi Feb 20, 2025
e021aaa
move ga to vocs config
brendan-defi Feb 20, 2025
b60c02a
QA fixes
ericbrown99 Feb 20, 2025
9bd0f57
Merge remote-tracking branch 'origin/eb/docs2-qa' into bf/docs2
brendan-defi Feb 20, 2025
677dea1
linter
brendan-defi Feb 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = {
],
rules: {
'import/no-extraneous-dependencies': 'off',
'import/extensions': 'off',
},
},
],
Expand All @@ -29,6 +30,7 @@ module.exports = {
'import/extensions': ['error', 'never'],
'react/destructuring-assignment': 'off',
'react/jsx-filename-extension': ['error', { extensions: ['.jsx', '.tsx', '.mdx'] }],
'react/react-in-jsx-scope': 'off',

// We utilize prop spreading
'react/jsx-props-no-spreading': 'off',
Expand Down
1 change: 0 additions & 1 deletion apps/base-docs/.env.example

This file was deleted.

1 change: 0 additions & 1 deletion apps/base-docs/.eslintignore

This file was deleted.

15 changes: 15 additions & 0 deletions apps/base-docs/.gitignore
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
1 change: 1 addition & 0 deletions apps/base-docs/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
10 changes: 0 additions & 10 deletions apps/base-docs/404.js

This file was deleted.

4 changes: 1 addition & 3 deletions apps/base-docs/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# Base Docs

This the Docusaurus app for the Base docs. You can run the dev server locally with `yarn workspace @app/base-docs dev`.
This is a [Vocs](https://vocs.dev) project bootstrapped with the Vocs CLI.
46 changes: 0 additions & 46 deletions apps/base-docs/algolia.json

This file was deleted.

73 changes: 73 additions & 0 deletions apps/base-docs/api/submitFeedback.ts
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' });
}
}
12 changes: 0 additions & 12 deletions apps/base-docs/assets/icons/caret-down-black.svg

This file was deleted.

12 changes: 0 additions & 12 deletions apps/base-docs/assets/icons/caret-down-white.svg

This file was deleted.

4 changes: 0 additions & 4 deletions apps/base-docs/assets/icons/collapse-black.svg

This file was deleted.

4 changes: 0 additions & 4 deletions apps/base-docs/assets/icons/collapse-white.svg

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 0 additions & 5 deletions apps/base-docs/babel.config.js

This file was deleted.

Loading