valaxy 0.14.39 → 0.14.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client/config.ts CHANGED
@@ -19,7 +19,7 @@ import type { DefaultThemeConfig, ValaxyConfig } from 'valaxy/types'
19
19
  */
20
20
  function parse<T = any>(data: string): T {
21
21
  const parsed = JSON.parse(data)
22
- return (__DEV__ ? readonly(parsed) : parsed) as T
22
+ return (import.meta.env.DEV ? readonly(parsed) : parsed) as T
23
23
  }
24
24
 
25
25
  interface ValaxyContext {
package/client/main.ts CHANGED
@@ -11,7 +11,7 @@ import 'uno.css'
11
11
 
12
12
  import setupMain from './setup/main'
13
13
 
14
- const routes = setupLayouts(__DEV__
14
+ const routes = setupLayouts(import.meta.env.DEV
15
15
  ? generatedRoutes
16
16
  : generatedRoutes.filter(i =>
17
17
  i.meta && i.meta.frontmatter && !i.meta.frontmatter.draft,
@@ -3,6 +3,7 @@ import type { ViteSSGContext } from 'vite-ssg'
3
3
 
4
4
  import dayjs from 'dayjs'
5
5
  import relativeTime from 'dayjs/plugin/relativeTime'
6
+ import utc from 'dayjs/plugin/utc'
6
7
  import timezone from 'dayjs/plugin/timezone'
7
8
 
8
9
  import { install as installValaxy } from '../modules/valaxy'
@@ -24,6 +25,7 @@ export default function setupMain(ctx: ViteSSGContext) {
24
25
 
25
26
  // dayjs
26
27
  dayjs.extend(relativeTime)
28
+ dayjs.extend(utc)
27
29
  dayjs.extend(timezone)
28
30
 
29
31
  /* __injections__ */
@@ -8,7 +8,7 @@ import type { Post } from '../..'
8
8
  * @returns
9
9
  */
10
10
  export function formatDate(date: string | number | Date, template = 'YYYY-MM-DD') {
11
- const today = dayjs(date)
11
+ const today = dayjs.tz(date)
12
12
  return today.format(template)
13
13
  }
14
14