ignotum 0.0.3 → 0.0.5
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 +26 -7
- package/dist/cli/bin.mjs +27353 -1490
- package/dist/cli/bin.mjs.map +1 -1
- package/dist/runtime/{api-Cpx57mk3.d.ts → api-D2bsAz4T.d.ts} +3 -2
- package/dist/runtime/{api-BXXIZc_Q.js → api-DtX8qPrq.js} +58 -27
- package/dist/runtime/api-DtX8qPrq.js.map +1 -0
- package/dist/runtime/client.d.ts +11 -4
- package/dist/runtime/client.js +352 -79
- package/dist/runtime/client.js.map +1 -1
- package/dist/runtime/{result-B2W-z2wG.js → descriptor-t6BOEGw9-BTHR-ZMv.js} +119 -4
- package/dist/runtime/descriptor-t6BOEGw9-BTHR-ZMv.js.map +1 -0
- package/dist/runtime/id-Btwac71X-B9OeBzvq.d.ts +9 -0
- package/dist/runtime/id-D570vudg.js +26 -0
- package/dist/runtime/id-D570vudg.js.map +1 -0
- package/dist/runtime/{index-C6KO3ZdI.d.ts → index-Dl_VQGmA.d.ts} +90 -29
- package/dist/runtime/internal/api.d.ts +1 -1
- package/dist/runtime/internal/api.js +1 -1
- package/dist/runtime/internal/host.d.ts +44 -0
- package/dist/runtime/internal/host.js +213 -0
- package/dist/runtime/internal/host.js.map +1 -0
- package/dist/runtime/internal/server.d.ts +1 -1
- package/dist/runtime/internal/server.js +1 -1
- package/dist/runtime/internal/types.d.ts +1 -1
- package/dist/runtime/internal/types.js +1 -1
- package/dist/runtime/{result-C1ZdsM6Y.d.ts → result-BgcHn25t.d.ts} +21 -6
- package/dist/runtime/{schema-wiFI7rgx.js → schema-B-jMZEbs.js} +95 -35
- package/dist/runtime/schema-B-jMZEbs.js.map +1 -0
- package/dist/runtime/server.d.ts +2 -2
- package/dist/runtime/server.js +2 -2
- package/package.json +13 -3
- package/src/cli/agent-files.ts +6 -2
- package/src/cli/app-configuration.ts +135 -0
- package/src/cli/bin.ts +24 -1
- package/src/cli/build/artifact.ts +95 -0
- package/src/cli/build/client.ts +111 -0
- package/src/cli/build/public.ts +182 -0
- package/src/cli/build/server.ts +527 -0
- package/src/cli/client-config.ts +148 -0
- package/src/cli/client-entry.ts +152 -0
- package/src/cli/client-plugin.ts +86 -16
- package/src/cli/codegen.ts +5 -5
- package/src/cli/command.ts +41 -9
- package/src/cli/control-client.ts +343 -0
- package/src/cli/deploy.ts +217 -0
- package/src/cli/dev.ts +43 -108
- package/src/cli/module-boundaries.ts +183 -0
- package/src/cli/{new-project.ts → new-app.ts} +86 -86
- package/src/cli/package-manager.ts +9 -9
- package/src/client/app.ts +15 -0
- package/src/client/errors.ts +1 -17
- package/src/client/index.ts +2 -0
- package/src/client/sync.ts +172 -120
- package/src/dev-runtime/database.ts +253 -96
- package/src/dev-runtime/dev-database.ts +14 -14
- package/src/dev-runtime/functions.ts +57 -88
- package/src/dev-runtime/id.ts +2 -10
- package/src/dev-runtime/migrations.ts +68 -0
- package/src/dev-runtime/sync.ts +266 -83
- package/src/internal/function-definition.ts +77 -0
- package/src/internal/host.ts +1 -0
- package/src/internal/http-paths.ts +3 -1
- package/dist/runtime/api-BXXIZc_Q.js.map +0 -1
- package/dist/runtime/result-B2W-z2wG.js.map +0 -1
- package/dist/runtime/schema-wiFI7rgx.js.map +0 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Ignotum is an opinionated TypeScript application cloud. Define a schema, queries, and mutations,
|
|
4
4
|
then call them from the client with end-to-end types and realtime updates.
|
|
5
5
|
|
|
6
|
-
The current release supports local development
|
|
6
|
+
The current release supports local development and hosted deployment.
|
|
7
7
|
|
|
8
8
|
## Get started
|
|
9
9
|
|
|
@@ -15,15 +15,15 @@ cd my-app
|
|
|
15
15
|
npx ignotum dev
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
Open <http://127.0.0.1:3210>. The generated
|
|
18
|
+
Open <http://127.0.0.1:3210>. The generated app contains a schema, a query, a mutation, and a
|
|
19
19
|
JSX client.
|
|
20
20
|
|
|
21
21
|
## Follow the example app
|
|
22
22
|
|
|
23
23
|
```text
|
|
24
24
|
client/
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
index.tsx
|
|
26
|
+
icon.svg
|
|
27
27
|
server/
|
|
28
28
|
counter.ts
|
|
29
29
|
schema.ts
|
|
@@ -75,6 +75,8 @@ export const get = query({
|
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
export const increment = mutation({
|
|
78
|
+
returns: values.number(),
|
|
79
|
+
|
|
78
80
|
handler: function* (ctx) {
|
|
79
81
|
const counters = yield* ctx.db.query("counters").collect();
|
|
80
82
|
const counter = counters[0];
|
|
@@ -85,6 +87,8 @@ export const increment = mutation({
|
|
|
85
87
|
} else {
|
|
86
88
|
yield* ctx.db.patch("counters", counter.id, { value });
|
|
87
89
|
}
|
|
90
|
+
|
|
91
|
+
return value;
|
|
88
92
|
},
|
|
89
93
|
});
|
|
90
94
|
```
|
|
@@ -100,15 +104,16 @@ and `api.counter.increment`.
|
|
|
100
104
|
|
|
101
105
|
### Call the functions from the client
|
|
102
106
|
|
|
103
|
-
`client/
|
|
107
|
+
`client/index.tsx` defines the app title and uses the generated references to call the server
|
|
108
|
+
functions.
|
|
104
109
|
|
|
105
110
|
```tsx
|
|
106
|
-
import { Result, useMutation, useQuery } from "ignotum/client";
|
|
111
|
+
import { app, Result, useMutation, useQuery } from "ignotum/client";
|
|
107
112
|
|
|
108
113
|
import { api } from "@/_generated/api.js";
|
|
109
114
|
import { counterIncrement } from "@/shared/utils.js";
|
|
110
115
|
|
|
111
|
-
|
|
116
|
+
function App() {
|
|
112
117
|
const count = useQuery(api.counter.get);
|
|
113
118
|
const increment = useMutation(api.counter.increment);
|
|
114
119
|
|
|
@@ -133,6 +138,11 @@ export default function App() {
|
|
|
133
138
|
</main>
|
|
134
139
|
);
|
|
135
140
|
}
|
|
141
|
+
|
|
142
|
+
export default app({
|
|
143
|
+
title: "Counter",
|
|
144
|
+
component: App,
|
|
145
|
+
});
|
|
136
146
|
```
|
|
137
147
|
|
|
138
148
|
`useQuery` starts with a pending result and subscribes to later values. `Result.match` makes the UI
|
|
@@ -142,6 +152,15 @@ server definition.
|
|
|
142
152
|
Open the app in two browser tabs and increment the counter in either one. Both tabs update because
|
|
143
153
|
Ignotum refreshes active queries after a successful mutation.
|
|
144
154
|
|
|
155
|
+
Ignotum loads Tailwind CSS automatically. Custom CSS files are ordinary client modules and can use
|
|
156
|
+
any filename when imported from app code.
|
|
157
|
+
|
|
158
|
+
The optional `client/icon.svg` file becomes the favicon automatically. If it is absent, Ignotum
|
|
159
|
+
does not add a favicon link.
|
|
160
|
+
|
|
161
|
+
Optional files in a top-level `public` directory keep their relative paths as public URLs. Ignotum
|
|
162
|
+
accepts AVIF, GIF, ICO, JPEG, PNG, WebP, and PDF files there; `client/public` is not supported.
|
|
163
|
+
|
|
145
164
|
## Keep working
|
|
146
165
|
|
|
147
166
|
The dev server watches the schema and server modules, regenerates bindings, and reloads the app.
|