diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml new file mode 100644 index 00000000..b3c9c20f --- /dev/null +++ b/.github/workflows/deploy-preview.yml @@ -0,0 +1,62 @@ +name: Deploy Preview + +on: + pull_request: + +permissions: + contents: read + pull-requests: write + +jobs: + Site: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: amondnet/vercel-action@v25 + with: + vercel-version: 30.2.2 + github-comment: | + + + + + + + + + + + + + +
NameHack at UCI Site
PreviewVisit Preview
Commit{{deploymentCommit}}
+ github-token: ${{ secrets.GITHUB_TOKEN }} + vercel-token: ${{ secrets.VERCEL_TOKEN }} + vercel-org-id: ${{ vars.VERCEL_ORG_ID}} + vercel-project-id: ${{ vars.VERCEL_PROJECT_ID_SITE}} + Studio: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: amondnet/vercel-action@v25 + with: + vercel-version: 30.2.2 + github-comment: | + + + + + + + + + + + + + +
NameSanity Studio
PreviewVisit Preview
Commit{{deploymentCommit}}
+ github-token: ${{ secrets.GITHUB_TOKEN }} + vercel-token: ${{ secrets.VERCEL_TOKEN }} + vercel-org-id: ${{ vars.VERCEL_ORG_ID}} + vercel-project-id: ${{ vars.VERCEL_PROJECT_ID_STUDIO}} diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml new file mode 100644 index 00000000..af833b0d --- /dev/null +++ b/.github/workflows/deploy-prod.yml @@ -0,0 +1,36 @@ +name: Deploy Production + +on: + push: + branches: + - main + +permissions: + contents: read + pull-requests: write + +jobs: + Site: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: amondnet/vercel-action@v25 + with: + vercel-version: 30.2.2 + github-comment: false + vercel-args: "--prod" + vercel-token: ${{ secrets.VERCEL_TOKEN }} + vercel-org-id: ${{ vars.VERCEL_ORG_ID}} + vercel-project-id: ${{ vars.VERCEL_PROJECT_ID_SITE}} + Studio: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: amondnet/vercel-action@v25 + with: + vercel-version: 30.2.2 + github-comment: false + vercel-args: "--prod" + vercel-token: ${{ secrets.VERCEL_TOKEN }} + vercel-org-id: ${{ vars.VERCEL_ORG_ID}} + vercel-project-id: ${{ vars.VERCEL_PROJECT_ID_STUDIO}} diff --git a/apps/sanity/package.json b/apps/sanity/package.json index dc99d4b5..e85417aa 100644 --- a/apps/sanity/package.json +++ b/apps/sanity/package.json @@ -16,8 +16,9 @@ "sanity" ], "dependencies": { - "@sanity/icons": "^2.4.1", + "@portabletext/react": "^3.0.7", "@sanity/vision": "^3.15.1", + "lucide-react": "^0.271.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-is": "^18.2.0", @@ -33,4 +34,4 @@ "prettier": "^2.8.8", "typescript": "^4.9.5" } -} +} \ No newline at end of file diff --git a/apps/sanity/sanity.config.ts b/apps/sanity/sanity.config.ts index c59362ba..c35f943d 100644 --- a/apps/sanity/sanity.config.ts +++ b/apps/sanity/sanity.config.ts @@ -3,6 +3,7 @@ import { deskTool } from "sanity/desk"; import { visionTool } from "@sanity/vision"; import { media } from "sanity-plugin-media"; import { schemaTypes } from "./schemas"; +import { BadgeHelp } from "lucide-react"; export default defineConfig({ name: "default", @@ -11,7 +12,27 @@ export default defineConfig({ projectId: "1smqaeyk", dataset: "production", - plugins: [deskTool(), visionTool(), media()], + plugins: [ + deskTool({ + structure: (S) => + S.list() + .title("Content") + .items([ + S.listItem() + .title("FAQs") + .icon(BadgeHelp) + .child( + S.document().schemaType("faqs").documentId("faqs").title("FAQs") + ), + S.divider(), + ...S.documentTypeListItems().filter( + (listItem) => !["faqs"].includes(listItem.getId()!) + ), + ]), + }), + visionTool(), + media(), + ], schema: { types: schemaTypes, diff --git a/apps/sanity/schemas/clipboard.ts b/apps/sanity/schemas/clipboard.ts deleted file mode 100644 index a3fba571..00000000 --- a/apps/sanity/schemas/clipboard.ts +++ /dev/null @@ -1,42 +0,0 @@ -// schemas/clipboard.ts -import { defineType, defineField, defineArrayMember } from "sanity"; -import { ClipboardIcon } from "@sanity/icons"; - -export default defineType({ - name: "clipboard", - type: "document", - title: "Clipboards", - icon: ClipboardIcon, - fields: [ - defineField({ - name: "label", - type: "string", - title: "Label", - validation: (Rule) => Rule.required(), - }), - defineField({ - name: "clipboardImage", - type: "image", - title: "Image", - validation: (Rule) => Rule.required(), - }), - defineField({ - name: "description", - type: "array", - title: "Description", - of: [defineArrayMember({ type: "block" })], - }), - defineField({ - name: "tags", - type: "array", - title: "Tags", - of: [ - defineArrayMember({ - type: "reference", - to: [{ type: "tag" }], - name: "tag", - }), - ], - }), - ], -}); diff --git a/apps/sanity/schemas/faqs.ts b/apps/sanity/schemas/faqs.ts new file mode 100644 index 00000000..8e12bedf --- /dev/null +++ b/apps/sanity/schemas/faqs.ts @@ -0,0 +1,55 @@ +import { defineType, defineField, defineArrayMember } from "sanity"; +import { toPlainText } from "@portabletext/react"; +import { FileQuestion } from "lucide-react"; + +export default defineType({ + name: "faqs", + title: "FAQs", + type: "document", + fields: [ + defineField({ + name: "faqs", + title: "FAQs", + type: "array", + of: [ + defineArrayMember({ + type: "object", + name: "faq", + fields: [ + defineField({ + name: "question", + title: "Question", + type: "text", + }), + defineField({ + name: "answer", + title: "Answer", + type: "array", + of: [ + { + type: "block", + styles: [{ title: "Normal", value: "normal" }], + lists: [], + }, + ], + }), + ], + + preview: { + select: { + title: "question", + subtitle: "answer", + }, + prepare({ title, subtitle }) { + return { + title, + subtitle: subtitle ? toPlainText(subtitle) : undefined, + media: FileQuestion, + }; + }, + }, + }), + ], + }), + ], +}); diff --git a/apps/sanity/schemas/index.ts b/apps/sanity/schemas/index.ts index 9692eecf..65f60c24 100644 --- a/apps/sanity/schemas/index.ts +++ b/apps/sanity/schemas/index.ts @@ -1,7 +1,3 @@ -import stickers from "./stickers"; -import notes from "./notes"; -import clipboard from "./clipboard"; -import tags from "./tags"; -import paper from "./paper"; +import faqs from "./faqs"; -export const schemaTypes = [stickers, notes, clipboard, paper, tags]; +export const schemaTypes = [faqs]; diff --git a/apps/sanity/schemas/notes.ts b/apps/sanity/schemas/notes.ts deleted file mode 100644 index 262e1462..00000000 --- a/apps/sanity/schemas/notes.ts +++ /dev/null @@ -1,36 +0,0 @@ -// schemas/notes.ts -import { defineType, defineField, defineArrayMember } from "sanity"; -import { DocumentIcon } from "@sanity/icons"; - -export default defineType({ - name: "note", - type: "document", - title: "Notes", - icon: DocumentIcon, - fields: [ - defineField({ - name: "label", - type: "string", - title: "Label", - validation: (Rule) => Rule.required(), - }), - defineField({ - name: "noteImage", - type: "image", - title: "Image", - validation: (Rule) => Rule.required(), - }), - defineField({ - name: "description", - type: "array", - title: "Description", - of: [defineArrayMember({ type: "block" })], - }), - defineField({ - name: "tags", - type: "array", - title: "Tags", - of: [defineArrayMember({ type: "reference", to: [{ type: "tag" }] })], - }), - ], -}); diff --git a/apps/sanity/schemas/paper.ts b/apps/sanity/schemas/paper.ts deleted file mode 100644 index ccac59a7..00000000 --- a/apps/sanity/schemas/paper.ts +++ /dev/null @@ -1,36 +0,0 @@ -// schemas/paper.ts -import { defineType, defineField, defineArrayMember } from "sanity"; -import { DocumentSheetIcon } from "@sanity/icons"; - -export default defineType({ - name: "paper", - type: "document", - title: "Paper", - icon: DocumentSheetIcon, - fields: [ - defineField({ - name: "label", - type: "string", - title: "Label", - validation: (Rule) => Rule.required(), - }), - defineField({ - name: "paperImage", - type: "image", - title: "Image", - validation: (Rule) => Rule.required(), - }), - defineField({ - name: "description", - type: "array", - title: "Description", - of: [defineArrayMember({ type: "block" })], - }), - defineField({ - name: "tags", - type: "array", - title: "Tags", - of: [defineArrayMember({ type: "reference", to: [{ type: "tag" }] })], - }), - ], -}); diff --git a/apps/sanity/schemas/stickers.ts b/apps/sanity/schemas/stickers.ts deleted file mode 100644 index 8aa3a95c..00000000 --- a/apps/sanity/schemas/stickers.ts +++ /dev/null @@ -1,36 +0,0 @@ -// schemas/stickers.ts -import { defineType, defineField, defineArrayMember } from "sanity"; -import { ImageIcon } from "@sanity/icons"; - -export default defineType({ - name: "sticker", - type: "document", - title: "Stickers", - icon: ImageIcon, - fields: [ - defineField({ - name: "label", - type: "string", - title: "Label", - validation: (Rule) => Rule.required(), - }), - defineField({ - name: "stickerImage", - type: "image", - title: "Image", - validation: (Rule) => Rule.required(), - }), - defineField({ - title: "Description", - name: "description", - type: "array", - of: [defineArrayMember({ type: "block" })], - }), - defineField({ - name: "tags", - type: "array", - title: "Tags", - of: [defineArrayMember({ type: "reference", to: [{ type: "tag" }] })], - }), - ], -}); diff --git a/apps/sanity/schemas/tags.ts b/apps/sanity/schemas/tags.ts deleted file mode 100644 index b2398ac5..00000000 --- a/apps/sanity/schemas/tags.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { defineType, defineField } from "sanity"; - -export default defineType({ - name: "tag", - title: "Tag", - type: "document", - fields: [ - defineField({ - name: "tag_title", - type: "string", - title: "Tag", - }), - ], -}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 01db84b9..59d42f67 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,16 +19,19 @@ importers: version: 3.0.1 turbo: specifier: latest - version: 1.10.13 + version: 1.10.4 apps/sanity: dependencies: - '@sanity/icons': - specifier: ^2.4.1 - version: 2.4.1(react@18.2.0) + '@portabletext/react': + specifier: ^3.0.7 + version: 3.0.7(react@18.2.0) '@sanity/vision': specifier: ^3.15.1 version: 3.15.1(@babel/runtime@7.22.11)(@codemirror/lint@6.4.0)(@codemirror/state@6.2.1)(@codemirror/theme-one-dark@6.1.2)(@lezer/common@1.0.4)(codemirror@6.0.1)(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0)(styled-components@5.3.9) + lucide-react: + specifier: ^0.271.0 + version: 0.271.0(react@18.2.0) react: specifier: ^18.2.0 version: 18.2.0 @@ -2279,6 +2282,29 @@ packages: react: 18.2.0 dev: false + /@portabletext/react@3.0.7(react@18.2.0): + resolution: {integrity: sha512-Hx4rohr3rul/IQMDl07nRhdXLeey2fZPE/3Nbn0I+k8Zr5DsqKdkqMgkla3iBNS8h0a0LTSclS5GKVXoQlzrWg==} + engines: {node: ^14.13.1 || >=16.0.0} + peerDependencies: + react: ^17 || ^18 + dependencies: + '@portabletext/toolkit': 2.0.8 + '@portabletext/types': 2.0.6 + react: 18.2.0 + dev: false + + /@portabletext/toolkit@2.0.8: + resolution: {integrity: sha512-MI3FKYZiL+/dYsClkkTDRjSvNS7K4j+U2LNZ5XIEoq67qCY0l7CYjvT0fn+lFBEUxjegtEmbxLk6T9nV/iXA+Q==} + engines: {node: ^14.13.1 || >=16.0.0} + dependencies: + '@portabletext/types': 2.0.6 + dev: false + + /@portabletext/types@2.0.6: + resolution: {integrity: sha512-6iqorcsQ0Z1/4Y7PWLvoknyiUv0DngSPao+q5UIE0+0gT2cZwFdItUyLZRheG85AisSEvacHEEnvN+TT8mxXVg==} + engines: {node: ^14.13.1 || >=16.0.0 || >=18.0.0} + dev: false + /@reduxjs/toolkit@1.9.5(react-redux@7.2.9)(react@18.2.0): resolution: {integrity: sha512-Rt97jHmfTeaxL4swLRNPD/zV4OxTes4la07Xc4hetpUW/vc75t5m1ANyxG6ymnEQ2FsLQsoMlYB2vV1sO3m8tQ==} peerDependencies: @@ -2843,7 +2869,6 @@ packages: /@types/node@20.4.9: resolution: {integrity: sha512-8e2HYcg7ohnTUbHk8focoklEQYvemQmu9M/f43DZVx43kHn0tE3BY/6gSDxS7k0SprtS0NHvj+L80cGLnoOUcQ==} - dev: false /@types/node@20.5.6: resolution: {integrity: sha512-Gi5wRGPbbyOTX+4Y2iULQ27oUPrefaB0PxGQJnfyWN3kvEDGM3mIB5M/gQLmitZf7A9FmLeaqxD3L1CXpm3VKQ==} @@ -6261,6 +6286,14 @@ packages: engines: {node: '>=12'} dev: true + /lucide-react@0.271.0(react@18.2.0): + resolution: {integrity: sha512-oc3/6m7gg/5E9FsX0F7t7DOuBiafsLTwg5/f0hJUJYePbmLmCXpZj1OESilmaUSwXGztawV7V12ZXBfAb8wRAA==} + peerDependencies: + react: ^16.5.1 || ^17.0.0 || ^18.0.0 + dependencies: + react: 18.2.0 + dev: false + /make-dir@3.1.0: resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} engines: {node: '>=8'} @@ -8372,7 +8405,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.5.6 + '@types/node': 20.4.9 acorn: 8.10.0 acorn-walk: 8.2.0 arg: 4.1.3 @@ -8419,64 +8452,65 @@ packages: safe-buffer: 5.2.1 dev: false - /turbo-darwin-64@1.10.13: - resolution: {integrity: sha512-vmngGfa2dlYvX7UFVncsNDMuT4X2KPyPJ2Jj+xvf5nvQnZR/3IeDEGleGVuMi/hRzdinoxwXqgk9flEmAYp0Xw==} + /turbo-darwin-64@1.10.4: + resolution: {integrity: sha512-oAILq0QZUvOxYZU71SXRsL7DFpqZutPl9CX7+rD48tReHrmhcm3HMeuAFY0S5FD/9fKub04UfAQwVtJSlhvISg==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-darwin-arm64@1.10.13: - resolution: {integrity: sha512-eMoJC+k7gIS4i2qL6rKmrIQGP6Wr9nN4odzzgHFngLTMimok2cGLK3qbJs5O5F/XAtEeRAmuxeRnzQwTl/iuAw==} + /turbo-darwin-arm64@1.10.4: + resolution: {integrity: sha512-N0XPFLXsZRLE6gKDa5MREpPQp0drOz9PrADaaMXTlspxWS/tmmxyH+ZQ/uGqKC/0mqsNIhZuSFsEVZe1PGaqxw==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-linux-64@1.10.13: - resolution: {integrity: sha512-0CyYmnKTs6kcx7+JRH3nPEqCnzWduM0hj8GP/aodhaIkLNSAGAa+RiYZz6C7IXN+xUVh5rrWTnU2f1SkIy7Gdg==} + /turbo-linux-64@1.10.4: + resolution: {integrity: sha512-S8ZVNCPnrBU+GMKKUWcgg4MaTOdL1reOU1XQtDiHfEPskXjLE+10vr65xJJQb6CqO8ARFXUlFSAUfxZRX6WVNA==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-linux-arm64@1.10.13: - resolution: {integrity: sha512-0iBKviSGQQlh2OjZgBsGjkPXoxvRIxrrLLbLObwJo3sOjIH0loGmVIimGS5E323soMfi/o+sidjk2wU1kFfD7Q==} + /turbo-linux-arm64@1.10.4: + resolution: {integrity: sha512-/C6vpo7kd2ae6dR0iZyRuvfjijuixidhwLzV026A+/1gmAMRXYkslBfgOGfoOquHmvqjCeDVTsMWwCY2NRQqtw==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-windows-64@1.10.13: - resolution: {integrity: sha512-S5XySRfW2AmnTeY1IT+Jdr6Goq7mxWganVFfrmqU+qqq3Om/nr0GkcUX+KTIo9mPrN0D3p5QViBRzulwB5iuUQ==} + /turbo-windows-64@1.10.4: + resolution: {integrity: sha512-fh6X/fJl9gNTu3r7zMmwCychxMlpQMFn32bpioPNIBxrTHCbQYeGSQuw2XWa/RswgNzCY3Xo34emYAKu9btrsw==} cpu: [x64] os: [win32] requiresBuild: true dev: true optional: true - /turbo-windows-arm64@1.10.13: - resolution: {integrity: sha512-nKol6+CyiExJIuoIc3exUQPIBjP9nIq5SkMJgJuxsot2hkgGrafAg/izVDRDrRduQcXj2s8LdtxJHvvnbI8hEQ==} + /turbo-windows-arm64@1.10.4: + resolution: {integrity: sha512-KzcKGl+bjwaSkxMNTutuoIM+xPuTBA13zJiC2vFM7fQ6XYM0/ZmUekfoxpMnWgSav8vlTk5tRYaPniLcVzLnTQ==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /turbo@1.10.13: - resolution: {integrity: sha512-vOF5IPytgQPIsgGtT0n2uGZizR2N3kKuPIn4b5p5DdeLoI0BV7uNiydT7eSzdkPRpdXNnO8UwS658VaI4+YSzQ==} + /turbo@1.10.4: + resolution: {integrity: sha512-EVBt762wVGyZAXtp1UWQptRG2N/9TThUJ1tRawvt/pmB62VmdzgDuz80SQYXK5U5yKEID6OJdqAzq8HnIQVA6g==} hasBin: true + requiresBuild: true optionalDependencies: - turbo-darwin-64: 1.10.13 - turbo-darwin-arm64: 1.10.13 - turbo-linux-64: 1.10.13 - turbo-linux-arm64: 1.10.13 - turbo-windows-64: 1.10.13 - turbo-windows-arm64: 1.10.13 + turbo-darwin-64: 1.10.4 + turbo-darwin-arm64: 1.10.4 + turbo-linux-64: 1.10.4 + turbo-linux-arm64: 1.10.4 + turbo-windows-64: 1.10.4 + turbo-windows-arm64: 1.10.4 dev: true /type-check@0.4.0: