cdn-and-caching-strategy: any firebase.json counts as a web-serving surface, also one with no hosting
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- firebase, typescript
- 领域
- performance
调研方向
文件列表位于 src/laws/performance/cdn-caching-strategy.ts:第 18 行的 WEB_SURFACE_FILES 包含 firebase.json,而第 33-36 行附近的 hasWebAssets 只要该文件存在就返回 true。修改该检查,使 firebase.json 仅在其解析后的 JSON 含有 hosting 键时才计入。完成标准是:firebase.json 只包含 firestore 设置的项目被报告为不适用,而包含 hosting 的项目仍会运行该规则。
由索引模型根据 Issue 内容生成。
描述
Version: 8.0.1 (tag v8.0.1)
Law: cdn-and-caching-strategy (CDN and Caching Strategy), CdnCachingStrategyLaw.hasWebAssets
What happens
WEB_SURFACE_FILES (src/laws/performance/cdn-caching-strategy.ts:18) lists firebase.json, and hasWebAssets (:33-36) returns true when the file exists. The law then judges the project for CDN configuration, browser caching headers and service-worker caching.
firebase.json configures several products. Only its hosting key declares something served to browsers; firestore, functions, storage and emulators do not.
Reproduction
A Python API (pyproject.toml, api/main.py with FastAPI) whose firebase.json is { "firestore": { "rules": "firestore.rules", "indexes": "firestore.indexes.json" } }, laws.enabled { "CDN and Caching Strategy": true }:
1. CDN and Caching Strategy [5 violations] (Score: 0/100)
• CDN configuration not implemented
• Browser caching headers not configured
• Service worker caching not implemented
Without firebase.json the same project gets "Not applicable — no web assets to serve".
What I ruled out
No other web-surface file and no JS/TS sources in the fixture: firebase.json alone switches the law on.
Why it matters
The law asks a JSON API for a service worker. The only ways out are a waiver or deleting a config the project needs for its database.
Suggested direction
- Count
firebase.jsonas a web surface only when it has ahostingkey. - Apply the same idea to other multi-purpose configs in the list where a key decides it (for example
wrangler.tomlwith[site]/assets).
- 主要语言
- TypeScript
- 星标
- 0
- 派生
- 0
- 平均合并
- 2 小时 36 分钟
- 30 天内合并 PR
- 168
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Rule-Of-Code/RoC 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
Rule-Of-Code/RoC#548 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
Rule-Of-Code/RoC#506 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
Rule-Of-Code/RoC#501 ·
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 62/100
Rule-Of-Code/RoC#563 ·
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 50/100
Rule-Of-Code/RoC#562 ·
维护者通常 1 天内回复
相似的 Issue
-
bug done
难度 2/5 1-3 小时 新手友好度 65/100
neavo/LinguaGacha#1124 ·
维护者通常 1 天内回复
-
[fullsend] E2E: backstage-microsoft-auth — catalogQuery missing error handler for network errors可能已有人在做 @fullsend-ai-coder 今天认领。 未关闭e2e-failure ready-to-code
难度 2/5 1 小时以内 新手友好度 78/100
redhat-developer/rhdh-plugin-export-overlays#4821 · 1 条评论 ·
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 62/100
brylie/mission-island#225 ·
维护者通常 1 天内回复
-
status/need-triage
难度 2/5 1-3 小时 新手友好度 72/100
google-gemini/gemini-cli#30412 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复