Compare commits

..

15 Commits

Author SHA1 Message Date
Ethan Arrowood
114199a0b7 fix integration.test.ts 2023-03-24 13:53:52 -06:00
Ethan Arrowood
b5e3d4f166 run prettier 2023-03-24 13:45:24 -06:00
Ethan Arrowood
7ac796591f Merge branch 'main' into refactor/cli-utils 2023-03-24 13:39:40 -06:00
Ethan Arrowood
29585327e1 remove unused fixtures from packages/cli 2023-03-24 13:37:52 -06:00
Ethan Arrowood
a0917206e2 fix lint 2023-03-24 13:35:20 -06:00
Ethan Arrowood
f8d359b496 clean up 2023-03-24 13:34:01 -06:00
Ethan Arrowood
6c2c143c35 fix get-latest-version 2023-03-24 13:26:40 -06:00
Ethan Arrowood
de7e07a90b tests working except for one 2023-03-24 13:21:59 -06:00
Ethan Arrowood
9a672d3b31 Merge remote-tracking branch 'origin/main' into refactor/cli-utils 2023-03-24 13:03:44 -06:00
Ethan Arrowood
17627eee30 refactor cli util tests 2023-03-23 14:42:37 -06:00
Ethan Arrowood
cd6f7a0e6f temp commit of refactoring test files 2023-03-20 13:55:12 -06:00
Ethan Arrowood
07f37454c0 update deps. cli is building! 2023-03-10 14:59:58 -07:00
Ethan Arrowood
2df1ae5fe6 try to get cli to build 2023-03-10 14:41:58 -07:00
Ethan Arrowood
0b7b500eb7 Merge branch 'main' of github.com:vercel/vercel into refactor/cli-utils 2023-03-10 13:08:02 -07:00
Ethan Arrowood
11cc079b69 refactor all cli/src/util files and fix imports 2023-03-10 11:47:21 -07:00
3850 changed files with 326775 additions and 1314765 deletions

View File

@@ -1,8 +0,0 @@
# Changesets
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

View File

@@ -1,14 +0,0 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": [
"@svitejs/changesets-changelog-github-compact",
{ "repo": "vercel/vercel" }
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}

View File

@@ -26,6 +26,12 @@ packages/hydrogen/edge-entry.js
packages/next/test/integration/middleware
packages/next/test/integration/middleware-eval
# node-bridge
packages/node-bridge/bridge.js
packages/node-bridge/launcher.js
packages/node-bridge/helpers.js
packages/node-bridge/source-map-support.js
# middleware
packages/middleware/src/entries.js
@@ -38,7 +44,7 @@ packages/static-build/test/cache-fixtures
packages/redwood/test/fixtures
# remix
packages/remix/test/fixtures-*
packages/remix/test/fixtures
# gatsby-plugin-vercel-analytics
packages/gatsby-plugin-vercel-analytics

24
.github/CODEOWNERS vendored
View File

@@ -1,18 +1,16 @@
# Documentation
# https://help.github.com/en/articles/about-code-owners
# Restricted Paths
* @TooTallNate @EndangeredMassa @trek
/.github/workflows @TooTallNate @EndangeredMassa @trek @ijjk
/packages/fs-detectors @TooTallNate @EndangeredMassa @trek @agadzik @chloetedder
/packages/next @TooTallNate @EndangeredMassa @Ethan-Arrowood @trek @ijjk @ztanner
/packages/routing-utils @TooTallNate @EndangeredMassa @trek @ijjk
/packages/static-build @TooTallNate @EndangeredMassa @trek
/packages/edge @vercel/compute @TooTallNate @EndangeredMassa @trek
* @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood
/.github/workflows @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @ijjk
/packages/fs-detectors @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @agadzik @chloetedder
/packages/node-bridge @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @ijjk
/packages/next @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @ijjk
/packages/routing-utils @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @ijjk
/packages/edge @vercel/edge-compute
/examples @leerob
/examples/create-react-app @Timer
/examples/nextjs @timneutkens @ijjk @ztanner @huozhi
/packages/node @TooTallNate @EndangeredMassa @trek @Kikobeats
# Unrestricted Paths
.changeset/
/examples/nextjs @timneutkens @ijjk @styfle
/examples/hugo @styfle
/examples/jekyll @styfle
/examples/zola @styfle

View File

@@ -15,6 +15,7 @@ git clone https://github.com/vercel/vercel
cd vercel
corepack enable
pnpm install
pnpm bootstrap
pnpm build
pnpm lint
pnpm test-unit

