@protobase/cli 0.57.4 → 0.57.5
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,13 +1,18 @@
|
|
|
1
1
|
import { checkMobileConfig } from "../mobile/mobile-config.js";
|
|
2
2
|
//#region src/build/bundle-mobile.ts
|
|
3
3
|
/**
|
|
4
|
-
* What the manifest says of the config's `mobile` section, checked as `protobase mobile` checks it: its
|
|
5
|
-
*
|
|
4
|
+
* What the manifest says of the config's `mobile` section, checked as `protobase mobile` checks it: its app id, which a
|
|
5
|
+
* host that never runs the config binds in the release's statement, and its plugins, empty when it gives none, which it
|
|
6
|
+
* fingerprints the mobile release with. `undefined`
|
|
6
7
|
* without a section, so its presence means the app has a mobile build.
|
|
7
8
|
*/
|
|
8
9
|
const bundleMobile = (section) => {
|
|
9
10
|
if (section === void 0) return;
|
|
10
|
-
|
|
11
|
+
const { appId, plugins } = checkMobileConfig(section);
|
|
12
|
+
return {
|
|
13
|
+
appId,
|
|
14
|
+
plugins: plugins ?? {}
|
|
15
|
+
};
|
|
11
16
|
};
|
|
12
17
|
//#endregion
|
|
13
18
|
export { bundleMobile };
|
package/dist/bundle/manifest.js
CHANGED
|
@@ -32,7 +32,7 @@ const parseManifest = (value, file) => {
|
|
|
32
32
|
if (builtAt !== void 0 && !isTime(builtAt)) throw new Error(`${file} has a builtAt that is no time in ms`);
|
|
33
33
|
if (icons !== void 0 && !isIcons(icons)) throw new Error(`${file} has icons that are not a favicon flag and a list of PNG icons`);
|
|
34
34
|
if (native !== void 0 && !isVersions(native)) throw new Error(`${file} has a native that is not a map of package names to versions`);
|
|
35
|
-
if (mobile !== void 0 && !(isObject(mobile) && isVersions(mobile.plugins))) throw new Error(`${file} has a mobile that is not { plugins } with a map of package names to versions`);
|
|
35
|
+
if (mobile !== void 0 && !(isObject(mobile) && isVersions(mobile.plugins) && (mobile.appId === void 0 || typeof mobile.appId === "string"))) throw new Error(`${file} has a mobile that is not { appId, plugins } with an app id and a map of package names to versions`);
|
|
36
36
|
if (nodeModules !== void 0 && typeof nodeModules !== "string") throw new Error(`${file} has a nodeModules that is no path`);
|
|
37
37
|
if (migrations !== void 0 && typeof migrations !== "string") throw new Error(`${file} has a migrations that is no path`);
|
|
38
38
|
return {
|
package/dist/cli/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.57.
|
|
3
|
+
"version": "0.57.5",
|
|
4
4
|
"description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@better-auth/core": "^1.7.12",
|
|
44
44
|
"@hono/node-server": "^2.1.3",
|
|
45
|
-
"@protobase/config": "0.57.
|
|
46
|
-
"@protobase/layout": "0.57.
|
|
47
|
-
"@protobase/query": "0.57.
|
|
48
|
-
"@protobase/schema": "0.57.
|
|
49
|
-
"@protobase/server": "0.57.
|
|
50
|
-
"@protobase/ui": "0.57.
|
|
45
|
+
"@protobase/config": "0.57.5",
|
|
46
|
+
"@protobase/layout": "0.57.5",
|
|
47
|
+
"@protobase/query": "0.57.5",
|
|
48
|
+
"@protobase/schema": "0.57.5",
|
|
49
|
+
"@protobase/server": "0.57.5",
|
|
50
|
+
"@protobase/ui": "0.57.5",
|
|
51
51
|
"@react-email/render": "^2.1.0",
|
|
52
52
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
53
53
|
"@tailwindcss/vite": "^4.3.3",
|
|
@@ -211,7 +211,7 @@ By default the bundle runs on Node and on Bun. `--bun` makes it a bundle for Bun
|
|
|
211
211
|
],
|
|
212
212
|
"shell": { "protobase": "0.12.0", "pluginApi": 1, "paths": ["/index.html", "/assets", "/protobase.sw.js"] },
|
|
213
213
|
"native": { "@capacitor/core": "8.5.3", "@capacitor/ios": "8.5.3" },
|
|
214
|
-
"mobile": { "plugins": { "@capacitor/camera": "^8.0.1" } },
|
|
214
|
+
"mobile": { "appId": "com.example.shop", "plugins": { "@capacitor/camera": "^8.0.1" } },
|
|
215
215
|
"nodeModules": "node_modules",
|
|
216
216
|
"migrations": "migrations"
|
|
217
217
|
}
|
|
@@ -222,7 +222,7 @@ By default the bundle runs on Node and on Bun. `--bun` makes it a bundle for Bun
|
|
|
222
222
|
- `plugins` are the bundle's own plugins, in the order the app merges them: the extensions', then the project's (`app`). Each names its `plugin.json`, the plugin API and Protobase versions it is built for, and the [field types](plugins.md#field-types) it registers with the storage types each shows, which the serve runtime checks the views against at startup. `/api/meta` names them to everyone, before any other plugin.
|
|
223
223
|
- `shell` is the admin app `public/` holds a copy of: its Protobase version and plugin API, and its files as URL paths. A host with a shell of its own may serve its own for those paths instead (see [The UI](#the-ui)), so the app gets that release's fixes without a rebuild.
|
|
224
224
|
- `native` is the native code, name to version, that `shell` runs on in the [mobile app](../guides/mobile-app.md): the native packages `@protobase/mobile` pins, and `@protobase/mobile` itself at its native contract, such as `native-1`, which Protobase raises when its own native code changes. The fingerprint of the bundle's [mobile release](#mobile-releases) names them. A bundle built before it serves no mobile release.
|
|
225
|
-
- `mobile` is present only when the project's config has a `mobile` section, so a host learns that the app has a mobile build without running the config: the section's `plugins`, name to the spec it gives, `{}` when it gives none, which the fingerprint of the mobile release names besides `native`. The build checks the section as `protobase mobile` does.
|
|
225
|
+
- `mobile` is present only when the project's config has a `mobile` section, so a host learns that the app has a mobile build without running the config: the section's `appId`, which the statement of a signed mobile release binds, and its `plugins`, name to the spec it gives, `{}` when it gives none, which the fingerprint of the mobile release names besides `native`. A bundle built before it names no `appId`. The build checks the section as `protobase mobile` does.
|
|
226
226
|
- `theme` is the project's [theme](theme.md), which the app links at `/protobase.theme.css`. It is always there, empty when the project has none.
|
|
227
227
|
- `nodeModules` is present only when the config module imports [native packages](#native-packages). It is always the `node_modules` folder beside `server`, where Bun and Node resolve the module's imports from, and holds plain packages: JavaScript, `package.json` files and native binaries for linux x64 and arm64 (glibc), which the runtime loads with `dlopen`. A host keeps it next to the server module and must not mount it `noexec` (an add-on there then fails with `failed to map segment from shared object`). Its binaries link nothing but glibc, `libstdc++.so.6`, `libgcc_s.so.1` and libraries in the bundle itself, so the run image must have those three. Without `nodeModules`, the server module is the only file the runtime reads.
|
|
228
228
|
- `migrations` is present only when the project has a `db/migrations` folder: its `.sql` files, which the runtime's `migrate` applies (see [Deploy](../guides/deploy.md)). A host never serves it.
|
|
@@ -447,7 +447,7 @@ A host that serves bundles without running their config, such as a router in fro
|
|
|
447
447
|
|
|
448
448
|
- `nativeFingerprint(native, plugins)`: the release's fingerprint, from the manifest's `native` (or that of the shell the host serves) and `mobile.plugins`. It is a contract across versions: a binary one Protobase release built is matched by a host that runs another.
|
|
449
449
|
- `withApiOrigin(html, origin)`: the `spa` page naming the API origin, the app's `url`.
|
|
450
|
-
- `composeRelease(files, signing?)`: the release of `{ href, content }` files, every file the host serves the web with the page above in place of `spa`, with its id and, with `signing`, `{ key, binding: { order, appId, fingerprint, shellVersion } }`, the signed checksums and statement.
|
|
450
|
+
- `composeRelease(files, signing?)`: the release of `{ href, content }` files, every file the host serves the web with the page above in place of `spa`, with its id and, with `signing`, `{ key, binding: { order, appId, fingerprint, shellVersion } }`, `appId` the manifest's `mobile.appId`, the signed checksums and statement.
|
|
451
451
|
- `readSigningKey(env)`: the signing key in `PROTOBASE_MOBILE_SIGNING_KEY` of the env object given, the app's own, never the process's.
|
|
452
452
|
- `mobileReleaseApp({ release, serverVersion })`: a Hono app answering the two routes above for `{ ...release, fingerprint, origin }`.
|
|
453
453
|
|