Skip to content

Commit c7b185d

Browse files
committed
chore: CI 增加 npm audit 步骤(官方 registry),postcss 转 CJS 消除 MODULE_TYPELESS 警告
1 parent 62807ae commit c7b185d

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

‎.github/workflows/pr-check.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ jobs:
6767
run: cd client && npm run test -- --run --coverage
6868
- name: Build
6969
run: cd client && npm run build
70+
- name: Audit (client)
71+
# 供应链漏洞扫描:默认 registry 为 npmmirror 不支持 advisories API,
72+
# 显式指定官方 registry(见 migration-spec §15.5)
73+
run: cd client && npm audit --registry=https://registry.npmjs.org --audit-level=high
7074

7175
# ===========================================================================
7276
# Server / sync-service —— Go + Gin 同步服务

‎client/postcss.config.js‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
export default {
2-
plugins: {
3-
tailwindcss: {},
4-
autoprefixer: {},
5-
},
6-
}
1+
// PostCSS 配置(CJS:package.json 无 "type": "module",与 tailwind.config.js 保持一致,
2+
// 避免 Node 的 MODULE_TYPELESS_PACKAGE_JSON 警告)
3+
module.exports = {
4+
plugins: {
5+
tailwindcss: {},
6+
autoprefixer: {},
7+
},
8+
}

‎docs/standards/dependency-management.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@
9292

9393
**定期审计:**
9494
```bash
95-
# Node.js
95+
# Node.js —— 注意:镜像 registry(如 npmmirror)不支持 advisories API,
96+
# 必须显式指定官方源:npm audit --registry=https://registry.npmjs.org
9697
npm audit
9798
npm audit fix
9899

0 commit comments

Comments
 (0)