skilld 1.6.2 → 1.7.0
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/README.md +29 -20
- package/dist/_chunks/agent.mjs +2 -1
- package/dist/_chunks/agent.mjs.map +1 -1
- package/dist/_chunks/assemble.mjs +1 -1
- package/dist/_chunks/author-group.mjs +17 -0
- package/dist/_chunks/author-group.mjs.map +1 -0
- package/dist/_chunks/author.mjs +8 -6
- package/dist/_chunks/author.mjs.map +1 -1
- package/dist/_chunks/cache.mjs +1 -1
- package/dist/_chunks/cache2.mjs +1 -1
- package/dist/_chunks/cli-helpers.mjs +3 -119
- package/dist/_chunks/cli-helpers.mjs.map +1 -1
- package/dist/_chunks/config.mjs +119 -27
- package/dist/_chunks/config.mjs.map +1 -1
- package/dist/_chunks/core.mjs +1 -1
- package/dist/_chunks/embedding-cache2.mjs +1 -1
- package/dist/_chunks/index.d.mts.map +1 -1
- package/dist/_chunks/index3.d.mts +79 -78
- package/dist/_chunks/index3.d.mts.map +1 -1
- package/dist/_chunks/install.mjs +85 -535
- package/dist/_chunks/install.mjs.map +1 -1
- package/dist/_chunks/install2.mjs +554 -0
- package/dist/_chunks/install2.mjs.map +1 -0
- package/dist/_chunks/lockfile.mjs +1 -0
- package/dist/_chunks/lockfile.mjs.map +1 -1
- package/dist/_chunks/package-registry.mjs +465 -0
- package/dist/_chunks/package-registry.mjs.map +1 -0
- package/dist/_chunks/prefix.mjs +108 -0
- package/dist/_chunks/prefix.mjs.map +1 -0
- package/dist/_chunks/prepare.mjs +6 -2
- package/dist/_chunks/prepare.mjs.map +1 -1
- package/dist/_chunks/prepare2.mjs +1 -1
- package/dist/_chunks/prompts.mjs +5 -99
- package/dist/_chunks/prompts.mjs.map +1 -1
- package/dist/_chunks/search-helpers.mjs +99 -0
- package/dist/_chunks/search-helpers.mjs.map +1 -0
- package/dist/_chunks/search-interactive.mjs +1 -1
- package/dist/_chunks/search-interactive.mjs.map +1 -1
- package/dist/_chunks/search.mjs +219 -1
- package/dist/_chunks/search.mjs.map +1 -0
- package/dist/_chunks/shared.mjs +1 -463
- package/dist/_chunks/shared.mjs.map +1 -1
- package/dist/_chunks/skills.mjs +1 -1
- package/dist/_chunks/sources.mjs +1177 -988
- package/dist/_chunks/sources.mjs.map +1 -1
- package/dist/_chunks/sync-registry.mjs +59 -0
- package/dist/_chunks/sync-registry.mjs.map +1 -0
- package/dist/_chunks/sync-shared2.mjs +10 -7
- package/dist/_chunks/sync-shared2.mjs.map +1 -1
- package/dist/_chunks/sync.mjs +208 -99
- package/dist/_chunks/sync.mjs.map +1 -1
- package/dist/_chunks/sync2.mjs +1 -1
- package/dist/_chunks/uninstall.mjs +3 -2
- package/dist/_chunks/uninstall.mjs.map +1 -1
- package/dist/_chunks/upload.mjs +152 -0
- package/dist/_chunks/upload.mjs.map +1 -0
- package/dist/_chunks/validate.mjs +1 -1
- package/dist/_chunks/version.mjs +30 -0
- package/dist/_chunks/version.mjs.map +1 -0
- package/dist/_chunks/wizard.mjs +2 -1
- package/dist/_chunks/wizard.mjs.map +1 -1
- package/dist/agent/index.mjs +2 -1
- package/dist/cache/index.mjs +1 -1
- package/dist/cli.mjs +48 -20
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +2 -2
- package/dist/sources/index.d.mts +2 -2
- package/dist/sources/index.mjs +3 -3
- package/dist/types.d.mts +1 -1
- package/package.json +11 -12
- package/dist/_chunks/search2.mjs +0 -310
- package/dist/_chunks/search2.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lockfile.mjs","names":[],"sources":["../../src/core/lockfile.ts"],"sourcesContent":["import { existsSync, readFileSync, unlinkSync, writeFileSync } from 'node:fs'\nimport { join } from 'pathe'\nimport { parseFrontmatter } from './markdown.ts'\nimport { yamlEscape, yamlParseKV } from './yaml.ts'\n\nexport interface SkillInfo {\n packageName?: string\n version?: string\n /** All tracked packages as comma-separated \"name@version\" pairs (multi-package skills) */\n packages?: string\n repo?: string\n source?: string\n syncedAt?: string\n generator?: string\n /** Skill path within repo (git-sourced skills) */\n path?: string\n /** Git ref tracked for updates */\n ref?: string\n /** Git commit SHA at install time */\n commit?: string\n}\n\nexport function parsePackages(packages?: string): Array<{ name: string, version: string }> {\n if (!packages)\n return []\n return packages.split(',').map((s) => {\n const trimmed = s.trim()\n const atIdx = trimmed.lastIndexOf('@')\n if (atIdx <= 0)\n return { name: trimmed, version: '' }\n return { name: trimmed.slice(0, atIdx), version: trimmed.slice(atIdx + 1) }\n }).filter(p => p.name)\n}\n\nexport function serializePackages(pkgs: Array<{ name: string, version: string }>): string {\n return pkgs.map(p => `${p.name}@${p.version}`).join(', ')\n}\n\nexport interface SkilldLock {\n skills: Record<string, SkillInfo>\n}\n\nconst SKILL_FM_KEYS: (keyof SkillInfo)[] = ['packageName', 'version', 'packages', 'repo', 'source', 'syncedAt', 'generator', 'path', 'ref', 'commit']\n\nfunction isSkillInfoKey(key: string): key is keyof SkillInfo {\n return (SKILL_FM_KEYS as readonly string[]).includes(key)\n}\n\nexport function parseSkillFrontmatter(skillPath: string): SkillInfo | null {\n if (!existsSync(skillPath))\n return null\n const content = readFileSync(skillPath, 'utf-8')\n const fm = parseFrontmatter(content)\n if (Object.keys(fm).length === 0)\n return null\n\n const info: SkillInfo = {}\n for (const key of SKILL_FM_KEYS) {\n if (fm[key])\n info[key] = fm[key]\n }\n return info\n}\n\nconst lockCache = new Map<string, SkilldLock>()\n\nexport function invalidateLockCache(skillsDir?: string): void {\n if (skillsDir)\n lockCache.delete(skillsDir)\n else\n lockCache.clear()\n}\n\nexport function readLock(skillsDir: string): SkilldLock | null {\n const cached = lockCache.get(skillsDir)\n if (cached)\n return { skills: { ...cached.skills } }\n const lockPath = join(skillsDir, 'skilld-lock.yaml')\n if (!existsSync(lockPath))\n return null\n const content = readFileSync(lockPath, 'utf-8')\n\n const skills: Record<string, SkillInfo> = {}\n let currentSkill: string | null = null\n\n for (const line of content.split('\\n')) {\n const skillMatch = line.match(/^ {2}(\\S+):$/)\n if (skillMatch) {\n currentSkill = skillMatch[1]!\n skills[currentSkill] = {}\n continue\n }\n if (currentSkill && line.startsWith(' ')) {\n const kv = yamlParseKV(line)\n if (kv && isSkillInfoKey(kv[0]))\n skills[currentSkill]![kv[0]] = kv[1]\n }\n }\n const lock = { skills }\n lockCache.set(skillsDir, lock)\n return { skills: { ...lock.skills } }\n}\n\nfunction serializeLock(lock: SkilldLock): string {\n let yaml = 'skills:\\n'\n for (const [name, skill] of Object.entries(lock.skills)) {\n yaml += ` ${name}:\\n`\n for (const key of SKILL_FM_KEYS) {\n if (skill[key])\n yaml += ` ${key}: ${yamlEscape(skill[key])}\\n`\n }\n }\n return yaml\n}\n\nexport function writeLock(skillsDir: string, skillName: string, info: SkillInfo): void {\n const lockPath = join(skillsDir, 'skilld-lock.yaml')\n let lock: SkilldLock = { skills: {} }\n if (existsSync(lockPath)) {\n lock = readLock(skillsDir) || { skills: {} }\n }\n\n const existing = lock.skills[skillName]\n if (existing && info.packageName) {\n // Merge packages list\n const existingPkgs = parsePackages(existing.packages)\n // Also include existing primary if not yet in packages list\n if (existing.packageName && !existingPkgs.some(p => p.name === existing.packageName)) {\n existingPkgs.unshift({ name: existing.packageName, version: existing.version || '' })\n }\n // Add/update new package\n const idx = existingPkgs.findIndex(p => p.name === info.packageName)\n if (idx >= 0) {\n existingPkgs[idx]!.version = info.version || ''\n }\n else {\n existingPkgs.push({ name: info.packageName, version: info.version || '' })\n }\n info.packages = serializePackages(existingPkgs)\n // Keep primary as first package\n info.packageName = existingPkgs[0]!.name\n info.version = existingPkgs[0]!.version\n // Preserve fields from existing entry that aren't in new info\n if (!info.repo && existing.repo)\n info.repo = existing.repo\n if (!info.source && existing.source)\n info.source = existing.source\n if (!info.generator && existing.generator)\n info.generator = existing.generator\n }\n\n lock.skills[skillName] = info\n writeFileSync(lockPath, serializeLock(lock))\n invalidateLockCache(skillsDir)\n}\n\n/**\n * Merge multiple lockfiles, preferring the most recently synced entry per skill.\n */\nexport function mergeLocks(locks: SkilldLock[]): SkilldLock {\n const merged: Record<string, SkillInfo> = {}\n for (const lock of locks) {\n for (const [name, info] of Object.entries(lock.skills)) {\n const existing = merged[name]\n if (!existing || (info.syncedAt && (!existing.syncedAt || info.syncedAt > existing.syncedAt)))\n merged[name] = info\n }\n }\n return { skills: merged }\n}\n\n/**\n * Sync a lockfile to all other dirs that already have a skilld-lock.yaml.\n * Only updates existing lockfiles — does not create new ones.\n */\nexport function syncLockfilesToDirs(sourceLock: SkilldLock, dirs: string[]): void {\n for (const dir of dirs) {\n const lockPath = join(dir, 'skilld-lock.yaml')\n if (!existsSync(lockPath))\n continue\n const existing = readLock(dir)\n if (!existing)\n continue\n // Merge source into existing\n const merged = mergeLocks([existing, sourceLock])\n writeFileSync(lockPath, serializeLock(merged))\n invalidateLockCache(dir)\n }\n}\n\nexport function removeLockEntry(skillsDir: string, skillName: string): void {\n const lockPath = join(skillsDir, 'skilld-lock.yaml')\n const lock = readLock(skillsDir)\n if (!lock)\n return\n\n delete lock.skills[skillName]\n\n if (Object.keys(lock.skills).length === 0) {\n unlinkSync(lockPath)\n invalidateLockCache(skillsDir)\n return\n }\n\n writeFileSync(lockPath, serializeLock(lock))\n invalidateLockCache(skillsDir)\n}\n"],"mappings":";;;;AAsBA,SAAgB,cAAc,UAA6D;AACzF,KAAI,CAAC,SACH,QAAO,EAAE;AACX,QAAO,SAAS,MAAM,IAAI,CAAC,KAAK,MAAM;EACpC,MAAM,UAAU,EAAE,MAAM;EACxB,MAAM,QAAQ,QAAQ,YAAY,IAAI;AACtC,MAAI,SAAS,EACX,QAAO;GAAE,MAAM;GAAS,SAAS;GAAI;AACvC,SAAO;GAAE,MAAM,QAAQ,MAAM,GAAG,MAAM;GAAE,SAAS,QAAQ,MAAM,QAAQ,EAAA;GAAI;GAC3E,CAAC,QAAO,MAAK,EAAE,KAAK;;AAGxB,SAAgB,kBAAkB,MAAwD;AACx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S;AACzB,MAAI,CAAC,KAAK,aAAa,SAAS,UAC9B,MAAK,YAAY,SAAS;;AAG9B,MAAK,OAAO,aAAa;AACzB,eAAc,UAAU,cAAc,KAAK,CAAC;AAC5C,qBAAoB,UAAU;;;;AAMhC,MAAA,MAAgB,QAAW,MAAiC,MAAA,MAAA,CAAA,MAAA,SAAA,OAAA,QAAA,KAAA,OAAA,EAAA;EAC1D,MAAM,WAAsC,OAAA;AAC5C,MAAK,CAAA,YAAM,KAAQ,aACZ,CAAM,SAAO,YAAS,KAAO,WAAa,SAAS,UAAA,QAAA,QAAA;;AAEtD,QAAK,EAAA,QAAA,QAAkB;;;;;;;AAW7B,MAAA,CAAA,SAAgB;AACd,gBAAW,UAAa,cAAA,WAAA,CAAA,UAAA,WAAA,CAAA,CAAA,CAAA;AACtB,sBAAiB,IAAK;;;AAItB,SAAK,gBACH,WAAA,WAAA;CAGF,MAAA,WAAc,KAAA,WAAU,mBADG;CAE3B,MAAA,OAAA,SAAoB,UAAI;;;AAI5B,KAAA,OAAgB,KAAA,KAAA,OAAgB,CAAA,WAAmB,GAAA;AACjD,aAAM,SAAW;AACjB,sBAAa,UAAS;AACtB;;AAKA,eAAW,UAAU,cAAQ,KAAc,CAAA;AACzC,qBAAW,UAAS"}
|
|
1
|
+
{"version":3,"file":"lockfile.mjs","names":[],"sources":["../../src/core/lockfile.ts"],"sourcesContent":["import { existsSync, readFileSync, unlinkSync, writeFileSync } from 'node:fs'\nimport { join } from 'pathe'\nimport { parseFrontmatter } from './markdown.ts'\nimport { yamlEscape, yamlParseKV } from './yaml.ts'\n\nexport interface SkillInfo {\n packageName?: string\n version?: string\n /** All tracked packages as comma-separated \"name@version\" pairs (multi-package skills) */\n packages?: string\n repo?: string\n source?: string\n syncedAt?: string\n generator?: string\n /** Skill path within repo (git-sourced skills) */\n path?: string\n /** Git ref tracked for updates */\n ref?: string\n /** Git commit SHA at install time */\n commit?: string\n}\n\nexport function parsePackages(packages?: string): Array<{ name: string, version: string }> {\n if (!packages)\n return []\n return packages.split(',').map((s) => {\n const trimmed = s.trim()\n const atIdx = trimmed.lastIndexOf('@')\n if (atIdx <= 0)\n return { name: trimmed, version: '' }\n return { name: trimmed.slice(0, atIdx), version: trimmed.slice(atIdx + 1) }\n }).filter(p => p.name)\n}\n\nexport function serializePackages(pkgs: Array<{ name: string, version: string }>): string {\n return pkgs.map(p => `${p.name}@${p.version}`).join(', ')\n}\n\nexport interface SkilldLock {\n skills: Record<string, SkillInfo>\n}\n\nconst SKILL_FM_KEYS: (keyof SkillInfo)[] = ['packageName', 'version', 'packages', 'repo', 'source', 'syncedAt', 'generator', 'path', 'ref', 'commit']\n\nfunction isSkillInfoKey(key: string): key is keyof SkillInfo {\n return (SKILL_FM_KEYS as readonly string[]).includes(key)\n}\n\nexport function parseSkillFrontmatter(skillPath: string): SkillInfo | null {\n if (!existsSync(skillPath))\n return null\n const content = readFileSync(skillPath, 'utf-8')\n const fm = parseFrontmatter(content)\n if (Object.keys(fm).length === 0)\n return null\n\n const info: SkillInfo = {}\n for (const key of SKILL_FM_KEYS) {\n if (fm[key])\n info[key] = fm[key]\n }\n return info\n}\n\nconst lockCache = new Map<string, SkilldLock>()\n\nexport function invalidateLockCache(skillsDir?: string): void {\n if (skillsDir)\n lockCache.delete(skillsDir)\n else\n lockCache.clear()\n}\n\nexport function readLock(skillsDir: string): SkilldLock | null {\n const cached = lockCache.get(skillsDir)\n if (cached)\n return { skills: { ...cached.skills } }\n const lockPath = join(skillsDir, 'skilld-lock.yaml')\n if (!existsSync(lockPath))\n return null\n const content = readFileSync(lockPath, 'utf-8')\n\n const skills: Record<string, SkillInfo> = {}\n let currentSkill: string | null = null\n\n for (const line of content.split('\\n')) {\n const skillMatch = line.match(/^ {2}(\\S+):$/)\n if (skillMatch) {\n currentSkill = skillMatch[1]!\n skills[currentSkill] = {}\n continue\n }\n if (currentSkill && line.startsWith(' ')) {\n const kv = yamlParseKV(line)\n if (kv && isSkillInfoKey(kv[0]))\n skills[currentSkill]![kv[0]] = kv[1]\n }\n }\n // Normalize legacy source values\n for (const info of Object.values(skills)) {\n if (info.source === 'npm')\n info.source = 'registry'\n }\n const lock = { skills }\n lockCache.set(skillsDir, lock)\n return { skills: { ...lock.skills } }\n}\n\nfunction serializeLock(lock: SkilldLock): string {\n let yaml = 'skills:\\n'\n for (const [name, skill] of Object.entries(lock.skills)) {\n yaml += ` ${name}:\\n`\n for (const key of SKILL_FM_KEYS) {\n if (skill[key])\n yaml += ` ${key}: ${yamlEscape(skill[key])}\\n`\n }\n }\n return yaml\n}\n\nexport function writeLock(skillsDir: string, skillName: string, info: SkillInfo): void {\n const lockPath = join(skillsDir, 'skilld-lock.yaml')\n let lock: SkilldLock = { skills: {} }\n if (existsSync(lockPath)) {\n lock = readLock(skillsDir) || { skills: {} }\n }\n\n const existing = lock.skills[skillName]\n if (existing && info.packageName) {\n // Merge packages list\n const existingPkgs = parsePackages(existing.packages)\n // Also include existing primary if not yet in packages list\n if (existing.packageName && !existingPkgs.some(p => p.name === existing.packageName)) {\n existingPkgs.unshift({ name: existing.packageName, version: existing.version || '' })\n }\n // Add/update new package\n const idx = existingPkgs.findIndex(p => p.name === info.packageName)\n if (idx >= 0) {\n existingPkgs[idx]!.version = info.version || ''\n }\n else {\n existingPkgs.push({ name: info.packageName, version: info.version || '' })\n }\n info.packages = serializePackages(existingPkgs)\n // Keep primary as first package\n info.packageName = existingPkgs[0]!.name\n info.version = existingPkgs[0]!.version\n // Preserve fields from existing entry that aren't in new info\n if (!info.repo && existing.repo)\n info.repo = existing.repo\n if (!info.source && existing.source)\n info.source = existing.source\n if (!info.generator && existing.generator)\n info.generator = existing.generator\n }\n\n lock.skills[skillName] = info\n writeFileSync(lockPath, serializeLock(lock))\n invalidateLockCache(skillsDir)\n}\n\n/**\n * Merge multiple lockfiles, preferring the most recently synced entry per skill.\n */\nexport function mergeLocks(locks: SkilldLock[]): SkilldLock {\n const merged: Record<string, SkillInfo> = {}\n for (const lock of locks) {\n for (const [name, info] of Object.entries(lock.skills)) {\n const existing = merged[name]\n if (!existing || (info.syncedAt && (!existing.syncedAt || info.syncedAt > existing.syncedAt)))\n merged[name] = info\n }\n }\n return { skills: merged }\n}\n\n/**\n * Sync a lockfile to all other dirs that already have a skilld-lock.yaml.\n * Only updates existing lockfiles — does not create new ones.\n */\nexport function syncLockfilesToDirs(sourceLock: SkilldLock, dirs: string[]): void {\n for (const dir of dirs) {\n const lockPath = join(dir, 'skilld-lock.yaml')\n if (!existsSync(lockPath))\n continue\n const existing = readLock(dir)\n if (!existing)\n continue\n // Merge source into existing\n const merged = mergeLocks([existing, sourceLock])\n writeFileSync(lockPath, serializeLock(merged))\n invalidateLockCache(dir)\n }\n}\n\nexport function removeLockEntry(skillsDir: string, skillName: string): void {\n const lockPath = join(skillsDir, 'skilld-lock.yaml')\n const lock = readLock(skillsDir)\n if (!lock)\n return\n\n delete lock.skills[skillName]\n\n if (Object.keys(lock.skills).length === 0) {\n unlinkSync(lockPath)\n invalidateLockCache(skillsDir)\n return\n }\n\n writeFileSync(lockPath, serializeLock(lock))\n invalidateLockCache(skillsDir)\n}\n"],"mappings":";;;;AAsBA,SAAgB,cAAc,UAA6D;AACzF,KAAI,CAAC,SACH,QAAO,EAAE;AACX,QAAO,SAAS,MAAM,IAAI,CAAC,KAAK,MAAM;EACpC,MAAM,UAAU,EAAE,MAAM;EACxB,MAAM,QAAQ,QAAQ,YAAY,IAAI;AACtC,MAAI,SAAS,EACX,QAAO;GAAE,MAAM;GAAS,SAAS;GAAI;AACvC,SAAO;GAAE,MAAM,QAAQ,MAAM,GAAG,MAAM;GAAE,SAAS,QAAQ,MAAM,QAAQ,EAAA;GAAI;GAC3E,CAAC,QAAO,MAAK,EAAE,KAAK;;AAGxB,SAAgB,kBAAkB,MAAwD;AACxF,QAAO,KAAK,KAAI,MAAK,GAAG,EAAE,KAAK,GAAG,EAAE,UAAU,CAAC,KAAK,KAAK;;AAO3D,MAAM,gBAAqC;CAAC;CAAe;CAAW;CAAY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C9B,MAAK,YAAY,SAAS;;AAG9B,MAAK,OAAO,aAAa;AACzB,eAAc,UAAU,cAAc,KAAK,CAAC;AAC5C,qBAAoB,UAAU;;;;AAMhC,MAAA,MAAgB,QAAW,MAAiC,MAAA,MAAA,CAAA,MAAA,SAAA,OAAA,QAAA,KAAA,OAAA,EAAA;EAC1D,MAAM,WAAsC,OAAA;AAC5C,MAAK,CAAA,YAAM,KAAQ,aACZ,CAAM,SAAO,YAAS,KAAO,WAAa,SAAS,UAAA,QAAA,QAAA;;AAEtD,QAAK,EAAA,QAAA,QAAkB;;;;;;;AAW7B,MAAA,CAAA,SAAgB;AACd,gBAAW,UAAa,cAAA,WAAA,CAAA,UAAA,WAAA,CAAA,CAAA,CAAA;AACtB,sBAAiB,IAAK;;;AAItB,SAAK,gBACH,WAAA,WAAA;CAGF,MAAA,WAAc,KAAA,WAAU,mBADG;CAE3B,MAAA,OAAA,SAAoB,UAAI;;;AAI5B,KAAA,OAAgB,KAAA,KAAA,OAAgB,CAAA,WAAmB,GAAA;AACjD,aAAM,SAAW;AACjB,sBAAa,UAAS;AACtB;;AAKA,eAAW,UAAU,cAAQ,KAAc,CAAA;AACzC,qBAAW,UAAS"}
|
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
const REPO_REGISTRY = {
|
|
2
|
+
"vuejs/core": {
|
|
3
|
+
owner: "vuejs",
|
|
4
|
+
repo: "core",
|
|
5
|
+
docsRepo: "docs",
|
|
6
|
+
docsPath: "src",
|
|
7
|
+
homepage: "https://vuejs.org",
|
|
8
|
+
prereleaseChangelogRef: "minor",
|
|
9
|
+
packages: {
|
|
10
|
+
"vue": {
|
|
11
|
+
primary: true,
|
|
12
|
+
filePatterns: ["*.vue"],
|
|
13
|
+
rules: ["ALWAYS use `<script setup lang=\"ts\">`", "Use ```vue code fences for SFC examples containing `<script>` or `<template>` tags, ```ts for plain TypeScript"]
|
|
14
|
+
},
|
|
15
|
+
"@vue/compiler-core": {},
|
|
16
|
+
"@vue/compiler-dom": {},
|
|
17
|
+
"@vue/reactivity": {},
|
|
18
|
+
"@vue/runtime-core": {},
|
|
19
|
+
"@vue/runtime-dom": {},
|
|
20
|
+
"@vue/shared": {}
|
|
21
|
+
},
|
|
22
|
+
blogReleases: [
|
|
23
|
+
{
|
|
24
|
+
version: "3.5",
|
|
25
|
+
url: "https://blog.vuejs.org/posts/vue-3-5",
|
|
26
|
+
date: "2024-09-01"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
version: "3.4",
|
|
30
|
+
url: "https://blog.vuejs.org/posts/vue-3-4",
|
|
31
|
+
date: "2023-12-28"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
version: "3.3",
|
|
35
|
+
url: "https://blog.vuejs.org/posts/vue-3-3",
|
|
36
|
+
date: "2023-05-11"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
version: "3.2",
|
|
40
|
+
url: "https://blog.vuejs.org/posts/vue-3-2",
|
|
41
|
+
date: "2021-08-05"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
version: "3.1",
|
|
45
|
+
url: "https://blog.vuejs.org/posts/vue-3-1",
|
|
46
|
+
date: "2021-06-07"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
version: "3.0",
|
|
50
|
+
url: "https://blog.vuejs.org/posts/vue-3-0",
|
|
51
|
+
date: "2020-09-18"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"tailwindlabs/tailwindcss": {
|
|
56
|
+
owner: "tailwindlabs",
|
|
57
|
+
repo: "tailwindcss",
|
|
58
|
+
docsRepo: "tailwindcss.com",
|
|
59
|
+
docsPath: "src/docs",
|
|
60
|
+
homepage: "https://tailwindcss.com",
|
|
61
|
+
packages: { tailwindcss: { primary: true } }
|
|
62
|
+
},
|
|
63
|
+
"withastro/astro": {
|
|
64
|
+
owner: "withastro",
|
|
65
|
+
repo: "astro",
|
|
66
|
+
docsRepo: "docs",
|
|
67
|
+
docsPath: "src/content/docs/en",
|
|
68
|
+
homepage: "https://docs.astro.build",
|
|
69
|
+
packages: { astro: {
|
|
70
|
+
primary: true,
|
|
71
|
+
filePatterns: ["*.astro"]
|
|
72
|
+
} }
|
|
73
|
+
},
|
|
74
|
+
"vueuse/vueuse": {
|
|
75
|
+
owner: "vueuse",
|
|
76
|
+
repo: "vueuse",
|
|
77
|
+
docsPath: "packages",
|
|
78
|
+
packages: { "@vueuse/core": { primary: true } }
|
|
79
|
+
},
|
|
80
|
+
"sveltejs/svelte": {
|
|
81
|
+
owner: "sveltejs",
|
|
82
|
+
repo: "svelte",
|
|
83
|
+
packages: { svelte: {
|
|
84
|
+
primary: true,
|
|
85
|
+
filePatterns: ["*.svelte"],
|
|
86
|
+
rules: ["ALWAYS use runes syntax ($state, $derived, $effect, $props)"]
|
|
87
|
+
} }
|
|
88
|
+
},
|
|
89
|
+
"solidjs/solid": {
|
|
90
|
+
owner: "solidjs",
|
|
91
|
+
repo: "solid",
|
|
92
|
+
packages: { "solid-js": {
|
|
93
|
+
primary: true,
|
|
94
|
+
filePatterns: ["*.jsx", "*.tsx"]
|
|
95
|
+
} }
|
|
96
|
+
},
|
|
97
|
+
"QwikDev/qwik": {
|
|
98
|
+
owner: "QwikDev",
|
|
99
|
+
repo: "qwik",
|
|
100
|
+
packages: { qwik: {
|
|
101
|
+
primary: true,
|
|
102
|
+
filePatterns: ["*.tsx"]
|
|
103
|
+
} }
|
|
104
|
+
},
|
|
105
|
+
"marko-js/marko": {
|
|
106
|
+
owner: "marko-js",
|
|
107
|
+
repo: "marko",
|
|
108
|
+
packages: { marko: {
|
|
109
|
+
primary: true,
|
|
110
|
+
filePatterns: ["*.marko"]
|
|
111
|
+
} }
|
|
112
|
+
},
|
|
113
|
+
"riot/riot": {
|
|
114
|
+
owner: "riot",
|
|
115
|
+
repo: "riot",
|
|
116
|
+
packages: { riot: {
|
|
117
|
+
primary: true,
|
|
118
|
+
filePatterns: ["*.riot"]
|
|
119
|
+
} }
|
|
120
|
+
},
|
|
121
|
+
"microsoft/TypeScript": {
|
|
122
|
+
owner: "microsoft",
|
|
123
|
+
repo: "TypeScript",
|
|
124
|
+
packages: { typescript: {
|
|
125
|
+
primary: true,
|
|
126
|
+
filePatterns: [
|
|
127
|
+
"*.ts",
|
|
128
|
+
"*.tsx",
|
|
129
|
+
"*.mts",
|
|
130
|
+
"*.cts"
|
|
131
|
+
]
|
|
132
|
+
} },
|
|
133
|
+
blogReleases: [
|
|
134
|
+
{
|
|
135
|
+
version: "6.0",
|
|
136
|
+
url: "https://devblogs.microsoft.com/typescript/announcing-typescript-6-0-beta/",
|
|
137
|
+
date: "2026-02-11",
|
|
138
|
+
title: "Announcing TypeScript 6.0 Beta"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
version: "5.9",
|
|
142
|
+
url: "https://devblogs.microsoft.com/typescript/announcing-typescript-5-9/",
|
|
143
|
+
date: "2025-08-01",
|
|
144
|
+
title: "Announcing TypeScript 5.9"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
version: "5.8",
|
|
148
|
+
url: "https://devblogs.microsoft.com/typescript/announcing-typescript-5-8/",
|
|
149
|
+
date: "2025-02-28",
|
|
150
|
+
title: "Announcing TypeScript 5.8"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
version: "5.7",
|
|
154
|
+
url: "https://devblogs.microsoft.com/typescript/announcing-typescript-5-7/",
|
|
155
|
+
date: "2024-11-22",
|
|
156
|
+
title: "Announcing TypeScript 5.7"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
version: "5.6",
|
|
160
|
+
url: "https://devblogs.microsoft.com/typescript/announcing-typescript-5-6/",
|
|
161
|
+
date: "2024-09-09",
|
|
162
|
+
title: "Announcing TypeScript 5.6"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
version: "5.5",
|
|
166
|
+
url: "https://devblogs.microsoft.com/typescript/announcing-typescript-5-5/",
|
|
167
|
+
date: "2024-06-20",
|
|
168
|
+
title: "Announcing TypeScript 5.5"
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
"jashkenas/coffeescript": {
|
|
173
|
+
owner: "jashkenas",
|
|
174
|
+
repo: "coffeescript",
|
|
175
|
+
packages: { coffeescript: {
|
|
176
|
+
primary: true,
|
|
177
|
+
filePatterns: ["*.coffee"]
|
|
178
|
+
} }
|
|
179
|
+
},
|
|
180
|
+
"gkz/LiveScript": {
|
|
181
|
+
owner: "gkz",
|
|
182
|
+
repo: "LiveScript",
|
|
183
|
+
packages: { livescript: {
|
|
184
|
+
primary: true,
|
|
185
|
+
filePatterns: ["*.ls"]
|
|
186
|
+
} }
|
|
187
|
+
},
|
|
188
|
+
"elm/compiler": {
|
|
189
|
+
owner: "elm",
|
|
190
|
+
repo: "compiler",
|
|
191
|
+
packages: { elm: {
|
|
192
|
+
primary: true,
|
|
193
|
+
filePatterns: ["*.elm"]
|
|
194
|
+
} }
|
|
195
|
+
},
|
|
196
|
+
"sass/dart-sass": {
|
|
197
|
+
owner: "sass",
|
|
198
|
+
repo: "dart-sass",
|
|
199
|
+
packages: { sass: {
|
|
200
|
+
primary: true,
|
|
201
|
+
filePatterns: ["*.scss", "*.sass"]
|
|
202
|
+
} }
|
|
203
|
+
},
|
|
204
|
+
"less/less.js": {
|
|
205
|
+
owner: "less",
|
|
206
|
+
repo: "less.js",
|
|
207
|
+
packages: { less: {
|
|
208
|
+
primary: true,
|
|
209
|
+
filePatterns: ["*.less"]
|
|
210
|
+
} }
|
|
211
|
+
},
|
|
212
|
+
"stylus/stylus": {
|
|
213
|
+
owner: "stylus",
|
|
214
|
+
repo: "stylus",
|
|
215
|
+
packages: { stylus: {
|
|
216
|
+
primary: true,
|
|
217
|
+
filePatterns: ["*.styl"]
|
|
218
|
+
} }
|
|
219
|
+
},
|
|
220
|
+
"postcss/postcss": {
|
|
221
|
+
owner: "postcss",
|
|
222
|
+
repo: "postcss",
|
|
223
|
+
packages: { postcss: {
|
|
224
|
+
primary: true,
|
|
225
|
+
filePatterns: ["*.css", "*.pcss"]
|
|
226
|
+
} }
|
|
227
|
+
},
|
|
228
|
+
"pugjs/pug": {
|
|
229
|
+
owner: "pugjs",
|
|
230
|
+
repo: "pug",
|
|
231
|
+
packages: { pug: {
|
|
232
|
+
primary: true,
|
|
233
|
+
filePatterns: ["*.pug"]
|
|
234
|
+
} }
|
|
235
|
+
},
|
|
236
|
+
"mde/ejs": {
|
|
237
|
+
owner: "mde",
|
|
238
|
+
repo: "ejs",
|
|
239
|
+
packages: { ejs: {
|
|
240
|
+
primary: true,
|
|
241
|
+
filePatterns: ["*.ejs"]
|
|
242
|
+
} }
|
|
243
|
+
},
|
|
244
|
+
"handlebars-lang/handlebars.js": {
|
|
245
|
+
owner: "handlebars-lang",
|
|
246
|
+
repo: "handlebars.js",
|
|
247
|
+
packages: { handlebars: {
|
|
248
|
+
primary: true,
|
|
249
|
+
filePatterns: ["*.hbs", "*.handlebars"]
|
|
250
|
+
} }
|
|
251
|
+
},
|
|
252
|
+
"janl/mustache.js": {
|
|
253
|
+
owner: "janl",
|
|
254
|
+
repo: "mustache.js",
|
|
255
|
+
packages: { mustache: {
|
|
256
|
+
primary: true,
|
|
257
|
+
filePatterns: ["*.mustache"]
|
|
258
|
+
} }
|
|
259
|
+
},
|
|
260
|
+
"mozilla/nunjucks": {
|
|
261
|
+
owner: "mozilla",
|
|
262
|
+
repo: "nunjucks",
|
|
263
|
+
packages: { nunjucks: {
|
|
264
|
+
primary: true,
|
|
265
|
+
filePatterns: ["*.njk"]
|
|
266
|
+
} }
|
|
267
|
+
},
|
|
268
|
+
"Shopify/liquid": {
|
|
269
|
+
owner: "Shopify",
|
|
270
|
+
repo: "liquid",
|
|
271
|
+
packages: { liquid: {
|
|
272
|
+
primary: true,
|
|
273
|
+
filePatterns: ["*.liquid"]
|
|
274
|
+
} }
|
|
275
|
+
},
|
|
276
|
+
"eemeli/yaml": {
|
|
277
|
+
owner: "eemeli",
|
|
278
|
+
repo: "yaml",
|
|
279
|
+
packages: { yaml: {
|
|
280
|
+
primary: true,
|
|
281
|
+
filePatterns: ["*.yaml", "*.yml"]
|
|
282
|
+
} }
|
|
283
|
+
},
|
|
284
|
+
"nodeca/js-yaml": {
|
|
285
|
+
owner: "nodeca",
|
|
286
|
+
repo: "js-yaml",
|
|
287
|
+
packages: { "js-yaml": {
|
|
288
|
+
primary: true,
|
|
289
|
+
filePatterns: ["*.yaml", "*.yml"]
|
|
290
|
+
} }
|
|
291
|
+
},
|
|
292
|
+
"BinaryMuse/toml-node": {
|
|
293
|
+
owner: "BinaryMuse",
|
|
294
|
+
repo: "toml-node",
|
|
295
|
+
packages: {
|
|
296
|
+
"toml": {
|
|
297
|
+
primary: true,
|
|
298
|
+
filePatterns: ["*.toml"]
|
|
299
|
+
},
|
|
300
|
+
"@iarna/toml": { filePatterns: ["*.toml"] }
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
"json5/json5": {
|
|
304
|
+
owner: "json5",
|
|
305
|
+
repo: "json5",
|
|
306
|
+
packages: { json5: {
|
|
307
|
+
primary: true,
|
|
308
|
+
filePatterns: ["*.json5"]
|
|
309
|
+
} }
|
|
310
|
+
},
|
|
311
|
+
"microsoft/node-jsonc-parser": {
|
|
312
|
+
owner: "microsoft",
|
|
313
|
+
repo: "node-jsonc-parser",
|
|
314
|
+
packages: { "jsonc-parser": {
|
|
315
|
+
primary: true,
|
|
316
|
+
filePatterns: ["*.jsonc"]
|
|
317
|
+
} }
|
|
318
|
+
},
|
|
319
|
+
"markdown-it/markdown-it": {
|
|
320
|
+
owner: "markdown-it",
|
|
321
|
+
repo: "markdown-it",
|
|
322
|
+
packages: { "markdown-it": {
|
|
323
|
+
primary: true,
|
|
324
|
+
filePatterns: ["*.md"]
|
|
325
|
+
} }
|
|
326
|
+
},
|
|
327
|
+
"markedjs/marked": {
|
|
328
|
+
owner: "markedjs",
|
|
329
|
+
repo: "marked",
|
|
330
|
+
packages: { marked: {
|
|
331
|
+
primary: true,
|
|
332
|
+
filePatterns: ["*.md"]
|
|
333
|
+
} }
|
|
334
|
+
},
|
|
335
|
+
"remarkjs/remark": {
|
|
336
|
+
owner: "remarkjs",
|
|
337
|
+
repo: "remark",
|
|
338
|
+
packages: { remark: {
|
|
339
|
+
primary: true,
|
|
340
|
+
filePatterns: ["*.md", "*.mdx"]
|
|
341
|
+
} }
|
|
342
|
+
},
|
|
343
|
+
"mdx-js/mdx": {
|
|
344
|
+
owner: "mdx-js",
|
|
345
|
+
repo: "mdx",
|
|
346
|
+
packages: { "@mdx-js/mdx": {
|
|
347
|
+
primary: true,
|
|
348
|
+
filePatterns: ["*.mdx"]
|
|
349
|
+
} }
|
|
350
|
+
},
|
|
351
|
+
"graphql/graphql-js": {
|
|
352
|
+
owner: "graphql",
|
|
353
|
+
repo: "graphql-js",
|
|
354
|
+
packages: {
|
|
355
|
+
"graphql": {
|
|
356
|
+
primary: true,
|
|
357
|
+
filePatterns: ["*.graphql", "*.gql"]
|
|
358
|
+
},
|
|
359
|
+
"graphql-tag": { filePatterns: ["*.graphql", "*.gql"] }
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
"dotansimha/graphql-code-generator": {
|
|
363
|
+
owner: "dotansimha",
|
|
364
|
+
repo: "graphql-code-generator",
|
|
365
|
+
packages: { "@graphql-codegen/cli": {
|
|
366
|
+
primary: true,
|
|
367
|
+
filePatterns: ["*.graphql", "*.gql"]
|
|
368
|
+
} }
|
|
369
|
+
},
|
|
370
|
+
"quasarframework/quasar": {
|
|
371
|
+
owner: "quasarframework",
|
|
372
|
+
repo: "quasar",
|
|
373
|
+
docsPath: "docs/src/pages",
|
|
374
|
+
docsRef: "dev",
|
|
375
|
+
homepage: "https://quasar.dev",
|
|
376
|
+
packages: { quasar: { primary: true } }
|
|
377
|
+
},
|
|
378
|
+
"motiondivision/motion-vue": {
|
|
379
|
+
owner: "motiondivision",
|
|
380
|
+
repo: "motion-vue",
|
|
381
|
+
homepage: "https://motion.dev",
|
|
382
|
+
crawlUrl: "https://motion.dev/docs/vue**",
|
|
383
|
+
packages: { "motion-v": { primary: true } }
|
|
384
|
+
},
|
|
385
|
+
"prisma/prisma": {
|
|
386
|
+
owner: "prisma",
|
|
387
|
+
repo: "prisma",
|
|
388
|
+
packages: {
|
|
389
|
+
"prisma": {
|
|
390
|
+
primary: true,
|
|
391
|
+
filePatterns: ["*.prisma"]
|
|
392
|
+
},
|
|
393
|
+
"@prisma/client": { filePatterns: ["*.prisma"] }
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
"nicolo-ribaudo/tc39-proposal-wasm-esm-integration": {
|
|
397
|
+
owner: "nicolo-ribaudo",
|
|
398
|
+
repo: "tc39-proposal-wasm-esm-integration",
|
|
399
|
+
packages: { "wasm-pack": {
|
|
400
|
+
primary: true,
|
|
401
|
+
filePatterns: ["*.wasm"]
|
|
402
|
+
} }
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
const PACKAGE_TO_REPO_MAP = {};
|
|
406
|
+
for (const [repoKey, entry] of Object.entries(REPO_REGISTRY)) for (const packageName of Object.keys(entry.packages)) PACKAGE_TO_REPO_MAP[packageName] = repoKey;
|
|
407
|
+
function getDocOverride(packageName) {
|
|
408
|
+
const repoKey = PACKAGE_TO_REPO_MAP[packageName];
|
|
409
|
+
if (!repoKey) return void 0;
|
|
410
|
+
const entry = REPO_REGISTRY[repoKey];
|
|
411
|
+
if (!entry?.docsRepo && !entry?.docsPath) return void 0;
|
|
412
|
+
return {
|
|
413
|
+
owner: entry.owner,
|
|
414
|
+
repo: entry.docsRepo || entry.repo,
|
|
415
|
+
path: entry.docsPath || "",
|
|
416
|
+
ref: entry.docsRef,
|
|
417
|
+
homepage: entry.homepage
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
function getBlogPreset(packageName) {
|
|
421
|
+
const repoKey = PACKAGE_TO_REPO_MAP[packageName];
|
|
422
|
+
if (!repoKey) return void 0;
|
|
423
|
+
const entry = REPO_REGISTRY[repoKey];
|
|
424
|
+
if (!entry?.blogReleases) return void 0;
|
|
425
|
+
return {
|
|
426
|
+
packageName,
|
|
427
|
+
releases: entry.blogReleases
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
function getFilePatterns(packageName) {
|
|
431
|
+
const repoKey = PACKAGE_TO_REPO_MAP[packageName];
|
|
432
|
+
if (!repoKey) return void 0;
|
|
433
|
+
return REPO_REGISTRY[repoKey]?.packages[packageName]?.filePatterns;
|
|
434
|
+
}
|
|
435
|
+
function getRepoEntry(repoKey) {
|
|
436
|
+
return REPO_REGISTRY[repoKey];
|
|
437
|
+
}
|
|
438
|
+
function getRepoKeyForPackage(packageName) {
|
|
439
|
+
return PACKAGE_TO_REPO_MAP[packageName];
|
|
440
|
+
}
|
|
441
|
+
function getPackageRules(packageName) {
|
|
442
|
+
const repoKey = PACKAGE_TO_REPO_MAP[packageName];
|
|
443
|
+
if (!repoKey) return [];
|
|
444
|
+
return REPO_REGISTRY[repoKey]?.packages[packageName]?.rules ?? [];
|
|
445
|
+
}
|
|
446
|
+
function getPrereleaseChangelogRef(packageName) {
|
|
447
|
+
const repoKey = PACKAGE_TO_REPO_MAP[packageName];
|
|
448
|
+
if (!repoKey) return void 0;
|
|
449
|
+
return REPO_REGISTRY[repoKey]?.prereleaseChangelogRef;
|
|
450
|
+
}
|
|
451
|
+
function getCrawlUrl(packageName) {
|
|
452
|
+
const repoKey = PACKAGE_TO_REPO_MAP[packageName];
|
|
453
|
+
if (!repoKey) return void 0;
|
|
454
|
+
return REPO_REGISTRY[repoKey]?.crawlUrl;
|
|
455
|
+
}
|
|
456
|
+
function getRelatedPackages(packageName) {
|
|
457
|
+
const repoKey = PACKAGE_TO_REPO_MAP[packageName];
|
|
458
|
+
if (!repoKey) return [];
|
|
459
|
+
const entry = REPO_REGISTRY[repoKey];
|
|
460
|
+
if (!entry) return [];
|
|
461
|
+
return Object.keys(entry.packages);
|
|
462
|
+
}
|
|
463
|
+
export { getPackageRules as a, getRepoEntry as c, getFilePatterns as i, getRepoKeyForPackage as l, getCrawlUrl as n, getPrereleaseChangelogRef as o, getDocOverride as r, getRelatedPackages as s, getBlogPreset as t };
|
|
464
|
+
|
|
465
|
+
//# sourceMappingURL=package-registry.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-registry.mjs","names":[],"sources":["../../src/sources/package-registry.ts"],"sourcesContent":["/**\n * Unified package registry — single source of truth for package metadata.\n * Consolidates doc overrides, blog presets, and file patterns.\n * Keyed by GitHub 'owner/repo' (source code repo).\n */\n\nexport interface BlogRelease {\n version: string\n url: string\n date: string\n title?: string\n}\n\nexport interface PackageEntry {\n filePatterns?: string[]\n primary?: boolean\n /** Extra rules injected into skill generation prompts */\n rules?: string[]\n}\n\nexport interface RepoEntry {\n owner: string\n repo: string\n /** Separate docs repo name (e.g. 'docs' → owner/docs) */\n docsRepo?: string\n /** Path prefix to filter markdown files */\n docsPath?: string\n /** Branch/ref override */\n docsRef?: string\n /** Homepage URL */\n homepage?: string\n /** URL pattern to crawl for docs (glob, e.g. 'https://example.com/docs/**') */\n crawlUrl?: string\n /** Branch to fetch CHANGELOG.md from when installed version is a prerelease (e.g. 'minor' for Vue) */\n prereleaseChangelogRef?: string\n /** Packages in this repo */\n packages: Record<string, PackageEntry>\n /** Curated blog release posts */\n blogReleases?: BlogRelease[]\n}\n\n// Backwards-compatible types\nexport interface DocOverride {\n owner: string\n repo: string\n path: string\n ref?: string\n homepage?: string\n}\n\nexport interface BlogPreset {\n packageName: string\n releases: BlogRelease[]\n}\n\n// ── Registry ──\n\nconst REPO_REGISTRY: Record<string, RepoEntry> = {\n // ── Frameworks with doc overrides ──\n\n 'vuejs/core': {\n owner: 'vuejs',\n repo: 'core',\n docsRepo: 'docs',\n docsPath: 'src',\n homepage: 'https://vuejs.org',\n prereleaseChangelogRef: 'minor',\n packages: {\n 'vue': { primary: true, filePatterns: ['*.vue'], rules: ['ALWAYS use `<script setup lang=\"ts\">`', 'Use ```vue code fences for SFC examples containing `<script>` or `<template>` tags, ```ts for plain TypeScript'] },\n '@vue/compiler-core': {},\n '@vue/compiler-dom': {},\n '@vue/reactivity': {},\n '@vue/runtime-core': {},\n '@vue/runtime-dom': {},\n '@vue/shared': {},\n },\n blogReleases: [\n { version: '3.5', url: 'https://blog.vuejs.org/posts/vue-3-5', date: '2024-09-01' },\n { version: '3.4', url: 'https://blog.vuejs.org/posts/vue-3-4', date: '2023-12-28' },\n { version: '3.3', url: 'https://blog.vuejs.org/posts/vue-3-3', date: '2023-05-11' },\n { version: '3.2', url: 'https://blog.vuejs.org/posts/vue-3-2', date: '2021-08-05' },\n { version: '3.1', url: 'https://blog.vuejs.org/posts/vue-3-1', date: '2021-06-07' },\n { version: '3.0', url: 'https://blog.vuejs.org/posts/vue-3-0', date: '2020-09-18' },\n ],\n },\n\n 'tailwindlabs/tailwindcss': {\n owner: 'tailwindlabs',\n repo: 'tailwindcss',\n docsRepo: 'tailwindcss.com',\n docsPath: 'src/docs',\n homepage: 'https://tailwindcss.com',\n packages: {\n tailwindcss: { primary: true },\n },\n },\n\n 'withastro/astro': {\n owner: 'withastro',\n repo: 'astro',\n docsRepo: 'docs',\n docsPath: 'src/content/docs/en',\n homepage: 'https://docs.astro.build',\n packages: {\n astro: { primary: true, filePatterns: ['*.astro'] },\n },\n },\n\n 'vueuse/vueuse': {\n owner: 'vueuse',\n repo: 'vueuse',\n docsPath: 'packages',\n packages: {\n '@vueuse/core': { primary: true },\n },\n },\n\n // ── Frameworks (file patterns only) ──\n\n 'sveltejs/svelte': {\n owner: 'sveltejs',\n repo: 'svelte',\n packages: {\n svelte: { primary: true, filePatterns: ['*.svelte'], rules: ['ALWAYS use runes syntax ($state, $derived, $effect, $props)'] },\n },\n },\n\n 'solidjs/solid': {\n owner: 'solidjs',\n repo: 'solid',\n packages: {\n 'solid-js': { primary: true, filePatterns: ['*.jsx', '*.tsx'] },\n },\n },\n\n 'QwikDev/qwik': {\n owner: 'QwikDev',\n repo: 'qwik',\n packages: {\n qwik: { primary: true, filePatterns: ['*.tsx'] },\n },\n },\n\n 'marko-js/marko': {\n owner: 'marko-js',\n repo: 'marko',\n packages: {\n marko: { primary: true, filePatterns: ['*.marko'] },\n },\n },\n\n 'riot/riot': {\n owner: 'riot',\n repo: 'riot',\n packages: {\n riot: { primary: true, filePatterns: ['*.riot'] },\n },\n },\n\n // ── Languages/transpilers ──\n\n 'microsoft/TypeScript': {\n owner: 'microsoft',\n repo: 'TypeScript',\n packages: {\n typescript: { primary: true, filePatterns: ['*.ts', '*.tsx', '*.mts', '*.cts'] },\n },\n blogReleases: [\n { version: '6.0', url: 'https://devblogs.microsoft.com/typescript/announcing-typescript-6-0-beta/', date: '2026-02-11', title: 'Announcing TypeScript 6.0 Beta' },\n { version: '5.9', url: 'https://devblogs.microsoft.com/typescript/announcing-typescript-5-9/', date: '2025-08-01', title: 'Announcing TypeScript 5.9' },\n { version: '5.8', url: 'https://devblogs.microsoft.com/typescript/announcing-typescript-5-8/', date: '2025-02-28', title: 'Announcing TypeScript 5.8' },\n { version: '5.7', url: 'https://devblogs.microsoft.com/typescript/announcing-typescript-5-7/', date: '2024-11-22', title: 'Announcing TypeScript 5.7' },\n { version: '5.6', url: 'https://devblogs.microsoft.com/typescript/announcing-typescript-5-6/', date: '2024-09-09', title: 'Announcing TypeScript 5.6' },\n { version: '5.5', url: 'https://devblogs.microsoft.com/typescript/announcing-typescript-5-5/', date: '2024-06-20', title: 'Announcing TypeScript 5.5' },\n ],\n },\n\n 'jashkenas/coffeescript': {\n owner: 'jashkenas',\n repo: 'coffeescript',\n packages: {\n coffeescript: { primary: true, filePatterns: ['*.coffee'] },\n },\n },\n\n 'gkz/LiveScript': {\n owner: 'gkz',\n repo: 'LiveScript',\n packages: {\n livescript: { primary: true, filePatterns: ['*.ls'] },\n },\n },\n\n 'elm/compiler': {\n owner: 'elm',\n repo: 'compiler',\n packages: {\n elm: { primary: true, filePatterns: ['*.elm'] },\n },\n },\n\n // ── CSS preprocessors ──\n\n 'sass/dart-sass': {\n owner: 'sass',\n repo: 'dart-sass',\n packages: {\n sass: { primary: true, filePatterns: ['*.scss', '*.sass'] },\n },\n },\n\n 'less/less.js': {\n owner: 'less',\n repo: 'less.js',\n packages: {\n less: { primary: true, filePatterns: ['*.less'] },\n },\n },\n\n 'stylus/stylus': {\n owner: 'stylus',\n repo: 'stylus',\n packages: {\n stylus: { primary: true, filePatterns: ['*.styl'] },\n },\n },\n\n 'postcss/postcss': {\n owner: 'postcss',\n repo: 'postcss',\n packages: {\n postcss: { primary: true, filePatterns: ['*.css', '*.pcss'] },\n },\n },\n\n // ── Template engines ──\n\n 'pugjs/pug': {\n owner: 'pugjs',\n repo: 'pug',\n packages: {\n pug: { primary: true, filePatterns: ['*.pug'] },\n },\n },\n\n 'mde/ejs': {\n owner: 'mde',\n repo: 'ejs',\n packages: {\n ejs: { primary: true, filePatterns: ['*.ejs'] },\n },\n },\n\n 'handlebars-lang/handlebars.js': {\n owner: 'handlebars-lang',\n repo: 'handlebars.js',\n packages: {\n handlebars: { primary: true, filePatterns: ['*.hbs', '*.handlebars'] },\n },\n },\n\n 'janl/mustache.js': {\n owner: 'janl',\n repo: 'mustache.js',\n packages: {\n mustache: { primary: true, filePatterns: ['*.mustache'] },\n },\n },\n\n 'mozilla/nunjucks': {\n owner: 'mozilla',\n repo: 'nunjucks',\n packages: {\n nunjucks: { primary: true, filePatterns: ['*.njk'] },\n },\n },\n\n 'Shopify/liquid': {\n owner: 'Shopify',\n repo: 'liquid',\n packages: {\n liquid: { primary: true, filePatterns: ['*.liquid'] },\n },\n },\n\n // ── Data formats ──\n\n 'eemeli/yaml': {\n owner: 'eemeli',\n repo: 'yaml',\n packages: {\n yaml: { primary: true, filePatterns: ['*.yaml', '*.yml'] },\n },\n },\n\n 'nodeca/js-yaml': {\n owner: 'nodeca',\n repo: 'js-yaml',\n packages: {\n 'js-yaml': { primary: true, filePatterns: ['*.yaml', '*.yml'] },\n },\n },\n\n 'BinaryMuse/toml-node': {\n owner: 'BinaryMuse',\n repo: 'toml-node',\n packages: {\n 'toml': { primary: true, filePatterns: ['*.toml'] },\n '@iarna/toml': { filePatterns: ['*.toml'] },\n },\n },\n\n 'json5/json5': {\n owner: 'json5',\n repo: 'json5',\n packages: {\n json5: { primary: true, filePatterns: ['*.json5'] },\n },\n },\n\n 'microsoft/node-jsonc-parser': {\n owner: 'microsoft',\n repo: 'node-jsonc-parser',\n packages: {\n 'jsonc-parser': { primary: true, filePatterns: ['*.jsonc'] },\n },\n },\n\n // ── Markdown ──\n\n 'markdown-it/markdown-it': {\n owner: 'markdown-it',\n repo: 'markdown-it',\n packages: {\n 'markdown-it': { primary: true, filePatterns: ['*.md'] },\n },\n },\n\n 'markedjs/marked': {\n owner: 'markedjs',\n repo: 'marked',\n packages: {\n marked: { primary: true, filePatterns: ['*.md'] },\n },\n },\n\n 'remarkjs/remark': {\n owner: 'remarkjs',\n repo: 'remark',\n packages: {\n remark: { primary: true, filePatterns: ['*.md', '*.mdx'] },\n },\n },\n\n 'mdx-js/mdx': {\n owner: 'mdx-js',\n repo: 'mdx',\n packages: {\n '@mdx-js/mdx': { primary: true, filePatterns: ['*.mdx'] },\n },\n },\n\n // ── GraphQL ──\n\n 'graphql/graphql-js': {\n owner: 'graphql',\n repo: 'graphql-js',\n packages: {\n 'graphql': { primary: true, filePatterns: ['*.graphql', '*.gql'] },\n 'graphql-tag': { filePatterns: ['*.graphql', '*.gql'] },\n },\n },\n\n 'dotansimha/graphql-code-generator': {\n owner: 'dotansimha',\n repo: 'graphql-code-generator',\n packages: {\n '@graphql-codegen/cli': { primary: true, filePatterns: ['*.graphql', '*.gql'] },\n },\n },\n\n // ── UI Frameworks ──\n\n 'quasarframework/quasar': {\n owner: 'quasarframework',\n repo: 'quasar',\n docsPath: 'docs/src/pages',\n docsRef: 'dev',\n homepage: 'https://quasar.dev',\n packages: {\n quasar: { primary: true },\n },\n },\n\n // ── Animation ──\n\n 'motiondivision/motion-vue': {\n owner: 'motiondivision',\n repo: 'motion-vue',\n homepage: 'https://motion.dev',\n crawlUrl: 'https://motion.dev/docs/vue**',\n packages: {\n 'motion-v': { primary: true },\n },\n },\n\n // ── Other ──\n\n 'prisma/prisma': {\n owner: 'prisma',\n repo: 'prisma',\n packages: {\n 'prisma': { primary: true, filePatterns: ['*.prisma'] },\n '@prisma/client': { filePatterns: ['*.prisma'] },\n },\n },\n\n 'nicolo-ribaudo/tc39-proposal-wasm-esm-integration': {\n owner: 'nicolo-ribaudo',\n repo: 'tc39-proposal-wasm-esm-integration',\n packages: {\n 'wasm-pack': { primary: true, filePatterns: ['*.wasm'] },\n },\n },\n}\n\n// ── Reverse index (auto-generated) ──\n\nconst PACKAGE_TO_REPO_MAP: Record<string, string> = {}\n\nfor (const [repoKey, entry] of Object.entries(REPO_REGISTRY)) {\n for (const packageName of Object.keys(entry.packages)) {\n PACKAGE_TO_REPO_MAP[packageName] = repoKey\n }\n}\n\n// ── Backwards-compatible helpers ──\n\nexport function getDocOverride(packageName: string): DocOverride | undefined {\n const repoKey = PACKAGE_TO_REPO_MAP[packageName]\n if (!repoKey)\n return undefined\n const entry = REPO_REGISTRY[repoKey]\n if (!entry?.docsRepo && !entry?.docsPath)\n return undefined\n\n return {\n owner: entry.owner,\n repo: entry.docsRepo || entry.repo,\n path: entry.docsPath || '',\n ref: entry.docsRef,\n homepage: entry.homepage,\n }\n}\n\nexport function getBlogPreset(packageName: string): BlogPreset | undefined {\n const repoKey = PACKAGE_TO_REPO_MAP[packageName]\n if (!repoKey)\n return undefined\n const entry = REPO_REGISTRY[repoKey]\n if (!entry?.blogReleases)\n return undefined\n\n return {\n packageName,\n releases: entry.blogReleases,\n }\n}\n\nexport function getFilePatterns(packageName: string): string[] | undefined {\n const repoKey = PACKAGE_TO_REPO_MAP[packageName]\n if (!repoKey)\n return undefined\n return REPO_REGISTRY[repoKey]?.packages[packageName]?.filePatterns\n}\n\n// ── New APIs ──\n\nexport function getRepoEntry(repoKey: string): RepoEntry | undefined {\n return REPO_REGISTRY[repoKey]\n}\n\nexport function getRepoKeyForPackage(packageName: string): string | undefined {\n return PACKAGE_TO_REPO_MAP[packageName]\n}\n\nexport function getPackageRules(packageName: string): string[] {\n const repoKey = PACKAGE_TO_REPO_MAP[packageName]\n if (!repoKey)\n return []\n return REPO_REGISTRY[repoKey]?.packages[packageName]?.rules ?? []\n}\n\nexport function getPrereleaseChangelogRef(packageName: string): string | undefined {\n const repoKey = PACKAGE_TO_REPO_MAP[packageName]\n if (!repoKey)\n return undefined\n return REPO_REGISTRY[repoKey]?.prereleaseChangelogRef\n}\n\nexport function getCrawlUrl(packageName: string): string | undefined {\n const repoKey = PACKAGE_TO_REPO_MAP[packageName]\n if (!repoKey)\n return undefined\n return REPO_REGISTRY[repoKey]?.crawlUrl\n}\n\nexport function getRelatedPackages(packageName: string): string[] {\n const repoKey = PACKAGE_TO_REPO_MAP[packageName]\n if (!repoKey)\n return []\n const entry = REPO_REGISTRY[repoKey]\n if (!entry)\n return []\n return Object.keys(entry.packages)\n}\n"],"mappings":"AAyDA,MAAM,gBAA2C;CAG/C,cAAc;EACZ,OAAO;EACP,MAAM;EACN,UAAU;EACV,UAAU;EACV,UAAU;EACV,wBAAwB;EACxB,UAAU;GACR,OAAO;IAAE,SAAS;IAAM,cAAc,CAAC,QAAQ;IAAE,OAAO,CAAC,2CAAyC,iHAAA;IAAmH;GACrN,sBAAsB,EAAE;GACxB,qBAAqB,EAAE;GACvB,mBAAmB,EAAE;GACrB,qBAAqB,EAAE;GACvB,oBAAoB,EAAE;GACtB,eAAe,EAAA;GAChB;EACD,cAAc;GACZ;IAAE,SAAS;IAAO,KAAK;IAAwC,MAAM;IAAc;GACnF;IAAE,SAAS;IAAO,KAAK;IAAwC,MAAM;IAAc;GACnF;IAAE,SAAS;IAAO,KAAK;IAAwC,MAAM;IAAc;GACnF;IAAE,SAAS;IAAO,KAAK;IAAwC,MAAM;IAAc;GACnF;IAAE,SAAS;IAAO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,MAAM,UAAU,oBAAoB;AACpC,KAAI,CAAC,QACH,QAAO,EAAE;CACX,MAAM,QAAQ,cAAc;AAC5B,KAAI,CAAC,MACH,QAAO,EAAE;AACX,QAAO,OAAO,KAAK,MAAM,SAAS"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { h as parseGitSkillInput } from "./sources.mjs";
|
|
2
|
+
function parseSkillInput(input) {
|
|
3
|
+
const trimmed = input.trim();
|
|
4
|
+
if (trimmed.startsWith("npm:")) {
|
|
5
|
+
const { name, tag } = splitPackageTag(trimmed.slice(4));
|
|
6
|
+
return {
|
|
7
|
+
type: "npm",
|
|
8
|
+
package: name,
|
|
9
|
+
tag
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
if (trimmed.startsWith("crate:")) {
|
|
13
|
+
const rest = trimmed.slice(6).trim();
|
|
14
|
+
const atIdx = rest.indexOf("@");
|
|
15
|
+
return {
|
|
16
|
+
type: "crate",
|
|
17
|
+
package: (atIdx === -1 ? rest : rest.slice(0, atIdx)).toLowerCase(),
|
|
18
|
+
version: atIdx === -1 ? void 0 : rest.slice(atIdx + 1) || void 0
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
if (trimmed.startsWith("gh:") || trimmed.startsWith("github:")) {
|
|
22
|
+
const rest = trimmed.startsWith("gh:") ? trimmed.slice(3) : trimmed.slice(7);
|
|
23
|
+
const gitSource = parseGitSkillInput(rest);
|
|
24
|
+
if (gitSource) return {
|
|
25
|
+
type: "git",
|
|
26
|
+
source: gitSource
|
|
27
|
+
};
|
|
28
|
+
if (/^[\w.-]+\/[\w.-]+/.test(rest)) {
|
|
29
|
+
const [owner, repo] = rest.split("/");
|
|
30
|
+
return {
|
|
31
|
+
type: "git",
|
|
32
|
+
source: {
|
|
33
|
+
type: "github",
|
|
34
|
+
owner,
|
|
35
|
+
repo
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
type: "bare",
|
|
41
|
+
package: rest
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
if (trimmed.startsWith("@")) {
|
|
45
|
+
const rest = trimmed.slice(1);
|
|
46
|
+
const slashIdx = rest.indexOf("/");
|
|
47
|
+
if (slashIdx === -1) return {
|
|
48
|
+
type: "curator",
|
|
49
|
+
handle: rest
|
|
50
|
+
};
|
|
51
|
+
return {
|
|
52
|
+
type: "collection",
|
|
53
|
+
handle: rest.slice(0, slashIdx),
|
|
54
|
+
name: rest.slice(slashIdx + 1)
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const gitSource = parseGitSkillInput(trimmed);
|
|
58
|
+
if (gitSource) return {
|
|
59
|
+
type: "git",
|
|
60
|
+
source: gitSource
|
|
61
|
+
};
|
|
62
|
+
const { name, tag } = splitPackageTag(trimmed);
|
|
63
|
+
return {
|
|
64
|
+
type: "bare",
|
|
65
|
+
package: name,
|
|
66
|
+
tag
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function resolveSkillName(input) {
|
|
70
|
+
const source = parseSkillInput(input);
|
|
71
|
+
switch (source.type) {
|
|
72
|
+
case "npm":
|
|
73
|
+
case "bare": return source.package;
|
|
74
|
+
case "crate": return `crate:${source.package}`;
|
|
75
|
+
case "git":
|
|
76
|
+
if (source.source.type === "github" && source.source.repo) return source.source.repo;
|
|
77
|
+
return null;
|
|
78
|
+
case "curator":
|
|
79
|
+
case "collection": return null;
|
|
80
|
+
default: throw new Error(`Unhandled SkillSource type: ${JSON.stringify(source)}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function toStoragePackageName(identityName) {
|
|
84
|
+
if (identityName.startsWith("crate:")) return `@skilld-crate/${identityName.slice(6)}`;
|
|
85
|
+
return identityName;
|
|
86
|
+
}
|
|
87
|
+
function splitPackageTag(spec) {
|
|
88
|
+
if (spec.startsWith("@")) {
|
|
89
|
+
const slashIdx = spec.indexOf("/");
|
|
90
|
+
if (slashIdx !== -1) {
|
|
91
|
+
const afterSlash = spec.indexOf("@", slashIdx);
|
|
92
|
+
if (afterSlash !== -1) return {
|
|
93
|
+
name: spec.slice(0, afterSlash),
|
|
94
|
+
tag: spec.slice(afterSlash + 1) || void 0
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
return { name: spec };
|
|
98
|
+
}
|
|
99
|
+
const atIdx = spec.indexOf("@");
|
|
100
|
+
if (atIdx !== -1) return {
|
|
101
|
+
name: spec.slice(0, atIdx),
|
|
102
|
+
tag: spec.slice(atIdx + 1) || void 0
|
|
103
|
+
};
|
|
104
|
+
return { name: spec };
|
|
105
|
+
}
|
|
106
|
+
export { resolveSkillName as n, toStoragePackageName as r, parseSkillInput as t };
|
|
107
|
+
|
|
108
|
+
//# sourceMappingURL=prefix.mjs.map
|