prpm 1.2.1 → 2.0.1

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.
Files changed (67) hide show
  1. package/README.md +90 -862
  2. package/dist/index.js +23233 -65
  3. package/dist/schemas/agents-md.schema.json +24 -0
  4. package/dist/schemas/aider.schema.json +24 -0
  5. package/dist/schemas/canonical.schema.json +435 -0
  6. package/dist/schemas/claude-agent.schema.json +62 -0
  7. package/dist/schemas/claude-hook.schema.json +70 -0
  8. package/dist/schemas/claude-plugin.schema.json +122 -0
  9. package/dist/schemas/claude-skill.schema.json +51 -0
  10. package/dist/schemas/claude-slash-command.schema.json +77 -0
  11. package/dist/schemas/claude.schema.json +52 -0
  12. package/dist/schemas/continue.schema.json +98 -0
  13. package/dist/schemas/copilot.schema.json +76 -0
  14. package/dist/schemas/cursor-command.schema.json +27 -0
  15. package/dist/schemas/cursor-hooks.schema.json +59 -0
  16. package/dist/schemas/cursor.schema.json +74 -0
  17. package/dist/schemas/droid-hook.schema.json +103 -0
  18. package/dist/schemas/droid-skill.schema.json +46 -0
  19. package/dist/schemas/droid-slash-command.schema.json +53 -0
  20. package/dist/schemas/droid.schema.json +46 -0
  21. package/dist/schemas/format-registry.schema.json +99 -0
  22. package/dist/schemas/gemini-md.schema.json +24 -0
  23. package/dist/schemas/gemini.schema.json +30 -0
  24. package/dist/schemas/kiro-agent.schema.json +146 -0
  25. package/dist/schemas/kiro-hook.schema.json +120 -0
  26. package/dist/schemas/kiro-steering.schema.json +74 -0
  27. package/dist/schemas/mcp-server.schema.json +130 -0
  28. package/dist/schemas/opencode-slash-command.schema.json +60 -0
  29. package/dist/schemas/opencode.schema.json +111 -0
  30. package/dist/schemas/prpm-manifest.schema.json +733 -0
  31. package/dist/schemas/replit.schema.json +21 -0
  32. package/dist/schemas/ruler.schema.json +22 -0
  33. package/dist/schemas/trae.schema.json +24 -0
  34. package/dist/schemas/windsurf.schema.json +22 -0
  35. package/dist/schemas/zencoder.schema.json +51 -0
  36. package/package.json +20 -14
  37. package/schemas/prpm-manifest.schema.json +465 -39
  38. package/dist/__tests__/e2e/test-helpers.js +0 -150
  39. package/dist/commands/collections.js +0 -606
  40. package/dist/commands/index.js +0 -186
  41. package/dist/commands/info.js +0 -82
  42. package/dist/commands/install.js +0 -477
  43. package/dist/commands/list.js +0 -166
  44. package/dist/commands/login.js +0 -281
  45. package/dist/commands/outdated.js +0 -128
  46. package/dist/commands/popular.js +0 -27
  47. package/dist/commands/publish.js +0 -274
  48. package/dist/commands/schema.js +0 -37
  49. package/dist/commands/search.js +0 -404
  50. package/dist/commands/telemetry.js +0 -103
  51. package/dist/commands/trending.js +0 -76
  52. package/dist/commands/uninstall.js +0 -77
  53. package/dist/commands/update.js +0 -121
  54. package/dist/commands/upgrade.js +0 -121
  55. package/dist/commands/whoami.js +0 -75
  56. package/dist/core/claude-config.js +0 -91
  57. package/dist/core/cursor-config.js +0 -130
  58. package/dist/core/downloader.js +0 -64
  59. package/dist/core/filesystem.js +0 -124
  60. package/dist/core/lockfile.js +0 -239
  61. package/dist/core/marketplace-converter.js +0 -198
  62. package/dist/core/registry-client.js +0 -265
  63. package/dist/core/schema-validator.js +0 -74
  64. package/dist/core/telemetry.js +0 -175
  65. package/dist/core/user-config.js +0 -79
  66. package/dist/types/registry.js +0 -5
  67. package/dist/types.js +0 -5
