skillstogether 0.1.7 → 0.1.9

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.
Files changed (2) hide show
  1. package/dist/index.js +10 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -49,7 +49,7 @@ function removeToken() {
49
49
  delete config.token;
50
50
  writeConfig(config);
51
51
  }
52
- var API_URL = process.env.NODE_ENV === "production" ? "https://skillstogether.app" : "http://localhost:3000";
52
+ var API_URL = "https://skillstogether.app";
53
53
  function getApiUrl() {
54
54
  return API_URL;
55
55
  }
@@ -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.description ? `description: ${escapeYaml(skill.description)}` : null,
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
- ].filter(Boolean).join("\n");
410
- return frontmatter + (skill.content || "");
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, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillstogether",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "CLI tool to install skills",
5
5
  "keywords": [
6
6
  "cli",