Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ on:
jobs:
verify:
runs-on: ubuntu-latest
env:
ASTRO_TELEMETRY_DISABLED: '1'
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -24,14 +22,5 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Validate content
run: npm run validate:content

- name: Build site
run: npm run build

- name: Smoke test built routes
run: npm run test:smoke

- name: Verify SEO and locale alternates
run: npm run test:seo
- name: Run full verification
run: npm run verify
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file.

## [1.1.2] - 2026-03-27

### Changed
- Unified the verification entrypoint around `npm run verify` and `verify.bat` to keep local, Windows, and CI checks aligned.
- Tightened the build flow so verification uses clean build output instead of relying on existing `dist/` artifacts.
- Updated the release and ops documentation to describe `1.1.2` as stability hardening, without adding outward site features.

## [1.1.1] - 2026-03-26

### Added
Expand Down
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@
git clone https://github.com/nightt5879/doubleducklab.git
cd doubleducklab
npm install
npm run validate:content
npm run build
npm run test:smoke
npm run test:seo
npm run verify
npm run preview
```

Expand Down Expand Up @@ -161,18 +158,19 @@ venue: "Conference Name"

## 验证链路

- `npm run verify`
- 推荐的一键验收入口,依次执行 `validate:content`、`build`、`test:smoke`、`test:seo`
- 统一本地、Windows 和 CI 的稳定性检查流程
- `npm run validate:content`
- 校验站点文案、成员、项目、论文、新闻、招生与合作的文件结构
- `npm run build`
- 生成静态站点
- 生成静态站点,并默认清理旧 `dist/` 与关闭 Astro telemetry
- `npm run test:smoke`
- 检查 `/`、`/en/`、`/members`、`/projects`、`/papers`、`/news` 的构建结果
- `npm run test:seo`
- 检查 canonical、Open Graph、hreflang、404 noindex 与当前页语言互跳
- `verify.bat`
- 依次执行 `validate:content`、`build`、`test:smoke`、`test:seo`
- 自动设置 `ASTRO_TELEMETRY_DISABLED=1`
- 适合 Windows 下双击或命令行一键验收
- Windows 下的一键验收入口,与 `npm run verify` 保持一致

## 文档入口

Expand All @@ -186,7 +184,8 @@ venue: "Conference Name"

- `1.0.1`:基线修复,修乱码、收真源、补 CI / smoke
- `1.1.0`:生产域名、SEO 元信息、当前页中英互跳与构建后 SEO 校验
- `1.1.1`:review follow-up,修 alternate 可用性、内部链接 URL 一致性与 `test:seo` 站点地址读取
- `1.1.1`:review follow-up,修 alternate 可用性、内部链接 URL 一致性与 `test:seo` 站点地址读取,已完成
- `1.1.2`:稳定性硬化,统一 `verify` 入口、干净构建与发布验收流程
- `1.2.0`:先给 `news` 接 CMS

## License
Expand Down
18 changes: 9 additions & 9 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ A bilingual Astro template for academic lab websites, built around a local-first
git clone https://github.com/nightt5879/doubleducklab.git
cd doubleducklab
npm install
npm run validate:content
npm run build
npm run test:smoke
npm run test:seo
npm run verify
npm run preview
```

Expand Down Expand Up @@ -161,18 +158,20 @@ venue: "Conference Name"

## Validation Pipeline

- `npm run verify`
- Recommended one-click verification entrypoint
- Runs `validate:content`, `build`, `test:smoke`, and `test:seo` in order
- Keeps local, Windows, and CI verification aligned
- `npm run validate:content`
- Validates site copy and all content collections
- `npm run build`
- Produces the static site
- Produces the static site with a clean `dist/` and telemetry disabled by default
- `npm run test:smoke`
- Checks the built `/`, `/en/`, `/members`, `/projects`, `/papers`, and `/news` routes
- `npm run test:seo`
- Checks canonical tags, Open Graph metadata, hreflang alternates, 404 noindex, and current-page locale switching
- `verify.bat`
- Runs `validate:content`, `build`, `test:smoke`, and `test:seo` in order
- Sets `ASTRO_TELEMETRY_DISABLED=1` automatically
- Useful for a one-click verification pass on Windows
- Windows one-click verification entrypoint kept in sync with `npm run verify`

## Docs

