Skip to content

chore(docs): update Zeit references to Vercel #5208

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

Merged
merged 10 commits into from
Apr 26, 2020
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
14 changes: 7 additions & 7 deletions docs/components/footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@

<hr>

<template v-if="isZeitNow && false">
<template v-if="isVercel && false">
<p class="mb-4 text-center">
<strong class="d-block mx-auto mb-2">Hosting provided by</strong>
<a href="https://zeit.co/?utm_campaign=bootstrap-vue" target="_blank" rel="noopener">
<a href="https://vercel.com/?utm_campaign=bootstrap-vue" target="_blank" rel="noopener">
<svg
xmlns="http://www.w3.org/2000/svg"
role="img"
Expand Down Expand Up @@ -98,12 +98,12 @@
Currently v{{ version }}. Code licensed
<a href="https://github.com/bootstrap-vue/bootstrap-vue/blob/master/LICENSE" target="_blank">MIT</a>.
Docs generated with
<a href="https://nuxtjs.org/" target="_blank">Nuxt.js</a><template v-if="!isNetlify && !isZeitNow">.</template>
<a href="https://nuxtjs.org/" target="_blank">Nuxt.js</a><template v-if="!isNetlify && !isVercel">.</template>
<template v-if="isNetlify">
and proudly hosted on <a href="https://www.netlify.com" target="_blank">Netlify</a>.
</template>
<template v-else-if="isZeitNow">
and proudly hosted on <a href="https://zeit.co/?utm_campaign=bootstrap-vue" target="_blank">Zeit</a>.
<template v-else-if="isVercel">
and proudly hosted on <a href="https://vercel.com/?utm_campaign=bootstrap-vue" target="_blank">Vercel</a>.
</template>
</p>
</b-container>
Expand Down Expand Up @@ -146,8 +146,8 @@ export default {
isNetlify() {
return Boolean(process.env.NETLIFY)
},
isZeitNow() {
return Boolean(process.env.ZEIT_NOW)
isVercel() {
return Boolean(process.env.VERCEL_NOW)
}
}
}
Expand Down
15 changes: 10 additions & 5 deletions docs/components/header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,30 +199,35 @@ export default {
isNetlify() {
return Boolean(process.env.NETLIFY)
},
isZeitNow() {
return Boolean(process.env.ZEIT_NOW)
isVercel() {
return Boolean(process.env.VERCEL_NOW)
},
branchName() {
return this.isZeitNow ? process.env.ZEIT_BRANCH || '' : ''
// Netlify doesn't support providing the branch name
return this.isVercel ? process.env.VERCEL_BRANCH || '' : ''
},
isDev() {
// In our case, `production` is the dev branch preview (Netlify)
return (
(this.isNetlify && process.env.NETLIFY_CONTEXT === 'production') ||
(this.isZeitNow && this.branchName === 'dev')
(this.isVercel && this.branchName === 'dev')
)
},
isPR() {
return (
(this.isNetlify && process.env.PULL_REQUEST && process.env.REVIEW_ID) ||
(this.isZeitNow && !this.isDev && this.branchName !== 'master')
(this.isVercel && !this.isDev && this.branchName !== 'master')
)
},
prId() {
// Vercel doesn't currently support returning the PR number
// `REVIEW_ID` is provided by Netlify
return this.isPR ? process.env.REVIEW_ID : ''
},
dropdownText() {
// Dropdown button text
if (this.isPR) {
// Vercel doesn't currently support returning the PR number
return this.prId ? `Pull #${this.prId}` : 'Pull Request'
} else if (this.isLocal) {
return 'Local Copy'
Expand Down
14 changes: 7 additions & 7 deletions docs/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,20 @@ module.exports = {
PULL_REQUEST: process.env.NETLIFY ? process.env.PULL_REQUEST : null,
// - If the previous is `true`, this will be the PR number
REVIEW_ID: process.env.NETLIFY && process.env.PULL_REQUEST ? process.env.REVIEW_ID : null,
// ENV vars provided by Zeit Now build
// ENV vars provided by Vercel/Zeit Now build
// https://zeit.co/docs/v2/build-step#system-environment-variables
// - `true` if on Zeit Now (dev or PR)
ZEIT_NOW: process.env.NOW_GITHUB_DEPLOYMENT,
VERCEL_NOW: process.env.VERCEL_GITHUB_DEPLOYMENT || process.env.NOW_GITHUB_DEPLOYMENT,
// - The branch name used for the deploy (i.e. `dev`, `master`, `patch-1`, etc)
ZEIT_BRANCH: process.env.NOW_GITHUB_COMMIT_REF,
VERCEL_BRANCH: process.env.VERCEL_GITHUB_COMMIT_REF || process.env.NOW_GITHUB_COMMIT_REF,
// - The Commit SHA hash
ZEIT_COMMIT_SHA: process.env.NOW_GITHUB_COMMIT_SHA,
VERCEL_COMMIT_SHA: process.env.VERCEL_GITHUB_COMMIT_SHA || process.env.NOW_GITHUB_COMMIT_SHA,
// - The deployment URL
ZEIT_URL: process.env.NOW_URL,
VERCEL_URL: process.env.VERCEL_URL || process.env.NOW_URL,
// - The Github Organization (ie. bootstrap-vue)
ZEIT_GITHUB_ORG: process.env.NOW_GITHUB_ORG,
VERCEL_GITHUB_ORG: process.env.VERCEL_GITHUB_ORG || process.env.NOW_GITHUB_ORG,
// - The repo is the organization (i.e. bootstrap-vue)
ZEIT_GITHUB_REPO: process.env.NOW_GITHUB_REPO
VERCEL_GITHUB_REPO: process.env.VERCEL_GITHUB_REPO || process.env.NOW_GITHUB_REPO
},

build: {
Expand Down