create-foldkit-app 0.35.1 → 0.35.2

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.
Files changed (134) hide show
  1. package/dist/templates/base/FOLDKIT.md +2 -2
  2. package/dist/templates/examples/api-cache/package.json +2 -2
  3. package/dist/templates/examples/api-cache/src/main.fixture.ts +4 -4
  4. package/dist/templates/examples/api-cache/src/main.ts +12 -12
  5. package/dist/templates/examples/api-cache/src/story.test.ts +6 -6
  6. package/dist/templates/examples/auth/package.json +2 -2
  7. package/dist/templates/examples/auth/src/page/loggedOut/page/login.scene.test.ts +2 -2
  8. package/dist/templates/examples/auth/src/page/loggedOut/page/login.story.test.ts +2 -2
  9. package/dist/templates/examples/auth/src/page/loggedOut/page/login.ts +5 -5
  10. package/dist/templates/examples/auth/src/page/loggedOut/update.ts +2 -2
  11. package/dist/templates/examples/auth/src/scene.test.ts +2 -2
  12. package/dist/templates/examples/auth/src/update.ts +3 -3
  13. package/dist/templates/examples/canvas-art/package.json +2 -2
  14. package/dist/templates/examples/canvas-art/src/main.ts +6 -6
  15. package/dist/templates/examples/canvas-art/src/scene.test.ts +3 -3
  16. package/dist/templates/examples/canvas-art/src/story.test.ts +3 -3
  17. package/dist/templates/examples/charting/package.json +2 -2
  18. package/dist/templates/examples/charting/src/main.fixture.ts +2 -2
  19. package/dist/templates/examples/charting/src/scene.test.ts +3 -3
  20. package/dist/templates/examples/charting/src/story.test.ts +2 -2
  21. package/dist/templates/examples/charting/src/update.ts +18 -16
  22. package/dist/templates/examples/counter/package.json +2 -2
  23. package/dist/templates/examples/counter/src/main.ts +4 -4
  24. package/dist/templates/examples/counters/package.json +2 -2
  25. package/dist/templates/examples/counters/src/counter.ts +3 -3
  26. package/dist/templates/examples/counters/src/main.ts +7 -5
  27. package/dist/templates/examples/crash-view/package.json +2 -2
  28. package/dist/templates/examples/embedding/package.json +2 -2
  29. package/dist/templates/examples/embedding/src/main.ts +5 -3
  30. package/dist/templates/examples/embedding/src/scene.test.ts +2 -2
  31. package/dist/templates/examples/embedding/src/story.test.ts +2 -2
  32. package/dist/templates/examples/form/package.json +2 -2
  33. package/dist/templates/examples/form/src/main.ts +9 -9
  34. package/dist/templates/examples/form/src/scene.test.ts +5 -5
  35. package/dist/templates/examples/form/src/story.test.ts +4 -4
  36. package/dist/templates/examples/generative-art/package.json +2 -2
  37. package/dist/templates/examples/generative-art/src/scene.test.ts +2 -2
  38. package/dist/templates/examples/generative-art/src/story.test.ts +3 -3
  39. package/dist/templates/examples/generative-art/src/update.ts +11 -11
  40. package/dist/templates/examples/interrupting-commands/package.json +2 -2
  41. package/dist/templates/examples/interrupting-commands/src/main.ts +8 -6
  42. package/dist/templates/examples/job-application/package.json +2 -2
  43. package/dist/templates/examples/job-application/src/main.fixture.ts +9 -9
  44. package/dist/templates/examples/job-application/src/scene.test.ts +13 -13
  45. package/dist/templates/examples/job-application/src/step/attachments/attachments.ts +7 -7
  46. package/dist/templates/examples/job-application/src/step/coverLetter/coverLetter.ts +2 -2
  47. package/dist/templates/examples/job-application/src/step/education/education.ts +6 -6
  48. package/dist/templates/examples/job-application/src/step/education/entry/entry.ts +14 -8
  49. package/dist/templates/examples/job-application/src/step/personalInfo/personalInfo.ts +20 -15
  50. package/dist/templates/examples/job-application/src/step/personalInfo/story.test.ts +2 -2
  51. package/dist/templates/examples/job-application/src/step/skills/entry/entry.ts +7 -5
  52. package/dist/templates/examples/job-application/src/step/skills/skills.ts +6 -6
  53. package/dist/templates/examples/job-application/src/step/workHistory/entry/entry.ts +13 -12
  54. package/dist/templates/examples/job-application/src/step/workHistory/workHistory.ts +6 -6
  55. package/dist/templates/examples/job-application/src/story.test.ts +10 -10
  56. package/dist/templates/examples/job-application/src/update.ts +25 -18
  57. package/dist/templates/examples/kanban/package.json +2 -2
  58. package/dist/templates/examples/kanban/src/domain/column.ts +9 -6
  59. package/dist/templates/examples/kanban/src/update.ts +8 -8
  60. package/dist/templates/examples/managed-resource-layer/package.json +2 -2
  61. package/dist/templates/examples/managed-resource-layer/src/main.ts +11 -7
  62. package/dist/templates/examples/managed-resource-layer/src/story.test.ts +3 -3
  63. package/dist/templates/examples/map/package.json +2 -2
  64. package/dist/templates/examples/map/src/main.fixture.ts +2 -2
  65. package/dist/templates/examples/map/src/main.ts +11 -11
  66. package/dist/templates/examples/map/src/scene.test.ts +4 -4
  67. package/dist/templates/examples/map/src/story.test.ts +4 -4
  68. package/dist/templates/examples/pixel-art/package.json +2 -2
  69. package/dist/templates/examples/pixel-art/src/comparison.bench.test.ts +2 -2
  70. package/dist/templates/examples/pixel-art/src/main.bench.ts +7 -3
  71. package/dist/templates/examples/pixel-art/src/scene.test.ts +5 -5
  72. package/dist/templates/examples/pixel-art/src/story.test.ts +4 -4
  73. package/dist/templates/examples/pixel-art/src/subscription.ts +2 -2
  74. package/dist/templates/examples/pixel-art/src/update.ts +49 -33
  75. package/dist/templates/examples/query-sync/package.json +2 -2
  76. package/dist/templates/examples/query-sync/src/main.ts +4 -4
  77. package/dist/templates/examples/query-sync/src/scene.test.ts +4 -4
  78. package/dist/templates/examples/query-sync/src/story.test.ts +2 -2
  79. package/dist/templates/examples/route-transitions/package.json +2 -2
  80. package/dist/templates/examples/route-transitions/src/main.ts +10 -10
  81. package/dist/templates/examples/route-transitions/src/story.test.ts +10 -6
  82. package/dist/templates/examples/routing/package.json +2 -2
  83. package/dist/templates/examples/routing/src/main.ts +13 -17
  84. package/dist/templates/examples/routing/src/page/people.ts +4 -4
  85. package/dist/templates/examples/shopping-cart/package.json +2 -2
  86. package/dist/templates/examples/shopping-cart/src/domain/cart.ts +4 -4
  87. package/dist/templates/examples/shopping-cart/src/main.ts +12 -12
  88. package/dist/templates/examples/shopping-cart/src/page/products.ts +2 -2
  89. package/dist/templates/examples/shopping-cart/src/scene.test.ts +10 -8
  90. package/dist/templates/examples/shopping-cart/src/story.test.ts +7 -7
  91. package/dist/templates/examples/slow-warnings/package.json +2 -2
  92. package/dist/templates/examples/slow-warnings/src/handleSlow.test.ts +2 -2
  93. package/dist/templates/examples/slow-warnings/src/main.ts +8 -8
  94. package/dist/templates/examples/slow-warnings/src/scene.test.ts +2 -2
  95. package/dist/templates/examples/slow-warnings/src/story.test.ts +2 -2
  96. package/dist/templates/examples/snake/package.json +2 -2
  97. package/dist/templates/examples/snake/src/main.ts +10 -10
  98. package/dist/templates/examples/snake/src/scene.test.ts +10 -5
  99. package/dist/templates/examples/snake/src/story.test.ts +6 -6
  100. package/dist/templates/examples/ssg/package.json +2 -2
  101. package/dist/templates/examples/ssg/src/main.ts +3 -3
  102. package/dist/templates/examples/ssr/package.json +4 -4
  103. package/dist/templates/examples/ssr/src/main.ts +3 -3
  104. package/dist/templates/examples/state-machine/package.json +2 -2
  105. package/dist/templates/examples/state-machine/src/main.ts +14 -10
  106. package/dist/templates/examples/stopwatch/package.json +2 -2
  107. package/dist/templates/examples/stopwatch/src/main.ts +5 -5
  108. package/dist/templates/examples/stopwatch/src/story.test.ts +2 -2
  109. package/dist/templates/examples/todo/package.json +2 -2
  110. package/dist/templates/examples/todo/src/main.ts +17 -17
  111. package/dist/templates/examples/todo/src/scene.test.ts +4 -4
  112. package/dist/templates/examples/todo/src/story.test.ts +22 -16
  113. package/dist/templates/examples/ui-showcase/package.json +2 -2
  114. package/dist/templates/examples/ui-showcase/src/main.ts +8 -5
  115. package/dist/templates/examples/ui-showcase/src/story.test.ts +3 -3
  116. package/dist/templates/examples/ui-showcase/src/ui/init.ts +4 -1
  117. package/dist/templates/examples/ui-showcase/src/ui/subscriptions.ts +10 -0
  118. package/dist/templates/examples/ui-showcase/src/ui/update.ts +119 -91
  119. package/dist/templates/examples/ui-showcase/src/ui/view/toast.ts +20 -3
  120. package/dist/templates/examples/view-transitions/package.json +2 -2
  121. package/dist/templates/examples/view-transitions/src/main.ts +3 -3
  122. package/dist/templates/examples/weather/package.json +2 -2
  123. package/dist/templates/examples/weather/src/main.ts +5 -5
  124. package/dist/templates/examples/web-components/package.json +2 -2
  125. package/dist/templates/examples/web-components/src/main.ts +4 -4
  126. package/dist/templates/examples/websocket-chat/package.json +2 -2
  127. package/dist/templates/examples/websocket-chat/src/main.ts +8 -8
  128. package/dist/templates/examples/websocket-chat/src/scene.test.ts +18 -6
  129. package/dist/templates/examples/websocket-chat/src/story.test.ts +15 -9
  130. package/dist/templates/release.json +13 -13
  131. package/dist/templates/rendering/ssg/src/main.ts +3 -3
  132. package/dist/templates/rendering/ssr/scripts/serve.ts +2 -2
  133. package/dist/templates/rendering/ssr/src/main.ts +3 -3
  134. package/package.json +5 -5
