Use @marko/parse for parsing - #140
Conversation
🦋 Changeset detectedLatest commit: bf8f3ab The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThe plugin now uses the shared 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
378525e to
40f6437
Compare
40f6437 to
bf8f3ab
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@package.json`:
- Line 46: Replace the temporary local link for `@marko/parse` in package.json
with the appropriate semver range for its published release, and regenerate
pnpm-lock.yaml accordingly. Confirm the selected release provides the imports
used by src/ and validate installation from the packed plugin.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2a3e7cbb-9dbf-4eda-a13a-1b595a05966c
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yamland included by**
📒 Files selected for processing (8)
.changeset/use-marko-parse.mdpackage.jsonsrc/index.tssrc/parser.tssrc/utils/get-formatted-body.tssrc/utils/get-parser-name.tssrc/utils/read.tssrc/utils/to-valid-doc.ts
💤 Files with no reviewable changes (1)
- src/parser.ts
| }, | ||
| "dependencies": { | ||
| "htmljs-parser": "^5.12.1" | ||
| "@marko/parse": "link:../language-server/packages/parse" |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/sh
set -eu
node <<'NODE'
const fs = require("node:fs");
const pkg = JSON.parse(fs.readFileSync("package.json", "utf8"));
const dependency = pkg.dependencies?.["`@marko/parse`"];
if (!dependency || dependency.startsWith("link:")) {
throw new Error(
`Expected a published `@marko/parse` version range, got ${dependency}`,
);
}
NODERepository: marko-js/prettier
Length of output: 793
🏁 Script executed:
#!/bin/sh
set -eu
printf '%s\n' '--- package.json dependency and scripts ---'
node <<'NODE'
const fs = require("node:fs");
const pkg = JSON.parse(fs.readFileSync("package.json", "utf8"));
console.log(JSON.stringify({
name: pkg.name,
version: pkg.version,
dependencies: pkg.dependencies,
devDependencies: pkg.devDependencies,
scripts: pkg.scripts,
files: pkg.files
}, null, 2));
NODE
printf '%s\n' '--- repository references to `@marko/parse` and link: ---'
rg -n --glob '!node_modules' --glob '!dist' --glob '!build' '`@marko/parse`|link:../language-server/packages/parse|language-server/packages/parse' . || true
printf '%s\n' '--- workspace and package metadata files ---'
git ls-files | rg '(^|/)(package\.json|yarn\.lock|package-lock\.json|pnpm-lock\.yaml|\.yarnrc|\.npmrc)$' | head -200Repository: marko-js/prettier
Length of output: 2416
🏁 Script executed:
#!/bin/sh
set -eu
printf '%s\n' '--- imported `@marko/parse` exports ---'
rg -n -C 2 'from ["'\'']`@marko/parse`["'\'']' src
printf '%s\n' '--- lockfile entry ---'
sed -n '1,35p' pnpm-lock.yaml
printf '%s\n' '--- published `@marko/parse` metadata ---'
python3 - <<'PY'
import json
import urllib.request
url = "https://registry.npmjs.org/@marko%2Fparse"
with urllib.request.urlopen(url, timeout=10) as response:
data = json.load(response)
print("latest:", data.get("dist-tags", {}).get("latest"))
print("versions:", list(data.get("versions", {}))[-10:])
for version in list(data.get("versions", {}))[-3:]:
package = data["versions"][version]
print(version, {
"exports": package.get("exports"),
"types": package.get("types"),
"main": package.get("main"),
"module": package.get("module"),
})
PYRepository: marko-js/prettier
Length of output: 4459
Replace the temporary link before publishing.
Update package.json and pnpm-lock.yaml to use a semver range for a published @marko/parse release that provides the imports used by src/. Validate a clean install from the packed plugin.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@package.json` at line 46, Replace the temporary local link for `@marko/parse`
in package.json with the appropriate semver range for its published release, and
regenerate pnpm-lock.yaml accordingly. Confirm the selected release provides the
imports used by src/ and validate installation from the packed plugin.
Replaces the vendored syntax tree builder with the new shared
@marko/parsepackage (marko-js/language-server#586), the same CST used by the language server,eslint-plugin-markoand (pending)@marko/compiler. All 484 fixtures pass unchanged.Depends on
@marko/parsebeing published — thelink:dependency needs to be swapped for a version range before merge.