Expand All @@ -186,7 +185,8 @@ venue: "Conference Name"

- `1.0.1`: baseline hardening, encoding fix, source-of-truth cleanup, CI and smoke coverage
- `1.1.0`: production site URL, SEO metadata, current-page locale switching, and post-build SEO checks
- `1.1.1`: review follow-up for alternate availability, internal URL consistency, and `test:seo` site URL loading
- `1.1.1`: review follow-up for alternate availability, internal URL consistency, and `test:seo` site URL loading, completed
- `1.1.2`: stability hardening, unified verification entrypoint, and clean-build guardrails
- `1.2.0`: CMS pilot for `news`

## License
Expand Down
5 changes: 2 additions & 3 deletions content-map.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@

## 8. 验证链路

- 推荐一键验收:`npm run verify`
- 内容校验:`npm run validate:content`
- 构建:`npm run build`
- 构建后 smoke:`npm run test:smoke`
Expand All @@ -101,6 +102,4 @@
1. 不再使用 `src/data/content/*`。
2. 改内容优先改 `src/data/site.*.json` 或 `src/content/*`,不要先改页面模板硬编码。
3. 改完内容后至少跑一次:
- `npm run validate:content`
- `npm run build`
- `npm run test:smoke`
- `npm run verify`
4 changes: 1 addition & 3 deletions docs/content-edit-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ venue: "Conference Name"
在项目根目录执行:

```bash
npm run validate:content
npm run build
npm run test:smoke
npm run verify
```

## 5. 如何预览
Expand Down
8 changes: 2 additions & 6 deletions docs/content-ops-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ git checkout -b content/YYYYMMDD-topic

3. 运行检查
```bash
npm run validate:content
npm run build
npm run test:smoke
npm run verify
```

4. 本地预览确认
Expand Down Expand Up @@ -75,8 +73,6 @@ git push origin content/YYYYMMDD-topic
## C. 交付前 30 秒检查

- [ ] 内容改动只落在 `src/data/site.*.json` 或 `src/content/*`
- [ ] `npm run validate:content` 通过
- [ ] `npm run build` 通过
- [ ] `npm run test:smoke` 通过
- [ ] `npm run verify` 通过
- [ ] 中英文页面都看过
- [ ] PR 描述写清楚影响范围
6 changes: 2 additions & 4 deletions docs/hand-off-summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
- 招生与合作:`src/content/join/recruitment/`

### 3. 工程验证
- `npm run validate:content`
- `npm run build`
- `npm run test:smoke`
- GitHub Actions CI:PR / `main` 自动跑校验、构建、smoke
- `npm run verify`
- GitHub Actions CI:PR / `main` 自动跑统一验收链路(内容校验、构建、smoke、SEO)

## 二、1.0.1 做了什么

Expand Down
2 changes: 1 addition & 1 deletion docs/local-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ npm run dev

## 3. 生产构建验证
```bash
npm run build
npm run verify
npm run preview
```

