@protobase/cli 0.96.5 → 0.96.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.
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.96.5";
2
+ var version = "0.96.6";
3
3
  //#endregion
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/cli",
3
- "version": "0.96.5",
3
+ "version": "0.96.6",
4
4
  "description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -43,13 +43,13 @@
43
43
  "dependencies": {
44
44
  "@better-auth/core": "^1.7.12",
45
45
  "@hono/node-server": "^2.1.3",
46
- "@protobase/config": "0.96.5",
47
- "@protobase/layout": "0.96.5",
48
- "@protobase/query": "0.96.5",
49
- "@protobase/schema": "0.96.5",
50
- "@protobase/server": "0.96.5",
51
- "@protobase/ui": "0.96.5",
52
- "@protobase/workflows": "0.96.5",
46
+ "@protobase/config": "0.96.6",
47
+ "@protobase/layout": "0.96.6",
48
+ "@protobase/query": "0.96.6",
49
+ "@protobase/schema": "0.96.6",
50
+ "@protobase/server": "0.96.6",
51
+ "@protobase/ui": "0.96.6",
52
+ "@protobase/workflows": "0.96.6",
53
53
  "@react-email/render": "^2.1.0",
54
54
  "@scalar/hono-api-reference": "^0.12.10",
55
55
  "@sentry/vite-plugin": "^11.10.0",
@@ -39,7 +39,7 @@ Nothing in it has to change: its named component exports, `defineUi({ actions, s
39
39
 
40
40
  - **Modules of the shared packages.** `react`, `react/jsx-runtime`, `react-dom` and `@protobase/ui` come from the app, by those names. An import of another module of theirs, such as `react-dom/client` or a file inside `@protobase/ui`, fails the build: import from the package's main entry instead.
41
41
  - **Browser work at the top level.** The build loads `protobase.ui.tsx` once in Node to read its field types. Code that touches `window`, `document` or `localStorage` when a module loads fails the build; move it into a component, a hook or a handler.
42
- - **A data library of its own.** A component that used `@tanstack/react-query` directly found the app's query client while it was built into the app; as a plugin it carries its own copy, which does not. Read through `@protobase/ui`'s hooks (`useList`, `useRecord`, `useClient`), which share the app's cache and session.
42
+ - **A data library of its own.** A component that used `@tanstack/react-query` directly found the app's query client while it was built into the app; as a plugin it carries its own copy, which does not. Read through `@protobase/ui`'s hooks (`useList`, `useRecord`, `useClient`), which share the app's cache and session, or import `useQuery` and `useQueryClient` from `@protobase/ui` instead of `@tanstack/react-query`: they run on the app's client.
43
43
 
44
44
  ## 3. Check its styles
45
45
 
@@ -486,7 +486,7 @@ With a `mobile` section, the server serves the [mobile app](../guides/mobile-app
486
486
 
487
487
  An Android or iOS app built with `mobile.publicKey` updates itself from the server it calls, and never shows that it does. Launch waits on nothing: the app starts on the release it set next earlier, or its own files. The shell asks `GET /api/mobile/release` in the background each time the app comes back to the foreground and, while someone is signed in, once the app has drawn, every 15 minutes while it is in view and when the server's Protobase version changes under an open page. It downloads a release it does not run, only the files that changed, and runs it at the next cold start. The session stays in the device's cookie store, so the user stays signed in across the switch.
488
488
 
489
- - The splash screen stays up from launch until the shell has drawn, and covers each reload into a release until the release has drawn.
489
+ - The splash screen stays up from launch until the app draws past its loading screens, the sign-in check, `/meta` and the plugins, so someone signed in sees the page from the start cache as it goes. It covers each reload into a release the same way.
490
490
  - Right after someone signs in on the app, before it opens, the app takes the server's release and reloads into it, on the same page. Past 20 seconds it opens on the files it runs, and the download goes on for a later start or return.
491
491
  - Coming back to the foreground after 5 minutes or more away, the app reloads into a release it downloaded, then returns to the page and scroll position it showed. It does not while a guard holds unsaved changes on the page, or when it was away for less. The app shows no prompt that it was updated: a reload would only start the files it runs again, so it checks for the server's release instead. A push tapped while the app reloads opens its page once the release has drawn.
492
492
 
@@ -52,4 +52,4 @@ The app keeps what someone signed in last saw, from the moment they sign in, and
52
52
  - When the fresh data lands it replaces the cached data in place, and nothing moves.
53
53
  - When the refresh fails, such as without a network, the cached data stays muted and a warning replaces the spinner.
54
54
 
55
- The start cache holds who is signed in, the app's `/meta` and the latest answer of each query the app read. It has no time limit, only a soft limit of 4 MB: once the answers pass it, those used least recently are dropped, oldest first, until they are back under it. Who is signed in and `/meta` are never dropped. It lives in the browser's IndexedDB for the app's origin, or in the app's own storage on a phone. It is emptied when someone signs out, when the session ends and the API answers 401, and when a new Protobase version of the app opens. Visitors and staff signed in as someone keep nothing.
55
+ The start cache holds who is signed in, the app's `/meta` and the latest answer of each query the app read. It has no time limit, only a soft limit of 4 MB: once the answers pass it, those used least recently are dropped, oldest first, until they are back under it. Who is signed in, `/meta` and the answers of the page on screen when it saves are never dropped, so the next start draws that page whole: the cache can pass 4 MB by that one page. A table embedded in a page reads only the fields it shows, which keeps the page small, unless its actions run on selected rows: those get whole records. It lives in the browser's IndexedDB for the app's origin, or in the app's own storage on a phone. It is emptied when someone signs out, when the session ends and the API answers 401, and when a new Protobase version of the app opens. Visitors and staff signed in as someone keep nothing.
@@ -72,7 +72,7 @@ export default definePlugin({ name: 'sales-tools', actions: { remindCustomer } }
72
72
 
73
73
  It is written as a project's `protobase.ui.tsx` is: each component exported under the PascalCase name the config declares, from a file of its own, and the rest in the default export, `definePlugin({ name, actions, fields, shell, beforeSignIn, extends, ... })` (`defineUi` is the same function), with the keys of [Extension points](#extension-points). Its components use the hooks and components of `@protobase/ui`, which read the API as the signed-in user, under the same access rules as everything else.
74
74
 
75
- **Imports.** `react`, `react/jsx-runtime` (the JSX), `react-dom` and `@protobase/ui`, by those names, come from the app. Everything else a plugin imports, its own files, icons or a chart library, is built into it. Other modules of those packages, such as `react-dom/client` or a file inside `@protobase/ui`, fail the build: a copy of its own would not work with the app's. Read data with `@protobase/ui`'s hooks (`useList`, `useRecord`, `useClient`), which share the app's cache: a data library of the plugin's own keeps a cache of its own.
75
+ **Imports.** `react`, `react/jsx-runtime` (the JSX), `react-dom` and `@protobase/ui`, by those names, come from the app. Everything else a plugin imports, its own files, icons or a chart library, is built into it. Other modules of those packages, such as `react-dom/client` or a file inside `@protobase/ui`, fail the build: a copy of its own would not work with the app's. Read data with `@protobase/ui`'s hooks (`useList`, `useRecord`, `useClient`), which share the app's cache: a data library of the plugin's own keeps a cache of its own. For anything else, such as another API's answer, `useQuery` and `useQueryClient` from `@protobase/ui` are TanStack Query's, on the app's own client, so their answers are kept in the [start cache](installable-app.md#starting-from-the-last-pages-seen) and draw on the next start before the network answers.
76
76
 
77
77
  **Styling.** Use Tailwind classes, as the app's own code does. The plugin's stylesheet holds the utilities its files use and nothing else, no reset and no global style, and each reads the app's [tokens](theme.md): `bg-primary` is the app's primary color and `rounded-md` its radius, whatever the app's version and whatever its theme, and a token the app does not set falls back to Tailwind's default.
78
78