Skip to content

Commit 61a674e

Browse files
Firebase (#34)
* Firebase * style: format code with ClangFormat, dotnet-format, Prettier, RuboCop, Rustfmt, Scalafmt, StandardJS, StandardRB and swift-format This commit fixes the style issues introduced in 44d480c according to the output from ClangFormat, dotnet-format, Prettier, RuboCop, Rustfmt, Scalafmt, StandardJS, StandardRB and swift-format. Details: #34 --------- Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
1 parent 10dbfc5 commit 61a674e

7 files changed

Lines changed: 388 additions & 0 deletions

File tree

β€Ž.firebasercβ€Ž

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "tools-b6884"
4+
}
5+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This file was auto-generated by the Firebase CLI
2+
# https://github.com/firebase/firebase-tools
3+
4+
name: Deploy to Firebase Hosting on merge
5+
on:
6+
push:
7+
branches:
8+
- main
9+
jobs:
10+
build_and_deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- run: npm ci && npm run build
15+
- uses: FirebaseExtended/action-hosting-deploy@v0
16+
with:
17+
repoToken: ${{ secrets.GITHUB_TOKEN }}
18+
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_TOOLS_B6884 }}
19+
channelId: live
20+
projectId: tools-b6884
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This file was auto-generated by the Firebase CLI
2+
# https://github.com/firebase/firebase-tools
3+
4+
name: Deploy to Firebase Hosting on PR
5+
on: pull_request
6+
permissions:
7+
checks: write
8+
contents: read
9+
pull-requests: write
10+
jobs:
11+
build_and_preview:
12+
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- run: npm ci && npm run build
17+
- uses: FirebaseExtended/action-hosting-deploy@v0
18+
with:
19+
repoToken: ${{ secrets.GITHUB_TOKEN }}
20+
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_TOOLS_B6884 }}
21+
projectId: tools-b6884

β€Ž.gitignoreβ€Ž

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
firebase-debug.log*
8+
firebase-debug.*.log*
9+
10+
# Firebase cache
11+
.firebase/
12+
13+
# Firebase config
14+
15+
# Uncomment this if you'd like others to create their own Firebase project.
16+
# For a team working on the same Firebase project(s), it is recommended to leave
17+
# it commented so all members can deploy to the same project(s) in .firebaserc.
18+
# .firebaserc
19+
20+
# Runtime data
21+
pids
22+
*.pid
23+
*.seed
24+
*.pid.lock
25+
26+
# Directory for instrumented libs generated by jscoverage/JSCover
27+
lib-cov
28+
29+
# Coverage directory used by tools like istanbul
30+
coverage
31+
32+
# nyc test coverage
33+
.nyc_output
34+
35+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
36+
.grunt
37+
38+
# Bower dependency directory (https://bower.io/)
39+
bower_components
40+
41+
# node-waf configuration
42+
.lock-wscript
43+
44+
# Compiled binary addons (http://nodejs.org/api/addons.html)
45+
build/Release
46+
47+
# Dependency directories
48+
node_modules/
49+
50+
# Optional npm cache directory
51+
.npm
52+
53+
# Optional eslint cache
54+
.eslintcache
55+
56+
# Optional REPL history
57+
.node_repl_history
58+
59+
# Output of 'npm pack'
60+
*.tgz
61+
62+
# Yarn Integrity file
63+
.yarn-integrity
64+
65+
# dotenv environment variables file
66+
.env
67+
68+
# dataconnect generated files
69+
.dataconnect

β€Žfirebase.jsonβ€Ž

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"hosting": {
3+
"public": "public",
4+
"ignore": [
5+
"firebase.json",
6+
"**/.*",
7+
"**/node_modules/**"
8+
]
9+
}
10+
}

