@protobase/cli 0.64.0 → 0.65.0

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.64.0";
2
+ var version = "0.65.0";
3
3
  //#endregion
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/cli",
3
- "version": "0.64.0",
3
+ "version": "0.65.0",
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.64.0",
46
- "@protobase/layout": "0.64.0",
47
- "@protobase/query": "0.64.0",
48
- "@protobase/schema": "0.64.0",
49
- "@protobase/server": "0.64.0",
50
- "@protobase/ui": "0.64.0",
45
+ "@protobase/config": "0.65.0",
46
+ "@protobase/layout": "0.65.0",
47
+ "@protobase/query": "0.65.0",
48
+ "@protobase/schema": "0.65.0",
49
+ "@protobase/server": "0.65.0",
50
+ "@protobase/ui": "0.65.0",
51
51
  "@react-email/render": "^2.1.0",
52
52
  "@scalar/hono-api-reference": "^0.12.10",
53
53
  "@tailwindcss/vite": "^4.3.3",
@@ -5,6 +5,7 @@
5
5
  The sidebar, the user menu, the bottom bar on phones and the global search.
6
6
 
7
7
  - [Sidebar](../reference/sidebar.md): Resources and pages in groups, in the order you set.
8
+ - [Sidebar icons](../reference/sidebar.md#sidebar-icons): Each resource shows the icon its view names in the sidebar, bottom bar and profile menu.
8
9
  - [Recent records](../reference/sidebar.md#recent-records): A sidebar entry lists a few records under it, with status dots or as titles alone, and marked per reader, such as unread ones in bold with a count.
9
10
  - [Create link](../reference/sidebar.md#create-link): A sidebar entry links to its create form, such as "New message" under Direct messages, for whoever may create.
10
11
  - [The current organization](../reference/sidebar.md#the-current-organization): A sidebar entry opens its list on the organization you work in, which you can clear to see every organization you are a member of.
@@ -65,7 +65,7 @@ export const paymentMethodsView = view<typeof paymentMethods>('payment_methods')
65
65
  a.remove('remove', { label: 'Remove', confirm: 'The card is removed from your account.' }),
66
66
  ])
67
67
 
68
- export const invoicesView = view<typeof invoices>('invoices')
68
+ export const invoicesView = view<typeof invoices>('invoices').icon('file-text')
69
69
  .title((r) => r.number)
70
70
  .names({ singular: 'Invoice', plural: 'Invoices' })
71
71
  .fields((r) => ({ number: r.number.format('code'), total: r.total.prefix('€').currency('EUR').decimals(2), issued_at: r.issued_at.label('Date'), status: r.status.valueLabels({ open: 'Open', paid: 'Paid' }).valueColors({ paid: 'green' }) }))
@@ -122,6 +122,7 @@ import type { orders } from './data'
122
122
  export const ordersView = view<typeof orders>('orders')
123
123
  .title((r) => r.number)
124
124
  .names({ singular: 'Order', plural: 'Orders' })
125
+ .icon('shopping-cart')
125
126
  .nav({
126
127
  recent: {
127
128
  status: 'status',
@@ -2,10 +2,20 @@
2
2
 
3
3
  # Sidebar
4
4
 
5
- How sidebar entries are grouped, how an entry lists recent records, with status dots or without, and how it links to its create form.
5
+ How sidebar entries are grouped and which icon each shows, how an entry lists recent records, with status dots or without, and how it links to its create form.
6
6
 
7
7
  The admin's sidebar has one entry per resource view, grouped by `nav.group` (default: the database schema, with no group name for `public`) and sorted by `nav.order`, then by the order `config/index.ts` exports them, in `protobase dev` and in a built bundle alike. The app opens on the first entry. A view's [named lists](ui-config.md#more-than-one-list) are entries of their own, placed by their own `nav`. `nav({ hidden: true })` leaves a resource out, for line and link tables; a resource in the [user menu](user-menu.md) is left out too. [Composed pages](layouts.md#setup) have entries of their own, and groups that hold pages come first. A [remote resource](remote-resources.md) has its entry where its source's view places it; while its source cannot be reached, it sits under the source's label, marked "Cannot reach" with the source's name.
8
8
 
9
+ ## Sidebar icons
10
+
11
+ Each resource shows the icon its view names, in the sidebar, the [bottom bar](bottom-bar.md) and the [user menu](user-menu.md), and its [named lists](ui-config.md#more-than-one-list) show the same icon:
12
+
13
+ ```ts
14
+ export const ordersView = view<typeof orders>('orders').names({ singular: 'Order', plural: 'Orders' }).icon('shopping-cart')
15
+ ```
16
+
17
+ `icon` is one of `bell`, `book-open`, `bookmark`, `building`, `credit-card`, `external-link`, `file-text`, `globe`, `heart`, `key`, `layout-dashboard`, `life-buoy`, `mail`, `package`, `receipt`, `settings`, `shield`, `shopping-cart`, `tags`, `users` or `warehouse`. A view without one, or with a name not in this list, shows a table icon, whatever the resource is called. A bottom bar tab's or user menu item's own `icon` wins over the view's.
18
+
9
19
  ## The current organization
10
20
 
11
21
  For a resource whose lists read [across organizations](access.md#lists-across-organizations), `nav({ tenant: 'current' })` opens its entry on the organization the session works in, while the person can still clear or widen it:
@@ -55,7 +55,7 @@ export const repairsView = view<typeof repairs>('repairs')
55
55
  | `.fields((r) => ({ name: r.name.label(...) }))` | Hints per field, below. Calls add up. |
56
56
  | `.help(text)` | A line under the list's title. |
57
57
  | `.nav({ group, order, hidden, recent, tenant })` | Where the resource sits in the sidebar, its [recent-record group](sidebar.md#recent-records), and with `tenant: 'current'` that it opens on [the current organization](sidebar.md#the-current-organization). |
58
- | `.icon(name)` | Carried in `/meta` for apps that render their own shell; the admin picks sidebar icons by resource name. |
58
+ | `.icon(name)` | The resource's icon in the sidebar, bottom bar and user menu; a table icon without one. See [Sidebar icons](sidebar.md#sidebar-icons). |
59
59
  | `.listOf((r) => r.listing_id)` | The list page shows the records this relation points at instead of the resource's own rows, such as the listings among a member's favorites. See [Favorites](#favorites). |
60
60
  | `.signIn({ title, description, benefits?, icon?, signUp? })` | What a visitor who is not signed in is told about the resource, in place of its list and by a card's favorite button. See [Sign-in prompts](#sign-in-prompts). |
61
61
  | `.form((r) => ({ name, fields, thanks, title?, perMinute? }))` | A public form at `/-/forms/<name>` that creates a record for anyone, signed in or not, behind a rate limit and a bot check. See [Public forms](forms.md). |
@@ -1036,6 +1036,7 @@ import type { orders } from './data'
1036
1036
  export const ordersView = view<typeof orders>('orders')
1037
1037
  .title((r) => r.number)
1038
1038
  .names({ singular: 'Order', plural: 'Orders' })
1039
+ .icon('shopping-cart')
1039
1040
  .nav({
1040
1041
  recent: {
1041
1042
  status: 'status',
@@ -26,7 +26,7 @@ export const accountMenu = userMenu((m) => [
26
26
  | `m.page(name, { label?, icon? })` | Opens a [composed page](layouts.md). The page leaves the sidebar. The label defaults to its title. |
27
27
  | `m.link(label, href, { icon? })` | Opens `href` in a new tab. Only `https://`, `http://` and `mailto:` are accepted. |
28
28
 
29
- `accounts` is the built-in [Users page](auth.md#users-page), which the config exports as `usersPage` from `@protobase/layout`; without the export, `createAdmin` refuses the item. Items keep their order. A line splits the menu into groups: these items, then the [organization](auth.md#organizations) pages when the app has organizations, then the person's own: "Account" for everyone (their [account page](auth.md#account-page): profile, [passkeys](auth.md#passkeys) and [two-factor authentication](auth.md#two-factor-authentication)) and "Sign-in policy" for admins (the [sign-in policy](auth.md#sign-in-policy), and the log of [staff sign-ins](auth.md#staff-sign-in)); then the [theme switch](theme.md#light-dark-or-the-system), and "Sign out" always comes last. `icon` is one of `bell`, `book-open`, `bookmark`, `building`, `credit-card`, `external-link`, `file-text`, `heart`, `key`, `layout-dashboard`, `life-buoy`, `mail`, `receipt`, `settings`, `shield`, `users`. A resource item without one uses the resource's sidebar icon, and a link item uses `external-link`.
29
+ `accounts` is the built-in [Users page](auth.md#users-page), which the config exports as `usersPage` from `@protobase/layout`; without the export, `createAdmin` refuses the item. Items keep their order. A line splits the menu into groups: these items, then the [organization](auth.md#organizations) pages when the app has organizations, then the person's own: "Account" for everyone (their [account page](auth.md#account-page): profile, [passkeys](auth.md#passkeys) and [two-factor authentication](auth.md#two-factor-authentication)) and "Sign-in policy" for admins (the [sign-in policy](auth.md#sign-in-policy), and the log of [staff sign-ins](auth.md#staff-sign-in)); then the [theme switch](theme.md#light-dark-or-the-system), and "Sign out" always comes last. `icon` is one of the names a view's [sidebar icon](sidebar.md#sidebar-icons) takes. A resource item without one uses the resource's sidebar icon, and a link item uses `external-link`.
30
30
 
31
31
  Every caller gets the menu through `/meta`, without the resources and pages they cannot see, so a user who cannot read `organizations` has no "Organization" item. Links are shown to everyone. `createAdmin` refuses to start when an item names a resource or page that does not exist, and `configExports` refuses a config that exports two menus.
32
32