Skip to content

Commit ca39c50

Browse files
authored
App Hosting adapters, fix -staging links (in dev) (#364)
* Fix -staging links, fix lint * Support subpaths * Add app hosting adapters
1 parent 2d98bc1 commit ca39c50

File tree

13 files changed

+98
-66
lines changed

13 files changed

+98
-66
lines changed

config/additional_projects.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
"projects": [
3+
"FirebaseExtended::firebase-framework-tools::docs::angular",
4+
"FirebaseExtended::firebase-framework-tools::docs::nextjs",
5+
"FirebaseExtended::firebase-framework-tools::docs::astro",
6+
"FirebaseExtended::firebase-framework-tools::docs::nitro",
7+
"FirebaseExtended::firebase-framework-tools::docs::nuxt",
8+
"angular::angularfire2",
39
"angular::angularfire2",
410
"googlesamples::easypermissions",
511
"tylermcginnis::re-base",

firebase.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
{
1515
"source": "**",
16-
"destination": "/404.html"
16+
"destination": "/index.html"
1717
}
1818
]
1919
},

frontend/components/HeaderBar.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
to="/"
1616
class="logo"
1717
>
18-
<img src="@/assets/img/firebase-icon.svg" width="32" height="32">
18+
<img
19+
src="@/assets/img/firebase-icon.svg"
20+
width="32"
21+
height="32"
22+
>
1923
<span><strong>Firebase</strong> Open Source</span>
2024
</NuxtLink>
2125
</div>