β€Žpublic/404.htmlβ€Ž

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
<title>Page Not Found</title>
7+
8+
<style media="screen">
9+
body {
10+
background: #eceff1;
11+
color: rgba(0, 0, 0, 0.87);
12+
font-family: Roboto, Helvetica, Arial, sans-serif;
13+
margin: 0;
14+
padding: 0;
15+
}
16+
#message {
17+
background: white;
18+
max-width: 360px;
19+
margin: 100px auto 16px;
20+
padding: 32px 24px 16px;
21+
border-radius: 3px;
22+
}
23+
#message h3 {
24+
color: #888;
25+
font-weight: normal;
26+
font-size: 16px;
27+
margin: 16px 0 12px;
28+
}
29+
#message h2 {
30+
color: #ffa100;
31+
font-weight: bold;
32+
font-size: 16px;
33+
margin: 0 0 8px;
34+
}
35+
#message h1 {
36+
font-size: 22px;
37+
font-weight: 300;
38+
color: rgba(0, 0, 0, 0.6);
39+
margin: 0 0 16px;
40+
}
41+
#message p {
42+
line-height: 140%;
43+
margin: 16px 0 24px;
44+
font-size: 14px;
45+
}
46+
#message a {
47+
display: block;
48+
text-align: center;
49+
background: #039be5;
50+
text-transform: uppercase;
51+
text-decoration: none;
52+
color: white;
53+
padding: 16px;
54+
border-radius: 4px;
55+
}
56+
#message,
57+
#message a {
58+
box-shadow:
59+
0 1px 3px rgba(0, 0, 0, 0.12),
60+
0 1px 2px rgba(0, 0, 0, 0.24);
61+
}
62+
#load {
63+
color: rgba(0, 0, 0, 0.4);
64+
text-align: center;
65+
font-size: 13px;
66+
}
67+
@media (max-width: 600px) {
68+
body,
69+
#message {
70+
margin-top: 0;
71+
background: white;
72+
box-shadow: none;
73+
}
74+
body {
75+
border-top: 16px solid #ffa100;
76+
}
77+
}
78+
</style>
79+
</head>
80+
<body>
81+
<div id="message">
82+
<h2>404</h2>
83+
<h1>Page Not Found</h1>
84+
<p>
85+
The specified file was not found on this website. Please check the URL
86+
for mistakes and try again.
87+
</p>
88+
<h3>Why am I seeing this?</h3>
89+
<p>
90+
This page was generated by the Firebase Command-Line Interface. To
91+
modify it, edit the <code>404.html</code> file in your project's
92+
configured <code>public</code> directory.
93+
</p>
94+
</div>
95+
</body>
96+
</html>

