@protobase/cli 0.79.1 → 0.79.3

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.79.1";
2
+ var version = "0.79.3";
3
3
  //#endregion
4
4
  export { version };
package/dist/main.js CHANGED
@@ -152,6 +152,8 @@ program.command("build-serve").description("Bundle the serve runtime into one fi
152
152
  program.command("serve").description("Serve a bundle written by `protobase build` until SIGTERM or SIGINT: a folder as a host serves it, a config module as its API alone").argument("<bundle>", "the bundle folder, e.g. dist, or its dist/protobase.config.js").action(async (bundle) => {
153
153
  loadNearestEnvFile(process.cwd());
154
154
  warn(placeholderSecretWarning(process.env));
155
+ const { provideHostModules } = await import("./serve/host-modules.js");
156
+ provideHostModules();
155
157
  if (statSync(bundle).isDirectory()) await (await import("./serve/serve-dir.js")).serveBundleDir(bundle, process.env, out);
156
158
  else await (await import("./serve/serve-bundle.js")).serveBundle(bundle, process.env, out);
157
159
  });
@@ -8,13 +8,14 @@ import { appNameOver } from "@protobase/server";
8
8
  * `extensions`: its mobile section, unchecked, whether it has `notifications()`, and with sign-in on the app's URL, its
9
9
  * tokens' issuer, and its name.
10
10
  * The project's .env is loaded first, as other commands do, and no `PROTOBASE_ANDROID_*` variable is left in the
11
- * environment; nothing but the configs runs.
11
+ * environment; nothing but the configs runs. A config function is called with `command: 'build'`, as for the deploy bundle
12
+ * the app's files come from, so the binary's fingerprint and that bundle's manifest name the same `notifications()`.
12
13
  */
13
14
  const loadMobileProject = async (dir, extensions) => {
14
15
  loadNearestEnvFile(dir);
15
16
  dropAndroidSigning(process.env);
16
17
  const { mobile, auth, url, name, notifications } = await loadSourceConfig(dir, {
17
- command: "tool",
18
+ command: "build",
18
19
  extensions
19
20
  });
20
21
  const appName = appNameOver(process.env, name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/cli",
3
- "version": "0.79.1",
3
+ "version": "0.79.3",
4
4
  "description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -43,13 +43,13 @@
43
43
  "dependencies": {
44
44
  "@better-auth/core": "^1.7.12",
45
45
  "@hono/node-server": "^2.1.3",
46
- "@protobase/config": "0.79.1",
47
- "@protobase/layout": "0.79.1",
48
- "@protobase/query": "0.79.1",
49
- "@protobase/schema": "0.79.1",
50
- "@protobase/server": "0.79.1",
51
- "@protobase/ui": "0.79.1",
52
- "@protobase/workflows": "0.79.1",
46
+ "@protobase/config": "0.79.3",
47
+ "@protobase/layout": "0.79.3",
48
+ "@protobase/query": "0.79.3",
49
+ "@protobase/schema": "0.79.3",
50
+ "@protobase/server": "0.79.3",
51
+ "@protobase/ui": "0.79.3",
52
+ "@protobase/workflows": "0.79.3",
53
53
  "@react-email/render": "^2.1.0",
54
54
  "@scalar/hono-api-reference": "^0.12.10",
55
55
  "@sentry/vite-plugin": "^11.10.0",
@@ -163,4 +163,4 @@ Put your Firebase project's `google-services.json` in the project folder, next t
163
163
 
164
164
  The user turns push on from the bell, or from your own button with [`usePushNotifications`](../reference/notifications.md#in-the-browser). Android 13 and later ask for the permission then. Signing out removes the phone's registration.
165
165
 
166
- A tap on a notification whose `url` is on your app's server opens that page inside the app. Any other `http` or `https` url opens in the phone's browser, never inside the app, and any other url opens nothing. Turning push on or off changes the app's native code, so it ships in a store release, not a [live update](#7-live-updates).
166
+ A tap on a notification whose `url` is on your app's server opens that page inside the app. Any other `http` or `https` url opens in the phone's browser, never inside the app, and any other url opens nothing. Turning push on or off changes the app's native code, so it ships in a store release, not a [live update](#7-live-updates). <gap>An app with `notifications()` on cannot get live updates on Protobase Cloud because fingerprinting its release with the manifest's `push` is not implemented there.</gap> <gap>A self-hosted server cannot offer live updates to an app whose config function turns `notifications()` on for `build` and not for `serve`, or the other way round, because fingerprinting a served release from its bundle's manifest is not implemented.</gap>
@@ -466,7 +466,7 @@ The app's address and secret are `PROTOBASE_URL` and `PROTOBASE_SECRET` unless i
466
466
  - **Startup:** a config module that `protobase build` did not write, a config with an `apiPath` other than `/api/v1`, or one with sign-in on and no secret or URL, stops startup with a one-line error and exit code 1, as does a missing `DATABASE_URL`, an auth store that has not applied every migration of this version, or has a newer one (see [`auth migration`](#auth-migration)), a resource over a table of the auth store, a resource whose [events](events.md) or [history](history.md) lack their triggers or have out-of-date ones, or a missing history or [comments](comments.md#the-table) table, a [rollup or formula field](data-config.md#rollups-and-formulas) whose column or trigger is missing or out of date, a jobs schema that is missing or behind for a config with [jobs](jobs.md#the-jobs-schema) (see [`migration`](#migration)), an [AI field or action](ai.md#the-model) without a model key, [encrypted fields](data-config.md#encrypted-fields) without a key, or another resource over their column, or a taken port; `PROTOBASE_STARTUP_CHECKS=false` skips the checks of those schemas and the key. `protobase serve listening on port <port>` means it is ready.
467
467
  - **Jobs:** with [jobs](jobs.md) in the config it runs them beside the API, unless `PROTOBASE_JOBS=false`, and with `PROTOBASE_JOBS_DRAIN_TOKEN` it answers `POST /api/jobs/drain` for the operator.
468
468
  - **Shutdown:** the first SIGTERM or SIGINT stops accepting connections, closes open WebSockets with 1001 (dropping any still open after 5 seconds), waits for open requests, gives running jobs 30 seconds to finish, drains the pool `serve` created and exits with 0.
469
- - **Host modules:** under Bun, the runtime registers [the modules it supplies](#the-config-module) as virtual modules, so the bundle needs no `node_modules` for them. `protobase serve`, on Node or Bun, resolves them from the `node_modules` next to the bundle, so keep the bundle inside the project. Native packages load from the bundle's own `node_modules/` under both.
469
+ - **Host modules:** under Bun, the runtime registers [the modules it supplies](#the-config-module) as virtual modules, so the bundle needs no `node_modules` for them. `protobase serve` under Bun does the same with the CLI's own copies, whatever the project installed, so a bundle runs on the copies of the CLI that serves it. <gap>`protobase serve` on Node cannot give a bundle the CLI's own host modules because a module hook for Node is not implemented.</gap> On Node it resolves them from the `node_modules` next to the bundle, so there keep the bundle inside the project, whose installed versions it then runs on. Native packages load from the bundle's own `node_modules/` under both.
470
470
  - **Read-only hosts:** nothing is written: no install (`--no-install`), and for a bundle built with `--bun` no transpiling and so no transpiler cache. A bundle with `node_modules/` needs its folder mounted without `noexec`, since its add-ons are mapped as executable code.
471
471
 
472
472
  ### Mobile releases
@@ -57,7 +57,7 @@ export default defineConfig(({ command, env }) => ({
57
57
 
58
58
  | | |
59
59
  | --- | --- |
60
- | `command` | `dev`, `build`, `serve` (also `protobase worker` and the serve runtime's `create-admin`; the runtime's `migrate` never reads the config), or `tool`, any other command over the project, such as `migration`, `users` or `doctor` |
60
+ | `command` | `dev`, `build` (also `protobase mobile`, which builds the app's files as a deploy bundle), `serve` (also `protobase worker` and the serve runtime's `create-admin`; the runtime's `migrate` never reads the config), or `tool`, any other command over the project, such as `migration`, `users` or `doctor` |
61
61
  | `env` | `process.env`, with the project's `.env` loaded |
62
62
  | `root` | the project's folder |
63
63