@protobase/cli 0.58.3 → 0.58.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,6 +1,6 @@
1
1
  import { bundleProtobaseVersion } from "../version/project-version.js";
2
- import { buildIcons } from "./app-icons.js";
3
2
  import { protobaseFolder } from "../project/protobase-folder.js";
3
+ import { buildIcons } from "./app-icons.js";
4
4
  import { bundleLayout, bundleMigrations, bundleNodeModules, manifestFile } from "../bundle/manifest.js";
5
5
  import { buildBundlePlugins } from "./bundle-plugins.js";
6
6
  import { copyMigrations } from "./bundle-migrations.js";
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.58.3";
2
+ var version = "0.58.5";
3
3
  //#endregion
4
4
  export { version };
@@ -1,8 +1,10 @@
1
1
  import { serverPackage } from "../dev/server-package.js";
2
+ import { writeProjectTypes } from "./project-types.js";
2
3
  import path from "node:path";
3
4
  import { pathToFileURL } from "node:url";
4
5
  //#region src/project/import-project-file.ts
5
6
  const runnerImport = async (file, projectDir, plugins = []) => {
7
+ await writeProjectTypes(projectDir);
6
8
  const vite = await import("vite");
7
9
  const resolution = serverPackage(projectDir);
8
10
  const packages = resolution.from === "cli" ? {
@@ -1,6 +1,6 @@
1
1
  import { hostModuleIds } from "../serve/host-module-ids.js";
2
- import { provideHostModules } from "../serve/host-modules.js";
3
2
  import { cliTypePaths } from "../project/project-types.js";
3
+ import { provideHostModules } from "../serve/host-modules.js";
4
4
  import { fileURLToPath } from "node:url";
5
5
  //#region src/run/preload.ts
6
6
  const bun = globalThis.Bun;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/cli",
3
- "version": "0.58.3",
3
+ "version": "0.58.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.58.3",
46
- "@protobase/layout": "0.58.3",
47
- "@protobase/query": "0.58.3",
48
- "@protobase/schema": "0.58.3",
49
- "@protobase/server": "0.58.3",
50
- "@protobase/ui": "0.58.3",
45
+ "@protobase/config": "0.58.5",
46
+ "@protobase/layout": "0.58.5",
47
+ "@protobase/query": "0.58.5",
48
+ "@protobase/schema": "0.58.5",
49
+ "@protobase/server": "0.58.5",
50
+ "@protobase/ui": "0.58.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",
@@ -309,7 +309,7 @@ docker run --rm -p 127.0.0.1:8787:8787 -e DATABASE_URL -e PROTOBASE_URL -e PROTO
309
309
  ## `types`
310
310
 
311
311
  ```sh
312
- protobase types # writes .protobase/tsconfig.json; dev and build write it too
312
+ protobase types # writes .protobase/tsconfig.json; dev, build and every command that loads the config write it too
313
313
  ```
314
314
 
315
315
  Writes `.protobase/tsconfig.json`, which the project's `tsconfig.json` extends (`"extends": "./.protobase/tsconfig.json"`). In a bundled project its `paths` point each `@protobase` package and each package the serve runtime supplies, by name and by each of its exports (`@protobase/layout/jsx-runtime`, `kysely`, `zod`, ...), at the declarations of the CLI that builds the app, so the editor and `tsc` see the version that runs with nothing installed. There is no catch-all, so a package the project imports and lacks still fails as missing. React carries no types of its own, so the project keeps `@types/react`, as it keeps `@types/node`. A locked project's installed packages type themselves, so its file holds no `paths`. A `paths` of the project's own `tsconfig.json` replaces the generated one, as `extends` does with any option.
@@ -337,7 +337,7 @@ resource('direct_messages')
337
337
  organization_id: f.relation('organizations'),
338
338
  member_ids: f.json(),
339
339
  // generated always as (...) stored: the members sorted, without repeats
340
- member_key: f.text().readOnly().dbDefault(),
340
+ member_key: f.text().readOnly(),
341
341
  })
342
342
  .primaryKey((r) => r.id)
343
343
  .tenant((r) => r.organization_id)
@@ -86,7 +86,7 @@ Record pages take the same conditions in the `when` of `l.section`, `l.related`
86
86
  | `a.ai(name, { label, prompt, writes, confirm?, icon? })` | Has the model write the field `writes` of the record from `prompt`, `{field}` replaced by the record's values, as the user, on the server; see [AI fields and actions](ai.md#ai-actions). |
