@edgespark/server-types 0.0.1-alpha.5 → 0.0.1-alpha.6

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 (2) hide show
  1. package/README.md +21 -79
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,90 +1,32 @@
1
1
  # @edgespark/server-types
2
2
 
3
- Type definitions for EdgeSpark Server SDK.
3
+ TypeScript type definitions for EdgeSpark server SDK.
4
4
 
5
- ## Overview
5
+ ## What's Included
6
6
 
7
- This is a **types-only** package. The actual implementation lives in `edge/workers/user-worker/src/sdk-server/` and is deployed with the user-worker.
7
+ - `Client<TSchema>` - Main SDK client interface
8
+ - `AuthClient` - Authentication with path-based conventions
9
+ - `User` - Authenticated user identity
10
+ - `StorageClient` / `BucketClient` - File storage operations
11
+ - `SecretClient` - Environment secrets access
8
12
 
9
- ```
10
- sdk/server-types/src/index.ts ← Types (this package)
11
-
12
- workspace:*
13
-
14
- sdk-server/ ← Implementation (imports types from here)
15
-
16
- deployed
17
-
18
- user-worker ← Runtime (serves SDK to user code)
19
- ```
20
-
21
- ## Development Flow
22
-
23
- ### Adding a New Feature
24
-
25
- 1. **Add types** in `sdk/server-types/src/index.ts`
26
- ```typescript
27
- export interface QueueClient {
28
- send(message: string): Promise<void>;
29
- }
30
-
31
- export interface Client<TSchema> {
32
- // ... existing
33
- queue: QueueClient; // new
34
- }
35
- ```
36
-
37
- 2. **Implement** in `edge/workers/user-worker/src/sdk-server/`
38
- ```typescript
39
- import type { QueueClient } from "@edgespark/server-types";
40
- // ... implementation
41
- ```
13
+ ## Usage
42
14
 
43
- 3. **Deploy user-worker** (implementation goes live)
44
- ```bash
45
- cd edge/workers/user-worker
46
- wrangler deploy
47
- ```
15
+ This package is pre-installed in EdgeSpark projects. Types are used for autocompletion and type checking:
48
16
 
49
- 4. **Publish types** to npm
50
- ```bash
51
- cd sdk/server-types
52
- pnpm version minor # 0.0.1 → 0.1.0
53
- pnpm publish
54
- ```
17
+ ```typescript
18
+ import type { Client } from "@edgespark/server-types";
19
+ import { tables } from "@generated";
55
20
 
56
- ### Types-Only Changes (JSDoc, comments)
57
-
58
- ```bash
59
- cd sdk/server-types
60
- # Edit src/index.ts
61
- pnpm version patch # 0.0.1 → 0.0.2
62
- pnpm publish
21
+ export async function createApp(edgespark: Client<typeof tables>) {
22
+ // Full IntelliSense for:
23
+ // - edgespark.db (Drizzle ORM)
24
+ // - edgespark.auth
25
+ // - edgespark.storage
26
+ // - edgespark.secret
27
+ }
63
28
  ```
64
29
 
65
- No deployment needed.
66
-
67
- ## Rules
68
-
69
- | Rule | Why |
70
- |------|-----|
71
- | Deploy impl BEFORE publishing types | New types + old impl = runtime errors |
72
- | Types can publish WITHOUT deploy | JSDoc/comment changes are safe |
73
- | Use `workspace:*` locally | Instant feedback during dev |
74
- | Bump version on every publish | npm requires unique versions |
75
-
76
- ## Local Development
30
+ ## Learn More
77
31
 
78
- The `user-worker` package uses `"@edgespark/server-types": "workspace:*"` which means:
79
- - Changes to `sdk/server-types/src/index.ts` are immediately available
80
- - Run `pnpm build` in `sdk/server-types/` to update `dist/`
81
- - No need to publish during development
82
-
83
- ## Publishing
84
-
85
- ```bash
86
- cd sdk/server-types
87
- pnpm build # Compile TypeScript
88
- pnpm version <patch|minor|major>
89
- pnpm publish --access public
90
- ```
32
+ Visit [edgespark.dev](https://edgespark.dev) to get started.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgespark/server-types",
3
- "version": "0.0.1-alpha.5",
3
+ "version": "0.0.1-alpha.6",
4
4
  "description": "Type definitions for EdgeSpark server SDK",
5
5
  "keywords": [
6
6
  "edgespark",