ignotum 0.0.2 → 0.0.4

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 (64) hide show
  1. package/README.md +23 -7
  2. package/dist/cli/bin.mjs +32313 -751
  3. package/dist/cli/bin.mjs.map +1 -1
  4. package/dist/runtime/{api-Cpx57mk3.d.ts → api-D2bsAz4T.d.ts} +3 -2
  5. package/dist/runtime/{api-BXXIZc_Q.js → api-DtX8qPrq.js} +58 -27
  6. package/dist/runtime/api-DtX8qPrq.js.map +1 -0
  7. package/dist/runtime/client.d.ts +11 -4
  8. package/dist/runtime/client.js +343 -79
  9. package/dist/runtime/client.js.map +1 -1
  10. package/dist/runtime/{result-B2W-z2wG.js → descriptor-t6BOEGw9-BTHR-ZMv.js} +119 -4
  11. package/dist/runtime/descriptor-t6BOEGw9-BTHR-ZMv.js.map +1 -0
  12. package/dist/runtime/id-Btwac71X-B9OeBzvq.d.ts +9 -0
  13. package/dist/runtime/id-D570vudg.js +26 -0
  14. package/dist/runtime/id-D570vudg.js.map +1 -0
  15. package/dist/runtime/{index-BgWROoyk.d.ts → index-Dl_VQGmA.d.ts} +114 -31
  16. package/dist/runtime/internal/api.d.ts +1 -1
  17. package/dist/runtime/internal/api.js +1 -1
  18. package/dist/runtime/internal/host.d.ts +44 -0
  19. package/dist/runtime/internal/host.js +213 -0
  20. package/dist/runtime/internal/host.js.map +1 -0
  21. package/dist/runtime/internal/server.d.ts +1 -1
  22. package/dist/runtime/internal/server.js +1 -1
  23. package/dist/runtime/internal/types.d.ts +1 -1
  24. package/dist/runtime/internal/types.js +1 -1
  25. package/dist/runtime/{result-C1ZdsM6Y.d.ts → result-BgcHn25t.d.ts} +21 -6
  26. package/dist/runtime/schema-B-jMZEbs.js +227 -0
  27. package/dist/runtime/schema-B-jMZEbs.js.map +1 -0
  28. package/dist/runtime/server.d.ts +2 -2
  29. package/dist/runtime/server.js +2 -2
  30. package/package.json +15 -5
  31. package/src/cli/agent-files.ts +6 -2
  32. package/src/cli/app-configuration.ts +135 -0
  33. package/src/cli/bin.ts +24 -1
  34. package/src/cli/build/artifact.ts +95 -0
  35. package/src/cli/build/client.ts +103 -0
  36. package/src/cli/build/server.ts +526 -0
  37. package/src/cli/client-config.ts +141 -0
  38. package/src/cli/client-entry.ts +152 -0
  39. package/src/cli/client-plugin.ts +86 -16
  40. package/src/cli/codegen.ts +5 -5
  41. package/src/cli/command.ts +41 -9
  42. package/src/cli/control-client.ts +343 -0
  43. package/src/cli/deploy.ts +217 -0
  44. package/src/cli/dev.ts +43 -108
  45. package/src/cli/module-boundaries.ts +183 -0
  46. package/src/cli/{new-project.ts → new-app.ts} +86 -86
  47. package/src/cli/package-manager.ts +9 -9
  48. package/src/client/app.ts +15 -0
  49. package/src/client/errors.ts +1 -17
  50. package/src/client/index.ts +2 -0
  51. package/src/client/sync.ts +172 -120
  52. package/src/dev-runtime/database.ts +253 -96
  53. package/src/dev-runtime/dev-database.ts +14 -14
  54. package/src/dev-runtime/functions.ts +57 -88
  55. package/src/dev-runtime/id.ts +2 -10
  56. package/src/dev-runtime/migrations.ts +68 -0
  57. package/src/dev-runtime/sync.ts +266 -83
  58. package/src/internal/function-definition.ts +77 -0
  59. package/src/internal/host.ts +1 -0
  60. package/src/internal/http-paths.ts +3 -1
  61. package/dist/runtime/api-BXXIZc_Q.js.map +0 -1
  62. package/dist/runtime/result-B2W-z2wG.js.map +0 -1
  63. package/dist/runtime/schema-CNEVLF7D.js +0 -116
  64. package/dist/runtime/schema-CNEVLF7D.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. Hosted infrastructure is not included yet.
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 project contains a schema, a query, a mutation, and a
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
- App.tsx
26
- styles.css
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/App.tsx` uses the generated references to call the server functions.
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
- export default function App() {
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,12 @@ 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
+
145
161
  ## Keep working
146
162
 
147
163
  The dev server watches the schema and server modules, regenerates bindings, and reloads the app.