From 8800fff1e87afec1f18042722c16d7a7a2c91ea3 Mon Sep 17 00:00:00 2001 From: Francisco Marques Date: Fri, 12 May 2023 18:40:08 +0100 Subject: [PATCH 1/3] updated i18n --- src/lib/i18n/data.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/i18n/data.json b/src/lib/i18n/data.json index e8cd93bc..bb59ed68 100644 --- a/src/lib/i18n/data.json +++ b/src/lib/i18n/data.json @@ -75,8 +75,8 @@ "tictactoe.draw": "It's a Draw!", "tictactoe.your-turn": "Your turn", "tictactoe.wait": "Wait for your turn", - "handbook.draft.title": "This is a draft", - "handbook.draft.description": "We're working on this page and it's due to be updated soon. Please check again later for some fresh new content.", + "handbook.draft.title": "This is a draft.", + "handbook.draft.description": "Our team is currently cracking away at creating more content to make our Handbook something increggdible. Soon, you'll be able to explore it fully. In the meantime, think of it as a carton of eggs, each section packed with the potential to deliver something eggceptional.", "draw-segg.title": "Your very own Segg?", "draw-segg.description": "Head over to our careers page, release your inner Basquiat and start your own Significa egg from scratch.", "draw-segg.cta": "Get my Segg", From c123190a4ec41228bbe2b7b34549e85b8ee54eec Mon Sep 17 00:00:00 2001 From: Francisco Marques Date: Fri, 12 May 2023 18:49:33 +0100 Subject: [PATCH 2/3] datasources.ts: better error handling when var is missing --- scripts/datasources.ts | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/scripts/datasources.ts b/scripts/datasources.ts index ebd31c62..5a5865df 100644 --- a/scripts/datasources.ts +++ b/scripts/datasources.ts @@ -5,8 +5,14 @@ import { apiPlugin, storyblokInit } from '@storyblok/js'; dotenv.config(); +const PUBLIC_STORYBLOK_TOKEN = process.env.PUBLIC_STORYBLOK_TOKEN; + +if (!PUBLIC_STORYBLOK_TOKEN) { + throw new Error('Missing required env var: PUBLIC_STORYBLOK_TOKEN'); +} + const { storyblokApi } = storyblokInit({ - accessToken: process.env.PUBLIC_STORYBLOK_TOKEN, + accessToken: PUBLIC_STORYBLOK_TOKEN, use: [apiPlugin], apiOptions: { https: true @@ -33,19 +39,15 @@ const entries: Config[] = [ fetcher: async () => { const strings: Record = {}; - try { - const translationsRes = await storyblok.get('cdn/datasource_entries', { - datasource: 'strings', - per_page: 1000, - cv: Date.now() - }); - const entries: Datasource[] = translationsRes.data.datasource_entries; - entries.forEach((entry) => { - strings[entry.name] = entry.value; - }); - } catch (error) { - throw new Error(`Failed to get strings`); - } + const translationsRes = await storyblok.get('cdn/datasource_entries', { + datasource: 'strings', + per_page: 1000, + cv: Date.now() + }); + const entries: Datasource[] = translationsRes.data.datasource_entries; + entries.forEach((entry) => { + strings[entry.name] = entry.value; + }); return { keys: Object.keys(strings), From ae3db5ce25dbbe232cafbd294b33c3ef236ede01 Mon Sep 17 00:00:00 2001 From: Francisco Marques Date: Fri, 12 May 2023 18:49:56 +0100 Subject: [PATCH 3/3] added install and build command to vercel.json --- vercel.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vercel.json b/vercel.json index 95c74a14..a5a88771 100644 --- a/vercel.json +++ b/vercel.json @@ -1,4 +1,7 @@ { + "installCommand": "npm ci --prefer-offline --no-audit --no-fund", + "buildCommand": "npm run build", + "framework": "sveltekit", "redirects": [ { "source": "/showcase/:path", "destination": "/projects/:path", "permanent": true }, {