refactor: remove firebase functions, remove old index.html, remove many unused files

This commit is contained in:
2025-07-16 11:59:37 -05:00
parent fa924a26be
commit ca2a6c3839
18 changed files with 1 additions and 10943 deletions
-5
View File
@@ -1,5 +0,0 @@
{
"projects": {
"default": "the-office-0x3401"
}
}
-25
View File
@@ -1,25 +0,0 @@
name: Deploy to Firebase Hosting on merge
on:
workflow_dispatch:
env:
VUE_APP_ALGOLIA_APP_ID: '${{ secrets.ALGOLIA_APP_ID }}'
VUE_APP_ALGOLIA_API_KEY: '${{ secrets.ALGOLIA_API_KEY }}'
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
- run: yarn install
- run: yarn run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_THE_OFFICE_0X3401 }}'
channelId: live
projectId: the-office-0x3401
-25
View File
@@ -1,25 +0,0 @@
name: Deploy to Firebase Hosting on PR
on:
workflow_dispatch:
env:
VUE_APP_ALGOLIA_APP_ID: '${{ secrets.ALGOLIA_APP_ID }}'
VUE_APP_ALGOLIA_API_KEY: '${{ secrets.ALGOLIA_API_KEY }}'
jobs:
build_and_preview:
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
- run: yarn install
- run: yarn run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_THE_OFFICE_0X3401 }}'
projectId: the-office-0x3401
Vendored
-1
View File
@@ -30,7 +30,6 @@ coverage
*.scss.css.map
build
*.cache
my-vue-app/
# .env files
.env
-13
View File
@@ -1,13 +0,0 @@
- Switch to Firebase Hosting
- Likes hosted on Firestore & Cloud Functions
- Switch to XML representation
```xml
<SceneList>
<Scene id="oa3nf4gkgjX">
<Quote character="Michael">
This is the quote body.
</Quote>
</Scene>
</SceneList>
```
- Add unique ID to all quotes to preserve likes
-29
View File
@@ -1,29 +0,0 @@
{
"hosting": {
"public": "build",
"predeploy": [
"yarn run build"
],
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "/api/surrounding",
"function": "surrounding"
},
{
"source": "**",
"destination": "/index.html"
}
]
},
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint",
"npm --prefix \"$RESOURCE_DIR\" run build"
]
}
}
-34
View File
@@ -1,34 +0,0 @@
module.exports = {
root: true,
env: {
es6: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"google",
"plugin:@typescript-eslint/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: ["tsconfig.json", "tsconfig.dev.json"],
sourceType: "module",
},
ignorePatterns: [
"/lib/**/*", // Ignore built files.
],
plugins: [
"@typescript-eslint",
"import",
],
rules: {
"quotes": ["error", "double"],
"import/no-unresolved": 0,
"indent": ["warn", 4],
"@typescript-eslint/no-var-requires": 0,
"max-len": ["warn", 120],
},
};
-9
View File
@@ -1,9 +0,0 @@
# Compiled JavaScript files
lib/**/*.js
lib/**/*.js.map
# TypeScript v1 declaration files
typings/
# Node.js dependency directory
node_modules/
-7767
View File
File diff suppressed because it is too large Load Diff
-32
View File
@@ -1,32 +0,0 @@
{
"name": "functions",
"scripts": {
"lint": "eslint --ext .js,.ts .",
"build": "tsc",
"build:watch": "tsc --watch",
"serve": "npm run build && firebase emulators:start --only functions",
"shell": "npm run build && firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "16"
},
"main": "lib/index.js",
"dependencies": {
"@google-cloud/storage": "^5.20.5",
"firebase-admin": "^10.0.2",
"firebase-functions": "^3.18.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.12.0",
"@typescript-eslint/parser": "^5.12.0",
"eslint": "^8.9.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-import": "^2.25.4",
"firebase-functions-test": "^0.2.0",
"typescript": "^4.5.4"
},
"private": true
}
File diff suppressed because one or more lines are too long
-65
View File
@@ -1,65 +0,0 @@
import * as functions from "firebase-functions";
import {Storage} from "@google-cloud/storage";
const storage = new Storage();
const bucket = storage.bucket("the-office-episode-data");
const file = bucket.file("data.json");
let quoteData: any = null;
// // Start writing Firebase Functions
// // https://firebase.google.com/docs/functions/typescript
export const surrounding = functions.https.onRequest(
async (request, response) => {
const params = {season: -1, episode: -1, scene: -1, quote: -1, radius: -1};
try {
params.season = Number(request.query.season);
params.episode = Number(request.query.episode);
params.scene = Number(request.query.scene);
params.quote = Number(request.query.quote);
} catch (e) {
response.send("Error processing parameters.").end();
return;
}
// Quote radius
const minRadius = 1;
const maxRadius = 5;
const defaultRadius = 2;
params.radius = Math.min(Math.max(Number(request.query.radius) || defaultRadius, minRadius), maxRadius);
// Check that all query parameters were given correctly.
for (const [k, v] of Object.entries(params)) {
if (v == null || v == -1 || v == undefined || isNaN(v)) {
response.send(`Parameter '${k}' was not specified or was fed an invalid integer. (${v})`).end();
return;
}
}
// Load quote data if not loaded already
if (quoteData == null) {
const content = await file.download();
quoteData = JSON.parse(content[0].toString("utf-8"));
}
const sceneData: never[] = quoteData[params.season - 1][params.episode - 1]["scenes"][params.scene - 1].quotes;
const surrounding = {center: sceneData[params.quote - 1], above: [], below: []};
const quoteIndex = params.quote - 1;
if (params.radius > 0) {
for (let i = 0; i < params.radius; i++) {
const topIndex = quoteIndex - (i + 1);
const bottomIndex = quoteIndex + (i + 1);
if (topIndex >= 0) {
surrounding.above.splice(0, 0, sceneData[topIndex]);
}
if (bottomIndex < sceneData.length) {
surrounding.below.push(sceneData[bottomIndex]);
}
}
}
response.send({...surrounding, params}).end();
});
-5
View File
@@ -1,5 +0,0 @@
{
"include": [
".eslintrc.js"
]
}
-15
View File
@@ -1,15 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"noImplicitReturns": true,
"noUnusedLocals": true,
"outDir": "lib",
"sourceMap": true,
"strict": true,
"target": "es2017"
},
"compileOnSave": true,
"include": [
"src"
]
}
-2747
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
<title>the-office</title>
</head>
<body>
<div id="app"></div>
-168
View File
@@ -1,168 +0,0 @@
<!DOCTYPE html>
<html lang="en" data-build-timestamp-utc="<%= new Date().toISOString() %>">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<base href="/"/>
</head>
<style>
body {
background: #0a0a0a;
}
.cssload-loader {
position: absolute;
top: calc(50% - 100px);
left: calc(50% - 100px);
width: 100px;
height: 100px;
-webkit-perspective: 780px;
perspective: 780px;
}
.cssload-inner {
position: absolute;
width: 100%;
height: 100%;
box-sizing: border-box;
-o-box-sizing: border-box;
-ms-box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
border-radius: 50%;
-o-border-radius: 50%;
-ms-border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
}
.cssload-inner.cssload-one {
left: 0%;
top: 0%;
animation: cssload-rotate-one 1.15s linear infinite;
-o-animation: cssload-rotate-one 1.15s linear infinite;
-ms-animation: cssload-rotate-one 1.15s linear infinite;
-webkit-animation: cssload-rotate-one 1.15s linear infinite;
-moz-animation: cssload-rotate-one 1.15s linear infinite;
border-bottom: 3px solid #5c5edc;
}
.cssload-inner.cssload-two {
right: 0%;
top: 0%;
animation: cssload-rotate-two 1.15s linear infinite;
-o-animation: cssload-rotate-two 1.15s linear infinite;
-ms-animation: cssload-rotate-two 1.15s linear infinite;
-webkit-animation: cssload-rotate-two 1.15s linear infinite;
-moz-animation: cssload-rotate-two 1.15s linear infinite;
border-right: 3px solid rgba(76, 70, 101, 0.99);
}
.cssload-inner.cssload-three {
right: 0%;
bottom: 0%;
animation: cssload-rotate-three 1.15s linear infinite;
-o-animation: cssload-rotate-three 1.15s linear infinite;
-ms-animation: cssload-rotate-three 1.15s linear infinite;
-webkit-animation: cssload-rotate-three 1.15s linear infinite;
-moz-animation: cssload-rotate-three 1.15s linear infinite;
border-top: 3px solid #e9908a;
}
@keyframes cssload-rotate-one {
0% {
-webkit-transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg);
transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg);
}
100% {
-webkit-transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg);
transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg);
}
}
@-webkit-keyframes cssload-rotate-one {
0% {
-webkit-transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg);
}
100% {
-webkit-transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg);
}
}
@keyframes cssload-rotate-two {
0% {
-webkit-transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg);
transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg);
}
100% {
-webkit-transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg);
transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg);
}
}
@-webkit-keyframes cssload-rotate-two {
0% {
-webkit-transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg);
}
100% {
-webkit-transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg);
}
}
@keyframes cssload-rotate-three {
0% {
-webkit-transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg);
transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg);
}
100% {
-webkit-transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg);
transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg);
}
}
@-webkit-keyframes cssload-rotate-three {
0% {
-webkit-transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg);
}
100% {
-webkit-transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg);
}
}
</style>
<script>
var ALGOLIA_INSIGHTS_SRC = "https://cdn.jsdelivr.net/npm/search-insights@1.3.1";
!function (e, a, t, n, s, i, c) {
e.AlgoliaAnalyticsObject = s, e[s] = e[s] || function () {
(e[s].queue = e[s].queue || []).push(arguments)
}, i = a.createElement(t), c = a.getElementsByTagName(t)[0],
i.async = 1, i.src = n, c.parentNode.insertBefore(i, c)
}(window, document, "script", ALGOLIA_INSIGHTS_SRC, "aa");
// Initialize library
aa('init', {
appId: "<%= VUE_APP_ALGOLIA_APP_ID %>",
apiKey: "<%= VUE_APP_ALGOLIA_API_KEY %>"
});
</script>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript
enabled. Please enable it to continue.</strong>
</noscript>
<div id="app">
<div id="loading-wrapper">
<div class='cssload-loader'>
<div class='cssload-inner cssload-one'></div>
<div class='cssload-inner cssload-two'></div>
<div class='cssload-inner cssload-three'></div>
</div>
</div>
</div>
<!-- built files will be auto injected -->
</body>
</html>
-1
View File
@@ -1 +0,0 @@
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}