@protobase/cli 0.45.11 → 0.45.13
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/dist/cli/package.js +1 -1
- package/dist/mobile/capacitor-config.js +19 -9
- package/dist/mobile/package.js +1 -0
- package/package.json +6 -6
- package/skills/protobase/references/guides/mobile-app.md +1 -1
- package/skills/protobase/references/reference/client.md +1 -1
- package/skills/protobase/references/reference/layouts.md +1 -1
package/dist/cli/package.js
CHANGED
|
@@ -3,24 +3,34 @@ import { rm, writeFile } from "node:fs/promises";
|
|
|
3
3
|
import { capacitorOrigin } from "@protobase/schema/internal";
|
|
4
4
|
//#region src/mobile/capacitor-config.ts
|
|
5
5
|
const protobasePlugin = "@protobase/mobile";
|
|
6
|
+
const keyboardPlugin = "@capacitor/keyboard";
|
|
6
7
|
/**
|
|
7
8
|
* The app's `capacitor.config.json`, every key it sets named here. It never sets `server.url`, the hostname or the
|
|
8
9
|
* schemes (the API's CORS list names Capacitor's default origins), or WebView debugging (on in debug builds only).
|
|
9
|
-
* `plugins` configures ProtobaseAuth alone, so CapacitorHttp and CapacitorCookies stay off
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* `plugins` configures ProtobaseAuth and the keyboard plugin alone, so CapacitorHttp and CapacitorCookies stay off;
|
|
11
|
+
* the keyboard plugin resizes natively, its default, and fills the space beside the keyboard's rounded corners with the
|
|
12
|
+
* page's background instead of black. Protobase's plugin is compiled in last, so its stand-ins replace any plugin of
|
|
13
|
+
* the same name. Service workers get nothing from the local server on Android, which they would reach past the
|
|
14
|
+
* WebViewClient that guards it. The file ships outside the app's web part, so the fingerprint in the user agent and
|
|
15
|
+
* ProtobaseAuth's origins are beyond page script and a live update.
|
|
13
16
|
*/
|
|
14
17
|
const capacitorConfig = ({ appId, appName, fingerprint, plugins, allowances, apiOrigin, platform }) => ({
|
|
15
18
|
appId,
|
|
16
19
|
appName,
|
|
17
20
|
webDir: "web",
|
|
18
21
|
appendUserAgent: `ProtobaseNative/${fingerprint}`,
|
|
19
|
-
includePlugins: [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
includePlugins: [
|
|
23
|
+
...plugins,
|
|
24
|
+
keyboardPlugin,
|
|
25
|
+
protobasePlugin
|
|
26
|
+
],
|
|
27
|
+
plugins: {
|
|
28
|
+
ProtobaseAuth: {
|
|
29
|
+
apiOrigin,
|
|
30
|
+
origin: capacitorOrigin[platform]
|
|
31
|
+
},
|
|
32
|
+
Keyboard: { autoBackdropColor: "dom" }
|
|
33
|
+
},
|
|
24
34
|
...allowances.cleartext && { server: { cleartext: true } },
|
|
25
35
|
android: {
|
|
26
36
|
resolveServiceWorkerRequests: false,
|
package/dist/mobile/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.45.
|
|
3
|
+
"version": "0.45.13",
|
|
4
4
|
"description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"@better-auth/core": "^1.7.12",
|
|
37
37
|
"@hono/node-server": "^2.1.3",
|
|
38
38
|
"@hono/vite-dev-server": "^0.26.1",
|
|
39
|
-
"@protobase/layout": "0.45.
|
|
40
|
-
"@protobase/query": "0.45.
|
|
41
|
-
"@protobase/schema": "0.45.
|
|
42
|
-
"@protobase/server": "0.45.
|
|
43
|
-
"@protobase/ui": "0.45.
|
|
39
|
+
"@protobase/layout": "0.45.13",
|
|
40
|
+
"@protobase/query": "0.45.13",
|
|
41
|
+
"@protobase/schema": "0.45.13",
|
|
42
|
+
"@protobase/server": "0.45.13",
|
|
43
|
+
"@protobase/ui": "0.45.13",
|
|
44
44
|
"@react-email/render": "^2.1.0",
|
|
45
45
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
46
46
|
"@tailwindcss/vite": "^4.3.3",
|
|
@@ -31,7 +31,7 @@ export default defineConfig({
|
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
- `appId` is the app's id in reverse-DNS form, the same on iOS and Android: at least two parts separated by dots, each starting with a letter and holding only letters and digits. Underscores and hyphens are refused, as iOS rejects underscores and Android rejects hyphens; `protobase mobile` stops early on such an id and suggests one without them.
|
|
34
|
-
- `plugins`, optional, are extra native [Capacitor plugins](https://capacitorjs.com/docs/plugins), npm name to version. Capacitor itself, `@capacitor/app`, `@capacitor/splash-screen` and `@capawesome/capacitor-live-update` come with Protobase at fixed versions and cannot be listed. A plugin runs native code with the app's rights, and one that writes files, such as `@capacitor/filesystem`, lets a script that got into the page point the iOS app at files it wrote (with Capacitor's own `WebView.setServerBasePath`), so list only plugins the app needs. On Android a plugin's JavaScript cannot call `CapacitorHttp`, `CapacitorCookies` or `WebView`, and `Capacitor.convertFileSrc` URLs do not load: call those from the plugin's native code.
|
|
34
|
+
- `plugins`, optional, are extra native [Capacitor plugins](https://capacitorjs.com/docs/plugins), npm name to version. Capacitor itself, `@capacitor/app`, `@capacitor/keyboard`, `@capacitor/splash-screen` and `@capawesome/capacitor-live-update` come with Protobase at fixed versions and cannot be listed. A plugin runs native code with the app's rights, and one that writes files, such as `@capacitor/filesystem`, lets a script that got into the page point the iOS app at files it wrote (with Capacitor's own `WebView.setServerBasePath`), so list only plugins the app needs. On Android a plugin's JavaScript cannot call `CapacitorHttp`, `CapacitorCookies` or `WebView`, and `Capacitor.convertFileSrc` URLs do not load: call those from the plugin's native code.
|
|
35
35
|
|
|
36
36
|
The app is installed under the name it shows in its upper left, on iOS and Android alike: `protobase mobile` reads it from the server the app calls (its web manifest), so a `PROTOBASE_APP_NAME` the server runs with names the app on the phone too. When that server cannot be reached, `run` and `open` warn and take the project's own name, `appName` or `PROTOBASE_APP_NAME` in its environment, and `build` stops.
|
|
37
37
|
|
|
@@ -23,7 +23,7 @@ With an absolute `baseUrl`, such as another app's `https://desk.example.com/api/
|
|
|
23
23
|
|
|
24
24
|
## The admin app
|
|
25
25
|
|
|
26
|
-
`<App baseUrl="/api/v1" />` renders the shell from `/api/meta` (beside the API, so `createClient` derives it from `baseUrl`) and routes `/:page` ([composed pages](layouts.md)), `/:resource` (list) and `/:resource/:key` (record); it opens on the first
|
|
26
|
+
`<App baseUrl="/api/v1" />` renders the shell from `/api/meta` (beside the API, so `createClient` derives it from `baseUrl`) and routes `/:page` ([composed pages](layouts.md)), `/:resource` (list) and `/:resource/:key` (record); it opens on the first entry of the [sidebar](sidebar.md) the user sees, or, with none, the first page or resource. Its own pages sit under `/-/`, which no page or resource name takes: `/-/account` (the user's passkeys and two-factor authentication) and `/-/sign-in-policy` (admins: the policy, and the log of staff sign-ins). Before the shell, it signs in on its sign-in route, `/-/sign-in`, with the methods the server offers and asks for what the [sign-in policy](auth.md#sign-in-policy) requires. Someone signed out goes there from any page, with that page in `?next=`, and signing in comes back to it; each step (a forgotten password, an emailed code, making an account) adds `?step=`, so the browser's Back returns to the step before; `?staff-sign-in` opens the [staff sign-in](auth.md#staff-sign-in) page instead, and a staff session gets a banner below the top bar. `createAuthSession` from `@protobase/client` is that session (`signIn`, `signInWithCode`, `signInWithPasskey`, `verifyTwoFactor`, `account`, `signInPolicy`, `staff`). `ui` takes the project's [custom components and action handlers](custom-components.md). The list state lives in the URL: `?list=`, a [named list](ui-config.md#more-than-one-list), `?filter=` (AIP-160), `?order_by=`, `?display=`, the [display](ui-config.md#list-displays) it shows, `?layout=panel`, the filters in a panel beside the table on a desktop instead of a bar above it, `?map=52.37,4.89,12`, where a [map](ui-config.md#maps) looks, `?calendar=month,2026-10-01`, the month or week a [calendar](ui-config.md#calendars) shows, `?timeline=quarter,2026-10-01`, the week, month or quarter a [timeline](ui-config.md#timelines) shows, and `?saved_search=`, the [saved search](ui-config.md#saved-searches) the list was opened from. Views come from `examples/*/config/*/ui.ts`. The sidebar's recent-record groups and the user menu are configured there too: see [Sidebar](sidebar.md), [User menu](user-menu.md) and [Bottom bar](bottom-bar.md).
|
|
27
27
|
|
|
28
28
|
## Global search
|
|
29
29
|
|
|
@@ -29,7 +29,7 @@ The comment makes `@protobase/layout/jsx-runtime` compile the file instead of Re
|
|
|
29
29
|
| `options.icon` | One of the [user menu icons](user-menu.md), or `layout-dashboard` (the default). |
|
|
30
30
|
| `options.roles` | Only users with one of these roles get the page. Without it, everyone who can sign in does. |
|
|
31
31
|
|
|
32
|
-
A page can also sit in the [user menu](user-menu.md) with `m.page(name)`; it then leaves the sidebar. The first page
|
|
32
|
+
A page can also sit in the [user menu](user-menu.md) with `m.page(name)`; it then leaves the sidebar. The admin opens on the first entry of the sidebar as the user sees it, so on the first page there in `nav.order`, not the first page the config exports: a config module's exports are in alphabetical order.
|
|
33
33
|
|
|
34
34
|
## The element tree
|
|
35
35
|
|