View File

@@ -2,9 +2,7 @@ body:
- type: markdown
attributes:
value: |
**Note**: This category is intended for discussions related to Vercel CLI or Runtimes.
If you post in this repository seeking help with other Vercel tools and features, it may be missed by our support team. For help with topics other than the CLI and Runtimes, please visit the [Vercel Community](https://github.com/orgs/vercel/discussions).
> **Note**: For discussions not related to Vercel CLI or Runtimes, please visit the [Vercel Community](https://github.com/orgs/vercel/discussions)
- type: textarea
attributes:
label: Description

View File

@@ -2,11 +2,9 @@ body:
- type: markdown
attributes:
value: |
**Note**: This category is intended for discussions related to Vercel CLI or Runtimes.
If you post in this repository seeking help with other Vercel tools and features, it may be missed by our support team. For help with topics other than the CLI and Runtimes, please visit the [Vercel Community](https://github.com/orgs/vercel/discussions).
> **Note**: For discussions not related to Vercel CLI or Runtimes, please visit the [Vercel Community](https://github.com/orgs/vercel/discussions/categories/help)
- type: textarea
attributes:
label: Question
label: Problem Description
validations:
required: true

View File

@@ -2,9 +2,7 @@ body:
- type: markdown
attributes:
value: |
**Note**: This category is intended for sharing ideas related to Vercel CLI or Runtimes.
Please visit the [Vercel Community](https://github.com/orgs/vercel/discussions) to share ideas for other Vercel tools and features.
> **Note**: For discussions not related to Vercel CLI or Runtimes, please visit the [Vercel Community](https://github.com/orgs/vercel/discussions/categories/ideas)
- type: textarea
attributes:
label: Idea

10
.github/DISCUSSION_TEMPLATE/polls.yml vendored Normal file
View File

@@ -0,0 +1,10 @@
body:
- type: markdown
attributes:
value: |
> **Note**: For discussions not related to Vercel CLI or Runtimes, please visit the [Vercel Community](https://github.com/orgs/vercel/discussions)
- type: textarea
attributes:
label: Description
validations:
required: true

View File

@@ -2,9 +2,7 @@ body:
- type: markdown
attributes:
value: |
**Note**: This category is intended for discussions related to Vercel CLI or Runtimes.
For topics related to other Vercel features, please visit the [Vercel Community](https://github.com/orgs/vercel/discussions).
> **Note**: For discussions not related to Vercel CLI or Runtimes, please visit the [Vercel Community](https://github.com/orgs/vercel/discussions)
- type: textarea
attributes:
label: Description

View File

@@ -0,0 +1,5 @@
body:
- type: markdown
attributes:
value: |
> **Note**: This category should not be used for new discussions. Please visit the [Vercel Community](https://github.com/orgs/vercel/discussions)

View File

@@ -1,8 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Bug Report
url: https://vercel.com/help
about: Reach out to our support team
url: https://vercel.com/support/request
about: Report a bug using the Vercel support form
- name: Feature Request
url: https://github.com/orgs/vercel/discussions/new?category=ideas
about: Share ideas for new features

View File

@@ -1,79 +0,0 @@
version: 2
updates:
- schedule:
interval: 'daily'
open-pull-requests-limit: 1
reviewers:
- 'trek'
- 'TooTallNate'
- 'EndangeredMassa'
commit-message:
prefix: '[framework-fixtures]'
package-ecosystem: 'npm'
directory: /packages/static-build/test/fixtures/angular-v17
allow:
- dependency-name: '@angular*'
ignore:
- dependency-name: '@angular*'
update-types:
['version-update:semver-major', 'version-update:semver-patch']
groups:
core:
patterns:
- '@angular*'
update-types:
- 'minor'
- schedule:
interval: 'daily'
open-pull-requests-limit: 1
reviewers:
- 'trek'
- 'TooTallNate'
- 'EndangeredMassa'
commit-message:
prefix: '[framework-fixtures]'
package-ecosystem: 'npm'
directory: /packages/static-build/test/fixtures/astro-v4
allow:
- dependency-name: 'astro*'
ignore:
- dependency-name: 'astro*'
update-types:
['version-update:semver-major', 'version-update:semver-patch']
groups:
core:
patterns:
- 'astro*'
update-types:
- 'minor'
- schedule:
interval: 'daily'
open-pull-requests-limit: 1
reviewers:
- 'trek'
- 'TooTallNate'
- 'EndangeredMassa'
commit-message:
prefix: '[framework-fixtures]'
package-ecosystem: 'npm'
directory: /packages/static-build/test/fixtures/hydrogen-v2023
allow:
- dependency-name: '@remix-run*'
- dependency-name: '@shopify*'
ignore:
- dependency-name: '@remix-run*'
update-types:
['version-update:semver-major', 'version-update:semver-patch']
- dependency-name: '@shopify*'
update-types:
['version-update:semver-major', 'version-update:semver-patch']
groups:
core:
patterns:
- '@remix-run*'
- '@shopify*'
update-types:
- 'minor'

View File

@@ -8,7 +8,7 @@ on:
- cron: '0 0 * * 0'
jobs:
update-gatsby-fixtures:
create-pull-request:
runs-on: ubuntu-latest
steps:
- name: Checkout
@@ -16,12 +16,9 @@ jobs:
# 0 means fetch all commits so we can commit and push in the script below
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Enable corepack
run: corepack enable pnpm
- name: Update Gatsby Fixtures
- name: Create Pull Request
uses: actions/github-script@v6
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

67
.github/workflows/publish.yml vendored Normal file
View File

@@ -0,0 +1,67 @@
name: Publish
on:
push:
branches:
- main
tags:
- '!*'
env:
TURBO_REMOTE_ONLY: 'true'
TURBO_TEAM: 'vercel'
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check Release
id: check-release
run: |
tag="$(git describe --tags --exact-match 2> /dev/null || :)"
if [[ -z "$tag" ]];
then
echo "IS_RELEASE=false" >> $GITHUB_OUTPUT
else
echo "IS_RELEASE=true" >> $GITHUB_OUTPUT
fi
- name: Setup Go
if: ${{ steps.check-release.outputs.IS_RELEASE == 'true' }}
uses: actions/setup-go@v3
with:
go-version: '1.13.15'
- name: Setup Node
if: ${{ steps.check-release.outputs.IS_RELEASE == 'true' }}
uses: actions/setup-node@v3
with:
node-version: 16
- name: install npm@9
run: npm i -g npm@9
- name: install pnpm@7.24.2
run: npm i -g pnpm@7.24.2
- name: Install
if: ${{ steps.check-release.outputs.IS_RELEASE == 'true' }}
run: pnpm install
- name: Build
if: ${{ steps.check-release.outputs.IS_RELEASE == 'true' }}
run: pnpm build
env:
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
- name: Publish
if: ${{ steps.check-release.outputs.IS_RELEASE == 'true' }}
run: pnpm publish-from-github
env:
NPM_CONFIG_PROVENANCE: 'true'
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}

View File

@@ -1,87 +0,0 @@
name: Release
on:
push:
branches:
- main
env:
TURBO_REMOTE_ONLY: 'true'
TURBO_TEAM: 'vercel'
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Fetch git tags
run: git fetch origin 'refs/tags/*:refs/tags/*'
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
- name: install npm@9
run: npm i -g npm@9
- name: install pnpm@8.3.1
run: npm i -g pnpm@8.3.1
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build Packages
run: pnpm build
env:
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: pnpm ci:version
publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
NPM_CONFIG_PROVENANCE: 'true'
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
- name: Trigger Update (if a Publish Happened)
if: steps.changesets.outputs.published == 'true'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
script: |
const script = require('./utils/trigger-update-workflow.js')
await script({ github, context })
- name: Set latest Release to `vercel` (if a Publish Happened)
if: steps.changesets.outputs.published == 'true'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
script: |
const script = require('./utils/update-latest-release.js')
await script({ github, context })
summary:
name: Summary
runs-on: ubuntu-latest
timeout-minutes: 5
needs:
- release
steps:
- name: Check All
run: echo OK

26
.github/workflows/required-pr-label.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Required PR Label
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
jobs:
label:
runs-on: ubuntu-latest
steps:
- name: Check PR Labels
uses: actions/github-script@v6
with:
script: |
let missing = false;
const labels = context.payload.pull_request.labels.map(l => l.name);
if (labels.filter(l => l.startsWith('area:')).length === 0) {
console.error('::error::Missing label: Please add at least one "area" label.');
missing = true;
}
if (labels.filter(l => l.startsWith('semver:')).length !== 1) {
console.error('::error::Missing label: Please add exactly one "semver" label.');
missing = true;
}
if (missing) {
process.exit(1);
}
console.log('::notice::Success: This pull request has correct labels, thanks!');

View File

@@ -0,0 +1,44 @@
name: CLI
on:
push:
branches:
- main
tags:
- '!*'
pull_request:
env:
TURBO_REMOTE_ONLY: 'true'
TURBO_TEAM: 'vercel'
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
test:
name: CLI
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: [16]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: install pnpm@7.24.2
run: npm i -g pnpm@7.24.2
- run: pnpm install
- run: pnpm run build
- run: pnpm test-cli
env:
VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
VERCEL_TEST_REGISTRATION_URL: ${{ secrets.VERCEL_TEST_REGISTRATION_URL }}

View File

@@ -19,23 +19,6 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
enforce-changeset:
name: Enforce Changeset
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.pull_request.title != 'Version Packages'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: main
- run: git fetch origin ${{ github.event.pull_request.head.sha }}:pr-${{ github.event.pull_request.number }}
- run: git checkout pr-${{ github.event.pull_request.number }}
- name: install pnpm@8.3.1
run: npm i -g pnpm@8.3.1
- run: pnpm install
# Enforce a changeset file to be present
- run: pnpm exec changeset status --since=main
test:
name: Lint
timeout-minutes: 10
@@ -45,10 +28,8 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: install pnpm@8.3.1
run: npm i -g pnpm@8.3.1
- name: install pnpm@7.24.2
run: npm i -g pnpm@7.24.2
- run: pnpm install
- run: pnpm run lint
- run: pnpm run prettier-check
- run: pnpm run build
- run: pnpm run type-check

View File

@@ -32,8 +32,8 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: install pnpm@8.3.1
run: npm i -g pnpm@8.3.1
- name: install pnpm@7.24.2
run: npm i -g pnpm@7.24.2
- run: pnpm install
- id: set-tests
run: |
@@ -41,12 +41,13 @@ jobs:
echo "Files to test:"
echo "$TESTS_ARRAY"
echo "tests=$TESTS_ARRAY" >> $GITHUB_OUTPUT
- uses: patrickedqvist/wait-for-vercel-preview@bfdff514ff78a669f2536e9f4dd4ef5813a704a2
- uses: patrickedqvist/wait-for-vercel-preview@ae34b392ef30297f2b672f9afb3c329bde9bd487
id: waitForTarball
with:
token: ${{ secrets.GITHUB_TOKEN }}
max_timeout: 360
check_interval: 5
test:
timeout-minutes: 120
runs-on: ${{ matrix.runner }}
@@ -64,71 +65,35 @@ jobs:
fetch-depth: 2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.nodeVersion || env.NODE_VERSION }}
node-version: ${{ env.NODE_VERSION }}
- name: Install Hugo
if: matrix.runner == 'macos-latest'
run: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.56.0/hugo_0.56.0_macOS-64bit.tar.gz && tar -xzf hugo_0.56.0_macOS-64bit.tar.gz && mv ./hugo packages/cli/test/dev/fixtures/08-hugo/
# yarn 1.22.21 introduced a Corepack bug when running tests.
# this can be removed once https://github.com/yarnpkg/yarn/issues/9015 is resolved
- name: install yarn@1.22.19
run: npm i -g yarn@1.22.19
- name: install pnpm@8.3.1
run: npm i -g pnpm@8.3.1
- name: install pnpm@7.24.2
run: npm i -g pnpm@7.24.2
- run: pnpm install
- name: fetch ssl certificate before build (linux, os x)
if: matrix.runner != 'windows-latest'
run: echo | openssl s_client -showcerts -servername 'api.vercel.com' -connect 76.76.21.21:443
- name: Build ${{matrix.packageName}} and all its dependencies
run: node utils/gen.js && node_modules/.bin/turbo run build --cache-dir=".turbo" --log-order=stream --scope=${{matrix.packageName}} --include-dependencies --no-deps
run: node utils/gen.js && node_modules/.bin/turbo run build --cache-dir=".turbo" --scope=${{matrix.packageName}} --include-dependencies --no-deps
env:
FORCE_COLOR: '1'
- name: Test ${{matrix.packageName}}
run: node utils/gen.js && node_modules/.bin/turbo run test --summarize --cache-dir=".turbo" --log-order=stream --scope=${{matrix.packageName}} --no-deps -- ${{ join(matrix.testPaths, ' ') }}
run: node utils/gen.js && node_modules/.bin/turbo run test --cache-dir=".turbo" --scope=${{matrix.packageName}} --no-deps -- ${{ join(matrix.testPaths, ' ') }}
shell: bash
env:
JEST_JUNIT_OUTPUT_FILE: ${{github.workspace}}/.junit-reports/${{matrix.scriptName}}-${{matrix.packageName}}-${{matrix.chunkNumber}}-${{ matrix.runner }}.xml
VERCEL_CLI_VERSION: ${{ needs.setup.outputs.dplUrl }}/tarballs/vercel.tgz
VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
VERCEL_TEST_REGISTRATION_URL: ${{ secrets.VERCEL_TEST_REGISTRATION_URL }}
FORCE_COLOR: '1'
- name: 'Determine Turbo HIT or MISS'
if: ${{ !cancelled() }}
id: turbo-summary
shell: bash
run: |
TURBO_MISS_COUNT=`node utils/determine-turbo-hit-or-miss.js`
echo "MISS COUNT: $TURBO_MISS_COUNT"
echo "misses=$TURBO_MISS_COUNT" >> $GITHUB_OUTPUT
- name: fetch ssl certificate after tests (linux, os x)
if: matrix.runner != 'windows-latest'
run: echo | openssl s_client -showcerts -servername 'api.vercel.com' -connect 76.76.21.21:443
- name: 'Upload Test Report to Datadog'
if: ${{ steps['turbo-summary'].outputs.misses != '0' && !cancelled() }}
run: 'npx @datadog/datadog-ci@2.18.1 junit upload --service vercel-cli .junit-reports'
env:
DATADOG_API_KEY: ${{secrets.DATADOG_API_KEY_CLI}}
DD_ENV: ci
summary:
name: Summary
runs-on: ubuntu-latest
timeout-minutes: 5
if: always()
conclusion:
needs:
- test
runs-on: ubuntu-latest
name: E2E
steps:
- name: Check All
run: |-
for status in ${{ join(needs.*.result, ' ') }}
do
if [ "$status" != "success" ] && [ "$status" != "skipped" ]
then
echo "Some checks failed"
exit 1
fi
done
- name: Done
run: echo "Done."

View File

@@ -17,8 +17,6 @@ jobs:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Enable corepack
run: corepack enable pnpm
- name: Update @remix-run/dev

5
.gitignore vendored
View File

@@ -9,8 +9,8 @@ coverage.lcov
*.swp
*.bak
*.tgz
packages/cli/src/util/dev/templates/*.ts
packages/cli/src/util/constants.ts
internals/utils/src/dev/templates/*.ts
internals/utils/src/constants.ts
packages/cli/test/**/yarn.lock
!packages/cli/test/dev/**/yarn.lock
packages/cli/test/**/node_modules
@@ -31,4 +31,3 @@ __pycache__
.turbo
.eslintcache
turbo-cache-key.json
junit.xml

View File

@@ -1 +0,0 @@
v16.20.2

1
.nvmrc
View File

@@ -1 +0,0 @@
16.20.2

View File

@@ -12,7 +12,6 @@ packages/gatsby-plugin-vercel-analytics
node_modules
dist
pnpm-lock.yaml
.changeset
.vscode
.DS_Store
.next
@@ -29,8 +28,7 @@ turbo-cache-key.json
packages/*/dist
packages/*/node_modules
packages/**/test/fixtures
packages/**/test/fixtures-*
packages/**/test/dev/fixtures
packages/**/test/build-fixtures
packages/**/test/cache-fixtures
packages/cli/src/util/dev/templates/*.ts

View File

@@ -385,16 +385,16 @@ This is a [class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refere
This is an abstract enumeration type that is implemented by one of the following possible `String` values:
- `nodejs20.x`
- `nodejs18.x`
- `nodejs16.x`
- `nodejs14.x`
- `go1.x`
- `java11`
- `python3.9`
- `dotnet6`
- `dotnetcore3.1`
- `ruby2.7`
- `provided.al2`
- `provided.al2023`
## `@vercel/build-utils` Helper Functions

View File

@@ -19,7 +19,9 @@
## Vercel
Vercels Frontend Cloud provides the developer experience and infrastructure to build, scale, and secure a faster, more personalized Web.
Vercel is the platform for frontend developers, providing the speed and reliability innovators need to create at the moment of inspiration.
We enable teams to iterate quickly and develop, preview, and ship delightful user experiences. Vercel has zero-configuration support for 35+ frontend frameworks and integrates with your headless content, commerce, or database of choice.
## Deploy

View File

@@ -1,7 +0,0 @@
# api
## 0.0.1
### Patch Changes
- fix RSC matching behavior & 404 status code on `fallback: false` ([#10388](https://github.com/vercel/vercel/pull/10388))

View File

@@ -1,7 +1,7 @@
{
"name": "api",
"private": true,
"version": "0.0.1",
"version": "0.0.0",
"description": "API for the vercel/vercel repo",
"main": "index.js",
"scripts": {},
@@ -16,6 +16,7 @@
"devDependencies": {
"@types/node": "16.18.11",
"@types/node-fetch": "2.5.4",
"@vercel/node": "*"
"@vercel/node": "*",
"typescript": "4.3.4"
}
}

View File

@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "ES2021",
"target": "ES2020",
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,

View File

@@ -4,7 +4,7 @@
You ran `vercel dev` inside a project that contains a `vercel.json` file with `env` or `build.env` properties that use [Vercel Secrets](https://vercel.com/docs/concepts/projects/environment-variables).
In order to use environment variables in your project locally that have values defined using the Vercel Secrets format (e.g. `@my-secret-value`), you will need to provide the value as an environment variable using a `.env.local`.
In order to use environment variables in your project locally that have values defined using the Vercel Secrets format (e.g. `@my-secret-value`), you will need to provide the value as an environment variable using a `.env`.
We require this to ensure your app works as you intend it to, in the development environment, and to provide you with a way to mirror or separate private environment variables within your applications, for example when connecting to a database.
@@ -12,11 +12,11 @@ Read below for how to address this error.
#### Possible Ways to Fix It
The error message will list environment variables that are required and which file they are required to be included in `.env.local`.
The error message will list environment variables that are required and which file they are required to be included in `.env`.
If the file does not exist yet, please create the file that the error message mentions and insert the missing environment variable into it.
For example, if the error message shows that the environment variable `TEST` is missing from `.env.local`, then the `.env.local` file should look like this:
For example, if the error message shows that the environment variable `TEST` is missing from `.env`, then the `.env` file should look like this:
```
TEST=value

13
examples/CHANGELOG.md vendored
View File

@@ -1,13 +0,0 @@
# examples
## null
### Patch Changes
- chore: update Nuxt example ([#10869](https://github.com/vercel/vercel/pull/10869))
## null
### Patch Changes
- update examples to use at least node@16 ([#10395](https://github.com/vercel/vercel/pull/10395))

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy angular', async () => {
await deployExample('angular');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy astro', async () => {
await deployExample('astro');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy blitzjs', async () => {
await deployExample('blitzjs');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy brunch', async () => {
await deployExample('brunch');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy create-react-app', async () => {
await deployExample('create-react-app');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy docusaurus-2', async () => {
await deployExample('docusaurus-2');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy docusaurus', async () => {
await deployExample('docusaurus');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy dojo', async () => {
await deployExample('dojo');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy eleventy', async () => {
await deployExample('eleventy');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy ember', async () => {
await deployExample('ember');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy gatsby', async () => {
await deployExample('gatsby');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy gridsome', async () => {
await deployExample('gridsome');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy hexo', async () => {
await deployExample('hexo');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy hugo', async () => {
await deployExample('hugo');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +0,0 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy hydrogen-2', async () => {
await deployExample('hydrogen-2');
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy hydrogen', async () => {
await deployExample('hydrogen');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy ionic-angular', async () => {
await deployExample('ionic-angular');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy ionic-react', async () => {
await deployExample('ionic-react');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy jekyll', async () => {
await deployExample('jekyll');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy middleman', async () => {
await deployExample('middleman');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy nextjs', async () => {
await deployExample('nextjs');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy node_modules', async () => {
await deployExample('node_modules');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy nuxtjs', async () => {
await deployExample('nuxtjs');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy parcel', async () => {
await deployExample('parcel');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy polymer', async () => {
await deployExample('polymer');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy preact', async () => {
await deployExample('preact');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy redwoodjs', async () => {
await deployExample('redwoodjs');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy remix', async () => {
await deployExample('remix');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy saber', async () => {
await deployExample('saber');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy sanity', async () => {
await deployExample('sanity');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy sapper', async () => {
await deployExample('sapper');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy scully', async () => {
await deployExample('scully');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy solidstart', async () => {
await deployExample('solidstart');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy stencil', async () => {
await deployExample('stencil');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +0,0 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy storybook', async () => {
await deployExample('storybook');
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy svelte', async () => {
await deployExample('svelte');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy sveltekit-1', async () => {
await deployExample('sveltekit-1');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy sveltekit', async () => {
await deployExample('sveltekit');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy umijs', async () => {
await deployExample('umijs');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy vite', async () => {
await deployExample('vite');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy vitepress', async () => {
await deployExample('vitepress');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy vue', async () => {
await deployExample('vue');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy vuepress', async () => {
await deployExample('vuepress');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,4 +1,5 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy zola', async () => {
await deployExample('zola');
it('should deploy', async () => {
await deployExample(__filename);
});

View File

@@ -1,14 +1,6 @@
# Astro
This directory is a brief example of an [Astro](https://astro.build/) site that can be deployed to Vercel with zero configuration. This demo showcases:
- `/` - A static page (pre-rendered)
- `/ssr` - A page that uses server-side rendering (through [Vercel Edge Functions](https://vercel.com/docs/functions/edge-functions))
- `/ssr-with-swr-caching` - Similar to the previous page, but also caches the response on the [Vercel Edge Network](https://vercel.com/docs/edge-network/overview) using `cache-control` headers
- `/image` - Astro [Asset](https://docs.astro.build/en/guides/assets/) using Vercel [Image Optimization](https://vercel.com/docs/image-optimization)
- `/edge.json` - An Astro API Endpoint that returns JSON data using [Vercel Edge Functions](https://vercel.com/docs/functions/edge-functions)
Learn more about [Astro on Vercel](https://vercel.com/docs/frameworks/astro).
This directory is a brief example of an [Astro](https://astro.build/) site that can be deployed to Vercel with zero configuration.
## Deploy Your Own
@@ -20,7 +12,21 @@ _Live Example: https://astro-template.vercel.app_
## Project Structure
Astro looks for `.astro`, `.md`, or `.js` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
Inside of your Astro project, you'll see the following folders and files:
```
/
├── public/
│ └── favicon.ico
├── src/
│ ├── components/
│ │ └── Layout.astro
│ └── pages/
│ └── index.astro
└── package.json
```
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components or layouts.
@@ -36,6 +42,5 @@ All commands are run from the root of the project, from a terminal:
| `pnpm run dev` | Starts local dev server at `localhost:3000` |
| `pnpm run build` | Build your production site to `./dist/` |
| `pnpm run preview` | Preview your build locally, before deploying |
| `pnpm run start` | Starts a production dev server at `localhost:3000` |
| `pnpm run astro ...` | Run CLI commands like `astro add`, `astro preview` |
| `pnpm run astro --help` | Get help using the Astro CLI |

View File

@@ -1,17 +1,4 @@
import { defineConfig } from 'astro/config';
// Use Vercel Edge Functions (Recommended)
import vercel from '@astrojs/vercel/edge';
// Can also use Serverless Functions
// import vercel from '@astrojs/vercel/serverless';
// Or a completely static build
// import vercel from '@astrojs/vercel/static';
export default defineConfig({
output: 'server',
experimental: {
assets: true
},
adapter: vercel({
imageService: true,
}),
});
// https://astro.build/config
export default defineConfig({});

View File

@@ -7,10 +7,8 @@
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/vercel": "3.8.2",
"astro": "^2.10.14",
"react": "18.2.0",
"web-vitals": "^3.3.1"
"devDependencies": {
"astro": "^2.0.6",
"web-vitals": "^3.1.1"
}
}

2953
examples/astro/pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -1,4 +1,4 @@
/// <reference types="astro/client-image" />
/// <reference types="astro/client" />
interface ImportMetaEnv {
readonly PUBLIC_VERCEL_ANALYTICS_ID: string;

View File

@@ -32,7 +32,7 @@ export function sendToAnalytics(metric, options) {
};
if (options.debug) {
console.log("[Web Vitals]", metric.name, JSON.stringify(body, null, 2));
console.log("[Analytics]", metric.name, JSON.stringify(body, null, 2));
}
const blob = new Blob([new URLSearchParams(body).toString()], {
@@ -61,6 +61,6 @@ export function webVitals(options) {
onCLS((metric) => sendToAnalytics(metric, options));
onFCP((metric) => sendToAnalytics(metric, options));
} catch (err) {
console.error("[Web Vitals]", err);
console.error("[Analytics]", err);
}
}

View File

@@ -1,9 +0,0 @@
export async function get() {
return new Response(JSON.stringify({ time: new Date() }), {
status: 200,
headers: {
'Content-Type': 'application/json',
'Cache-Control': 's-maxage=10, stale-while-revalidate',
},
});
}

View File

@@ -1,6 +0,0 @@
---
import { Image } from 'astro:assets';
import astroLogo from '../assets/logo.png';
---
<Image src={astroLogo} alt="Astro Logo" width={50} quality={75} />

View File

@@ -1,8 +1,6 @@
---
import Layout from '../layouts/Layout.astro';
import Card from '../components/Card.astro';
export const prerender = true;
---
<Layout title="Welcome to Astro.">

View File

@@ -1,7 +0,0 @@
---
Astro.response.headers.set('Cache-Control', 's-maxage=10, stale-while-revalidate');
const time = new Date().toLocaleTimeString();
---
<h1>{time}</h1>

View File

@@ -1,5 +0,0 @@
---
const time = new Date().toLocaleTimeString();
---
<h1>{time}</h1>

View File

@@ -4,6 +4,7 @@
root = true
[*]
end_of_line = lf
charset = utf-8

View File

@@ -5,11 +5,5 @@
Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false,
/**
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
*/
"isTypeScriptProject": false
"disableAnalytics": false
}

View File

@@ -1,13 +1,20 @@
# unconventional js
/blueprints/*/files/
/vendor/
# compiled output
/dist/
/tmp/
# dependencies
/bower_components/
/node_modules/
# misc
/coverage/
!.*
.*/
# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try

View File

@@ -1,24 +1,11 @@
'use strict';
module.exports = {
root: true,
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
ecmaVersion: 2018,
sourceType: 'module',
requireConfigFile: false,
babelOptions: {
plugins: [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
],
},
},
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
extends: ['eslint:recommended', 'plugin:ember/recommended'],
env: {
browser: true,
},
@@ -27,16 +14,14 @@ module.exports = {
// node files
{
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./lib/*/index.js',
'./server/**/*.js',
'.eslintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'lib/*/index.js',
'server/**/*.js',
],
parserOptions: {
sourceType: 'script',
@@ -45,12 +30,18 @@ module.exports = {
browser: false,
node: true,
},
extends: ['plugin:n/recommended'],
},
{
// test files
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
plugins: ['node'],
rules: Object.assign(
{},
require('eslint-plugin-node').configs.recommended.rules,
{
// add your custom rules and overrides for node files here
// this can be removed once the following is fixed
// https://github.com/mysticatea/eslint-plugin-node/issues/77
'node/no-unpublished-require': 'off',
}
),
},
],
};

View File

@@ -1,47 +0,0 @@
name: CI
on:
push:
branches:
- main
- master
pull_request: {}
concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
lint:
name: "Lint"
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- name: Install Dependencies
run: npm ci
- name: Lint
run: npm run lint
test:
name: "Test"
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- name: Install Dependencies
run: npm ci
- name: Run Tests
run: npm test

View File

@@ -1,32 +1,32 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist/
/tmp/
# dependencies
/bower_components/
/node_modules/
# misc
/.env*
/.pnp*
/.eslintcache
/.sass-cache
/connect.lock
/coverage/
/libpeerconnection.log
/npm-debug.log*
/testem.log
/yarn-error.log
# ember-try
/.node_modules.ember-try/
/npm-shrinkwrap.json.ember-try
/bower.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
# broccoli-debug
/DEBUG/
# Environment Variables
.env
.env.build
.env.local
# Vercel
.vercel

View File

@@ -1,13 +0,0 @@
# unconventional js
/blueprints/*/files/
# compiled output
/dist/
# misc
/coverage/
!.*
.*/
# ember-try
/.node_modules.ember-try/

View File

@@ -1,12 +0,0 @@
'use strict';
module.exports = {
overrides: [
{
files: '*.{js,ts}',
options: {
singleQuote: true,
},
},
],
};

View File

@@ -1,8 +0,0 @@
# unconventional files
/blueprints/*/files/
# compiled output
/dist/
# addons
/.node_modules.ember-try/

View File

@@ -1,5 +0,0 @@
'use strict';
module.exports = {
extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'],
};

View File

@@ -1,3 +1,3 @@
{
"ignore_dirs": ["dist"]
"ignore_dirs": ["tmp", "dist"]
}

Some files were not shown because too many files have changed in this diff Show More