From 35937c256fcd8885524549adb4a2177084d3be5e Mon Sep 17 00:00:00 2001 From: Felicio Mununga Date: Fri, 12 May 2023 15:06:04 +0200 Subject: [PATCH] Set up website deployment (#391) * env * vercel.json * turbo * u * root * cwd --- apps/website/.env | 4 ++++ apps/website/.env.development | 1 + apps/website/.env.production | 1 + apps/website/next.config.js | 4 ---- apps/website/package.json | 8 ++++---- apps/website/vercel.json | 11 +++++++++++ package.json | 2 +- turbo.json | 7 ++++++- vercel.json | 8 ++++++++ 9 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 apps/website/.env create mode 100644 apps/website/.env.development create mode 100644 apps/website/.env.production create mode 100644 apps/website/vercel.json create mode 100644 vercel.json diff --git a/apps/website/.env b/apps/website/.env new file mode 100644 index 00000000..d7d8ad1c --- /dev/null +++ b/apps/website/.env @@ -0,0 +1,4 @@ +NODE_ENV=development +IGNORE_TS_CONFIG_PATHS=true +TAMAGUI_TARGET=web +TAMAGUI_DISABLE_WARN_DYNAMIC_LOAD=1 diff --git a/apps/website/.env.development b/apps/website/.env.development new file mode 100644 index 00000000..c0d66521 --- /dev/null +++ b/apps/website/.env.development @@ -0,0 +1 @@ +NODE_ENV=development diff --git a/apps/website/.env.production b/apps/website/.env.production new file mode 100644 index 00000000..cbde1cca --- /dev/null +++ b/apps/website/.env.production @@ -0,0 +1 @@ +NODE_ENV=production diff --git a/apps/website/next.config.js b/apps/website/next.config.js index b6dd11cb..2e77ac2a 100644 --- a/apps/website/next.config.js +++ b/apps/website/next.config.js @@ -5,10 +5,6 @@ const { withTamagui } = require('@tamagui/next-plugin') const { join } = require('path') -process.env.IGNORE_TS_CONFIG_PATHS = 'true' -process.env.TAMAGUI_TARGET = 'web' -process.env.TAMAGUI_DISABLE_WARN_DYNAMIC_LOAD = '1' - /** @type {import('next').NextConfig} */ let config = { // output: 'export', diff --git a/apps/website/package.json b/apps/website/package.json index 2a0588c0..c1b8acee 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -3,13 +3,13 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "TAMAGUI_TARGET='web' next dev", - "build": "TAMAGUI_TARGET='web' next build", - "start": "TAMAGUI_TARGET='web' next start", + "dev": "next dev", + "build": "next build", + "start": "next start", "lint": "next lint", "typecheck": "tsc", "clean": "rimraf .next .tamagui .vercel/output node_modules", - "serve": "TAMAGUI_TARGET='web' NODE_ENV=production next start --port 8151" + "serve": "next start --port 8151" }, "dependencies": { "@radix-ui/react-dialog": "^1.0.3", diff --git a/apps/website/vercel.json b/apps/website/vercel.json new file mode 100644 index 00000000..ca70dbd5 --- /dev/null +++ b/apps/website/vercel.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://openapi.vercel.sh/vercel.json", + "git": { + "deploymentEnabled": { + "main": false + } + }, + "ignoreCommand": "git diff --quiet HEAD^ HEAD ../../{patches,package.json} ../../packages/{colors,components,icons} ./", + "installCommand": "yarn install --cwd ../../ --frozen-lockfile", + "buildCommand": "turbo run build --filter=website..." +} diff --git a/package.json b/package.json index db8a193f..870b883d 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "prepare": "husky install", "test": "turbo run test --filter=@status-im/* -- --run", "dev": "turbo run dev --filter=@status-im/* --parallel", - "build": "turbo run build --filter=@status-im/*", + "build": "turbo run build --filter=@status-im/*", "lint": "eslint --cache --cache-location ./node_modules/.cache/eslint/.eslint-cache .", "typecheck": "turbo run typecheck", "format": "prettier --ignore-path .gitignore --write .", diff --git a/turbo.json b/turbo.json index 349699f4..83526388 100644 --- a/turbo.json +++ b/turbo.json @@ -1,11 +1,15 @@ { "$schema": "https://turborepo.org/schema.json", - "baseBranch": "origin/main", "pipeline": { "build": { "dependsOn": ["^build"], "outputs": ["dist/**"] }, + "website#build": { + "dependsOn": ["^build"], + "env": ["TAMAGUI_TARGET", "TAMAGUI_DISABLE_WARN_DYNAMIC_LOAD"], + "outputs": [".next/**", "!.next/cache/**"] + }, "dev": { "cache": false }, @@ -23,5 +27,6 @@ "cache": false } }, + "globalEnv": ["GITHUB_TOKEN"], "globalDependencies": ["tsconfig.base.json"] } diff --git a/vercel.json b/vercel.json new file mode 100644 index 00000000..ad003ec4 --- /dev/null +++ b/vercel.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://openapi.vercel.sh/vercel.json", + "git": { + "deploymentEnabled": { + "main": false + } + } +}