@rayul/kordis 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1361,8 +1361,10 @@ function parseFrontmatter(source) {
|
|
|
1361
1361
|
try {
|
|
1362
1362
|
parsed = parseYaml(raw);
|
|
1363
1363
|
} catch (err) {
|
|
1364
|
+
const msg = err.message;
|
|
1365
|
+
const hint = msg.includes("Nested mapping") || msg.includes("compact mapping") ? ' Hint: if a field value (e.g. description) contains a colon, wrap the entire value in quotes: description: "Use when... Trigger: X".' : "";
|
|
1364
1366
|
throw new FrontmatterParseError(
|
|
1365
|
-
`YAML frontmatter is malformed: ${
|
|
1367
|
+
`YAML frontmatter is malformed: ${msg}${hint}`,
|
|
1366
1368
|
{ cause: err }
|
|
1367
1369
|
);
|
|
1368
1370
|
}
|
|
@@ -1408,6 +1410,14 @@ function pushCommand() {
|
|
|
1408
1410
|
} else {
|
|
1409
1411
|
content = await readFile3(abs, "utf8");
|
|
1410
1412
|
}
|
|
1413
|
+
let nameFromFm = null;
|
|
1414
|
+
try {
|
|
1415
|
+
const fm = parseFrontmatter(content).frontmatter ?? {};
|
|
1416
|
+
const v = fm["name"];
|
|
1417
|
+
if (typeof v === "string") nameFromFm = v;
|
|
1418
|
+
} catch (err) {
|
|
1419
|
+
throw new Error(err.message);
|
|
1420
|
+
}
|
|
1411
1421
|
let targetUser = null;
|
|
1412
1422
|
let targetSlug = null;
|
|
1413
1423
|
if (opts.slug && opts.slug.includes("/")) {
|
|
@@ -1417,13 +1427,6 @@ function pushCommand() {
|
|
|
1417
1427
|
targetSlug = s2;
|
|
1418
1428
|
}
|
|
1419
1429
|
} else {
|
|
1420
|
-
let nameFromFm = null;
|
|
1421
|
-
try {
|
|
1422
|
-
const fm = parseFrontmatter(content).frontmatter ?? {};
|
|
1423
|
-
const v = fm["name"];
|
|
1424
|
-
if (typeof v === "string") nameFromFm = v;
|
|
1425
|
-
} catch {
|
|
1426
|
-
}
|
|
1427
1430
|
if (bundle.username && (opts.slug || nameFromFm)) {
|
|
1428
1431
|
targetUser = bundle.username;
|
|
1429
1432
|
targetSlug = opts.slug ?? nameFromFm;
|