@protobase/cli 0.45.7 → 0.45.8

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.45.7";
2
+ var version = "0.45.8";
3
3
  //#endregion
4
4
  export { version };
@@ -0,0 +1,16 @@
1
+ //#region src/mobile/app-plugins-hook.ts
2
+ /** The Capacitor hooks, scripts in the workspace's package.json, run after `cap copy` and `cap update`; `add` and `sync` run both. */
3
+ const appPluginsHooks = ["capacitor:copy:after", "capacitor:update:after"];
4
+ /** Where each platform's native project keeps the app's files, as Capacitor copies them from the web part. */
5
+ const nativeWebDirs = {
6
+ ios: "ios/App/App/public",
7
+ android: "android/app/src/main/assets/public"
8
+ };
9
+ /**
10
+ * The hook's command: copies the web part's `plugins/`, the app's own UI plugins, back into the platform's files.
11
+ * Capacitor keeps `plugins/` for Cordova plugins and removes it on every copy and update, so without this the app finds
12
+ * no plugin.json at `/plugins/<name>/` and turns its plugins off. Single quotes only, for any shell npm scripts run in.
13
+ */
14
+ const appPluginsCommand = `node -e "const fs=require('fs');const to={${Object.entries(nativeWebDirs).map(([platform, dir]) => `${platform}:'${dir}'`).join(",")}}[process.env.CAPACITOR_PLATFORM_NAME];if(to&&fs.existsSync('web/plugins'))fs.cpSync('web/plugins',to+'/plugins',{recursive:true})"`;
15
+ //#endregion
16
+ export { appPluginsCommand, appPluginsHooks, nativeWebDirs };
@@ -1,6 +1,7 @@
1
1
  import { protobaseVersion } from "../version/version.js";
2
2
  import { protobaseFolder } from "../project/protobase-folder.js";
3
3
  import { packageNameProblem } from "./package-name.js";
4
+ import { appPluginsCommand, appPluginsHooks } from "./app-plugins-hook.js";
4
5
  import { isLocalSpec } from "./local-spec.js";
5
6
  import { checkLocalPins, isUnmet, localPins } from "./local-pins.js";
6
7
  import { existsSync } from "node:fs";
@@ -13,9 +14,10 @@ const workspaceDir = (projectDir) => path.join(projectDir, protobaseFolder, "mob
13
14
  const fromSource = path.extname(import.meta.url) === ".ts";
14
15
  /** The @protobase/mobile to install: the CLI's own version, or this repository's package when the CLI runs from source. */
15
16
  const mobileSpec = (source = fromSource) => source ? `file:${fileURLToPath(new URL("../../../mobile", import.meta.url))}` : protobaseVersion;
16
- /** The workspace's package.json: @protobase/mobile and the project's extra plugins. */
17
+ /** The workspace's package.json: @protobase/mobile, the project's extra plugins and the hooks that keep the app's UI plugins. */
17
18
  const workspacePackageJson = ({ mobileSpec, plugins = {} }) => ({
18
19
  private: true,
20
+ scripts: Object.fromEntries(appPluginsHooks.map((hook) => [hook, appPluginsCommand])),
19
21
  dependencies: {
20
22
  "@protobase/mobile": mobileSpec,
21
23
  ...plugins
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/cli",
3
- "version": "0.45.7",
3
+ "version": "0.45.8",
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.7",
40
- "@protobase/query": "0.45.7",
41
- "@protobase/schema": "0.45.7",
42
- "@protobase/server": "0.45.7",
43
- "@protobase/ui": "0.45.7",
39
+ "@protobase/layout": "0.45.8",
40
+ "@protobase/query": "0.45.8",
41
+ "@protobase/schema": "0.45.8",
42
+ "@protobase/server": "0.45.8",
43
+ "@protobase/ui": "0.45.8",
44
44
  "@react-email/render": "^2.1.0",
45
45
  "@scalar/hono-api-reference": "^0.12.10",
46
46
  "@tailwindcss/vite": "^4.3.3",
@@ -163,4 +163,4 @@ Put `dist/` on a static host, and list its `plugin.json` in the deployed app's `
163
163
 
164
164
  The app updates to a new release of Protobase. Nothing happens to the plugin: within plugin API 1, every release keeps what the plugin imports, and the plugin runs on the newer `@protobase/ui` it is handed, its fixes included.
165
165
 
166
- If the app were older than the plugin needs, it would not load the plugin at all. Its admins would see a notice above the app, such as "The plugin sales-tools is off: it needs Protobase >=0.12.0, and this app runs 0.11.1.", and the card would show a warning in place of the drafts, while the rest of the app works as before. [Versions](../reference/plugins.md#versions) has the rules.
166
+ If the app were older than the plugin needs, it would not load the plugin at all. Its admins would see a notice below the top bar, such as "The plugin sales-tools is off: it needs Protobase >=0.12.0, and this app runs 0.11.1.", and the card would show a warning in place of the drafts, while the rest of the app works as before. [Versions](../reference/plugins.md#versions) has the rules.
@@ -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 page, or the first 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 above the shell. `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).
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 page, or the first 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
 
@@ -307,7 +307,7 @@ Nothing a plugin does stops the app. Each of these turns off that plugin alone:
307
307
  - its module cannot be loaded, or does not link: it imports something the app's `@protobase/ui` does not have;
308
308
  - it defines a name an earlier plugin defines.
309
309
 
310
- Every place it would fill then draws its fallback (see [Extension points](#extension-points)). The app's admins (the `admin` role) see a notice above the app naming each plugin that is off and why, such as "The plugin sales-tools is off: it needs Protobase >=0.12.3, and this app runs 0.12.1." Everyone else sees only the fallbacks. An action handler that throws shows its error in a toast, as a project's does, and a part that throws while drawing shows its fallback in its own place.
310
+ Every place it would fill then draws its fallback (see [Extension points](#extension-points)). The app's admins (the `admin` role) see a notice below the top bar naming each plugin that is off and why, such as "The plugin sales-tools is off: it needs Protobase >=0.12.3, and this app runs 0.12.1." Everyone else sees only the fallbacks. An action handler that throws shows its error in a toast, as a project's does, and a part that throws while drawing shows its fallback in its own place.
311
311
 
312
312
  ## API
313
313