Skip to content

Commit

Permalink
Vercel migration (#59)
Browse files Browse the repository at this point in the history
* fix OG image

* adding support for PR preview URLs in SEO images

* initial pass at adding vercel + latest deps

* updating env variables and migrating the nightly build

* adding schema def to the vercel config

* migrating the fonts redirect, removing the cron job

* removing nightly build env variable

* updating site-kit imports

* fixing hero image

* fixing a few site-kit related bugs

* why do linters always fight me

---------

Co-authored-by: Fred K. Schott <[email protected]>
Co-authored-by: Tony Sullivan <[email protected]>
  • Loading branch information
3 people authored Sep 27, 2023
1 parent 938b7c2 commit 5b46625
Show file tree
Hide file tree
Showing 17 changed files with 3,284 additions and 3,711 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# build output
dist
.netlify
.vercel

# dependencies
node_modules/
Expand Down
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pnpm-lock.yaml
.vercel
20 changes: 10 additions & 10 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
// @ts-expect-error: module types don't work in this version
import netlify from '@astrojs/netlify/functions';
import tailwind from '@astrojs/tailwind';
import vercel from '@astrojs/vercel/serverless';
import { defineConfig } from 'astro/config';

/* https://docs.netlify.com/configure-builds/environment-variables/#read-only-variables */
const NETLIFY_PREVIEW_SITE = process.env.CONTEXT !== 'production' && process.env.DEPLOY_PRIME_URL;
/* https://vercel.com/docs/projects/environment-variables/system-environment-variables#system-environment-variables */
const VERCEL_PREVIEW_SITE =
process.env.VERCEL_ENV !== 'production' &&
process.env.VERCEL_URL &&
`https://${process.env.VERCEL_URL}`;

// https://astro.build/config
export default defineConfig({
site: NETLIFY_PREVIEW_SITE || 'https://astro.new',
site: VERCEL_PREVIEW_SITE || 'https://astro.new',
integrations: [
tailwind({
config: {
path: './tailwind.config.mjs',
applyBaseStyles: false,
},
configFile: './tailwind.config.mjs',
applyBaseStyles: false,
}),
],
output: 'server',
adapter: netlify(),
adapter: vercel(),
vite: {
ssr: {
noExternal: ['smartypants'],
Expand Down
4 changes: 0 additions & 4 deletions netlify.toml

This file was deleted.

27 changes: 0 additions & 27 deletions netlify/functions/nightly-build.ts

This file was deleted.

22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"node": "18"
},
"scripts": {
"dev": "netlify dev",
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
Expand All @@ -25,24 +25,26 @@
},
"prettier": "@astrojs/site-kit/prettier",
"dependencies": {
"@astrojs/netlify": "^2.2.2",
"@fontsource/inter": "^4.5.15",
"@astrojs/check": "^0.2.0",
"@astrojs/vercel": "^5.0.1",
"@fontsource-variable/inter": "^5.0.8",
"title": "^3.5.3"
},
"devDependencies": {
"@astrojs/site-kit": "github:withastro/site-kit",
"@astrojs/tailwind": "^3.1.1",
"@netlify/functions": "^1.4.0",
"@astrojs/tailwind": "^5.0.0",
"@tailwindcss/container-queries": "^0.1.1",
"@types/node": "^18.15.11",
"@types/node": "^20.6.5",
"@types/title": "^3.4.1",
"astro": "^2.2.3",
"astro-icon": "^0.8.0",
"eslint": "^8.49.0",
"astro": "^3.1.3",
"astro-icon": "^0.8.1",
"eslint": "^8.50.0",
"install": "^0.13.0",
"netlify-cli": "^13.2.2",
"netlify-cli": "^16.4.2",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.3",
"prettier-plugin-astro": "^0.12.0",
"prettier-plugin-tailwindcss": "^0.5.4",
"tailwindcss": "^3.3.3",
"typescript": "^5.2.2"
},
Expand Down
Loading

0 comments on commit 5b46625

Please sign in to comment.