From 2149d8df9a533929d78bc669a9f32b90533bd0b6 Mon Sep 17 00:00:00 2001 From: PoolOfDeath20 <53143214+GervinFung@users.noreply.github.com> Date: Sat, 13 Apr 2024 19:29:00 +0800 Subject: [PATCH] Web fix deployment and build (#21) * fix(size): added `.vercelignore` to ignore unrelated files * fix(postinstall): move postinstall for rust to desktop * chore(apps/web): updated command to reduce steps --- .vercelignore | 8 ++++++++ Makefile | 6 +----- apps/desktop/package.json | 1 + apps/web/Makefile | 4 ++-- package.json | 2 +- 5 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .vercelignore diff --git a/.vercelignore b/.vercelignore new file mode 100644 index 0000000..7fbf4e5 --- /dev/null +++ b/.vercelignore @@ -0,0 +1,8 @@ +apps/desktop +apps/mobile +.github +.gitattributes +.prettierignore +LICENSE +README.md +apps/web/test/snapshot/snapshot-images diff --git a/Makefile b/Makefile index 2b612b9..4246ef0 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,3 @@ -postinstall: - cd apps/desktop && make install-rust - # format format-write: pnpm --stream -r format-write @@ -18,11 +15,10 @@ lint-workflows: # web deployment web-deploy-production: - vercel --prod --prebuilt + vercel --prod deploy-web: cd apps/web &&\ make build-production &&\ cd ../../ &&\ - mv apps/web/.next .vercel/output &&\ make web-deploy-production diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 25a738c..ff737e4 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -6,6 +6,7 @@ "license": "GPL", "description": "A UI/UX friendly desktop application to learn more about Modern Periodic Table of Elements", "scripts": { + "postinstall": "make install-rust", "format-check": "make format-check", "format-write": "make format-write" }, diff --git a/apps/web/Makefile b/apps/web/Makefile index 6e464e1..00443a9 100644 --- a/apps/web/Makefile +++ b/apps/web/Makefile @@ -25,7 +25,7 @@ generate-web-pages: pnpm shx cp next/web.mjs next.config.mjs &&\ pnpm vite-node script/pages/web.ts -generate-web-pages-and-schema: generate-web-pages generate-schema +generate-web-pages-and-schema: generate-web-pages generate-schema generate-webmanifest generate-desktop-pages: pnpm shx cp next/desktop.mjs next.config.mjs &&\ @@ -69,7 +69,7 @@ start-production: copy-env-production generate-web-pages-and-schema clear-cache ## build build-development: clear-cache copy-env-development generate-web-pages-and-schema build -build-production: clear-cache copy-env-production generate-web-pages-and-schema generate build +build-production: clear-cache copy-env-production clear-snapshot generate-web-pages-and-schema build generate-sitemap build-testing: clear-cache copy-env-testing generate-web-pages-and-schema build diff --git a/package.json b/package.json index 053db9e..d45fdca 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "license": "GPL", "description": "A UI/UX friendly applications to learn more about Modern Periodic Table of Elements", "scripts": { - "postinstall": "prettier-config-generate && make postinstall" + "postinstall": "prettier-config-generate" }, "devDependencies": { "@poolofdeath20/prettier-config-generator": "^0.0.1",