Skip to content

Commit

Permalink
Merge pull request #224 from coldsurfers/release/surf-tree-v1.0.6
Browse files Browse the repository at this point in the history
release(surf-tree): v1.0.6
  • Loading branch information
yungblud authored Dec 29, 2024
2 parents 3594076 + c0cccaf commit 7c78b76
Show file tree
Hide file tree
Showing 14 changed files with 83 additions and 578 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci-cd.surf-tree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ jobs:
run: |
echo "SURF_TREE_DOMAIN_CERT_ARN=${{ secrets.SURF_TREE_DOMAIN_CERT_ARN }}" >> .env
echo "SURF_TREE_DOMAIN_NAME=${{ secrets.SURF_TREE_DOMAIN_NAME }}" >> .env
echo "NEXT_PUBLIC_FIREBASE_API_KEY=${{ secrets.SURF_TREE_FIREBASE_API_KEY }}" >> .env
echo "NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=${{ secrets.SURF_TREE_FIREBASE_AUTH_DOMAIN }}" >> .env
echo "NEXT_PUBLIC_FIREBASE_PROJECT_ID=${{ secrets.SURF_TREE_FIREBASE_PROJECT_ID }}" >> .env
echo "NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=${{ secrets.SURF_TREE_FIREBASE_STORAGE_BUCKET }}" >> .env
echo "NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=${{ secrets.SURF_TREE_FIREBASE_MESSAGING_SENDER_ID }}" >> .env
echo "NEXT_PUBLIC_FIREBASE_APP_ID=${{ secrets.SURF_TREE_FIREBASE_APP_ID }}" >> .env
echo "NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=${{ secrets.SURF_TREE_FIREBASE_MEASUREMENT_ID }}" >> .env
- name: SST Next.js template action
uses: ./.github/workflows/composites/sst-nextjs-template
Expand Down
2 changes: 1 addition & 1 deletion apps/coldsurf-io/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/css": "*",
"@emotion/react": "*",
"@emotion/styled": "*",
"firebase": "^11.1.0",
"firebase": "*",
"framer-motion": "*",
"lucide-react": "*",
"next": "15.1.2",
Expand Down
9 changes: 8 additions & 1 deletion apps/surf-tree/.env.sample
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
SURF_TREE_DOMAIN_NAME=
SURF_TREE_DOMAIN_CERT_ARN=
SURF_TREE_DOMAIN_CERT_ARN=
NEXT_PUBLIC_FIREBASE_API_KEY=
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
NEXT_PUBLIC_FIREBASE_APP_ID=
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=
3 changes: 2 additions & 1 deletion apps/surf-tree/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coldsurfers/surf-tree",
"version": "1.0.5",
"version": "1.0.6",
"private": true,
"scripts": {
"build": "next build",
Expand All @@ -14,6 +14,7 @@
"@emotion/react": "*",
"@emotion/styled": "*",
"cheerio": "^1.0.0",
"firebase": "*",
"framer-motion": "*",
"lucide-react": "*",
"next": "15.1.0",
Expand Down
9 changes: 9 additions & 0 deletions apps/surf-tree/src/app/(lib)/firebase/firebase.constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const firebaseConfig = {
apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY,
authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN,
projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID,
storageBucket: process.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET,
messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID,
appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID,
measurementId: process.env.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID,
}
28 changes: 28 additions & 0 deletions apps/surf-tree/src/app/(lib)/firebase/firebase.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Import the functions you need from the SDKs you need
import { Analytics, getAnalytics } from 'firebase/analytics'
import { FirebaseApp, initializeApp as fbInitializeApp } from 'firebase/app'
import { firebaseConfig } from './firebase.constants'
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries

/**
* only for client side
*/
export class Firebase {
private analytics: Analytics
private app: FirebaseApp

constructor() {
// Initialize Firebase
this.app = fbInitializeApp(firebaseConfig)
this.analytics = getAnalytics(this.app)
}

static initializeApp() {
if (process.env.NODE_ENV === 'development') {
return
}
const app = fbInitializeApp(firebaseConfig)
return getAnalytics(app)
}
}
1 change: 1 addition & 0 deletions apps/surf-tree/src/app/(lib)/firebase/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './firebase'
1 change: 1 addition & 0 deletions apps/surf-tree/src/app/(lib)/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './firebase'
6 changes: 4 additions & 2 deletions apps/surf-tree/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { OceanRoadThemeContext } from '@/contexts'
import { FirebaseContext, OceanRoadThemeContext } from '@/contexts'
import type { Metadata } from 'next'
import { Noto_Sans_KR } from 'next/font/google'

Expand Down Expand Up @@ -74,7 +74,9 @@ export default function RootLayout({
`,
}}
/>
<OceanRoadThemeContext>{children}</OceanRoadThemeContext>
<FirebaseContext>
<OceanRoadThemeContext>{children}</OceanRoadThemeContext>
</FirebaseContext>
</body>
</html>
)
Expand Down
15 changes: 15 additions & 0 deletions apps/surf-tree/src/contexts/firebase-context/firebase-context.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use client'

import { Firebase } from '@/app/(lib)'
import { PropsWithChildren, useEffect } from 'react'

export function FirebaseContext({ children }: PropsWithChildren) {
useEffect(() => {
function initFirebase() {
Firebase.initializeApp()
}
initFirebase()
}, [])

return <>{children}</>
}
1 change: 1 addition & 0 deletions apps/surf-tree/src/contexts/firebase-context/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './firebase-context'
1 change: 1 addition & 0 deletions apps/surf-tree/src/contexts/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './firebase-context'
export * from './ocean-road-theme-context'
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
"serverless-plugin-monorepo": "0.11.0",
"sst": "3.4.28",
"lucide-react": "0.469.0",
"react-lite-youtube-embed": "2.4.0"
"react-lite-youtube-embed": "2.4.0",
"firebase": "11.1.0"
},
"devDependencies": {
"@tanstack/eslint-plugin-query": "^5.12.1",
Expand Down
Loading

0 comments on commit 7c78b76

Please sign in to comment.