frontend/components/HomePage.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ const subheaderTabs = [
6161
{ title: 'Web', href: '/platform/web' },
6262
{ title: 'Admin', href: '/platform/admin' },
6363
{ title: 'Games', href: '/platform/games' },
64+
{ title: 'App Hosting', href: '/platform/app_hosting' },
6465
] as const
6566
6667
const {

frontend/components/Project/Detail.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,8 @@ const info = {
9898
stars: projectConfig.stars,
9999
}
100100
101-
const projectPath = `/projects/${org}/${repo}`.toLowerCase()
102-
103101
const isStaging = env === Env.STAGING
102+
const projectPath = `/projects${isStaging ? '-staging' : ''}/${org}/${repo}`.toLowerCase()
104103
105104
function getSubheaderTabs() {
106105
const tabs = [

frontend/components/SearchInput.vue

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
11
<template>
22
<span ref="search">
3-
<button type="button" aria-label="Search (Command+K)" class="DocSearch DocSearch-Button">
3+
<button
4+
type="button"
5+
aria-label="Search (Command+K)"
6+
class="DocSearch DocSearch-Button"
7+
>
48
<span class="DocSearch-Button-Container">
5-
<svg width="20" height="20" viewBox="0 0 20 20" aria-hidden="true" class="DocSearch-Search-Icon">
6-
<path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
7-
</path>
9+
<svg
10+
width="20"
11+
height="20"
12+
viewBox="0 0 20 20"
13+
aria-hidden="true"
14+
class="DocSearch-Search-Icon"
15+
>
16+
<path
17+
d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z"
18+
stroke="currentColor"
19+
fill="none"
20+
fill-rule="evenodd"
21+
stroke-linecap="round"
22+
stroke-linejoin="round"
23+
/>
824
</svg>
925
<span class="DocSearch-Button-Placeholder">Search</span>
1026
</span>
@@ -19,7 +35,7 @@
1935
<script setup lang="ts">
2036
import docsearch from '@docsearch/js'
2137
22-
const search = ref("search");
38+
const search = ref('search')
2339
2440
onMounted(() => {
2541
docsearch({
@@ -29,9 +45,9 @@ onMounted(() => {
2945
indexName: 'firebaseopensource',
3046
placeholder: 'Find a project',
3147
})
32-
});
48+
})
3349
</script>
3450

3551
<style lang="scss">
3652
@use "../node_modules/@docsearch/css/dist/style.scss";
37-
</style>
53+
</style>

frontend/components/WelcomeCard.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
class="content welcomeCard"
99
>
1010
<div class="image">
11-
<img src="@/assets/img/firebase-github.png" width="213" height="160">
11+
<img
12+
src="@/assets/img/firebase-github.png"
13+
width="213"
14+
height="160"
15+
>
1216
</div>
1317
<div class="body">
1418
<h1>Firebase ❤️ Open Source</h1>

frontend/nuxt.config.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ export default async () => {
3535
type: 'image/x-icon',
3636
href: '/favicon.ico',
3737
}, {
38-
rel: "shortcut icon",
39-
href: "https://www.gstatic.com/devrel-devsite/prod/v38a693baeb774512feb42f10aac8f755d8791ed41119b5be7a531f8e16f8279f/firebase/images/favicon.png",
38+
rel: 'shortcut icon',
39+
href: 'https://www.gstatic.com/devrel-devsite/prod/v38a693baeb774512feb42f10aac8f755d8791ed41119b5be7a531f8e16f8279f/firebase/images/favicon.png',
4040
}, {
41-
rel: "apple-touch-icon",
42-
href: "https://www.gstatic.com/devrel-devsite/prod/v38a693baeb774512feb42f10aac8f755d8791ed41119b5be7a531f8e16f8279f/firebase/images/touchicon-180.png",
41+
rel: 'apple-touch-icon',
42+
href: 'https://www.gstatic.com/devrel-devsite/prod/v38a693baeb774512feb42f10aac8f755d8791ed41119b5be7a531f8e16f8279f/firebase/images/touchicon-180.png',
4343
}, {
4444
rel: 'preconnect',
4545
href: 'https://www.google-analytics.com',
@@ -62,8 +62,8 @@ gtag('config', 'UA-110728272-1');`,
6262
name: 'viewport',
6363
content: 'width=device-width, initial-scale=1',
6464
}, {
65-
content: "https://firebase.google.com/images/social.png",
66-
name: "image"
65+
content: 'https://firebase.google.com/images/social.png',
66+
name: 'image',
6767
}, {
6868
hid: 'description',
6969
name: 'description',

frontend/pages/projects/[org]/[repo]/[...parts].vue

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,41 @@
1010
</template>
1111

1212
<script setup lang="ts">
13+
definePageMeta({
14+
alias: ['/projects-staging/:org/:repo/:parts*'],
15+
})
16+
1317
const route = useRoute('projects-org-repo-parts')
1418
const org = route.params.org
1519
const repo = route.params.repo
16-
const subpageId = route.params.parts!.join('::')
20+
const subpageId = route.params.parts?.join?.('::')
1721
1822
const id = [org, repo].join('::')
1923
2024
const env = route.path.includes('-staging') ? Env.STAGING : Env.PROD
25+
const isStaging = env === Env.STAGING
26+
27+
if (isStaging) {
28+
useHead({
29+
meta: [
30+
{ 'http-equiv': 'Cache-Control', 'content': 'no-store' },
31+
{ name: 'robots', content: 'noindex, nofollow' },
32+
],
33+
})
34+
onMounted(() => {
35+
refreshConfig()
36+
refreshContent()
37+
})
38+
}
2139
22-
const [{ data: config }, { data: content }] = await Promise.all([
23-
useAsyncData(`projects/${org}/${repo}`, () => getProjectConfig(id, env)),
24-
useAsyncData(`projects/${org}/${repo}/${route.params.parts!.join('/')}`, () => getSubpage(id, env, subpageId)),
40+
const [
41+
{ data: config, refresh: refreshConfig },
42+
{ data: content, refresh: refreshContent },
43+
] = await Promise.all([
44+
useAsyncData(`projects${isStaging ? '-staging' : ''}/${org}/${repo}`, () => getProjectConfig(id, env)),
45+
useAsyncData(`projects${isStaging ? '-staging' : ''}/${org}/${repo}/${subpageId || ':README'}`, () =>
46+
subpageId ? getSubpage(id, env, subpageId) : getProjectContent(id, env),
47+
),
2548
])
2649
2750
let pageTitle = ''
@@ -31,6 +54,7 @@ if (config.value && content.value) {
3154
pageTitle = calculatePageTitle(content.value, config.value, repo)
3255
}
3356
else {
57+
// TODO do something better
3458
redirectTo = `http://github.com/${org}/${repo}`
3559
navigateTo(redirectTo, { external: true })
3660
}

frontend/pages/projects/[org]/[repo]/index.vue

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)