skillstogether 0.1.7 → 0.1.8
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 +9 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -398,16 +398,19 @@ function generateSkillContent(skill, organizationSlug, filesChecksum) {
|
|
|
398
398
|
const frontmatter = [
|
|
399
399
|
"---",
|
|
400
400
|
`name: ${escapeYaml(skill.name)}`,
|
|
401
|
+
skill.description ? `description: ${escapeYaml(skill.description)}` : null,
|
|
401
402
|
`slug: ${escapeYaml(skill.slug)}`,
|
|
402
403
|
`organization: ${escapeYaml(organizationSlug)}`,
|
|
403
|
-
skill.
|
|
404
|
-
`createdBy: ${escapeYaml(skill.createdBy.name)}`,
|
|
404
|
+
skill.createdBy.name ? `createdBy: ${escapeYaml(skill.createdBy.name)}` : null,
|
|
405
405
|
`installedAt: ${(/* @__PURE__ */ new Date()).toISOString()}`,
|
|
406
406
|
filesChecksum ? `filesChecksum: ${filesChecksum}` : null,
|
|
407
|
-
"---"
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
407
|
+
"---"
|
|
408
|
+
].filter((line) => line !== null && line !== void 0).join("\n");
|
|
409
|
+
const body = skill.content || "";
|
|
410
|
+
const separator = body ? body.startsWith("\n") || body.startsWith("\r\n") ? "\n" : "\n\n" : "\n";
|
|
411
|
+
const content = frontmatter + separator + body;
|
|
412
|
+
return content.endsWith("\n") ? content : `${content}
|
|
413
|
+
`;
|
|
411
414
|
}
|
|
412
415
|
async function downloadFile(url) {
|
|
413
416
|
return fetchWithSizeLimit(url, {
|