@powerhousedao/registry 6.0.0-dev.73
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/README.md +52 -0
- package/package.json +42 -0
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# @powerhousedao/registry
|
|
2
|
+
|
|
3
|
+
Express-based server that serves Powerhouse packages (ESM bundles) for dynamic loading via `import()` in browsers and Node.js.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
### CLI
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
# Serve packages from a directory
|
|
11
|
+
ph-registry ./path/to/packages 3000
|
|
12
|
+
|
|
13
|
+
# Or with environment variables
|
|
14
|
+
REGISTRY_DIR=./packages PORT=3000 ph-registry
|
|
15
|
+
|
|
16
|
+
# Or run directly
|
|
17
|
+
node dist/src/run.js ./path/to/packages 3000
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Arguments:
|
|
21
|
+
|
|
22
|
+
- `dir` (positional, 1st) -- directory to serve packages from (default: `.`, env: `REGISTRY_DIR`)
|
|
23
|
+
- `port` (positional, 2nd) -- port to listen on (default: `8080`, env: `PORT`)
|
|
24
|
+
|
|
25
|
+
### Library
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import express from "express";
|
|
29
|
+
import { createRegistryRouter } from "@powerhousedao/registry";
|
|
30
|
+
|
|
31
|
+
const app = express();
|
|
32
|
+
app.use(createRegistryRouter("./packages"));
|
|
33
|
+
app.listen(3000);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## API
|
|
37
|
+
|
|
38
|
+
### `createPowerhouseRouter(config)`
|
|
39
|
+
|
|
40
|
+
Creates an Express `Router` that serves packages.
|
|
41
|
+
|
|
42
|
+
### `GET /packages`
|
|
43
|
+
|
|
44
|
+
Returns a JSON array of all discovered packages.
|
|
45
|
+
|
|
46
|
+
### `GET /packages/by-document-type?type=<documentType>`
|
|
47
|
+
|
|
48
|
+
Returns package names that contain the specified document type.
|
|
49
|
+
|
|
50
|
+
### `GET /-/cdn/<packageName>/<filePath>`
|
|
51
|
+
|
|
52
|
+
Serves files from the CDN cache for a package.
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@powerhousedao/registry",
|
|
3
|
+
"version": "6.0.0-dev.73",
|
|
4
|
+
"description": "",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/powerhouse-inc/powerhouse"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"ph-registry": "./dist/src/cli.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"scripts": {
|
|
18
|
+
"start": "node ./dist/src/cli.js",
|
|
19
|
+
"dev": "bun run ./src/cli.ts",
|
|
20
|
+
"build:cli": "bun run ./bundle.ts",
|
|
21
|
+
"test": "vitest --run"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [],
|
|
24
|
+
"author": "",
|
|
25
|
+
"license": "ISC",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"cmd-ts": "catalog:",
|
|
28
|
+
"express": "^5.2.1",
|
|
29
|
+
"find-up": "^8.0.0",
|
|
30
|
+
"tar": "^7.4.3",
|
|
31
|
+
"verdaccio": "^6.1.1",
|
|
32
|
+
"verdaccio-aws-s3-storage": "^10.4.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/bun": "catalog:",
|
|
36
|
+
"@types/express": "^5.0.6",
|
|
37
|
+
"@types/node": "catalog:",
|
|
38
|
+
"@types/supertest": "^6.0.2",
|
|
39
|
+
"supertest": "^7.1.0",
|
|
40
|
+
"vitest": "catalog:"
|
|
41
|
+
}
|
|
42
|
+
}
|