@@ -23,7 +23,8 @@ const variantClassName = (variant: Variant): string =>
23
23
  Match.exhaustive,
24
24
  )
25
25
 
26
- const entryClassName = 'w-80'
26
+ const entryClassName =
27
+ 'w-80 motion-safe:data-[swipe=settling]:transition-[translate] motion-safe:data-[swipe=settling]:duration-150 motion-safe:data-[swipe=settling]:ease-out motion-safe:data-[swipe=end]:transition-[translate] motion-safe:data-[swipe=end]:duration-[240ms] motion-safe:data-[swipe=end]:ease-in'
27
28
 
28
29
  const renderToastEntry = (
29
30
  entry: Entry,
@@ -37,11 +38,27 @@ const renderToastEntry = (
37
38
  ),
38
39
  ],
39
40
  [
40
- h.p([h.Class('font-semibold text-sm')], [entry.payload.title]),
41
+ h.p(
42
+ [h.Class('font-semibold text-sm')],
43
+ [
44
+ h.span(
45
+ [h.DataAttribute('toast-swipe-ignore', '')],
46
+ [entry.payload.title],
47
+ ),
48
+ ],
49
+ ),
41
50
  ...Option.match(entry.payload.maybeDescription, {
42
51
  onNone: () => [],
43
52
  onSome: description => [
44
- h.p([h.Class('text-sm text-gray-700 mt-0.5')], [description]),
53
+ h.p(
54
+ [h.Class('text-sm text-gray-700 mt-0.5')],
55
+ [
56
+ h.span(
57
+ [h.DataAttribute('toast-swipe-ignore', '')],
58
+ [description],
59
+ ),
60
+ ],
61
+ ),
45
62
  ],
46
63
  }),
47
64
  h.button(
@@ -9,8 +9,8 @@
9
9
  "test": "vitest run"
10
10
  },
11
11
  "dependencies": {
12
- "@effect/platform-browser": "4.0.0-rc.115",
13
- "effect": "4.0.0-rc.115",
12
+ "@effect/platform-browser": "4.0.0-rc.116",
13
+ "effect": "4.0.0-rc.116",
14
14
  "foldkit": "workspace:*"
15
15
  },
16
16
  "devDependencies": {
@@ -4,7 +4,7 @@ import { Document, Html, HtmlBuilder } from 'foldkit/html'
4
4
  import { defineMessageUnion } from 'foldkit/message'
5
5
  import { UrlRequest, load, pushUrl } from 'foldkit/navigation'
6
6
  import { Transition } from 'foldkit/route'
7
- import { evo } from 'foldkit/struct'
7
+ import { modifyFields } from 'foldkit/struct'
8
8
  import { Url, toString as urlToString } from 'foldkit/url'
9
9
 
10
10
  import { Artwork, artworks, findArtwork } from './artwork'
@@ -76,11 +76,11 @@ export const update = (model: Model, message: Message) =>
76
76
  }),
