@theholocron/holocron-plugin-neon 2.0.0-alpha.0 → 2.0.0-alpha.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.
package/README.md CHANGED
@@ -3,6 +3,12 @@
3
3
  Neon plugin for [Holocron](../cli). Implements the `storage`
4
4
  capability against [Neon's REST API](https://api-docs.neon.tech/reference/getting-started-with-neon-api).
5
5
 
6
+ ## Install
7
+
8
+ ```bash
9
+ pnpm add -D @theholocron/holocron-plugin-neon@alpha
10
+ ```
11
+
6
12
  ## Auth
7
13
 
8
14
  Token resolution order:
@@ -15,25 +21,25 @@ Token resolution order:
15
21
 
16
22
  ```jsonc
17
23
  {
18
- "providers": {
19
- "storage": ["neon", { "projectId": "ancient-resonance-…" }]
20
- }
24
+ "providers": {
25
+ "storage": ["neon", { "projectId": "ancient-resonance-…" }],
26
+ },
21
27
  }
22
28
  ```
23
29
 
24
30
  - `projectId` (required) — the Neon project id. The plugin binds to
25
- this project; every method operates within it.
31
+ this project; every method operates within it.
26
32
 
27
33
  ## What's implemented
28
34
 
29
- | Method | What it does |
30
- | ----------------------- | --------------------------------------------------------- |
31
- | `getConnectionString` | Fetches the connection URI for a branch. `pooled: true` returns the PgBouncer URL. |
32
- | `listBranches` | All branches on the bound project. |
33
- | `createBranch` | Provisions a branch + a read_write compute endpoint inline (so the next connection-string call doesn't 404). |
34
- | `destroyBranch` | DELETEs a branch. |
35
- | `resetBranch` | Restores one branch to match another (Neon "restore branch" endpoint). |
36
- | `enableExtension` | Runs `CREATE EXTENSION IF NOT EXISTS "..."` against the branch's default database via Neon's run_sql endpoint. Used for PostGIS, pgvector, etc. |
35
+ | Method | What it does |
36
+ | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
37
+ | `getConnectionString` | Fetches the connection URI for a branch. `pooled: true` returns the PgBouncer URL. |
38
+ | `listBranches` | All branches on the bound project. |
39
+ | `createBranch` | Provisions a branch + a read_write compute endpoint inline (so the next connection-string call doesn't 404). |
40
+ | `destroyBranch` | DELETEs a branch. |
41
+ | `resetBranch` | Restores one branch to match another (Neon "restore branch" endpoint). |
42
+ | `enableExtension` | Runs `CREATE EXTENSION IF NOT EXISTS "..."` against the branch's default database via Neon's run_sql endpoint. Used for PostGIS, pgvector, etc. |
37
43
 
38
44
  Vercel-managed Neon orgs reject project-create at the Neon API level
39
45
  ("organization is managed by Vercel"). For those setups, provision
@@ -45,4 +51,6 @@ later).
45
51
 
46
52
  ## Status
47
53
 
48
- **v0.0.0 — first port.**
54
+ **`v2.0.0-alpha.0`**published on npm under the `alpha` dist-tag.
55
+ [Release notes](https://github.com/theholocron/holocron/releases/tag/v2.0.0-alpha.0).
56
+ APIs may still shift before stable v2.0.0.
package/dist/index.d.mts CHANGED
@@ -35,7 +35,7 @@ interface RestClientOptions {
35
35
  baseUrl?: string;
36
36
  }
37
37
  interface RequestOptions {
38
- method?: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
38
+ method?: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
39
39
  body?: unknown;
40
40
  query?: Record<string, string>;
41
41
  }
package/dist/index.mjs CHANGED
@@ -124,7 +124,9 @@ var NeonRestClient = class {
124
124
  constructor(opts) {
125
125
  this.token = opts.token;
126
126
  this.fetchImpl = opts.fetch ?? globalThis.fetch;
127
- this.baseUrl = (opts.baseUrl ?? "https://console.neon.tech/api/v2").replace(/\/+$/, "");
127
+ let url = opts.baseUrl ?? "https://console.neon.tech/api/v2";
128
+ while (url.endsWith("/")) url = url.slice(0, -1);
129
+ this.baseUrl = url;
128
130
  }
129
131
  async request(path, opts = {}) {
130
132
  const url = new URL(`${this.baseUrl}${path.startsWith("/") ? path : "/" + path}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-neon",
3
- "version": "2.0.0-alpha.0",
3
+ "version": "2.0.0-alpha.1",
4
4
  "description": "Holocron plugin for Neon. Implements the storage capability against Neon's REST API — branch ops, connection strings, extensions.",
5
5
  "homepage": "https://github.com/theholocron/holocron/tree/main/packages/holocron-plugin-neon#readme",
6
6
  "bugs": "https://github.com/theholocron/holocron/issues",
@@ -21,7 +21,7 @@
21
21
  }
22
22
  },
23
23
  "peerDependencies": {
24
- "@theholocron/cli": "2.0.0-alpha.0"
24
+ "@theholocron/cli": "2.0.0-alpha.1"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@theholocron/tsconfig": "^4.1.0",
@@ -32,7 +32,7 @@
32
32
  "typescript": "^5.9.3",
33
33
  "vitest": "^3.2.6",
34
34
  "tsdown": "^0.22.3",
35
- "@theholocron/cli": "2.0.0-alpha.0"
35
+ "@theholocron/cli": "2.0.0-alpha.1"
36
36
  },
37
37
  "publishConfig": {
38
38
  "access": "public"