@protobase/cli 0.45.0 → 0.45.1
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
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
//#region src/mobile/fingerprint.ts
|
|
3
3
|
/**
|
|
4
|
-
* Names the app's native code:
|
|
5
|
-
* project's `mobile.plugins`, name → the spec it gives. A release of the
|
|
6
|
-
* fingerprint. It holds no Protobase version, so a Protobase release that
|
|
7
|
-
* binaries on live updates. A plugin's spec counts, not the
|
|
8
|
-
* need of it, so raise the floor when they start using a
|
|
4
|
+
* Names the app's native code: what @protobase/mobile carries, name → version (`pinnedNative`: the native packages it
|
|
5
|
+
* pins and its own native contract), and the project's `mobile.plugins`, name → the spec it gives. A release of the
|
|
6
|
+
* app's files runs only on a binary of the same fingerprint. It holds no Protobase version, so a Protobase release that
|
|
7
|
+
* pins the same native packages and native contract keeps binaries on live updates. A plugin's spec counts, not the
|
|
8
|
+
* version npm installed: its floor is what the app's files need of it, so raise the floor when they start using a
|
|
9
|
+
* newer native feature, which changes the fingerprint.
|
|
9
10
|
*/
|
|
10
11
|
const nativeFingerprint = (pinned, plugins = {}) => {
|
|
11
12
|
const entries = Object.entries({
|
package/dist/mobile/package.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
//#region ../mobile/package.json
|
|
2
2
|
var name = "@protobase/mobile";
|
|
3
|
+
var nativeContract = 1;
|
|
3
4
|
var dependencies = {
|
|
4
5
|
"@capacitor/android": "8.5.3",
|
|
5
6
|
"@capacitor/app": "8.1.2",
|
|
@@ -10,4 +11,4 @@ var dependencies = {
|
|
|
10
11
|
"@capawesome/capacitor-live-update": "8.7.1"
|
|
11
12
|
};
|
|
12
13
|
//#endregion
|
|
13
|
-
export { dependencies, name };
|
|
14
|
+
export { dependencies, name, nativeContract };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dependencies, name } from "./package.js";
|
|
1
|
+
import { dependencies, name, nativeContract } from "./package.js";
|
|
2
2
|
import { installedPackage } from "./installed-package.js";
|
|
3
3
|
//#region src/mobile/pinned-packages.ts
|
|
4
4
|
/**
|
|
@@ -8,10 +8,15 @@ import { installedPackage } from "./installed-package.js";
|
|
|
8
8
|
*/
|
|
9
9
|
const pinnedPackages = /* @__PURE__ */ new Set([name, ...Object.keys(dependencies)]);
|
|
10
10
|
/**
|
|
11
|
-
* The native
|
|
12
|
-
*
|
|
11
|
+
* The native code an app's binary carries from @protobase/mobile, name → version, which a native fingerprint names:
|
|
12
|
+
* the native packages it pins, at their versions, and its own native code by its `nativeContract`, `native-<n>`. Never
|
|
13
|
+
* its npm version, which is Protobase's: every Protobase release would cut the binaries off updates. Raise
|
|
14
|
+
* `nativeContract` whenever its Android (later iOS) sources change; its test fails until it is.
|
|
13
15
|
*/
|
|
14
|
-
const pinnedNative =
|
|
16
|
+
const pinnedNative = {
|
|
17
|
+
...Object.fromEntries(Object.entries(dependencies).filter(([name]) => !name.startsWith("@protobase/"))),
|
|
18
|
+
[name]: `native-${nativeContract}`
|
|
19
|
+
};
|
|
15
20
|
const liveUpdate = "@capawesome/capacitor-live-update";
|
|
16
21
|
/** Why the plugin `key`, a package that is or names `name`, may not be listed; `undefined` when it may. */
|
|
17
22
|
const pinnedProblem = (key, name = key) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.45.
|
|
3
|
+
"version": "0.45.1",
|
|
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.1",
|
|
40
|
+
"@protobase/query": "0.45.1",
|
|
41
|
+
"@protobase/schema": "0.45.1",
|
|
42
|
+
"@protobase/server": "0.45.1",
|
|
43
|
+
"@protobase/ui": "0.45.1",
|
|
44
44
|
"@react-email/render": "^2.1.0",
|
|
45
45
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
46
46
|
"@tailwindcss/vite": "^4.3.3",
|
|
@@ -234,7 +234,7 @@ By default the bundle runs on Node and on Bun. `--bun` makes it a bundle for Bun
|
|
|
234
234
|
- `server`, `public`, `nodeModules` and `migrations` are relative to the bundle folder; `spa`, `theme` and each plugin's `path` to `public`.
|
|
235
235
|
- `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.
|
|
236
236
|
- `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, of a release every plugin of the bundle loads in, may serve its own for those paths instead (see [The UI](#the-ui)), so the app gets that release's fixes without a rebuild.
|
|
237
|
-
- `native` is the native
|
|
237
|
+
- `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.
|
|
238
238
|
- `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.
|
|
239
239
|
- `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.
|
|
240
240
|
- `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.
|
|
@@ -551,7 +551,7 @@ Builds the project in the current directory as an iOS or Android app with Capaci
|
|
|
551
551
|
- `build` makes a signed release, an `.aab` (Android) or `.ipa` (iOS), and copies it to `--out`, which ignores itself in git when the command creates it, as `<appId>-<version>-<build number>`. Android signs through Gradle with the keystore, alias and passwords in `PROTOBASE_ANDROID_KEYSTORE`, `PROTOBASE_ANDROID_KEY_ALIAS`, `PROTOBASE_ANDROID_KEYSTORE_PASSWORD` and `PROTOBASE_ANDROID_KEY_PASSWORD`; iOS runs Capacitor's build with `--team`, and `--certificate` with `--profile` for manual signing.
|
|
552
552
|
- A release calls an https server that is not this machine, and `--app-version` (one to three numbers) and `--build-number` (1 to 2100000000) are required.
|
|
553
553
|
- npm and Capacitor get the CLI's environment without any variable named in the current directory's `.env*` files, nor the four `PROTOBASE_ANDROID_*` signing variables, which only Gradle gets, and with `CI=true`, which keeps Capacitor's telemetry off.
|
|
554
|
-
- It prints the workspace, the API origin and the native fingerprint, which the app also sends in its user agent as `ProtobaseNative/<fingerprint>`: a hash of the native packages `@protobase/mobile` pins, at their versions, and the section's `plugins`, at the versions they give. A [mobile release](#mobile-releases) runs only on a binary of its own fingerprint. A Protobase release that pins the same native packages keeps it; raise a plugin's version when the app's files start using a newer native feature of it, which changes it.
|
|
554
|
+
- It prints the workspace, the API origin and the native fingerprint, which the app also sends in its user agent as `ProtobaseNative/<fingerprint>`: a hash of the native packages `@protobase/mobile` pins, at their versions, its own native contract, and the section's `plugins`, at the versions they give. A [mobile release](#mobile-releases) runs only on a binary of its own fingerprint. A Protobase release that pins the same native packages and keeps the same native contract keeps it; raise a plugin's version when the app's files start using a newer native feature of it, which changes it.
|
|
555
555
|
- The app's files carry the live updater's manifest of them, so an update downloads only the files that changed.
|
|
556
556
|
|
|
557
557
|
## `token`
|