Skip to content

Commit

Permalink
🚚 Remove vercel specific code, add netlify specific code (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
wei authored Sep 7, 2024
1 parent 5bfe149 commit dfaea81
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changeset/tricky-suits-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"socialify": patch
---

Remove vercel specific code, add Netlify specific code
2 changes: 1 addition & 1 deletion common/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const checkWebpSupport = (): boolean => {

const HOST_PREFIX = process.env.VERCEL_URL
? `https://${process.env.VERCEL_URL}`
: process.env.PROJECT_URL || ''
: process.env.PROJECT_URL || process.env.URL || ''

const autoThemeCss = `
.card-light {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"dependencies": {
"@changesets/cli": "^2.27.7",
"@resvg/resvg-wasm": "^2.6.2",
"@vercel/analytics": "^1.3.1",
"autoprefixer": "^10.4.19",
"badgen": "^3.2.3",
"clsx": "^2.1.1",
Expand Down
2 changes: 0 additions & 2 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Analytics } from '@vercel/analytics/react'
import App from 'next/app'
import Head from 'next/head'
import Script from 'next/script'
Expand Down Expand Up @@ -77,7 +76,6 @@ export default class MyApp extends App {
</div>
<FooterElement />
<Toaster />
<Analytics />
</div>
</>
)
Expand Down
1 change: 1 addition & 0 deletions pages/api/png.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const pngEndpoint = async (req: NextRequest) => {
'cache-control': `public, immutable, no-transform, max-age=0, s-maxage=${
searchParams.has('cache') ? searchParams.get('cache') : 3600
}`,
'Netlify-Vary': 'query',
},
})
} catch (error) {
Expand Down
1 change: 1 addition & 0 deletions pages/api/stats.svg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const statsSvgEndpoint = async (req: NextRequest) => {
'content-type': 'image/svg+xml',
'cache-control':
'public, immutable, no-transform, max-age=60, s-maxage=86400',
'Netlify-Vary': 'query',
},
})
}
Expand Down
1 change: 1 addition & 0 deletions pages/api/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const statsEndpoint = async (_req: NextRequest) => {
'content-type': 'application/json',
'cache-control':
'public, immutable, no-transform, max-age=60, s-maxage=86400',
'Netlify-Vary': 'query',
},
})
}
Expand Down
1 change: 1 addition & 0 deletions pages/api/svg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const svgEndpoint = async (req: NextRequest) => {
'cache-control': `public, immutable, no-transform, max-age=0, s-maxage=${
searchParams.has('cache') ? searchParams.get('cache') : 3600
}`,
'Netlify-Vary': 'query',
},
})
} catch (error) {
Expand Down
12 changes: 0 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1452,13 +1452,6 @@
dependencies:
"@types/yargs-parser" "*"

"@vercel/analytics@^1.3.1":
version "1.3.1"
resolved "https://registry.yarnpkg.com/@vercel/analytics/-/analytics-1.3.1.tgz#e2b1deac1b5d14fa2e4fe36186ac5054c6385ae4"
integrity sha512-xhSlYgAuJ6Q4WQGkzYTLmXwhYl39sWjoMA3nHxfkvG+WdBT25c563a7QhwwKivEOZtPJXifYHR1m2ihoisbWyA==
dependencies:
server-only "^0.0.1"

abab@^2.0.6:
version "2.0.6"
resolved "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291"
Expand Down Expand Up @@ -4101,11 +4094,6 @@ semver@^7.5.3, semver@^7.5.4:
dependencies:
lru-cache "^6.0.0"

server-only@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/server-only/-/server-only-0.0.1.tgz#0f366bb6afb618c37c9255a314535dc412cd1c9e"
integrity sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==

shebang-command@^1.2.0:
version "1.2.0"
resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
Expand Down

0 comments on commit dfaea81

Please sign in to comment.