@@ -1,150 +0,0 @@
1
- "use strict";
2
- /**
3
- * E2E Test Helpers
4
- * Shared utilities for end-to-end CLI testing
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.createTestDir = createTestDir;
8
- exports.cleanupTestDir = cleanupTestDir;
9
- exports.createMockPackage = createMockPackage;
10
- exports.createMockCollection = createMockCollection;
11
- exports.createMockConfig = createMockConfig;
12
- exports.createMockFetch = createMockFetch;
13
- exports.delay = delay;
14
- exports.setupGlobalMocks = setupGlobalMocks;
15
- exports.mockProcessExit = mockProcessExit;
16
- const promises_1 = require("fs/promises");
17
- const path_1 = require("path");
18
- const os_1 = require("os");
19
- /**
20
- * Create a temporary test directory
21
- */
22
- async function createTestDir() {
23
- const testDir = (0, path_1.join)((0, os_1.tmpdir)(), `prpm-e2e-test-${Date.now()}-${Math.random().toString(36).slice(2)}`);
24
- await (0, promises_1.mkdir)(testDir, { recursive: true });
25
- return testDir;
26
- }
27
- /**
28
- * Clean up test directory
29
- */
30
- async function cleanupTestDir(testDir) {
31
- try {
32
- await (0, promises_1.rm)(testDir, { recursive: true, force: true });
33
- }
34
- catch {
35
- // Ignore cleanup errors
36
- }
37
- }
38
- /**
39
- * Create a mock package manifest
40
- */
41
- async function createMockPackage(testDir, name, type = 'cursor', version = '1.0.0') {
42
- const manifest = {
43
- name,
44
- version,
45
- description: `Test package ${name}`,
46
- type,
47
- author: 'test-author',
48
- tags: ['test', type],
49
- };
50
- const manifestPath = (0, path_1.join)(testDir, 'prpm.json');
51
- await (0, promises_1.writeFile)(manifestPath, JSON.stringify(manifest, null, 2));
52
- // Create a sample .cursorrules file
53
- const rulesPath = (0, path_1.join)(testDir, '.cursorrules');
54
- await (0, promises_1.writeFile)(rulesPath, '# Test cursor rules\n\nAlways write tests.\n');
55
- return manifestPath;
56
- }
57
- /**
58
- * Create a mock collection manifest
59
- */
60
- async function createMockCollection(testDir, id, packages) {
61
- const manifest = {
62
- id,
63
- name: `Test Collection ${id}`,
64
- description: 'A test collection for E2E testing',
65
- category: 'development',
66
- tags: ['test', 'automation'],
67
- packages,
68
- icon: '📦',
69
- };
70
- const manifestPath = (0, path_1.join)(testDir, 'collection.json');
71
- await (0, promises_1.writeFile)(manifestPath, JSON.stringify(manifest, null, 2));
72
- return manifestPath;
73
- }
74
- /**
75
- * Create a mock user config
76
- */
77
- async function createMockConfig(configPath, options) {
78
- const config = {
79
- token: options.token || 'test-token-123',
80
- registryUrl: options.registryUrl || 'http://localhost:3000',
81
- };
82
- await (0, promises_1.mkdir)((0, path_1.join)(configPath, '..'), { recursive: true });
83
- await (0, promises_1.writeFile)(configPath, JSON.stringify(config, null, 2));
84
- }
85
- /**
86
- * Mock fetch response for registry API
87
- */
88
- function createMockFetch() {
89
- const responses = new Map();
90
- const mockFetch = jest.fn(async (url, options) => {
91
- const key = `${options?.method || 'GET'} ${url}`;
92
- const response = responses.get(key) || responses.get(url);
93
- if (!response) {
94
- return {
95
- ok: false,
96
- status: 404,
97
- statusText: 'Not Found',
98
- json: async () => ({ error: 'Not found' }),
99
- };
100
- }
101
- if (typeof response === 'function') {
102
- return response(url, options);
103
- }
104
- return {
105
- ok: true,
106
- status: 200,
107
- json: async () => response,
108
- arrayBuffer: async () => Buffer.from('mock-data').buffer,
109
- };
110
- });
111
- return {
112
- fetch: mockFetch,
113
- addResponse: (key, response) => {
114
- responses.set(key, response);
115
- },
116
- clear: () => {
117
- responses.clear();
118
- mockFetch.mockClear();
119
- },
120
- };
121
- }
122
- /**
123
- * Wait for async operations
124
- */
125
- function delay(ms) {
126
- return new Promise(resolve => setTimeout(resolve, ms));
127
- }
128
- /**
129
- * Setup global mocks for E2E tests
130
- */
131
- function setupGlobalMocks() {
132
- // Mock console to reduce noise
133
- beforeAll(() => {
134
- jest.spyOn(console, 'log').mockImplementation();
135
- jest.spyOn(console, 'error').mockImplementation();
136
- jest.spyOn(console, 'warn').mockImplementation();
137
- });
138
- afterAll(() => {
139
- jest.restoreAllMocks();
140
- });
141
- }
142
- /**
143
- * Mock process.exit to throw instead of exiting
144
- */
145
- function mockProcessExit() {
146
- const mockExit = jest.spyOn(process, 'exit').mockImplementation((code) => {
147
- throw new Error(`Process exited with code ${code}`);
148
- });
149
- return mockExit;
150
- }