Expand Down
13 changes: 6 additions & 7 deletions docs/release-baseline-checklist.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Release Baseline Checklist(1.1.0
# Release Baseline Checklist(1.1.2

## 0. 环境要求
- Node.js 18+
Expand All @@ -8,10 +8,7 @@

```bash
npm install
npm run validate:content
npm run build
npm run test:smoke
npm run test:seo
npm run verify
```

Windows 可直接运行:
Expand All @@ -36,6 +33,7 @@ verify.bat

## 3. 通过标准

- [ ] `verify` 通过
- [ ] `validate:content` 通过
- [ ] `build` 通过
- [ ] `test:smoke` 通过
Expand All @@ -47,8 +45,9 @@ verify.bat

## 4. 失败排查

- `verify` 失败:先看卡在哪一步,再对应下方各项逐一排查
- `validate:content` 失败:优先检查 frontmatter、语言配对、文件路径
- `build` 失败:检查页面 import、字段拼写、内容集合命名
- `build` 失败:检查页面 import、字段拼写、内容集合命名,以及是否有旧 `dist/` 干扰
- `test:smoke` 失败:优先检查页面静态文案是否被误删或再次出现乱码
- `test:seo` 失败:优先检查 `PUBLIC_SITE_URL`、语言路由映射与布局层 meta 输出
- `verify.bat` 失败:先看停在哪一步,再对应上面三项逐一排查
- `verify.bat` 失败:先看停在哪一步,再对应上面各项逐一排查
11 changes: 9 additions & 2 deletions docs/roadmap.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Roadmap

更新时间:2026-03-26(1.1.1 follow-up
更新时间:2026-03-27(1.1.2 stability hardening

## 1.0.1 基线修复

Expand All @@ -19,13 +19,20 @@
- 当前页面中英互跳
- build 后补 SEO / i18n 校验

## 1.1.1 SEO / URL follow-up(进行中
## 1.1.1 SEO / URL follow-up(已完成

计划项:
- alternate / hreflang 按对侧页面存在性输出
- 站内内部链接统一为 canonical 尾斜杠形式
- `test:seo` 与 build 共用站点 URL 解析逻辑

## 1.1.2 Stability hardening

已完成:
- 统一 `verify` 作为本地、Windows 和 CI 的验收入口
- 让构建流程默认走干净产物,避免旧 `dist/` 影响验收
- 收口发布验收与文档叙事,保持对外行为不变

## 1.2.0 CMS 试点

计划项:
Expand Down
4 changes: 1 addition & 3 deletions docs/zero-code-ops-playbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
## 2. 每次修改后的标准验证

```bash
npm run validate:content
npm run build
npm run test:smoke
npm run verify
./run.sh
```

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"name": "double-duck-lab",
"type": "module",
"version": "1.1.1",
"version": "1.1.2",
"private": true,
"scripts": {
"dev": "astro dev",
"build": "astro build",
"build": "node scripts/build-site.mjs",
"preview": "astro preview",
"astro": "astro",
"validate:content": "node scripts/validate-content.mjs",
"test:smoke": "node scripts/smoke-build.mjs",
"test:seo": "node scripts/verify-seo-i18n.mjs"
"test:seo": "node scripts/verify-seo-i18n.mjs",
"verify": "node scripts/verify.mjs"
},
"devDependencies": {
"astro": "^5.13.0",
Expand Down
31 changes: 31 additions & 0 deletions scripts/build-site.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env node
import { spawnSync } from 'node:child_process';
import fs from 'node:fs';
import path from 'node:path';

const distDir = path.resolve('dist');
const astroEntry = path.resolve('node_modules/astro/astro.js');

fs.rmSync(distDir, { recursive: true, force: true });

if (process.env.ASTRO_TELEMETRY_DISABLED === undefined) {
process.env.ASTRO_TELEMETRY_DISABLED = '1';
}

const result = spawnSync(process.execPath, [astroEntry, 'build'], {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Forward user-supplied build flags to Astro

build used to execute astro build directly, so npm run build -- --mode staging (and similar flags) reached Astro. The new wrapper hardcodes ['build'] and never forwards process.argv.slice(2), so any caller-provided build options are silently dropped. This can produce incorrect artifacts (for example, wrong mode-specific env/config during release verification) when teams rely on build-time flags.

Useful? React with 👍 / 👎.

stdio: 'inherit',
env: process.env,
shell: false,
});

if (result.error) {
console.error(result.error.message);
process.exit(1);
}

if (result.signal) {
console.error(`Build interrupted by signal ${result.signal}`);
process.exit(1);
}

process.exit(result.status ?? 1);
39 changes: 39 additions & 0 deletions scripts/verify.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env node
import { spawnSync } from 'node:child_process';

const npmExecPath = process.env.npm_execpath;
const steps = [
'validate:content',
'build',
'test:smoke',
'test:seo',
];

if (!npmExecPath) {
console.error('[verify] npm_execpath is not set. Run this script via `npm run verify`.');
process.exit(1);
}

steps.forEach((scriptName, index) => {
console.log(`[verify] step ${index + 1}/${steps.length}: npm run ${scriptName}`);

const result = spawnSync(process.execPath, [npmExecPath, 'run', scriptName], {
stdio: 'inherit',
shell: false,
env: process.env,
});

if (result.error) {
console.error(`[verify] failed to start npm run ${scriptName}: ${result.error.message}`);
process.exit(1);
}

if (result.signal) {
console.error(`[verify] interrupted during npm run ${scriptName}: ${result.signal}`);
process.exit(1);
}

if ((result.status ?? 1) !== 0) {
process.exit(result.status ?? 1);
}
});
Loading
Loading