prpm 0.0.8 → 0.0.10
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/commands/list.js +28 -18
- package/package.json +3 -3
package/dist/commands/list.js
CHANGED
|
@@ -43,21 +43,25 @@ function getDestinationDir(type) {
|
|
|
43
43
|
/**
|
|
44
44
|
* Find the actual file location for a package
|
|
45
45
|
*/
|
|
46
|
-
async function findPackageLocation(id,
|
|
47
|
-
if (!
|
|
46
|
+
async function findPackageLocation(id, format, subtype) {
|
|
47
|
+
if (!format)
|
|
48
48
|
return null;
|
|
49
|
-
const baseDir = getDestinationDir(
|
|
50
|
-
// Try
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
const baseDir = getDestinationDir(format);
|
|
50
|
+
// Try different file extensions based on format
|
|
51
|
+
const extensions = format === 'cursor' ? ['.mdc', '.md'] : ['.md'];
|
|
52
|
+
// Try direct file: <dir>/<id>.ext
|
|
53
|
+
for (const ext of extensions) {
|
|
54
|
+
const directPath = path_1.default.join(baseDir, `${id}${ext}`);
|
|
55
|
+
try {
|
|
56
|
+
await fs_1.promises.access(directPath);
|
|
57
|
+
return directPath;
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
// File doesn't exist, continue
|
|
61
|
+
}
|
|
58
62
|
}
|
|
59
63
|
// Try subdirectory: <dir>/<id>/SKILL.md or <dir>/<id>/AGENT.md
|
|
60
|
-
if (
|
|
64
|
+
if (subtype === 'skill') {
|
|
61
65
|
const skillPath = path_1.default.join(baseDir, id, 'SKILL.md');
|
|
62
66
|
try {
|
|
63
67
|
await fs_1.promises.access(skillPath);
|
|
@@ -67,7 +71,7 @@ async function findPackageLocation(id, type) {
|
|
|
67
71
|
// Not found
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
|
-
if (
|
|
74
|
+
if (subtype === 'agent' || format === 'claude') {
|
|
71
75
|
const agentPath = path_1.default.join(baseDir, id, 'AGENT.md');
|
|
72
76
|
try {
|
|
73
77
|
await fs_1.promises.access(agentPath);
|
|
@@ -92,13 +96,19 @@ async function displayPackages(packages) {
|
|
|
92
96
|
// Find file locations
|
|
93
97
|
const packagesWithLocations = await Promise.all(packages.map(async (pkg) => ({
|
|
94
98
|
...pkg,
|
|
95
|
-
location: await findPackageLocation(pkg.id,
|
|
99
|
+
location: await findPackageLocation(pkg.id, pkg.format, pkg.subtype)
|
|
96
100
|
})));
|
|
101
|
+
// Helper to format type display
|
|
102
|
+
const formatType = (format, subtype) => {
|
|
103
|
+
if (!format)
|
|
104
|
+
return '';
|
|
105
|
+
return subtype ? `${format}/${subtype}` : format;
|
|
106
|
+
};
|
|
97
107
|
// Calculate column widths
|
|
98
108
|
const idWidth = Math.max(8, ...packagesWithLocations.map(p => p.id.length));
|
|
99
109
|
const versionWidth = Math.max(7, ...packagesWithLocations.map(p => p.version.length));
|
|
100
|
-
const typeWidth = Math.max(6, ...packagesWithLocations.map(p => (
|
|
101
|
-
const locationWidth = Math.max(8, ...packagesWithLocations.map(p => (p.
|
|
110
|
+
const typeWidth = Math.max(6, ...packagesWithLocations.map(p => formatType(p.format, p.subtype).length));
|
|
111
|
+
const locationWidth = Math.max(8, ...packagesWithLocations.map(p => (p.installedPath || 'N/A').length));
|
|
102
112
|
// Header
|
|
103
113
|
const header = [
|
|
104
114
|
'ID'.padEnd(idWidth),
|
|
@@ -113,8 +123,8 @@ async function displayPackages(packages) {
|
|
|
113
123
|
const row = [
|
|
114
124
|
pkg.id.padEnd(idWidth),
|
|
115
125
|
pkg.version.padEnd(versionWidth),
|
|
116
|
-
(
|
|
117
|
-
(pkg.
|
|
126
|
+
formatType(pkg.format, pkg.subtype).padEnd(typeWidth),
|
|
127
|
+
(pkg.installedPath || 'N/A').padEnd(locationWidth)
|
|
118
128
|
].join(' | ');
|
|
119
129
|
console.log(row);
|
|
120
130
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prpm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
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.
|
|
49
|
-
"@pr-pm/types": "^0.1.
|
|
48
|
+
"@pr-pm/registry-client": "^1.2.4",
|
|
49
|
+
"@pr-pm/types": "^0.1.4",
|
|
50
50
|
"ajv": "^8.17.1",
|
|
51
51
|
"ajv-formats": "^3.0.1",
|
|
52
52
|
"commander": "^11.1.0",
|