prpm 0.0.6 → 0.0.7
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/login.js +4 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
- package/dist/commands/remove.js +0 -76
package/dist/commands/login.js
CHANGED
|
@@ -140,7 +140,10 @@ async function loginWithOAuth(registryUrl) {
|
|
|
140
140
|
}
|
|
141
141
|
// Create the CLI auth URL with session token, callback, and userId
|
|
142
142
|
const callbackUrl = 'http://localhost:8765/callback';
|
|
143
|
-
|
|
143
|
+
// Determine webapp URL - default to production
|
|
144
|
+
const webappUrl = registryUrl.includes('localhost')
|
|
145
|
+
? registryUrl.replace(':3000', ':5173') // Local: localhost:3000 → localhost:5173
|
|
146
|
+
: 'https://prpm.dev'; // Production: always use prpm.dev
|
|
144
147
|
const authUrl = `${webappUrl}/cli-auth?sessionToken=${encodeURIComponent(connectSessionToken)}&cliCallback=${encodeURIComponent(callbackUrl)}&userId=${encodeURIComponent(userId)}`;
|
|
145
148
|
console.log(` Please open this link in your browser to authenticate:`);
|
|
146
149
|
console.log(` ${authUrl}\n`);
|
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ const program = new commander_1.Command();
|
|
|
26
26
|
program
|
|
27
27
|
.name('prpm')
|
|
28
28
|
.description('Prompt Package Manager - Install and manage prompt-based files')
|
|
29
|
-
.version('
|
|
29
|
+
.version(' run `npm fund` for details');
|
|
30
30
|
// Registry commands (new)
|
|
31
31
|
program.addCommand((0, search_1.createSearchCommand)());
|
|
32
32
|
program.addCommand((0, install_1.createInstallCommand)());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prpm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Prompt Package Manager CLI - Install and manage prompt-based files",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"license": "MIT",
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@octokit/rest": "^22.0.0",
|
|
44
|
-
"@pr-pm/registry-client": "1.2.
|
|
45
|
-
"@pr-pm/types": "^0.1.
|
|
44
|
+
"@pr-pm/registry-client": "^1.2.2",
|
|
45
|
+
"@pr-pm/types": "^0.1.2",
|
|
46
46
|
"ajv": "^8.17.1",
|
|
47
47
|
"ajv-formats": "^3.0.1",
|
|
48
48
|
"commander": "^11.1.0",
|
package/dist/commands/remove.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Remove command implementation
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.handleRemove = handleRemove;
|
|
7
|
-
exports.createRemoveCommand = createRemoveCommand;
|
|
8
|
-
const commander_1 = require("commander");
|
|
9
|
-
const lockfile_1 = require("../core/lockfile");
|
|
10
|
-
const filesystem_1 = require("../core/filesystem");
|
|
11
|
-
const fs_1 = require("fs");
|
|
12
|
-
/**
|
|
13
|
-
* Handle the remove command
|
|
14
|
-
*/
|
|
15
|
-
async function handleRemove(name) {
|
|
16
|
-
try {
|
|
17
|
-
console.log(`🗑️ Removing package: ${name}`);
|
|
18
|
-
// Remove from lockfile and get package info
|
|
19
|
-
const pkg = await (0, lockfile_1.removePackage)(name);
|
|
20
|
-
if (!pkg) {
|
|
21
|
-
console.error(`❌ Package "${name}" not found`);
|
|
22
|
-
process.exit(1);
|
|
23
|
-
}
|
|
24
|
-
// Determine file path based on package type and format
|
|
25
|
-
const effectiveType = (pkg.format === 'claude' ? 'claude-skill' :
|
|
26
|
-
pkg.format === 'cursor' ? 'cursor' :
|
|
27
|
-
pkg.format === 'continue' ? 'continue' :
|
|
28
|
-
pkg.format === 'windsurf' ? 'windsurf' :
|
|
29
|
-
pkg.type);
|
|
30
|
-
const destDir = (0, filesystem_1.getDestinationDir)(effectiveType);
|
|
31
|
-
const fileExtension = pkg.format === 'cursor' ? 'mdc' : 'md';
|
|
32
|
-
// Strip author namespace to get just the package name
|
|
33
|
-
const packageName = (0, filesystem_1.stripAuthorNamespace)(name);
|
|
34
|
-
// Try single file first
|
|
35
|
-
const singleFilePath = `${destDir}/${packageName}.${fileExtension}`;
|
|
36
|
-
if (await (0, filesystem_1.fileExists)(singleFilePath)) {
|
|
37
|
-
// Single file package
|
|
38
|
-
await (0, filesystem_1.deleteFile)(singleFilePath);
|
|
39
|
-
console.log(` 🗑️ Deleted file: ${singleFilePath}`);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
// Try multi-file package directory
|
|
43
|
-
const packageDir = `${destDir}/${packageName}`;
|
|
44
|
-
try {
|
|
45
|
-
const stats = await fs_1.promises.stat(packageDir);
|
|
46
|
-
if (stats.isDirectory()) {
|
|
47
|
-
await fs_1.promises.rm(packageDir, { recursive: true, force: true });
|
|
48
|
-
console.log(` 🗑️ Deleted directory: ${packageDir}`);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
catch (error) {
|
|
52
|
-
const err = error;
|
|
53
|
-
if (err.code !== 'ENOENT') {
|
|
54
|
-
console.warn(` ⚠️ Could not delete package files: ${err.message}`);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
console.log(`✅ Successfully removed ${name}`);
|
|
59
|
-
process.exit(0);
|
|
60
|
-
}
|
|
61
|
-
catch (error) {
|
|
62
|
-
console.error(`❌ Failed to remove package: ${error}`);
|
|
63
|
-
process.exit(1);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Create the remove command
|
|
68
|
-
*/
|
|
69
|
-
function createRemoveCommand() {
|
|
70
|
-
const command = new commander_1.Command('remove');
|
|
71
|
-
command
|
|
72
|
-
.description('Remove a prompt package')
|
|
73
|
-
.argument('<id>', 'Package ID to remove')
|
|
74
|
-
.action(handleRemove);
|
|
75
|
-
return command;
|
|
76
|
-
}
|