prpm 0.0.16 → 0.0.18

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.
@@ -327,20 +327,21 @@ async function handleInstall(packageSpec, options) {
327
327
  : `${destDir}/${packageName}`;
328
328
  destPath = packageDir;
329
329
  console.log(` šŸ“ Multi-file package - creating directory: ${packageDir}`);
330
- // For Claude skills, auto-fix filename to SKILL.md if needed
330
+ // For Claude skills, verify SKILL.md exists
331
331
  if (effectiveFormat === 'claude' && effectiveSubtype === 'skill') {
332
- const skillMdIndex = extractedFiles.findIndex(f => f.name === 'SKILL.md');
332
+ const skillMdIndex = extractedFiles.findIndex(f => f.name === 'SKILL.md' || f.name.endsWith('/SKILL.md'));
333
333
  if (skillMdIndex === -1) {
334
334
  // SKILL.md not found, look for common variations and auto-rename
335
- const skillFileIndex = extractedFiles.findIndex(f => f.name.toLowerCase() === 'skill.md' ||
336
- f.name === 'skill.md' ||
337
- f.name.endsWith('.md') && extractedFiles.length === 1 // Single .md file
335
+ const skillFileIndex = extractedFiles.findIndex(f => f.name.toLowerCase().endsWith('skill.md') ||
336
+ (f.name.endsWith('.md') && extractedFiles.length === 1) // Single .md file
338
337
  );
339
338
  if (skillFileIndex !== -1) {
340
339
  const oldName = extractedFiles[skillFileIndex].name;
341
- console.log(` āš ļø Auto-fixing skill filename: ${oldName} → SKILL.md`);
340
+ const basePath = oldName.substring(0, oldName.lastIndexOf('/') + 1);
341
+ const newName = basePath + 'SKILL.md';
342
+ console.log(` āš ļø Auto-fixing skill filename: ${oldName} → ${newName}`);
342
343
  console.log(` (Claude skills must be named SKILL.md per official documentation)`);
343
- extractedFiles[skillFileIndex].name = 'SKILL.md';
344
+ extractedFiles[skillFileIndex].name = newName;
344
345
  }
345
346
  else {
346
347
  throw new Error('Claude skills must contain a SKILL.md file. ' +
@@ -65,23 +65,7 @@ async function findAndLoadManifests() {
65
65
  let prpmJsonError = null;
66
66
  try {
67
67
  const content = await (0, promises_1.readFile)(prpmJsonPath, 'utf-8');
68
- prpmJsonExists = true;
69
- // Try to parse JSON
70
- let manifest;
71
- try {
72
- manifest = JSON.parse(content);
73
- }
74
- catch (parseError) {
75
- // JSON parse error - provide specific error message
76
- const error = parseError;
77
- throw new Error(`Invalid JSON in prpm.json:\n\n` +
78
- `${error.message}\n\n` +
79
- `Please check your prpm.json file for syntax errors:\n` +
80
- ` - Missing or extra commas\n` +
81
- ` - Unclosed quotes or brackets\n` +
82
- ` - Invalid JSON syntax\n\n` +
83
- `You can validate your JSON at https://jsonlint.com/`);
84
- }
68
+ const manifest = JSON.parse(content);
85
69
  // Check if this is a multi-package manifest
86
70
  if ('packages' in manifest && Array.isArray(manifest.packages)) {
87
71
  const multiManifest = manifest;
@@ -94,29 +78,20 @@ async function findAndLoadManifests() {
94
78
  description: pkg.description,
95
79
  format: pkg.format,
96
80
  files: pkg.files,
97
- author: pkg.author !== undefined ? pkg.author : multiManifest.author,
98
- license: pkg.license !== undefined ? pkg.license : multiManifest.license,
99
- repository: pkg.repository !== undefined ? pkg.repository : multiManifest.repository,
100
- homepage: pkg.homepage !== undefined ? pkg.homepage : multiManifest.homepage,
101
- documentation: pkg.documentation !== undefined ? pkg.documentation : multiManifest.documentation,
102
- organization: pkg.organization !== undefined ? pkg.organization : multiManifest.organization,
103
- private: pkg.private !== undefined ? pkg.private : multiManifest.private,
104
- tags: pkg.tags !== undefined ? pkg.tags : multiManifest.tags,
105
- keywords: pkg.keywords !== undefined ? pkg.keywords : multiManifest.keywords,
81
+ author: pkg.author ?? multiManifest.author,
82
+ license: pkg.license ?? multiManifest.license,
83
+ repository: pkg.repository ?? multiManifest.repository,
84
+ homepage: pkg.homepage ?? multiManifest.homepage,
85
+ documentation: pkg.documentation ?? multiManifest.documentation,
86
+ organization: pkg.organization ?? multiManifest.organization,
87
+ tags: pkg.tags ?? multiManifest.tags,
88
+ keywords: pkg.keywords ?? multiManifest.keywords,
106
89
  subtype: pkg.subtype,
107
90
  dependencies: pkg.dependencies,
108
91
  peerDependencies: pkg.peerDependencies,
109
92
  engines: pkg.engines,
110
93
  main: pkg.main,
111
94
  };
112
- // Debug: Log inheritance only if DEBUG env var is set
113
- if (process.env.DEBUG) {
114
- console.log(`\nšŸ” Package ${pkg.name} inheritance:`);
115
- console.log(` - Package-level private: ${pkg.private}`);
116
- console.log(` - Top-level private: ${multiManifest.private}`);
117
- console.log(` - Inherited private: ${packageWithDefaults.private}`);
118
- console.log('');
119
- }
120
95
  return validateManifest(packageWithDefaults);
121
96
  });
122
97
  return { manifests: validatedManifests, source: 'prpm.json (multi-package)' };
@@ -350,8 +325,20 @@ async function handlePublish(options) {
350
325
  const { manifests, source } = await findAndLoadManifests();
351
326
  if (manifests.length > 1) {
352
327
  console.log(` Found ${manifests.length} plugins in ${source}`);
328
+ if (options.package) {
329
+ console.log(` Filtering to package: ${options.package}`);
330
+ }
353
331
  console.log(' Will publish each plugin separately\n');
354
332
  }
333
+ // Filter to specific package if requested
334
+ let filteredManifests = manifests;
335
+ if (options.package) {
336
+ filteredManifests = manifests.filter(m => m.name === options.package);
337
+ if (filteredManifests.length === 0) {
338
+ throw new Error(`Package "${options.package}" not found in manifest. Available packages: ${manifests.map(m => m.name).join(', ')}`);
339
+ }
340
+ console.log(` āœ“ Found package "${options.package}"\n`);
341
+ }
355
342
  // Get user info to check for organizations (once for all packages)
356
343
  console.log('šŸ” Checking authentication...');
357
344
  const client = (0, registry_client_1.getRegistryClient)(config);
@@ -363,11 +350,11 @@ async function handlePublish(options) {
363
350
  console.log(' Could not fetch user organizations, publishing as personal packages');
364
351
  }
365
352
  console.log('');
366
- // Check for duplicate package names
367
- if (manifests.length > 1) {
353
+ // Check for duplicate package names (only in filtered set)
354
+ if (filteredManifests.length > 1) {
368
355
  const nameMap = new Map();
369
356
  const duplicates = [];
370
- manifests.forEach((manifest, index) => {
357
+ filteredManifests.forEach((manifest, index) => {
371
358
  const existingIndex = nameMap.get(manifest.name);
372
359
  if (existingIndex !== undefined) {
373
360
  duplicates.push(` - "${manifest.name}" appears in positions ${existingIndex + 1} and ${index + 1}`);
@@ -389,14 +376,14 @@ async function handlePublish(options) {
389
376
  // Track published packages
390
377
  const publishedPackages = [];
391
378
  const failedPackages = [];
392
- // Publish each manifest
393
- for (let i = 0; i < manifests.length; i++) {
394
- const manifest = manifests[i];
379
+ // Publish each manifest (filtered set)
380
+ for (let i = 0; i < filteredManifests.length; i++) {
381
+ const manifest = filteredManifests[i];
395
382
  packageName = manifest.name;
396
383
  version = manifest.version;
397
- if (manifests.length > 1) {
384
+ if (filteredManifests.length > 1) {
398
385
  console.log(`\n${'='.repeat(60)}`);
399
- console.log(`šŸ“¦ Publishing plugin ${i + 1} of ${manifests.length}`);
386
+ console.log(`šŸ“¦ Publishing plugin ${i + 1} of ${filteredManifests.length}`);
400
387
  console.log(`${'='.repeat(60)}\n`);
401
388
  }
402
389
  try {
@@ -645,6 +632,7 @@ function createPublishCommand() {
645
632
  .option('--access <type>', 'Package access (public or private) - overrides manifest setting')
646
633
  .option('--tag <tag>', 'NPM-style tag (e.g., latest, beta)', 'latest')
647
634
  .option('--dry-run', 'Validate package without publishing')
635
+ .option('--package <name>', 'Publish only a specific package from multi-package manifest')
648
636
  .action(async (options) => {
649
637
  await handlePublish(options);
650
638
  process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prpm",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "description": "Prompt Package Manager CLI - Install and manage prompt-based files",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -45,8 +45,8 @@
45
45
  "license": "MIT",
46
46
  "dependencies": {
47
47
  "@octokit/rest": "^22.0.0",
48
- "@pr-pm/registry-client": "^1.2.10",
49
- "@pr-pm/types": "^0.1.10",
48
+ "@pr-pm/registry-client": "^1.2.12",
49
+ "@pr-pm/types": "^0.1.12",
50
50
  "ajv": "^8.17.1",
51
51
  "ajv-formats": "^3.0.1",
52
52
  "commander": "^11.1.0",