Skip to content

Commit ac15048

Browse files
Improve site URL configuration and update Storybook play function
Co-authored-by: ryanclementshax <ryanclementshax@gmail.com>
1 parent f1e3c99 commit ac15048

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

lib/constants.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ export const IS_PREVIEW = process.env.VERCEL_ENV === 'preview'
55

66
const protocol = IS_DEV ? 'http://' : 'https://'
77

8-
export const SITE_URL: string =
9-
protocol + (process.env.NEXT_PUBLIC_URL ?? 'localhost:3000')
8+
const configuredHost =
9+
process.env.NEXT_PUBLIC_URL && process.env.NEXT_PUBLIC_URL.trim().length > 0
10+
? process.env.NEXT_PUBLIC_URL
11+
: 'localhost:3000'
12+
13+
export const SITE_URL: string = protocol + configuredHost
1014

1115
export const RSS_FEED_URL = `${SITE_URL}/rss/feed.xml`
1216
export const JSON_FEED_URL = `${SITE_URL}/rss/feed.json`

stories/storyUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ export const withArgs: <T>(args?: Args<T>) => StoryModifier<T> =
7777

7878
export const withPlay: <T>(play?: StorybookPlay<T>) => StoryModifier<T> =
7979
play => story => {
80-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO: refine Storybook v8 play typing
8180
// TODO: Storybook v8 typing for play is stricter; leaving as-is for now
81+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO: refine Storybook v8 play typing
8282
story.play = play as any
8383
return story
8484
}

0 commit comments

Comments
 (0)