87
87
  | `a.action(name, { label, confirm?, icon?, bulk?, inputs? })` | Runs the handler the app registers under `name` in [`protobase.ui.tsx`](custom-components.md#action-handlers), after asking for its [`inputs`](ui-config.md#actions-that-ask-for-input) in a dialog when it has some. |
88
88
 
89
- `icon` is one of `archive`, `arrow-right-left`, `ban`, `bath`, `bed`, `bell`, `bookmark`, `calendar`, `camera`, `copy`, `cpu`, `door-open`, `download`, `external-link`, `file-text`, `hard-drive`, `heart`, `house`, `key`, `land-plot`, `leaf`, `memory`, `network`, `play`, `plug`, `power`, `restart`, `ruler`, `send`, `server`, `stop`, `tag`, `terminal`, `upload`, `wallet` or `wrench`; another name shows a lightning bolt. With `confirm` the button asks first. Every builder also takes `when`, `otherwise` and `reason`, which limit the action to the records it [applies to](ui-config.md#where-an-action-applies), and `variant: 'danger'`, which draws it in red. The button is disabled, with the reason as its tooltip, when the user may not update or delete the record (or, for an AI action, the field it writes), when an `a.action` has no handler, or when an update, delete or AI action has no record. After an action, everything shown of that resource reloads. The record page's action rail runs the same actions the same way.
89
+ `icon` is one of `archive`, `arrow-right-left`, `ban`, `bath`, `bed`, `bell`, `bookmark`, `calendar`, `camera`, `copy`, `cpu`, `door-open`, `download`, `external-link`, `file-text`, `hard-drive`, `heart`, `house`, `key`, `land-plot`, `leaf`, `memory`, `network`, `play`, `plug`, `power`, `restart`, `ruler`, `send`, `server`, `stop`, `tag`, `terminal`, `upload`, `wallet` or `wrench`; another name shows a lightning bolt. With `confirm` the button asks first. Every builder also takes `when`, `otherwise` and `reason`, which limit the action to the records it [applies to](ui-config.md#where-an-action-applies), and `variant: 'danger'`, which draws it in red. The button is disabled, with the reason as its tooltip, when the user may not update or delete the record (or, for an AI action, the field it writes), when an `a.action` has no handler, or when an update, delete or AI action has no record. After an action, everything shown of that resource reloads. The record page's action rail runs the same actions the same way; there an `a.link` is a real link that looks like the rail's buttons, which the browser can preview, copy or open in a new tab, while a disabled one is a disabled button with its reason. <gap>An `<Action>` block for an `a.link` cannot be opened in a new tab or copied as a link because drawing link actions as links is not implemented for the block.</gap>
90
90
 
91
91
  ### Links to a record's URL
92
92
 
@@ -1103,6 +1103,6 @@ A custom input's component gets the answer as `value` (`null` when empty), `onCh
1103
1103
  ])
1104
1104
  ```
1105
1105
 
1106
- Besides the record page, the list's row menu offers each named action without `inputs` on the rows it applies to, disabled where it is disabled on the record page, and in red when it is a delete or a danger action; a link is a link there, and is left out where `when` does not hold. An `a.update` or `a.action` with `bulk` and no `inputs` is also offered for the selected rows, as **Start (2)**, while one of them applies: it asks its `confirm` once, runs on each row it applies to, one after another, and its toast says how many it ran on, skipped and failed on. An `a.action`'s handler is called once per row.
1106
+ Besides the record page, the list's row menu offers each named action without `inputs` on the rows it applies to, disabled where it is disabled on the record page, and in red when it is a delete or a danger action; a link is a link there, or a disabled item without one where it is disabled. An `a.update` or `a.action` with `bulk` and no `inputs` is also offered for the selected rows, as **Start (2)**, while one of them applies: it asks its `confirm` once, runs on each row it applies to, one after another, and its toast says how many it ran on, skipped and failed on. An `a.action`'s handler is called once per row.
1107
1107
 
1108
1108
  A condition reads only the record's own fields, so the list decides it for each row from the row itself: `protobase build` refuses one that names a relation's field (`host_id.name`), counts records (`hosts.count`) or names a field the resource does not have, a disabled button without a `reason`, and a `reason` or `otherwise` without `when`. In `/api/meta`, a user who cannot read a field the condition reads does not get the action. The condition only decides what the buttons show: the resource's [access rules](access.md) decide what the API lets the user do.