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

Improve repository structure and documentation #988

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
"import/no-anonymous-default-export": "off"
}
}

// This configuration file extends the Next.js core web vitals rules.
// It also disables the rule for no HTML links for pages and the rule for no anonymous default exports.
15 changes: 15 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# .github Directory

This directory contains configuration files and templates for GitHub-specific features and workflows.

## Purpose and Usage

The files within the `.github` directory are used to manage various aspects of the repository, such as code ownership, pull request templates, dependency updates, and continuous integration workflows.

## Files

- `.github/CODEOWNERS`: Defines the code owners for the repository. Code owners are automatically requested for review when someone opens a pull request that modifies code they own.
- `.github/pull_request_template.md`: Provides a template for pull request descriptions. This helps ensure that pull requests contain all the necessary information for reviewers.
- `.github/renovate.json`: Configuration file for Renovate, a tool that automates dependency updates. This file defines the rules and settings for how dependencies should be updated.
- `.github/workflows/publish-template.yaml`: GitHub Actions workflow for publishing templates. This workflow automates the process of publishing templates to the repository.
- `.github/workflows/release.yml`: GitHub Actions workflow for releasing new versions of the repository. This workflow automates the process of creating and publishing releases.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,34 @@ We're going to be shipping new examples weekly. Stay tuned!
- [Solutions](/solutions) – Demos, Architectures, and Best Practices
- [Starter](/starter) – Fully functional applications that encompass an idea as a robust starting point.

## Purpose and Usage

This repository contains a collection of examples and solutions to help you build robust and scalable applications using Vercel. The examples cover various use cases, including Edge Functions, Edge Middleware, and more. You can use these examples as a starting point for your own projects or as a reference to learn best practices and patterns.

## Repository Structure

The repository is organized into several directories, each containing examples and solutions for different use cases. Here is an overview of the main directories:

- `edge-functions/`: Examples of high-performance APIs deployed to every Edge Network region.
- `edge-middleware/`: Examples of providing speed and personalization to users.
- `solutions/`: Demos, architectures, and best practices for various use cases.
- `starter/`: Fully functional applications that serve as robust starting points for new projects.
- `ci-cd/`: Continuous integration and deployment configurations for various CI/CD providers.
- `internal/`: Internal tools and scripts used for maintaining and deploying the examples.

## Dependencies and Installation

To get started with the examples in this repository, you need to have the following dependencies installed:

- [Node.js](https://nodejs.org/) (version 14 or higher)
- [pnpm](https://pnpm.io/) (version 6 or higher)

To install the dependencies, run the following command:

```bash
pnpm install
```

## Vercel Templates

Multiple examples are being featured in [Vercel's Templates](https://vercel.com/templates), visit that page for more advanced filtering options.
Expand Down
3 changes: 3 additions & 0 deletions app-directory/css-in-js/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.

// This file provides type definitions for Next.js and Next.js Image component.
// It ensures that TypeScript understands the types used in Next.js and its Image component.
9 changes: 9 additions & 0 deletions ci-cd/bitbucket-pipelines/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,12 @@ Now that your Vercel application is configured with Bitbucket Pipelines, you can
- When the pull request is merged, a Production build is created and deployed

Every pull request will now automatically have a Preview Deployment attached. If the pull request needs to be rolled back, you can revert and merge the PR and Vercel will start a new Production build back to the old git state.

## Purpose and Usage

The `ci-cd/bitbucket-pipelines` directory contains configuration files and scripts for setting up and using Bitbucket Pipelines as your CI/CD provider with Vercel. These files help you automate the process of building, testing, and deploying your Vercel applications using Bitbucket Pipelines.

## Files

- `bitbucket-pipelines.yml`: The main configuration file for Bitbucket Pipelines. It defines the pipeline steps, triggers, and scripts to build and deploy your Vercel application.
- `index.html`: A sample HTML file to demonstrate the usage of Bitbucket Pipelines with Vercel.
9 changes: 9 additions & 0 deletions ci-cd/github-actions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,12 @@ Now that your Vercel application is configured with GitHub Actions, you can try
- When the pull request is merged, a Production build is created and deployed

Every pull request will now automatically have a Preview Deployment attached. If the pull request needs to be rolled back, you can revert and merge the PR and Vercel will start a new Production build back to the old git state.

## Purpose and Usage

The `ci-cd/github-actions` directory contains configuration files and scripts for setting up and using GitHub Actions as your CI/CD provider with Vercel. These files help you automate the process of building, testing, and deploying your Vercel applications using GitHub Actions.

## Files

- `.gitignore`: Specifies files and directories that should be ignored by Git.
- `index.html`: A sample HTML file to demonstrate the usage of GitHub Actions with Vercel.
10 changes: 10 additions & 0 deletions ci-cd/gitlab-cicd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,13 @@ Now that your Vercel application is configured with Gitlab CI/CD, you can try ou
- When the merge request is merged, a Production build is created and deployed

Every merge request will now automatically have a Preview Deployment attached. If the merge request needs to be rolled back, you can revert and merge the MR and Vercel will start a new Production build back to the old git state.

## Purpose and Usage

The `ci-cd/gitlab-cicd` directory contains configuration files and scripts for setting up and using Gitlab CI/CD as your CI/CD provider with Vercel. These files help you automate the process of building, testing, and deploying your Vercel applications using Gitlab CI/CD.

## Files

- `.gitignore`: Specifies files and directories that should be ignored by Git.
- `.gitlab-ci.yml`: The main configuration file for Gitlab CI/CD. It defines the pipeline steps, triggers, and scripts to build and deploy your Vercel application.
- `index.html`: A sample HTML file to demonstrate the usage of Gitlab CI/CD with Vercel.
26 changes: 26 additions & 0 deletions ci-cd/turborepo-github-actions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,29 @@ It uses a GitHub Actions workflows to build and deploy applications.
- `docs` is built using `vc build` and `vc deploy --prebuilt` to show how you can take more control of your build and deploy process. This process builds the application in the GitHub Action, and then deploys those prebuilt assets to Vercel.

Additionally, a `foo` internal package has been added to demonstrate how to use the `turbo` CLI to build internal dependencies prior to building the `docs` application with the Vercel CLI.

## Purpose and Usage

The purpose of this directory is to demonstrate how to use GitHub Actions with Turborepo and Vercel CLI to build and deploy applications. It provides examples of building and deploying applications using different approaches, such as using `vc deploy` and `vc build` with `vc deploy --prebuilt`.

## Directory Structure

- `.gitignore`: Specifies files and directories to be ignored by Git.
- `.npmrc`: Configuration file for npm.
- `package.json`: Contains metadata about the project and its dependencies.
- `pnpm-lock.yaml`: Lockfile for pnpm.
- `pnpm-workspace.yaml`: Configuration file for pnpm workspace.
- `turbo.json`: Configuration file for Turborepo.

## Dependencies and Installation

To get started with the examples in this directory, you need to have the following dependencies installed:

- [Node.js](https://nodejs.org/) (version 14 or higher)
- [pnpm](https://pnpm.io/) (version 6 or higher)

To install the dependencies, run the following command:

```bash
pnpm install
```
2 changes: 2 additions & 0 deletions edge-middleware/feature-flag-optimizely/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
"root": true,
"extends": "next/core-web-vitals"
}

// This configuration file sets the root to true and extends the Next.js core web vitals rules.
2 changes: 2 additions & 0 deletions edge-middleware/feature-flag-split/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
"root": true,
"extends": "next/core-web-vitals"
}

// This configuration file sets the root to true and extends the Next.js core web vitals rules.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 internal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Internal Directory

This directory contains internal tools and scripts used for maintaining and deploying the examples in this repository.

## Purpose and Usage

The files within the `internal` directory serve various purposes, such as managing dependencies, updating templates, and running tests. Below is a brief explanation of each file:

- `.gitignore`: Specifies files and directories that should be ignored by Git.
- `.npmrc`: Configuration file for npm, enabling auto-installation of peer dependencies.
- `fields.json`: Defines the structure and validation rules for the templates.
- `package.json`: Lists the dependencies and scripts for the internal tools.
- `pnpm-lock.yaml`: Lockfile for pnpm, ensuring consistent installations.
- `pnpm-workspace.yaml`: Configuration file for pnpm workspaces, specifying the packages and apps in the workspace.
- `publishing-templates.md`: Instructions for Vercel employees on how to publish templates to Contentful.
- `readme.md`: Provides an overview of the internal tools and their usage.
- `turbo.json`: Configuration file for Turborepo, defining the pipeline for building, testing, and deploying the examples.