@kamaras/venpm 0.0.1 → 0.1.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 (119) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +204 -0
  3. package/actions/publish-index/action.yml +50 -0
  4. package/dist/cli/config-cmd.d.ts +3 -0
  5. package/dist/cli/config-cmd.d.ts.map +1 -0
  6. package/dist/cli/config-cmd.js +101 -0
  7. package/dist/cli/config-cmd.js.map +1 -0
  8. package/dist/cli/context.d.ts +3 -0
  9. package/dist/cli/context.d.ts.map +1 -0
  10. package/dist/cli/context.js +153 -0
  11. package/dist/cli/context.js.map +1 -0
  12. package/dist/cli/create.d.ts +23 -0
  13. package/dist/cli/create.d.ts.map +1 -0
  14. package/dist/cli/create.js +230 -0
  15. package/dist/cli/create.js.map +1 -0
  16. package/dist/cli/doctor.d.ts +3 -0
  17. package/dist/cli/doctor.d.ts.map +1 -0
  18. package/dist/cli/doctor.js +68 -0
  19. package/dist/cli/doctor.js.map +1 -0
  20. package/dist/cli/info.d.ts +5 -0
  21. package/dist/cli/info.d.ts.map +1 -0
  22. package/dist/cli/info.js +105 -0
  23. package/dist/cli/info.js.map +1 -0
  24. package/dist/cli/install.d.ts +5 -0
  25. package/dist/cli/install.d.ts.map +1 -0
  26. package/dist/cli/install.js +252 -0
  27. package/dist/cli/install.js.map +1 -0
  28. package/dist/cli/list.d.ts +5 -0
  29. package/dist/cli/list.d.ts.map +1 -0
  30. package/dist/cli/list.js +41 -0
  31. package/dist/cli/list.js.map +1 -0
  32. package/dist/cli/rebuild.d.ts +3 -0
  33. package/dist/cli/rebuild.d.ts.map +1 -0
  34. package/dist/cli/rebuild.js +84 -0
  35. package/dist/cli/rebuild.js.map +1 -0
  36. package/dist/cli/repo.d.ts +3 -0
  37. package/dist/cli/repo.d.ts.map +1 -0
  38. package/dist/cli/repo.js +93 -0
  39. package/dist/cli/repo.js.map +1 -0
  40. package/dist/cli/search.d.ts +5 -0
  41. package/dist/cli/search.d.ts.map +1 -0
  42. package/dist/cli/search.js +50 -0
  43. package/dist/cli/search.js.map +1 -0
  44. package/dist/cli/uninstall.d.ts +5 -0
  45. package/dist/cli/uninstall.d.ts.map +1 -0
  46. package/dist/cli/uninstall.js +68 -0
  47. package/dist/cli/uninstall.js.map +1 -0
  48. package/dist/cli/update.d.ts +5 -0
  49. package/dist/cli/update.d.ts.map +1 -0
  50. package/dist/cli/update.js +156 -0
  51. package/dist/cli/update.js.map +1 -0
  52. package/dist/cli/validate.d.ts +3 -0
  53. package/dist/cli/validate.d.ts.map +1 -0
  54. package/dist/cli/validate.js +99 -0
  55. package/dist/cli/validate.js.map +1 -0
  56. package/dist/core/builder.d.ts +32 -0
  57. package/dist/core/builder.d.ts.map +1 -0
  58. package/dist/core/builder.js +76 -0
  59. package/dist/core/builder.js.map +1 -0
  60. package/dist/core/cache.d.ts +17 -0
  61. package/dist/core/cache.d.ts.map +1 -0
  62. package/dist/core/cache.js +36 -0
  63. package/dist/core/cache.js.map +1 -0
  64. package/dist/core/config.d.ts +7 -0
  65. package/dist/core/config.d.ts.map +1 -0
  66. package/dist/core/config.js +32 -0
  67. package/dist/core/config.js.map +1 -0
  68. package/dist/core/detect.d.ts +28 -0
  69. package/dist/core/detect.d.ts.map +1 -0
  70. package/dist/core/detect.js +100 -0
  71. package/dist/core/detect.js.map +1 -0
  72. package/dist/core/fetcher.d.ts +21 -0
  73. package/dist/core/fetcher.d.ts.map +1 -0
  74. package/dist/core/fetcher.js +92 -0
  75. package/dist/core/fetcher.js.map +1 -0
  76. package/dist/core/json.d.ts +9 -0
  77. package/dist/core/json.d.ts.map +1 -0
  78. package/dist/core/json.js +10 -0
  79. package/dist/core/json.js.map +1 -0
  80. package/dist/core/lockfile.d.ts +9 -0
  81. package/dist/core/lockfile.d.ts.map +1 -0
  82. package/dist/core/lockfile.js +30 -0
  83. package/dist/core/lockfile.js.map +1 -0
  84. package/dist/core/log.d.ts +8 -0
  85. package/dist/core/log.d.ts.map +1 -0
  86. package/dist/core/log.js +24 -0
  87. package/dist/core/log.js.map +1 -0
  88. package/dist/core/paths.d.ts +4 -0
  89. package/dist/core/paths.d.ts.map +1 -0
  90. package/dist/core/paths.js +33 -0
  91. package/dist/core/paths.js.map +1 -0
  92. package/dist/core/prompt.d.ts +6 -0
  93. package/dist/core/prompt.d.ts.map +1 -0
  94. package/dist/core/prompt.js +78 -0
  95. package/dist/core/prompt.js.map +1 -0
  96. package/dist/core/registry.d.ts +52 -0
  97. package/dist/core/registry.d.ts.map +1 -0
  98. package/dist/core/registry.js +134 -0
  99. package/dist/core/registry.js.map +1 -0
  100. package/dist/core/resolver.d.ts +47 -0
  101. package/dist/core/resolver.d.ts.map +1 -0
  102. package/dist/core/resolver.js +153 -0
  103. package/dist/core/resolver.js.map +1 -0
  104. package/dist/core/schema.d.ts +8 -0
  105. package/dist/core/schema.d.ts.map +1 -0
  106. package/dist/core/schema.js +47 -0
  107. package/dist/core/schema.js.map +1 -0
  108. package/dist/core/types.d.ts +208 -0
  109. package/dist/core/types.d.ts.map +1 -0
  110. package/dist/core/types.js +3 -0
  111. package/dist/core/types.js.map +1 -0
  112. package/dist/index.d.ts +3 -0
  113. package/dist/index.d.ts.map +1 -0
  114. package/dist/index.js +40 -0
  115. package/dist/index.js.map +1 -0
  116. package/package.json +42 -6
  117. package/schemas/v1/config.schema.json +53 -0
  118. package/schemas/v1/lockfile.schema.json +43 -0
  119. package/schemas/v1/plugins.schema.json +69 -0
