Unify frontmatter imports as import bind:target and drop > imports.

`import json:lib/json.mq.md` binds file libraries; `import fmt:time.format`
binds member short names (replaces `> use`). Legacy `> path.mq.md` / `> use`
now hard-error with a hint. Migrates repo docs, skills, ext, lib, public, examples,
man-test and tests; adds a negative gold and updates view/catalog rendering.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-08-13 10:03:21 +08:00
1 parent 56b9bfa5a3
commit ecc92f473a
163 files changed
+577 -593

No files matched your search

+8 -4
View File
@@ -301,10 +301,14 @@ fn extract_frontmatter_imports(source: &str) -> Vec<String> {
if t == "---" {
break;
}
if let Some(rest) = t.strip_prefix('>') {
if let Some(imp) = crate::parse::parse_import_spec(rest.trim()) {
imports.push(format!("{} as {}", imp.path, imp.bind));
}
if let Ok(Some(crate::parse::ImportLine::File(imp))) =
crate::parse::parse_import_line(t)
{
imports.push(format!("import {}:{}", imp.bind, imp.path));
} else if let Ok(Some(crate::parse::ImportLine::Member(u))) =
crate::parse::parse_import_line(t)
{
imports.push(format!("import {}:{}", u.bind, u.path.join(".")));
}
}
imports