Repository navigation
feat(core): a folder with index.html is one a step can work on, apart from finding projects - #7734
Conversation
… from finding projects isHyperframesProject needs index.html and a marker file, which is right for finding projects on a computer (a website's folder must not be listed) but not for what a step works on. isCompositionFolder says that: any folder whose index.html is the composition.
There was a problem hiding this comment.
Verdict: REQUEST CHANGES · 1 blocker · 0 important · 0 nits · head 9ddbc7ee
- blocker: the required CI › Build job fails at
verify:packed-manifests(run):@hyperframes/core unpacked size 4373541 bytes is over its budget of 4330000 by more than 1%. That is 241 bytes over the 1% tolerance (4373300). The baseb5e9bc68passes Build, so this PR's new export, which ships in the root andprojectsentry points plus their.d.tsfiles, tips core over the limit. Raise the@hyperframes/coreentry inscripts/package-size-budgets.jsonand give the reason in the body, as the script asks.
The code is fine. isCompositionFolder matches how the CLI already decides a folder is workable (existsSync(join(dir, "index.html")), e.g. cli/src/utils/project.ts:98). Discovery still uses only isHyperframesProject.
Scope
Read all 4 files. Checked every use of isHyperframesProject against the body's table, and both exports entries (., ./projects). This is a feat, and its body also has a fails without the fix: line naming both tests. Comments, CodeQL and the other workflows are green. Windows render was still running.
|
Raised |
4beb8e4 to
b1e24c6
Compare
What
@hyperframes/coregets a second, named project rule:isCompositionFolder(fileNames), true for any folder with anindex.html.isHyperframesProject(index.html plushyperframes.json,meta.jsonorproject.json) is unchanged. Both are exported from the package root and fromprojects.Why
One rule answered two different questions:
index.htmlwould be listed.isHyperframesProjectis right for that.index.htmlis the composition can be previewed, snapshotted and checked. A host that used the strict rule here refused to open a folder holding onlyindex.html, while the CLI's own snapshot and check worked on it.Repro: make a folder with only an
index.htmlcomposition.hyperframes snapshotandhyperframes checkwork on it, butisHyperframesProjectsays it is not a project, so anything that gates opening on that rule refuses it.Every use of the rule on main, sorted:
core/src/projects.ts:49(Spotlight query on the marker files)core/src/projects.ts:109(folder walk)core/src/projects.ts:159(is a folder inside a project)core/src/projects.ts:171(Spotlight hit check)cli/src/utils/desktopApp.ts:163(markBareIndexAsProject)isCompositionFolderNo step in this repo calls the rule. The other uses of
meta.jsonandhyperframes.json(capture output,init, the regression harness, the registry installer) are those files' own formats, not the project rule.Related work
None.
How
isCompositionFoldersits besideisHyperframesProjectinprojectRule.ts, so the two rules have one home and one test file. Discovery code is untouched.The new export ships in both the root and
projectsentry points and their.d.tsfiles. That put@hyperframes/core's unpacked size at 4,373,541 bytes, 241 bytes past the 1% tolerance on its 4,330,000 budget. The budget inscripts/package-size-budgets.jsongoes to 4,374,000: CI's measured unpacked size at this branch, 4,373,541, rounded up to the next 1,000, with the file's 1% tolerance still on top. The packed size stays inside its budget.Test plan
Unit tests added/updated
Manual testing performed
Documentation updated (if applicable)
Comments follow CONTRIBUTING.md "Comments": they say why, not what, and a bug fix says what the code must do and how to reproduce the bug
fails without the fix:
packages/core/src/projectRule.test.ts"counts any folder with index.html, marker or not" and "does not count a folder without index.html" (2 failed beforeisCompositionFolderexisted).projectRule.test.tsandprojects.test.ts: 20 pass.projects.test.ts:53"finds a folder with index.html and a project marker, and nothing else" already proves discovery never lists an index-only folder (site/index.html), and it still passes.oxfmt, oxlint and the comment ratchet are clean on the changed files.
Not run: the full repo test suite and a build (CI runs both).