package/dist/index.js ADDED
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from "node:module";
3
+ import { Command } from "commander";
4
+ import { registerInstallCommand } from "./cli/install.js";
5
+ import { registerUninstallCommand } from "./cli/uninstall.js";
6
+ import { registerUpdateCommand } from "./cli/update.js";
7
+ import { registerListCommand } from "./cli/list.js";
8
+ import { registerSearchCommand } from "./cli/search.js";
9
+ import { registerInfoCommand } from "./cli/info.js";
10
+ import { registerRepoCommand } from "./cli/repo.js";
11
+ import { registerConfigCommand } from "./cli/config-cmd.js";
12
+ import { registerCreateCommand } from "./cli/create.js";
13
+ import { registerRebuildCommand } from "./cli/rebuild.js";
14
+ import { registerDoctorCommand } from "./cli/doctor.js";
15
+ import { registerValidateCommand } from "./cli/validate.js";
16
+ const _require = createRequire(import.meta.url);
17
+ const { version } = _require("../package.json");
18
+ const program = new Command();
19
+ program
20
+ .name("venpm")
21
+ .description("Vencord Plugin Manager — install and manage userplugins")
22
+ .version(version)
23
+ .option("-y, --yes", "Automatically answer yes to all prompts")
24
+ .option("--verbose", "Enable verbose output")
25
+ .option("--quiet", "Suppress non-essential output")
26
+ .option("--json", "Output structured JSON instead of human-readable text");
27
+ registerInstallCommand(program);
28
+ registerUninstallCommand(program);
29
+ registerUpdateCommand(program);
30
+ registerListCommand(program);
31
+ registerSearchCommand(program);
32
+ registerInfoCommand(program);
33
+ registerRepoCommand(program);
34
+ registerConfigCommand(program);
35
+ registerCreateCommand(program);
36
+ registerRebuildCommand(program);
37
+ registerDoctorCommand(program);
38
+ registerValidateCommand(program);
39
+ program.parse();
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE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,OAAO,CAAC,CAAC;AAEjC,OAAO,CAAC,KAAK,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,12 +1,48 @@
1
1
  {
2
2
  "name": "@kamaras/venpm",
3
- "version": "0.0.1",
4
- "description": "Vencord Plugin Manager — install and manage userplugins from JSON indexes",
5
- "keywords": ["vencord", "discord", "plugin", "manager"],
3
+ "version": "0.1.1",
4
+ "description": "Vencord Plugin Manager — CLI and index spec for distributing userplugins",
5
+ "type": "module",
6
+ "bin": {
7
+ "venpm": "./dist/index.js"
8
+ },
9
+ "scripts": {
10
+ "build": "tsc",
11
+ "dev": "tsc --watch",
12
+ "test": "vitest run",
13
+ "test:watch": "vitest",
14
+ "test:coverage": "vitest run --coverage",
15
+ "lint": "tsc --noEmit",
16
+ "setup": "npm install && npm run build && npm link",
17
+ "unsetup": "npm unlink -g venpm"
18
+ },
19
+ "engines": {
20
+ "node": ">=18.0.0"
21
+ },
22
+ "files": [
23
+ "dist/",
24
+ "schemas/",
25
+ "actions/"
26
+ ],
27
+ "keywords": [
28
+ "vencord",
29
+ "discord",
30
+ "plugin",
31
+ "userplugin",
32
+ "package-manager"
33
+ ],
6
34
  "author": "kamaras",
7
35
  "license": "MIT",
8
- "repository": {
9
- "type": "git",
10
- "url": "https://github.com/theokyr/venpm"
36
+ "publishConfig": { "access": "public" },
37
+ "dependencies": {
38
+ "ajv": "^8.17.0",
39
+ "ajv-formats": "^3.0.1",
40
+ "commander": "^13.0.0",
41
+ "tar": "^7.4.0"
42
+ },
43
+ "devDependencies": {
44
+ "@types/node": "^22.0.0",
45
+ "typescript": "^5.7.0",
46
+ "vitest": "^3.1.0"
11
47
  }
12
48
  }
@@ -0,0 +1,53 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://venpm.dev/schemas/v1/config.json",
4
+ "title": "venpm Config",
5
+ "description": "User configuration for venpm, the Vencord Plugin Manager",
6
+ "type": "object",
7
+ "required": ["repos", "vencord", "rebuild", "discord"],
8
+ "properties": {
9
+ "$schema": { "type": "string", "description": "JSON Schema URL for IDE validation" },
10
+ "repos": {
11
+ "type": "array",
12
+ "description": "Plugin repository sources",
13
+ "items": {
14
+ "type": "object",
15
+ "required": ["name", "url"],
16
+ "properties": {
17
+ "name": { "type": "string", "description": "Repository identifier", "pattern": "^[a-zA-Z0-9_-]+$" },
18
+ "url": { "type": "string", "format": "uri", "description": "URL to the plugin index JSON" }
19
+ },
20
+ "additionalProperties": false
21
+ }
22
+ },
23
+ "vencord": {
24
+ "type": "object",
25
+ "description": "Vencord installation settings",
26
+ "required": ["path"],
27
+ "properties": {
28
+ "path": { "type": ["string", "null"], "description": "Path to the Vencord source directory, or null to auto-detect" }
29
+ },
30
+ "additionalProperties": false
31
+ },
32
+ "rebuild": {
33
+ "type": "string",
34
+ "description": "Whether to rebuild Vencord after plugin changes",
35
+ "enum": ["ask", "always", "never"]
36
+ },
37
+ "discord": {
38
+ "type": "object",
39
+ "description": "Discord restart settings",
40
+ "required": ["restart", "binary"],
41
+ "properties": {
42
+ "restart": {
43
+ "type": "string",
44
+ "description": "Whether to restart Discord after a rebuild",
45
+ "enum": ["ask", "always", "never"]
46
+ },
47
+ "binary": { "type": ["string", "null"], "description": "Path to the Discord binary, or null to auto-detect" }
48
+ },
49
+ "additionalProperties": false
50
+ }
51
+ },
52
+ "additionalProperties": false
53
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://venpm.dev/schemas/v1/lockfile.json",
4
+ "title": "venpm Lockfile",
5
+ "description": "Lockfile tracking installed plugins for venpm, the Vencord Plugin Manager",
6
+ "type": "object",
7
+ "required": ["installed"],
8
+ "properties": {
9
+ "$schema": { "type": "string", "description": "JSON Schema URL for IDE validation" },
10
+ "installed": {
11
+ "type": "object",
12
+ "description": "Map of plugin name to installed plugin entry",
13
+ "additionalProperties": { "$ref": "#/$defs/installedEntry" }
14
+ }
15
+ },
16
+ "additionalProperties": false,
17
+ "$defs": {
18
+ "installedEntry": {
19
+ "type": "object",
20
+ "required": ["version", "repo", "method", "pinned", "installed_at"],
21
+ "properties": {
22
+ "version": {
23
+ "description": "Installed version (semver or 'local' for local installs)",
24
+ "oneOf": [
25
+ { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[a-zA-Z0-9.]+)?$" },
26
+ { "type": "string", "const": "local" }
27
+ ]
28
+ },
29
+ "repo": { "type": "string", "description": "Repository name this plugin was installed from" },
30
+ "method": {
31
+ "type": "string",
32
+ "description": "How the plugin was installed",
33
+ "enum": ["git", "tarball", "local"]
34
+ },
35
+ "pinned": { "type": "boolean", "description": "Whether this plugin is pinned to its current version" },
36
+ "installed_at": { "type": "string", "format": "date-time", "description": "ISO 8601 timestamp of when the plugin was installed" },
37
+ "git_ref": { "type": "string", "description": "Git ref (commit SHA, tag, or branch) used for installation" },
38
+ "path": { "type": "string", "description": "Subdirectory path within the git repo (for monorepos)" }
39
+ },
40
+ "additionalProperties": false
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,69 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://venpm.dev/schemas/v1/plugins.json",
4
+ "title": "venpm Plugin Index",
5
+ "description": "Plugin repository index for venpm, the Vencord Plugin Manager",
6
+ "type": "object",
7
+ "required": ["name", "description", "plugins"],
8
+ "properties": {
9
+ "$schema": { "type": "string", "description": "JSON Schema URL for IDE validation" },
10
+ "name": { "type": "string", "description": "Repository identifier", "pattern": "^[a-zA-Z0-9_-]+$" },
11
+ "description": { "type": "string", "description": "Human-readable repository description" },
12
+ "plugins": {
13
+ "type": "object",
14
+ "description": "Map of plugin name to plugin definition",
15
+ "additionalProperties": { "$ref": "#/$defs/pluginEntry" }
16
+ }
17
+ },
18
+ "additionalProperties": false,
19
+ "$defs": {
20
+ "pluginEntry": {
21
+ "type": "object",
22
+ "required": ["version", "description", "authors", "source"],
23
+ "properties": {
24
+ "version": { "type": "string", "description": "Current/latest semver version", "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[a-zA-Z0-9.]+)?$" },
25
+ "description": { "type": "string" },
26
+ "authors": {
27
+ "type": "array",
28
+ "items": {
29
+ "type": "object", "required": ["name", "id"],
30
+ "properties": { "name": { "type": "string" }, "id": { "type": "string" } },
31
+ "additionalProperties": false
32
+ },
33
+ "minItems": 1
34
+ },
35
+ "license": { "type": "string", "description": "SPDX license identifier" },
36
+ "dependencies": { "type": "array", "items": { "type": "string" }, "description": "Required plugins (auto-installed)" },
37
+ "optionalDependencies": { "type": "array", "items": { "type": "string" }, "description": "Recommended plugins (warned about, not auto-installed)" },
38
+ "discord": { "type": "string", "description": "Informational Discord version range (never blocks install)" },
39
+ "vencord": { "type": "string", "description": "Informational Vencord version range (never blocks install)" },
40
+ "source": { "$ref": "#/$defs/pluginSource" },
41
+ "versions": {
42
+ "type": "object",
43
+ "additionalProperties": { "$ref": "#/$defs/versionEntry" }
44
+ }
45
+ },
46
+ "additionalProperties": false
47
+ },
48
+ "pluginSource": {
49
+ "type": "object",
50
+ "description": "Where to fetch the plugin. At least one of git, tarball, or local must be present.",
51
+ "properties": {
52
+ "git": { "type": "string", "description": "Git clone URL" },
53
+ "path": { "type": "string", "description": "Subdirectory within the git repo (for monorepos)" },
54
+ "tarball": { "type": "string", "format": "uri", "description": "Direct download URL for tarball" },
55
+ "local": { "type": "string", "description": "Local filesystem path (developer workflow)" }
56
+ },
57
+ "anyOf": [{ "required": ["git"] }, { "required": ["tarball"] }, { "required": ["local"] }],
58
+ "additionalProperties": false
59
+ },
60
+ "versionEntry": {
61
+ "type": "object",
62
+ "properties": {
63
+ "git_tag": { "type": "string" },
64
+ "tarball": { "type": "string", "format": "uri" }
65
+ },
66
+ "additionalProperties": false
67
+ }
68
+ }
69
+ }