@allbluecn/web-app 0.4.19 → 0.4.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allbluecn/web-app",
3
- "version": "0.4.19",
3
+ "version": "0.4.21",
4
4
  "license": "AGPL-3.0-or-later",
5
5
  "type": "module",
6
6
  "files": [
@@ -135,14 +135,14 @@
135
135
  "three": "^0.180.0",
136
136
  "tw-animate-css": "^1.4.0",
137
137
  "zod": "^4.4.3",
138
+ "@allbluecn/ai-gateway": "0.4.14",
138
139
  "@allbluecn/kernel": "0.3.0",
139
- "@allbluecn/shared": "0.4.14",
140
140
  "@allbluecn/database": "0.4.14",
141
+ "@allbluecn/plugins-core": "0.4.13",
142
+ "@allbluecn/prototype": "0.1.1",
141
143
  "@allbluecn/tiptap": "0.4.13",
142
144
  "@allbluecn/ui": "0.4.14",
143
- "@allbluecn/ai-gateway": "0.4.14",
144
- "@allbluecn/plugins-core": "0.4.13",
145
- "@allbluecn/prototype": "0.1.1"
145
+ "@allbluecn/shared": "0.4.14"
146
146
  },
147
147
  "devDependencies": {
148
148
  "@babel/parser": "^8.0.4",
@@ -23,7 +23,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
23
23
  import { Route } from '@/routes/_nav/changelog/route'
24
24
  import type { DeveloperLogEntry } from '@allbluecn/shared'
25
25
  import { SDK_GROUPS } from '@/lib/changelog/sdk-versions'
26
- import { APP_FULL_VERSION } from '@/lib/app-version'
26
+ import { APP_FULL_VERSION, APP_UPDATE_DATE_DISPLAY } from '@/lib/app-version'
27
27
 
28
28
  const TAG_KEYS = ['all', 'feat', 'fix', 'improvement', 'design', 'refactor', 'breaking', 'docs', 'security', 'perf']
29
29
 
@@ -140,9 +140,12 @@ function ChangelogSidebar() {
140
140
  </div>
141
141
 
142
142
  <div className="pt-4 border-border/50">
143
- <code className="text-[10px] font-mono text-primary/80 bg-primary/5 px-2 py-0.5 rounded-full">
143
+ <span className="text-[10px] font-mono text-primary/80 bg-primary/5 px-2 py-0.5 rounded-full">
144
144
  {APP_FULL_VERSION}
145
- </code>
145
+ <span className="text-[10px] font-mono text-muted-foreground bg-transparent px-1.5">
146
+ {APP_UPDATE_DATE_DISPLAY}
147
+ </span>
148
+ </span>
146
149
  </div>
147
150
  </aside>
148
151
  )
@@ -19,5 +19,9 @@
19
19
  declare const __APP_VERSION__: string
20
20
  const APP_VERSION: string = __APP_VERSION__
21
21
 
22
+ declare const __APP_UPDATE_DATE__: string
23
+ const APP_UPDATE_DATE: string = __APP_UPDATE_DATE__
24
+
22
25
  export const APP_VERSION_DISPLAY = `v${APP_VERSION}`
23
26
  export const APP_FULL_VERSION = `AllBlue v${APP_VERSION}`
27
+ export const APP_UPDATE_DATE_DISPLAY = `更新于${APP_UPDATE_DATE}`
@@ -95,7 +95,7 @@ export const SDK_GROUPS: SdkGroup[] = [
95
95
  "items": [
96
96
  {
97
97
  "name": "@allbluecn/web-app",
98
- "version": "v0.4.19",
98
+ "version": "v0.4.21",
99
99
  "lastUpdate": "Aug 28, 2026",
100
100
  "source": "apps/web/package.json",
101
101
  "docsUrl": "https://github.com/allbluecn/allblue"
package/vite.shared.ts CHANGED
@@ -31,6 +31,7 @@
31
31
  import { defineConfig, type PluginOption } from 'vite'
32
32
  import path from 'node:path'
33
33
  import { readFileSync } from 'node:fs'
34
+ import { execFileSync } from 'node:child_process'
34
35
 
35
36
  // 从 apps/web/package.json 读取版本号,构建时注入到客户端/SSR
36
37
  function getWebAppVersion(rootDir: string): string {
@@ -42,6 +43,21 @@ function getWebAppVersion(rootDir: string): string {
42
43
  }
43
44
  }
44
45
 
46
+ // 获取最新 git commit 日期,构建时注入到客户端/SSR
47
+ // AllBlue 与 Pro 仓库各自构建,自然得到不同的更新日期
48
+ function getAppUpdateDate(rootDir: string): string {
49
+ try {
50
+ const date = execFileSync('git', ['log', '-1', '--format=%cI'], {
51
+ cwd: rootDir,
52
+ encoding: 'utf-8',
53
+ stdio: ['ignore', 'pipe', 'ignore'],
54
+ }).trim()
55
+ return date.slice(0, 10)
56
+ } catch {
57
+ return '1970-01-01'
58
+ }
59
+ }
60
+
45
61
  function prismaDirnamePolyfill(rootDir: string): PluginOption {
46
62
  return {
47
63
  name: 'prisma-dirname-polyfill',
@@ -89,6 +105,7 @@ export interface WebViteConfigOptions {
89
105
 
90
106
  export function createWebViteConfig(opts: WebViteConfigOptions) {
91
107
  const webVersion = getWebAppVersion(opts.rootDir)
108
+ const appUpdateDate = getAppUpdateDate(opts.rootDir)
92
109
  return defineConfig(async () => {
93
110
  const deployTarget = process.env.DEPLOY_TARGET
94
111
  const plugins: PluginOption[] = [...opts.basePlugins, tiptapAliasPlugin(opts.rootDir)]
@@ -115,6 +132,7 @@ export function createWebViteConfig(opts: WebViteConfigOptions) {
115
132
  process.env.DEPLOY_TARGET ?? 'web',
116
133
  ),
117
134
  '__APP_VERSION__': JSON.stringify(webVersion),
135
+ '__APP_UPDATE_DATE__': JSON.stringify(appUpdateDate),
118
136
  },
119
137
  server: {
120
138
  port: 3000,