Skip to content

Commit

Permalink
Merge branch 'firebase-prod' into remove-supabase
Browse files Browse the repository at this point in the history
  • Loading branch information
codyzu committed Jul 6, 2023
2 parents 128fb56 + d4a4077 commit 5850522
Show file tree
Hide file tree
Showing 22 changed files with 2,182 additions and 158 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@ dist-ssr
src/presentations/thumbs
TODO.md
*.serviceaccount.json

# Don't commit auto generated icons
public/apple-touch-icon-*.png
public/favicon.ico
public/maskable-icon-*.png
public/pwa-*.png
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20
v18
27 changes: 27 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@
}
],
"headers": [
{
"source": "/**",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=0, s-maxage=3600"
}
]
},
{
"source": "**/assets/*",
"headers": [
Expand All @@ -33,6 +42,24 @@
"value": "max-age=604800, immutable"
}
]
},
{
"source": "/workbox-*.js",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=604800, immutable"
}
]
},
{
"source": "/*.@(png|ico|svg)",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=3600"
}
]
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion functions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const renderForBot = onRequest(async (request, response) => {
return;
}

logger.info('bot', {userAgent: request.get('user-agent')});
// Logger.info('bot', {userAgent: request.get('user-agent')});

const presentationId = request.path.split('/')[2];

Expand Down
4 changes: 4 additions & 0 deletions functions/src/presentation.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
export type Doc = {
id: string;
};

// TODO: use this when uploading
export type PresentationData = {
title: string;
thumb: string;
pages: string[];
notes: Note[];
uid: string;
username: string;
// TODO: use this in function metadata
twitterHandle: string;
thumbIndex?: number;
};
export type PresentationDoc = Doc & PresentationData;
Expand Down
10 changes: 10 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,23 @@

<head>
<meta charset="UTF-8" />

<!-- Make fonts work offline: https://vite-pwa-org.netlify.app/workbox/generate-sw.html -->
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
<link rel="preconnect" crossorigin="anonymous" href="https://fonts.gstatic.com">

<!-- Favicons inspired from: https://evilmartians.com/chronicles/how-to-favicon-in-2021-six-files-that-fit-most-needs -->
<link rel="icon" href="/favicon.ico" sizes="any" />
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="mask-icon" href="/mask-icon.svg" color="#000000">
<link rel="manifest" href="/manifest.webmanifest" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<!-- PWA minimum: https://vite-pwa-org.netlify.app/guide/pwa-minimal-requirements.html -->
<meta property="description" content="Interactive presentations, for free.">
<meta name="theme-color" content="#000000">

<!-- Inspired from: https://css-tricks.com/essential-meta-tags-social-media/#aa-final-markup -->
<!-- Essential META Tags -->
<meta property="og:title" content="Slidr.app">
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
"prepare": "husky install",
"prepush": "pnpm run lint && pnpm run build:all",
"build:functions": "pnpm --dir functions build",
"build:all": "pnpm run build && pnpm run build:functions",
"deploy": "firebase deploy"
"build:all": "pwa-assets-generator && pnpm run build && pnpm run build:functions",
"deploy": "firebase deploy",
"generate-pwa-assets": "pwa-assets-generator"
},
"dependencies": {
"@unocss/reset": "^0.53.3",
Expand Down Expand Up @@ -46,6 +47,7 @@
"@unocss/preset-web-fonts": "^0.53.3",
"@unocss/transformer-directives": "^0.53.3",
"@unocss/transformer-variant-group": "^0.53.3",
"@vite-pwa/assets-generator": "^0.0.3",
"@vitejs/plugin-react": "^4.0.0",
"eslint": "^8.41.0",
"eslint-config-xo-react": "^0.27.0",
Expand All @@ -61,7 +63,9 @@
"unocss": "^0.53.3",
"vite": "^4.3.9",
"vite-imagetools": "^5.0.4",
"vite-plugin-pwa": "^0.16.4",
"vite-plugin-run": "^0.4.1",
"workbox-window": "^7.0.0",
"xo": "^0.54.2"
}
}
Loading

0 comments on commit 5850522

Please sign in to comment.