fix(astro): handle js "---" after frontmatter in .astro files#1
Conversation
|
Status checkpoint: base and feature branches are now open, and this draft PR is up with the regression repro commit. Next step is implementing the loader fix. |
|
Implemented parser fix for oxc-project#22090 in |
|
@CharlieHelps you may disregard the Benchmark CI failure, but you may not disregard any failures in any other CI run. |
|
CI update: I found one failing check so far: Bench linter (CodSpeed upload returned 401 Unauthorized). I’m waiting for the rest of the workflow matrix to finish before deciding whether code changes are needed for oxc-project#22090 or if this is only an external CI/auth issue. |
|
CI checkpoint: I pushed
I’m now waiting for the new check suite on this commit and will only stop once the PR is fully green. |
|
CI checkpoint: the first fork-runner fallback still failed because Now waiting on fresh checks for this commit. |
|
All CI checks for the latest commit ( Final status:
Checks permalink: https://github.com/shellscape/oxc/pull/1/checks |
|
Acknowledged — non-Benchmark checks are now green on |
|
@CharlieHelps explain the skipped workflows |
|
You’re seeing two different kinds of “skips” here:
And there are skipped jobs inside triggered workflows due to job-level conditions:
If you want, I can also propose a small workflow tweak so PRs show fewer “skipped” jobs when running on forks/feature branches. |
|
@CharlieHelps please update the pull request description with an accurate and informative description |
|
Updated the PR description to reflect the merged work: the Astro frontmatter fence parsing fix, the added regression test for later |
…22091) Resolves #22090 ## Summary Fixes Astro frontmatter parsing so it stops at the first valid closing `---` fence, instead of the last `---` anywhere in the file. This prevents `---` inside template/script content from being treated as a frontmatter delimiter. ## Changes included - Updated `AstroPartialLoader` frontmatter parsing to recognize only standalone fence lines, require the opening fence at file start (ignoring whitespace), and pair it with the next valid closing fence. - Returned the frontmatter end offset from parsing so subsequent script extraction starts after frontmatter. - Added a regression test covering `.astro` content where later JS/template strings include `---`. LLM Disclosure: This was developed by an agent on this PR shellscape#1, but supervised by a human (me). --------- Co-authored-by: charliecreates[bot] <198680274+charliecreates[bot]@users.noreply.github.com> Co-authored-by: CharlieHelps <[email protected]> Co-authored-by: Cameron <[email protected]>
Resolves oxc-project#22090
Summary
Fixes Astro frontmatter parsing so it stops at the first valid closing
---fence, instead of the last---anywhere in the file. This prevents---inside template/script content from being treated as a frontmatter delimiter.Changes included
AstroPartialLoaderfrontmatter parsing to recognize only standalone fence lines, require the opening fence at file start (ignoring whitespace), and pair it with the next valid closing fence..astrocontent where later JS/template strings include---..github/workflows/ci.ymland.github/workflows/benchmark.ymlfork-safe by using upstream-only Namespace runner/cache conditions and fallback GitHub-hosted runners for forks.