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

Add solidity integration docs #3486

Merged
merged 2 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .github/workflows/assets/root-dir.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions .github/workflows/solidity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Configuring a New Vercel Project for Solidity Documentation

Since we're using Vercel via github actions rather than the UI, configuring a new project requires a little extra work.

1. Click "Add New" on the home screen.
2. The project creation page will force you to import a project from github. Select any non-private repo, as this will be disconnected later.
![create project](./assets/vercel-create-project.png)me
Comment on lines +6 to +7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Clarify repository selection guidance

The instruction to "select any non-private repo" could be improved by recommending the use of a temporary public repository or a template specifically created for this purpose.

-2. The project creation page will force you to import a project from github. Select any non-private repo, as this will be disconnected later.
+2. The project creation page will force you to import a project from GitHub. Create and use a temporary public repository (or use our template at `example-repo-url`) for this step, as it will be disconnected later.

Committable suggestion skipped: line range outside the PR's diff.

3. Go to the settings->git and disconnect the repo.
![disconnect repo](./assets/vercel-git-page.png)
4. Get the project id from vercel.
![project id](./assets/vercel-project-id.png)
5. Set the root directory to the path in the repo where your package is located + docs
![root directory](./assets/root-dir.png)
Comment on lines +7 to +13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Missing images referenced in the documentation

The following images are referenced in the documentation but are missing from the repository:

  • ./assets/vercel-create-project.png
  • ./assets/vercel-git-page.png
  • ./assets/vercel-project-id.png
  • ./assets/root-dir.png
🔗 Analysis chain

Verify image references in the documentation

Let's verify that all referenced images exist in the correct location.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if all referenced images exist
for img in "vercel-create-project.png" "vercel-git-page.png" "vercel-project-id.png" "root-dir.png"; do
  if ! [ -f ".github/workflows/assets/$img" ]; then
    echo "Missing image: $img"
  fi
done

Length of output: 640


Script:

#!/bin/bash
# Check if assets directory exists
if [ -d ".github/workflows/assets" ]; then
  echo "Assets directory exists"
else
  echo "Assets directory does not exist"
fi

# Search for the image files anywhere in the repository
echo -e "\nSearching for images:"
fd -e png "vercel-create-project|vercel-git-page|vercel-project-id|root-dir"

Length of output: 232

6. [Add this variable as a secret to github actions](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository). As a convention this should be called `VERCEL_[PACKAGE_NAME]_DOCS_PROJECT_ID` (e.g. `VERCEL_CONTRACT_DOCS_PROJECT_ID` for contracts-core).
7. Add the project id to the PROJECT_IDS mapping in [solidity.yml](./solidity.yml) under the "Get Project ID" step.

Comment on lines +15 to +16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add example of PROJECT_IDS mapping format

Include an example of the expected format in the solidity.yml file to make it clearer for users.

 7. Add the project id to the PROJECT_IDS mapping in [solidity.yml](./solidity.yml) under the "Get Project ID" step.
+
+   Example format in solidity.yml:
+   ```yaml
+   PROJECT_IDS:
+     contracts-core: ${{ secrets.VERCEL_CONTRACT_DOCS_PROJECT_ID }}
+     your-package: ${{ secrets.VERCEL_YOUR_PACKAGE_DOCS_PROJECT_ID }}
+   ```

Now you're done. Any time you push to the main branch, the Solidity documentation will be deployed to vercel.
Loading