@stacksjs/defaults 0.75.320 → 0.75.322

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.
@@ -100,6 +100,29 @@ interface Desktop {
100
100
 
101
101
  ## Local-first apps: owning the launcher
102
102
 
103
+ ### Model-backed offline native apps
104
+
105
+ An app created with `buddy new <name> --native` can use `craft.config.ts`'s
106
+ `backend: { entry: 'app/Desktop/api.ts' }` to bundle a Bun backend. The native
107
+ host owns an authenticated ephemeral loopback session and the backend's lifetime.
108
+ The binary does not need an installed Bun, external server or source files.
109
+
110
+ Define models under `app/Models` with `defineModel` from `@stacksjs/orm/define-model`.
111
+ In the backend, import those models explicitly and use `openNativeDatabase` and
112
+ `createNativeModelApi` from `@stacksjs/orm/native`. Pass an absolute SQLite path
113
+ inside Application Support and an explicit model registry. The same query-builder
114
+ migration planner derives the schema and atomically records its snapshot in the
115
+ database. Additive upgrades preserve rows; destructive changes are refused.
116
+
117
+ CRUD follows `traits.useApi.uri` and its explicit `routes` list. Native models
118
+ declare `middleware: []` because the transport owns session authorization.
119
+ `createNativeModelApi` requires an `authorize(request, model, ability)` callback
120
+ on every request. Only return true unconditionally when the handler runs solely
121
+ behind stx's authenticated native backend. Never expose that handler through an
122
+ unprotected HTTP server. Web middleware declarations are refused by this native
123
+ adapter instead of silently skipped. Writes use the model's validation, fillable
124
+ allowlist and hidden-field serialization; index requests have bounded pagination.
125
+
103
126
  The launcher Stacks compiles opens a Craft window on the URL in `desktop.json`,
104
127
  which is what a hosted Stacks application wants. An app whose subject is the
105
128
  machine it runs on - a disk cleaner, a log viewer, a device tool - has no such
@@ -53,7 +53,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
53
53
  | `@stacksjs/features` | [`stacks-features`](../stacks-features/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/features/src/index.ts) | 1 |
54
54
  | `@stacksjs/forms` | [`stacks-forms`](../stacks-forms/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/forms/src/index.ts) | 4 |
55
55
  | `@stacksjs/git` | [`stacks-git`](../stacks-git/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/git/src/index.ts) | 2 |
56
- | `@stacksjs/github` | [`stacks-git`](../stacks-git/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/index.ts) | 7 |
56
+ | `@stacksjs/github` | [`stacks-git`](../stacks-git/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/index.ts) | 8 |
57
57
  | `@stacksjs/health` | [`stacks-health`](../stacks-health/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/health/src/index.ts) | 2 |
58
58
  | `@stacksjs/http` | [`stacks-http`](../stacks-http/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/http/src/index.ts) | 2 |
59
59
  | `@stacksjs/i18n` | [`stacks-i18n`](../stacks-i18n/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/i18n/src/index.ts) | 4 |
@@ -65,7 +65,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
65
65
  | `@stacksjs/newsletter` | [`stacks-newsletter`](../stacks-newsletter/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/newsletter/src/index.ts) | 7 |
66
66
  | `@stacksjs/notifications` | [`stacks-notifications`](../stacks-notifications/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/notifications/src/index.ts) | 16 |
67
67
  | `@stacksjs/objects` | [`stacks-objects`](../stacks-objects/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/objects/src/index.ts) | 4 |
68
- | `@stacksjs/orm` | [`stacks-orm`](../stacks-orm/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/index.ts) | 72 |
68
+ | `@stacksjs/orm` | [`stacks-orm`](../stacks-orm/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/index.ts) | 73 |
69
69
  | `@stacksjs/pagination` | [`stacks-pagination`](../stacks-pagination/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/pagination/src/index.ts) | 0 |
70
70
  | `@stacksjs/path` | [`stacks-path`](../stacks-path/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/path/src/index.ts) | 13 |
71
71
  | `@stacksjs/payments` | [`stacks-payments`](../stacks-payments/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/payments/src/index.ts) | 29 |
@@ -519,11 +519,11 @@ Evidence directory: [2 retained tests](https://github.com/stacksjs/stacks/blob/m
519
519
 
520
520
  Guidance: [`stacks-git`](../stacks-git/SKILL.md). Source: [storage/framework/core/github/src/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/index.ts).
521
521
 
522
- Declared runtime exports: `GITHUB_API`, `GITHUB_API_VERSION`, `clearDashboardCache`, `createPullRequestWithFiles`, `detectNewlyFailedRuns`, `detectRunnerPressure`, `fetchAllRepos`, `fetchBotPRCounts`, `fetchFailedJobs`, `fetchPullRequestCounts`, `fetchRepoActiveRuns`, `fetchRepoStatus`, `fetchRepositoryFile`, `fetchRepositoryTree`, `fetchRunJobs`, `fetchWorkflowRuns`, `getDashboardData`, `ghFetch`, `ghHeaders`, `githubHeaders`, `githubJson`, `githubRequest`, `mapWithConcurrency`.
522
+ Declared runtime exports: `GITHUB_API`, `GITHUB_API_VERSION`, `clearDashboardCache`, `createPullRequestWithFiles`, `detectNewlyFailedRuns`, `detectRunnerPressure`, `fetchAllRepos`, `fetchBotPRCounts`, `fetchFailedJobs`, `fetchGitHubNotifications`, `fetchGitHubViewer`, `fetchPullRequestCounts`, `fetchRepoActiveRuns`, `fetchRepoStatus`, `fetchRepositoryFile`, `fetchRepositoryTree`, `fetchRunJobs`, `fetchWorkflowRuns`, `getDashboardData`, `ghFetch`, `ghHeaders`, `githubHeaders`, `githubJson`, `githubRequest`, `mapWithConcurrency`, `searchGitHubIssues`, `searchGitHubRepositories`.
523
523
 
524
- Local source modules: [src/bots.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/bots.ts), [src/client.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/client.ts), [src/dashboard.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/dashboard.ts), [src/failure-detector.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/failure-detector.ts), [src/pull-requests.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/pull-requests.ts), [src/repos.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/repos.ts), [src/run-history.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/run-history.ts), [src/runner-pressure-detector.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/runner-pressure-detector.ts), [src/runners.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/runners.ts), [src/runs.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/runs.ts).
524
+ Local source modules: [src/bots.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/bots.ts), [src/client.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/client.ts), [src/dashboard.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/dashboard.ts), [src/failure-detector.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/failure-detector.ts), [src/pull-requests.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/pull-requests.ts), [src/repos.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/repos.ts), [src/run-history.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/run-history.ts), [src/runner-pressure-detector.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/runner-pressure-detector.ts), [src/runners.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/runners.ts), [src/runs.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/runs.ts), [src/search.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/search.ts).
525
525
 
526
- Evidence directory: [7 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
526
+ Evidence directory: [8 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
527
527
 
528
528
  ### @stacksjs/health
529
529
 
@@ -635,7 +635,7 @@ Declared runtime exports: `Activity`, `AnalyticsEvent`, `Auction`, `AuctionItem`
635
635
 
636
636
  Local source modules: [src/auto-crud.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/auto-crud.ts), [src/batch-loader.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/batch-loader.ts), [src/db.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/db.ts), [src/define-model.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/define-model.ts), [src/extend-model.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/extend-model.ts), [src/gdpr/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/gdpr/index.ts), [src/generate-database-schema.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/generate-database-schema.ts), [src/locked-row.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/locked-row.ts), [src/messaging.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/messaging.ts), [src/model-types.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/model-types.ts), [src/ownership.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/ownership.ts), [src/paginator-request.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/paginator-request.ts), [src/row-token.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/row-token.ts), [src/subquery.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/subquery.ts), [src/traits/audit.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/traits/audit.ts), [src/traits/billable.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/traits/billable.ts), [src/traits/categorizable.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/traits/categorizable.ts), [src/traits/commentable.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/traits/commentable.ts), [src/traits/likeable.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/traits/likeable.ts), [src/traits/taggable.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/traits/taggable.ts), [src/transaction.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/transaction.ts), [src/types.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/types.ts), [src/utils/encrypted.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/utils/encrypted.ts), [src/utils/prunable.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/utils/prunable.ts).
637
637
 
638
- Evidence directory: [72 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
638
+ Evidence directory: [73 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
639
639
 
640
640
  ### @stacksjs/pagination
641
641
 
@@ -2,7 +2,7 @@
2
2
  "publisher": "Stacks",
3
3
  "name": "vscode-stacks",
4
4
  "displayName": "Stacks",
5
- "version": "0.75.320",
5
+ "version": "0.75.322",
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.320",
5
+ "version": "0.75.322",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/stacksjs/stacks.git",
@@ -45,7 +45,7 @@
45
45
  "dependencies": {
46
46
  "@iconify-json/f7": "^1.2.2",
47
47
  "@iconify-json/hugeicons": "^1.2.35",
48
- "@stacksjs/mobile": "0.75.320",
48
+ "@stacksjs/mobile": "0.75.322",
49
49
  "@stacksjs/sanitizer": "0.2.711",
50
50
  "@stacksjs/stx": "0.2.711",
51
51
  "@xterm/addon-fit": "^0.11.0",