diff --git a/.eslintrc.json b/.eslintrc.json index 22be32ff0a..445477be14 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -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. diff --git a/.github/README.md b/.github/README.md new file mode 100644 index 0000000000..e9c8770866 --- /dev/null +++ b/.github/README.md @@ -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. diff --git a/README.md b/README.md index 0f68451e6d..03f49c72ed 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/app-directory/css-in-js/next-env.d.ts b/app-directory/css-in-js/next-env.d.ts index 4f11a03dc6..5da94eb433 100644 --- a/app-directory/css-in-js/next-env.d.ts +++ b/app-directory/css-in-js/next-env.d.ts @@ -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. diff --git a/ci-cd/bitbucket-pipelines/README.md b/ci-cd/bitbucket-pipelines/README.md index 52c4a087ab..02574a5e4e 100644 --- a/ci-cd/bitbucket-pipelines/README.md +++ b/ci-cd/bitbucket-pipelines/README.md @@ -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. diff --git a/ci-cd/github-actions/README.md b/ci-cd/github-actions/README.md index 90722e83cd..f1a1e805f2 100644 --- a/ci-cd/github-actions/README.md +++ b/ci-cd/github-actions/README.md @@ -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. diff --git a/ci-cd/gitlab-cicd/README.md b/ci-cd/gitlab-cicd/README.md index 9ff38fac1f..9f8c70feff 100644 --- a/ci-cd/gitlab-cicd/README.md +++ b/ci-cd/gitlab-cicd/README.md @@ -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. diff --git a/ci-cd/turborepo-github-actions/README.md b/ci-cd/turborepo-github-actions/README.md index 99c9cb6333..048b2aa9bb 100644 --- a/ci-cd/turborepo-github-actions/README.md +++ b/ci-cd/turborepo-github-actions/README.md @@ -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 +``` diff --git a/edge-middleware/feature-flag-optimizely/.eslintrc.json b/edge-middleware/feature-flag-optimizely/.eslintrc.json index a2569c2c7c..bc9b8bf483 100644 --- a/edge-middleware/feature-flag-optimizely/.eslintrc.json +++ b/edge-middleware/feature-flag-optimizely/.eslintrc.json @@ -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. diff --git a/edge-middleware/feature-flag-split/.eslintrc.json b/edge-middleware/feature-flag-split/.eslintrc.json index a2569c2c7c..bc9b8bf483 100644 --- a/edge-middleware/feature-flag-split/.eslintrc.json +++ b/edge-middleware/feature-flag-split/.eslintrc.json @@ -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. diff --git a/edge-middleware/power-parity-pricing-strategies/public/flags/ad.svg b/edge-middleware/power-parity-pricing-strategies/public/flags/ad.svg index 1323d8e6f3..50049f81ab 100644 --- a/edge-middleware/power-parity-pricing-strategies/public/flags/ad.svg +++ b/edge-middleware/power-parity-pricing-strategies/public/flags/ad.svg @@ -1,3 +1,4 @@ + @@ -110,7 +111,7 @@ - + diff --git a/edge-middleware/power-parity-pricing-strategies/public/flags/ae.svg b/edge-middleware/power-parity-pricing-strategies/public/flags/ae.svg index b7acdbdb36..993a9d905c 100644 --- a/edge-middleware/power-parity-pricing-strategies/public/flags/ae.svg +++ b/edge-middleware/power-parity-pricing-strategies/public/flags/ae.svg @@ -1,4 +1,5 @@ + diff --git a/internal/README.md b/internal/README.md new file mode 100644 index 0000000000..4b9552e33b --- /dev/null +++ b/internal/README.md @@ -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.