@stacksjs/defaults 0.75.383 → 0.75.388

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.
@@ -34,8 +34,9 @@ function parse(expression: string, relativeDate?: Date | number, options?: { tz?
34
34
  ```
35
35
 
36
36
  Parses a cron expression and returns the next matching Date as a UTC instant.
37
- Without tz it uses Bun.cron.parse when available, otherwise the built-in parser.
38
- With tz it always uses the built-in parser so the IANA timezone is honored.
37
+ Without tz the expression is read in UTC, with tz in that IANA zone, and never
38
+ in the server's own timezone. It does not call `Bun.cron.parse`, which reads
39
+ expressions in the process's local time the way crontab does.
39
40
 
40
41
  ```typescript
41
42
  parse('0 0 * * *') // Next midnight UTC
@@ -471,6 +471,10 @@ For a run or ride, `createRouteRecorder({ location, onUpdate })` starts, pauses,
471
471
  resumes and stops the native recording, re-attaches to one that outlived the
472
472
  app (`attach({ expectedId })` with the ID saved in the account's draft), and reports live distance and pace from `routeStats(fixes)`,
473
473
  which ignores GPS drift, inaccurate fixes and the ground crossed during a pause.
474
+ It keeps those numbers incrementally (`createRouteStats().add(fixes)` counts
475
+ only fixes newer than the last) and reads with `since`, so a long recording is
476
+ not re-summed on every read; a host that ignores `since` is read less often past
477
+ an hour of fixes (`routeReadInterval`).
474
478
  Recorder operations serialize; repeated `stop()` returns the same recording.
475
479
  Call `dispose()` when the owning page is destroyed to stop polling without
476
480
  stopping the native recording. Refreshes coalesce and cannot overwrite a final
@@ -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) | 93 |
14
+ | `@stacksjs/actions` | [`stacks-actions`](../stacks-actions/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/index.ts) | 94 |
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) | 20 |
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) | 1 |
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) | 6 |
@@ -21,7 +21,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
21
21
  | `@stacksjs/auth` | [`stacks-auth`](../stacks-auth/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/index.ts) | 124 |
22
22
  | `@stacksjs/browser` | [`stacks-browser`](../stacks-browser/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser/src/index.ts) | 8 |
23
23
  | `@stacksjs/browser-extension` | [`stacks-browser-extension`](../stacks-browser-extension/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser-extension/src/index.ts) | 7 |
24
- | `@stacksjs/buddy` | [`stacks-buddy`](../stacks-buddy/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/buddy/src/index.ts) | 172 |
24
+ | `@stacksjs/buddy` | [`stacks-buddy`](../stacks-buddy/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/buddy/src/index.ts) | 173 |
25
25
  | `@stacksjs/build` | [`stacks-build`](../stacks-build/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/build/src/index.ts) | 4 |
26
26
  | `@stacksjs/cache` | [`stacks-cache`](../stacks-cache/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/cache/src/index.ts) | 18 |
27
27
  | `@stacksjs/calendar-api` | [`stacks-calendar`](../stacks-calendar/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/calendar-api/src/index.ts) | 2 |
@@ -34,7 +34,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
34
34
  | `@stacksjs/commerce` | [`stacks-commerce`](../stacks-commerce/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/index.ts) | 14 |
35
35
  | `@stacksjs/composables` | [`stacks-composables`](../stacks-composables/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/composables/src/index.ts) | 18 |
36
36
  | `@stacksjs/config` | [`stacks-config`](../stacks-config/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/config/src/index.ts) | 16 |
37
- | `@stacksjs/cron` | [`stacks-cron`](../stacks-cron/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/cron/src/index.ts) | 4 |
37
+ | `@stacksjs/cron` | [`stacks-cron`](../stacks-cron/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/cron/src/index.ts) | 6 |
38
38
  | `@stacksjs/database` | [`stacks-database`](../stacks-database/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/index.ts) | 135 |
39
39
  | `@stacksjs/datetime` | [`stacks-datetime`](../stacks-datetime/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/datetime/src/index.ts) | 13 |
40
40
  | `@stacksjs/defaults` | [`stacks-build`](../stacks-build/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/defaults/package.json) | 2 |
