@softr/sdk 1.1.0 → 1.1.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @softr/sdk
2
2
 
3
+ ## 1.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - The formatting skill names the keys `parts` takes and says there is no `timeStyle`.
8
+
3
9
  ## 1.1.0
4
10
 
5
11
  ### Minor Changes
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "1.1.0";
2
+ var version = "1.1.1";
3
3
 
4
4
  //#endregion
5
5
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softr/sdk",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" },
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: core
11
11
  library: softr-sdk
12
- library_version: 1.1.0
12
+ library_version: 1.1.1
13
13
  ---
14
14
 
15
15
  # Softr SDK core
@@ -13,7 +13,7 @@ description: >-
13
13
  metadata:
14
14
  type: sub-skill
15
15
  library: softr-sdk
16
- library_version: 1.1.0
16
+ library_version: 1.1.1
17
17
  ---
18
18
 
19
19
  **Boundary.** `ai` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineAiAction` and every type come from `@softr/sdk` and can be imported anywhere.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 1.1.0
12
+ library_version: 1.1.1
13
13
  ---
14
14
 
15
15
  **Boundary.** `auth` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 1.1.0
12
+ library_version: 1.1.1
13
13
  ---
14
14
 
15
15
  **Boundary.** `ds` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler or a server-side route hook — importing it into a component fails the build. `defineQuery` and every type come from `@softr/sdk` and can be imported anywhere.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 1.1.0
12
+ library_version: 1.1.1
13
13
  ---
14
14
 
15
15
  # The current user
@@ -7,7 +7,7 @@ description: >-
7
7
  metadata:
8
8
  type: sub-skill
9
9
  library: softr-sdk
10
- library_version: 1.1.0
10
+ library_version: 1.1.1
11
11
  ---
12
12
 
13
13
  **Boundary.** `upload` lives on `@softr/sdk/server` and runs inside server functions. `useFileUpload` and `FileItem` live on `@softr/sdk` and run in components. `FileAttachment` comes from `@softr/sdk` and can be imported anywhere.
@@ -8,7 +8,7 @@ description: >-
8
8
  metadata:
9
9
  type: sub-skill
10
10
  library: softr-sdk
11
- library_version: 1.1.0
11
+ library_version: 1.1.1
12
12
  ---
13
13
 
14
14
  # Dates, times and numbers
@@ -41,7 +41,7 @@ type Formatting = {
41
41
 
42
42
  type DateOptions = {
43
43
  dateStyle?: 'short' | 'medium' | 'long' | 'full'
44
- parts?: { weekday?, year?, month?, day?, hour?, minute?, timeZoneName? } // Intl.DateTimeFormat options
44
+ parts?: { weekday?, year?, month?, day?, hour?, minute?, timeZoneName? } // only these seven keys
45
45
  timeZone?: string // IANA, such as 'America/New_York'
46
46
  }
47
47
  ```
