@protobase/cli 0.45.12 → 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
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
|
|