eraspace 0.0.0-stage → 0.2.0
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/LICENSE +21 -0
- package/README.md +55 -2
- package/bin.js +40620 -0
- package/package.json +32 -4
- package/sdk/src/client/client.ts +171 -0
- package/sdk/src/client/config.ts +39 -0
- package/sdk/src/client/connection.ts +450 -0
- package/sdk/src/client/errors.ts +37 -0
- package/sdk/src/client/files.ts +364 -0
- package/sdk/src/client/index.ts +36 -0
- package/sdk/src/client/mount.ts +45 -0
- package/sdk/src/client/pagination.ts +104 -0
- package/sdk/src/client/request-key.ts +13 -0
- package/sdk/src/client/result-diff.ts +41 -0
- package/sdk/src/client/retry.ts +5 -0
- package/sdk/src/client/room.ts +110 -0
- package/sdk/src/client/router.ts +177 -0
- package/sdk/src/client/storage.ts +132 -0
- package/sdk/src/client/sub-key.ts +12 -0
- package/sdk/src/client/subscription.ts +55 -0
- package/sdk/src/client/transport.ts +356 -0
- package/sdk/src/client/types.ts +132 -0
- package/sdk/src/server/index.ts +635 -0
- package/templates/chat/client/index.tsx +41 -0
- package/templates/chat/client/styles.css +43 -0
- package/templates/chat/server/index.ts +27 -0
- package/templates/poll/client/index.tsx +24 -0
- package/templates/poll/client/styles.css +28 -0
- package/templates/poll/server/index.ts +17 -0
- package/templates/todo/client/index.tsx +26 -0
- package/templates/todo/client/styles.css +28 -0
- package/templates/todo/server/index.ts +18 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 shujanshaikh
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,56 @@
|
|
|
1
|
-
#
|
|
1
|
+
# eraspace
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Build and deploy realtime apps written in TypeScript. The server runs in V8 with Postgres storage, live queries
|
|
4
|
+
and WebSockets; the client is Preact. Apps need no `package.json`, `tsconfig.json` or `node_modules`: the CLI bundles
|
|
5
|
+
the SDK, Preact and TypeScript.
|
|
6
|
+
|
|
7
|
+
Requires Node.js 24 or newer.
|
|
8
|
+
|
|
9
|
+
## Quick start
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx eraspace new my-app # templates: --template chat | todo | poll
|
|
13
|
+
cd my-app
|
|
14
|
+
npx eraspace deploy # prints the app URL
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
A deploy without an account creates an unclaimed app. It works straight away and expires after about a week unless you
|
|
18
|
+
sign in and claim it (`eraspace auth login`, then `eraspace claim`).
|
|
19
|
+
|
|
20
|
+
## Commands
|
|
21
|
+
|
|
22
|
+
| Command | What it does |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| `new <name>` / `init` | Create an app in a new directory or the current one |
|
|
25
|
+
| `typecheck` | Typecheck `server/`, `client/` and `shared/` |
|
|
26
|
+
| `deploy` | Build the client, compile the server and deploy (`--delete-table <table>=<rows>` confirms deleting a removed table) |
|
|
27
|
+
| `dev` | Deploy, then redeploy whenever `server/`, `client/`, `shared/` or `.env.eraspace.server` change |
|
|
28
|
+
| `call <fn> '<json>'...` | Call a query, mutation or action, each argument a JSON value |
|
|
29
|
+
| `logs [app]` | Read handler logs (`--follow` to stream) |
|
|
30
|
+
| `inspect` | Show the schema, functions and deploys |
|
|
31
|
+
| `auth login` / `logout` / `whoami` | Sign in with your browser, sign out, or show who you are |
|
|
32
|
+
| `claim` | Take ownership of this checkout's unclaimed app |
|
|
33
|
+
| `apps` | List your apps |
|
|
34
|
+
| `names` / `names add` / `names rm` | List, add or remove the app's names |
|
|
35
|
+
| `inspection public\|private [app]` | Open or close inspection and logs to everyone |
|
|
36
|
+
| `archive` / `restore [app]` | Stop serving an app and keep its data, or serve it again |
|
|
37
|
+
| `terminate [app] --yes` | Stop an app permanently: its data is kept but it accepts no more deploys |
|
|
38
|
+
| `token create` / `list` / `revoke` | Manage API tokens for one app, or for all your apps with `--personal` |
|
|
39
|
+
|
|
40
|
+
Commands act on the app bound to the current checkout. Pass `--app <name or id>` or set `ERASPACE_APP` to choose
|
|
41
|
+
another. `eraspace --help` and `eraspace <command> --help` list every flag.
|
|
42
|
+
|
|
43
|
+
## CI
|
|
44
|
+
|
|
45
|
+
Create a token with `eraspace token create` (add `--read` for inspection and logs only), then set `ERASPACE_TOKEN` and
|
|
46
|
+
`ERASPACE_TOKEN_API=<platform origin>` in CI. The CLI never sends the token to any other origin.
|
|
47
|
+
|
|
48
|
+
## Platform
|
|
49
|
+
|
|
50
|
+
The CLI deploys to the hosted eraspace platform by default. Set `ERASPACE_URL` or pass `--url` to use another one, such
|
|
51
|
+
as a local platform at `http://localhost:4000`.
|
|
52
|
+
|
|
53
|
+
## Upgrading from 0.1
|
|
54
|
+
|
|
55
|
+
0.2 targets the V8 platform and its JSON socket protocol. Apps deployed with 0.1 are not carried over: deploy them
|
|
56
|
+
afresh with 0.2, which also rebuilds their browser bundles against the new SDK.
|