@@ -58,9 +58,11 @@ type DateOptions = {
58
58
 
59
59
  A timestamp (`DATETIME`, `CREATED_AT`, `UPDATED_AT`) is a UTC instant and needs a time zone. On a visitor's first page load their zone can be unknown, and then `FormattedDate` renders its `fallback` (nothing by default) until the browser supplies it. A calendar day (`DATE`, such as `2026-10-06`) names the same day everywhere and always renders at once. `dateStyle` applies only when the app uses the visitor's format; a fixed format ignores it.
60
60
 
61
+ There is no `timeStyle`. `time` and `formatDateTime` add the time in the app's style, with or without `dateStyle`. For the time alone, use `parts`.
62
+
61
63
  ### Part of a date: `parts`
62
64
 
63
- A list already filtered to this year needs only the month. A schedule needs only the time. `parts` takes the `Intl.DateTimeFormat` fields and wins over `dateStyle` and the app's fixed format. The locale and the zone still come from the app.
65
+ A list already filtered to this year needs only the month. A schedule needs only the time. `parts` takes seven keys, with their `Intl` values: `weekday`, `year`, `month`, `day`, `hour`, `minute` and `timeZoneName`. Nothing else, so no `dateStyle`, `timeStyle` or `hour12`. It wins over `dateStyle` and the app's fixed format. The locale and the zone still come from the app.
64
66
 
65
67
  ```tsx
66
68
  <FormattedDate value={post.fields.published} parts={{ month: 'long', year: 'numeric' }} /> // October 2026
@@ -68,6 +70,12 @@ A list already filtered to this year needs only the month. A schedule needs only
68
70
  <FormattedDate value={shift.fields.starts} parts={{ hour: 'numeric', minute: 'numeric' }} /> // 14:30
69
71
  ```
70
72
 
73
+ The format functions take the same keys inside `parts`, never at the top level:
74
+
75
+ ```ts
76
+ formatDate(post.fields.published, formatting, { parts: { month: 'long', year: 'numeric' } })
77
+ ```
78
+
71
79
  ### A zone or a locale the user names
72
80
 
73
81
  "Show this page in New York time" or "use German formatting here" is a fixed value. It wins over the visitor's and the app's settings. A date in a named zone renders on the server at once, with no fallback.
@@ -224,6 +232,24 @@ Correct:
224
232
 
225
233
  On a first visit `formatting.timeZone` is `null`. `undefined` makes the server use its own zone and the browser use the visitor's, so the text differs and hydration fails. Use the helpers, or render nothing until the zone is known.
226
234
 
235
+ ### HIGH: Passing `Intl` options the helpers do not take
236
+
237
+ Wrong:
238
+
239
+ ```ts
240
+ formatDateTime(shift.fields.starts, formatting, { dateStyle: 'medium', timeStyle: 'short' })
241
+ formatDate(post.fields.published, formatting, { month: 'long', year: 'numeric' })
242
+ ```
243
+
244
+ Correct:
245
+
246
+ ```ts
247
+ formatDateTime(shift.fields.starts, formatting, { dateStyle: 'medium' })
248
+ formatDate(post.fields.published, formatting, { parts: { month: 'long', year: 'numeric' } })
249
+ ```
250
+
251
+ The options are `dateStyle`, `parts` and `timeZone`, not `Intl.DateTimeFormatOptions`. Anything else fails the type check. `formatDateTime` adds the time itself, and the date parts go inside `parts`.
252
+
227
253
  ## References
228
254
 
229
255
  - [SKILL.md](../SKILL.md): the entrypoints and which one each export lives on
@@ -7,7 +7,7 @@ description: >-
7
7
  metadata:
8
8
  type: sub-skill
9
9
  library: softr-sdk
10
- library_version: 1.1.0
10
+ library_version: 1.1.1
11
11
  ---
12
12
 
13
13
  **Boundary.** `integration` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineIntegration` and every type come from `@softr/sdk` and can be imported anywhere.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 1.1.0
12
+ library_version: 1.1.1
13
13
  ---
14
14
 
15
15
  **Boundary.** `softrMcpMiddleware` lives on `@softr/sdk` and is registered once, in `src/start.ts`. The actions you hand it are the same `defineQuery` / `defineMutation` values the app's own pages use — declared wherever they already live, not duplicated for MCP.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 1.1.0
12
+ library_version: 1.1.1
13
13
  ---
14
14
 
15
15
  # Push notifications
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 1.1.0
12
+ library_version: 1.1.1
13
13
  ---
14
14
 
15
15
  # Installing the app
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 1.1.0
12
+ library_version: 1.1.1
13
13
  ---
14
14
 
15
15
  **Boundary.** `ds` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineMutation` and every type come from `@softr/sdk` and can be imported anywhere.
@@ -10,7 +10,7 @@ description: >-
10
10
  metadata:
11
11
  type: sub-skill
12
12
  library: softr-sdk
13
- library_version: 1.1.0
13
+ library_version: 1.1.1
14
14
  ---
15
15
 
16
16
  **Boundary.** `ds` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler or a server-side route hook — importing it into a component fails the build. The same holds for any helper that calls `ds`: declare it inside the handler. A function at module level that calls `ds` keeps the server-only import in the browser bundle, and every page stops loading until it moves. `defineQuery` and every type come from `@softr/sdk` and can be imported anywhere.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 1.1.0
12
+ library_version: 1.1.1
13
13
  ---
14
14
 
15
15
  **Boundary.** `Audience` and `defineVisibility` come from `@softr/sdk` and work anywhere.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 1.1.0
12
+ library_version: 1.1.1
13
13
  ---
14
14
 
15
15
  **Boundary.** `definePage`, `pageHead`, the access functions and the error predicates come from `@softr/sdk` and work anywhere.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 1.1.0
12
+ library_version: 1.1.1
13
13
  ---
14
14
 
15
15
  **Boundary.** `workflow` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineWorkflow` and every type come from `@softr/sdk` and can be imported anywhere.