prpm 0.0.14 → 0.0.15
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/catalog.js +22 -5
- package/package.json +3 -3
package/dist/commands/catalog.js
CHANGED
|
@@ -9,6 +9,7 @@ const commander_1 = require("commander");
|
|
|
9
9
|
const promises_1 = require("fs/promises");
|
|
10
10
|
const path_1 = require("path");
|
|
11
11
|
const telemetry_1 = require("../core/telemetry");
|
|
12
|
+
const lockfile_1 = require("../core/lockfile");
|
|
12
13
|
/**
|
|
13
14
|
* Detect format and subtype from file path and content
|
|
14
15
|
*/
|
|
@@ -205,15 +206,31 @@ async function handleCatalog(directories, options) {
|
|
|
205
206
|
console.log(` ⚠️ Could not access ${dir}: ${err instanceof Error ? err.message : String(err)}`);
|
|
206
207
|
}
|
|
207
208
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
// Read lockfile to exclude packages installed from other users
|
|
210
|
+
const lockfile = await (0, lockfile_1.readLockfile)();
|
|
211
|
+
const installedPackageIds = new Set(lockfile ? Object.keys(lockfile.packages) : []);
|
|
212
|
+
// Filter out packages that are installed from the registry (not user-created)
|
|
213
|
+
const filteredDiscovered = allDiscovered.filter(pkg => {
|
|
214
|
+
// Check if this package exists in lockfile
|
|
215
|
+
// Package ID in lockfile could be: "package-name", "@author/package-name"
|
|
216
|
+
// Check both formats
|
|
217
|
+
const isInstalled = installedPackageIds.has(pkg.name) ||
|
|
218
|
+
Array.from(installedPackageIds).some(id => id.endsWith(`/${pkg.name}`));
|
|
219
|
+
if (isInstalled) {
|
|
220
|
+
console.log(` ⏩ Skipping ${pkg.name} (installed from registry, not user-created)`);
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
return true;
|
|
224
|
+
});
|
|
225
|
+
console.log(`\n✨ Discovered ${filteredDiscovered.length} package(s) total:\n`);
|
|
226
|
+
if (filteredDiscovered.length === 0) {
|
|
227
|
+
console.log('No user-created packages found. Try scanning different directories or check if all packages were installed from registry.');
|
|
211
228
|
success = true;
|
|
212
229
|
return;
|
|
213
230
|
}
|
|
214
231
|
// Display discovered packages
|
|
215
232
|
const byFormat = new Map();
|
|
216
|
-
for (const pkg of
|
|
233
|
+
for (const pkg of filteredDiscovered) {
|
|
217
234
|
if (!byFormat.has(pkg.format)) {
|
|
218
235
|
byFormat.set(pkg.format, []);
|
|
219
236
|
}
|
|
@@ -270,7 +287,7 @@ async function handleCatalog(directories, options) {
|
|
|
270
287
|
// Convert discovered packages to manifests
|
|
271
288
|
const existingNames = new Set(manifest.packages.map(p => p.name));
|
|
272
289
|
let addedCount = 0;
|
|
273
|
-
for (const discovered of
|
|
290
|
+
for (const discovered of filteredDiscovered) {
|
|
274
291
|
// Skip if already exists
|
|
275
292
|
if (existingNames.has(discovered.name)) {
|
|
276
293
|
console.log(` ⚠️ Skipping ${discovered.name} (already in prpm.json)`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prpm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
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.9",
|
|
49
|
+
"@pr-pm/types": "^0.1.9",
|
|
50
50
|
"ajv": "^8.17.1",
|
|
51
51
|
"ajv-formats": "^3.0.1",
|
|
52
52
|
"commander": "^11.1.0",
|