@stacksjs/defaults 0.75.495 → 0.75.497

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.
@@ -11,7 +11,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
11
11
  | Package | Task guidance | Source entry | Retained tests |
12
12
  |---|---|---|---|
13
13
  | `@stacksjs/action-runner` | [`stacks-actions`](../stacks-actions/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/action-runner/src/index.ts) | 1 |
14
- | `@stacksjs/actions` | [`stacks-actions`](../stacks-actions/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/index.ts) | 105 |
14
+ | `@stacksjs/actions` | [`stacks-actions`](../stacks-actions/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/index.ts) | 106 |
15
15
  | `@stacksjs/ai` | [`stacks-ai`](../stacks-ai/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/index.ts) | 21 |
16
16
  | `@stacksjs/alias` | [`stacks-alias`](../stacks-alias/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/alias/src/index.ts) | 3 |
17
17
  | `@stacksjs/analytics` | [`stacks-analytics`](../stacks-analytics/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/analytics/src/index.ts) | 7 |
@@ -119,7 +119,7 @@ Declared runtime exports: `BlogAdminError`, `DEFAULT_IOS_DEPENDENCIES`, `DEFAULT
119
119
 
120
120
  Local source modules: [src/action.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/action.ts), [src/add.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/add.ts), [src/blog-admin.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/blog-admin.ts), [src/build/ios-toolchain.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/build/ios-toolchain.ts), [src/build/macos-native.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/build/macos-native.ts), [src/commit.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/commit.ts), [src/dev/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/dev/index.ts), [src/discover-packages.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/discover-packages.ts), [src/generate/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/generate/index.ts), [src/github-release.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/github-release.ts), [src/helpers/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/helpers/index.ts), [src/library/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/library/index.ts), [src/lint/lint.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/lint/lint.ts), [src/lint/stx-gate.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/lint/stx-gate.ts), [src/make-command.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/make-command.ts), [src/make-job.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/make-job.ts), [src/make-policy.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/make-policy.ts), [src/make-resource.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/make-resource.ts), [src/make.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/make.ts), [src/publication-preflight.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/publication-preflight.ts), [src/release-evidence.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/release-evidence.ts), [src/reviewos-evidence.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/reviewos-evidence.ts), [src/scaffold-crud.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/scaffold-crud.ts), [src/setup/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/setup/index.ts), [src/stacks.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/stacks.ts), [src/stx-source.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/stx-source.ts), [src/upgrade/package-project.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/upgrade/package-project.ts), [src/upgrade/route-actions.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/upgrade/route-actions.ts).
121
121
 
122
- Evidence directory: [105 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
122
+ Evidence directory: [106 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
123
123
 
124
124
  ### @stacksjs/ai
125
125
 
@@ -4,6 +4,7 @@ import { resolveModelSources } from '@stacksjs/database/model-sources'
4
4
  import { countRows } from '../../../../resources/functions/dashboard/data'
5
5
  import { dashboardOperationalError, dashboardOperationalIssue } from '../dashboard-response'
6
6
  import { resolveDashboardModel } from '../../../../resources/functions/dashboard/model-access'
7
+ import { resolveDashboardIcon } from '../../../../resources/functions/dashboard/sidebar'
7
8
  import { isUnmigratedTable } from './model-migration'
8
9
  import { modelApiConfiguration } from './model-api'
9
10
 
@@ -25,6 +26,7 @@ import { modelApiConfiguration } from './model-api'
25
26
  */
26
27
  interface ModelRow {
27
28
  name: string
29
+ icon: string
28
30
  table: string
29
31
  href: string
30
32
  count: number | null
@@ -86,6 +88,7 @@ function categoryLabel(k: string): string {
86
88
  function unavailableModelRow(model: DiscoveredModel, error: string): ModelRow {
87
89
  return {
88
90
  name: model.name,
91
+ icon: resolveDashboardIcon('table'),
89
92
  table: pluralize(pascalToSnake(model.name)),
90
93
  href: `/models/${pascalToKebab(model.name)}`,
91
94
  count: null,
@@ -160,6 +163,7 @@ export default new Action({
160
163
 
161
164
  return {
162
165
  name: m.name,
166
+ icon: resolveDashboardIcon(Model.dashboard?.icon ?? 'table'),
163
167
  table,
164
168
  href: `/models/${pascalToKebab(m.name)}`,
165
169
  count,
@@ -2,7 +2,7 @@
2
2
  "publisher": "Stacks",
3
3
  "name": "vscode-stacks",
4
4
  "displayName": "Stacks",
5
- "version": "0.75.495",
5
+ "version": "0.75.497",
6
6
  "description": "Stacks, built into VS Code: stx templates, pickier linting and formatting, encrypted env files, the dev server preview and every buddy command. No other extensions required.",
7
7
  "license": "MIT",
8
8
  "funding": "https://github.com/sponsors/chrisbbreuer",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/defaults",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.75.495",
5
+ "version": "0.75.497",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/stacksjs/stacks.git",
@@ -45,9 +45,10 @@
45
45
  "dependencies": {
46
46
  "@iconify-json/f7": "^1.2.2",
47
47
  "@iconify-json/hugeicons": "^1.2.35",
48
- "@stacksjs/mobile": "0.75.495",
48
+ "@stacksjs/mobile": "0.75.497",
49
49
  "@stacksjs/sanitizer": "0.2.807",
50
50
  "@stacksjs/stx": "0.2.807",
51
+ "@stacksjs/strings": "0.75.497",
51
52
  "@xterm/addon-fit": "^0.11.0",
52
53
  "@xterm/xterm": "^6.0.0",
53
54
  "ts-qr-codes": "^0.1.8"
@@ -3,6 +3,7 @@ import { dashboardApi } from '../../../../functions/dashboard-api'
3
3
 
4
4
  interface ModelRow {
5
5
  name: string
6
+ icon: string
6
7
  table: string
7
8
  href: string
8
9
  count: number | null
@@ -188,7 +189,7 @@ onMount(() => {
188
189
  <StxLink :for="model in group.models" :to="model.href" class="block p-5 bg-white dark:bg-neutral-900 border border-neutral-200 rounded-xl dark:border-neutral-700 hover:border-blue-300 dark:hover:border-blue-700 hover:shadow-sm transition-colors group">
189
190
  <div class="flex gap-3 items-start justify-between">
190
191
  <div class="flex gap-3 items-center min-w-0">
191
- <span class="flex flex-none items-center justify-center h-9 w-9 text-neutral-500 dark:text-neutral-400 group-hover:text-blue-600 dark:group-hover:text-blue-400 bg-neutral-100 dark:bg-neutral-800 rounded-lg i-hugeicons-database-01"></span>
192
+ <span class="flex flex-none items-center justify-center h-9 w-9 text-neutral-500 dark:text-neutral-400 group-hover:text-blue-600 dark:group-hover:text-blue-400 bg-neutral-100 dark:bg-neutral-800 rounded-lg"><span aria-hidden="true" :class="model.icon" class="h-5 w-5"></span></span>
192
193
  <div class="min-w-0">
193
194
  <h4 class="font-medium text-neutral-900 truncate dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400">{{ model.name }}</h4>
194
195
  <p class="font-mono text-neutral-500 text-xs truncate dark:text-neutral-400">{{ model.table }}</p>
@@ -1,5 +1,6 @@
1
1
  /** Server-side exposure boundary for the generic dashboard model surfaces. */
2
2
  import type { DashboardModelOptions } from '@stacksjs/types'
3
+ import { resolveModelSources } from '@stacksjs/database/model-sources'
3
4
  import { loadModelIfExists } from './data'
4
5
 
5
6
  /** Omission preserves the existing dashboard exposure. `enabled` only controls navigation. */
@@ -9,6 +10,13 @@ export function hasDashboardModelAccess(Model: { dashboard?: DashboardModelOptio
9
10
 
10
11
  /** Resolve the native model, then exclude it before callers inspect metadata or query rows. */
11
12
  export async function resolveDashboardModel(name: string, candidate?: any): Promise<any | null> {
13
+ // App-owned definitions retain their native ORM and dashboard access even
14
+ // when a same-named framework feature exports a disabled proxy.
15
+ const source = resolveModelSources()?.models.find(model => model.name === name)
16
+ if (source && source.origin !== 'framework') {
17
+ const Model = candidate ?? await loadModelIfExists(name)
18
+ return Model && hasDashboardModelAccess(Model) ? Model : null
19
+ }
12
20
  const injected = (globalThis as Record<string, any>)[name]
13
21
  // A model whose feature is off is still the ORM's export, as a proxy that
14
22
  // throws on `.where` (#2928). `in` asks it without the throw, and a feature
@@ -5,6 +5,7 @@
5
5
  * native STX Sidebar component. Markup, icons, disclosure state, and
6
6
  * persistence stay inside the component instead of being serialized as HTML.
7
7
  */
8
+ import { capitalCase, plural } from '@stacksjs/strings'
8
9
  import { existsSync, readFileSync } from 'node:fs'
9
10
  import { createRequire } from 'node:module'
10
11
  import { resolve } from 'node:path'
@@ -326,7 +327,7 @@ function categoryNavItems(
326
327
  .map((m): NavItem => ({
327
328
  to: `/models/${m.id}`,
328
329
  icon: m.dashboard?.icon ?? m.icon ?? 'table',
329
- text: m.dashboard?.label ?? m.name,
330
+ text: m.dashboard?.label ?? capitalCase(plural(m.name)),
330
331
  ...(m.dashboard?.roles && m.dashboard.roles.length > 0
331
332
  ? { roles: m.dashboard.roles }
332
333
  : {}),
@@ -452,7 +453,7 @@ export function buildNavSections(
452
453
  const item: NavItem = {
453
454
  to: `/models/${m.id}`,
454
455
  icon: m.dashboard?.icon ?? m.icon ?? 'table',
455
- text: m.dashboard?.label ?? m.name,
456
+ text: m.dashboard?.label ?? capitalCase(plural(m.name)),
456
457
  ...(m.dashboard?.roles && m.dashboard.roles.length > 0
457
458
  ? { roles: m.dashboard.roles }
458
459
  : {}),
@@ -699,7 +700,7 @@ function titleCase(label: string): string {
699
700
  * an application should not be limited to the icons the framework happened to
700
701
  * name, and `i-hugeicons-champion` is the spelling its own templates use.
701
702
  */
702
- function resolveNavIcon(icon: string): string {
703
+ export function resolveDashboardIcon(icon: string): string {
703
704
  if (icon.startsWith('i-'))
704
705
  return icon
705
706
 
@@ -748,7 +749,7 @@ export function buildWebSidebarSections(): WebSidebarSection[] {
748
749
  const webItem = (item: NavItem): WebSidebarItem => ({
749
750
  id: item.id ?? navItemId(item.to),
750
751
  label: item.text,
751
- icon: resolveNavIcon(item.icon),
752
+ icon: resolveDashboardIcon(item.icon),
752
753
  iconColor: 'blue',
753
754
  ...(item.to ? { href: item.to } : {}),
754
755
  ...(item.roles?.length ? { roles: item.roles } : {}),
@@ -758,7 +759,7 @@ export function buildWebSidebarSections(): WebSidebarSection[] {
758
759
  {
759
760
  id: 'top',
760
761
  label: '',
761
- items: [{ id: 'home', label: 'Home', icon: NAV_ICON_CLASSES.home, iconColor: 'blue', href: '/' }],
762
+ items: [{ id: 'home', label: 'Home', icon: NAV_ICON_CLASSES.home!, iconColor: 'blue', href: '/' }],
762
763
  },
763
764
  ...sections.map(([key, label, items]) => ({
764
765
  id: key,