From eea1475038f2d243efba8d30748c432c38d8a42f Mon Sep 17 00:00:00 2001 From: Nightt <87569709+nightt5879@users.noreply.github.com> Date: Sun, 3 May 2026 15:48:45 +0800 Subject: [PATCH] fix: clean astro cache before builds --- CHANGELOG.md | 9 +++++++++ README.md | 1 + README_EN.md | 1 + docs/roadmap.md | 8 +++++++- package-lock.json | 4 ++-- package.json | 2 +- scripts/build-site.mjs | 2 ++ 7 files changed, 23 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 794e880..6cce5f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +## [1.3.3] - 2026-05-03 + +### Changed +- Bumped the package version from `1.3.2` to `1.3.3` for build-log stability cleanup. +- Cleared Astro's `.astro` content cache before each site build, matching the existing clean `dist/` build behavior. + +### Fixed +- Removed stale-content-cache duplicate news id warnings from repeated local and configured builds. + ## [1.3.2] - 2026-05-03 ### Changed diff --git a/README.md b/README.md index d7c27d7..99d12e2 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,7 @@ venue: "Conference Name" - `1.3.0`:CMS 文件管理后台,扩展到新闻、成员、论文、招生与现有项目文件 - `1.3.1`:CMS 线上启用跟进,补 Cloudflare Worker OAuth 代理部署包与生产环境变量验收说明 - `1.3.2`:CMS 稳定性补丁,补齐旧新闻 `slug`、清理后台测试残留,并收紧新闻 slug 校验 +- `1.3.3`:构建日志清理,构建前清理 Astro 内容缓存,消除重复 news id warning ## License diff --git a/README_EN.md b/README_EN.md index 58bf513..0429e61 100644 --- a/README_EN.md +++ b/README_EN.md @@ -225,6 +225,7 @@ venue: "Conference Name" - `1.3.0`: CMS file management for news, members, papers, recruitment pages, and existing project files - `1.3.1`: CMS live enablement follow-up with a Cloudflare Worker OAuth proxy package and production environment validation notes - `1.3.2`: CMS stability patch that adds stable legacy news slugs, removes CMS test residue, and tightens news slug validation +- `1.3.3`: build-log cleanup that clears Astro content cache before builds to remove duplicate news id warnings ## License diff --git a/docs/roadmap.md b/docs/roadmap.md index 56186ec..ed82b6a 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # Roadmap -更新时间:2026-05-03(1.3.2 CMS stability hardening) +更新时间:2026-05-03(1.3.3 build-log cleanup) ## 1.0.1 基线修复 @@ -74,6 +74,12 @@ - 收紧新闻 `slug` 提示、校验和 smoke 检查,要求以小写字母开头,不包含日期前缀 - 文档补充 Save -> Ready -> Publish now 的后台发布流程说明 +## 1.3.3 构建日志清理 + +已完成: +- 构建前同步清理 `dist/` 与 `.astro`,避免 stale content cache 造成重复 news id warning +- 保持 CMS 范围、公开路由和内容模型不变 + ## T-0015 真实上线闭环演练 已完成: diff --git a/package-lock.json b/package-lock.json index b521358..3137115 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "double-duck-lab", - "version": "1.3.2", + "version": "1.3.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "double-duck-lab", - "version": "1.3.2", + "version": "1.3.3", "devDependencies": { "astro": "^5.13.0", "vite": "^6.4.1" diff --git a/package.json b/package.json index 3b13e14..e5b6dc5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "double-duck-lab", "type": "module", - "version": "1.3.2", + "version": "1.3.3", "private": true, "scripts": { "dev": "astro dev", diff --git a/scripts/build-site.mjs b/scripts/build-site.mjs index 1684efb..d98c7c9 100644 --- a/scripts/build-site.mjs +++ b/scripts/build-site.mjs @@ -4,9 +4,11 @@ import fs from 'node:fs'; import path from 'node:path'; const distDir = path.resolve('dist'); +const astroCacheDir = path.resolve('.astro'); const astroEntry = path.resolve('node_modules/astro/astro.js'); fs.rmSync(distDir, { recursive: true, force: true }); +fs.rmSync(astroCacheDir, { recursive: true, force: true }); if (process.env.ASTRO_TELEMETRY_DISABLED === undefined) { process.env.ASTRO_TELEMETRY_DISABLED = '1';