@@ -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/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/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: [93 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: [94 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
 
@@ -217,7 +217,7 @@ Read the entrypoint and package export map for re-exported or type-only surfaces
217
217
 
218
218
  Local source modules: [src/commands/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/buddy/src/commands/index.ts).
219
219
 
220
- Evidence directory: [172 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/buddy/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
220
+ Evidence directory: [173 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/buddy/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
221
221
 
222
222
  ### @stacksjs/build
223
223
 
@@ -343,7 +343,7 @@ Declared runtime exports: `parse`, `parseCron`, `register`, `remove`.
343
343
 
344
344
  Local source modules: [src/parser.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/cron/src/parser.ts), [src/types.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/cron/src/types.ts).
345
345
 
346
- Evidence directory: [4 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/cron/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
346
+ Evidence directory: [6 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/cron/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
347
347
 
348
348
  ### @stacksjs/database
349
349
 
@@ -172,7 +172,7 @@ import { parse } from '@stacksjs/cron'
172
172
  parse(expression: string, relativeDate?: Date | number, options?: { tz?: string }): Date | null
173
173
  ```
174
174
 
175
- - Uses `Bun.cron.parse()` when available and no timezone is supplied. With tz, or without native support, it uses the built-in parseCron implementation.
175
+ - Reads the expression in UTC, or in the given tz, using the built-in parseCron. It does not use `Bun.cron.parse()`, which reads in the server's local time.
176
176
  - Returns the next matching UTC `Date`, or `null` if no match within ~4 years.
177
177
  - Throws on invalid expressions (wrong field count, out-of-range values).
178
178
 
@@ -2,7 +2,7 @@
2
2
  "publisher": "Stacks",
3
3
  "name": "vscode-stacks",
4
4
  "displayName": "Stacks",
5
- "version": "0.75.383",
5
+ "version": "0.75.388",
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.383",
5
+ "version": "0.75.388",
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.383",
48
+ "@stacksjs/mobile": "0.75.388",
49
49
  "@stacksjs/sanitizer": "0.2.752",
50
50
  "@stacksjs/stx": "0.2.752",
51
51
  "@xterm/addon-fit": "^0.11.0",
@@ -10,7 +10,8 @@ const error = state('')
10
10
  const challengeToken = state('')
11
11
 
12
12
  function safeRedirect(): string {
13
- return safeAuthRedirect(route.query.redirect)
13
+ // The stx page gate sends visitors here with `?next=`; links written by hand use `?redirect=`.
14
+ return safeAuthRedirect(route.query.redirect ?? route.query.next)
14
15
  }
15
16
 
16
17
  async function handleLogin(credentials: AuthUser): Promise<void> {
@@ -1,6 +1,6 @@
1
1
  <script client>
2
2
  import type { RegisterCredentials } from '../../../../types/dashboard'
3
- import { describeAuthError, useAuth } from '../../../../functions/auth'
3
+ import { describeAuthError, safeAuthRedirect, useAuth } from '../../../../functions/auth'
4
4
 
5
5
  const { register } = useAuth()
6
6
  const route = useRoute()
@@ -9,8 +9,8 @@ const isLoading = state(false)
9
9
  const error = state('')
10
10
 
11
11
  function safeRedirect(): string {
12
- const redirect = String(route.query.redirect || '')
13
- return redirect.startsWith('/') && !redirect.startsWith('//') ? redirect : '/'
12
+ // Same destinations as sign-in: `?redirect=` from links, `?next=` from the page gate.
13
+ return safeAuthRedirect(route.query.redirect ?? route.query.next)
14
14
  }
15
15
 
16
16
  async function handleRegister(credentials: RegisterCredentials): Promise<void> {
@@ -10,6 +10,13 @@ export function hasDashboardModelAccess(Model: { dashboard?: DashboardModelOptio
10
10
  /** Resolve the native model, then exclude it before callers inspect metadata or query rows. */
11
11
  export async function resolveDashboardModel(name: string, candidate?: any): Promise<any | null> {
12
12
  const injected = (globalThis as Record<string, any>)[name]
13
+ // A model whose feature is off is still the ORM's export, as a proxy that
14
+ // throws on `.where` (#2928). `in` asks it without the throw, and a feature
15
+ // that is off keeps its models out of the dashboard as it does the sidebar.
16
+ // Compared to the ORM's own export so a built-in global the ORM leaves in
17
+ // place, like `Request`, still resolves through its model file.
18
+ if (injected && injected === (await import('@stacksjs/orm') as Record<string, unknown>)[name] && !('where' in injected))
19
+ return null
13
20
  const Model = (injected && typeof injected.where === 'function') ? injected : (candidate ?? await loadModelIfExists(name))
14
21
  return Model && hasDashboardModelAccess(Model) ? Model : null
15
22
  }