77
77
 
78
78
  ChangedUrl: ({ url }) => ({
79
- model: evo(model, { route: () => urlToAppRoute(url) }),
79
+ model: modifyFields(model, { route: () => urlToAppRoute(url) }),
80
80
  }),
81
81
 
82
82
  UpdatedFilterText: ({ filterText }) => ({
83
- model: evo(model, { filterText: () => filterText }),
83
+ model: modifyFields(model, { filterText: () => filterText }),
84
84
  }),
85
85
  })
86
86
 
@@ -9,9 +9,9 @@
9
9
  "test": "vitest run"
10
10
  },
11
11
  "dependencies": {
12
- "@effect/platform-browser": "4.0.0-rc.115",
12
+ "@effect/platform-browser": "4.0.0-rc.116",
13
13
  "@foldkit/ui": "workspace:*",
14
- "effect": "4.0.0-rc.115",
14
+ "effect": "4.0.0-rc.116",
15
15
  "foldkit": "workspace:*"
16
16
  },
17
17
  "devDependencies": {
@@ -3,7 +3,7 @@ import { HttpClient, HttpClientRequest } from 'effect/unstable/http'
3
3
  import { AsyncData, Command, Http, Runtime, type Update } from 'foldkit'
4
4
  import { Document, Html, HtmlBuilder } from 'foldkit/html'
5
5
  import { defineMessageUnion } from 'foldkit/message'
6
- import { evo } from 'foldkit/struct'
6
+ import { modifyFields } from 'foldkit/struct'
7
7
 
8
8
  import { Button, Input } from '@foldkit/ui'
9
9
 
@@ -42,7 +42,7 @@ export type Message = typeof Message.Type
42
42
  export const update = (model: Model, message: Message) =>
43
43
  Message.match<Update.Return<Model, Message>>(message, {
44
44
  UpdatedZipCodeInput: ({ value }) => ({
45
- model: evo(model, {
45
+ model: modifyFields(model, {
46
46
  zipCodeInput: () => value,
47
47
  }),
48
48
  }),
@@ -52,7 +52,7 @@ export const update = (model: Model, message: Message) =>
52
52
  return { model }
53
53
  }
54
54
  return {
55
- model: evo(model, {
55
+ model: modifyFields(model, {
56
56
  weather: () => WeatherAsyncData.Loading(),
57
57
  }),
58
58
  commands: [FetchWeather({ zipCode: model.zipCodeInput })],
@@ -60,13 +60,13 @@ export const update = (model: Model, message: Message) =>
60
60
  },
61
61
 
62
62
  SucceededFetchWeather: ({ weather }) => ({
63
- model: evo(model, {
63
+ model: modifyFields(model, {
64
64
  weather: () => WeatherAsyncData.Success({ data: weather }),
65
65
  }),
66
66
  }),
67
67
 
68
68
  FailedFetchWeather: ({ error }) => ({
69
- model: evo(model, {
69
+ model: modifyFields(model, {
70
70
  weather: () => WeatherAsyncData.Failure({ error }),
71
71
  }),
72
72
  }),
@@ -9,11 +9,11 @@
9
9
  "test": "vitest run"
10
10
  },
11
11
  "dependencies": {
12
- "@effect/platform-browser": "4.0.0-rc.115",
12
+ "@effect/platform-browser": "4.0.0-rc.116",
13
13
  "@foldkit/ui": "workspace:*",
14
14
  "@shoelace-style/shoelace": "^2.20.1",
15
15
  "clsx": "^2.1.1",
16
- "effect": "4.0.0-rc.115",
16
+ "effect": "4.0.0-rc.116",
17
17
  "foldkit": "workspace:*",
18
18
  "vanilla-colorful": "^0.7.2"
19
19
  },
@@ -3,7 +3,7 @@ import { Schema } from 'effect'
3
3
  import { CustomElement, Runtime, type Update } from 'foldkit'
4
4
  import { Document, Html, HtmlBuilder } from 'foldkit/html'
5
5
  import { defineMessageUnion } from 'foldkit/message'
6
- import { evo } from 'foldkit/struct'
6
+ import { modifyFields } from 'foldkit/struct'
7
7
  import 'vanilla-colorful/hex-color-picker.js'
8
8
 
9
9
  import { Button, Input } from '@foldkit/ui'
@@ -47,13 +47,13 @@ export const init: Runtime.ApplicationInit<Model, Message> = () => ({
47
47
  export const update = (model: Model, message: Message) =>
48
48
  Message.match<Update.Return<Model, Message>>(message, {
49
49
  UpdatedContent: ({ value }) => ({
50
- model: evo(model, { content: () => value }),
50
+ model: modifyFields(model, { content: () => value }),
51
51
  }),
52
52
  ChangedFillColor: ({ value }) => ({
53
- model: evo(model, { fillColor: () => value }),
53
+ model: modifyFields(model, { fillColor: () => value }),
54
54
  }),
55
55
  ChangedBackgroundColor: ({ value }) => ({
56
- model: evo(model, { backgroundColor: () => value }),
56
+ model: modifyFields(model, { backgroundColor: () => value }),
57
57
  }),
58
58
  })
59
59
 
@@ -9,9 +9,9 @@
9
9
  "test": "vitest run"
10
10
  },
11
11
  "dependencies": {
12
- "@effect/platform-browser": "4.0.0-rc.115",
12
+ "@effect/platform-browser": "4.0.0-rc.116",
13
13
  "@foldkit/ui": "workspace:*",
14
- "effect": "4.0.0-rc.115",
14
+ "effect": "4.0.0-rc.116",
15
15
  "foldkit": "workspace:*"
16
16
  },
17
17
  "devDependencies": {
@@ -20,7 +20,7 @@ import {
20
20
  import { Document, Html, HtmlBuilder } from 'foldkit/html'
21
21
  import { defineMessageUnion } from 'foldkit/message'
22
22
  import { defineTaggedUnion } from 'foldkit/schema'
23
- import { evo } from 'foldkit/struct'
23
+ import { modifyFields } from 'foldkit/struct'
24
24
 
25
25
  import { Button, Input } from '@foldkit/ui'
26
26
 
@@ -87,32 +87,32 @@ type UpdateReturn = Update.Return<Model, Message, ChatSocketService>
87
87
  export const update = (model: Model, message: Message) =>
88
88
  Message.match<UpdateReturn>(message, {
89
89
  ClickedConnect: () => ({
90
- model: evo(model, {
90
+ model: modifyFields(model, {
91
91
  connection: () => ConnectionState.Connecting(),
92
92
  }),
93
93
  }),
94
94
 
95
95
  Connected: () => ({
96
- model: evo(model, {
96
+ model: modifyFields(model, {
97
97
  connection: () => ConnectionState.Connected(),
98
98
  }),
99
99
  }),
100
100
 
101
101
  Disconnected: () => ({
102
- model: evo(model, {
102
+ model: modifyFields(model, {
103
103
  connection: () => ConnectionState.Disconnected(),
104
104
  messages: () => [],
105
105
  }),
106
106
  }),
107
107
 
108
108
  FailedConnect: ({ error }) => ({
109
- model: evo(model, {
109
+ model: modifyFields(model, {
110
110
  connection: () => ConnectionState.Error({ error }),
111
111
  }),
112
112
  }),
113
113
 
114
114
  UpdatedMessageInput: ({ value }) => ({
115
- model: evo(model, {
115
+ model: modifyFields(model, {
116
116
  messageInput: () => value,
117
117
  }),
118
118
  }),
@@ -127,7 +127,7 @@ export const update = (model: Model, message: Message) =>
127
127
  return Match.value(model.connection).pipe(
128
128
  Match.withReturnType<UpdateReturn>(),
129
129
  Match.tag('Connected', () => ({
130
- model: evo(model, {
130
+ model: modifyFields(model, {
131
131
  messageInput: () => '',
132
132
  }),
133
133
  commands: [SendMessage({ text: trimmedMessage })],
@@ -150,7 +150,7 @@ export const update = (model: Model, message: Message) =>
150
150
  const newMessage = ChatMessage.make({ text, zoned, isSent })
151
151
 
152
152
  return {
153
- model: evo(model, {
153
+ model: modifyFields(model, {
154
154
  messages: messages => [...messages, newMessage],
155
155
  }),
156
156
  }
@@ -12,7 +12,7 @@ import {
12
12
  text,
13
13
  type,
14
14
  } from 'foldkit/scene'
15
- import { evo } from 'foldkit/struct'
15
+ import { modifyFields } from 'foldkit/struct'
16
16
  import { describe, test } from 'vitest'
17
17
 
18
18
  import {
@@ -51,7 +51,11 @@ describe('view', () => {
51
51
  test('connecting state renders the Connecting message', () => {
52
52
  scene(
53
53
  { update, view },
54
- given(evo(idleModel, { connection: () => ConnectionState.Connecting() })),
54
+ given(
55
+ modifyFields(idleModel, {
56
+ connection: () => ConnectionState.Connecting(),
57
+ }),
58
+ ),
55
59
  expect(text('Connecting...')).toExist(),
56
60
  )
57
61
  })
@@ -59,7 +63,11 @@ describe('view', () => {
59
63
  test('connected state shows the message input and Send button', () => {
60
64
  scene(
61
65
  { update, view },
62
- given(evo(idleModel, { connection: () => ConnectionState.Connected() })),
66
+ given(
67
+ modifyFields(idleModel, {
68
+ connection: () => ConnectionState.Connected(),
69
+ }),
70
+ ),
63
71
  expect(placeholder('Type a message...')).toExist(),
64
72
  expect(role('button', { name: 'Send' })).toBeDisabled(),
65
73
  type(placeholder('Type a message...'), 'hi'),
@@ -71,7 +79,7 @@ describe('view', () => {
71
79
  scene(
72
80
  { update, view },
73
81
  given(
74
- evo(idleModel, {
82
+ modifyFields(idleModel, {
75
83
  connection: () =>
76
84
  ConnectionState.Error({
77
85
  error: 'Connection refused',
@@ -88,7 +96,7 @@ describe('view', () => {
88
96
  scene(
89
97
  { update, view },
90
98
  given(
91
- evo(idleModel, {
99
+ modifyFields(idleModel, {
92
100
  connection: () => ConnectionState.Connected(),
93
101
  messages: () => [
94
102
  { text: 'Hello there', zoned: zonedAt(0), isSent: true },
@@ -149,7 +157,11 @@ describe('view', () => {
149
157
  test('a message arriving on the socket Subscription lands in the conversation', () => {
150
158
  scene(
151
159
  { update, view },
152
- given(evo(idleModel, { connection: () => ConnectionState.Connected() })),
160
+ given(
161
+ modifyFields(idleModel, {
162
+ connection: () => ConnectionState.Connected(),
163
+ }),
164
+ ),
153
165
  Subscription.emit(Message.ReceivedMessage({ text: 'hello from echo' })),
154
166
  Command.expectExact(
155
167
  TimestampReceivedMessage({ text: 'hello from echo' }),
@@ -1,6 +1,6 @@
1
1
  import { DateTime } from 'effect'
2
2
  import { Command, given, message, model, story } from 'foldkit/story'
3
- import { evo } from 'foldkit/struct'
3
+ import { modifyFields } from 'foldkit/struct'
4
4
  import { describe, expect, test } from 'vitest'
5
5
 
6
6
  import {
@@ -19,7 +19,7 @@ const idleModel: Model = {
19
19
  messageInput: '',
20
20
  }
21
21
 
22
- const connectedModel: Model = evo(idleModel, {
22
+ const connectedModel: Model = modifyFields(idleModel, {
23
23
  connection: () => ConnectionState.Connected(),
24
24
  })
25
25
 
@@ -42,7 +42,9 @@ describe('update', () => {
42
42
  story(
43
43
  update,
44
44
  given(
45
- evo(idleModel, { connection: () => ConnectionState.Connecting() }),
45
+ modifyFields(idleModel, {
46
+ connection: () => ConnectionState.Connecting(),
47
+ }),
46
48
  ),
47
49
  message(Message.Connected()),
48
50
  model(model => {
@@ -55,7 +57,7 @@ describe('update', () => {
55
57
  story(
56
58
  update,
57
59
  given(
58
- evo(connectedModel, {
60
+ modifyFields(connectedModel, {
59
61
  messages: () => [{ text: 'old', zoned: zonedNow, isSent: true }],
60
62
  }),
61
63
  ),
@@ -71,7 +73,9 @@ describe('update', () => {
71
73
  story(
72
74
  update,
73
75
  given(
74
- evo(idleModel, { connection: () => ConnectionState.Connecting() }),
76
+ modifyFields(idleModel, {
77
+ connection: () => ConnectionState.Connecting(),
78
+ }),
75
79
  ),
76
80
  message(Message.FailedConnect({ error: 'Timeout' })),
77
81
  model(model => {
@@ -102,7 +106,7 @@ describe('update', () => {
102
106
  test('an empty input is ignored', () => {
103
107
  story(
104
108
  update,
105
- given(evo(connectedModel, { messageInput: () => '' })),
109
+ given(modifyFields(connectedModel, { messageInput: () => '' })),
106
110
  message(Message.SubmittedMessage()),
107
111
  Command.expectNone(),
108
112
  )
@@ -111,7 +115,7 @@ describe('update', () => {
111
115
  test('whitespace-only input is ignored', () => {
112
116
  story(
113
117
  update,
114
- given(evo(connectedModel, { messageInput: () => ' ' })),
118
+ given(modifyFields(connectedModel, { messageInput: () => ' ' })),
115
119
  message(Message.SubmittedMessage()),
116
120
  Command.expectNone(),
117
121
  )
@@ -120,7 +124,9 @@ describe('update', () => {
120
124
  test('connected client fires SendMessage and clears the input', () => {
121
125
  story(
122
126
  update,
123
- given(evo(connectedModel, { messageInput: () => 'Hello there' })),
127
+ given(
128
+ modifyFields(connectedModel, { messageInput: () => 'Hello there' }),
129
+ ),
124
130
  message(Message.SubmittedMessage()),
125
131
  model(model => {
126
132
  expect(model.messageInput).toBe('')
@@ -150,7 +156,7 @@ describe('update', () => {
150
156
  test('disconnected client ignores SubmittedMessage', () => {
151
157
  story(
152
158
  update,
153
- given(evo(idleModel, { messageInput: () => 'Hello' })),
159
+ given(modifyFields(idleModel, { messageInput: () => 'Hello' })),
154
160
  message(Message.SubmittedMessage()),
155
161
  Command.expectNone(),
156
162
  model(model => {
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "channel": "stable",
4
- "sourceCommit": "7a3180b90d4eff772fa22928f31009e7dda9ff8f",
4
+ "sourceCommit": "b415a3e22be572abb1785010e23bd3e57f2e24f2",
5
5
  "packages": {
6
- "create-foldkit-app": "0.35.1",
7
- "@foldkit/devtools": "0.161.0",
8
- "@foldkit/devtools-mcp": "0.21.0",
9
- "foldkit": "0.161.0",
10
- "@foldkit/markdown": "0.11.0",
11
- "@foldkit/oxlint-plugin": "0.14.0",
12
- "@foldkit/ui": "0.161.0",
13
- "@foldkit/vite-plugin": "0.23.0"
6
+ "create-foldkit-app": "0.35.2",
7
+ "@foldkit/devtools": "0.163.0",
8
+ "@foldkit/devtools-mcp": "0.22.0",
9
+ "foldkit": "0.163.0",
10
+ "@foldkit/markdown": "0.12.0",
11
+ "@foldkit/oxlint-plugin": "0.15.0",
12
+ "@foldkit/ui": "0.163.0",
13
+ "@foldkit/vite-plugin": "0.24.0"
14
14
  },
15
15
  "dependencies": {
16
- "@foldkit/devtools": "0.161.0",
17
- "@foldkit/vite-plugin": "0.23.0",
18
- "@foldkit/devtools-mcp": "0.21.0",
19
- "@foldkit/oxlint-plugin": "0.14.0",
16
+ "@foldkit/devtools": "0.163.0",
17
+ "@foldkit/vite-plugin": "0.24.0",
18
+ "@foldkit/devtools-mcp": "0.22.0",
19
+ "@foldkit/oxlint-plugin": "0.15.0",
20
20
  "@types/node": "^26.4.0",
21
21
  "happy-dom": "^20.11.13",
22
22
  "oxfmt": "^0.66.0",
@@ -3,7 +3,7 @@ import { Command, Runtime, type Update } from 'foldkit'
3
3
  import { type Document, type Html, type HtmlBuilder } from 'foldkit/html'
4
4
  import { defineMessageUnion } from 'foldkit/message'
5
5
  import { UrlRequest, load, pushUrl } from 'foldkit/navigation'
6
- import { evo } from 'foldkit/struct'
6
+ import { modifyFields } from 'foldkit/struct'
7
7
  import { Url, toString as urlToString } from 'foldkit/url'
8
8
 
9
9
  import { AppRoute, aboutRouter, homeRouter, urlToAppRoute } from './route'
@@ -57,7 +57,7 @@ type UpdateReturn = Update.Return<Model, Message>
57
57
  export const update = (model: Model, message: Message) =>
58
58
  Message.match<UpdateReturn>(message, {
59
59
  ClickedIncrement: () => ({
60
- model: evo(model, { count: count => count + 1 }),
60
+ model: modifyFields(model, { count: count => count + 1 }),
61
61
  }),
62
62
  ClickedLink: ({ request }) =>
63
63
  UrlRequest.match<UpdateReturn>(request, {
@@ -71,7 +71,7 @@ export const update = (model: Model, message: Message) =>
71
71
  }),
72
72
  }),
73
73
  ChangedUrl: ({ url }) => ({
74
- model: evo(model, { route: () => urlToAppRoute(url) }),
74
+ model: modifyFields(model, { route: () => urlToAppRoute(url) }),
75
75
  }),
76
76
  CompletedNavigateInternal: () => ({ model }),
77
77
  CompletedLoadExternal: () => ({ model }),
@@ -97,8 +97,8 @@ const makeHandler = Effect.gen(function* () {
97
97
  () => `http://localhost:${globalThis.String(port)}`,
98
98
  )
99
99
  const app = yield* loadFetchHandler
100
- // NOTE: `index` is unset so a directory request does not serve the raw
101
- // client `index.html` template. Page requests go through `fetch` instead.
100
+ // NOTE: directory requests reach `fetch` even when a generated index file
101
+ // exists. This host serves assets as files and renders pages at request time.
102
102
  const staticFiles = yield* HttpStaticServer.make({
103
103
  root: CLIENT_DIR,
104
104
  index: undefined,
@@ -2,7 +2,7 @@ import { Effect, Schema } from 'effect'
2
2
  import { Command, Runtime, type Update } from 'foldkit'
3
3
  import { type Document, type HtmlBuilder } from 'foldkit/html'
4
4
  import { defineMessageUnion } from 'foldkit/message'
5
- import { evo } from 'foldkit/struct'
5
+ import { modifyFields } from 'foldkit/struct'
6
6
 
7
7
  import { Button } from '@foldkit/ui'
8
8
 
@@ -43,14 +43,14 @@ export const update = (model: Model, message: Message) =>
43
43
  ClickedDecrement: () => {
44
44
  const nextCount = model.count - 1
45
45
  return {
46
- model: evo(model, { count: () => nextCount }),
46
+ model: modifyFields(model, { count: () => nextCount }),
47
47
  commands: [PersistCount({ count: nextCount })],
48
48
  }
49
49
  },
50
50
  ClickedIncrement: () => {
51
51
  const nextCount = model.count + 1
52
52
  return {
53
- model: evo(model, { count: () => nextCount }),
53
+ model: modifyFields(model, { count: () => nextCount }),
54
54
  commands: [PersistCount({ count: nextCount })],
55
55
  }
56
56
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-foldkit-app",
3
- "version": "0.35.1",
3
+ "version": "0.35.2",
4
4
  "description": "Create Foldkit applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -11,15 +11,15 @@
11
11
  "dist"
12
12
  ],
13
13
  "dependencies": {
14
- "@effect/platform-node": "4.0.0-rc.115",
15
- "@effect/platform-node-shared": "4.0.0-rc.115",
14
+ "@effect/platform-node": "4.0.0-rc.116",
15
+ "@effect/platform-node-shared": "4.0.0-rc.116",
16
16
  "chalk": "^6.0.0",
17
- "effect": "4.0.0-rc.115",
17
+ "effect": "4.0.0-rc.116",
18
18
  "rimraf": "^6.1.3",
19
19
  "typescript": "^7.0.2"
20
20
  },
21
21
  "devDependencies": {
22
- "@effect/vitest": "4.0.0-rc.115",
22
+ "@effect/vitest": "4.0.0-rc.116",
23
23
  "@types/node": "^26.4.0",
24
24
  "vitest": "^5.0.0"
25
25
  },