β€Žpublic/index.htmlβ€Ž

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
<title>Welcome to Firebase Hosting</title>
7+
8+
<!-- update the version number as needed -->
9+
<script defer src="/__/firebase/11.6.0/firebase-app-compat.js"></script>
10+
<!-- include only the Firebase features as you need -->
11+
<script defer src="/__/firebase/11.6.0/firebase-auth-compat.js"></script>
12+
<script
13+
defer
14+
src="/__/firebase/11.6.0/firebase-database-compat.js"
15+
></script>
16+
<script
17+
defer
18+
src="/__/firebase/11.6.0/firebase-firestore-compat.js"
19+
></script>
20+
<script
21+
defer
22+
src="/__/firebase/11.6.0/firebase-functions-compat.js"
23+
></script>
24+
<script
25+
defer
26+
src="/__/firebase/11.6.0/firebase-messaging-compat.js"
27+
></script>
28+
<script defer src="/__/firebase/11.6.0/firebase-storage-compat.js"></script>
29+
<script
30+
defer
31+
src="/__/firebase/11.6.0/firebase-analytics-compat.js"
32+
></script>
33+
<script
34+
defer
35+
src="/__/firebase/11.6.0/firebase-remote-config-compat.js"
36+
></script>
37+
<script
38+
defer
39+
src="/__/firebase/11.6.0/firebase-performance-compat.js"
40+
></script>
41+
<!--
42+
initialize the SDK after all desired features are loaded, set useEmulator to false
43+
to avoid connecting the SDK to running emulators.
44+
-->
45+
<script defer src="/__/firebase/init.js?useEmulator=true"></script>
46+
47+
<style media="screen">
48+
body {
49+
background: #eceff1;
50+
color: rgba(0, 0, 0, 0.87);
51+
font-family: Roboto, Helvetica, Arial, sans-serif;
52+
margin: 0;
53+
padding: 0;
54+
}
55+
#message {
56+
background: white;
57+
max-width: 360px;
58+
margin: 100px auto 16px;
59+
padding: 32px 24px;
60+
border-radius: 3px;
61+
}
62+
#message h2 {
63+
color: #ffa100;
64+
font-weight: bold;
65+
font-size: 16px;
66+
margin: 0 0 8px;
67+
}
68+
#message h1 {
69+
font-size: 22px;
70+
font-weight: 300;
71+
color: rgba(0, 0, 0, 0.6);
72+
margin: 0 0 16px;
73+
}
74+
#message p {
75+
line-height: 140%;
76+
margin: 16px 0 24px;
77+
font-size: 14px;
78+
}
79+
#message a {
80+
display: block;
81+
text-align: center;
82+
background: #039be5;
83+
text-transform: uppercase;
84+
text-decoration: none;
85+
color: white;
86+
padding: 16px;
87+
border-radius: 4px;
88+
}
89+
#message,
90+
#message a {
91+
box-shadow:
92+
0 1px 3px rgba(0, 0, 0, 0.12),
93+
0 1px 2px rgba(0, 0, 0, 0.24);
94+
}
95+
#load {
96+
color: rgba(0, 0, 0, 0.4);
97+
text-align: center;
98+
font-size: 13px;
99+
}
100+
@media (max-width: 600px) {
101+
body,
102+
#message {
103+
margin-top: 0;
104+
background: white;
105+
box-shadow: none;
106+
}
107+
body {
108+
border-top: 16px solid #ffa100;
109+
}
110+
}
111+
</style>
112+
</head>
113+
<body>
114+
<div id="message">
115+
<h2>Welcome</h2>
116+
<h1>Firebase Hosting Setup Complete</h1>
117+
<p>
118+
You're seeing this because you've successfully setup Firebase Hosting.
119+
Now it's time to go build something extraordinary!
120+
</p>
121+
<a target="_blank" href="https://firebase.google.com/docs/hosting/"
122+
>Open Hosting Documentation</a
123+
>
124+
</div>
125+
<p id="load">Firebase SDK Loading&hellip;</p>
126+
127+
<script>
128+
document.addEventListener("DOMContentLoaded", function () {
129+
const loadEl = document.querySelector("#load");
130+
// // πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯
131+
// // The Firebase SDK is initialized and available here!
132+
//
133+
// firebase.auth().onAuthStateChanged(user => { });
134+
// firebase.database().ref('/path/to/ref').on('value', snapshot => { });
135+
// firebase.firestore().doc('/foo/bar').get().then(() => { });
136+
// firebase.functions().httpsCallable('yourFunction')().then(() => { });
137+
// firebase.messaging().requestPermission().then(() => { });
138+
// firebase.storage().ref('/path/to/ref').getDownloadURL().then(() => { });
139+
// firebase.analytics(); // call to activate
140+
// firebase.analytics().logEvent('tutorial_completed');
141+
// firebase.performance(); // call to activate
142+
//
143+
// // πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯
144+
145+
try {
146+
let app = firebase.app();
147+
let features = [
148+
"auth",
149+
"database",
150+
"firestore",
151+
"functions",
152+
"messaging",
153+
"storage",
154+
"analytics",
155+
"remoteConfig",
156+
"performance",
157+
].filter((feature) => typeof app[feature] === "function");
158+
loadEl.textContent = `Firebase SDK loaded with ${features.join(", ")}`;
159+
} catch (e) {
160+
console.error(e);
161+
loadEl.textContent =
162+
"Error loading the Firebase SDK, check the console.";
163+
}
164+
});
165+
</script>
166+
</body>
167+
</html>

0 commit comments

Comments
Β (0)